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
4ab73ba5
Commit
4ab73ba5
authored
Jun 27, 2017
by
Don Gagne
Committed by
GitHub
Jun 27, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5343 from DonLakeFlyer/AltRelativeFixes
Fixes for relative altitude signalling
parents
25c19fb6
36377fa7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
18 deletions
+24
-18
MissionSettingsItem.h
src/MissionManager/MissionSettingsItem.h
+2
-2
SimpleMissionItem.cc
src/MissionManager/SimpleMissionItem.cc
+2
-0
SimpleMissionItemTest.cc
src/MissionManager/SimpleMissionItemTest.cc
+10
-8
SimpleMissionItemTest.h
src/MissionManager/SimpleMissionItemTest.h
+9
-7
VisualMissionItem.h
src/MissionManager/VisualMissionItem.h
+1
-1
No files found.
src/MissionManager/MissionSettingsItem.h
View file @
4ab73ba5
...
...
@@ -74,8 +74,8 @@ public:
void
applyNewAltitude
(
double
newAltitude
)
final
{
Q_UNUSED
(
newAltitude
);
/* no action */
}
double
specifiedFlightSpeed
(
void
)
final
;
bool
coordinateHasRelativeAltitude
(
void
)
const
final
{
return
tru
e
;
}
bool
exitCoordinateHasRelativeAltitude
(
void
)
const
final
{
return
tru
e
;
}
bool
coordinateHasRelativeAltitude
(
void
)
const
final
{
return
fals
e
;
}
bool
exitCoordinateHasRelativeAltitude
(
void
)
const
final
{
return
fals
e
;
}
bool
exitCoordinateSameAsEntry
(
void
)
const
final
{
return
true
;
}
void
setDirty
(
bool
dirty
)
final
;
...
...
src/MissionManager/SimpleMissionItem.cc
View file @
4ab73ba5
...
...
@@ -604,6 +604,7 @@ void SimpleMissionItem::_syncAltitudeRelativeToHomeToFrame(const QVariant& value
if
(
!
_syncingAltitudeRelativeToHomeAndFrame
)
{
_syncingAltitudeRelativeToHomeAndFrame
=
true
;
_missionItem
.
setFrame
(
value
.
toBool
()
?
MAV_FRAME_GLOBAL_RELATIVE_ALT
:
MAV_FRAME_GLOBAL
);
emit
coordinateHasRelativeAltitudeChanged
(
value
.
toBool
());
_syncingAltitudeRelativeToHomeAndFrame
=
false
;
}
}
...
...
@@ -613,6 +614,7 @@ void SimpleMissionItem::_syncFrameToAltitudeRelativeToHome(void)
if
(
!
_syncingAltitudeRelativeToHomeAndFrame
)
{
_syncingAltitudeRelativeToHomeAndFrame
=
true
;
_altitudeRelativeToHomeFact
.
setRawValue
(
relativeAltitude
());
emit
coordinateHasRelativeAltitudeChanged
(
_altitudeRelativeToHomeFact
.
rawValue
().
toBool
());
_syncingAltitudeRelativeToHomeAndFrame
=
false
;
}
}
...
...
src/MissionManager/SimpleMissionItemTest.cc
View file @
4ab73ba5
...
...
@@ -79,13 +79,14 @@ void SimpleMissionItemTest::init(void)
{
VisualMissionItemTest
::
init
();
rgSimpleItemSignals
[
commandChangedIndex
]
=
SIGNAL
(
commandChanged
(
int
));
rgSimpleItemSignals
[
frameChangedIndex
]
=
SIGNAL
(
frameChanged
(
int
));
rgSimpleItemSignals
[
friendlyEditAllowedChangedIndex
]
=
SIGNAL
(
friendlyEditAllowedChanged
(
bool
));
rgSimpleItemSignals
[
headingDegreesChangedIndex
]
=
SIGNAL
(
headingDegreesChanged
(
double
));
rgSimpleItemSignals
[
rawEditChangedIndex
]
=
SIGNAL
(
rawEditChanged
(
bool
));
rgSimpleItemSignals
[
cameraSectionChangedIndex
]
=
SIGNAL
(
rawEditChanged
(
bool
));
rgSimpleItemSignals
[
speedSectionChangedIndex
]
=
SIGNAL
(
rawEditChanged
(
bool
));
rgSimpleItemSignals
[
commandChangedIndex
]
=
SIGNAL
(
commandChanged
(
int
));
rgSimpleItemSignals
[
frameChangedIndex
]
=
SIGNAL
(
frameChanged
(
int
));
rgSimpleItemSignals
[
friendlyEditAllowedChangedIndex
]
=
SIGNAL
(
friendlyEditAllowedChanged
(
bool
));
rgSimpleItemSignals
[
headingDegreesChangedIndex
]
=
SIGNAL
(
headingDegreesChanged
(
double
));
rgSimpleItemSignals
[
rawEditChangedIndex
]
=
SIGNAL
(
rawEditChanged
(
bool
));
rgSimpleItemSignals
[
cameraSectionChangedIndex
]
=
SIGNAL
(
rawEditChanged
(
bool
));
rgSimpleItemSignals
[
speedSectionChangedIndex
]
=
SIGNAL
(
rawEditChanged
(
bool
));
rgSimpleItemSignals
[
coordinateHasRelativeAltitudeChangedIndex
]
=
SIGNAL
(
coordinateHasRelativeAltitudeChanged
(
bool
));
MissionItem
missionItem
(
1
,
// sequence number
MAV_CMD_NAV_WAYPOINT
,
...
...
@@ -231,13 +232,14 @@ void SimpleMissionItemTest::_testSignals(void)
// frameChanged
// dirtyChanged
// friendlyEditAllowedChanged - this signal is not very smart on when it gets sent
// coordinateHasRelativeAltitudeChanged
missionItem
.
setFrame
(
MAV_FRAME_GLOBAL_RELATIVE_ALT
);
QVERIFY
(
_spyVisualItem
->
checkNoSignals
());
QVERIFY
(
_spySimpleItem
->
checkNoSignals
());
missionItem
.
setFrame
(
MAV_FRAME_GLOBAL
);
QVERIFY
(
_spySimpleItem
->
checkOnlySignalByMask
(
frameChangedMask
|
dirtyChangedMask
|
friendlyEditAllowedChangedMask
));
QVERIFY
(
_spySimpleItem
->
checkOnlySignalByMask
(
frameChangedMask
|
dirtyChangedMask
|
friendlyEditAllowedChangedMask
|
coordinateHasRelativeAltitudeChangedMask
));
_spySimpleItem
->
clearAllSignals
();
_spyVisualItem
->
clearAllSignals
();
...
...
src/MissionManager/SimpleMissionItemTest.h
View file @
4ab73ba5
...
...
@@ -41,17 +41,19 @@ private:
rawEditChangedIndex
,
cameraSectionChangedIndex
,
speedSectionChangedIndex
,
coordinateHasRelativeAltitudeChangedIndex
,
maxSignalIndex
,
};
enum
{
commandChangedMask
=
1
<<
commandChangedIndex
,
frameChangedMask
=
1
<<
frameChangedIndex
,
friendlyEditAllowedChangedMask
=
1
<<
friendlyEditAllowedChangedIndex
,
headingDegreesChangedMask
=
1
<<
headingDegreesChangedIndex
,
rawEditChangedMask
=
1
<<
rawEditChangedIndex
,
cameraSectionChangedMask
=
1
<<
cameraSectionChangedIndex
,
speedSectionChangedMask
=
1
<<
speedSectionChangedIndex
commandChangedMask
=
1
<<
commandChangedIndex
,
frameChangedMask
=
1
<<
frameChangedIndex
,
friendlyEditAllowedChangedMask
=
1
<<
friendlyEditAllowedChangedIndex
,
headingDegreesChangedMask
=
1
<<
headingDegreesChangedIndex
,
rawEditChangedMask
=
1
<<
rawEditChangedIndex
,
cameraSectionChangedMask
=
1
<<
cameraSectionChangedIndex
,
speedSectionChangedMask
=
1
<<
speedSectionChangedIndex
,
coordinateHasRelativeAltitudeChangedMask
=
1
<<
coordinateHasRelativeAltitudeChangedIndex
,
};
static
const
size_t
cSimpleItemSignals
=
maxSignalIndex
;
...
...
src/MissionManager/VisualMissionItem.h
View file @
4ab73ba5
...
...
@@ -102,7 +102,7 @@ public:
virtual
bool
isSimpleItem
(
void
)
const
=
0
;
virtual
bool
isStandaloneCoordinate
(
void
)
const
=
0
;
virtual
bool
specifiesCoordinate
(
void
)
const
=
0
;
virtual
bool
specifiesAltitudeOnly
(
void
)
const
=
0
;
;
virtual
bool
specifiesAltitudeOnly
(
void
)
const
=
0
;
virtual
QString
commandDescription
(
void
)
const
=
0
;
virtual
QString
commandName
(
void
)
const
=
0
;
virtual
QString
abbreviation
(
void
)
const
=
0
;
...
...
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