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