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