mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
Ref T270, Ref T268, plugin common / simulator improvements
* connect with "about to quit" * added interface declarations * sim statistics, use common function setStatsRemoteAircraftUpdate and double for average values
This commit is contained in:
@@ -61,10 +61,10 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CSimulatorEmulated::connectTo()
|
||||
{
|
||||
const QPointer<CSimulatorEmulated> guard(this);
|
||||
const QPointer<CSimulatorEmulated> myself(this);
|
||||
QTimer::singleShot(1000, this, [ = ]
|
||||
{
|
||||
if (guard.isNull()) { return; }
|
||||
if (myself.isNull()) { return; }
|
||||
this->emitSimulatorCombinedStatus();
|
||||
m_monitorWidget->show();
|
||||
});
|
||||
@@ -75,9 +75,15 @@ namespace BlackSimPlugin
|
||||
|
||||
bool CSimulatorEmulated::disconnectFrom()
|
||||
{
|
||||
if (canLog()) m_monitorWidget->appendReceivingCall(Q_FUNC_INFO);
|
||||
if (canLog()) { m_monitorWidget->appendReceivingCall(Q_FUNC_INFO); }
|
||||
m_renderedAircraft.clear();
|
||||
return true;
|
||||
return CSimulatorPluginCommon::disconnectFrom();
|
||||
}
|
||||
|
||||
void CSimulatorEmulated::unload()
|
||||
{
|
||||
if (canLog()) { m_monitorWidget->appendReceivingCall(Q_FUNC_INFO); }
|
||||
return CSimulatorPluginCommon::unload();
|
||||
}
|
||||
|
||||
bool CSimulatorEmulated::logicallyAddRemoteAircraft(const CSimulatedAircraft &remoteAircraft)
|
||||
|
||||
@@ -34,6 +34,10 @@ namespace BlackSimPlugin
|
||||
class CSimulatorEmulated : public Common::CSimulatorPluginCommon
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(BlackCore::ISimulator)
|
||||
Q_INTERFACES(BlackMisc::Simulation::ISimulationEnvironmentProvider)
|
||||
Q_INTERFACES(BlackMisc::Simulation::IInterpolationSetupProvider)
|
||||
|
||||
friend class CSimulatorEmulatedMonitorDialog; //!< the monitor widget represents the simulator and needs access to internals (i.e. private/protected)
|
||||
|
||||
public:
|
||||
@@ -50,6 +54,7 @@ namespace BlackSimPlugin
|
||||
virtual bool isTimeSynchronized() const override;
|
||||
virtual bool connectTo() override;
|
||||
virtual bool disconnectFrom() override;
|
||||
virtual void unload() override;
|
||||
virtual bool changeRemoteAircraftModel(const BlackMisc::Simulation::CSimulatedAircraft &aircraft) override;
|
||||
virtual bool changeRemoteAircraftEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft) override;
|
||||
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const BlackMisc::CIdentifier &originator) override;
|
||||
|
||||
Reference in New Issue
Block a user