swift
visualpilotdataperiodic.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_VISUALPILOTDATAPERIODIC_H
7 #define SWIFT_CORE_FSD_VISUALPILOTDATAPERIODIC_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  VisualPilotDataPeriodic(const QString &sender, double latitude, double longitude, double altitudeTrue,
22  double heightAgl, double pitch, double bank, double heading, double xVelocity,
23  double yVelocity, double zVelocity, double pitchRadPerSec, double bankRadPerSec,
24  double headingRadPerSec, double noseGearAngle = 0.0);
25 
27  QStringList toTokens() const;
28 
30  static VisualPilotDataPeriodic fromTokens(const QStringList &tokens);
31 
33  static QString pdu() { return "#SL"; }
34 
36  VisualPilotDataUpdate toUpdate() const;
37 
40  double m_latitude = 0.0;
41  double m_longitude = 0.0;
42  double m_altitudeTrue = 0.0;
43  double m_heightAgl = 0.0;
44  double m_pitch = 0.0;
45  double m_bank = 0.0;
46  double m_heading = 0.0;
47  double m_xVelocity = 0.0;
48  double m_yVelocity = 0.0;
49  double m_zVelocity = 0.0;
50  double m_pitchRadPerSec = 0.0;
51  double m_bankRadPerSec = 0.0;
52  double m_headingRadPerSec = 0.0;
53  double m_noseGearAngle = 0.0;
55 
56  private:
58  };
59 
61  inline bool operator==(const VisualPilotDataPeriodic &lhs, const VisualPilotDataPeriodic &rhs)
62  {
63  return qFuzzyCompare(lhs.m_latitude, rhs.m_latitude) && qFuzzyCompare(lhs.m_longitude, rhs.m_longitude) &&
64  qFuzzyCompare(lhs.m_altitudeTrue, rhs.m_altitudeTrue) &&
65  qFuzzyCompare(lhs.m_heightAgl, rhs.m_heightAgl) && qFuzzyCompare(lhs.m_pitch, rhs.m_pitch) &&
66  qFuzzyCompare(lhs.m_bank, rhs.m_bank) && qFuzzyCompare(lhs.m_heading, rhs.m_heading) &&
67  qFuzzyCompare(lhs.m_xVelocity, rhs.m_xVelocity) && qFuzzyCompare(lhs.m_yVelocity, rhs.m_yVelocity) &&
68  qFuzzyCompare(lhs.m_zVelocity, rhs.m_zVelocity) &&
69  qFuzzyCompare(lhs.m_pitchRadPerSec, rhs.m_pitchRadPerSec) &&
70  qFuzzyCompare(lhs.m_bankRadPerSec, rhs.m_bankRadPerSec) &&
71  qFuzzyCompare(lhs.m_headingRadPerSec, rhs.m_headingRadPerSec) &&
72  qFuzzyCompare(lhs.m_noseGearAngle, rhs.m_noseGearAngle);
73  }
74 
76  inline bool operator!=(const VisualPilotDataPeriodic &lhs, const VisualPilotDataPeriodic &rhs)
77  {
78  return !(lhs == rhs);
79  }
80 } // namespace swift::core::fsd
81 
82 #endif // SWIFT_CORE_FSD_VISUALPILOTDATAPERIODIC_H
bool operator!=(const AddAtc &lhs, const AddAtc &rhs)
Not equal operator.
Definition: addatc.h:68
FSD message base class.
Definition: messagebase.h:58
Every 25th VisualPilotDataUpdate is actually one of these ("slowfast").
Pilot data update broadcasted to pilots in range every 0.2 seconds.
#define SWIFT_CORE_EXPORT
Export a class or function from the library.