Changeset 908:fcf3c44650f1 for src
- Timestamp:
- 05/21/18 14:15:25 (7 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/common.py
r800 r908 18 18 #--------------------------------------------------------------------------------------- 19 19 20 MAVA_BASE_URL = os.environ.get("MAVA_BASE_URL", "http://virtualairlines.hu") 20 #MAVA_BASE_URL = os.environ.get("MAVA_BASE_URL", "http://virtualairlines.hu") 21 MAVA_BASE_URL = os.environ.get("MAVA_BASE_URL", "http://oldmava.mavasystems.hu") 21 22 22 23 #------------------------------------------------------------------------------- -
src/mlx/gui/flight.py
r899 r908 2275 2275 aircraft = self._wizard.gui._flight.aircraft 2276 2276 2277 numC rew = bookedFlight.numCrew2278 numC ockpitCrew = min(numCrew, aircraft.dowCockpit)2279 numC abinCrew = numCrew - numCockpitCrew2277 numCockpitCrew = bookedFlight.numCockpitCrew 2278 numCabinCrew = bookedFlight.numCabinCrew 2279 numCrew = numCockpitCrew + numCabinCrew 2280 2280 2281 2281 self._numCockpitCrew.set_int(numCockpitCrew) -
src/mlx/pirep.py
r856 r908 136 136 self.bookedFlight = flight.bookedFlight 137 137 138 self.numCockpitCrew = flight.numCockpitCrew 139 self.numCabinCrew = flight.numCabinCrew 138 140 self.numCrew = flight.numCrew 139 141 self.numPassengers = flight.numPassengers … … 182 184 self.bookedFlight = bookedFlight 183 185 184 self.numCrew = int(pirepData["numCrew"]) 186 self.numCockpitCrew = int(pirepData["numCockpitCrew"]) 187 self.numCabinCrew = int(pirepData["numCabinCrew"]) 188 self.numCrew = self.numCockpitCrew + self.numCabinCrew 185 189 self.numPassengers = int(pirepData["numPassengers"]) 186 190 self.bagWeight = int(pirepData["bagWeight"]) … … 381 385 attrs["arrivalICAO"] = self.bookedFlight.arrivalICAO 382 386 attrs["numPassengers"] = self.numPassengers 387 attrs["numCockpitCrew"] = self.numCockpitCrew 388 attrs["numCabinCrew"] = self.numCabinCrew 383 389 attrs["numCrew"] = self.numCrew 384 390 attrs["cargoWeight"] = self.cargoWeight -
src/mlx/rpc.py
r898 r908 236 236 def _decodeAircraftType(typeCode): 237 237 """Decode the aircraft type from the given typeCode.""" 238 if typeCode in BookedFlight.TYPECODE2TYPE:239 return BookedFlight.TYPECODE2TYPE[typeCode]238 if typeCode in const.icao2Type: 239 return const.icao2Type[typeCode] 240 240 else: 241 241 raise Exception("Invalid aircraft type code: '" + typeCode + "'") … … 277 277 _instructions = { 278 278 "numPassengers" : int, 279 "numCrew" : int, 279 "numCockpitCrew" : int, 280 "numCabinCrew" : int, 280 281 "bagWeight" : int, 281 282 "cargoWeight" : int, … … 309 310 print >> f, "tail_nr=%s" % (self.tailNumber,) 310 311 print >> f, "passenger=%d" % (self.numPassengers,) 311 print >> f, "crew=%d" % (self.numC rew,)312 print >> f, "crew=%d" % (self.numCockpitrew + self.numCabinCrew,) 312 313 print >> f, "bag=%d" % (self.bagWeight,) 313 314 print >> f, "cargo=%d" % (self.cargoWeight,) … … 518 519 self._sessionID = reply.value["sessionID"] 519 520 520 types = [ BookedFlight.TYPECODE2TYPE[typeCode]521 types = [const.icao2Type[typeCode] 521 522 for typeCode in reply.value["typeCodes"]] 522 523 … … 626 627 of type codes, if any.""" 627 628 typeCodes = None if types is None else \ 628 [BookedFlight.TYPE2TYPECODE[type] for type in types]629 [const.icaoCodes[type] for type in types] 629 630 630 631 values = self._performCall(lambda sessionID: -
src/mlx/web.py
r898 r908 130 130 131 131 flight.numPassengers = 0 132 flight.numCockpitCrew = 2 133 flight.numCabinCrew = 2 132 134 flight.numCrew = 2 133 135 flight.bagWeight = 0 … … 248 250 arrivalTime) 249 251 252 self.numCockpitCrew = self.numCrew 253 self.numCabinCrew = 0 254 250 255 d = dir(self) 251 256 for attribute in ["callsign", "departureICAO", "arrivalICAO", 252 "aircraftType", "tailNumber", 253 "num Passengers", "numCrew",257 "aircraftType", "tailNumber", "numPassengers", 258 "numCrew", "numCockpitCrew", "numCabinCrew", 254 259 "bagWeight", "cargoWeight", "mailWeight", 255 260 "route", "departureTime", "arrivalTime"]: … … 281 286 282 287 self.aircraftType = \ 283 self._decodeAircraft Type(bookedFlightData["aircraftType"])288 self._decodeAircraftICAOType(bookedFlightData["aircraftType"]) 284 289 self.tailNumber = bookedFlightData["tailNumber"] 285 290 self.numPassengers = int(bookedFlightData["numPassengers"]) 286 self.numCrew = int(bookedFlightData["numCrew"]) 291 self.numCockpitCrew = int(bookedFlightData["numCockpitCrew"]) 292 self.numCabinCrew = int(bookedFlightData["numCabinCrew"]) 293 self.numCrew = self.numCockpitCrew + self.numCabinCrew 287 294 self.bagWeight = int(bookedFlightData["bagWeight"]) 288 295 self.cargoWeight = int(bookedFlightData["cargoWeight"]) … … 326 333 if typeCode in self.TYPECODE2TYPE: 327 334 return self.TYPECODE2TYPE[typeCode] 335 else: 336 raise Exception("Invalid aircraft type code: '" + typeCode + "'") 337 338 def _decodeAircraftICAOType(self, typeCode): 339 """Decode the aircraft type from the given typeCode.""" 340 if typeCode in const.icao2Type: 341 return const.icao2Type[typeCode] 328 342 else: 329 343 raise Exception("Invalid aircraft type code: '" + typeCode + "'")
Note:
See TracChangeset
for help on using the changeset viewer.