mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 03:15:34 +08:00
Ref T717, simulator adjustments to support "TEST AIRCRAFT"
This commit is contained in:
committed by
Mat Sutcliffe
parent
903cf07eac
commit
838e41051c
@@ -1019,6 +1019,11 @@ namespace BlackCore
|
|||||||
m_remoteAircraftProviderConnections.disconnectAll(); // disconnect signals from provider
|
m_remoteAircraftProviderConnections.disconnectAll(); // disconnect signals from provider
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ISimulator::isAircraftInRangeOrTestMode(const CCallsign &callsign) const
|
||||||
|
{
|
||||||
|
return this->isTestMode() || this->isAircraftInRange(callsign);
|
||||||
|
}
|
||||||
|
|
||||||
bool ISimulator::disconnectFrom()
|
bool ISimulator::disconnectFrom()
|
||||||
{
|
{
|
||||||
// supposed to be overridden
|
// supposed to be overridden
|
||||||
|
|||||||
@@ -209,6 +209,12 @@ namespace BlackCore
|
|||||||
//! Simulator running?
|
//! Simulator running?
|
||||||
virtual bool isSimulating() const { return this->isConnected(); }
|
virtual bool isSimulating() const { return this->isConnected(); }
|
||||||
|
|
||||||
|
//! Set test mode
|
||||||
|
void setTestMode(bool test) { m_test = test; }
|
||||||
|
|
||||||
|
//! Test mode?
|
||||||
|
bool isTestMode() const { return m_test; }
|
||||||
|
|
||||||
//! Debug function to check state after all aircraft have been removed
|
//! Debug function to check state after all aircraft have been removed
|
||||||
//! \remarks only in local developer builds
|
//! \remarks only in local developer builds
|
||||||
virtual BlackMisc::CStatusMessageList debugVerifyStateAfterAllAircraftRemoved() const;
|
virtual BlackMisc::CStatusMessageList debugVerifyStateAfterAllAircraftRemoved() const;
|
||||||
@@ -551,6 +557,9 @@ namespace BlackCore
|
|||||||
//! Unified qeeing aircraft message
|
//! Unified qeeing aircraft message
|
||||||
void logAddingAircraftModel(const BlackMisc::Simulation::CSimulatedAircraft &aircraft) const;
|
void logAddingAircraftModel(const BlackMisc::Simulation::CSimulatedAircraft &aircraft) const;
|
||||||
|
|
||||||
|
//! Test version aware version of isAircraftInRange
|
||||||
|
bool isAircraftInRangeOrTestMode(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||||
|
|
||||||
//! Lookup against DB data
|
//! Lookup against DB data
|
||||||
static BlackMisc::Simulation::CAircraftModel reverseLookupModel(const BlackMisc::Simulation::CAircraftModel &model);
|
static BlackMisc::Simulation::CAircraftModel reverseLookupModel(const BlackMisc::Simulation::CAircraftModel &model);
|
||||||
|
|
||||||
@@ -620,6 +629,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
// misc.
|
// misc.
|
||||||
bool m_networkConnected = false; //!< flight network connected
|
bool m_networkConnected = false; //!< flight network connected
|
||||||
|
bool m_test = false; //!< test mode?
|
||||||
BlackMisc::Aviation::CCallsignSet m_callsignsToBeRendered; //!< callsigns which will be rendered
|
BlackMisc::Aviation::CCallsignSet m_callsignsToBeRendered; //!< callsigns which will be rendered
|
||||||
BlackMisc::CConnectionGuard m_remoteAircraftProviderConnections; //!< connected signal/slots
|
BlackMisc::CConnectionGuard m_remoteAircraftProviderConnections; //!< connected signal/slots
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1602,7 +1602,7 @@ namespace BlackSimPlugin
|
|||||||
const CSimConnectObject removedPendingObj = this->removeFromAddPendingAndAddAgainAircraft(callsign);
|
const CSimConnectObject removedPendingObj = this->removeFromAddPendingAndAddAgainAircraft(callsign);
|
||||||
|
|
||||||
// create AI after crosschecking it
|
// create AI after crosschecking it
|
||||||
if (!probe && !this->isAircraftInRange(callsign))
|
if (!probe && !this->isAircraftInRangeOrTestMode(callsign))
|
||||||
{
|
{
|
||||||
CLogMessage(this).info(u"Skipping adding of '%1' since it is no longer in range") << callsign.asString();
|
CLogMessage(this).info(u"Skipping adding of '%1' since it is no longer in range") << callsign.asString();
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user