source: src/mlx/const.py@ 175:6db038066dec

Last change on this file since 175:6db038066dec was 175:6db038066dec, checked in by István Váradi <ivaradi@…>, 13 years ago

Checklist saving/restoring and editing is implemented

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