swift
interimpilotdataupdate.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_INTERIMPILOTDATAUPDATE_H
7 #define SWIFT_CORE_FSD_INTERIMPILOTDATAUPDATE_H
8 
9 #include "core/fsd/messagebase.h"
10 
11 namespace swift::core::fsd
12 {
16  {
17  public:
19  InterimPilotDataUpdate(const QString &sender, const QString &receiver, double latitude, double longitude,
20  int altitudeTrue, int groundSpeed, double pitch, double bank, double heading,
21  bool onGround);
22 
24  QStringList toTokens() const;
25 
27  static InterimPilotDataUpdate fromTokens(const QStringList &tokens);
28 
30  static QString pdu() { return "#SB"; }
31 
34  double m_latitude = 0.0;
35  double m_longitude = 0.0;
36  int m_altitudeTrue = 0.0;
37  int m_groundSpeed = 0.0;
38  double m_pitch = 0.0;
39  double m_bank = 0.0;
40  double m_heading = 0.0;
41  bool m_onGround = false;
43 
44  private:
46  };
47 
49  inline bool operator==(const InterimPilotDataUpdate &lhs, const InterimPilotDataUpdate &rhs)
50  {
51  return lhs.sender() == rhs.sender() && lhs.receiver() == rhs.receiver() &&
52  qFuzzyCompare(lhs.m_latitude, rhs.m_latitude) && qFuzzyCompare(lhs.m_longitude, rhs.m_longitude) &&
53  lhs.m_altitudeTrue == rhs.m_altitudeTrue && qFuzzyCompare(lhs.m_pitch, rhs.m_pitch) &&
54  qFuzzyCompare(lhs.m_bank, rhs.m_bank) && qFuzzyCompare(lhs.m_heading, rhs.m_heading) &&
55  lhs.m_onGround == rhs.m_onGround;
56  }
57 
59  inline bool operator!=(const InterimPilotDataUpdate &lhs, const InterimPilotDataUpdate &rhs)
60  {
61  return !(lhs == rhs);
62  }
63 } // namespace swift::core::fsd
64 
65 #endif // SWIFT_CORE_FSD_INTERIMPILOTDATAUPDATE_H
bool operator!=(const AddAtc &lhs, const AddAtc &rhs)
Not equal operator.
Definition: addatc.h:68
Interim pilot data update sent to specific receivers faster than the standard broadcast update.
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
#define SWIFT_CORE_EXPORT
Export a class or function from the library.