swift
ssrequipment.h
1 // SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
4 #ifndef SWIFT_MISC_AVIATION_SSREQUIPMENT_H
5 #define SWIFT_MISC_AVIATION_SSREQUIPMENT_H
6 
7 #include "misc/swiftmiscexport.h"
8 #include "misc/valueobject.h"
9 
10 SWIFT_DECLARE_VALUEOBJECT_MIXINS(swift::misc::aviation, CSsrEquipment)
11 
12 namespace swift::misc::aviation
13 {
16  {
17  public:
19  enum SsrEquipmentOption : int
20  {
21  None = (1 << 0),
22  ModeA = (1 << 1),
23  ModeAC = (1 << 2),
24  ModeSTypeE = (1 << 3),
25  ModeSTypeH = (1 << 4),
26  ModeSTypeI = (1 << 5),
27  ModeSTypeL = (1 << 6),
28  ModeSTypeX = (1 << 7),
29  ModeSTypeP = (1 << 8),
30  ModeSTypeS = (1 << 9),
31  AdsBB1 = (1 << 10),
32  AdsBB2 = (1 << 11),
33  AdsBU1 = (1 << 12),
34  AdsBU2 = (1 << 13),
35  AdsBV1 = (1 << 14),
36  AdsBV2 = (1 << 15),
37  AdsCD1 = (1 << 16),
38  AdsCG1 = (1 << 17)
39  };
40  Q_DECLARE_FLAGS(SSrEquipment, SsrEquipmentOption)
41 
42 
43  CSsrEquipment() = default;
44 
46  CSsrEquipment(SSrEquipment equipment);
47 
49  explicit CSsrEquipment(QString equipment);
50 
52  static QStringList allEquipmentLetters();
53 
55  QStringList enabledOptions() const;
56 
58  QString convertToQString(bool i18n = false) const;
59 
61  bool hasEquipment(SsrEquipmentOption equip) const { return m_equipment.testFlag(equip); }
62 
63  private:
65  static QString flagToString(SSrEquipment flag);
66 
67  SSrEquipment m_equipment = None;
68 
71  SWIFT_METAMEMBER(equipment));
72  };
73 
74 } // namespace swift::misc::aviation
75 
76 Q_DECLARE_METATYPE(swift::misc::aviation::CSsrEquipment)
77 
78 #endif // SWIFT_MISC_AVIATION_SSREQUIPMENT_H
Mix of the most commonly used mixin classes.
Definition: valueobject.h:114
ICAO flightplan field 10b.
Definition: ssrequipment.h:16
SsrEquipmentOption
Surveillance equipment options.
Definition: ssrequipment.h:20
#define SWIFT_METAMEMBER(MEMBER,...)
Macro to define an element within a metaclass.
Definition: metaclass.h:73
#define SWIFT_METACLASS(CLASS,...)
Macro to define a nested metaclass that describes the attributes of its enclosing class.
Definition: metaclass.h:53
#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 ...
Definition: valueobject.h:65