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
8616ebef
Commit
8616ebef
authored
May 06, 2017
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add flightTime to Vehicle FactGroup
parent
ab397c99
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
+9
-0
Vehicle.h
src/Vehicle/Vehicle.h
+3
-0
VehicleFact.json
src/Vehicle/VehicleFact.json
+6
-0
No files found.
src/Vehicle/Vehicle.cc
View file @
8616ebef
...
...
@@ -52,6 +52,7 @@ const char* Vehicle::_climbRateFactName = "climbRate";
const
char
*
Vehicle
::
_altitudeRelativeFactName
=
"altitudeRelative"
;
const
char
*
Vehicle
::
_altitudeAMSLFactName
=
"altitudeAMSL"
;
const
char
*
Vehicle
::
_flightDistanceFactName
=
"flightDistance"
;
const
char
*
Vehicle
::
_flightTimeFactName
=
"flightTime"
;
const
char
*
Vehicle
::
_gpsFactGroupName
=
"gps"
;
const
char
*
Vehicle
::
_batteryFactGroupName
=
"battery"
;
...
...
@@ -150,6 +151,7 @@ Vehicle::Vehicle(LinkInterface* link,
,
_altitudeRelativeFact
(
0
,
_altitudeRelativeFactName
,
FactMetaData
::
valueTypeDouble
)
,
_altitudeAMSLFact
(
0
,
_altitudeAMSLFactName
,
FactMetaData
::
valueTypeDouble
)
,
_flightDistanceFact
(
0
,
_flightDistanceFactName
,
FactMetaData
::
valueTypeDouble
)
,
_flightTimeFact
(
0
,
_flightTimeFactName
,
FactMetaData
::
valueTypeElapsedTimeInSeconds
)
,
_gpsFactGroup
(
this
)
,
_batteryFactGroup
(
this
)
,
_windFactGroup
(
this
)
...
...
@@ -303,6 +305,8 @@ Vehicle::Vehicle(MAV_AUTOPILOT firmwareType,
,
_climbRateFact
(
0
,
_climbRateFactName
,
FactMetaData
::
valueTypeDouble
)
,
_altitudeRelativeFact
(
0
,
_altitudeRelativeFactName
,
FactMetaData
::
valueTypeDouble
)
,
_altitudeAMSLFact
(
0
,
_altitudeAMSLFactName
,
FactMetaData
::
valueTypeDouble
)
,
_flightDistanceFact
(
0
,
_flightDistanceFactName
,
FactMetaData
::
valueTypeDouble
)
,
_flightTimeFact
(
0
,
_flightTimeFactName
,
FactMetaData
::
valueTypeElapsedTimeInSeconds
)
,
_gpsFactGroup
(
this
)
,
_batteryFactGroup
(
this
)
,
_windFactGroup
(
this
)
...
...
@@ -353,6 +357,7 @@ void Vehicle::_commonInit(void)
_addFact
(
&
_altitudeRelativeFact
,
_altitudeRelativeFactName
);
_addFact
(
&
_altitudeAMSLFact
,
_altitudeAMSLFactName
);
_addFact
(
&
_flightDistanceFact
,
_flightDistanceFactName
);
_addFact
(
&
_flightTimeFact
,
_flightTimeFactName
);
_addFactGroup
(
&
_gpsFactGroup
,
_gpsFactGroupName
);
_addFactGroup
(
&
_batteryFactGroup
,
_batteryFactGroupName
);
...
...
@@ -361,6 +366,7 @@ void Vehicle::_commonInit(void)
_addFactGroup
(
&
_temperatureFactGroup
,
_temperatureFactGroupName
);
_flightDistanceFact
.
setRawValue
(
0
);
_flightTimeFact
.
setRawValue
(
0
);
}
Vehicle
::~
Vehicle
()
...
...
@@ -1674,6 +1680,7 @@ void Vehicle::_addNewMapTrajectoryPoint(void)
}
_mapTrajectoryHaveFirstCoordinate
=
true
;
_mapTrajectoryLastCoordinate
=
_coordinate
;
_flightTimeFact
.
setRawValue
((
double
)
_flightTimer
.
elapsed
()
/
1000.0
);
}
void
Vehicle
::
_clearTrajectoryPoints
(
void
)
...
...
@@ -1691,7 +1698,9 @@ void Vehicle::_mapTrajectoryStart(void)
_mapTrajectoryHaveFirstCoordinate
=
false
;
_clearTrajectoryPoints
();
_mapTrajectoryTimer
.
start
();
_flightTimer
.
start
();
_flightDistanceFact
.
setRawValue
(
0
);
_flightTimeFact
.
setRawValue
(
0
);
}
void
Vehicle
::
_mapTrajectoryStop
()
...
...
src/Vehicle/Vehicle.h
View file @
8616ebef
...
...
@@ -959,6 +959,7 @@ private:
QTimer
_sendMultipleTimer
;
int
_nextSendMessageMultipleIndex
;
QTime
_flightTimer
;
QTimer
_mapTrajectoryTimer
;
QmlObjectListModel
_mapTrajectoryList
;
QGeoCoordinate
_mapTrajectoryLastCoordinate
;
...
...
@@ -1004,6 +1005,7 @@ private:
Fact
_altitudeRelativeFact
;
Fact
_altitudeAMSLFact
;
Fact
_flightDistanceFact
;
Fact
_flightTimeFact
;
VehicleGPSFactGroup
_gpsFactGroup
;
VehicleBatteryFactGroup
_batteryFactGroup
;
...
...
@@ -1020,6 +1022,7 @@ private:
static
const
char
*
_altitudeRelativeFactName
;
static
const
char
*
_altitudeAMSLFactName
;
static
const
char
*
_flightDistanceFactName
;
static
const
char
*
_flightTimeFactName
;
static
const
char
*
_gpsFactGroupName
;
static
const
char
*
_batteryFactGroupName
;
...
...
src/Vehicle/VehicleFact.json
View file @
8616ebef
...
...
@@ -61,5 +61,11 @@
"type"
:
"double"
,
"decimalPlaces"
:
1
,
"units"
:
"m"
},
{
"name"
:
"flightTime"
,
"shortDescription"
:
"Flight Time"
,
"type"
:
"elapsedSeconds"
,
"decimalPlaces"
:
1
}
]
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