swift
enums.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_ENUMS_H
7 #define SWIFT_CORE_FSD_ENUMS_H
8 
9 #include <QMetaType>
10 
11 namespace swift::core::fsd
12 {
14  enum class AtcRating
15  {
16  Unknown,
17  Observer,
18  Student,
19  Student2,
20  Student3,
21  Controller1,
22  Controller2,
23  Controller3,
24  Instructor1,
25  Instructor2,
26  Instructor3,
27  Supervisor,
29  };
30 
32  enum class PilotRating
33  {
34  Unknown,
35  Student,
36  VFR,
37  IFR,
38  Instructor,
39  Supervisor
40  };
41 
43  enum class SimType
44  {
45  Unknown,
46  MSFS95,
47  MSFS98,
48  MSCFS,
49  MSFS2000,
50  MSCFS2,
51  MSFS2002,
52  MSCFS3,
53  MSFS2004,
54  MSFSX,
55  MSFS,
56  MSFS2024,
57  XPLANE8,
58  XPLANE9,
59  XPLANE10,
60  XPLANE11,
61  XPLANE12,
62  P3Dv1,
63  P3Dv2,
64  P3Dv3,
65  P3Dv4,
66  P3Dv5,
67  FlightGear
68  };
69 
71  enum class ClientQueryType
72  {
73  Unknown,
74  IsValidATC,
75  Capabilities,
76  Com1Freq,
77  RealName,
78  Server,
79  ATIS,
80  PublicIP,
81  INF,
82  FP,
85  // There are many more which are only relevant to ATC clients.
86  };
87 
89  enum class FlightType
90  {
91  IFR,
92  VFR,
93  SVFR,
94  DVFR
95  };
96 
98  enum class ServerErrorCode
99  {
100  NoError,
101  CallsignInUse,
104  SyntaxError,
108  NoFlightPlan,
112  ServerFull,
113  CidSuspended,
114  InvalidCtrl,
115  RatingTooLow,
116  InvalidClient,
117  AuthTimeout,
118  Unknown
119  };
120 
122  enum class ServerType
123  {
124  LegacyFsd,
125  Vatsim
126  };
127 
129  enum class Capabilities : int
130  {
132  None = (1 << 0),
133 
135  AtcInfo = (1 << 1),
136 
138  SecondaryPos = (1 << 2),
139 
150  AircraftInfo = (1 << 3),
151 
153  OngoingCoord = (1 << 4),
154 
160  InterminPos = (1 << 5),
161 
163  FastPos = (1 << 6),
164 
166  VisPos = (1 << 7),
167 
169  Stealth = (1 << 8),
170 
172  AircraftConfig = (1 << 9),
173 
175  IcaoEquipment = (1 << 10)
176  };
177 
181  {
182  return static_cast<Capabilities>(static_cast<int>(lhs) | static_cast<int>(rhs));
183  }
184 
186  {
187  lhs = lhs | rhs;
188  return lhs;
189  }
190 
191  inline bool operator&(Capabilities lhs, Capabilities rhs) { return static_cast<int>(lhs) & static_cast<int>(rhs); }
193 
195  enum class AtisLineType
196  {
197  Unknown,
198  VoiceRoom,
199  TextMessage,
200  ZuluLogoff,
201  LineCount
202  };
203 } // namespace swift::core::fsd
204 
205 Q_DECLARE_METATYPE(swift::core::fsd::AtcRating)
206 Q_DECLARE_METATYPE(swift::core::fsd::PilotRating)
207 Q_DECLARE_METATYPE(swift::core::fsd::SimType)
208 Q_DECLARE_METATYPE(swift::core::fsd::ClientQueryType)
209 Q_DECLARE_METATYPE(swift::core::fsd::FlightType)
210 Q_DECLARE_METATYPE(swift::core::fsd::ServerErrorCode)
211 Q_DECLARE_METATYPE(swift::core::fsd::ServerType)
212 Q_DECLARE_METATYPE(swift::core::fsd::Capabilities)
213 
214 #endif // SWIFT_CORE_FSD_ENUMS_H
Pilot data update broadcast by Euroscope Simulator every second.
Text, radio or private message.
Definition: textmessage.h:19
FlightType
Flight types.
Definition: enums.h:90
@ DVFR
Defense visual Flight Rules.
@ SVFR
Special visual flight rules.
AtisLineType
ATIS line type.
Definition: enums.h:196
bool operator&(Capabilities lhs, Capabilities rhs)
Operators.
Definition: enums.h:191
Capabilities & operator|=(Capabilities &lhs, Capabilities rhs)
Operators.
Definition: enums.h:185
Capabilities operator|(Capabilities lhs, Capabilities rhs)
Operators.
Definition: enums.h:180
ServerType
FSD Server type.
Definition: enums.h:123
SimType
Flight simulator type.
Definition: enums.h:44
@ MSFS95
MS Flight Simulator 95.
@ MSCFS2
MS Combat Flight Simulator 2.
@ MSFS2000
MS Flight Simulator 2000.
@ MSFS
MS Flight Simulator 2020.
@ MSFS2002
MS Flight Simulator 2002.
@ MSFS2024
MS Flight Simulator 2024.
@ MSCFS
MS Combat Flight Simulator.
@ MSFS2004
MS Flight Simulator 2004.
@ MSCFS3
MS Combat Flight Simulator 3.
@ MSFSX
MS Flight Simulator X.
@ MSFS98
MS Flight Simulator 98.
AtcRating
ATC ratings.
Definition: enums.h:15
PilotRating
Pilot ratings.
Definition: enums.h:33
ServerErrorCode
Server error codes.
Definition: enums.h:99
@ InvalidSrcCallsign
Invalid source callsign.
@ CidSuspended
CID/PID was suspended.
@ RatingTooLow
Rating too low for this position.
@ NoSuchCallsign
No such callsign.
@ InvalidClient
Unauthorized client software.
@ ServerFull
Too many clients connected
@ AlreadyRegistered
Already registered.
@ RequestedLevelTooHigh
Requested level too high.
@ InvalidCallsign
Invalid callsign.
@ InvalidCidPassword
Invalid CID/password.
@ AuthTimeout
Wrong server type.
@ InvalidCtrl
Not valid control.
@ InvalidRevision
Invalid protocol revision.
@ NoWeatherProfile
No such weather profile.
ClientQueryType
Client query types.
Definition: enums.h:72
@ PublicIP
What is my public IP address?
@ FP
Send Cached Flight Plan.
@ ATIS
What is your ATIS? Reponse by ATC clients only.
@ INF
Supervisor Privileged Information Request.
@ Server
What server are you on?
@ AircraftConfig
Aircraft Configuration.
@ RealName
What is your real-name (and other ATC data)
@ Com1Freq
What is your COM1 Frequency? Response by pilot clients only.
@ IsValidATC
Is this client working ATC or just an observer.
Capabilities
Client capability flags *‍/.
Definition: enums.h:130
@ SecondaryPos
Can send/receive secondary visibility center points (ATC/Server only).
@ AtcInfo
Can accept ATIS responses.
@ IcaoEquipment
Process aircraft ICAO in flightplan as ICAO equipment code (e.g.
@ FastPos
Can send/receive fast position updates (pilot only).
@ OngoingCoord
Can send/receive inter-facility coordination packets (ATC only).
@ VisPos
Can send/receive visual position updates (pilot only).
@ InterminPos
Can send/receive Interim position updates (pilot only)
@ AircraftInfo
Can send/receive modern model packets.