QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
VehicleClockFactGroup.cc
Go to the documentation of this file.
2#include "QGCApplication.h"
3
4VehicleClockFactGroup::VehicleClockFactGroup(QObject *parent)
5 : FactGroup(1000, QStringLiteral(":/json/Vehicle/ClockFact.json"), parent)
6{
7 _addFact(&_currentTimeFact);
8 _addFact(&_currentUTCTimeFact);
9 _addFact(&_currentDateFact);
10
11 _currentTimeFact.setRawValue(QTime().toString());
12 _currentUTCTimeFact.setRawValue(std::numeric_limits<float>::quiet_NaN());
13 _currentDateFact.setRawValue(std::numeric_limits<float>::quiet_NaN());
14}
15
16void VehicleClockFactGroup::_updateAllValues()
17{
18 currentTime()->setRawValue(QTime::currentTime().toString());
19 currentUTCTime()->setRawValue(QDateTime::currentDateTimeUtc().time().toString());
20 currentDate()->setRawValue(QDateTime::currentDateTime().toString(qgcApp()->getCurrentLanguage().dateFormat(QLocale::ShortFormat)));
21
23
25}
#define qgcApp()
Used to group Facts together into an object hierarachy.
Definition FactGroup.h:19
virtual void _updateAllValues()
Definition FactGroup.cc:142
void _setTelemetryAvailable(bool telemetryAvailable)
Definition FactGroup.cc:172