source: src/mlx/const.py@ 133:dcbe33497899

Last change on this file since 133:dcbe33497899 was 133:dcbe33497899, checked in by István Váradi <ivaradi@…>, 12 years ago

The general message sending works and the most important messages are sent

File size: 8.1 KB
Line 
1# Various constants used in the logger
2
3#-------------------------------------------------------------------------------
4
5# The version of the program
6VERSION="0.03"
7
8#-------------------------------------------------------------------------------
9
10# The ratio between lbs and kg
11LBSTOKG=0.4536
12
13# The ratio between kgs and lbs
14KGSTOLB=1/LBSTOKG
15
16# The ratio between feet and metre
17FEETTOMETRES=0.3048
18
19#-------------------------------------------------------------------------------
20
21# Flight simulator type: MS Flight Simulator 2004
22SIM_MSFS9 = 1
23
24# Flight simulator type: MS Flight Simulator X
25SIM_MSFSX = 2
26
27# Flight simulator type: X-Plane 9
28SIM_XPLANE9 = 3
29
30# Flight simulator type: X-Plane 10
31SIM_XPLANE10 = 4
32
33#-------------------------------------------------------------------------------
34
35# Aircraft type: Boeing 737-600
36AIRCRAFT_B736 = 1
37
38# Aircraft type: Boeing 737-700
39AIRCRAFT_B737 = 2
40
41# Aircraft type: Boeing 737-800
42AIRCRAFT_B738 = 3
43
44# Aircraft type: Boeing 737-300
45AIRCRAFT_B733 = 4
46
47# Aircraft type: Boeing 737-400
48AIRCRAFT_B734 = 5
49
50# Aircraft type: Boeing 737-500
51AIRCRAFT_B735 = 6
52
53# Aircraft type: Dash-8 Q400
54AIRCRAFT_DH8D = 7
55
56# Aircraft type: Boeing 767-200
57AIRCRAFT_B762 = 8
58
59# Aircraft type: Boeing 767-300
60AIRCRAFT_B763 = 9
61
62# Aircraft type: Canadair CRJ-200
63AIRCRAFT_CRJ2 = 10
64
65# Aircraft type: Fokker F-70
66AIRCRAFT_F70 = 11
67
68# Aircraft type: Lisunov Li-2
69AIRCRAFT_DC3 = 12
70
71# Aircraft type: Tupolev Tu-134
72AIRCRAFT_T134 = 13
73
74# Aircraft type: Tupolev Tu-154
75AIRCRAFT_T154 = 14
76
77# Aircraft type: Yakovlev Yak-40
78AIRCRAFT_YK40 = 15
79
80#-------------------------------------------------------------------------------
81
82# Flight stage: boarding
83STAGE_BOARDING = 1
84
85# Flight stage: pushback, startup and taxi
86STAGE_PUSHANDTAXI = 2
87
88# Flight stage: takeoff
89STAGE_TAKEOFF = 3
90
91# Flight stage: RTO
92STAGE_RTO = 4
93
94# Flight stage: climb
95STAGE_CLIMB = 5
96
97# Flight stage: cruise
98STAGE_CRUISE = 6
99
100# Flight stage: descent
101STAGE_DESCENT = 7
102
103# Flight stage: landing
104STAGE_LANDING = 8
105
106# Flight stage: taxi after landing
107STAGE_TAXIAFTERLAND = 9
108
109# Flight stage: parking
110STAGE_PARKING = 10
111
112# Flight stage: go-around
113STAGE_GOAROUND = 11
114
115# Flight stage: end
116STAGE_END = 12
117
118#-------------------------------------------------------------------------------
119
120_stageStrings = { STAGE_BOARDING : "boarding",
121 STAGE_PUSHANDTAXI : "pushback and taxi",
122 STAGE_TAKEOFF : "takeoff",
123 STAGE_RTO : "RTO",
124 STAGE_CLIMB : "climb",
125 STAGE_CRUISE : "cruise",
126 STAGE_DESCENT : "descent",
127 STAGE_LANDING : "landing",
128 STAGE_TAXIAFTERLAND : "taxi",
129 STAGE_PARKING : "parking",
130 STAGE_GOAROUND : "go-around",
131 STAGE_END : "end" }
132
133def stage2string(stage):
134 """Convert the given stage to a lower-case string."""
135 return _stageStrings[stage] if stage in _stageStrings else None
136
137#-------------------------------------------------------------------------------
138
139# Plane status: unknown
140PLANE_UNKNOWN = 0
141
142# Plane status: at home, i.e. LHBP
143PLANE_HOME = 1
144
145# Plane status: away
146PLANE_AWAY = 2
147
148# Plane status: parking
149PLANE_PARKING = 3
150
151#-------------------------------------------------------------------------------
152
153# Flight type: scheduled
154FLIGHTTYPE_SCHEDULED = 0
155
156# Flight type: old-timer
157FLIGHTTYPE_OLDTIMER = 1
158
159# Flight type: VIP
160FLIGHTTYPE_VIP = 2
161
162# Flight type: charter
163FLIGHTTYPE_CHARTER = 3
164
165#-------------------------------------------------------------------------------
166
167# Delay code: loading problems
168DELAYCODE_LOADING = 0
169
170# Delay code: VATSIM problem
171DELAYCODE_VATSIM = 1
172
173# Delay code: network problems
174DELAYCODE_NETWORK = 2
175
176# Delay code: controller's fault
177DELAYCODE_CONTROLLER = 3
178
179# Delay code: system crash or freeze
180DELAYCODE_SYSTEM = 4
181
182# Delay code: navigation problem
183DELAYCODE_NAVIGATION = 5
184
185# Delay code: traffic problems
186DELAYCODE_TRAFFIC = 6
187
188# Delay code: apron navigation
189DELAYCODE_APRON = 7
190
191# Delay code: weather problems
192DELAYCODE_WEATHER = 8
193
194# Delay code: personal reasons
195DELAYCODE_PERSONAL = 9
196
197#-------------------------------------------------------------------------------
198
199# Message type: logger error
200# FIXME: cannot set the hotkey
201MESSAGETYPE_LOGGER_ERROR = 1
202
203# Message type: information
204# FIXME: flare time begin (3 sec)
205MESSAGETYPE_INFORMATION = 2
206
207# Message type: fault messages
208MESSAGETYPE_FAULT = 3
209
210# Message type: NO-GO fault messages
211MESSAGETYPE_NOGO = 4
212
213# Message type: gate system messages
214# FIXME: the available gates when arriving to LHBP (10 sec)
215MESSAGETYPE_GATE_SYSTEM = 5
216
217# Message type: environment messages
218# FIXME: flight plan closed (5 sec)
219MESSAGETYPE_ENVIRONMENT = 6
220
221# Message type: help messages
222# FIXME: don't forget V speeds when stage is PUSHANDTAXI (5 sec)
223MESSAGETYPE_HELP = 7
224
225# Message type: visibility messages
226# FIXME: the visibility, once when below 2000 RA, then when below 1000 RA (5 sec)
227MESSAGETYPE_VISIBILITY = 8
228
229#-------------------------------------------------------------------------------
230
231messageTypes = [ MESSAGETYPE_LOGGER_ERROR,
232 MESSAGETYPE_INFORMATION,
233 MESSAGETYPE_FAULT,
234 MESSAGETYPE_NOGO,
235 MESSAGETYPE_GATE_SYSTEM,
236 MESSAGETYPE_ENVIRONMENT,
237 MESSAGETYPE_HELP,
238 MESSAGETYPE_VISIBILITY ]
239
240#-------------------------------------------------------------------------------
241
242_messageTypeStrings = { MESSAGETYPE_LOGGER_ERROR : "loggerError",
243 MESSAGETYPE_INFORMATION : "information",
244 MESSAGETYPE_FAULT : "fault",
245 MESSAGETYPE_NOGO : "nogo",
246 MESSAGETYPE_GATE_SYSTEM : "gateSystem",
247 MESSAGETYPE_ENVIRONMENT : "environment",
248 MESSAGETYPE_HELP : "help",
249 MESSAGETYPE_VISIBILITY : "visibility" }
250
251def messageType2string(messageType):
252 """Get the string equivalent of the given message type."""
253 return _messageTypeStrings[messageType] \
254 if messageType in _messageTypeStrings else None
255
256#-------------------------------------------------------------------------------
257
258# Message display level: none
259MESSAGELEVEL_NONE = 0
260
261# Message display level: only message in the simulator
262MESSAGELEVEL_FS = 1
263
264# Message display level: only sound
265MESSAGELEVEL_SOUND = 2
266
267# Message display level: both
268MESSAGELEVEL_BOTH = 3
269
270#-------------------------------------------------------------------------------
271
272messageLevels = [ MESSAGELEVEL_NONE,
273 MESSAGELEVEL_FS,
274 MESSAGELEVEL_SOUND,
275 MESSAGELEVEL_BOTH ]
276
277#-------------------------------------------------------------------------------
278
279_messageLevelStrings = { MESSAGELEVEL_NONE : "none",
280 MESSAGELEVEL_FS : "fs",
281 MESSAGELEVEL_SOUND : "sound",
282 MESSAGELEVEL_BOTH : "both" }
283
284def messageLevel2string(messageLevel):
285 """Get the string equivalent of the given message level."""
286 return _messageLevelStrings[messageLevel] \
287 if messageLevel in _messageLevelStrings else None
288
289def string2messageLevel(str):
290 """Get the message level for the given string."""
291 for (value, s) in _messageLevelStrings.iteritems():
292 if str==s:
293 return value
294 return MESSAGELEVEL_NONE
295
296#-------------------------------------------------------------------------------
297
298# Sound: ding
299SOUND_DING = "ding.wav"
300
301#-------------------------------------------------------------------------------
302
303# The available gates at LHBP
304lhbpGateNumbers = []
305
306for i in range(1, 7):
307 lhbpGateNumbers.append(str(i))
308
309for i in range(10, 19):
310 lhbpGateNumbers.append(str(i))
311
312for i in range(24, 28):
313 lhbpGateNumbers.append(str(i))
314
315for i in range(31, 39):
316 lhbpGateNumbers.append(str(i))
317
318for i in range(42, 47):
319 lhbpGateNumbers.append(str(i))
320
321for i in range(60, 84):
322 if i!=70 and i!=80:
323 lhbpGateNumbers.append(str(i))
324
325#-------------------------------------------------------------------------------
326
327languages = ["$system", "en_GB", "hu_HU"]
328
329#-------------------------------------------------------------------------------
330
Note: See TracBrowser for help on using the repository browser.