1 |
|
---|
2 | import sys
|
---|
3 | import datetime
|
---|
4 |
|
---|
5 | #-------------------------------------------------------------------------------
|
---|
6 |
|
---|
7 | ## @package mlx.const
|
---|
8 | #
|
---|
9 | # The constants used by the program.
|
---|
10 |
|
---|
11 | #-------------------------------------------------------------------------------
|
---|
12 |
|
---|
13 | ## The version of the program
|
---|
14 | VERSION="0.64.2"
|
---|
15 |
|
---|
16 | #-------------------------------------------------------------------------------
|
---|
17 |
|
---|
18 | ## The ratio between lbs and kg
|
---|
19 | LBSTOKG=0.4536
|
---|
20 |
|
---|
21 | ## The ratio between kgs and lbs
|
---|
22 | KGSTOLB=1/LBSTOKG
|
---|
23 |
|
---|
24 | ## The ratio between feet and metre
|
---|
25 | FEETTOMETRES=0.3048
|
---|
26 |
|
---|
27 | #-------------------------------------------------------------------------------
|
---|
28 |
|
---|
29 | ## The ratio between knots and km/h
|
---|
30 | KNOTSTOKMPH=1.852
|
---|
31 |
|
---|
32 | ## The ratio between km/h and knots
|
---|
33 | KMPHTOKNOTS=1/1.852
|
---|
34 |
|
---|
35 | #-------------------------------------------------------------------------------
|
---|
36 |
|
---|
37 | ## Flight simulator type: MS Flight Simulator 2004
|
---|
38 | SIM_MSFS9 = 1
|
---|
39 |
|
---|
40 | ## Flight simulator type: MS Flight Simulator X
|
---|
41 | SIM_MSFSX = 2
|
---|
42 |
|
---|
43 | ## Flight simulator type: X-Plane 9
|
---|
44 | SIM_XPLANE9 = 3
|
---|
45 |
|
---|
46 | ## Flight simulator type: X-Plane 10
|
---|
47 | SIM_XPLANE10 = 4
|
---|
48 |
|
---|
49 | ## Flight simulator type: Prepar3D
|
---|
50 | SIM_P3D = 5
|
---|
51 |
|
---|
52 | ## Flight simulator type: X-Plane 11
|
---|
53 | SIM_XPLANE11 = 6
|
---|
54 |
|
---|
55 | ## Flight simulator type: X-Plane 12
|
---|
56 | SIM_XPLANE12 = 7
|
---|
57 |
|
---|
58 | #---light simulator type: MSFS 2020
|
---|
59 | SIM_MSFS2020 = 8
|
---|
60 |
|
---|
61 | #-------------------------------------------------------------------------------
|
---|
62 |
|
---|
63 | ## Aircraft type: Boeing 737-600
|
---|
64 | AIRCRAFT_B736 = 1
|
---|
65 |
|
---|
66 | ## Aircraft type: Boeing 737-700
|
---|
67 | AIRCRAFT_B737 = 2
|
---|
68 |
|
---|
69 | ## Aircraft type: Boeing 737-800
|
---|
70 | AIRCRAFT_B738 = 3
|
---|
71 |
|
---|
72 | ## Aircraft type: Boeing 737-800 (charter configuration)
|
---|
73 | AIRCRAFT_B738C = 16
|
---|
74 |
|
---|
75 | ## Aircraft type: Boeing 737-200
|
---|
76 | AIRCRAFT_B732 = 18
|
---|
77 |
|
---|
78 | ## Aircraft type: Boeing 737-300
|
---|
79 | AIRCRAFT_B733 = 4
|
---|
80 |
|
---|
81 | ## Aircraft type: Boeing 737-400
|
---|
82 | AIRCRAFT_B734 = 5
|
---|
83 |
|
---|
84 | ## Aircraft type: Boeing 737-500
|
---|
85 | AIRCRAFT_B735 = 6
|
---|
86 |
|
---|
87 | ## Aircraft type: Dash-8 Q400
|
---|
88 | AIRCRAFT_DH8D = 7
|
---|
89 |
|
---|
90 | ## Aircraft type: Boeing 767-200
|
---|
91 | AIRCRAFT_B762 = 8
|
---|
92 |
|
---|
93 | ## Aircraft type: Boeing 767-300
|
---|
94 | AIRCRAFT_B763 = 9
|
---|
95 |
|
---|
96 | ## Aircraft type: Canadair CRJ-200
|
---|
97 | AIRCRAFT_CRJ2 = 10
|
---|
98 |
|
---|
99 | ## Aircraft type: Fokker F-70
|
---|
100 | AIRCRAFT_F70 = 11
|
---|
101 |
|
---|
102 | ## Aircraft type: Lisunov Li-2
|
---|
103 | AIRCRAFT_DC3 = 12
|
---|
104 |
|
---|
105 | ## Aircraft type: Tupolev Tu-134
|
---|
106 | AIRCRAFT_T134 = 13
|
---|
107 |
|
---|
108 | ## Aircraft type: Tupolev Tu-154
|
---|
109 | AIRCRAFT_T154 = 14
|
---|
110 |
|
---|
111 | ## Aircraft type: Yakovlev Yak-40
|
---|
112 | AIRCRAFT_YK40 = 15
|
---|
113 |
|
---|
114 | ## Aircraft type: British Aerospace BAe-146
|
---|
115 | AIRCRAFT_B462 = 17
|
---|
116 |
|
---|
117 | ## Aircraft type: Ilyushin IL-62
|
---|
118 | AIRCRAFT_IL62 = 18
|
---|
119 |
|
---|
120 | #-------------------------------------------------------------------------------
|
---|
121 |
|
---|
122 | ## The list of aircraft types that we know of
|
---|
123 | # The order is mostly from most recent to oldest considering
|
---|
124 | # Malev's history
|
---|
125 | aircraftTypes = [AIRCRAFT_B736, AIRCRAFT_B737,
|
---|
126 | AIRCRAFT_B738, AIRCRAFT_B738C,
|
---|
127 | AIRCRAFT_DH8D,
|
---|
128 | AIRCRAFT_F70, AIRCRAFT_CRJ2,
|
---|
129 | AIRCRAFT_B762, AIRCRAFT_B763,
|
---|
130 | AIRCRAFT_B732, AIRCRAFT_B733, AIRCRAFT_B734, AIRCRAFT_B735,
|
---|
131 | AIRCRAFT_T154, AIRCRAFT_T134,
|
---|
132 | AIRCRAFT_YK40, AIRCRAFT_DC3,
|
---|
133 | AIRCRAFT_B462, AIRCRAFT_IL62]
|
---|
134 |
|
---|
135 | #-------------------------------------------------------------------------------
|
---|
136 |
|
---|
137 | ## Aircraft type family: Boeing 737 NG
|
---|
138 | AIRCRAFT_FAMILY_B737NG = 1
|
---|
139 |
|
---|
140 | ## Aircraft type family: Boeing 737 Classic
|
---|
141 | AIRCRAFT_FAMILY_B737CL = 2
|
---|
142 |
|
---|
143 | ## Aircraft type family: Bombardier Dash-8 Q400
|
---|
144 | AIRCRAFT_FAMILY_DH8D = 3
|
---|
145 |
|
---|
146 | ## Aircraft type family: Boeing 767
|
---|
147 | AIRCRAFT_FAMILY_B767 = 4
|
---|
148 |
|
---|
149 | ## Aircraft type family: Canadair CRJ-200
|
---|
150 | AIRCRAFT_FAMILY_CRJ2 = 5
|
---|
151 |
|
---|
152 | ## Aircraft type family: Fokker F-70
|
---|
153 | AIRCRAFT_FAMILY_F70 = 6
|
---|
154 |
|
---|
155 | ## Aircraft type family: Lisunov Li-2
|
---|
156 | AIRCRAFT_FAMILY_DC3 = 7
|
---|
157 |
|
---|
158 | ## Aircraft type family: Tupolev Tu-134
|
---|
159 | AIRCRAFT_FAMILY_T134 = 8
|
---|
160 |
|
---|
161 | ## Aircraft type family: Tupolev Tu-154
|
---|
162 | AIRCRAFT_FAMILY_T154 = 9
|
---|
163 |
|
---|
164 | ## Aircraft type family: Yakovlev Yak-40
|
---|
165 | AIRCRAFT_FAMILY_YK40 = 10
|
---|
166 |
|
---|
167 | ## Aircraft type family: British Aerospace BAe-146
|
---|
168 | AIRCRAFT_FAMILY_B462 = 11
|
---|
169 |
|
---|
170 | #-------------------------------------------------------------------------------
|
---|
171 |
|
---|
172 | ## Map aircraft families to the list of the types they comprise of
|
---|
173 | aircraftFamily2Types = {
|
---|
174 | AIRCRAFT_FAMILY_B737NG: [AIRCRAFT_B736, AIRCRAFT_B737, AIRCRAFT_B738,
|
---|
175 | AIRCRAFT_B738C],
|
---|
176 |
|
---|
177 | AIRCRAFT_FAMILY_B737CL: [AIRCRAFT_B732, AIRCRAFT_B733, AIRCRAFT_B734,
|
---|
178 | AIRCRAFT_B735],
|
---|
179 |
|
---|
180 | AIRCRAFT_FAMILY_DH8D: [AIRCRAFT_DH8D],
|
---|
181 |
|
---|
182 | AIRCRAFT_FAMILY_B767: [AIRCRAFT_B762, AIRCRAFT_B763],
|
---|
183 |
|
---|
184 | AIRCRAFT_FAMILY_CRJ2: [AIRCRAFT_CRJ2],
|
---|
185 |
|
---|
186 | AIRCRAFT_FAMILY_F70: [AIRCRAFT_F70],
|
---|
187 |
|
---|
188 | AIRCRAFT_FAMILY_DC3: [AIRCRAFT_DC3],
|
---|
189 |
|
---|
190 | AIRCRAFT_FAMILY_T134: [AIRCRAFT_T134],
|
---|
191 |
|
---|
192 | AIRCRAFT_FAMILY_T154: [AIRCRAFT_T154],
|
---|
193 |
|
---|
194 | AIRCRAFT_FAMILY_YK40: [AIRCRAFT_YK40],
|
---|
195 |
|
---|
196 | AIRCRAFT_FAMILY_B462: [AIRCRAFT_B462]
|
---|
197 |
|
---|
198 | }
|
---|
199 |
|
---|
200 | #-------------------------------------------------------------------------------
|
---|
201 |
|
---|
202 | def aircraftType2Family(aircraftType):
|
---|
203 | """Get the family for the given aircraft type."""
|
---|
204 | for (family, types) in aircraftFamily2Types.items():
|
---|
205 | if aircraftType in types:
|
---|
206 | return family
|
---|
207 | assert False
|
---|
208 |
|
---|
209 | #-------------------------------------------------------------------------------
|
---|
210 |
|
---|
211 | ## A mapping of aircraft types to their 'internal' ICAO codes (which are
|
---|
212 | # the same as the real ICAO codes, except in a few cases)
|
---|
213 | icaoCodes = { AIRCRAFT_B736 : "B736",
|
---|
214 | AIRCRAFT_B737 : "B737",
|
---|
215 | AIRCRAFT_B738 : "B738",
|
---|
216 | AIRCRAFT_B738C : "B738C",
|
---|
217 | AIRCRAFT_B732 : "B732",
|
---|
218 | AIRCRAFT_B733 : "B733",
|
---|
219 | AIRCRAFT_B734 : "B734",
|
---|
220 | AIRCRAFT_B735 : "B735",
|
---|
221 | AIRCRAFT_DH8D : "DH8D",
|
---|
222 | AIRCRAFT_B762 : "B762",
|
---|
223 | AIRCRAFT_B763 : "B763",
|
---|
224 | AIRCRAFT_CRJ2 : "CRJ2",
|
---|
225 | AIRCRAFT_F70 : "F70",
|
---|
226 | AIRCRAFT_DC3 : "DC3",
|
---|
227 | AIRCRAFT_T134 : "T134",
|
---|
228 | AIRCRAFT_T154 : "T154",
|
---|
229 | AIRCRAFT_YK40 : "YK40",
|
---|
230 | AIRCRAFT_B462 : "B462" }
|
---|
231 |
|
---|
232 | #-------------------------------------------------------------------------------
|
---|
233 |
|
---|
234 | ## Flight stage: boarding
|
---|
235 | STAGE_BOARDING = 1
|
---|
236 |
|
---|
237 | ## Flight stage: pushback, startup and taxi
|
---|
238 | STAGE_PUSHANDTAXI = 2
|
---|
239 |
|
---|
240 | ## Flight stage: takeoff
|
---|
241 | STAGE_TAKEOFF = 3
|
---|
242 |
|
---|
243 | ## Flight stage: RTO
|
---|
244 | STAGE_RTO = 4
|
---|
245 |
|
---|
246 | ## Flight stage: climb
|
---|
247 | STAGE_CLIMB = 5
|
---|
248 |
|
---|
249 | ## Flight stage: cruise
|
---|
250 | STAGE_CRUISE = 6
|
---|
251 |
|
---|
252 | ## Flight stage: descent
|
---|
253 | STAGE_DESCENT = 7
|
---|
254 |
|
---|
255 | ## Flight stage: landing
|
---|
256 | STAGE_LANDING = 8
|
---|
257 |
|
---|
258 | ## Flight stage: taxi after landing
|
---|
259 | STAGE_TAXIAFTERLAND = 9
|
---|
260 |
|
---|
261 | ## Flight stage: parking
|
---|
262 | STAGE_PARKING = 10
|
---|
263 |
|
---|
264 | ## Flight stage: go-around
|
---|
265 | STAGE_GOAROUND = 11
|
---|
266 |
|
---|
267 | ## Flight stage: end
|
---|
268 | STAGE_END = 12
|
---|
269 |
|
---|
270 | #-------------------------------------------------------------------------------
|
---|
271 |
|
---|
272 | _stageStrings = { STAGE_BOARDING : "boarding",
|
---|
273 | STAGE_PUSHANDTAXI : "pushback and taxi",
|
---|
274 | STAGE_TAKEOFF : "takeoff",
|
---|
275 | STAGE_RTO : "RTO",
|
---|
276 | STAGE_CLIMB : "climb",
|
---|
277 | STAGE_CRUISE : "cruise",
|
---|
278 | STAGE_DESCENT : "descent",
|
---|
279 | STAGE_LANDING : "landing",
|
---|
280 | STAGE_TAXIAFTERLAND : "taxi",
|
---|
281 | STAGE_PARKING : "parking",
|
---|
282 | STAGE_GOAROUND : "go-around",
|
---|
283 | STAGE_END : "end" }
|
---|
284 |
|
---|
285 | def stage2string(stage):
|
---|
286 | """Convert the given stage to a lower-case string."""
|
---|
287 | return _stageStrings[stage] if stage in _stageStrings else None
|
---|
288 |
|
---|
289 | #-------------------------------------------------------------------------------
|
---|
290 |
|
---|
291 | ## Plane status: unknown
|
---|
292 | PLANE_UNKNOWN = 0
|
---|
293 |
|
---|
294 | ## Plane status: at home, i.e. LHBP
|
---|
295 | PLANE_HOME = 1
|
---|
296 |
|
---|
297 | ## Plane status: away
|
---|
298 | PLANE_AWAY = 2
|
---|
299 |
|
---|
300 | ## Plane status: parking
|
---|
301 | PLANE_PARKING = 3
|
---|
302 |
|
---|
303 | #-------------------------------------------------------------------------------
|
---|
304 |
|
---|
305 | ## Flight type: scheduled
|
---|
306 | FLIGHTTYPE_SCHEDULED = 0
|
---|
307 |
|
---|
308 | ## Flight type: VIP
|
---|
309 | FLIGHTTYPE_VIP = 1
|
---|
310 |
|
---|
311 | ## Flight type: charter
|
---|
312 | FLIGHTTYPE_CHARTER = 2
|
---|
313 |
|
---|
314 | ## Flight type: old timer (not used anymore)
|
---|
315 | FLIGHTTYPE_OLDTIMER = -1
|
---|
316 |
|
---|
317 | #-------------------------------------------------------------------------------
|
---|
318 |
|
---|
319 | flightTypes = [ FLIGHTTYPE_SCHEDULED,
|
---|
320 | FLIGHTTYPE_VIP,
|
---|
321 | FLIGHTTYPE_CHARTER,
|
---|
322 | FLIGHTTYPE_OLDTIMER ]
|
---|
323 |
|
---|
324 | #-------------------------------------------------------------------------------
|
---|
325 |
|
---|
326 | _flightTypeStrings = { FLIGHTTYPE_SCHEDULED : "scheduled",
|
---|
327 | FLIGHTTYPE_VIP : "vip",
|
---|
328 | FLIGHTTYPE_CHARTER : "charter",
|
---|
329 | FLIGHTTYPE_OLDTIMER : "ot" }
|
---|
330 |
|
---|
331 | def flightType2string(flightType):
|
---|
332 | """Get the string equivalent of the given flight type."""
|
---|
333 | return _flightTypeStrings[flightType] \
|
---|
334 | if flightType in _flightTypeStrings else None
|
---|
335 |
|
---|
336 | def flightType2index(flightType):
|
---|
337 | """Get the index of the given flight type according to the list above"""
|
---|
338 | return flightTypes.index(flightType)
|
---|
339 |
|
---|
340 | #-------------------------------------------------------------------------------
|
---|
341 |
|
---|
342 | ## Message type: logger error
|
---|
343 | # FIXME: cannot set the hotkey
|
---|
344 | MESSAGETYPE_LOGGER_ERROR = 1
|
---|
345 |
|
---|
346 | ## Message type: information
|
---|
347 | MESSAGETYPE_INFORMATION = 2
|
---|
348 |
|
---|
349 | ## Message type: in-flight information
|
---|
350 | MESSAGETYPE_INFLIGHT = 3
|
---|
351 |
|
---|
352 | ## Message type: fault messages
|
---|
353 | MESSAGETYPE_FAULT = 4
|
---|
354 |
|
---|
355 | ## Message type: NO-GO fault messages
|
---|
356 | MESSAGETYPE_NOGO = 5
|
---|
357 |
|
---|
358 | ## Message type: gate system messages
|
---|
359 | MESSAGETYPE_GATE_SYSTEM = 6
|
---|
360 |
|
---|
361 | ## Message type: environment messages
|
---|
362 | # FIXME: flight plan closed (5 sec)
|
---|
363 | MESSAGETYPE_ENVIRONMENT = 7
|
---|
364 |
|
---|
365 | ## Message type: help messages
|
---|
366 | MESSAGETYPE_HELP = 8
|
---|
367 |
|
---|
368 | ## Message type: visibility messages
|
---|
369 | MESSAGETYPE_VISIBILITY = 9
|
---|
370 |
|
---|
371 | #-------------------------------------------------------------------------------
|
---|
372 |
|
---|
373 | messageTypes = [ MESSAGETYPE_LOGGER_ERROR,
|
---|
374 | MESSAGETYPE_INFORMATION,
|
---|
375 | MESSAGETYPE_INFLIGHT,
|
---|
376 | MESSAGETYPE_FAULT,
|
---|
377 | MESSAGETYPE_NOGO,
|
---|
378 | MESSAGETYPE_GATE_SYSTEM,
|
---|
379 | MESSAGETYPE_ENVIRONMENT,
|
---|
380 | MESSAGETYPE_HELP,
|
---|
381 | MESSAGETYPE_VISIBILITY ]
|
---|
382 |
|
---|
383 | #-------------------------------------------------------------------------------
|
---|
384 |
|
---|
385 | _messageTypeStrings = { MESSAGETYPE_LOGGER_ERROR : "loggerError",
|
---|
386 | MESSAGETYPE_INFORMATION : "information",
|
---|
387 | MESSAGETYPE_INFLIGHT : "inflight",
|
---|
388 | MESSAGETYPE_FAULT : "fault",
|
---|
389 | MESSAGETYPE_NOGO : "nogo",
|
---|
390 | MESSAGETYPE_GATE_SYSTEM : "gateSystem",
|
---|
391 | MESSAGETYPE_ENVIRONMENT : "environment",
|
---|
392 | MESSAGETYPE_HELP : "help",
|
---|
393 | MESSAGETYPE_VISIBILITY : "visibility" }
|
---|
394 |
|
---|
395 | def messageType2string(messageType):
|
---|
396 | """Get the string equivalent of the given message type."""
|
---|
397 | return _messageTypeStrings[messageType] \
|
---|
398 | if messageType in _messageTypeStrings else None
|
---|
399 |
|
---|
400 | #-------------------------------------------------------------------------------
|
---|
401 |
|
---|
402 | ## Message display level: none
|
---|
403 | MESSAGELEVEL_NONE = 0
|
---|
404 |
|
---|
405 | ## Message display level: only message in the simulator
|
---|
406 | MESSAGELEVEL_FS = 1
|
---|
407 |
|
---|
408 | ## Message display level: only sound
|
---|
409 | MESSAGELEVEL_SOUND = 2
|
---|
410 |
|
---|
411 | ## Message display level: both
|
---|
412 | MESSAGELEVEL_BOTH = 3
|
---|
413 |
|
---|
414 | #-------------------------------------------------------------------------------
|
---|
415 |
|
---|
416 | messageLevels = [ MESSAGELEVEL_NONE,
|
---|
417 | MESSAGELEVEL_FS,
|
---|
418 | MESSAGELEVEL_SOUND,
|
---|
419 | MESSAGELEVEL_BOTH ]
|
---|
420 |
|
---|
421 | #-------------------------------------------------------------------------------
|
---|
422 |
|
---|
423 | _messageLevelStrings = { MESSAGELEVEL_NONE : "none",
|
---|
424 | MESSAGELEVEL_FS : "fs",
|
---|
425 | MESSAGELEVEL_SOUND : "sound",
|
---|
426 | MESSAGELEVEL_BOTH : "both" }
|
---|
427 |
|
---|
428 | def messageLevel2string(messageLevel):
|
---|
429 | """Get the string equivalent of the given message level."""
|
---|
430 | return _messageLevelStrings[messageLevel] \
|
---|
431 | if messageLevel in _messageLevelStrings else None
|
---|
432 |
|
---|
433 | def string2messageLevel(str):
|
---|
434 | """Get the message level for the given string."""
|
---|
435 | for (value, s) in _messageLevelStrings.items():
|
---|
436 | if str==s:
|
---|
437 | return value
|
---|
438 | return MESSAGELEVEL_NONE
|
---|
439 |
|
---|
440 | #-------------------------------------------------------------------------------
|
---|
441 |
|
---|
442 | ## Sound: ding
|
---|
443 | SOUND_DING = "ding.wav"
|
---|
444 |
|
---|
445 | ## Sound: notify
|
---|
446 | SOUND_NOTIFY = "notify.wav"
|
---|
447 |
|
---|
448 | ## Sound: NOTAM
|
---|
449 | SOUND_NOTAM = "notam.mp3"
|
---|
450 |
|
---|
451 | ## Sound: scream
|
---|
452 | SOUND_SCREAM = "sikoly.mp3"
|
---|
453 |
|
---|
454 | ## Sound: boarding
|
---|
455 | SOUND_BOARDING = "board.mp3"
|
---|
456 |
|
---|
457 | ## Sound: Malev theme
|
---|
458 | SOUND_MALEV = "malev.mp3"
|
---|
459 |
|
---|
460 | ## Sound: taxi: Boeing 737 NG
|
---|
461 | SOUND_TAXI_BOEING737NG = "737taxi.mp3"
|
---|
462 |
|
---|
463 | ## Sound: taxi: Boeing 737 NG (alternative variant)
|
---|
464 | SOUND_TAXI_BOEING737NG_ALT1 = "737taxi_1.mp3"
|
---|
465 |
|
---|
466 | ## Sound: taxi: Boeing 767
|
---|
467 | SOUND_TAXI_BOEING767 = "767taxi.mp3"
|
---|
468 |
|
---|
469 | ## Sound: taxi: Boeing 767 (alternative variant)
|
---|
470 | SOUND_TAXI_BOEING767_ALT1 = "767taxi_1.mp3"
|
---|
471 |
|
---|
472 | ## Sound: taxi: Fokker F70
|
---|
473 | SOUND_TAXI_F70 = "F70taxi.mp3"
|
---|
474 |
|
---|
475 | ## Sound: takeoff preparation request from the captain
|
---|
476 | SOUND_CAPTAIN_TAKEOFF = "cpt_takeoff.mp3"
|
---|
477 |
|
---|
478 | ## Sound: cruise
|
---|
479 | SOUND_CRUISE = "TOC.mp3"
|
---|
480 |
|
---|
481 | ## Sound: descent
|
---|
482 | SOUND_DESCENT = "TOD.mp3"
|
---|
483 |
|
---|
484 | ## Sound: applause
|
---|
485 | SOUND_APPLAUSE = "taps.mp3"
|
---|
486 |
|
---|
487 | ## Sound: speedbrake
|
---|
488 | SOUND_SPEEDBRAKE = "speed.mp3"
|
---|
489 |
|
---|
490 | ## Sound: taxi after landing
|
---|
491 | SOUND_TAXIAFTERLAND = "TaxiAfterLand.mp3"
|
---|
492 |
|
---|
493 |
|
---|
494 | #-------------------------------------------------------------------------------
|
---|
495 |
|
---|
496 | ## Fuel tank: centre
|
---|
497 | FUELTANK_CENTRE = 1
|
---|
498 |
|
---|
499 | ## Fuel tank: left
|
---|
500 | FUELTANK_LEFT = 2
|
---|
501 |
|
---|
502 | ## Fuel tank: right
|
---|
503 | FUELTANK_RIGHT = 3
|
---|
504 |
|
---|
505 | ## Fuel tank: left aux
|
---|
506 | FUELTANK_LEFT_AUX = 4
|
---|
507 |
|
---|
508 | ## Fuel tank: right aux
|
---|
509 | FUELTANK_RIGHT_AUX = 5
|
---|
510 |
|
---|
511 | ## Fuel tank: left tip
|
---|
512 | FUELTANK_LEFT_TIP = 6
|
---|
513 |
|
---|
514 | ## Fuel tank: right tip
|
---|
515 | FUELTANK_RIGHT_TIP = 7
|
---|
516 |
|
---|
517 | ## Fuel tank: external 1
|
---|
518 | FUELTANK_EXTERNAL1 = 8
|
---|
519 |
|
---|
520 | ## Fuel tank: external 2
|
---|
521 | FUELTANK_EXTERNAL2 = 9
|
---|
522 |
|
---|
523 | ## Fuel tank: centre2
|
---|
524 | FUELTANK_CENTRE2 = 10
|
---|
525 |
|
---|
526 | #-------------------------------------------------------------------------------
|
---|
527 |
|
---|
528 | fuelTanks = [ FUELTANK_CENTRE,
|
---|
529 | FUELTANK_LEFT,
|
---|
530 | FUELTANK_RIGHT,
|
---|
531 | FUELTANK_LEFT_AUX,
|
---|
532 | FUELTANK_RIGHT_AUX,
|
---|
533 | FUELTANK_LEFT_TIP,
|
---|
534 | FUELTANK_RIGHT_TIP,
|
---|
535 | FUELTANK_EXTERNAL1,
|
---|
536 | FUELTANK_EXTERNAL2,
|
---|
537 | FUELTANK_CENTRE2 ]
|
---|
538 |
|
---|
539 | #-------------------------------------------------------------------------------
|
---|
540 |
|
---|
541 | _fuelTankStrings = { FUELTANK_CENTRE : "centre",
|
---|
542 | FUELTANK_LEFT : "left",
|
---|
543 | FUELTANK_RIGHT : "right",
|
---|
544 | FUELTANK_LEFT_AUX : "left_aux",
|
---|
545 | FUELTANK_RIGHT_AUX : "right_aux",
|
---|
546 | FUELTANK_LEFT_TIP : "left_tip",
|
---|
547 | FUELTANK_RIGHT_TIP : "right_tip",
|
---|
548 | FUELTANK_EXTERNAL1 : "external1",
|
---|
549 | FUELTANK_EXTERNAL2 : "external2",
|
---|
550 | FUELTANK_CENTRE2 : "centre2" }
|
---|
551 |
|
---|
552 | def fuelTank2string(fuelTank):
|
---|
553 | """Get the string equivalent of the given fuelTank."""
|
---|
554 | return _fuelTankStrings[fuelTank] \
|
---|
555 | if fuelTank in _fuelTankStrings else None
|
---|
556 |
|
---|
557 | #-------------------------------------------------------------------------------
|
---|
558 |
|
---|
559 | _fuelTankLogStrings = { FUELTANK_CENTRE : "centre",
|
---|
560 | FUELTANK_LEFT : "left",
|
---|
561 | FUELTANK_RIGHT : "right",
|
---|
562 | FUELTANK_LEFT_AUX : "left aux",
|
---|
563 | FUELTANK_RIGHT_AUX : "right aux",
|
---|
564 | FUELTANK_LEFT_TIP : "left tip",
|
---|
565 | FUELTANK_RIGHT_TIP : "right tip",
|
---|
566 | FUELTANK_EXTERNAL1 : "external 1",
|
---|
567 | FUELTANK_EXTERNAL2 : "external 2",
|
---|
568 | FUELTANK_CENTRE2 : "centre 2" }
|
---|
569 |
|
---|
570 | def fuelTank2logString(fuelTank):
|
---|
571 | """Get the log string equivalent of the given fuelTank."""
|
---|
572 | return _fuelTankLogStrings[fuelTank] \
|
---|
573 | if fuelTank in _fuelTankLogStrings else "unknown"
|
---|
574 |
|
---|
575 | #-------------------------------------------------------------------------------
|
---|
576 |
|
---|
577 | languages = ["$system", "en_GB", "hu_HU"]
|
---|
578 |
|
---|
579 | #-------------------------------------------------------------------------------
|
---|
580 |
|
---|
581 | defaultDate = datetime.date(1900, 1, 1)
|
---|
582 |
|
---|
583 | #-------------------------------------------------------------------------------
|
---|
584 |
|
---|
585 | # The weight of a cabin crew member [kg]
|
---|
586 | WEIGHT_CABIN_CREW = 75
|
---|
587 |
|
---|
588 | # The weight of an adult passenger [kg]
|
---|
589 | WEIGHT_PASSENGER = 84
|
---|
590 |
|
---|
591 | # The weight of an adult passenger on charter flight [kg]
|
---|
592 | WEIGHT_PASSENGER_CHARTER = 76
|
---|
593 |
|
---|
594 | # The weight of a child passenger [kg]
|
---|
595 | WEIGHT_CHILD = 35
|
---|
596 |
|
---|
597 | # The weight of an infant passenger [kg]
|
---|
598 | WEIGHT_INFANT = 0
|
---|
599 |
|
---|
600 | #-------------------------------------------------------------------------------
|
---|