Changeset 600:c788380d2fea for src


Ignore:
Timestamp:
02/22/15 09:37:37 (10 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The manual speedbrake operation is logged (re #245)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/checks.py

    r598 r600  
    193193
    194194class SpoilerLogger(StateChecker):
    195     """Logger for the cruise speed."""
     195    """Logger for the spoiler."""
    196196    def __init__(self):
    197197        """Construct the logger."""
     198        self._spoilersDown = True
    198199        self._logged = False
    199200        self._spoilersExtension = None
     
    201202    def check(self, flight, aircraft, logger, oldState, state):
    202203        """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")
    207210                    self._logged = True
    208211                    config = flight.config
    209212                    if config.enableSounds and config.speedbrakeAtTD:
    210213                        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
    213219
    214220#---------------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.