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
9306dc35
Commit
9306dc35
authored
Mar 24, 2017
by
Donald Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add flightDistance to Vehicle FactGroup
parent
1723a2d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
Vehicle.cc
src/Vehicle/Vehicle.cc
+7
-0
Vehicle.h
src/Vehicle/Vehicle.h
+4
-0
VehicleFact.json
src/Vehicle/VehicleFact.json
+7
-0
No files found.
src/Vehicle/Vehicle.cc
View file @
9306dc35
...
...
@@ -49,6 +49,7 @@ const char* Vehicle::_groundSpeedFactName = "groundSpeed";
const
char
*
Vehicle
::
_climbRateFactName
=
"climbRate"
;
const
char
*
Vehicle
::
_altitudeRelativeFactName
=
"altitudeRelative"
;
const
char
*
Vehicle
::
_altitudeAMSLFactName
=
"altitudeAMSL"
;
const
char
*
Vehicle
::
_flightDistanceFactName
=
"flightDistance"
;
const
char
*
Vehicle
::
_gpsFactGroupName
=
"gps"
;
const
char
*
Vehicle
::
_batteryFactGroupName
=
"battery"
;
...
...
@@ -148,6 +149,7 @@ Vehicle::Vehicle(LinkInterface* link,
,
_climbRateFact
(
0
,
_climbRateFactName
,
FactMetaData
::
valueTypeDouble
)
,
_altitudeRelativeFact
(
0
,
_altitudeRelativeFactName
,
FactMetaData
::
valueTypeDouble
)
,
_altitudeAMSLFact
(
0
,
_altitudeAMSLFactName
,
FactMetaData
::
valueTypeDouble
)
,
_flightDistanceFact
(
0
,
_flightDistanceFactName
,
FactMetaData
::
valueTypeDouble
)
,
_gpsFactGroup
(
this
)
,
_batteryFactGroup
(
this
)
,
_windFactGroup
(
this
)
...
...
@@ -348,12 +350,15 @@ void Vehicle::_commonInit(void)
_addFact
(
&
_climbRateFact
,
_climbRateFactName
);
_addFact
(
&
_altitudeRelativeFact
,
_altitudeRelativeFactName
);
_addFact
(
&
_altitudeAMSLFact
,
_altitudeAMSLFactName
);
_addFact
(
&
_flightDistanceFact
,
_flightDistanceFactName
);
_addFactGroup
(
&
_gpsFactGroup
,
_gpsFactGroupName
);
_addFactGroup
(
&
_batteryFactGroup
,
_batteryFactGroupName
);
_addFactGroup
(
&
_windFactGroup
,
_windFactGroupName
);
_addFactGroup
(
&
_vibrationFactGroup
,
_vibrationFactGroupName
);
_addFactGroup
(
&
_temperatureFactGroup
,
_temperatureFactGroupName
);
_flightDistanceFact
.
setRawValue
(
0
);
}
Vehicle
::~
Vehicle
()
...
...
@@ -1637,6 +1642,7 @@ void Vehicle::_addNewMapTrajectoryPoint(void)
_mapTrajectoryList
.
removeAt
(
0
)
->
deleteLater
();
}
_mapTrajectoryList
.
append
(
new
CoordinateVector
(
_mapTrajectoryLastCoordinate
,
_coordinate
,
this
));
_flightDistanceFact
.
setRawValue
(
_flightDistanceFact
.
rawValue
().
toDouble
()
+
_mapTrajectoryLastCoordinate
.
distanceTo
(
_coordinate
));
}
_mapTrajectoryHaveFirstCoordinate
=
true
;
_mapTrajectoryLastCoordinate
=
_coordinate
;
...
...
@@ -1647,6 +1653,7 @@ void Vehicle::_mapTrajectoryStart(void)
_mapTrajectoryHaveFirstCoordinate
=
false
;
_mapTrajectoryList
.
clear
();
_mapTrajectoryTimer
.
start
();
_flightDistanceFact
.
setRawValue
(
0
);
}
void
Vehicle
::
_mapTrajectoryStop
()
...
...
src/Vehicle/Vehicle.h
View file @
9306dc35
...
...
@@ -338,6 +338,7 @@ public:
Q_PROPERTY
(
Fact
*
climbRate
READ
climbRate
CONSTANT
)
Q_PROPERTY
(
Fact
*
altitudeRelative
READ
altitudeRelative
CONSTANT
)
Q_PROPERTY
(
Fact
*
altitudeAMSL
READ
altitudeAMSL
CONSTANT
)
Q_PROPERTY
(
Fact
*
flightDistance
READ
flightDistance
CONSTANT
)
Q_PROPERTY
(
FactGroup
*
gps
READ
gpsFactGroup
CONSTANT
)
Q_PROPERTY
(
FactGroup
*
battery
READ
batteryFactGroup
CONSTANT
)
...
...
@@ -594,6 +595,7 @@ public:
Fact
*
climbRate
(
void
)
{
return
&
_climbRateFact
;
}
Fact
*
altitudeRelative
(
void
)
{
return
&
_altitudeRelativeFact
;
}
Fact
*
altitudeAMSL
(
void
)
{
return
&
_altitudeAMSLFact
;
}
Fact
*
flightDistance
(
void
)
{
return
&
_flightDistanceFact
;
}
FactGroup
*
gpsFactGroup
(
void
)
{
return
&
_gpsFactGroup
;
}
FactGroup
*
batteryFactGroup
(
void
)
{
return
&
_batteryFactGroup
;
}
...
...
@@ -982,6 +984,7 @@ private:
Fact
_climbRateFact
;
Fact
_altitudeRelativeFact
;
Fact
_altitudeAMSLFact
;
Fact
_flightDistanceFact
;
VehicleGPSFactGroup
_gpsFactGroup
;
VehicleBatteryFactGroup
_batteryFactGroup
;
...
...
@@ -997,6 +1000,7 @@ private:
static
const
char
*
_climbRateFactName
;
static
const
char
*
_altitudeRelativeFactName
;
static
const
char
*
_altitudeAMSLFactName
;
static
const
char
*
_flightDistanceFactName
;
static
const
char
*
_gpsFactGroupName
;
static
const
char
*
_batteryFactGroupName
;
...
...
src/Vehicle/VehicleFact.json
View file @
9306dc35
...
...
@@ -54,5 +54,12 @@
"type"
:
"double"
,
"decimalPlaces"
:
1
,
"units"
:
"m"
},
{
"name"
:
"flightDistance"
,
"shortDescription"
:
"Flight Distance"
,
"type"
:
"double"
,
"decimalPlaces"
:
1
,
"units"
:
"m"
}
]
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