mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
refs #871, use const values for times
This commit is contained in:
committed by
Mathew Sutcliffe
parent
0488b4b5ea
commit
309d593607
@@ -12,6 +12,7 @@
|
|||||||
#include "blackcore/aircraftmatcher.h"
|
#include "blackcore/aircraftmatcher.h"
|
||||||
#include "blackcore/matchingutils.h"
|
#include "blackcore/matchingutils.h"
|
||||||
#include "blackcore/application.h"
|
#include "blackcore/application.h"
|
||||||
|
#include "blackcore/vatsim/networkvatlib.h"
|
||||||
#include "blackcore/vatsim/vatsimbookingreader.h"
|
#include "blackcore/vatsim/vatsimbookingreader.h"
|
||||||
#include "blackcore/vatsim/vatsimdatafilereader.h"
|
#include "blackcore/vatsim/vatsimdatafilereader.h"
|
||||||
#include "blackcore/webdataservices.h"
|
#include "blackcore/webdataservices.h"
|
||||||
@@ -1228,7 +1229,7 @@ namespace BlackCore
|
|||||||
if (callsign.isEmpty()) { return; }
|
if (callsign.isEmpty()) { return; }
|
||||||
|
|
||||||
// get time offset from situation
|
// get time offset from situation
|
||||||
qint64 timeOffsetMs = 6000; //! \fixme 6000 is assumed default offset, copied from CNetworkVatlib::onPilotPositionUpdate
|
qint64 timeOffsetMs = CNetworkVatlib::c_positionTimeOffsetMsec;
|
||||||
{
|
{
|
||||||
QReadLocker lock(&m_lockSituations);
|
QReadLocker lock(&m_lockSituations);
|
||||||
const CAircraftSituationList &situationList = this->m_situationsByCallsign[callsign];
|
const CAircraftSituationList &situationList = this->m_situationsByCallsign[callsign];
|
||||||
|
|||||||
@@ -846,7 +846,7 @@ namespace BlackCore
|
|||||||
CAltitude({ 0, nullptr }, CAltitude::MeanSeaLevel)
|
CAltitude({ 0, nullptr }, CAltitude::MeanSeaLevel)
|
||||||
);
|
);
|
||||||
situation.setCurrentUtcTime();
|
situation.setCurrentUtcTime();
|
||||||
situation.setTimeOffsetMs(6000);
|
situation.setTimeOffsetMs(c_positionTimeOffsetMsec);
|
||||||
|
|
||||||
QString transponderName("transponder ");
|
QString transponderName("transponder ");
|
||||||
transponderName.append(callsign.asString());
|
transponderName.append(callsign.asString());
|
||||||
@@ -923,7 +923,7 @@ namespace BlackCore
|
|||||||
CAltitude({ 0, nullptr }, CAltitude::MeanSeaLevel)
|
CAltitude({ 0, nullptr }, CAltitude::MeanSeaLevel)
|
||||||
);
|
);
|
||||||
situation.setCurrentUtcTime();
|
situation.setCurrentUtcTime();
|
||||||
situation.setTimeOffsetMs(2000);
|
situation.setTimeOffsetMs(c_interimPositionTimeOffsetMsec);
|
||||||
situation.setInterimFlag(true);
|
situation.setInterimFlag(true);
|
||||||
|
|
||||||
emit cbvar_cast(cbvar)->aircraftInterimPositionUpdate(situation);
|
emit cbvar_cast(cbvar)->aircraftInterimPositionUpdate(situation);
|
||||||
|
|||||||
@@ -121,6 +121,9 @@ namespace BlackCore
|
|||||||
//! Cmd. line options this library can handle
|
//! Cmd. line options this library can handle
|
||||||
static const QList<QCommandLineOption> &getCmdLineOptions();
|
static const QList<QCommandLineOption> &getCmdLineOptions();
|
||||||
|
|
||||||
|
static int const c_positionTimeOffsetMsec = 6000; //!< offset time for received position updates
|
||||||
|
static int const c_interimPositionTimeOffsetMsec = 2000; //!< offset time for received interim position updates
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool getCmdLineClientIdAndKey(int &id, QString &key) const;
|
bool getCmdLineClientIdAndKey(int &id, QString &key) const;
|
||||||
bool getCmdLineServerType(VatServerType &serverType) const;
|
bool getCmdLineServerType(VatServerType &serverType) const;
|
||||||
@@ -219,10 +222,9 @@ namespace BlackCore
|
|||||||
QTimer m_positionUpdateTimer;
|
QTimer m_positionUpdateTimer;
|
||||||
QTimer m_interimPositionUpdateTimer;
|
QTimer m_interimPositionUpdateTimer;
|
||||||
|
|
||||||
static int const c_processingIntervalMsec = 100;
|
static int const c_processingIntervalMsec = 100; //!< interval for the processing timer
|
||||||
static int const c_updatePostionIntervalMsec = 5000;
|
static int const c_updatePostionIntervalMsec = 5000; //!< interval for the position update timer (send our position to network)
|
||||||
static int const c_updateInterimPostionIntervalMsec = 1000;
|
static int const c_updateInterimPostionIntervalMsec = 1000; //!< interval for iterim position updates (send our position as interim position)
|
||||||
static int const c_logoffTimeoutSec = 5;
|
|
||||||
};
|
};
|
||||||
} //namespace
|
} //namespace
|
||||||
} //namespace
|
} //namespace
|
||||||
|
|||||||
Reference in New Issue
Block a user