Changeset 331:79755718ab7d for src/mlx
- Timestamp:
- 11/13/12 16:26:50 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/acft.py
r329 r331 51 51 """Get the average.""" 52 52 return self._sum / len(self._deque) 53 53 54 54 #--------------------------------------------------------------------------------------- 55 55 … … 65 65 self._flight = flight 66 66 self._aircraftState = None 67 67 68 68 self._maxVS = -10000.0 69 69 self._minVS = 10000.0 … … 93 93 self._adf2Logger = checks.ADF2Logger() 94 94 self._checkers.append(self._adf2Logger) 95 95 96 96 self._checkers.append(checks.SquawkLogger()) 97 97 … … 139 139 timeout = 5.0 + config.realIASSmoothingLength - 1 140 140 self._checkers.append(checks.OverspeedChecker(timeout = timeout)) 141 141 142 142 self._checkers.append(checks.StallChecker()) 143 143 144 144 self._checkers.append(checks.PitotChecker()) 145 145 146 146 self._checkers.append(checks.ReverserChecker()) 147 147 … … 186 186 return None if self._aircraftState is None \ 187 187 else self._aircraftState.timestamp 188 188 189 189 def getFlapsSpeedLimit(self, flaps): 190 190 """Get the speed limit for the given flaps setting.""" … … 229 229 finally: 230 230 self._aircraftState = aircraftState 231 231 232 232 def setStage(self, aircraftState, newStage): 233 233 """Set the given stage as the new one and do whatever should be … … 237 237 self.logger.message(aircraftState.timestamp, "Block time start") 238 238 self._flight.logFuel(aircraftState) 239 self.logger.message(aircraftState.timestamp, 239 self.logger.message(aircraftState.timestamp, 240 240 "ZFW: %.2f kg" % (aircraftState.zfw)) 241 241 flight = self._flight … … 247 247 self.logger.message(aircraftState.timestamp, 248 248 "Flight time start") 249 self.logger.message(aircraftState.timestamp, 249 self.logger.message(aircraftState.timestamp, 250 250 "Takeoff weight: %.0f kg, MTOW: %.0f kg" % \ 251 251 (aircraftState.grossWeight, self.mtow)) 252 252 self.logger.message(aircraftState.timestamp, 253 253 "Wind %03.0f degrees at %.0f knots" % \ 254 (aircraftState.windDirection, 254 (aircraftState.windDirection, 255 255 aircraftState.windSpeed)) 256 256 self._logRadios(aircraftState) … … 286 286 self.logger.message(aircraftState.timestamp, 287 287 "Flown distance: %.2f NM" % \ 288 (self._flight.flownDistance,)) 288 (self._flight.flownDistance,)) 289 289 blockLength = self._flight.blockTimeEnd - self._flight.blockTimeStart 290 290 self.logger.message(aircraftState.timestamp, … … 299 299 self.flight.simulator.startFlare() 300 300 301 def flareStarted(self, windSpeed, windDirection, visibility, 301 def flareStarted(self, windSpeed, windDirection, visibility, 302 302 flareStart, flareStartFS): 303 303 """Called when the flare has started.""" … … 314 314 self.flight.flareStarted(flareStart, flareStartFS) 315 315 fs.sendMessage(const.MESSAGETYPE_INFORMATION, "Flare-time", 3) 316 316 317 317 def flareFinished(self, flareEnd, flareEndFS, tdRate, tdRateCalculatedByFS, 318 318 ias, pitch, bank, heading): … … 323 323 self.logger.message(self._aircraftState.timestamp, 324 324 "Flaretime: %.3f (from %s)" % \ 325 (flareTime, 325 (flareTime, 326 326 "the simulator" if flareTimeFromFS else "real time",)) 327 327 self.logger.message(self._aircraftState.timestamp, … … 341 341 self.logger.message(self._aircraftState.timestamp, 342 342 "Touchdown heading: %03.0f degrees" % (heading,)) 343 self.logger.message(self._aircraftState.timestamp, 343 self.logger.message(self._aircraftState.timestamp, 344 344 "Centre of gravity: %.1f%%" % \ 345 345 (self._aircraftState.cog*100.0,)) … … 434 434 fs.sendMessage(const.MESSAGETYPE_GATE_SYSTEM, 435 435 "Free gates: " + gateList, 20) 436 436 437 437 438 438 def _logRadios(self, aircraftState): … … 455 455 - fuel: left, centre, right 456 456 - n1: left, right 457 - reverser: left, right""" 457 - reverser: left, right""" 458 458 def __init__(self, flight): 459 459 super(Boeing737, self).__init__(flight) … … 605 605 """Boeing 767-300 aircraft.""" 606 606 def __init__(self, flight): 607 super(B763, self).__init__( cflight)607 super(B763, self).__init__(flight) 608 608 self.dow = 91311 609 609 self.mtow = 181436 … … 714 714 """Indicate if the speed is in knots.""" 715 715 return False 716 716 717 717 def _appendLightsLoggers(self): 718 718 """Append the loggers needed for the lights.""" … … 752 752 """Indicate if the speed is in knots.""" 753 753 return False 754 754 755 755 def _appendLightsLoggers(self): 756 756 """Append the loggers needed for the lights.""" … … 791 791 """Indicate if the speed is in knots.""" 792 792 return False 793 793 794 794 def _appendLightsLoggers(self): 795 795 """Append the loggers needed for the lights."""
Note:
See TracChangeset
for help on using the changeset viewer.