mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
refs #402, post merge feedback by MS
This commit is contained in:
@@ -28,7 +28,7 @@ namespace BlackCore
|
||||
|
||||
CAirspaceMonitor::CAirspaceMonitor(QObject *parent, const BlackMisc::Simulation::IOwnAircraftProviderReadOnly *ownAircraftProvider, INetwork *network, CVatsimBookingReader *bookings, CVatsimDataFileReader *dataFile)
|
||||
: QObject(parent),
|
||||
COwnAircraftProviderSupportReadOnly(ownAircraftProvider),
|
||||
COwnAircraftAwareReadOnly(ownAircraftProvider),
|
||||
m_network(network), m_vatsimBookingReader(bookings), m_vatsimDataFileReader(dataFile),
|
||||
m_atcWatchdog(this), m_aircraftWatchdog(this)
|
||||
{
|
||||
@@ -144,8 +144,7 @@ namespace BlackCore
|
||||
CSimulatedAircraft aircraft = m_aircraftInRange.findFirstByCallsign(callsign);
|
||||
if (!aircraft.hasValidCallsign()) { return false; }
|
||||
|
||||
CAircraftModel newModel(model);
|
||||
aircraft.setModel(newModel); // this consolidates all common data such as callsign, ICAO ...
|
||||
aircraft.setModel(model); // this consolidates all common data such as callsign, ICAO ...
|
||||
|
||||
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexModel, aircraft.getModel().toCVariant());
|
||||
int c = m_aircraftInRange.applyIfCallsign(callsign, vm);
|
||||
|
||||
@@ -34,8 +34,8 @@ namespace BlackCore
|
||||
*/
|
||||
class CAirspaceMonitor :
|
||||
public QObject,
|
||||
public BlackMisc::Simulation::IRemoteAircraftProvider, // those data will be provided from the class CAirspaceMonitor
|
||||
public BlackMisc::Simulation::COwnAircraftProviderSupportReadOnly // used to obtain in memory inofmration about own aircraft
|
||||
public BlackMisc::Simulation::IRemoteAircraftProvider, // those data will be provided from the class CAirspaceMonitor
|
||||
public BlackMisc::Simulation::COwnAircraftAwareReadOnly // used to obtain in memory inofmration about own aircraft
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(BlackMisc::Simulation::IRemoteAircraftProvider)
|
||||
@@ -131,8 +131,8 @@ namespace BlackCore
|
||||
std::function<void(const BlackMisc::Aviation::CCallsign &)> removedAircraftSlot
|
||||
) override;
|
||||
|
||||
const qint64 AircraftSituationsRemovedOffsetMs = 30 * 1000; //!< situations older than now - offset will be removed
|
||||
const qint64 AircraftPartsRemoveOffsetMs = 30* 1000; //!< parts older than now - offset will be removed
|
||||
static const qint64 AircraftSituationsRemovedOffsetMs = 30 * 1000; //!< situations older than now - offset will be removed
|
||||
static const qint64 AircraftPartsRemoveOffsetMs = 30* 1000; //!< parts older than now - offset will be removed
|
||||
|
||||
signals:
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace BlackCore
|
||||
|
||||
IInterpolator::IInterpolator(IRemoteAircraftProviderReadOnly *provider, const QString &workerName, QObject *parent) :
|
||||
CContinuousWorker(parent, workerName),
|
||||
CRemoteAircraftProviderSupportReadOnly(provider)
|
||||
CRemoteAircraftAwareReadOnly(provider)
|
||||
{
|
||||
Q_ASSERT(provider);
|
||||
this->m_situationsByCallsign = this->remoteAircraftSituations().splitPerCallsign();
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace BlackCore
|
||||
//! Interpolator, calculation inbetween positions
|
||||
class IInterpolator :
|
||||
public BlackMisc::CContinuousWorker,
|
||||
public BlackMisc::Simulation::CRemoteAircraftProviderSupportReadOnly
|
||||
public BlackMisc::Simulation::CRemoteAircraftAwareReadOnly
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace BlackCore
|
||||
void exceptionDispatcher(const char *caller);
|
||||
|
||||
CNetworkVatlib::CNetworkVatlib(Simulation::IOwnAircraftProvider *ownAircraft, QObject *parent)
|
||||
: INetwork(parent), COwnAircraftProviderSupport(ownAircraft),
|
||||
: INetwork(parent), COwnAircraftAware(ownAircraft),
|
||||
m_loginMode(LoginNormal),
|
||||
m_status(vatStatusIdle),
|
||||
m_fsdTextCodec(QTextCodec::codecForName("latin1")),
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace BlackCore
|
||||
*/
|
||||
class CNetworkVatlib :
|
||||
public INetwork,
|
||||
public BlackMisc::Simulation::COwnAircraftProviderSupport // network vatlib consumes own aircraft data and sets ICAO/callsign data
|
||||
public BlackMisc::Simulation::COwnAircraftAware // network vatlib consumes own aircraft data and sets ICAO/callsign data
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ namespace BlackCore
|
||||
BlackMisc::Simulation::IRemoteAircraftProvider *remoteAircraftProvider,
|
||||
QObject *parent)
|
||||
: ISimulator(parent),
|
||||
COwnAircraftProviderSupport(ownAircraftProvider),
|
||||
CRemoteAircraftProviderSupport(remoteAircraftProvider)
|
||||
COwnAircraftAware(ownAircraftProvider),
|
||||
CRemoteAircraftAware(remoteAircraftProvider)
|
||||
{
|
||||
m_oneSecondTimer = new QTimer(this);
|
||||
connect(this->m_oneSecondTimer, &QTimer::timeout, this, &CSimulatorCommon::ps_oneSecondTimer);
|
||||
|
||||
@@ -259,8 +259,8 @@ namespace BlackCore
|
||||
//! Common base class with providers, interface and some base functionality
|
||||
class CSimulatorCommon :
|
||||
public BlackCore::ISimulator,
|
||||
public BlackMisc::Simulation::COwnAircraftProviderSupport, // gain access to in memor own aircraft data
|
||||
public BlackMisc::Simulation::CRemoteAircraftProviderSupport // gain access to in memory remote aircraft data
|
||||
public BlackMisc::Simulation::COwnAircraftAware, // gain access to in memor own aircraft data
|
||||
public BlackMisc::Simulation::CRemoteAircraftAware // gain access to in memory remote aircraft data
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
@@ -32,16 +32,9 @@ namespace BlackCore
|
||||
|
||||
void CVatsimBookingReader::readInBackgroundThread()
|
||||
{
|
||||
if (QThread::currentThread() == QObject::thread())
|
||||
{
|
||||
ps_read();
|
||||
}
|
||||
else
|
||||
{
|
||||
bool s = QMetaObject::invokeMethod(this, "ps_read", Qt::BlockingQueuedConnection);
|
||||
Q_ASSERT(s);
|
||||
Q_UNUSED(s);
|
||||
}
|
||||
bool s = QMetaObject::invokeMethod(this, "ps_read");
|
||||
Q_ASSERT(s);
|
||||
Q_UNUSED(s);
|
||||
}
|
||||
|
||||
void CVatsimBookingReader::ps_read()
|
||||
|
||||
@@ -126,16 +126,9 @@ namespace BlackCore
|
||||
|
||||
void CVatsimDataFileReader::readInBackgroundThread()
|
||||
{
|
||||
if (QThread::currentThread() == QObject::thread())
|
||||
{
|
||||
ps_read();
|
||||
}
|
||||
else
|
||||
{
|
||||
bool s = QMetaObject::invokeMethod(this, "ps_read", Qt::BlockingQueuedConnection);
|
||||
Q_ASSERT(s);
|
||||
Q_UNUSED(s);
|
||||
}
|
||||
bool s = QMetaObject::invokeMethod(this, "ps_read");
|
||||
Q_ASSERT(s);
|
||||
Q_UNUSED(s);
|
||||
}
|
||||
|
||||
void CVatsimDataFileReader::ps_read()
|
||||
|
||||
Reference in New Issue
Block a user