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
a2a82f30
Commit
a2a82f30
authored
Nov 08, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump survey complex item version to 5
parent
8144d1f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
SurveyComplexItem.cc
src/MissionManager/SurveyComplexItem.cc
+15
-7
SurveyComplexItem.h
src/MissionManager/SurveyComplexItem.h
+1
-1
No files found.
src/MissionManager/SurveyComplexItem.cc
View file @
a2a82f30
...
...
@@ -110,7 +110,7 @@ void SurveyComplexItem::save(QJsonArray& planItems)
_save
(
saveObject
);
saveObject
[
JsonHelper
::
jsonVersionKey
]
=
4
;
saveObject
[
JsonHelper
::
jsonVersionKey
]
=
5
;
saveObject
[
VisualMissionItem
::
jsonTypeKey
]
=
VisualMissionItem
::
jsonTypeComplexItemValue
;
saveObject
[
ComplexMissionItem
::
jsonComplexItemTypeKey
]
=
jsonComplexItemTypeValue
;
saveObject
[
_jsonGridAngleKey
]
=
_gridAngleFact
.
rawValue
().
toDouble
();
...
...
@@ -135,13 +135,13 @@ bool SurveyComplexItem::load(const QJsonObject& complexObject, int sequenceNumbe
}
int
version
=
complexObject
[
JsonHelper
::
jsonVersionKey
].
toInt
();
if
(
version
<
2
||
version
>
4
)
{
if
(
version
<
2
||
version
>
5
)
{
errorString
=
tr
(
"Survey items do not support version %1"
).
arg
(
version
);
return
false
;
}
if
(
version
==
4
)
{
if
(
!
_loadV4
(
complexObject
,
sequenceNumber
,
errorString
))
{
if
(
version
==
4
||
version
==
5
)
{
if
(
!
_loadV4
V5
(
complexObject
,
sequenceNumber
,
errorString
,
version
))
{
return
false
;
}
}
else
{
...
...
@@ -164,7 +164,7 @@ bool SurveyComplexItem::load(const QJsonObject& complexObject, int sequenceNumbe
return
true
;
}
bool
SurveyComplexItem
::
_loadV4
(
const
QJsonObject
&
complexObject
,
int
sequenceNumber
,
QString
&
errorString
)
bool
SurveyComplexItem
::
_loadV4
V5
(
const
QJsonObject
&
complexObject
,
int
sequenceNumber
,
QString
&
errorString
,
int
version
)
{
QList
<
JsonHelper
::
KeyValidateInfo
>
keyInfoList
=
{
{
VisualMissionItem
::
jsonTypeKey
,
QJsonValue
::
String
,
true
},
...
...
@@ -172,8 +172,13 @@ bool SurveyComplexItem::_loadV4(const QJsonObject& complexObject, int sequenceNu
{
_jsonEntryPointKey
,
QJsonValue
::
Double
,
true
},
{
_jsonGridAngleKey
,
QJsonValue
::
Double
,
true
},
{
_jsonFlyAlternateTransectsKey
,
QJsonValue
::
Bool
,
false
},
{
_jsonSplitConcavePolygonsKey
,
QJsonValue
::
Bool
,
false
},
};
if
(
version
==
5
)
{
JsonHelper
::
KeyValidateInfo
jSplitPolygon
=
{
_jsonSplitConcavePolygonsKey
,
QJsonValue
::
Bool
,
true
};
keyInfoList
.
append
(
jSplitPolygon
);
}
if
(
!
JsonHelper
::
validateKeys
(
complexObject
,
keyInfoList
,
errorString
))
{
return
false
;
}
...
...
@@ -201,7 +206,10 @@ bool SurveyComplexItem::_loadV4(const QJsonObject& complexObject, int sequenceNu
_gridAngleFact
.
setRawValue
(
complexObject
[
_jsonGridAngleKey
].
toDouble
());
_flyAlternateTransectsFact
.
setRawValue
(
complexObject
[
_jsonFlyAlternateTransectsKey
].
toBool
(
false
));
_splitConcavePolygonsFact
.
setRawValue
(
complexObject
[
_jsonSplitConcavePolygonsKey
].
toBool
(
true
));
if
(
version
==
5
)
{
_splitConcavePolygonsFact
.
setRawValue
(
complexObject
[
_jsonSplitConcavePolygonsKey
].
toBool
(
true
));
}
_entryPoint
=
complexObject
[
_jsonEntryPointKey
].
toInt
();
...
...
src/MissionManager/SurveyComplexItem.h
View file @
a2a82f30
...
...
@@ -112,7 +112,7 @@ private:
double
_turnaroundDistance
(
void
)
const
;
bool
_hoverAndCaptureEnabled
(
void
)
const
;
bool
_loadV3
(
const
QJsonObject
&
complexObject
,
int
sequenceNumber
,
QString
&
errorString
);
bool
_loadV4
(
const
QJsonObject
&
complexObject
,
int
sequenceNumber
,
QString
&
errorString
);
bool
_loadV4
V5
(
const
QJsonObject
&
complexObject
,
int
sequenceNumber
,
QString
&
errorString
,
int
version
);
void
_rebuildTransectsPhase1Worker
(
bool
refly
);
void
_rebuildTransectsPhase1WorkerSinglePolygon
(
bool
refly
);
void
_rebuildTransectsPhase1WorkerSplitPolygons
(
bool
refly
);
...
...
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