mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
Ref T709, sync Qt free timestamp after parsing with swift version
This commit is contained in:
committed by
Mat Sutcliffe
parent
04e57df5f7
commit
34aa8333cc
@@ -85,6 +85,11 @@ namespace BlackMisc
|
|||||||
static const CXSwiftBusSettings s;
|
static const CXSwiftBusSettings s;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CXSwiftBusSettings::jsonParsed()
|
||||||
|
{
|
||||||
|
m_timestampMSecsSinceEpoch = m_msSinceEpochQtFree;
|
||||||
|
}
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -79,6 +79,10 @@ namespace BlackMisc
|
|||||||
//! Default value for settings
|
//! Default value for settings
|
||||||
static const CXSwiftBusSettings &defaultValue();
|
static const CXSwiftBusSettings &defaultValue();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
//! \copydoc CXSwiftBusSettingsQtFree::jsonParsed
|
||||||
|
virtual void jsonParsed() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BLACK_METACLASS(
|
BLACK_METACLASS(
|
||||||
CXSwiftBusSettings,
|
CXSwiftBusSettings,
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
m_msSinceEpochQtFree = settingsDoc[CXSwiftBusSettingsQtFree::JsonTimestamp].GetInt64(); c++;
|
m_msSinceEpochQtFree = settingsDoc[CXSwiftBusSettingsQtFree::JsonTimestamp].GetInt64(); c++;
|
||||||
}
|
}
|
||||||
|
this->jsonParsed(); // post processing
|
||||||
return c == 6;
|
return c == 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,6 +121,11 @@ namespace BlackMisc
|
|||||||
const milliseconds ms = duration_cast<milliseconds>(system_clock::now().time_since_epoch());
|
const milliseconds ms = duration_cast<milliseconds>(system_clock::now().time_since_epoch());
|
||||||
m_msSinceEpochQtFree = static_cast<int64_t>(ms.count());
|
m_msSinceEpochQtFree = static_cast<int64_t>(ms.count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CXSwiftBusSettingsQtFree::jsonParsed()
|
||||||
|
{
|
||||||
|
// void
|
||||||
|
}
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -82,6 +82,9 @@ namespace BlackMisc
|
|||||||
static constexpr char JsonFollowAircraftDistanceM[] = "followAircraftDistance";
|
static constexpr char JsonFollowAircraftDistanceM[] = "followAircraftDistance";
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
//! Pasing completed
|
||||||
|
virtual void jsonParsed();
|
||||||
|
|
||||||
std::string m_dBusServerAddress { "tcp:host=127.0.0.1,port=45001" }; //!< DBus server
|
std::string m_dBusServerAddress { "tcp:host=127.0.0.1,port=45001" }; //!< DBus server
|
||||||
int m_maxPlanes = 100; //!< max. planes in XPlane
|
int m_maxPlanes = 100; //!< max. planes in XPlane
|
||||||
int m_followAircraftDistanceM = 200; //!< follow aircraft in distance
|
int m_followAircraftDistanceM = 200; //!< follow aircraft in distance
|
||||||
|
|||||||
@@ -107,6 +107,8 @@ namespace BlackMiscTest
|
|||||||
s.setMaxPlanes(33);
|
s.setMaxPlanes(33);
|
||||||
s.setMaxDrawDistanceNM(11.11);
|
s.setMaxDrawDistanceNM(11.11);
|
||||||
s.setDrawingLabels(false);
|
s.setDrawingLabels(false);
|
||||||
|
s.setFollowAircraftDistanceM(123);
|
||||||
|
s.setCurrentUtcTime();
|
||||||
QString json = s.toXSwiftBusJsonStringQt();
|
QString json = s.toXSwiftBusJsonStringQt();
|
||||||
|
|
||||||
qDebug() << json;
|
qDebug() << json;
|
||||||
@@ -117,6 +119,8 @@ namespace BlackMiscTest
|
|||||||
QCOMPARE(s.getMaxPlanes(), s2.getMaxPlanes());
|
QCOMPARE(s.getMaxPlanes(), s2.getMaxPlanes());
|
||||||
QCOMPARE(s.isDrawingLabels(), s2.isDrawingLabels());
|
QCOMPARE(s.isDrawingLabels(), s2.isDrawingLabels());
|
||||||
QCOMPARE(s.getDBusServerAddressQt(), s2.getDBusServerAddressQt());
|
QCOMPARE(s.getDBusServerAddressQt(), s2.getDBusServerAddressQt());
|
||||||
|
QCOMPARE(s.getFollowAircraftDistanceM(), s2.getFollowAircraftDistanceM());
|
||||||
|
QCOMPARE(s.getMSecsSinceEpoch(), s2.getMSecsSinceEpoch());
|
||||||
|
|
||||||
s.setDBusServerAddressQt(CDBusServer::sessionBusAddress());
|
s.setDBusServerAddressQt(CDBusServer::sessionBusAddress());
|
||||||
json = s.toXSwiftBusJsonStringQt();
|
json = s.toXSwiftBusJsonStringQt();
|
||||||
|
|||||||
Reference in New Issue
Block a user