source: src/mlx/const.py@ 196:13494d36771a

Last change on this file since 196:13494d36771a was 191:b23bf6aa7672, checked in by István Váradi <ivaradi@…>, 13 years ago

Added support for the charter configuration version of the Boeing 737-800

File size: 11.8 KB
Line 
1# Various constants used in the logger
2
3#-------------------------------------------------------------------------------
4
5# The version of the program
6VERSION="0.1"
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
205# Delay code: loading problems
206DELAYCODE_LOADING = 0
207
208# Delay code: VATSIM problem
209DELAYCODE_VATSIM = 1
210
211# Delay code: network problems
212DELAYCODE_NETWORK = 2
213
214# Delay code: controller's fault
215DELAYCODE_CONTROLLER = 3
216
217# Delay code: system crash or freeze
218DELAYCODE_SYSTEM = 4
219
220# Delay code: navigation problem
221DELAYCODE_NAVIGATION = 5
222
223# Delay code: traffic problems
224DELAYCODE_TRAFFIC = 6
225
226# Delay code: apron navigation
227DELAYCODE_APRON = 7
228
229# Delay code: weather problems
230DELAYCODE_WEATHER = 8
231
232# Delay code: personal reasons
233DELAYCODE_PERSONAL = 9
234
235#-------------------------------------------------------------------------------
236
237# Message type: logger error
238# FIXME: cannot set the hotkey
239MESSAGETYPE_LOGGER_ERROR = 1
240
241# Message type: information
242MESSAGETYPE_INFORMATION = 2
243
244# Message type: fault messages
245MESSAGETYPE_FAULT = 3
246
247# Message type: NO-GO fault messages
248MESSAGETYPE_NOGO = 4
249
250# Message type: gate system messages
251MESSAGETYPE_GATE_SYSTEM = 5
252
253# Message type: environment messages
254# FIXME: flight plan closed (5 sec)
255MESSAGETYPE_ENVIRONMENT = 6
256
257# Message type: help messages
258MESSAGETYPE_HELP = 7
259
260# Message type: visibility messages
261MESSAGETYPE_VISIBILITY = 8
262
263#-------------------------------------------------------------------------------
264
265messageTypes = [ MESSAGETYPE_LOGGER_ERROR,
266 MESSAGETYPE_INFORMATION,
267 MESSAGETYPE_FAULT,
268 MESSAGETYPE_NOGO,
269 MESSAGETYPE_GATE_SYSTEM,
270 MESSAGETYPE_ENVIRONMENT,
271 MESSAGETYPE_HELP,
272 MESSAGETYPE_VISIBILITY ]
273
274#-------------------------------------------------------------------------------
275
276_messageTypeStrings = { MESSAGETYPE_LOGGER_ERROR : "loggerError",
277 MESSAGETYPE_INFORMATION : "information",
278 MESSAGETYPE_FAULT : "fault",
279 MESSAGETYPE_NOGO : "nogo",
280 MESSAGETYPE_GATE_SYSTEM : "gateSystem",
281 MESSAGETYPE_ENVIRONMENT : "environment",
282 MESSAGETYPE_HELP : "help",
283 MESSAGETYPE_VISIBILITY : "visibility" }
284
285def messageType2string(messageType):
286 """Get the string equivalent of the given message type."""
287 return _messageTypeStrings[messageType] \
288 if messageType in _messageTypeStrings else None
289
290#-------------------------------------------------------------------------------
291
292# Message display level: none
293MESSAGELEVEL_NONE = 0
294
295# Message display level: only message in the simulator
296MESSAGELEVEL_FS = 1
297
298# Message display level: only sound
299MESSAGELEVEL_SOUND = 2
300
301# Message display level: both
302MESSAGELEVEL_BOTH = 3
303
304#-------------------------------------------------------------------------------
305
306messageLevels = [ MESSAGELEVEL_NONE,
307 MESSAGELEVEL_FS,
308 MESSAGELEVEL_SOUND,
309 MESSAGELEVEL_BOTH ]
310
311#-------------------------------------------------------------------------------
312
313_messageLevelStrings = { MESSAGELEVEL_NONE : "none",
314 MESSAGELEVEL_FS : "fs",
315 MESSAGELEVEL_SOUND : "sound",
316 MESSAGELEVEL_BOTH : "both" }
317
318def messageLevel2string(messageLevel):
319 """Get the string equivalent of the given message level."""
320 return _messageLevelStrings[messageLevel] \
321 if messageLevel in _messageLevelStrings else None
322
323def string2messageLevel(str):
324 """Get the message level for the given string."""
325 for (value, s) in _messageLevelStrings.iteritems():
326 if str==s:
327 return value
328 return MESSAGELEVEL_NONE
329
330#-------------------------------------------------------------------------------
331
332# Sound: ding
333SOUND_DING = "ding.wav"
334
335# Sound: notify
336SOUND_NOTIFY = "notify.wav"
337
338# Sound: NOTAM
339SOUND_NOTAM = "notam.mp3"
340
341# Sound: scream
342SOUND_SCREAM = "sikoly.mp3"
343
344# Sound: boarding
345SOUND_BOARDING = "board.mp3"
346
347# Sound: Malev theme
348SOUND_MALEV = "malev.mp3"
349
350# Sound: taxi: Boeing 737 NG
351SOUND_TAXI_BOEING737NG = "737taxi.mp3"
352
353# Sound: taxi: Boeing 767
354SOUND_TAXI_BOEING767 = "767taxi.mp3"
355
356# Sound: taxi: Fokker F70
357SOUND_TAXI_F70 = "F70taxi.mp3"
358
359# Sound: takeoff preparation request from the captain
360SOUND_CAPTAIN_TAKEOFF = "cpt_takeoff.mp3"
361
362# Sound: cruise
363SOUND_CRUISE = "TOC.mp3"
364
365# Sound: descent
366SOUND_DESCENT = "TOD.mp3"
367
368# Sound: applause
369SOUND_APPLAUSE = "taps.mp3"
370
371# Sound: speedbrake
372SOUND_SPEEDBRAKE = "speed.mp3"
373
374# Sound: taxi after landing
375SOUND_TAXIAFTERLAND = "TaxiAfterLand.mp3"
376
377
378#-------------------------------------------------------------------------------
379
380# Fuel tank: centre
381FUELTANK_CENTRE = 1
382
383# Fuel tank: left
384FUELTANK_LEFT = 2
385
386# Fuel tank: right
387FUELTANK_RIGHT = 3
388
389# Fuel tank: left aux
390FUELTANK_LEFT_AUX = 4
391
392# Fuel tank: right aux
393FUELTANK_RIGHT_AUX = 5
394
395# Fuel tank: left tip
396FUELTANK_LEFT_TIP = 6
397
398# Fuel tank: right tip
399FUELTANK_RIGHT_TIP = 7
400
401# Fuel tank: external 1
402FUELTANK_EXTERNAL1 = 8
403
404# Fuel tank: external 2
405FUELTANK_EXTERNAL2 = 9
406
407# Fuel tank: centre2
408FUELTANK_CENTRE2 = 10
409
410#-------------------------------------------------------------------------------
411
412fuelTanks = [ FUELTANK_CENTRE,
413 FUELTANK_LEFT,
414 FUELTANK_RIGHT,
415 FUELTANK_LEFT_AUX,
416 FUELTANK_RIGHT_AUX,
417 FUELTANK_LEFT_TIP,
418 FUELTANK_RIGHT_TIP,
419 FUELTANK_EXTERNAL1,
420 FUELTANK_EXTERNAL2,
421 FUELTANK_CENTRE2 ]
422
423#-------------------------------------------------------------------------------
424
425_fuelTankStrings = { FUELTANK_CENTRE : "centre",
426 FUELTANK_LEFT : "left",
427 FUELTANK_RIGHT : "right",
428 FUELTANK_LEFT_AUX : "left_aux",
429 FUELTANK_RIGHT_AUX : "right_aux",
430 FUELTANK_LEFT_TIP : "left_tip",
431 FUELTANK_RIGHT_TIP : "right_tip",
432 FUELTANK_EXTERNAL1 : "external1",
433 FUELTANK_EXTERNAL2 : "external2",
434 FUELTANK_CENTRE2 : "centre2" }
435
436def fuelTank2string(fuelTank):
437 """Get the string equivalent of the given fuelTank."""
438 return _fuelTankStrings[fuelTank] \
439 if fuelTank in _fuelTankStrings else None
440
441#-------------------------------------------------------------------------------
442
443# The available gates at LHBP
444lhbpGateNumbers = []
445
446for i in range(1, 7):
447 lhbpGateNumbers.append(str(i))
448
449for i in range(10, 19):
450 lhbpGateNumbers.append(str(i))
451
452for i in range(24, 28):
453 lhbpGateNumbers.append(str(i))
454
455for i in range(31, 39):
456 lhbpGateNumbers.append(str(i))
457
458for i in range(42, 47):
459 lhbpGateNumbers.append(str(i))
460
461for i in range(60, 84):
462 if i!=70 and i!=80:
463 lhbpGateNumbers.append(str(i))
464
465#-------------------------------------------------------------------------------
466
467languages = ["$system", "en_GB", "hu_HU"]
468
469#-------------------------------------------------------------------------------
470
Note: See TracBrowser for help on using the repository browser.