mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
refs #808, set internals object for FS9
(only basic code, needs to be completed)
This commit is contained in:
@@ -48,9 +48,13 @@ namespace BlackSimPlugin
|
||||
|
||||
dLow = dLow / 65536.0;
|
||||
if (dHigh > 0)
|
||||
{
|
||||
dHigh = dHigh + dLow;
|
||||
}
|
||||
else
|
||||
{
|
||||
dHigh = dHigh - dLow;
|
||||
}
|
||||
|
||||
CCoordinateGeodetic position;
|
||||
position.setLatitude(CLatitude(dHigh * 90.0 / 10001750.0, CAngleUnit::deg()));
|
||||
@@ -60,9 +64,13 @@ namespace BlackSimPlugin
|
||||
|
||||
dLow = dLow / 65536.0;
|
||||
if (dHigh > 0)
|
||||
{
|
||||
dHigh = dHigh + dLow;
|
||||
}
|
||||
else
|
||||
{
|
||||
dHigh = dHigh - dLow;
|
||||
}
|
||||
|
||||
position.setLongitude(CLongitude(dHigh * 360.0 / (65536.0 * 65536.0), CAngleUnit::deg()));
|
||||
|
||||
@@ -133,6 +141,7 @@ namespace BlackSimPlugin
|
||||
m_fsuipc->connect(); // connect FSUIPC too
|
||||
}
|
||||
reloadWeatherSettings();
|
||||
initInternalsObject();
|
||||
m_dispatchTimerId = startTimer(50);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -51,48 +51,29 @@ namespace BlackSimPlugin
|
||||
//! Destructor
|
||||
virtual ~CSimulatorFs9() = default;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::connectTo()
|
||||
//! \name Interface implementations
|
||||
//! \@{
|
||||
virtual bool connectTo() override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::disconnectFrom()
|
||||
virtual bool disconnectFrom() override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::physicallyAddRemoteAircraft()
|
||||
virtual bool physicallyAddRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &newRemoteAircraft) override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::physicallyRemoveRemoteAircraft()
|
||||
virtual bool physicallyRemoveRemoteAircraft(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::physicallyRemoveAllRemoteAircraft
|
||||
virtual int physicallyRemoveAllRemoteAircraft() override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::physicallyRenderedAircraft
|
||||
virtual BlackMisc::Aviation::CCallsignSet physicallyRenderedAircraft() const override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::isPhysicallyRenderedAircraft
|
||||
virtual bool isPhysicallyRenderedAircraft(const BlackMisc::Aviation::CCallsign &callsign) const override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::updateOwnSimulatorCockpit()
|
||||
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft, const BlackMisc::CIdentifier &originator) override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::displayStatusMessage()
|
||||
virtual void displayStatusMessage(const BlackMisc::CStatusMessage &message) const override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::displayTextMessage()
|
||||
virtual void displayTextMessage(const BlackMisc::Network::CTextMessage &message) const override;
|
||||
//! \@}
|
||||
|
||||
protected:
|
||||
//! \copydoc BlackCore::ISimulator::isConnected()
|
||||
//! \name Interface implementations
|
||||
//! \@{
|
||||
virtual bool isConnected() const override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::isSimulating
|
||||
virtual bool isSimulating() const override { return isConnected(); }
|
||||
|
||||
//! Timer event
|
||||
virtual void timerEvent(QTimerEvent *event) override;
|
||||
//! \@}
|
||||
|
||||
private slots:
|
||||
|
||||
//! Dispatch SimConnect messages
|
||||
void ps_dispatch();
|
||||
|
||||
@@ -100,10 +81,10 @@ namespace BlackSimPlugin
|
||||
void ps_processFs9Message(const QByteArray &message);
|
||||
|
||||
private:
|
||||
|
||||
//! Called when data about our own aircraft are received
|
||||
void updateOwnAircraftFromSimulator(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft);
|
||||
|
||||
//! Disconnect all clients
|
||||
void disconnectAllClients();
|
||||
|
||||
//! Inject weather grid to simulator
|
||||
|
||||
Reference in New Issue
Block a user