Skip to content
GitLab
Menu
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
470a46f8
Commit
470a46f8
authored
Feb 17, 2016
by
Don Gagne
Browse files
Land items default to 0 altitude
parent
4f0562b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/FirmwarePlugin/APM/MavCmdInfoCommon.json
View file @
470a46f8
...
...
@@ -33,7 +33,13 @@
"description"
:
"Land using VTOL mode."
,
"specifiesCoordinate"
:
true
,
"friendlyEdit"
:
true
,
"category"
:
"VTOL"
"category"
:
"VTOL"
,
"param7"
:
{
"label"
:
"Altitude:"
,
"units"
:
"meters"
,
"default"
:
0.0
,
"decimalPlaces"
:
2
}
}
]
}
src/MissionManager/MavCmdInfoCommon.json
View file @
470a46f8
...
...
@@ -120,6 +120,12 @@
"units"
:
"radians"
,
"default"
:
0.0
,
"decimalPlaces"
:
2
},
"param7"
:
{
"label"
:
"Altitude:"
,
"units"
:
"meters"
,
"default"
:
0.0
,
"decimalPlaces"
:
2
}
},
{
...
...
@@ -290,6 +296,12 @@
"units"
:
"degrees"
,
"default"
:
0.0
,
"decimalPlaces"
:
2
},
"param7"
:
{
"label"
:
"Altitude:"
,
"units"
:
"meters"
,
"default"
:
0.0
,
"decimalPlaces"
:
2
}
},
{
...
...
src/MissionManager/MissionItem.cc
View file @
470a46f8
...
...
@@ -329,7 +329,7 @@ void MissionItem::_setupMetaData(void)
if
(
!
_altitudeMetaData
)
{
_altitudeMetaData
=
new
FactMetaData
(
FactMetaData
::
valueTypeDouble
);
_altitudeMetaData
->
setRawUnits
(
"meters"
);
_altitudeMetaData
->
setDecimalPlaces
(
3
);
_altitudeMetaData
->
setDecimalPlaces
(
2
);
enumStrings
.
clear
();
enumValues
.
clear
();
...
...
@@ -620,6 +620,7 @@ QmlObjectListModel* MissionItem::textFieldFacts(void)
Fact
*
rgParamFacts
[
7
]
=
{
&
_param1Fact
,
&
_param2Fact
,
&
_param3Fact
,
&
_param4Fact
,
&
_param5Fact
,
&
_param6Fact
,
&
_param7Fact
};
FactMetaData
*
rgParamMetaData
[
7
]
=
{
&
_param1MetaData
,
&
_param2MetaData
,
&
_param3MetaData
,
&
_param4MetaData
,
&
_param5MetaData
,
&
_param6MetaData
,
&
_param7MetaData
};
bool
altitudeAdded
=
false
;
for
(
int
i
=
1
;
i
<=
7
;
i
++
)
{
const
QMap
<
int
,
MavCmdParamInfo
*>&
paramInfoMap
=
_missionCommands
->
getMavCmdInfo
(
command
,
_vehicle
)
->
paramInfoMap
();
...
...
@@ -634,10 +635,14 @@ QmlObjectListModel* MissionItem::textFieldFacts(void)
paramMetaData
->
setRawUnits
(
paramInfo
->
units
());
paramFact
->
setMetaData
(
paramMetaData
);
model
->
append
(
paramFact
);
if
(
i
==
7
)
{
altitudeAdded
=
true
;
}
}
}
if
(
specifiesCoordinate
())
{
if
(
specifiesCoordinate
()
&&
!
altitudeAdded
)
{
_param7Fact
.
_setName
(
"Altitude:"
);
_param7Fact
.
setMetaData
(
_altitudeMetaData
);
model
->
append
(
&
_param7Fact
);
...
...
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