Changeset 307:81a8a915717a for src


Ignore:
Timestamp:
08/18/12 11:31:05 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The condition in the anti-collision lights checker is reworked for Tupolev aircraft

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/checks.py

    r298 r307  
    622622class TupolevAntiCollisionLightsChecker(AntiCollisionLightsChecker):
    623623    """Check for the anti-collision light for Tuplev planes."""
    624 
    625     def isEngineCondition(self, state):
    626         """Determine if the engines are in such a state that the lights should
    627         be on."""
    628         return max(state.n1[1:])>5   
     624    def isCondition(self, flight, aircraft, oldState, state):
     625        """Check if the fault condition holds."""       
     626        numEnginesRunning = 0
     627        for n1 in state.n1:
     628            if n1>5: numEnginesRunning += 1
     629           
     630        if flight.stage==const.STAGE_PARKING:
     631            return numEnginesRunning<len(state.n1) \
     632                   and state.antiCollisionLightsOn
     633        else:
     634            return numEnginesRunning>1 and not state.antiCollisionLightsOn or \
     635                   numEnginesRunning<1 and state.antiCollisionLightsOn
    629636
    630637#---------------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.