Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
65aa662a
Commit
65aa662a
authored
Aug 23, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1791 from DonLakeFlyer/ParamReset
Param reset
parents
9a2774f7
c3d7b15a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
23 deletions
+49
-23
AutoPilotPlugin.cc
src/AutoPilotPlugins/AutoPilotPlugin.cc
+9
-0
AutoPilotPlugin.h
src/AutoPilotPlugins/AutoPilotPlugin.h
+3
-0
ParameterEditor.qml
src/QmlControls/ParameterEditor.qml
+30
-23
ParameterEditorController.cc
src/QmlControls/ParameterEditorController.cc
+6
-0
ParameterEditorController.h
src/QmlControls/ParameterEditorController.h
+1
-0
No files found.
src/AutoPilotPlugins/AutoPilotPlugin.cc
View file @
65aa662a
...
...
@@ -97,6 +97,15 @@ bool AutoPilotPlugin::setupComplete(void)
return
_setupComplete
;
}
void
AutoPilotPlugin
::
resetAllParametersToDefaults
(
void
)
{
mavlink_message_t
msg
;
MAVLinkProtocol
*
mavlink
=
MAVLinkProtocol
::
instance
();
mavlink_msg_command_long_pack
(
mavlink
->
getSystemId
(),
mavlink
->
getComponentId
(),
&
msg
,
_uas
->
getUASID
(),
0
,
MAV_CMD_PREFLIGHT_STORAGE
,
0
,
2
,
-
1
,
0
,
0
,
0
,
0
,
0
);
_uas
->
sendMessage
(
msg
);
}
void
AutoPilotPlugin
::
refreshAllParameters
(
void
)
{
_getParameterLoader
()
->
refreshAllParameters
();
...
...
src/AutoPilotPlugins/AutoPilotPlugin.h
View file @
65aa662a
...
...
@@ -63,6 +63,9 @@ public:
Q_PROPERTY
(
bool
setupComplete
READ
setupComplete
NOTIFY
setupCompleteChanged
)
Q_PROPERTY
(
bool
armed
READ
armed
NOTIFY
armedChanged
)
/// Reset all parameters to their default values
Q_INVOKABLE
void
resetAllParametersToDefaults
(
void
);
/// Re-request the full set of parameters from the autopilot
Q_INVOKABLE
void
refreshAllParameters
(
void
);
...
...
src/QmlControls/ParameterEditor.qml
View file @
65aa662a
...
...
@@ -152,7 +152,7 @@ QGCView {
Item
{
width
:
parent
.
width
height
:
first
Button
.
height
height
:
tools
Button
.
height
QGCLabel
{
font.pixelSize
:
ScreenTools
.
largeFontPixelSize
...
...
@@ -160,29 +160,36 @@ QGCView {
text
:
"
PARAMETER EDITOR
"
}
Row
{
spacing
:
10
layoutDirection
:
Qt
.
RightToLef
t
width
:
parent
.
width
QGCButton
{
id
:
toolsButton
anchors.right
:
parent
.
righ
t
text
:
"
Tools
"
QGCButton
{
text
:
"
Clear RC to Param
"
onClicked
:
controller
.
clearRCToParam
()
}
QGCButton
{
text
:
"
Save to file
"
visible
:
fullMode
onClicked
:
controller
.
saveToFile
()
}
QGCButton
{
text
:
"
Load from file
"
visible
:
fullMode
onClicked
:
controller
.
loadFromFile
()
}
QGCButton
{
id
:
firstButton
text
:
"
Refresh
"
onClicked
:
controller
.
refresh
()
menu
:
Menu
{
MenuItem
{
text
:
"
Refresh
"
onTriggered
:
controller
.
refresh
()
}
MenuItem
{
text
:
"
Reset all to defaults
"
onTriggered
:
controller
.
resetAllToDefaults
()
}
MenuSeparator
{
}
MenuItem
{
text
:
"
Load from file
"
visible
:
fullMode
onTriggered
:
controller
.
loadFromFile
()
}
MenuItem
{
text
:
"
Save to file
"
visible
:
fullMode
onTriggered
:
controller
.
saveToFile
()
}
MenuSeparator
{
}
MenuItem
{
text
:
"
Clear RC to Param
"
onTriggered
:
controller
.
clearRCToParam
()
}
}
}
}
...
...
src/QmlControls/ParameterEditorController.cc
View file @
65aa662a
...
...
@@ -128,6 +128,12 @@ void ParameterEditorController::refresh(void)
_autopilot
->
refreshAllParameters
();
}
void
ParameterEditorController
::
resetAllToDefaults
(
void
)
{
_autopilot
->
resetAllParametersToDefaults
();
refresh
();
}
void
ParameterEditorController
::
setRCToParam
(
const
QString
&
paramName
)
{
Q_ASSERT
(
_uas
);
...
...
src/QmlControls/ParameterEditorController.h
View file @
65aa662a
...
...
@@ -51,6 +51,7 @@ public:
Q_INVOKABLE
void
saveToFile
(
void
);
Q_INVOKABLE
void
loadFromFile
(
void
);
Q_INVOKABLE
void
refresh
(
void
);
Q_INVOKABLE
void
resetAllToDefaults
(
void
);
Q_INVOKABLE
void
setRCToParam
(
const
QString
&
paramName
);
QList
<
QObject
*>
model
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment