Ignore:
Timestamp:
12/14/12 18:39:04 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

In case of the DA F70 the transponder is considered to be turned on automatically, so it is checked differently: it should be on not later than 10 seconds after liftoff (#144)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/checks.py

    r360 r361  
    10701070class TransponderChecker(PatientFaultChecker):
    10711071    """Check if the transponder is used properly."""
    1072     def isCondition(self, flight, aircraft, oldState, state):
    1073         """Check if the fault condition holds."""
     1072    def __init__(self):
     1073        """Construct the transponder checker."""
     1074        super(TransponderChecker, self).__init__()
     1075        self._liftOffTime = None
     1076
     1077    def isCondition(self, flight, aircraft, oldState, state):
     1078        """Check if the fault condition holds."""
     1079        if state.onTheGround:
     1080            self._liftOffTime = None
     1081        elif self._liftOffTime is None:
     1082            self._liftOffTime = state.timestamp
     1083
    10741084        return state.xpdrC is not None and \
    10751085               ((state.xpdrC and flight.stage in
    10761086                 [const.STAGE_BOARDING, const.STAGE_PARKING]) or \
    1077                 (not state.xpdrC and flight.stage in
    1078                  [const.STAGE_TAKEOFF, const.STAGE_RTO, const.STAGE_CLIMB,
    1079                   const.STAGE_CRUISE, const.STAGE_DESCENT,
    1080                   const.STAGE_LANDING, const.STAGE_GOAROUND]))
     1087                (not state.xpdrC and
     1088                 (flight.stage in
     1089                  [const.STAGE_CRUISE, const.STAGE_DESCENT,
     1090                   const.STAGE_LANDING, const.STAGE_GOAROUND] or \
     1091                  ((not state.autoXPDR or \
     1092                    (self._liftOffTime is not None and
     1093                     state.timestamp > (self._liftOffTime+8))) and \
     1094                   flight.stage in
     1095                   [const.STAGE_TAKEOFF, const.STAGE_RTO, const.STAGE_CLIMB])
     1096                  )
     1097                 )
     1098                )
    10811099
    10821100    def logFault(self, flight, aircraft, logger, oldState, state):
Note: See TracChangeset for help on using the changeset viewer.