Changeset 10:103229d7ace5 for src
- Timestamp:
- 02/05/12 15:11:45 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/acft.py
r9 r10 44 44 45 45 self._checkers.append(checks.GearsLogger()) 46 47 46 self._checkers.append(checks.CruiseSpeedLogger()) 47 self._checkers.append(checks.SpoilerLogger()) 48 48 49 49 @property -
src/checks.py
r9 r10 109 109 if state.altitude>24500.0: 110 110 logger.message(state.timestamp, 111 "Cruise speed: %. 2f mach" % (state.mach,))111 "Cruise speed: %.3f mach" % (state.mach,)) 112 112 else: 113 113 logger.message(state.timestamp, 114 114 "Cruise speed: %.0f knots" % (state.ias,)) 115 115 self._lastTime = state.timestamp 116 117 #--------------------------------------------------------------------------------------- 118 119 class SpoilerLogger(StateChecker): 120 """Logger for the cruise speed.""" 121 def __init__(self): 122 """Construct the logger.""" 123 self._logged = False 124 self._spoilerExtension = None 125 126 def check(self, flight, aircraft, logger, oldState, state): 127 """Log the cruise speed if necessary.""" 128 if flight.stage==const.STAGE_LANDING and not self._logged: 129 if state.onTheGround: 130 if state.spoilerExtension!=self._spoilerExtension: 131 logger.message(state.timestamp, "Spoilers deployed") 132 self._logged = True 133 else: 134 self._spoilerExtension = state.spoilerExtension 116 135 117 136 #---------------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.