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
1bcd33e3
Commit
1bcd33e3
authored
Oct 27, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix relative altitude fact
parent
ae0fb2c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
21 deletions
+20
-21
MissionItem.cc
src/MissionItem.cc
+15
-12
MissionItem.h
src/MissionItem.h
+5
-9
No files found.
src/MissionItem.cc
View file @
1bcd33e3
...
...
@@ -233,7 +233,8 @@ void MissionItem::_connectSignals(void)
connect
(
_longitudeFact
,
&
Fact
::
valueChanged
,
this
,
&
MissionItem
::
_coordinateFactChanged
);
connect
(
_altitudeFact
,
&
Fact
::
valueChanged
,
this
,
&
MissionItem
::
_coordinateFactChanged
);
connect
(
_headingDegreesFact
,
&
Fact
::
valueChanged
,
this
,
&
MissionItem
::
_headingDegreesFactChanged
);
connect
(
_headingDegreesFact
,
&
Fact
::
valueChanged
,
this
,
&
MissionItem
::
_headingDegreesFactChanged
);
connect
(
_altitudeRelativeToHomeFact
,
&
Fact
::
valueChanged
,
this
,
&
MissionItem
::
_altitudeRelativeToHomeFactChanged
);
}
MissionItem
::~
MissionItem
()
...
...
@@ -284,7 +285,6 @@ void MissionItem::setSequenceNumber(int sequenceNumber)
{
_sequenceNumber
=
sequenceNumber
;
emit
sequenceNumberChanged
(
_sequenceNumber
);
emit
changed
(
this
);
}
void
MissionItem
::
setX
(
double
x
)
...
...
@@ -316,7 +316,6 @@ void MissionItem::setLatitude(double lat)
if
(
_latitudeFact
->
value
().
toDouble
()
!=
lat
)
{
_latitudeFact
->
setValue
(
lat
);
emit
changed
(
this
);
emit
coordinateChanged
(
coordinate
());
}
}
...
...
@@ -326,7 +325,6 @@ void MissionItem::setLongitude(double lon)
if
(
_longitudeFact
->
value
().
toDouble
()
!=
lon
)
{
_longitudeFact
->
setValue
(
lon
);
emit
changed
(
this
);
emit
coordinateChanged
(
coordinate
());
}
}
...
...
@@ -336,7 +334,6 @@ void MissionItem::setAltitude(double altitude)
if
(
_altitudeFact
->
value
().
toDouble
()
!=
altitude
)
{
_altitudeFact
->
setValue
(
altitude
);
emit
changed
(
this
);
emit
valueStringsChanged
(
valueStrings
());
emit
coordinateChanged
(
coordinate
());
}
...
...
@@ -378,7 +375,6 @@ void MissionItem::setAction(int /*MAV_CMD*/ action)
setFrame
(
MAV_FRAME_MISSION
);
}
emit
changed
(
this
);
emit
commandNameChanged
(
commandName
());
emit
commandChanged
((
MavlinkQmlSingleton
::
Qml_MAV_CMD
)
_command
);
emit
valueLabelsChanged
(
valueLabels
());
...
...
@@ -400,7 +396,7 @@ void MissionItem::setFrame(int /*MAV_FRAME*/ frame)
if
(
_frame
!=
frame
)
{
_altitudeRelativeToHomeFact
->
setValue
(
frame
==
MAV_FRAME_GLOBAL_RELATIVE_ALT
);
_frame
=
frame
;
emit
changed
(
this
);
emit
frameChanged
(
_frame
);
}
}
...
...
@@ -408,7 +404,7 @@ void MissionItem::setAutocontinue(bool autoContinue)
{
if
(
_autocontinue
!=
autoContinue
)
{
_autocontinue
=
autoContinue
;
emit
changed
(
this
);
emit
autoContinueChanged
(
_autocontinue
);
}
}
...
...
@@ -430,7 +426,6 @@ void MissionItem::setParam1(double param)
if
(
param1
()
!=
param
)
{
_param1Fact
->
setValue
(
param
);
emit
changed
(
this
);
emit
valueStringsChanged
(
valueStrings
());
}
}
...
...
@@ -441,7 +436,6 @@ void MissionItem::setParam2(double param)
{
_param2Fact
->
setValue
(
param
);
emit
valueStringsChanged
(
valueStrings
());
emit
changed
(
this
);
}
}
...
...
@@ -475,7 +469,6 @@ void MissionItem::setLoiterOrbitRadius(double radius)
if
(
loiterOrbitRadius
()
!=
radius
)
{
_loiterOrbitRadiusFact
->
setValue
(
radius
);
emit
valueStringsChanged
(
valueStrings
());
emit
changed
(
this
);
}
}
...
...
@@ -815,7 +808,6 @@ void MissionItem::setHeadingDegrees(double headingDegrees)
{
if
(
_headingDegreesFact
->
value
().
toDouble
()
!=
headingDegrees
)
{
_headingDegreesFact
->
setValue
(
headingDegrees
);
emit
changed
(
this
);
emit
valueStringsChanged
(
valueStrings
());
emit
headingDegreesChanged
(
headingDegrees
);
}
...
...
@@ -913,6 +905,17 @@ void MissionItem::_headingDegreesFactChanged(QVariant value)
emit
headingDegreesChanged
(
value
.
toDouble
());
}
void
MissionItem
::
_altitudeRelativeToHomeFactChanged
(
QVariant
value
)
{
// Don't call setFrame, that will cause a signalling loop
int
frame
=
value
.
toBool
()
?
MAV_FRAME_GLOBAL_RELATIVE_ALT
:
MAV_FRAME_GLOBAL
;
if
(
_frame
!=
frame
)
{
_frame
=
frame
;
emit
frameChanged
(
_frame
);
}
}
void
MissionItem
::
setHomePositionValid
(
bool
homePositionValid
)
{
_homePositionValid
=
homePositionValid
;
...
...
src/MissionItem.h
View file @
1bcd33e3
...
...
@@ -213,6 +213,8 @@ public:
void
setHomePositionSpecialCase
(
bool
homePositionSpecialCase
)
{
_homePositionSpecialCase
=
homePositionSpecialCase
;
}
bool
relativeAltitude
(
void
)
{
return
_frame
==
MAV_FRAME_GLOBAL_RELATIVE_ALT
;
}
static
const
double
defaultPitch
;
static
const
double
defaultHeading
;
static
const
double
defaultAltitude
;
...
...
@@ -228,15 +230,12 @@ signals:
void
dirtyChanged
(
bool
dirty
);
void
homePositionValidChanged
(
bool
homePostionValid
);
void
distanceChanged
(
float
distance
);
/** @brief Announces a change to the waypoint data */
void
changed
(
MissionItem
*
wp
);
void
frameChanged
(
int
frame
);
void
commandNameChanged
(
QString
type
);
void
commandChanged
(
MavlinkQmlSingleton
::
Qml_MAV_CMD
command
);
void
valueLabelsChanged
(
QStringList
valueLabels
);
void
valueStringsChanged
(
QStringList
valueStrings
);
bool
autoContinueChanged
(
bool
autoContinue
);
public:
/** @brief Set the waypoint action */
...
...
@@ -260,14 +259,11 @@ public:
/** @brief Wether this waypoint has been reached yet */
bool
isReached
()
{
return
(
_reachedTime
>
0
);
}
void
setChanged
()
{
emit
changed
(
this
);
}
private
slots
:
void
_factValueChanged
(
QVariant
value
);
void
_coordinateFactChanged
(
QVariant
value
);
void
_headingDegreesFactChanged
(
QVariant
value
);
void
_altitudeRelativeToHomeFactChanged
(
QVariant
value
);
private:
QString
_oneDecimalString
(
double
value
);
...
...
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