Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
65aa662a
Commit
65aa662a
authored
Aug 23, 2015
by
Don Gagne
Browse files
Merge pull request #1791 from DonLakeFlyer/ParamReset
Param reset
parents
9a2774f7
c3d7b15a
Changes
5
Show whitespace changes
Inline
Side-by-side
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
...
...
@@ -64,6 +64,9 @@ public:
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
.
RightToLeft
width
:
parent
.
width
QGCButton
{
text
:
"
Clear RC to Param
"
onClicked
:
controller
.
clearRCToParam
()
id
:
toolsButton
anchors.right
:
parent
.
right
text
:
"
Tools
"
menu
:
Menu
{
MenuItem
{
text
:
"
Refresh
"
onTriggered
:
controller
.
refresh
()
}
QGCButton
{
text
:
"
Save to file
"
visible
:
fullMode
onClicked
:
controller
.
saveToFile
()
MenuItem
{
text
:
"
Reset all to defaults
"
onTriggered
:
controller
.
resetAllToDefaults
()
}
QGCButton
{
MenuSeparator
{
}
MenuItem
{
text
:
"
Load from file
"
visible
:
fullMode
onClicked
:
controller
.
loadFromFile
()
onTriggered
:
controller
.
loadFromFile
()
}
MenuItem
{
text
:
"
Save to file
"
visible
:
fullMode
onTriggered
:
controller
.
saveToFile
()
}
MenuSeparator
{
}
MenuItem
{
text
:
"
Clear RC to Param
"
onTriggered
:
controller
.
clearRCToParam
()
}
QGCButton
{
id
:
firstButton
text
:
"
Refresh
"
onClicked
:
controller
.
refresh
()
}
}
}
...
...
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
Supports
Markdown
0%
Try again
or
attach a new 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