Ignore:
Timestamp:
06/28/12 17:24:45 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

RPM is handled properly and the fuel tanks of Li-2 match the simulator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/checks.py

    r243 r263  
    572572        """Determine if the engines are in such a state that the lights should
    573573        be on."""
    574         return max(state.n1)>5
     574        if state.n1 is not None:
     575            return max(state.n1)>5
     576        elif state.rpm is not None:
     577            return max(state.rpm)>0
     578        else:
     579            return False
    575580
    576581#---------------------------------------------------------------------------------------
     
    582587        """Determine if the engines are in such a state that the lights should
    583588        be on."""
    584         return max(state.n1[1:])>5
    585    
     589        return max(state.n1[1:])>5   
    586590
    587591#---------------------------------------------------------------------------------------
    588592
    589593class BankChecker(SimpleFaultChecker):
    590     """Check for the anti-collision light being off at high N1 values."""
     594    """Check for the bank is within limits."""
    591595    def isCondition(self, flight, aircraft, oldState, state):
    592596        """Check if the fault condition holds."""
     
    973977    def isCondition(self, flight, aircraft, oldState, state):
    974978        """Check if the fault condition holds."""
    975         return flight.stage==const.STAGE_TAKEOFF and max(state.n1)>97
     979        return flight.stage==const.STAGE_TAKEOFF and \
     980               state.n1 is not None and max(state.n1)>97
    976981               
    977982    def logFault(self, flight, aircraft, logger, oldState, state):
    978983        """Log the fault."""
    979         print state.n1
    980984        flight.handleFault(ThrustChecker, state.timestamp,
    981985                           FaultChecker._appendDuring(flight,
Note: See TracChangeset for help on using the changeset viewer.