Changeset 600:c788380d2fea for src
- Timestamp:
- 02/22/15 09:37:37 (10 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/checks.py
r598 r600 193 193 194 194 class SpoilerLogger(StateChecker): 195 """Logger for the cruise speed."""195 """Logger for the spoiler.""" 196 196 def __init__(self): 197 197 """Construct the logger.""" 198 self._spoilersDown = True 198 199 self._logged = False 199 200 self._spoilersExtension = None … … 201 202 def check(self, flight, aircraft, logger, oldState, state): 202 203 """Log the cruise speed if necessary.""" 203 if flight.stage==const.STAGE_LANDING and not self._logged: 204 if state.onTheGround: 205 if state.spoilersExtension!=self._spoilersExtension: 206 logger.message(state.timestamp, "Spoilers deployed") 204 spoilersDown = state.spoilersExtension==0 205 206 if flight.stage==const.STAGE_LANDING and state.onTheGround: 207 if not self._logged: 208 if not spoilersDown and self._spoilersDown: 209 logger.message(state.timestamp, "Speedbrake deployed") 207 210 self._logged = True 208 211 config = flight.config 209 212 if config.enableSounds and config.speedbrakeAtTD: 210 213 startSound(const.SOUND_SPEEDBRAKE) 211 else: 212 self._spoilersExtension = state.spoilersExtension 214 elif spoilersDown!=self._spoilersDown: 215 logger.message(state.timestamp, 216 "Speedbrake " + ("down" if spoilersDown else "up")) 217 218 self._spoilersDown = spoilersDown 213 219 214 220 #---------------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.