6 #ifndef SWIFT_SIMPLUGIN_XSWIFTBUS_TRAFFIC_PROXY_H
7 #define SWIFT_SIMPLUGIN_XSWIFTBUS_TRAFFIC_PROXY_H
11 #include <QStringList>
22 class QDBusConnection;
25 #define XSWIFTBUS_TRAFFIC_INTERFACENAME "org.swift_project.xswiftbus.traffic"
26 #define XSWIFTBUS_TRAFFIC_OBJECTPATH "/xswiftbus/traffic"
29 namespace swift::simplugin::xplane
51 if (s !=
rollsDeg.size()) {
return false; }
170 static QString s(XSWIFTBUS_TRAFFIC_INTERFACENAME);
177 static QString s(XSWIFTBUS_TRAFFIC_OBJECTPATH);
188 bool isValid()
const {
return m_dbusInterface->isValid(); }
224 void addPlane(
const QString &callsign,
const QString &modelName,
const QString &aircraftIcao,
225 const QString &airlineIcao,
const QString &livery);
250 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 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.
Proxy object connected to a real XSwiftBus::CTraffic object via DBus.
void cleanup()
Reverse the actions of initialize().
static const QString & ObjectPath()
Service path.
void setMaxPlanes(int planes)
Set the maximum number of aircraft.
void addPlane(const QString &callsign, const QString &modelName, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery)
Introduce a new traffic aircraft.
MultiplayerAcquireInfo acquireMultiplayerPlanes()
Returns whether multiplayer planes have been acquired. If not, owner will be set to the plugin that a...
void remoteAircraftAddingFailed(const QString &callsign)
Remote aircraft adding failed.
bool initialize()
Initialize the multiplayer planes rendering and return true if successful.
void setPlanesPositions(const swift::simplugin::xplane::PlanesPositions &planesPositions)
Set the position of multiple traffic aircrafts.
void removeAllPlanes()
Remove all traffic aircraft.
void setFollowedAircraft(const QString &callsign)
Sets the aircraft with callsign to be followed in plane view.
void simFrame()
Simulator frame.
void setMaxDrawDistance(double nauticalMiles)
Set the maximum distance at which to draw aircraft (nautical miles).
void setPlanesSurfaces(const swift::simplugin::xplane::PlanesSurfaces &planesSurfaces)
Set the flight control surfaces and lights of multiple traffic aircrafts.
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.
void setInterpolatorMode(const QString &callsign, bool spline)
QString loadPlanesPackage(const QString &path)
Load a collection of planes from the given directory and return error message if unsuccessful.
static const QString & InterfaceName()
Service name.
CXSwiftBusTrafficProxy(QDBusConnection &connection, QObject *parent=nullptr, bool dummy=false)
Constructor.
void setDefaultIcao(const QString &defaultIcao)
Set the ICAO code to use for aircraft without a model match.
void setPlanesTransponders(const swift::simplugin::xplane::PlanesTransponders &planesTransponders)
Set the transponder of multiple traffic aircraft.
std::function< void(const swift::misc::geo::CElevationPlane &, const swift::misc::aviation::CCallsign &, bool)> ElevationCallback
Elevation callback.
void removePlane(const QString &callsign)
Remove a traffic aircraft.
std::function< void(const QStringList &, const QDoubleList &, const QDoubleList &, const QDoubleList &, const QBoolList &, const QDoubleList &)> RemoteAircraftDataCallback
Remote aircrafts data callback.
bool isValid() const
Does the remote object exist?
void remoteAircraftAdded(const QString &callsign)
Remote aircraft successfully added.
static const QStringList & getLogCategories()
Log. categories.
void getRemoteAircraftData(const QStringList &callsigns, const RemoteAircraftDataCallback &setter) const
Get remote aircrafts data (lat, lon, elevation and CG)
Multiplayer Acquire Info.
bool hasAcquired
Has xswiftbus acquired multiplayer planes?
QString owner
Name of the plugin having multiplayer planes acquired.
QList< double > pitchesDeg
List of pitches.
QList< double > altitudesFt
List of altitudes.
QStringList callsigns
List of callsigns.
QList< double > headingsDeg
List of headings.
bool hasSameSizes() const
Check function.
QList< double > rollsDeg
List of rolls.
QList< bool > onGrounds
List of onGrounds.
void push_back(const swift::misc::aviation::CAircraftSituation &situation)
Push back the latest situation.
QList< double > latitudesDeg
List of latitudes.
QList< double > longitudesDeg
List of longitudes.
bool isEmpty() const
Is empty?
void push_back(const swift::misc::aviation::CCallsign &callsign, const swift::misc::aviation::CAircraftParts &parts)
Push back the latest parts.
QList< double > slats
List of slats.
QList< bool > beaconLights
List of beacon lights.
QList< bool > landLights
List of landing lights.
QList< double > gears
List of gears.
QStringList callsigns
List of callsigns.
QList< double > speedBrakes
List of speed brakes.
QList< bool > strobeLights
List of strobe lights.
QList< double > rudders
List of rudders.
QList< double > ailerons
List of ailerons.
QList< bool > navLights
List of nav lights.
QList< double > thrusts
List of thrusts.
bool isEmpty() const
Is empty?
QList< double > elevators
List of elevators.
QList< bool > taxiLights
List of taxi lights.
QList< int > lightPatterns
List of light patterns.
QList< double > spoilers
List of spoilers.
QList< double > flaps
List of flaps.
QList< double > wingSweeps
List of wing sweeps.
QList< bool > idents
List of active idents.
bool isEmpty() const
Is empty?
QStringList callsigns
List of callsigns.
QList< bool > modeCs
List of active mode C's.
QList< int > codes
List of transponder codes.
QList< bool > QBoolList
List of bools.
QList< double > QDoubleList
List of doubles.