1 | # Various constants used in the logger
|
---|
2 |
|
---|
3 | #-------------------------------------------------------------------------------
|
---|
4 |
|
---|
5 | # The ratio between lbs and kg
|
---|
6 | LBSTOKG=0.4536
|
---|
7 |
|
---|
8 | # The ratio between feet and metre
|
---|
9 | FEETTOMETRES=0.3048
|
---|
10 |
|
---|
11 | #-------------------------------------------------------------------------------
|
---|
12 |
|
---|
13 | # Flight simulator type: MS Flight Simulator 2004
|
---|
14 | SIM_MSFS9 = 1
|
---|
15 |
|
---|
16 | # Flight simulator type: MS Flight Simulator X
|
---|
17 | SIM_MSFSX = 2
|
---|
18 |
|
---|
19 | # Flight simulator type: X-Plane 9
|
---|
20 | SIM_XPLANE9 = 3
|
---|
21 |
|
---|
22 | # Flight simulator type: X-Plane 10
|
---|
23 | SIM_XPLANE10 = 4
|
---|
24 |
|
---|
25 | #-------------------------------------------------------------------------------
|
---|
26 |
|
---|
27 | # Aircraft type: Boeing 737-600
|
---|
28 | AIRCRAFT_B736 = 1
|
---|
29 |
|
---|
30 | # Aircraft type: Boeing 737-700
|
---|
31 | AIRCRAFT_B737 = 2
|
---|
32 |
|
---|
33 | # Aircraft type: Boeing 737-800
|
---|
34 | AIRCRAFT_B738 = 3
|
---|
35 |
|
---|
36 | # Aircraft type: Boeing 737-300
|
---|
37 | AIRCRAFT_B733 = 4
|
---|
38 |
|
---|
39 | # Aircraft type: Boeing 737-400
|
---|
40 | AIRCRAFT_B734 = 5
|
---|
41 |
|
---|
42 | # Aircraft type: Boeing 737-500
|
---|
43 | AIRCRAFT_B735 = 6
|
---|
44 |
|
---|
45 | # Aircraft type: Dash-8 Q400
|
---|
46 | AIRCRAFT_DH8D = 7
|
---|
47 |
|
---|
48 | # Aircraft type: Boeing 767-200
|
---|
49 | AIRCRAFT_B762 = 8
|
---|
50 |
|
---|
51 | # Aircraft type: Boeing 767-300
|
---|
52 | AIRCRAFT_B763 = 9
|
---|
53 |
|
---|
54 | # Aircraft type: Canadair CRJ-200
|
---|
55 | AIRCRAFT_CRJ2 = 10
|
---|
56 |
|
---|
57 | # Aircraft type: Fokker F-70
|
---|
58 | AIRCRAFT_F70 = 11
|
---|
59 |
|
---|
60 | # Aircraft type: Lisunov Li-2
|
---|
61 | AIRCRAFT_DC3 = 12
|
---|
62 |
|
---|
63 | # Aircraft type: Tupolev Tu-134
|
---|
64 | AIRCRAFT_T134 = 13
|
---|
65 |
|
---|
66 | # Aircraft type: Tupolev Tu-154
|
---|
67 | AIRCRAFT_T154 = 14
|
---|
68 |
|
---|
69 | # Aircraft type: Yakovlev Yak-40
|
---|
70 | AIRCRAFT_YK40 = 15
|
---|
71 |
|
---|
72 | #-------------------------------------------------------------------------------
|
---|
73 |
|
---|
74 | # Flight stage: boarding
|
---|
75 | STAGE_BOARDING = 1
|
---|
76 |
|
---|
77 | # Flight stage: pushback, startup and taxi
|
---|
78 | STAGE_PUSHANDTAXI = 2
|
---|
79 |
|
---|
80 | # Flight stage: takeoff
|
---|
81 | STAGE_TAKEOFF = 3
|
---|
82 |
|
---|
83 | # Flight stage: RTO
|
---|
84 | STAGE_RTO = 4
|
---|
85 |
|
---|
86 | # Flight stage: climb
|
---|
87 | STAGE_CLIMB = 5
|
---|
88 |
|
---|
89 | # Flight stage: cruise
|
---|
90 | STAGE_CRUISE = 6
|
---|
91 |
|
---|
92 | # Flight stage: descent
|
---|
93 | STAGE_DESCENT = 7
|
---|
94 |
|
---|
95 | # Flight stage: landing
|
---|
96 | STAGE_LANDING = 8
|
---|
97 |
|
---|
98 | # Flight stage: taxi after landing
|
---|
99 | STAGE_TAXIAFTERLAND = 9
|
---|
100 |
|
---|
101 | # Flight stage: parking
|
---|
102 | STAGE_PARKING = 10
|
---|
103 |
|
---|
104 | # Flight stage: go-around
|
---|
105 | STAGE_GOAROUND = 11
|
---|
106 |
|
---|
107 | # Flight stage: end
|
---|
108 | STAGE_END = 12
|
---|
109 |
|
---|
110 | #-------------------------------------------------------------------------------
|
---|
111 |
|
---|
112 | _stageStrings = { STAGE_BOARDING : "boarding",
|
---|
113 | STAGE_PUSHANDTAXI : "pushback and taxi",
|
---|
114 | STAGE_TAKEOFF : "takeoff",
|
---|
115 | STAGE_RTO : "RTO",
|
---|
116 | STAGE_CLIMB : "climb",
|
---|
117 | STAGE_CRUISE : "cruise",
|
---|
118 | STAGE_DESCENT : "descent",
|
---|
119 | STAGE_LANDING : "landing",
|
---|
120 | STAGE_TAXIAFTERLAND : "taxi",
|
---|
121 | STAGE_PARKING : "parking",
|
---|
122 | STAGE_GOAROUND : "go-around",
|
---|
123 | STAGE_END : "end" }
|
---|
124 |
|
---|
125 | def stage2string(stage):
|
---|
126 | """Convert the given stage to a lower-case string."""
|
---|
127 | return _stageStrings[stage] if stage in _stageStrings else None
|
---|
128 |
|
---|
129 |
|
---|