swift
Loading...
Searching...
No Matches
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
8#include "misc/valueobject.h"
9
10SWIFT_DECLARE_VALUEOBJECT_MIXINS(swift::misc::aviation, CSsrEquipment)
11
12namespace swift::misc::aviation
13{
16 {
17 public:
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
53
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
77
78#endif // SWIFT_MISC_AVIATION_SSREQUIPMENT_H
Mix of the most commonly used mixin classes.
ICAO flightplan field 10b.
CSsrEquipment()=default
Create default SSR equipment with "None" equipment enabled.
QStringList enabledOptions() const
Get all enabled SSR equipment codes of this object as a list.
SsrEquipmentOption
Surveillance equipment options.
QString convertToQString(bool i18n=false) const
Get the SSR equipment string of this object (for example "LB1").
bool hasEquipment(SsrEquipmentOption equip) const
Does this object contains equip?
static QStringList allEquipmentLetters()
Get all possible SSR equipment code letters.
#define SWIFT_METAMEMBER(MEMBER,...)
Macro to define an element within a metaclass.
Definition metaclass.h:72
#define SWIFT_METACLASS(CLASS,...)
Macro to define a nested metaclass that describes the attributes of its enclosing class.
Definition metaclass.h:52
#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