mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T275, move some simple implementations into ISimulator
Goal: merge CSimulatorCommon/ISimulator
This commit is contained in:
@@ -44,11 +44,6 @@ namespace BlackCore
|
||||
return setup;
|
||||
}
|
||||
|
||||
bool ISimulator::isShuttingDownOrDisconnected() const
|
||||
{
|
||||
return (this->isShuttingDown() || !this->isConnected());
|
||||
}
|
||||
|
||||
bool ISimulator::requestElevation(const Geo::ICoordinateGeodetic &reference, const CCallsign &callsign)
|
||||
{
|
||||
Q_UNUSED(reference);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#ifndef BLACKCORE_SIMULATOR_H
|
||||
#define BLACKCORE_SIMULATOR_H
|
||||
|
||||
#include "blackcore/application.h"
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackmisc/simulation/aircraftmodellist.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
@@ -157,7 +158,11 @@ namespace BlackCore
|
||||
virtual void highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime) = 0;
|
||||
|
||||
//! Follow aircraft
|
||||
virtual bool followAircraft(const BlackMisc::Aviation::CCallsign &callsign) = 0;
|
||||
virtual bool followAircraft(const BlackMisc::Aviation::CCallsign &callsign)
|
||||
{
|
||||
Q_UNUSED(callsign);
|
||||
return false;
|
||||
}
|
||||
|
||||
//! Activates or deactivates simulator weather
|
||||
virtual void setWeatherActivated(bool activated) = 0;
|
||||
@@ -172,7 +177,7 @@ namespace BlackCore
|
||||
virtual bool isPaused() const = 0;
|
||||
|
||||
//! Simulator running?
|
||||
virtual bool isSimulating() const = 0;
|
||||
virtual bool isSimulating() const { return this->isConnected(); }
|
||||
|
||||
//! Clear all aircraft related data
|
||||
virtual void clearAllRemoteAircraftData() = 0;
|
||||
@@ -182,10 +187,11 @@ namespace BlackCore
|
||||
virtual BlackMisc::CStatusMessageList debugVerifyStateAfterAllAircraftRemoved() const = 0;
|
||||
|
||||
//! Is overall (swift) application shutting down
|
||||
virtual bool isShuttingDown() const = 0;
|
||||
//! \threadsafe
|
||||
virtual bool isShuttingDown() const { return (!sApp || sApp->isShuttingDown()); }
|
||||
|
||||
//! Shutting down or disconnected?
|
||||
virtual bool isShuttingDownOrDisconnected() const;
|
||||
virtual bool isShuttingDownOrDisconnected() const { return (this->isShuttingDown() || !this->isConnected()); }
|
||||
|
||||
//! \copydoc BlackMisc::Simulation::ISimulationEnvironmentProvider::requestElevation
|
||||
//! \remark needs to be overridden if the concrete driver supports such an option
|
||||
|
||||
@@ -355,11 +355,6 @@ namespace BlackCore
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CSimulatorCommon::isShuttingDown() const
|
||||
{
|
||||
return (!sApp || sApp->isShuttingDown());
|
||||
}
|
||||
|
||||
bool CSimulatorCommon::logicallyReAddRemoteAircraft(const CCallsign &callsign)
|
||||
{
|
||||
if (this->isShuttingDown()) { return false; }
|
||||
@@ -413,12 +408,6 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
bool CSimulatorCommon::followAircraft(const CCallsign &callsign)
|
||||
{
|
||||
Q_UNUSED(callsign);
|
||||
return false;
|
||||
}
|
||||
|
||||
int CSimulatorCommon::physicallyRemoveMultipleRemoteAircraft(const CCallsignSet &callsigns)
|
||||
{
|
||||
if (callsigns.isEmpty()) { return 0; }
|
||||
|
||||
@@ -72,13 +72,11 @@ namespace BlackCore
|
||||
|
||||
// --------- ISimulator implementations ------------
|
||||
virtual void highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime) override;
|
||||
virtual bool followAircraft(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
virtual const BlackMisc::Simulation::CSimulatorInternals &getSimulatorInternals() const override;
|
||||
virtual BlackMisc::Aviation::CAirportList getAirportsInRange() const override;
|
||||
virtual void setWeatherActivated(bool activated) override;
|
||||
virtual void unload() override;
|
||||
virtual bool disconnectFrom() override;
|
||||
virtual bool isShuttingDown() const override;
|
||||
virtual bool logicallyReAddRemoteAircraft(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
virtual BlackMisc::Aviation::CCallsignSet unrenderedEnabledAircraft() const override;
|
||||
virtual BlackMisc::Aviation::CCallsignSet renderedDisabledAircraft() const override;
|
||||
|
||||
Reference in New Issue
Block a user