swift
Public Types | Public Member Functions | Static Public Member Functions | List of all members
swift::simplugin::fsxcommon::CSimConnectObject Class Reference

Class representing a SimConnect object. More...

Public Types

enum  SimObjectType { AircraftNonAtc , AircraftSimulatedObject , TerrainProbe , AllTypes }
 Type.
 

Public Member Functions

 CSimConnectObject ()
 Constructor.
 
 CSimConnectObject (SimObjectType type)
 Constructor.
 
 CSimConnectObject (const swift::misc::simulation::CSimulatedAircraft &aircraft, DWORD requestId, swift::misc::simulation::ISimulationEnvironmentProvider *simEnvProvider, swift::misc::simulation::IInterpolationSetupProvider *setupProvider, swift::misc::simulation::IRemoteAircraftProvider *remoteAircraftProvider, swift::misc::simulation::CInterpolationLogger *logger)
 Constructor providing initial situation/parts.
 
const swift::misc::aviation::CCallsigngetCallsign () const
 Get callsign.
 
const QString & getCallsignAsString () const
 Get callsign.
 
bool hasCallsign () const
 Callsign?
 
const swift::misc::simulation::CSimulatedAircraftgetAircraft () const
 Simulated aircraft (as added)
 
const swift::misc::simulation::CAircraftModelgetAircraftModel () const
 Simulated aircraft model.
 
const QString & getAircraftModelString () const
 Simulated aircraft model string.
 
SimObjectType getType () const
 Object type.
 
const QString & getTypeAsString () const
 Type as string.
 
bool isAircraft () const
 Aircraft?
 
bool isAircraftSimulatedObject () const
 Aircraft simulated object?
 
bool isAircraftNonAtc () const
 Aircraft NON ATC?
 
bool isTerrainProbe () const
 Probe?
 
void setType (SimObjectType type)
 Set the type.
 
void setAircraft (const swift::misc::simulation::CSimulatedAircraft &aircraft)
 Set the aircraft.
 
void setAircraftModelString (const QString &modelString)
 Set model string.
 
void setAircraftCG (const swift::misc::physical_quantities::CLength &cg)
 Set CG.
 
const swift::misc::aviation::CAircraftLightsgetCurrentLightsInSimulator () const
 Get current lights (requested from simulator)
 
bool hasCurrentLightsInSimulator () const
 Received lights in simulator.
 
void setCurrentLightsInSimulator (const swift::misc::aviation::CAircraftLights &lights)
 Set current lights when received from simulator.
 
void fakeCurrentLightsInSimulator ()
 Pretend to have received lights from simulator.
 
const swift::misc::aviation::CAircraftLightsgetLightsAsSent () const
 Lights as sent to simulator.
 
void setLightsAsSent (const swift::misc::aviation::CAircraftLights &lights)
 Lights as sent to simulator.
 
SIMCONNECT_PERIOD getSimDataPeriod () const
 How often do we request data from simulator for this remote aircraft.
 
void setSimDataPeriod (SIMCONNECT_PERIOD period)
 How often do we request data from simulator for this remote aircraft.
 
void setRequestId (DWORD id)
 Set Simconnect request id.
 
DWORD getRequestId () const
 Get SimConnect request id.
 
DWORD getRequestId (CSimConnectDefinitions::SimObjectRequest offset) const
 Get SimConnect with offset.
 
void setObjectId (DWORD id)
 Set Simconnect object id.
 
DWORD getObjectId () const
 Get SimConnect object id.
 
QString getObjectIdAsString () const
 Get SimConnect object id.
 
bool hasValidRequestId () const
 Valid request id?
 
bool hasValidObjectId () const
 Valid object id?
 
bool isPendingAdded () const
 Object is requested in simulator, not yet confirmed added.
 
bool isOutdatedPendingAdded (qint64 thresholdMs=5000, qint64 currentMsSinceEpoch=-1) const
 Still pending.
 
bool isConfirmedAdded () const
 Adding is confirmed.
 
void setConfirmedAdded (bool confirm)
 Marked as confirmed, means the simulator has "confirmed" the objectId as added and not instantly removed the object.
 
bool isPendingRemoved () const
 Removing is pending.
 
bool isReadyToSend () const
 Object which can be used for sending, not pending and valid ids.
 
void setPendingRemoved (bool pending)
 Marked as pending for removal.
 
bool isPending () const
 Pending added or removed?
 
bool hasCamera () const
 Has camera?
 
void resetCameraPositions ()
 Reset camera positions.
 
const SIMCONNECT_DATA_XYZ & cameraPosition () const
 Camera position.
 
const SIMCONNECT_DATA_PBHcameraRotation () const
 Camera rotation;.
 
void setCameraPositionAndRotation (const SIMCONNECT_DATA_XYZ &position, const SIMCONNECT_DATA_PBH &rotation)
 Camera position/rotation.
 
GUID getCameraGUID () const
 Camera GUID.
 
void setCameraGUID (GUID guid)
 Set camera GUID.
 
void removeCamera ()
 No camera anymore.
 
void setObserverName (const QString &observer)
 Set observer.
 
const QString & getObserverName () const
 Observer name.
 
void resetState ()
 Reset the state (like it was a new onject) without affecting interpolator and aircraft.
 
void resetToAddAgain ()
 Reset so it can be added again.
 
void resetTimestampToNow ()
 Reset the timestamp.
 
bool isVtol () const
 VTOL?
 
bool isValid () const
 Valid?
 
bool isInvalid () const
 Invalid?
 
bool hasCreatedTimestamp () const
 Created timestamp?
 
qint64 getCreatedTimestamp () const
 Created timestamp.
 
int getEngineCount () const
 Engine count.
 
bool hasValidRequestAndObjectId () const
 Was the object really added to simulator.
 
int getAddingExceptions () const
 Adding has been failed before.
 
void setAddingExceptions (int number)
 Set adding failed before.
 
void increaseAddingExceptions ()
 Increase adding exception.
 
void decreaseAddingExceptions ()
 Decrease adding exception.
 
int getAddingDirectlyRemoved () const
 Adding and directly removed.
 
void setAddingDirectlyRemoved (int number)
 Set adding and directly removed.
 
void increaseAddingDirectlyRemoved ()
 Increase adding and directly removed.
 
void copyAddingFailureCounters (const CSimConnectObject &otherObject)
 Copy the counters from another object.
 
const QByteArray & getCallsignByteArray () const
 Callsign as LATIN1.
 
QString getInterpolatorInfo (swift::misc::simulation::CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const
 Get an interpolator info string (for debug info) More...
 
void attachInterpolatorLogger (swift::misc::simulation::CInterpolationLogger *logger) const
 Attach an observer to read the interpolator's state for debugging. More...
 
swift::misc::simulation::CInterpolationResult getInterpolation (qint64 currentTimeSinceEpoch, const swift::misc::simulation::CInterpolationAndRenderingSetupPerCallsign &setup, uint32_t aircraftNumber) const
 Get interpolated situation. More...
 
const swift::misc::aviation::CAircraftSituationgetLastInterpolatedSituation (swift::misc::simulation::CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const
 Latest interpolation result. More...
 
const swift::misc::CStatusMessageListgetInterpolationMessages (swift::misc::simulation::CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const
 Interpolation messages. More...
 
swift::misc::simulation::CInterpolatorMultigetInterpolator () const
 Interpolator.
 
QString toQString () const
 SimObject as string.
 
bool isAddedWhileRemoving ()
 Special states.
 
void setAddedWhileRemoving (bool addedWileRemoved)
 Special states.
 
bool isRemovedWhileAdding () const
 Special states.
 
void setRemovedWhileAdding (bool removedWhileAdding)
 Special states.
 

Static Public Member Functions

static SimObjectType requestIdToType (DWORD requestId)
 Type of id.
 
static const QString & typeToString (SimObjectType type)
 Type to string.
 
static bool isSameTypeGroup (SimObjectType t1, SimObjectType t2)
 Same type.
 
static bool isAircraft (SimObjectType type)
 Aircraft?
 

Detailed Description

Class representing a SimConnect object.

Definition at line 21 of file simconnectobject.h.

Member Function Documentation

◆ attachInterpolatorLogger()

void swift::simplugin::fsxcommon::CSimConnectObject::attachInterpolatorLogger ( swift::misc::simulation::CInterpolationLogger logger) const

Attach an observer to read the interpolator's state for debugging.

Remarks
parts logging has a bool log flag

Definition at line 192 of file simconnectobject.cpp.

◆ getInterpolation()

CInterpolationResult swift::simplugin::fsxcommon::CSimConnectObject::getInterpolation ( qint64  currentTimeSinceEpoch,
const swift::misc::simulation::CInterpolationAndRenderingSetupPerCallsign setup,
uint32_t  aircraftNumber 
) const

Get interpolated situation.

Parameters
currentTimeSinceEpochmilliseconds since epoch for which the situation should be interpolated
setupinterpolation setup
aircraftNumbernumber used to spread the computational load of part interpolation
Returns
interpolation result

Definition at line 198 of file simconnectobject.cpp.

◆ getInterpolationMessages()

const CStatusMessageList & swift::simplugin::fsxcommon::CSimConnectObject::getInterpolationMessages ( swift::misc::simulation::CInterpolationAndRenderingSetupBase::InterpolatorMode  mode) const

Interpolation messages.

Definition at line 214 of file simconnectobject.cpp.

◆ getInterpolatorInfo()

QString swift::simplugin::fsxcommon::CSimConnectObject::getInterpolatorInfo ( swift::misc::simulation::CInterpolationAndRenderingSetupBase::InterpolatorMode  mode) const

Get an interpolator info string (for debug info)

Definition at line 186 of file simconnectobject.cpp.

◆ getLastInterpolatedSituation()

const CAircraftSituation & swift::simplugin::fsxcommon::CSimConnectObject::getLastInterpolatedSituation ( swift::misc::simulation::CInterpolationAndRenderingSetupBase::InterpolatorMode  mode) const

Latest interpolation result.

Definition at line 207 of file simconnectobject.cpp.


The documentation for this class was generated from the following files: