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
825ba9e4
Commit
825ba9e4
authored
Mar 23, 2018
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix v1/v2 load semantics
parent
cf237be6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletion
+18
-1
FixedWingLandingComplexItem.cc
src/MissionManager/FixedWingLandingComplexItem.cc
+18
-1
No files found.
src/MissionManager/FixedWingLandingComplexItem.cc
View file @
825ba9e4
...
...
@@ -166,6 +166,14 @@ bool FixedWingLandingComplexItem::load(const QJsonObject& complexObject, int seq
int
version
=
complexObject
[
JsonHelper
::
jsonVersionKey
].
toInt
();
if
(
version
==
1
)
{
QList
<
JsonHelper
::
KeyValidateInfo
>
v1KeyInfoList
=
{
{
_jsonLoiterAltitudeRelativeKey
,
QJsonValue
::
Bool
,
true
},
{
_jsonLandingAltitudeRelativeKey
,
QJsonValue
::
Bool
,
true
},
};
if
(
!
JsonHelper
::
validateKeys
(
complexObject
,
v1KeyInfoList
,
errorString
))
{
return
false
;
}
bool
loiterAltitudeRelative
=
complexObject
[
_jsonLoiterAltitudeRelativeKey
].
toBool
();
bool
landingAltitudeRelative
=
complexObject
[
_jsonLandingAltitudeRelativeKey
].
toBool
();
if
(
loiterAltitudeRelative
!=
landingAltitudeRelative
)
{
...
...
@@ -176,13 +184,19 @@ bool FixedWingLandingComplexItem::load(const QJsonObject& complexObject, int seq
}
else
{
_altitudesAreRelative
=
loiterAltitudeRelative
;
}
_valueSetIsDistance
=
true
;
}
else
if
(
version
==
2
)
{
QList
<
JsonHelper
::
KeyValidateInfo
>
v2KeyInfoList
=
{
{
_jsonAltitudesAreRelativeKey
,
QJsonValue
::
Bool
,
true
},
{
_jsonValueSetIsDistanceKey
,
QJsonValue
::
Bool
,
true
},
};
if
(
!
JsonHelper
::
validateKeys
(
complexObject
,
v2KeyInfoList
,
errorString
))
{
_ignoreRecalcSignals
=
false
;
return
false
;
}
_altitudesAreRelative
=
complexObject
[
_jsonAltitudesAreRelativeKey
].
toBool
();
_valueSetIsDistance
=
complexObject
[
_jsonValueSetIsDistanceKey
].
toBool
();
}
else
{
errorString
=
tr
(
"%1 complex item version %2 not supported"
).
arg
(
jsonComplexItemTypeValue
).
arg
(
version
);
_ignoreRecalcSignals
=
false
;
...
...
@@ -204,7 +218,8 @@ bool FixedWingLandingComplexItem::load(const QJsonObject& complexObject, int seq
_loiterRadiusFact
.
setRawValue
(
complexObject
[
_jsonLoiterRadiusKey
].
toDouble
());
_loiterClockwise
=
complexObject
[
_jsonLoiterClockwiseKey
].
toBool
();
_altitudesAreRelative
=
complexObject
[
_jsonAltitudesAreRelativeKey
].
toBool
();
_calcGlideSlope
();
_landingCoordSet
=
true
;
...
...
@@ -328,6 +343,8 @@ bool FixedWingLandingComplexItem::scanForItem(QmlObjectListModel* visualItems, V
complexItem
->
_landingCoordinate
.
setLongitude
(
missionItemLand
.
param6
());
complexItem
->
_landingAltitudeFact
.
setRawValue
(
missionItemLand
.
param7
());
complexItem
->
_calcGlideSlope
();
complexItem
->
_landingCoordSet
=
true
;
complexItem
->
_ignoreRecalcSignals
=
false
;
...
...
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