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
e678bc34
Unverified
Commit
e678bc34
authored
Sep 05, 2020
by
Don Gagne
Committed by
GitHub
Sep 05, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store terrain follow flight speed in Plan file to prevent recalcs on load (#9056)
parent
20233502
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
TransectStyleComplexItem.cc
src/MissionManager/TransectStyleComplexItem.cc
+15
-8
TransectStyleComplexItem.h
src/MissionManager/TransectStyleComplexItem.h
+2
-1
No files found.
src/MissionManager/TransectStyleComplexItem.cc
View file @
e678bc34
...
...
@@ -36,7 +36,8 @@ const char* TransectStyleComplexItem::_jsonTransectStyleComplexItemKey = "Tra
const
char
*
TransectStyleComplexItem
::
_jsonCameraCalcKey
=
"CameraCalc"
;
const
char
*
TransectStyleComplexItem
::
_jsonVisualTransectPointsKey
=
"VisualTransectPoints"
;
const
char
*
TransectStyleComplexItem
::
_jsonItemsKey
=
"Items"
;
const
char
*
TransectStyleComplexItem
::
_jsonFollowTerrainKey
=
"FollowTerrain"
;
const
char
*
TransectStyleComplexItem
::
_jsonTerrainFollowKey
=
"FollowTerrain"
;
const
char
*
TransectStyleComplexItem
::
_jsonTerrainFlightSpeed
=
"TerrainFlightSpeed"
;
const
char
*
TransectStyleComplexItem
::
_jsonCameraShotsKey
=
"CameraShots"
;
TransectStyleComplexItem
::
TransectStyleComplexItem
(
PlanMasterController
*
masterController
,
bool
flyView
,
QString
settingsGroup
,
QObject
*
parent
)
...
...
@@ -149,13 +150,14 @@ void TransectStyleComplexItem::_save(QJsonObject& complexObject)
innerObject
[
cameraTriggerInTurnAroundName
]
=
_cameraTriggerInTurnAroundFact
.
rawValue
().
toBool
();
innerObject
[
hoverAndCaptureName
]
=
_hoverAndCaptureFact
.
rawValue
().
toBool
();
innerObject
[
refly90DegreesName
]
=
_refly90DegreesFact
.
rawValue
().
toBool
();
innerObject
[
_json
FollowTerrain
Key
]
=
_followTerrain
;
innerObject
[
_json
TerrainFollow
Key
]
=
_followTerrain
;
innerObject
[
_jsonCameraShotsKey
]
=
_cameraShots
;
if
(
_followTerrain
)
{
innerObject
[
terrainAdjustToleranceName
]
=
_terrainAdjustToleranceFact
.
rawValue
().
toDouble
();
innerObject
[
terrainAdjustMaxClimbRateName
]
=
_terrainAdjustMaxClimbRateFact
.
rawValue
().
toDouble
();
innerObject
[
terrainAdjustMaxDescentRateName
]
=
_terrainAdjustMaxDescentRateFact
.
rawValue
().
toDouble
();
innerObject
[
terrainAdjustToleranceName
]
=
_terrainAdjustToleranceFact
.
rawValue
().
toDouble
();
innerObject
[
terrainAdjustMaxClimbRateName
]
=
_terrainAdjustMaxClimbRateFact
.
rawValue
().
toDouble
();
innerObject
[
terrainAdjustMaxDescentRateName
]
=
_terrainAdjustMaxDescentRateFact
.
rawValue
().
toDouble
();
innerObject
[
_jsonTerrainFlightSpeed
]
=
_vehicleSpeed
;
}
QJsonObject
cameraCalcObject
;
...
...
@@ -222,8 +224,8 @@ bool TransectStyleComplexItem::_load(const QJsonObject& complexObject, bool forP
{
_jsonCameraCalcKey
,
QJsonValue
::
Object
,
true
},
{
_jsonVisualTransectPointsKey
,
QJsonValue
::
Array
,
!
forPresets
},
{
_jsonItemsKey
,
QJsonValue
::
Array
,
!
forPresets
},
{
_json
FollowTerrain
Key
,
QJsonValue
::
Bool
,
true
},
{
_jsonCameraShotsKey
,
QJsonValue
::
Double
,
false
},
// Not required since it was missing from initial implementation
{
_json
TerrainFollow
Key
,
QJsonValue
::
Bool
,
true
},
{
_jsonCameraShotsKey
,
QJsonValue
::
Double
,
false
},
// Not required since it was missing from initial implementation
};
if
(
!
JsonHelper
::
validateKeys
(
innerObject
,
innerKeyInfoList
,
errorString
))
{
return
false
;
...
...
@@ -262,7 +264,7 @@ bool TransectStyleComplexItem::_load(const QJsonObject& complexObject, bool forP
_cameraTriggerInTurnAroundFact
.
setRawValue
(
innerObject
[
cameraTriggerInTurnAroundName
].
toBool
());
_hoverAndCaptureFact
.
setRawValue
(
innerObject
[
hoverAndCaptureName
].
toBool
());
_refly90DegreesFact
.
setRawValue
(
innerObject
[
refly90DegreesName
].
toBool
());
_followTerrain
=
innerObject
[
_json
FollowTerrain
Key
].
toBool
();
_followTerrain
=
innerObject
[
_json
TerrainFollow
Key
].
toBool
();
// These two keys where not included in initial implementation so they are optional. Without them the values will be
// incorrect when loaded though.
...
...
@@ -275,6 +277,7 @@ bool TransectStyleComplexItem::_load(const QJsonObject& complexObject, bool forP
{
terrainAdjustToleranceName
,
QJsonValue
::
Double
,
true
},
{
terrainAdjustMaxClimbRateName
,
QJsonValue
::
Double
,
true
},
{
terrainAdjustMaxDescentRateName
,
QJsonValue
::
Double
,
true
},
{
_jsonTerrainFlightSpeed
,
QJsonValue
::
Double
,
false
},
// Not required since it was missing from initial implementation
};
if
(
!
JsonHelper
::
validateKeys
(
innerObject
,
followTerrainKeyInfoList
,
errorString
))
{
return
false
;
...
...
@@ -283,6 +286,9 @@ bool TransectStyleComplexItem::_load(const QJsonObject& complexObject, bool forP
_terrainAdjustToleranceFact
.
setRawValue
(
innerObject
[
terrainAdjustToleranceName
].
toDouble
());
_terrainAdjustMaxClimbRateFact
.
setRawValue
(
innerObject
[
terrainAdjustMaxClimbRateName
].
toDouble
());
_terrainAdjustMaxDescentRateFact
.
setRawValue
(
innerObject
[
terrainAdjustMaxDescentRateName
].
toDouble
());
if
(
innerObject
.
contains
(
_jsonTerrainFlightSpeed
))
{
_vehicleSpeed
=
innerObject
[
_jsonTerrainFlightSpeed
].
toDouble
();
}
if
(
!
forPresets
)
{
// We have to grovel through mission items to determine min/max alt
...
...
@@ -622,6 +628,7 @@ TransectStyleComplexItem::ReadyForSaveState TransectStyleComplexItem::readyForSa
terrainReady
=
true
;
}
bool
polygonNotReady
=
!
_surveyAreaPolygon
.
isValid
();
qDebug
()
<<
polygonNotReady
<<
_wizardMode
<<
terrainReady
;
return
(
polygonNotReady
||
_wizardMode
)
?
NotReadyForSaveData
:
(
terrainReady
?
ReadyForSave
:
NotReadyForSaveTerrain
);
...
...
src/MissionManager/TransectStyleComplexItem.h
View file @
e678bc34
...
...
@@ -208,7 +208,8 @@ protected:
static
const
char
*
_jsonTransectStyleComplexItemKey
;
static
const
char
*
_jsonVisualTransectPointsKey
;
static
const
char
*
_jsonItemsKey
;
static
const
char
*
_jsonFollowTerrainKey
;
static
const
char
*
_jsonTerrainFollowKey
;
static
const
char
*
_jsonTerrainFlightSpeed
;
static
const
char
*
_jsonCameraShotsKey
;
static
const
int
_terrainQueryTimeoutMsecs
=
1000
;
...
...
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