mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T709, virtual function for timestamp setting
This commit is contained in:
committed by
Mat Sutcliffe
parent
1440c4d2e9
commit
04e57df5f7
@@ -11,7 +11,9 @@
|
||||
|
||||
#include "rapidjson/document.h" // rapidjson's DOM-style API
|
||||
#include "rapidjson/prettywriter.h" // for stringify JSON
|
||||
|
||||
#include <string>
|
||||
#include <chrono>
|
||||
|
||||
using namespace BlackMisc::Simulation::Settings;
|
||||
using namespace BlackMisc::Simulation::XPlane;
|
||||
@@ -111,6 +113,13 @@ namespace BlackMisc
|
||||
", follow dist m: " + std::to_string(m_followAircraftDistanceM) +
|
||||
", ts: " + std::to_string(m_msSinceEpochQtFree);
|
||||
}
|
||||
|
||||
void CXSwiftBusSettingsQtFree::setCurrentUtcTime()
|
||||
{
|
||||
using namespace std::chrono;
|
||||
const milliseconds ms = duration_cast<milliseconds>(system_clock::now().time_since_epoch());
|
||||
m_msSinceEpochQtFree = static_cast<int64_t>(ms.count());
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -27,6 +27,9 @@ namespace BlackMisc
|
||||
//! Constructor.
|
||||
CXSwiftBusSettingsQtFree();
|
||||
|
||||
//! Dtor
|
||||
virtual ~CXSwiftBusSettingsQtFree() {}
|
||||
|
||||
//! DBus server
|
||||
const std::string &getDBusServerAddress() const { return m_dBusServerAddress; }
|
||||
|
||||
@@ -66,6 +69,9 @@ namespace BlackMisc
|
||||
//! Convert to string
|
||||
std::string convertToString() const;
|
||||
|
||||
//! Sets timestamp to now
|
||||
virtual void setCurrentUtcTime();
|
||||
|
||||
protected:
|
||||
//! The JSON members @{
|
||||
static constexpr char JsonDBusServerAddress[] = "dbusserveradress";
|
||||
|
||||
Reference in New Issue
Block a user