6 #ifndef SWIFT_SIMPLUGIN_FLIGHTGEAR_TRAFFIC_PROXY_H
7 #define SWIFT_SIMPLUGIN_FLIGHTGEAR_TRAFFIC_PROXY_H
11 #include <QStringList>
21 class QDBusConnection;
24 #define FGSWIFTBUS_TRAFFIC_INTERFACENAME "org.swift_project.fgswiftbus.traffic"
25 #define FGSWIFTBUS_TRAFFIC_OBJECTPATH "/fgswiftbus/traffic"
28 namespace swift::simplugin::flightgear
47 if (s !=
rollsDeg.size()) {
return false; }
168 static QString s(FGSWIFTBUS_TRAFFIC_INTERFACENAME);
175 static QString s(FGSWIFTBUS_TRAFFIC_OBJECTPATH);
183 bool isValid()
const {
return m_dbusInterface->isValid(); }
208 void addPlane(
const QString &callsign,
const QString &modelName,
const QString &aircraftIcao,
209 const QString &airlineIcao,
const QString &livery);
231 double longitudeDeg,
double altitudeMeters,
const ElevationCallback &setter)
const;
Used for hand written interface based on virtual methods.
bool isLandingOn() const
Landing lights on?
bool isBeaconOn() const
Beacon lights on?
bool isNavOn() const
Nac lights on?
bool isTaxiOn() const
Taxi lights on?
bool isStrobeOn() const
Strobes lights on?
Value object encapsulating information of aircraft's parts.
CAircraftLights getLights() const
Get aircraft lights.
bool isSpoilersOut() const
Are spoilers out?
bool isFixedGearDown() const
Is fixed gear down?
bool isAnyEngineOn() const
Any engine on?
int getFlapsPercent() const
Get flaps position in percent.
Value object encapsulating information of an aircraft's situation.
const CHeading & getHeading() const
Get heading.
bool isOnGround() const
Is on ground?
const CCallsign & getCallsign() const
Corresponding callsign.
virtual geo::CLatitude latitude() const
Latitude.
const physical_quantities::CSpeed & getGroundSpeed() const
Get ground speed.
const CAltitude & getAltitude() const
Get altitude.
const physical_quantities::CAngle & getBank() const
Get bank (angle)
const physical_quantities::CAngle & getPitch() const
Get pitch.
virtual geo::CLongitude longitude() const
Longitude.
Value object encapsulating information of a callsign.
const QString & asString() const
Get callsign (normalized)
Plane of same elevation, can be a single point or larger area (e.g. airport)
static CAngleUnit deg()
Degrees.
static CLengthUnit ft()
Foot ft.
double value(MU unit) const
Value in given unit.
static CSpeedUnit kts()
Knots.
Proxy object connected to a real FGSwiftBus::CTraffic object via DBus.
void remoteAircraftAdded(const QString &callsign)
Remote aircraft successfully added.
void setPlanesTransponders(const swift::simplugin::flightgear::PlanesTransponders &planesTransponders)
Set the transponders of multiple traffic aircrafts.
static const QString & ObjectPath()
Service path.
void setPlanesSurfaces(const swift::simplugin::flightgear::PlanesSurfaces &planesSurfaces)
Set the surfaces of multiple traffic aircrafts.
void cleanup()
Reverse the actions of initialize().
std::function< void(const QStringList &, const QDoubleList &, const QDoubleList &, const QDoubleList &, const QDoubleList &)> RemoteAircraftDataCallback
Remote aircrafts data callback.
void remoteAircraftAddingFailed(const QString &callsign)
Remote aircraft adding failed.
void addPlane(const QString &callsign, const QString &modelName, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery)
Introduce a new traffic aircraft.
bool initialize()
Initialize the multiplayer planes rendering and return true if successful.
bool isValid() const
Does the remote object exist?
void simFrame()
Simulator frame.
MultiplayerAcquireInfo acquireMultiplayerPlanes()
Returns whether multiplayer planes have been acquired. If not, owner will be set to the plugin that a...
void getElevationAtPosition(const swift::misc::aviation::CCallsign &callsign, double latitudeDeg, double longitudeDeg, double altitudeMeters, const ElevationCallback &setter) const
Get the ground elevation at an arbitrary position.
std::function< void(const swift::misc::geo::CElevationPlane &, const swift::misc::aviation::CCallsign &)> ElevationCallback
Elevation callback.
void getRemoteAircraftData(const QStringList &callsigns, const RemoteAircraftDataCallback &setter) const
Get remote aircrafts data (lat, lon, elevation and CG)
void removePlane(const QString &callsign)
Remove a traffic aircraft.
CFGSwiftBusTrafficProxy(QDBusConnection &connection, QObject *parent=nullptr, bool dummy=false)
Constructor.
void setPlanesPositions(const swift::simplugin::flightgear::PlanesPositions &planesPositions)
Set the position of multiple traffic aircrafts.
static const QString & InterfaceName()
Service name.
void removeAllPlanes()
Remove all traffic aircraft.
QList< double > QDoubleList
List of doubles.
Multiplayer Acquire Info.
QString owner
Name of the plugin having multiplayer planes acquired.
bool hasAcquired
Has FGSwiftBus acquired multiplayer planes?
QList< double > rollsDeg
List of rolls.
QList< bool > onGrounds
List of onGrounds.
QList< double > altitudesFt
List of altitudes.
QList< double > latitudesDeg
List of latitudes.
void push_back(const swift::misc::aviation::CAircraftSituation &situation)
Push back the latest situation.
bool isEmpty() const
Is empty?
QList< double > longitudesDeg
List of longitudes.
QList< double > groundSpeedKts
List of groundspeeds.
QList< double > headingsDeg
List of headings.
bool hasSameSizes() const
Check function.
QStringList callsigns
List of callsigns.
QList< double > pitchesDeg
List of pitches.
QList< bool > strobeLights
List of strobeLights.
QList< double > slats
List of slats.
QList< double > thrusts
List of thrusts.
QList< double > ailerons
List of ailerons.
QList< double > wingSweeps
List of wingSweeps.
bool isEmpty() const
Is empty?
QList< double > gears
List of gears.
QList< bool > taxiLights
List of taxi lights.
QList< double > spoilers
List of spoilers.
QList< int > lightPatterns
List of lightPatterns.
QList< double > speedBrakes
List of speedBrakes.
void push_back(const swift::misc::aviation::CCallsign &callsign, const swift::misc::aviation::CAircraftParts &parts)
Push back the latest parts.
QList< double > rudders
List of rudders.
QList< double > elevators
List of elevators.
QStringList callsigns
List of callsigns.
QList< bool > landLights
List of landLights.
QList< bool > beaconLights
List of beaconLights.
QList< double > flaps
List of flaps.
QList< bool > navLights
List of navLights.
QStringList callsigns
List of callsigns.
QList< int > codes
List of transponder codes.
bool isEmpty() const
Is empty?
QList< bool > modeCs
List of active mode C's.
QList< bool > idents
List of active idents.