mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-02 15:15:39 +08:00
Ref T259, Ref T243 align timestamp values to qint64
This commit is contained in:
@@ -903,7 +903,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
//! we set a dynamically updating offset time here
|
//! we set a dynamically updating offset time here
|
||||||
situation.setCurrentUtcTime();
|
situation.setCurrentUtcTime();
|
||||||
const int offsetMs = self->markReceivedPositionAndGetOffsetTime(situation.getCallsign(), situation.getMSecsSinceEpoch());
|
const int offsetMs = self->receivedPositionFixTsAndGetOffsetTime(situation.getCallsign(), situation.getMSecsSinceEpoch());
|
||||||
situation.setTimeOffsetMs(offsetMs);
|
situation.setTimeOffsetMs(offsetMs);
|
||||||
|
|
||||||
CTransponder::TransponderMode mode = CTransponder::StateStandby;
|
CTransponder::TransponderMode mode = CTransponder::StateStandby;
|
||||||
@@ -979,7 +979,7 @@ namespace BlackCore
|
|||||||
situation.setCurrentUtcTime();
|
situation.setCurrentUtcTime();
|
||||||
situation.setTimeOffsetMs(c_interimPositionTimeOffsetMsec);
|
situation.setTimeOffsetMs(c_interimPositionTimeOffsetMsec);
|
||||||
situation.setInterimFlag(true);
|
situation.setInterimFlag(true);
|
||||||
self->markReceivedPositionAndGetOffsetTime(situation.getCallsign(), situation.getMSecsSinceEpoch());
|
self->receivedPositionFixTsAndGetOffsetTime(situation.getCallsign(), situation.getMSecsSinceEpoch());
|
||||||
|
|
||||||
emit self->aircraftInterimPositionUpdate(situation);
|
emit self->aircraftInterimPositionUpdate(situation);
|
||||||
}
|
}
|
||||||
@@ -1184,7 +1184,7 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int CNetworkVatlib::markReceivedPositionAndGetOffsetTime(const CCallsign &callsign, qint64 markerTs)
|
qint64 CNetworkVatlib::receivedPositionFixTsAndGetOffsetTime(const CCallsign &callsign, qint64 markerTs)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign");
|
Q_ASSERT_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign");
|
||||||
|
|
||||||
@@ -1197,15 +1197,15 @@ namespace BlackCore
|
|||||||
const qint64 oldTs = m_lastPositionUpdate.value(callsign);
|
const qint64 oldTs = m_lastPositionUpdate.value(callsign);
|
||||||
m_lastPositionUpdate[callsign] = markerTs;
|
m_lastPositionUpdate[callsign] = markerTs;
|
||||||
|
|
||||||
const int diff = oldTs - markerTs;
|
const qint64 diff = oldTs - markerTs;
|
||||||
const int offsetTime = (oldTs > 0 && diff > 0 && diff < c_interimPositionTimeOffsetMsec) ?
|
const qint64 offsetTime = (oldTs > 0 && diff > 0 && diff < c_interimPositionTimeOffsetMsec) ?
|
||||||
c_interimPositionTimeOffsetMsec :
|
c_interimPositionTimeOffsetMsec :
|
||||||
c_positionTimeOffsetMsec;
|
c_positionTimeOffsetMsec;
|
||||||
m_lastOffsetTime[callsign] = offsetTime;
|
m_lastOffsetTime[callsign] = offsetTime;
|
||||||
return offsetTime;
|
return offsetTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
int CNetworkVatlib::currentOffsetTime(const CCallsign &callsign) const
|
qint64 CNetworkVatlib::currentOffsetTime(const CCallsign &callsign) const
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign");
|
Q_ASSERT_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign");
|
||||||
|
|
||||||
|
|||||||
@@ -134,8 +134,8 @@ namespace BlackCore
|
|||||||
|
|
||||||
//! Offset times basically telling when to expect the next value from network plus some reserve
|
//! Offset times basically telling when to expect the next value from network plus some reserve
|
||||||
//! @{
|
//! @{
|
||||||
static int constexpr c_positionTimeOffsetMsec = 6000; //!< offset time for received position updates
|
static qint64 constexpr c_positionTimeOffsetMsec = 6000; //!< offset time for received position updates
|
||||||
static int constexpr c_interimPositionTimeOffsetMsec = 2000; //!< offset time for received interim position updates
|
static qint64 constexpr c_interimPositionTimeOffsetMsec = 2000; //!< offset time for received interim position updates
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -228,10 +228,10 @@ namespace BlackCore
|
|||||||
void maybeHandleAtisReply(const BlackMisc::Aviation::CCallsign &sender, const BlackMisc::Aviation::CCallsign &receiver, const QString &message);
|
void maybeHandleAtisReply(const BlackMisc::Aviation::CCallsign &sender, const BlackMisc::Aviation::CCallsign &receiver, const QString &message);
|
||||||
|
|
||||||
//! Remember when last position was received
|
//! Remember when last position was received
|
||||||
int markReceivedPositionAndGetOffsetTime(const BlackMisc::Aviation::CCallsign &callsign, qint64 markerTs = -1);
|
qint64 receivedPositionFixTsAndGetOffsetTime(const BlackMisc::Aviation::CCallsign &callsign, qint64 markerTs = -1);
|
||||||
|
|
||||||
//! Current offset time
|
//! Current offset time
|
||||||
int currentOffsetTime(const BlackMisc::Aviation::CCallsign &callsign) const;
|
qint64 currentOffsetTime(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||||
|
|
||||||
//! Clear state when connection is terminated
|
//! Clear state when connection is terminated
|
||||||
void clearState();
|
void clearState();
|
||||||
|
|||||||
Reference in New Issue
Block a user