Ignore:
Timestamp:
09/30/12 06:53:14 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added support for the landing lights and the NAV frequencies being unreliable and the Digital Aviation F70 model

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/checks.py

    r307 r314  
    301301    def _changed(self, oldState, state):
    302302        """Determine if the value has changed."""
    303         return self._getValue(oldState)!=self._getValue(state)
     303        currentValue = self._getValue(state)
     304        return currentValue is not None and self._getValue(oldState)!=currentValue
    304305
    305306#---------------------------------------------------------------------------------------
     
    759760    def isCondition(self, flight, aircraft, oldState, state):
    760761        """Check if the fault condition holds."""
    761         return (flight.stage==const.STAGE_BOARDING and \
    762                 state.landingLightsOn and state.onTheGround) or \
    763                (flight.stage==const.STAGE_TAKEOFF and \
    764                 not state.landingLightsOn and not state.onTheGround) or \
    765                (flight.stage in [const.STAGE_CLIMB, const.STAGE_CRUISE,
    766                                  const.STAGE_DESCENT] and \
    767                 state.landingLightsOn and state.altitude>12500) or \
    768                (flight.stage==const.STAGE_LANDING and \
    769                 not state.landingLightsOn and state.onTheGround) or \
    770                (flight.stage==const.STAGE_PARKING and \
    771                 state.landingLightsOn and state.onTheGround)
     762        return state.landingLightsOn is not None and \
     763               ((flight.stage==const.STAGE_BOARDING and \
     764                 state.landingLightsOn and state.onTheGround) or \
     765                (flight.stage==const.STAGE_TAKEOFF and \
     766                 not state.landingLightsOn and not state.onTheGround) or \
     767                (flight.stage in [const.STAGE_CLIMB, const.STAGE_CRUISE,
     768                                  const.STAGE_DESCENT] and \
     769                 state.landingLightsOn and state.altitude>12500) or \
     770                (flight.stage==const.STAGE_LANDING and \
     771                 not state.landingLightsOn and state.onTheGround) or \
     772                (flight.stage==const.STAGE_PARKING and \
     773                 state.landingLightsOn and state.onTheGround))
    772774               
    773775    def logFault(self, flight, aircraft, logger, oldState, state):
Note: See TracChangeset for help on using the changeset viewer.