mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 01:35:45 +08:00
Ref T312, simulator factory not copyable plus check function (bypassing timer)
This commit is contained in:
@@ -1145,4 +1145,10 @@ namespace BlackCore
|
|||||||
this->stopImpl();
|
this->stopImpl();
|
||||||
m_isRunning = false;
|
m_isRunning = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ISimulatorListener::check()
|
||||||
|
{
|
||||||
|
if (!m_isRunning) { return; }
|
||||||
|
this->checkImpl();
|
||||||
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -584,9 +584,6 @@ namespace BlackCore
|
|||||||
//! Info about the backend system (if available)
|
//! Info about the backend system (if available)
|
||||||
virtual QString backendInfo() const;
|
virtual QString backendInfo() const;
|
||||||
|
|
||||||
//! Overall (swift) application shutting down
|
|
||||||
virtual bool isShuttingDown() const;
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
//! Start listening for the simulator to start.
|
//! Start listening for the simulator to start.
|
||||||
void start();
|
void start();
|
||||||
@@ -594,6 +591,9 @@ namespace BlackCore
|
|||||||
//! Stops listening.
|
//! Stops listening.
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
|
//! Check simulator availability
|
||||||
|
void check();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! Emitted when the listener discovers the simulator running.
|
//! Emitted when the listener discovers the simulator running.
|
||||||
void simulatorStarted(const BlackMisc::Simulation::CSimulatorPluginInfo &info);
|
void simulatorStarted(const BlackMisc::Simulation::CSimulatorPluginInfo &info);
|
||||||
@@ -603,12 +603,18 @@ namespace BlackCore
|
|||||||
//! \sa ISimulatorFactory::createListener().
|
//! \sa ISimulatorFactory::createListener().
|
||||||
ISimulatorListener(const BlackMisc::Simulation::CSimulatorPluginInfo &info);
|
ISimulatorListener(const BlackMisc::Simulation::CSimulatorPluginInfo &info);
|
||||||
|
|
||||||
|
//! Overall (swift) application shutting down
|
||||||
|
virtual bool isShuttingDown() const;
|
||||||
|
|
||||||
//! Plugin specific implementation to start listener
|
//! Plugin specific implementation to start listener
|
||||||
virtual void startImpl() = 0;
|
virtual void startImpl() = 0;
|
||||||
|
|
||||||
//! Plugin specific implementation to stop listener
|
//! Plugin specific implementation to stop listener
|
||||||
virtual void stopImpl() = 0;
|
virtual void stopImpl() = 0;
|
||||||
|
|
||||||
|
//! Plugin specific implementation to check
|
||||||
|
virtual void checkImpl() = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BlackMisc::Simulation::CSimulatorPluginInfo m_info;
|
BlackMisc::Simulation::CSimulatorPluginInfo m_info;
|
||||||
bool m_isRunning = false;
|
bool m_isRunning = false;
|
||||||
@@ -621,6 +627,11 @@ namespace BlackCore
|
|||||||
//! ISimulatorVirtual destructor
|
//! ISimulatorVirtual destructor
|
||||||
virtual ~ISimulatorFactory() {}
|
virtual ~ISimulatorFactory() {}
|
||||||
|
|
||||||
|
//! Not copyable @{
|
||||||
|
ISimulatorFactory(const ISimulatorFactory &) = delete;
|
||||||
|
ISimulatorFactory &operator=(const ISimulatorFactory &) = delete;
|
||||||
|
//! @}
|
||||||
|
|
||||||
//! Create a new instance of a driver
|
//! Create a new instance of a driver
|
||||||
//! \param info metadata about simulator
|
//! \param info metadata about simulator
|
||||||
//! \param ownAircraftProvider in memory access to own aircraft data
|
//! \param ownAircraftProvider in memory access to own aircraft data
|
||||||
@@ -638,6 +649,10 @@ namespace BlackCore
|
|||||||
|
|
||||||
//! Simulator listener instance
|
//! Simulator listener instance
|
||||||
virtual ISimulatorListener *createListener(const BlackMisc::Simulation::CSimulatorPluginInfo &info) = 0;
|
virtual ISimulatorListener *createListener(const BlackMisc::Simulation::CSimulatorPluginInfo &info) = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
//! Default ctor
|
||||||
|
ISimulatorFactory() {}
|
||||||
};
|
};
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user