6 #ifndef SWIFT_MISC_SIMULATION_SIMULATEDAIRCRAFT_H
7 #define SWIFT_MISC_SIMULATION_SIMULATEDAIRCRAFT_H
44 class CAircraftIcaoCode;
48 namespace physical_quantities
65 IndexCallsign = CPropertyIndexRef::GlobalIndexCSimulatedAircraft,
67 IndexRelativeDistance,
72 IndexAircraftIcaoCode,
76 IndexCombinedIcaoLiveryString,
77 IndexCombinedIcaoLiveryStringNetworkModel,
80 IndexNetworkModelAircraftIcaoDifference,
81 IndexNetworkModelAirlineIcaoDifference,
82 IndexNetworkModelLiveryDifference,
85 IndexPartsSynchronized,
86 IndexFastPositionUpdates,
135 const QString &getAircraftIcaoCodeDesignator()
const;
138 QString getAirlineAndAircraftIcaoCodeDesignators()
const;
141 const QString &getAircraftIcaoCombinedType()
const;
146 return m_models[CurrentModel].setAircraftIcaoCode(aircraftIcaoCode);
162 const QString &getAirlineIcaoCodeDesignator()
const;
165 void setAircraftIcaoDesignator(
const QString &designator);
171 bool hasId()
const {
return m_pilot.hasId(); }
174 bool hasAircraftDesignator()
const;
180 bool hasAircraftAndAirlineDesignator()
const;
222 virtual QVector3D
normalVector()
const override {
return m_situation.normalVector(); }
227 return m_situation.normalVectorDouble();
237 m_situation.setGroundElevation(elevation, info);
244 m_situation.setGroundElevationChecked(elevation, info);
340 return m_transponder.getTransponderMode();
344 bool isValidForLogin()
const;
347 void initComSystems();
350 void initTransponder();
356 int getEnginesCount()
const;
368 void setAllLightsOn();
371 void setAllLightsOff();
377 bool isMilitary()
const;
380 QString getCombinedIcaoLiveryString(
bool networkModel =
false)
const;
398 bool hasNetworkModel()
const;
401 QString getNetworkModelAircraftIcaoDifference()
const;
404 QString getNetworkModelAirlineIcaoDifference()
const;
407 QString getNetworkModelLiveryDifference()
const;
410 const QString &
getModelString()
const {
return m_models[CurrentModel].getModelString(); }
413 void setModelString(
const QString &modelString);
428 bool hasCG()
const {
return !this->getCG().isNull(); }
431 bool resetToNetworkModel();
443 bool isEnabled()
const;
446 bool setEnabled(
bool enabled);
455 bool setFastPositionUpdates(
bool useFastPositions);
458 bool toggleFastPositionUpdates();
461 bool setRendered(
bool rendered);
484 QString convertToQString(
bool i18n =
false)
const;
490 static constexpr
int CurrentModel = 0;
491 static constexpr
int NetworkModel = 1;
503 bool m_enabled =
true;
504 bool m_rendered =
false;
505 bool m_partsSynchronized =
false;
506 bool m_fastPositionUpdates =
false;
507 bool m_supportsGndFlag =
false;
IconIndex
Index for each icon, allows to send them via DBus, efficiently store them, etc.
Non-owning reference to a CPropertyIndex with a subset of its features.
Mix of the most commonly used mixin classes.
Value object for ICAO classification.
Value object encapsulating information about aircraft's lights.
Value object encapsulating information of aircraft's parts.
Value object encapsulating information of an aircraft's situation.
GndElevationInfo
Where did we get elevation from?
Velocity and angular velocity for 6DOF bodies.
Value object for ICAO classification.
Altitude as used in aviation, can be AGL or MSL altitude.
Value object encapsulating information of a callsign.
static bool isValidAircraftCallsign(const QString &callsign)
Valid callsign?
Heading as used in aviation, can be true or magnetic heading.
Value object encapsulating information about an airpot.
TransponderMode
Transponder codes.
Plane of same elevation, can be a single point or larger area (e.g. airport)
ColumnIndex
Properties by index.
Interface (actually more an abstract class) of coordinates and relative position to something (normal...
Value object encapsulating information of a user.
Physical unit angle (radians, degrees)
Physical unit length (length)
Aircraft model (used by another pilot, my models on disk)
Value object encapsulating a list of aircraft models.
Comprehensive information of an aircraft.
bool hasRealName() const
Has valid realname?
void setGroundElevation(const geo::CElevationPlane &elevation, aviation::CAircraftSituation::GndElevationInfo info)
Elevation of the ground directly beneath at the given situation.
bool hasAirlineDesignator() const
Valid airline designator.
QString getPilotId()
Get user's real id.
void setPartsSynchronized(bool synchronized)
Set the synchronisation flag.
bool hasModelString() const
Has model string?
const aviation::CSelcal getSelcal() const
SELCAL.
aviation::CTransponder::TransponderMode getTransponderMode() const
Get transponder mode.
virtual geo::CLatitude latitude() const
Latitude.
const aviation::CAircraftSituation & getSituation() const
Get situation.
bool isPartsSynchronized() const
Have parts been synchronized with a remote client?
const aviation::CComSystem & getCom2System() const
Get COM2 system.
const aviation::CAircraftVelocity & getVelocity() const
Get 6DOF velocity.
bool isSupportingGndFlag() const
Is supporting gnd.flag?
bool hasCG() const
Has CG from model?
const aviation::CTransponder & getTransponder() const
Get transponder.
bool fastPositionUpdates() const
Support fast position updates.
virtual geo::CLongitude longitude() const
Longitude.
QString getPilotRealName() const
Get user's real name.
void setGroundElevationChecked(const geo::CElevationPlane &elevation, aviation::CAircraftSituation::GndElevationInfo info)
Elevation of the ground directly beneath at the given situation.
bool isRendered() const
Rendered?
virtual std::array< double, 3 > normalVectorDouble() const
Normal vector with double precision.
CIcons::IconIndex toIcon() const
As icon, not implemented by all classes.
void setSelcal(const aviation::CSelcal &selcal)
Own SELCAL code.
const aviation::CAltitude & getPressureAltitude() const
Get pressure altitude.
void setPosition(const geo::CCoordinateGeodetic &position)
Set position.
const physical_quantities::CAngle & getPitch() const
Get pitch.
void setVelocity(const aviation::CAircraftVelocity &velocity)
Set 6DOF velocity.
bool setAircraftIcaoCode(const aviation::CAircraftIcaoCode &aircraftIcaoCode)
Set aicraft ICAO code.
void setPressureAltitude(const aviation::CAltitude &altitude)
Set pressure altitude.
const aviation::CHeading & getHeading() const
Get heading.
void setCom1System(const aviation::CComSystem &comSystem)
Set COM1 system.
const network::CUser & getPilot() const
Get user.
const aviation::CAltitude & geodeticHeight() const
Height, ellipsoidal or geodetic height (used in GPS)
const simulation::CAircraftModel & getNetworkModel() const
Get network model.
qint32 getTransponderCode() const
Get transponder code.
bool isSelcalSelected(const aviation::CSelcal &selcal) const
Given SELCAL selected?
bool hasCallsign() const
Callsign not empty, no further checks.
const aviation::CCallsign & getCallsign() const
Get callsign.
const aviation::CLivery & getLivery() const
Get livery.
QString getTransponderCodeFormatted() const
Get transponder code.
geo::CCoordinateGeodetic getPosition() const
Get position.
bool hasValidCallsign() const
Valid callsign?
const simulation::CAircraftModel & getModel() const
Get model (model used for mapping)
bool isTerrainProbe() const
Terrain probe?
void setSupportingGndFlag(bool supports)
Indicate gnd.flag is supported.
bool hasValidSelcal() const
Valid SELCAL?
const aviation::CAltitude & getGroundElevation() const
Elevation of the ground directly beneath.
const physical_quantities::CSpeed & getGroundSpeed() const
Get groundspeed.
bool hasId() const
Has valid id?
const physical_quantities::CAngle & getBank() const
Get bank (angle)
virtual QVector3D normalVector() const
Normal vector.
void setTransponder(const aviation::CTransponder &transponder)
Set transponder.
void setCom2System(const aviation::CComSystem &comSystem)
Set COM2 system.
QString getCallsignAsString() const
Get callsign.
void setTransponderCode(int code)
Set transponder code.
const aviation::CAltitude & getAltitude() const
Get altitude.
const aviation::CComSystem & getCom1System() const
Get COM1 system.
const physical_quantities::CLength & getCG() const
Get CG from model.
const aviation::CAircraftParts & getParts() const
Get aircraft parts.
void setAltitude(const aviation::CAltitude &altitude)
Set altitude.
const QString & getModelString() const
Get model string.
Free functions in swift::misc.
#define SWIFT_MISC_EXPORT
Export a class or function from the library.
#define SWIFT_DECLARE_VALUEOBJECT_MIXINS(Namespace, Class)
Explicit template declaration of mixins for a CValueObject subclass to be placed near the top of the ...