source: src/mlx/const.py@ 224:6269b46d6740

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

Added an OK button to the PIREP viewer.

File size: 12.5 KB
Line 
1# Various constants used in the logger
2
3#-------------------------------------------------------------------------------
4
5# The version of the program
6VERSION="0.2"
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-800 (charter configuration)
45AIRCRAFT_B738C = 16
46
47# Aircraft type: Boeing 737-300
48AIRCRAFT_B733 = 4
49
50# Aircraft type: Boeing 737-400
51AIRCRAFT_B734 = 5
52
53# Aircraft type: Boeing 737-500
54AIRCRAFT_B735 = 6
55
56# Aircraft type: Dash-8 Q400
57AIRCRAFT_DH8D = 7
58
59# Aircraft type: Boeing 767-200
60AIRCRAFT_B762 = 8
61
62# Aircraft type: Boeing 767-300
63AIRCRAFT_B763 = 9
64
65# Aircraft type: Canadair CRJ-200
66AIRCRAFT_CRJ2 = 10
67
68# Aircraft type: Fokker F-70
69AIRCRAFT_F70 = 11
70
71# Aircraft type: Lisunov Li-2
72AIRCRAFT_DC3 = 12
73
74# Aircraft type: Tupolev Tu-134
75AIRCRAFT_T134 = 13
76
77# Aircraft type: Tupolev Tu-154
78AIRCRAFT_T154 = 14
79
80# Aircraft type: Yakovlev Yak-40
81AIRCRAFT_YK40 = 15
82
83#-------------------------------------------------------------------------------
84
85# The list of aircraft types that we know of
86# The order is mostly from most recent to oldest considering
87# Malev's history
88aircraftTypes = [AIRCRAFT_B736, AIRCRAFT_B737,
89 AIRCRAFT_B738, AIRCRAFT_B738C,
90 AIRCRAFT_DH8D,
91 AIRCRAFT_F70, AIRCRAFT_CRJ2,
92 AIRCRAFT_B762, AIRCRAFT_B763,
93 AIRCRAFT_B733, AIRCRAFT_B734, AIRCRAFT_B735,
94 AIRCRAFT_T154, AIRCRAFT_T134,
95 AIRCRAFT_YK40, AIRCRAFT_DC3]
96
97#-------------------------------------------------------------------------------
98
99# A mapping of aircraft types to their 'internal' ICAO codes (which are
100# the same as the real ICAO codes, except in a few cases)
101icaoCodes = { AIRCRAFT_B736 : "B736",
102 AIRCRAFT_B737 : "B737",
103 AIRCRAFT_B738 : "B738",
104 AIRCRAFT_B738C : "B738C",
105 AIRCRAFT_B733 : "B733",
106 AIRCRAFT_B734 : "B734",
107 AIRCRAFT_B735 : "B735",
108 AIRCRAFT_DH8D : "DH8D",
109 AIRCRAFT_B762 : "B762",
110 AIRCRAFT_B763 : "B763",
111 AIRCRAFT_CRJ2 : "CRJ2",
112 AIRCRAFT_F70 : "F70",
113 AIRCRAFT_DC3 : "DC3",
114 AIRCRAFT_T134 : "T134",
115 AIRCRAFT_T154 : "T154",
116 AIRCRAFT_YK40 : "YK40" }
117
118#-------------------------------------------------------------------------------
119
120# Flight stage: boarding
121STAGE_BOARDING = 1
122
123# Flight stage: pushback, startup and taxi
124STAGE_PUSHANDTAXI = 2
125
126# Flight stage: takeoff
127STAGE_TAKEOFF = 3
128
129# Flight stage: RTO
130STAGE_RTO = 4
131
132# Flight stage: climb
133STAGE_CLIMB = 5
134
135# Flight stage: cruise
136STAGE_CRUISE = 6
137
138# Flight stage: descent
139STAGE_DESCENT = 7
140
141# Flight stage: landing
142STAGE_LANDING = 8
143
144# Flight stage: taxi after landing
145STAGE_TAXIAFTERLAND = 9
146
147# Flight stage: parking
148STAGE_PARKING = 10
149
150# Flight stage: go-around
151STAGE_GOAROUND = 11
152
153# Flight stage: end
154STAGE_END = 12
155
156#-------------------------------------------------------------------------------
157
158_stageStrings = { STAGE_BOARDING : "boarding",
159 STAGE_PUSHANDTAXI : "pushback and taxi",
160 STAGE_TAKEOFF : "takeoff",
161 STAGE_RTO : "RTO",
162 STAGE_CLIMB : "climb",
163 STAGE_CRUISE : "cruise",
164 STAGE_DESCENT : "descent",
165 STAGE_LANDING : "landing",
166 STAGE_TAXIAFTERLAND : "taxi",
167 STAGE_PARKING : "parking",
168 STAGE_GOAROUND : "go-around",
169 STAGE_END : "end" }
170
171def stage2string(stage):
172 """Convert the given stage to a lower-case string."""
173 return _stageStrings[stage] if stage in _stageStrings else None
174
175#-------------------------------------------------------------------------------
176
177# Plane status: unknown
178PLANE_UNKNOWN = 0
179
180# Plane status: at home, i.e. LHBP
181PLANE_HOME = 1
182
183# Plane status: away
184PLANE_AWAY = 2
185
186# Plane status: parking
187PLANE_PARKING = 3
188
189#-------------------------------------------------------------------------------
190
191# Flight type: scheduled
192FLIGHTTYPE_SCHEDULED = 0
193
194# Flight type: old-timer
195FLIGHTTYPE_OLDTIMER = 1
196
197# Flight type: VIP
198FLIGHTTYPE_VIP = 2
199
200# Flight type: charter
201FLIGHTTYPE_CHARTER = 3
202
203#-------------------------------------------------------------------------------
204
205flightTypes = [ FLIGHTTYPE_SCHEDULED,
206 FLIGHTTYPE_OLDTIMER,
207 FLIGHTTYPE_VIP,
208 FLIGHTTYPE_CHARTER ]
209
210#-------------------------------------------------------------------------------
211
212_flightTypeStrings = { FLIGHTTYPE_SCHEDULED : "scheduled",
213 FLIGHTTYPE_OLDTIMER : "ot",
214 FLIGHTTYPE_VIP : "vip",
215 FLIGHTTYPE_CHARTER : "charter" }
216
217def flightType2string(flightType):
218 """Get the string equivalent of the given flight type."""
219 return _flightTypeStrings[flightType] \
220 if flightType in _flightTypeStrings else None
221
222#-------------------------------------------------------------------------------
223
224# Delay code: loading problems
225DELAYCODE_LOADING = 0
226
227# Delay code: VATSIM problem
228DELAYCODE_VATSIM = 1
229
230# Delay code: network problems
231DELAYCODE_NETWORK = 2
232
233# Delay code: controller's fault
234DELAYCODE_CONTROLLER = 3
235
236# Delay code: system crash or freeze
237DELAYCODE_SYSTEM = 4
238
239# Delay code: navigation problem
240DELAYCODE_NAVIGATION = 5
241
242# Delay code: traffic problems
243DELAYCODE_TRAFFIC = 6
244
245# Delay code: apron navigation
246DELAYCODE_APRON = 7
247
248# Delay code: weather problems
249DELAYCODE_WEATHER = 8
250
251# Delay code: personal reasons
252DELAYCODE_PERSONAL = 9
253
254#-------------------------------------------------------------------------------
255
256# Message type: logger error
257# FIXME: cannot set the hotkey
258MESSAGETYPE_LOGGER_ERROR = 1
259
260# Message type: information
261MESSAGETYPE_INFORMATION = 2
262
263# Message type: fault messages
264MESSAGETYPE_FAULT = 3
265
266# Message type: NO-GO fault messages
267MESSAGETYPE_NOGO = 4
268
269# Message type: gate system messages
270MESSAGETYPE_GATE_SYSTEM = 5
271
272# Message type: environment messages
273# FIXME: flight plan closed (5 sec)
274MESSAGETYPE_ENVIRONMENT = 6
275
276# Message type: help messages
277MESSAGETYPE_HELP = 7
278
279# Message type: visibility messages
280MESSAGETYPE_VISIBILITY = 8
281
282#-------------------------------------------------------------------------------
283
284messageTypes = [ MESSAGETYPE_LOGGER_ERROR,
285 MESSAGETYPE_INFORMATION,
286 MESSAGETYPE_FAULT,
287 MESSAGETYPE_NOGO,
288 MESSAGETYPE_GATE_SYSTEM,
289 MESSAGETYPE_ENVIRONMENT,
290 MESSAGETYPE_HELP,
291 MESSAGETYPE_VISIBILITY ]
292
293#-------------------------------------------------------------------------------
294
295_messageTypeStrings = { MESSAGETYPE_LOGGER_ERROR : "loggerError",
296 MESSAGETYPE_INFORMATION : "information",
297 MESSAGETYPE_FAULT : "fault",
298 MESSAGETYPE_NOGO : "nogo",
299 MESSAGETYPE_GATE_SYSTEM : "gateSystem",
300 MESSAGETYPE_ENVIRONMENT : "environment",
301 MESSAGETYPE_HELP : "help",
302 MESSAGETYPE_VISIBILITY : "visibility" }
303
304def messageType2string(messageType):
305 """Get the string equivalent of the given message type."""
306 return _messageTypeStrings[messageType] \
307 if messageType in _messageTypeStrings else None
308
309#-------------------------------------------------------------------------------
310
311# Message display level: none
312MESSAGELEVEL_NONE = 0
313
314# Message display level: only message in the simulator
315MESSAGELEVEL_FS = 1
316
317# Message display level: only sound
318MESSAGELEVEL_SOUND = 2
319
320# Message display level: both
321MESSAGELEVEL_BOTH = 3
322
323#-------------------------------------------------------------------------------
324
325messageLevels = [ MESSAGELEVEL_NONE,
326 MESSAGELEVEL_FS,
327 MESSAGELEVEL_SOUND,
328 MESSAGELEVEL_BOTH ]
329
330#-------------------------------------------------------------------------------
331
332_messageLevelStrings = { MESSAGELEVEL_NONE : "none",
333 MESSAGELEVEL_FS : "fs",
334 MESSAGELEVEL_SOUND : "sound",
335 MESSAGELEVEL_BOTH : "both" }
336
337def messageLevel2string(messageLevel):
338 """Get the string equivalent of the given message level."""
339 return _messageLevelStrings[messageLevel] \
340 if messageLevel in _messageLevelStrings else None
341
342def string2messageLevel(str):
343 """Get the message level for the given string."""
344 for (value, s) in _messageLevelStrings.iteritems():
345 if str==s:
346 return value
347 return MESSAGELEVEL_NONE
348
349#-------------------------------------------------------------------------------
350
351# Sound: ding
352SOUND_DING = "ding.wav"
353
354# Sound: notify
355SOUND_NOTIFY = "notify.wav"
356
357# Sound: NOTAM
358SOUND_NOTAM = "notam.mp3"
359
360# Sound: scream
361SOUND_SCREAM = "sikoly.mp3"
362
363# Sound: boarding
364SOUND_BOARDING = "board.mp3"
365
366# Sound: Malev theme
367SOUND_MALEV = "malev.mp3"
368
369# Sound: taxi: Boeing 737 NG
370SOUND_TAXI_BOEING737NG = "737taxi.mp3"
371
372# Sound: taxi: Boeing 767
373SOUND_TAXI_BOEING767 = "767taxi.mp3"
374
375# Sound: taxi: Fokker F70
376SOUND_TAXI_F70 = "F70taxi.mp3"
377
378# Sound: takeoff preparation request from the captain
379SOUND_CAPTAIN_TAKEOFF = "cpt_takeoff.mp3"
380
381# Sound: cruise
382SOUND_CRUISE = "TOC.mp3"
383
384# Sound: descent
385SOUND_DESCENT = "TOD.mp3"
386
387# Sound: applause
388SOUND_APPLAUSE = "taps.mp3"
389
390# Sound: speedbrake
391SOUND_SPEEDBRAKE = "speed.mp3"
392
393# Sound: taxi after landing
394SOUND_TAXIAFTERLAND = "TaxiAfterLand.mp3"
395
396
397#-------------------------------------------------------------------------------
398
399# Fuel tank: centre
400FUELTANK_CENTRE = 1
401
402# Fuel tank: left
403FUELTANK_LEFT = 2
404
405# Fuel tank: right
406FUELTANK_RIGHT = 3
407
408# Fuel tank: left aux
409FUELTANK_LEFT_AUX = 4
410
411# Fuel tank: right aux
412FUELTANK_RIGHT_AUX = 5
413
414# Fuel tank: left tip
415FUELTANK_LEFT_TIP = 6
416
417# Fuel tank: right tip
418FUELTANK_RIGHT_TIP = 7
419
420# Fuel tank: external 1
421FUELTANK_EXTERNAL1 = 8
422
423# Fuel tank: external 2
424FUELTANK_EXTERNAL2 = 9
425
426# Fuel tank: centre2
427FUELTANK_CENTRE2 = 10
428
429#-------------------------------------------------------------------------------
430
431fuelTanks = [ FUELTANK_CENTRE,
432 FUELTANK_LEFT,
433 FUELTANK_RIGHT,
434 FUELTANK_LEFT_AUX,
435 FUELTANK_RIGHT_AUX,
436 FUELTANK_LEFT_TIP,
437 FUELTANK_RIGHT_TIP,
438 FUELTANK_EXTERNAL1,
439 FUELTANK_EXTERNAL2,
440 FUELTANK_CENTRE2 ]
441
442#-------------------------------------------------------------------------------
443
444_fuelTankStrings = { FUELTANK_CENTRE : "centre",
445 FUELTANK_LEFT : "left",
446 FUELTANK_RIGHT : "right",
447 FUELTANK_LEFT_AUX : "left_aux",
448 FUELTANK_RIGHT_AUX : "right_aux",
449 FUELTANK_LEFT_TIP : "left_tip",
450 FUELTANK_RIGHT_TIP : "right_tip",
451 FUELTANK_EXTERNAL1 : "external1",
452 FUELTANK_EXTERNAL2 : "external2",
453 FUELTANK_CENTRE2 : "centre2" }
454
455def fuelTank2string(fuelTank):
456 """Get the string equivalent of the given fuelTank."""
457 return _fuelTankStrings[fuelTank] \
458 if fuelTank in _fuelTankStrings else None
459
460#-------------------------------------------------------------------------------
461
462# The available gates at LHBP
463lhbpGateNumbers = []
464
465for i in range(1, 7):
466 lhbpGateNumbers.append(str(i))
467
468for i in range(10, 19):
469 lhbpGateNumbers.append(str(i))
470
471for i in range(24, 28):
472 lhbpGateNumbers.append(str(i))
473
474for i in range(31, 39):
475 lhbpGateNumbers.append(str(i))
476
477for i in range(42, 47):
478 lhbpGateNumbers.append(str(i))
479
480for i in range(60, 84):
481 if i!=70 and i!=80:
482 lhbpGateNumbers.append(str(i))
483
484#-------------------------------------------------------------------------------
485
486languages = ["$system", "en_GB", "hu_HU"]
487
488#-------------------------------------------------------------------------------
489
Note: See TracBrowser for help on using the repository browser.