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 | # The available gates at LHBP
|
---|
135 | lhbpGateNumbers = []
|
---|
136 |
|
---|
137 | for i in range(1, 7):
|
---|
138 | lhbpGateNumbers.append(str(i))
|
---|
139 |
|
---|
140 | for i in range(10, 19):
|
---|
141 | lhbpGateNumbers.append(str(i))
|
---|
142 |
|
---|
143 | for i in range(24, 28):
|
---|
144 | lhbpGateNumbers.append(str(i))
|
---|
145 |
|
---|
146 | for i in range(31, 39):
|
---|
147 | lhbpGateNumbers.append(str(i))
|
---|
148 |
|
---|
149 | for i in range(42, 47):
|
---|
150 | lhbpGateNumbers.append(str(i))
|
---|
151 |
|
---|
152 | for i in range(60, 84):
|
---|
153 | if i!=70 and i!=80:
|
---|
154 | lhbpGateNumbers.append(str(i))
|
---|
155 |
|
---|
156 | #-------------------------------------------------------------------------------
|
---|
157 |
|
---|
158 | _stageStrings = { STAGE_BOARDING : "boarding",
|
---|
159 | STAGE_PUSHANDTAXI : "pushback and taxi",
|
---|
160 | STAGE_TAKEOFF : "takeoff",
|
---|
161 | STAGE_RTO : "RTO",
|
---|
162 | STAGE_CLIMB : "climb",
|
---|
163 | STAGE_CRUISE : "cruise",
|
---|
164 | STAGE_DESCENT : "descent",
|
---|
165 | STAGE_LANDING : "landing",
|
---|
166 | STAGE_TAXIAFTERLAND : "taxi",
|
---|
167 | STAGE_PARKING : "parking",
|
---|
168 | STAGE_GOAROUND : "go-around",
|
---|
169 | STAGE_END : "end" }
|
---|
170 |
|
---|
171 | def stage2string(stage):
|
---|
172 | """Convert the given stage to a lower-case string."""
|
---|
173 | return _stageStrings[stage] if stage in _stageStrings else None
|
---|
174 |
|
---|
175 |
|
---|