Changeset 1043:3629e16455ef for src


Ignore:
Timestamp:
04/03/22 14:32:40 (3 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

Unreadable N1 values are handled better (re #359)

Location:
src/mlx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/acft.py

    r919 r1043  
    516516        This default implementation checks the N1 values, but for
    517517        piston-powered aircraft you need to check the RPMs."""
    518         for n1 in aircraftState.n1:
    519             if n1>=0.5: return False
     518        if aircraftState.n1 is not None:
     519            for n1 in aircraftState.n1:
     520                if n1 is not None and n1>=0.5: return False
    520521        return True
    521522
  • src/mlx/checks.py

    r919 r1043  
    977977        be on."""
    978978        if state.n1 is not None:
    979             return max(state.n1)>5
     979            for n1 in state.n1:
     980                if n1 is not None and n1>5:
     981                    return True
     982            return False
    980983        elif state.rpm is not None:
    981984            return max(state.rpm)>0
     
    15901593    def isCondition(self, flight, aircraft, oldState, state):
    15911594        """Check if the fault condition holds."""
    1592         return flight.stage==const.STAGE_TAKEOFF and \
    1593                state.n1 is not None and max(state.n1)>97
     1595        if flight.stage==const.STAGE_TAKEOFF and state.n1 is not None:
     1596            for n1 in state.n1:
     1597                if n1 is not None and n1>97:
     1598                    return True
     1599        return False
    15941600
    15951601    def logFault(self, flight, aircraft, logger, oldState, state):
Note: See TracChangeset for help on using the changeset viewer.