swift
euroscopesimdata.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2021 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_CORE_FSD_EUROSCOPESIMDATA_H
7 #define SWIFT_CORE_FSD_EUROSCOPESIMDATA_H
8 
9 #include "core/fsd/enums.h"
10 #include "core/fsd/messagebase.h"
12 
13 namespace swift::core::fsd
14 {
17  {
18  public:
20  EuroscopeSimData(const QString &sender, const QString &model, const QString &livery, quint64 timestamp,
21  double latitude, double longitude, double altitude, double heading, int bank, int pitch,
22  int groundSpeed, bool onGround, double gearPercent, double thrustPercent,
24 
26  QStringList toTokens() const;
27 
29  static EuroscopeSimData fromTokens(const QStringList &tokens);
30 
32  static QString pdu() { return QStringLiteral("SIMDATA"); }
33 
36  QString m_model;
37  QString m_livery;
38  quint64 m_timestamp = 0;
39  double m_latitude = 0;
40  double m_longitude = 0;
41  double m_altitude = 0;
42  double m_heading = 0;
43  int m_bank = 0;
44  int m_pitch = 0;
45  int m_groundSpeed = 0;
46  bool m_onGround = false;
47  int m_gearPercent = 0;
48  int m_thrustPercent = 0;
51 
52  private:
54  };
55 
57  inline bool operator==(const EuroscopeSimData &lhs, const EuroscopeSimData &rhs)
58  {
59  return lhs.sender() == rhs.sender() && lhs.receiver() == rhs.receiver() && lhs.m_model == rhs.m_model &&
60  lhs.m_livery == rhs.m_livery && lhs.m_timestamp == rhs.m_timestamp &&
61  qFuzzyCompare(lhs.m_latitude, rhs.m_latitude) && qFuzzyCompare(lhs.m_longitude, rhs.m_longitude) &&
62  qFuzzyCompare(lhs.m_altitude, rhs.m_altitude) && qFuzzyCompare(lhs.m_heading, rhs.m_heading) &&
63  lhs.m_bank == rhs.m_bank && lhs.m_pitch == rhs.m_pitch && lhs.m_groundSpeed == rhs.m_groundSpeed &&
64  lhs.m_onGround == rhs.m_onGround && lhs.m_gearPercent == rhs.m_gearPercent &&
65  lhs.m_thrustPercent == rhs.m_thrustPercent && lhs.m_lights == rhs.m_lights;
66  }
67 
69  inline bool operator!=(const EuroscopeSimData &lhs, const EuroscopeSimData &rhs) { return !(lhs == rhs); }
70 } // namespace swift::core::fsd
71 
72 #endif // SWIFT_CORE_FSD_EUROSCOPESIMDATA_H
bool operator!=(const AddAtc &lhs, const AddAtc &rhs)
Not equal operator.
Definition: addatc.h:68
Pilot data update broadcast by Euroscope Simulator every second.
static QString pdu()
PDU identifier.
swift::misc::aviation::CAircraftLights m_lights
Properties.
FSD message base class.
Definition: messagebase.h:58
QString sender() const
get message sender
Definition: messagebase.h:73
QString receiver() const
Get message receiver.
Definition: messagebase.h:79
Value object encapsulating information about aircraft's lights.
#define SWIFT_CORE_EXPORT
Export a class or function from the library.