mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
refs #873, use events for lights
* added members for sim objects * receive lights for (remote) aircraft from simulator * update lights * utility functions for request ids
This commit is contained in:
committed by
Mathew Sutcliffe
parent
9c2682f386
commit
a61abfcb8b
@@ -13,7 +13,7 @@
|
||||
#define BLACKSIMPLUGIN_SIMCONNECT_OBJECT_H
|
||||
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "simconnect/SimConnect.h"
|
||||
#include "simconnectdatadefinition.h"
|
||||
#include <QSharedPointer>
|
||||
|
||||
namespace BlackMisc { namespace Simulation { class IInterpolator; } }
|
||||
@@ -43,6 +43,24 @@ namespace BlackSimPlugin
|
||||
//! Simulated aircraft model string
|
||||
const QString &getAircraftModelString() const { return m_aircraft.getModelString(); }
|
||||
|
||||
//! Get current lights (requested from simulator)
|
||||
const BlackMisc::Aviation::CAircraftLights &getCurrentLightsInSimulator() const { return m_currentLightsInSim; }
|
||||
|
||||
//! Set current lights when received from simulator
|
||||
void setCurrentLightsInSimulator(const BlackMisc::Aviation::CAircraftLights &lights) { m_currentLightsInSim = lights; }
|
||||
|
||||
//! Parts as sent to simulator
|
||||
const DataDefinitionRemoteAircraftParts &getPartsAsSent() const { return m_partsAsSent; }
|
||||
|
||||
//! Parts as sent to simulator
|
||||
void setPartsAsSent(const DataDefinitionRemoteAircraftParts &parts) { m_partsAsSent = parts; }
|
||||
|
||||
//! Lights as sent to simulator
|
||||
const BlackMisc::Aviation::CAircraftLights &getLightsAsSent() const { return m_lightsAsSent; }
|
||||
|
||||
//! Lights as sent to simulator
|
||||
void setLightsAsSent(const BlackMisc::Aviation::CAircraftLights &lights) { m_lightsAsSent = lights; }
|
||||
|
||||
//! How often do we request data from simulator for this remote aircraft
|
||||
SIMCONNECT_PERIOD getSimDataPeriod() const { return m_requestSimDataPeriod; }
|
||||
|
||||
@@ -89,14 +107,18 @@ namespace BlackSimPlugin
|
||||
bool hasValidRequestAndObjectId() const;
|
||||
|
||||
private:
|
||||
BlackMisc::Simulation::CSimulatedAircraft m_aircraft;
|
||||
BlackMisc::Simulation::CSimulatedAircraft m_aircraft; //!< corresponding aircraft
|
||||
DWORD m_requestId = 0;
|
||||
DWORD m_objectId = 0;
|
||||
SIMCONNECT_PERIOD m_requestSimDataPeriod = SIMCONNECT_PERIOD_NEVER; //!< how often do we query ground elevation
|
||||
bool m_validRequestId = false;
|
||||
bool m_validObjectId = false;
|
||||
bool m_confirmedAdded = false;
|
||||
bool m_pendingRemoved = false;
|
||||
int m_lightsRequestedAt = -1;
|
||||
DataDefinitionRemoteAircraftParts m_partsAsSent {}; //!< parts as sent
|
||||
BlackMisc::Aviation::CAircraftLights m_currentLightsInSim { nullptr }; //!< current lights to know state for toggling
|
||||
BlackMisc::Aviation::CAircraftLights m_lightsAsSent { nullptr }; //!< lights as sent to simulator
|
||||
SIMCONNECT_PERIOD m_requestSimDataPeriod = SIMCONNECT_PERIOD_NEVER; //!< how often do we query ground elevation
|
||||
};
|
||||
|
||||
//! Simulator objects (aka AI aircraft)
|
||||
|
||||
Reference in New Issue
Block a user