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