6#ifndef SWIFT_SIMPLUGIN_EMULATED_SIMULATOREMULATED_H
7#define SWIFT_SIMPLUGIN_EMULATED_SIMULATOREMULATED_H
25namespace swift::simplugin::emulated
41 swift::
misc::simulation::IOwnAircraftProvider *ownAircraftProvider,
42 swift::
misc::simulation::IRemoteAircraftProvider *remoteAircraftProvider,
43 swift::
misc::network::IClientProvider *clientProvider,
QObject *
parent =
nullptr);
58 const swift::
misc::CIdentifier &originator) override;
60 const swift::
misc::CIdentifier &originator) override;
65 swift::
misc::CStatusMessageList
68 const swift::
misc::aviation::CAircraftSituation &situation,
69 const swift::
misc::aviation::CAircraftParts &parts) override;
71 const swift::
misc::aviation::CCallsign &callsign) override;
147 bool canDisplay()
const;
153 void onSettingsChanged();
156 void onSimulatorStatusChanged();
159 void connectOwnSignals();
163 void updateRemoteAircraft();
166 bool m_paused =
false;
167 bool m_connected =
true;
168 bool m_simulating =
true;
169 int m_countInterpolatedSituations = 0;
170 int m_countInterpolatedParts = 0;
171 QTimer m_interpolatorFetchTimer;
178 this, &CSimulatorEmulated::onSettingsChanged
Interface to a simulator.
Interface to a simulator listener.
List of QMetaObject::Connection.
Class template for accessing a specific value in the CSettingsCache.
Utility methods for simple line parsing used with the command line.
Value object encapsulating information of aircraft's parts.
Value object encapsulating information of an aircraft's situation.
Value object encapsulating information of a callsign.
COM system (aka "radio").
Comprehensive information of an aircraft.
Value object encapsulating a list of aircraft.
Simple hardcoded info about the corresponding simulator.
Describing a simulator plugin.
Direct in memory access to interpolation setup, normally implemented by simulator.
Direct in memory access to elevation data.
Common base class for simulator plugins.
bool updateOwnSimulatorSelcal(const swift::misc::aviation::CSelcal &selcal, const swift::misc::CIdentifier &originator)
Update own aircraft cockpit (usually from context).
bool isInterpolatorFetching() const
Is fetching from interpolator.
bool testSendSituationAndParts(const swift::misc::aviation::CCallsign &callsign, const swift::misc::aviation::CAircraftSituation &situation, const swift::misc::aviation::CAircraftParts &parts)
Send situation/parts for testing.
bool changeRemoteAircraftModel(const swift::misc::simulation::CSimulatedAircraft &aircraft)
Change remote aircraft per property.
swift::misc::simulation::CSimulatorInfo getEmulatedSimulator() const
The emulated simulated simulator.
bool disconnectFrom()
Disconnect from simulator.
bool physicallyAddRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &remoteAircraft)
Add new remote aircraft physically to the simulator.
void internalAircraftChanged()
Internal aircraft changed.
swift::misc::aviation::CCallsignSet physicallyRenderedAircraft() const
Physically rendered (displayed in simulator) This shall only return aircraft handled in the simulator...
CSimulatorEmulated(const swift::misc::simulation::CSimulatorPluginInfo &info, swift::misc::simulation::IOwnAircraftProvider *ownAircraftProvider, swift::misc::simulation::IRemoteAircraftProvider *remoteAircraftProvider, swift::misc::network::IClientProvider *clientProvider, QObject *parent=nullptr)
Constructor, parameters as in.
bool connectTo()
Connect to simulator.
bool updateOwnSimulatorCockpit(const swift::misc::simulation::CSimulatedAircraft &aircraft, const swift::misc::CIdentifier &originator)
Update own aircraft cockpit (usually from context).
swift::misc::CStatusMessageList getInterpolationMessages(const swift::misc::aviation::CCallsign &callsign) const
Interpolation messages for callsign.
bool logicallyRemoveRemoteAircraft(const swift::misc::aviation::CCallsign &callsign)
Logically remove remote aircraft from simulator. Depending on max. aircraft, enabled status etc....
const swift::misc::simulation::CSimulatedAircraft & getInternalOwnAircraft() const
Internal own aircraft.
bool requestElevation(const swift::misc::geo::ICoordinateGeodetic &reference, const swift::misc::aviation::CCallsign &callsign)
Request elevation, there is no guarantee the requested elevation will be available in the provider.
bool changeInternalSituation(const swift::misc::aviation::CAircraftSituation &situation)
Simulator internal change of situation.
friend class CSimulatorEmulatedMonitorDialog
the monitor widget represents the simulator and needs access to internals (i.e.
void displayTextMessage(const swift::misc::network::CTextMessage &message) const
Display a text message.
bool changeInternalCom(const swift::misc::simulation::CSimulatedAircraft &aircraft)
Simulator internal change of COM values.
bool isSimulating() const
Simulator running?
bool setInterpolatorFetchTime(int timeMs)
Interpolator fetch time, <=0 stops.
void unload()
Driver will be unloaded.
bool parseDetails(const swift::misc::CSimpleCommandParser &parser)
Parsed in derived classes.
static void registerHelp()
Register help.
bool changeInternalParts(const swift::misc::aviation::CAircraftParts &parts)
Simulator internal change of parts.
int physicallyRemoveMultipleRemoteAircraft(const swift::misc::aviation::CCallsignSet &callsigns)
Remove remote aircraft from simulator.
bool changeInternalSelcal(const swift::misc::aviation::CSelcal &selcal)
Simulator internal change of SELCAL.
bool changeRemoteAircraftEnabled(const swift::misc::simulation::CSimulatedAircraft &aircraft)
Aircraft got enabled / disabled.
bool logicallyAddRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &remoteAircraft)
Logically add a new aircraft. Depending on max. aircraft, enabled status etc. it will physically adde...
bool physicallyRemoveRemoteAircraft(const swift::misc::aviation::CCallsign &callsign)
Remove remote aircraft from simulator.
bool isConnected() const
Are we connected to the simulator?
bool isPaused() const
Simulator paused?
bool isPhysicallyRenderedAircraft(const swift::misc::aviation::CCallsign &callsign) const
Is the aircraft rendered (displayed in simulator)? This shall only return true if the aircraft is rea...
void displayStatusMessage(const swift::misc::CStatusMessage &message) const
Display a status message in the simulator.
void setCombinedStatus(bool connected, bool simulating, bool paused)
UI setter.
int physicallyRemoveAllRemoteAircraft()
Remove all remote aircraft and their data via ISimulator::clearAllRemoteAircraftData.
void startImpl()
Plugin specific implementation to start listener.
CSimulatorEmulatedListener(const swift::misc::simulation::CSimulatorPluginInfo &info)
Constructor.
void checkImpl()
Plugin specific implementation to stop listener.
void stopImpl()
Plugin specific implementation to stop listener.
bool parseCommandLine(const QString &commandLine, const swift::misc::CIdentifier &originator)
Free functions in swift::misc.
QObject * parent() const const