swift
visualpilotdatastopped.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2019 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_VISUALPILOTDATASTOPPED_H
7 #define SWIFT_CORE_FSD_VISUALPILOTDATASTOPPED_H
8 
9 #include "enums.h"
10 #include "messagebase.h"
11 
12 namespace swift::core::fsd
13 {
14  class VisualPilotDataUpdate;
15 
18  {
19  public:
21  VisualPilotDataStopped(const QString &sender, double latitude, double longitude, double altitudeTrue,
22  double heightAgl, double pitch, double bank, double heading, double noseGearAngle = 0.0);
23 
25  QStringList toTokens() const;
26 
28  static VisualPilotDataStopped fromTokens(const QStringList &tokens);
29 
31  static QString pdu() { return "#ST"; }
32 
34  VisualPilotDataUpdate toUpdate() const;
35 
38  double m_latitude = 0.0;
39  double m_longitude = 0.0;
40  double m_altitudeTrue = 0.0;
41  double m_heightAgl = 0.0;
42  double m_pitch = 0.0;
43  double m_bank = 0.0;
44  double m_heading = 0.0;
45  double m_noseGearAngle = 0.0;
47 
48  private:
50  };
51 
53  inline bool operator==(const VisualPilotDataStopped &lhs, const VisualPilotDataStopped &rhs)
54  {
55  return qFuzzyCompare(lhs.m_latitude, rhs.m_latitude) && qFuzzyCompare(lhs.m_longitude, rhs.m_longitude) &&
56  qFuzzyCompare(lhs.m_altitudeTrue, rhs.m_altitudeTrue) &&
57  qFuzzyCompare(lhs.m_heightAgl, rhs.m_heightAgl) && qFuzzyCompare(lhs.m_pitch, rhs.m_pitch) &&
58  qFuzzyCompare(lhs.m_bank, rhs.m_bank) && qFuzzyCompare(lhs.m_heading, rhs.m_heading) &&
59  qFuzzyCompare(lhs.m_noseGearAngle, rhs.m_noseGearAngle);
60  }
61 
63  inline bool operator!=(const VisualPilotDataStopped &lhs, const VisualPilotDataStopped &rhs)
64  {
65  return !(lhs == rhs);
66  }
67 } // namespace swift::core::fsd
68 
69 #endif // SWIFT_CORE_FSD_VISUALPILOTDATASTOPPED_H
bool operator!=(const AddAtc &lhs, const AddAtc &rhs)
Not equal operator.
Definition: addatc.h:68
FSD message base class.
Definition: messagebase.h:58
VisualPilotDataUpdate with velocity assumed to be zero.
Pilot data update broadcasted to pilots in range every 0.2 seconds.
#define SWIFT_CORE_EXPORT
Export a class or function from the library.