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
f1579b91
Commit
f1579b91
authored
May 26, 2018
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test alt mode resets
parent
c62a279b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
TransectStyleComplexItem.cc
src/MissionManager/TransectStyleComplexItem.cc
+1
-1
TransectStyleComplexItemTest.cc
src/MissionManager/TransectStyleComplexItemTest.cc
+24
-0
TransectStyleComplexItemTest.h
src/MissionManager/TransectStyleComplexItemTest.h
+1
-0
No files found.
src/MissionManager/TransectStyleComplexItem.cc
View file @
f1579b91
...
...
@@ -712,8 +712,8 @@ bool TransectStyleComplexItem::exitCoordinateHasRelativeAltitude(void) const
void
TransectStyleComplexItem
::
_followTerrainChanged
(
bool
followTerrain
)
{
_cameraCalc
.
setDistanceToSurfaceRelative
(
!
followTerrain
);
if
(
followTerrain
)
{
_cameraCalc
.
setDistanceToSurfaceRelative
(
false
);
_refly90DegreesFact
.
setRawValue
(
false
);
_hoverAndCaptureFact
.
setRawValue
(
false
);
}
...
...
src/MissionManager/TransectStyleComplexItemTest.cc
View file @
f1579b91
...
...
@@ -167,6 +167,30 @@ void TransectStyleComplexItemTest::_adjustSurveAreaPolygon(void)
_transectStyleItem
->
surveyAreaPolygon
()
->
adjustVertex
(
0
,
vertex
);
}
void
TransectStyleComplexItemTest
::
_testAltMode
(
void
)
{
// Default should be relative
QVERIFY
(
_transectStyleItem
->
cameraCalc
()
->
distanceToSurfaceRelative
());
// Manual camera allows non-relative altitudes, validate that changing back to known
// camera switches back to relative
_transectStyleItem
->
cameraCalc
()
->
cameraName
()
->
setRawValue
(
_transectStyleItem
->
cameraCalc
()
->
manualCameraName
());
_transectStyleItem
->
cameraCalc
()
->
setDistanceToSurfaceRelative
(
false
);
_transectStyleItem
->
cameraCalc
()
->
cameraName
()
->
setRawValue
(
_transectStyleItem
->
cameraCalc
()
->
customCameraName
());
QVERIFY
(
_transectStyleItem
->
cameraCalc
()
->
distanceToSurfaceRelative
());
// When you turn off terrain following mode make sure that the altitude mode changed back to relative altitudes
_transectStyleItem
->
cameraCalc
()
->
setDistanceToSurfaceRelative
(
false
);
_transectStyleItem
->
setFollowTerrain
(
true
);
QVERIFY
(
!
_transectStyleItem
->
cameraCalc
()
->
distanceToSurfaceRelative
());
QVERIFY
(
_transectStyleItem
->
followTerrain
());
_transectStyleItem
->
setFollowTerrain
(
false
);
QVERIFY
(
_transectStyleItem
->
cameraCalc
()
->
distanceToSurfaceRelative
());
QVERIFY
(
!
_transectStyleItem
->
followTerrain
());
}
TransectStyleItem
::
TransectStyleItem
(
Vehicle
*
vehicle
,
QObject
*
parent
)
:
TransectStyleComplexItem
(
vehicle
,
false
/* flyView */
,
QStringLiteral
(
"UnitTestTransect"
),
parent
)
,
rebuildTransectsCalled
(
false
)
...
...
src/MissionManager/TransectStyleComplexItemTest.h
View file @
f1579b91
...
...
@@ -32,6 +32,7 @@ private slots:
void
_testDirty
(
void
);
void
_testRebuildTransects
(
void
);
void
_testDistanceSignalling
(
void
);
void
_testAltMode
(
void
);
private:
void
_setSurveyAreaPolygon
(
void
);
...
...
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