Changeset 132:92f78dc5b965 for src/mlx/const.py
- Timestamp:
- 04/30/12 10:55:37 (12 years ago)
- Branch:
- default
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/const.py
r129 r132 115 115 # Flight stage: end 116 116 STAGE_END = 12 117 118 #-------------------------------------------------------------------------------119 120 # Plane status: unknown121 PLANE_UNKNOWN = 0122 123 # Plane status: at home, i.e. LHBP124 PLANE_HOME = 1125 126 # Plane status: away127 PLANE_AWAY = 2128 129 # Plane status: parking130 PLANE_PARKING = 3131 132 #-------------------------------------------------------------------------------133 134 # Flight type: scheduled135 FLIGHTTYPE_SCHEDULED = 0136 137 # Flight type: old-timer138 FLIGHTTYPE_OLDTIMER = 1139 140 # Flight type: VIP141 FLIGHTTYPE_VIP = 2142 143 # Flight type: charter144 FLIGHTTYPE_CHARTER = 3145 146 #-------------------------------------------------------------------------------147 148 # Delay code: loading problems149 DELAYCODE_LOADING = 0150 151 # Delay code: VATSIM problem152 DELAYCODE_VATSIM = 1153 154 # Delay code: network problems155 DELAYCODE_NETWORK = 2156 157 # Delay code: controller's fault158 DELAYCODE_CONTROLLER = 3159 160 # Delay code: system crash or freeze161 DELAYCODE_SYSTEM = 4162 163 # Delay code: navigation problem164 DELAYCODE_NAVIGATION = 5165 166 # Delay code: traffic problems167 DELAYCODE_TRAFFIC = 6168 169 # Delay code: apron navigation170 DELAYCODE_APRON = 7171 172 # Delay code: weather problems173 DELAYCODE_WEATHER = 8174 175 # Delay code: personal reasons176 DELAYCODE_PERSONAL = 9177 178 #-------------------------------------------------------------------------------179 180 # The available gates at LHBP181 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 117 202 118 #------------------------------------------------------------------------------- … … 221 137 #------------------------------------------------------------------------------- 222 138 139 # Plane status: unknown 140 PLANE_UNKNOWN = 0 141 142 # Plane status: at home, i.e. LHBP 143 PLANE_HOME = 1 144 145 # Plane status: away 146 PLANE_AWAY = 2 147 148 # Plane status: parking 149 PLANE_PARKING = 3 150 151 #------------------------------------------------------------------------------- 152 153 # Flight type: scheduled 154 FLIGHTTYPE_SCHEDULED = 0 155 156 # Flight type: old-timer 157 FLIGHTTYPE_OLDTIMER = 1 158 159 # Flight type: VIP 160 FLIGHTTYPE_VIP = 2 161 162 # Flight type: charter 163 FLIGHTTYPE_CHARTER = 3 164 165 #------------------------------------------------------------------------------- 166 167 # Delay code: loading problems 168 DELAYCODE_LOADING = 0 169 170 # Delay code: VATSIM problem 171 DELAYCODE_VATSIM = 1 172 173 # Delay code: network problems 174 DELAYCODE_NETWORK = 2 175 176 # Delay code: controller's fault 177 DELAYCODE_CONTROLLER = 3 178 179 # Delay code: system crash or freeze 180 DELAYCODE_SYSTEM = 4 181 182 # Delay code: navigation problem 183 DELAYCODE_NAVIGATION = 5 184 185 # Delay code: traffic problems 186 DELAYCODE_TRAFFIC = 6 187 188 # Delay code: apron navigation 189 DELAYCODE_APRON = 7 190 191 # Delay code: weather problems 192 DELAYCODE_WEATHER = 8 193 194 # Delay code: personal reasons 195 DELAYCODE_PERSONAL = 9 196 197 #------------------------------------------------------------------------------- 198 199 # Message type: logger error 200 MESSAGETYPE_LOGGER_ERROR = 1 201 202 # Message type: information 203 MESSAGETYPE_INFORMATION = 2 204 205 # Message type: fault messages 206 MESSAGETYPE_FAULT = 3 207 208 # Message type: NO-GO fault messages 209 MESSAGETYPE_NOGO = 4 210 211 # Message type: gate system messages 212 MESSAGETYPE_GATE_SYSTEM = 5 213 214 # Message type: environment messages 215 MESSAGETYPE_ENVIRONMENT = 6 216 217 # Message type: help messages 218 MESSAGETYPE_HELP = 7 219 220 # Message type: visibility messages 221 MESSAGETYPE_VISIBILITY = 8 222 223 #------------------------------------------------------------------------------- 224 225 messageTypes = [ MESSAGETYPE_LOGGER_ERROR, 226 MESSAGETYPE_INFORMATION, 227 MESSAGETYPE_FAULT, 228 MESSAGETYPE_NOGO, 229 MESSAGETYPE_GATE_SYSTEM, 230 MESSAGETYPE_ENVIRONMENT, 231 MESSAGETYPE_HELP, 232 MESSAGETYPE_VISIBILITY ] 233 234 #------------------------------------------------------------------------------- 235 236 _messageTypeStrings = { MESSAGETYPE_LOGGER_ERROR : "loggerError", 237 MESSAGETYPE_INFORMATION : "information", 238 MESSAGETYPE_FAULT : "fault", 239 MESSAGETYPE_NOGO : "nogo", 240 MESSAGETYPE_GATE_SYSTEM : "gateSystem", 241 MESSAGETYPE_ENVIRONMENT : "environment", 242 MESSAGETYPE_HELP : "help", 243 MESSAGETYPE_VISIBILITY : "visibility" } 244 245 def messageType2string(messageType): 246 """Get the string equivalent of the given message type.""" 247 return _messageTypeStrings[messageType] \ 248 if messageType in _messageTypeStrings else None 249 250 #------------------------------------------------------------------------------- 251 252 # Message display level: none 253 MESSAGELEVEL_NONE = 0 254 255 # Message display level: only message in the simulator 256 MESSAGELEVEL_FS = 1 257 258 # Message display level: only sound 259 MESSAGELEVEL_SOUND = 2 260 261 # Message display level: both 262 MESSAGELEVEL_BOTH = 3 263 264 #------------------------------------------------------------------------------- 265 266 messageLevels = [ MESSAGELEVEL_NONE, 267 MESSAGELEVEL_FS, 268 MESSAGELEVEL_SOUND, 269 MESSAGELEVEL_BOTH ] 270 271 #------------------------------------------------------------------------------- 272 273 _messageLevelStrings = { MESSAGELEVEL_NONE : "none", 274 MESSAGELEVEL_FS : "fs", 275 MESSAGELEVEL_SOUND : "sound", 276 MESSAGELEVEL_BOTH : "both" } 277 278 def messageLevel2string(messageLevel): 279 """Get the string equivalent of the given message level.""" 280 return _messageLevelStrings[messageLevel] \ 281 if messageLevel in _messageLevelStrings else None 282 283 def string2messageLevel(str): 284 """Get the message level for the given string.""" 285 for (value, s) in _messageLevelStrings.iteritems(): 286 if str==s: 287 return value 288 return MESSAGELEVEL_NONE 289 290 #------------------------------------------------------------------------------- 291 292 # The available gates at LHBP 293 lhbpGateNumbers = [] 294 295 for i in range(1, 7): 296 lhbpGateNumbers.append(str(i)) 297 298 for i in range(10, 19): 299 lhbpGateNumbers.append(str(i)) 300 301 for i in range(24, 28): 302 lhbpGateNumbers.append(str(i)) 303 304 for i in range(31, 39): 305 lhbpGateNumbers.append(str(i)) 306 307 for i in range(42, 47): 308 lhbpGateNumbers.append(str(i)) 309 310 for i in range(60, 84): 311 if i!=70 and i!=80: 312 lhbpGateNumbers.append(str(i)) 313 314 #------------------------------------------------------------------------------- 315 223 316 languages = ["$system", "en_GB", "hu_HU"] 317
Note:
See TracChangeset
for help on using the changeset viewer.