1 | # Various constants used in the logger
|
---|
2 |
|
---|
3 | #-------------------------------------------------------------------------------
|
---|
4 |
|
---|
5 | # The version of the program
|
---|
6 | VERSION="0.006"
|
---|
7 |
|
---|
8 | #-------------------------------------------------------------------------------
|
---|
9 |
|
---|
10 | # The ratio between lbs and kg
|
---|
11 | LBSTOKG=0.4536
|
---|
12 |
|
---|
13 | # The ratio between kgs and lbs
|
---|
14 | KGSTOLB=1/LBSTOKG
|
---|
15 |
|
---|
16 | # The ratio between feet and metre
|
---|
17 | FEETTOMETRES=0.3048
|
---|
18 |
|
---|
19 | #-------------------------------------------------------------------------------
|
---|
20 |
|
---|
21 | # Flight simulator type: MS Flight Simulator 2004
|
---|
22 | SIM_MSFS9 = 1
|
---|
23 |
|
---|
24 | # Flight simulator type: MS Flight Simulator X
|
---|
25 | SIM_MSFSX = 2
|
---|
26 |
|
---|
27 | # Flight simulator type: X-Plane 9
|
---|
28 | SIM_XPLANE9 = 3
|
---|
29 |
|
---|
30 | # Flight simulator type: X-Plane 10
|
---|
31 | SIM_XPLANE10 = 4
|
---|
32 |
|
---|
33 | #-------------------------------------------------------------------------------
|
---|
34 |
|
---|
35 | # Aircraft type: Boeing 737-600
|
---|
36 | AIRCRAFT_B736 = 1
|
---|
37 |
|
---|
38 | # Aircraft type: Boeing 737-700
|
---|
39 | AIRCRAFT_B737 = 2
|
---|
40 |
|
---|
41 | # Aircraft type: Boeing 737-800
|
---|
42 | AIRCRAFT_B738 = 3
|
---|
43 |
|
---|
44 | # Aircraft type: Boeing 737-300
|
---|
45 | AIRCRAFT_B733 = 4
|
---|
46 |
|
---|
47 | # Aircraft type: Boeing 737-400
|
---|
48 | AIRCRAFT_B734 = 5
|
---|
49 |
|
---|
50 | # Aircraft type: Boeing 737-500
|
---|
51 | AIRCRAFT_B735 = 6
|
---|
52 |
|
---|
53 | # Aircraft type: Dash-8 Q400
|
---|
54 | AIRCRAFT_DH8D = 7
|
---|
55 |
|
---|
56 | # Aircraft type: Boeing 767-200
|
---|
57 | AIRCRAFT_B762 = 8
|
---|
58 |
|
---|
59 | # Aircraft type: Boeing 767-300
|
---|
60 | AIRCRAFT_B763 = 9
|
---|
61 |
|
---|
62 | # Aircraft type: Canadair CRJ-200
|
---|
63 | AIRCRAFT_CRJ2 = 10
|
---|
64 |
|
---|
65 | # Aircraft type: Fokker F-70
|
---|
66 | AIRCRAFT_F70 = 11
|
---|
67 |
|
---|
68 | # Aircraft type: Lisunov Li-2
|
---|
69 | AIRCRAFT_DC3 = 12
|
---|
70 |
|
---|
71 | # Aircraft type: Tupolev Tu-134
|
---|
72 | AIRCRAFT_T134 = 13
|
---|
73 |
|
---|
74 | # Aircraft type: Tupolev Tu-154
|
---|
75 | AIRCRAFT_T154 = 14
|
---|
76 |
|
---|
77 | # Aircraft type: Yakovlev Yak-40
|
---|
78 | AIRCRAFT_YK40 = 15
|
---|
79 |
|
---|
80 | #-------------------------------------------------------------------------------
|
---|
81 |
|
---|
82 | # Flight stage: boarding
|
---|
83 | STAGE_BOARDING = 1
|
---|
84 |
|
---|
85 | # Flight stage: pushback, startup and taxi
|
---|
86 | STAGE_PUSHANDTAXI = 2
|
---|
87 |
|
---|
88 | # Flight stage: takeoff
|
---|
89 | STAGE_TAKEOFF = 3
|
---|
90 |
|
---|
91 | # Flight stage: RTO
|
---|
92 | STAGE_RTO = 4
|
---|
93 |
|
---|
94 | # Flight stage: climb
|
---|
95 | STAGE_CLIMB = 5
|
---|
96 |
|
---|
97 | # Flight stage: cruise
|
---|
98 | STAGE_CRUISE = 6
|
---|
99 |
|
---|
100 | # Flight stage: descent
|
---|
101 | STAGE_DESCENT = 7
|
---|
102 |
|
---|
103 | # Flight stage: landing
|
---|
104 | STAGE_LANDING = 8
|
---|
105 |
|
---|
106 | # Flight stage: taxi after landing
|
---|
107 | STAGE_TAXIAFTERLAND = 9
|
---|
108 |
|
---|
109 | # Flight stage: parking
|
---|
110 | STAGE_PARKING = 10
|
---|
111 |
|
---|
112 | # Flight stage: go-around
|
---|
113 | STAGE_GOAROUND = 11
|
---|
114 |
|
---|
115 | # Flight stage: end
|
---|
116 | STAGE_END = 12
|
---|
117 |
|
---|
118 | #-------------------------------------------------------------------------------
|
---|
119 |
|
---|
120 | # Plane status: unknown
|
---|
121 | PLANE_UNKNOWN = 0
|
---|
122 |
|
---|
123 | # Plane status: at home, i.e. LHBP
|
---|
124 | PLANE_HOME = 1
|
---|
125 |
|
---|
126 | # Plane status: away
|
---|
127 | PLANE_AWAY = 2
|
---|
128 |
|
---|
129 | # Plane status: parking
|
---|
130 | PLANE_PARKING = 3
|
---|
131 |
|
---|
132 | #-------------------------------------------------------------------------------
|
---|
133 |
|
---|
134 | # Flight type: scheduled
|
---|
135 | FLIGHTTYPE_SCHEDULED = 0
|
---|
136 |
|
---|
137 | # Flight type: old-timer
|
---|
138 | FLIGHTTYPE_OLDTIMER = 1
|
---|
139 |
|
---|
140 | # Flight type: VIP
|
---|
141 | FLIGHTTYPE_VIP = 2
|
---|
142 |
|
---|
143 | # Flight type: charter
|
---|
144 | FLIGHTTYPE_CHARTER = 3
|
---|
145 |
|
---|
146 | #-------------------------------------------------------------------------------
|
---|
147 |
|
---|
148 | # Delay code: loading problems
|
---|
149 | DELAYCODE_LOADING = 0
|
---|
150 |
|
---|
151 | # Delay code: VATSIM problem
|
---|
152 | DELAYCODE_VATSIM = 1
|
---|
153 |
|
---|
154 | # Delay code: network problems
|
---|
155 | DELAYCODE_NETWORK = 2
|
---|
156 |
|
---|
157 | # Delay code: controller's fault
|
---|
158 | DELAYCODE_CONTROLLER = 3
|
---|
159 |
|
---|
160 | # Delay code: system crash or freeze
|
---|
161 | DELAYCODE_SYSTEM = 4
|
---|
162 |
|
---|
163 | # Delay code: navigation problem
|
---|
164 | DELAYCODE_NAVIGATION = 5
|
---|
165 |
|
---|
166 | # Delay code: traffic problems
|
---|
167 | DELAYCODE_TRAFFIC = 6
|
---|
168 |
|
---|
169 | # Delay code: apron navigation
|
---|
170 | DELAYCODE_APRON = 7
|
---|
171 |
|
---|
172 | # Delay code: weather problems
|
---|
173 | DELAYCODE_WEATHER = 8
|
---|
174 |
|
---|
175 | # Delay code: personal reasons
|
---|
176 | DELAYCODE_PERSONAL = 9
|
---|
177 |
|
---|
178 | #-------------------------------------------------------------------------------
|
---|
179 |
|
---|
180 | # The available gates at LHBP
|
---|
181 | lhbpGateNumbers = []
|
---|
182 |
|
---|
183 | for i in range(1, 7):
|
---|
184 | lhbpGateNumbers.append(str(i))
|
---|
185 |
|
---|
186 | for i in range(10, 19):
|
---|
187 | lhbpGateNumbers.append(str(i))
|
---|
188 |
|
---|
189 | for i in range(24, 28):
|
---|
190 | lhbpGateNumbers.append(str(i))
|
---|
191 |
|
---|
192 | for i in range(31, 39):
|
---|
193 | lhbpGateNumbers.append(str(i))
|
---|
194 |
|
---|
195 | for i in range(42, 47):
|
---|
196 | lhbpGateNumbers.append(str(i))
|
---|
197 |
|
---|
198 | for i in range(60, 84):
|
---|
199 | if i!=70 and i!=80:
|
---|
200 | lhbpGateNumbers.append(str(i))
|
---|
201 |
|
---|
202 | #-------------------------------------------------------------------------------
|
---|
203 |
|
---|
204 | _stageStrings = { STAGE_BOARDING : "boarding",
|
---|
205 | STAGE_PUSHANDTAXI : "pushback and taxi",
|
---|
206 | STAGE_TAKEOFF : "takeoff",
|
---|
207 | STAGE_RTO : "RTO",
|
---|
208 | STAGE_CLIMB : "climb",
|
---|
209 | STAGE_CRUISE : "cruise",
|
---|
210 | STAGE_DESCENT : "descent",
|
---|
211 | STAGE_LANDING : "landing",
|
---|
212 | STAGE_TAXIAFTERLAND : "taxi",
|
---|
213 | STAGE_PARKING : "parking",
|
---|
214 | STAGE_GOAROUND : "go-around",
|
---|
215 | STAGE_END : "end" }
|
---|
216 |
|
---|
217 | def stage2string(stage):
|
---|
218 | """Convert the given stage to a lower-case string."""
|
---|
219 | return _stageStrings[stage] if stage in _stageStrings else None
|
---|
220 |
|
---|
221 |
|
---|