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