Ignore:
Timestamp:
02/19/12 15:01:54 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Modified some checks to work with the Tupolev aircraft

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/checks.py

    r25 r26  
    476476    def isCondition(self, flight, aircraft, oldState, state):
    477477        """Check if the fault condition holds."""
     478        isTupolev = aircraft.type in [const.AIRCRAFT_T134,
     479                                      const.AIRCRAFT_T154]
    478480        return (flight.stage!=const.STAGE_PARKING or \
    479481                not flight.options.fs2Crew) and \
    480482                not state.antiCollisionLightsOn and \
    481                 max(state.n1)>5
     483                ((isTupolev and max(state.n1[1:])>5) or \
     484                 (not isTupolev and max(state.n1)>5))
    482485
    483486    def logFault(self, flight, aircraft, logger, oldState, state):
     
    835838    def isCondition(self, flight, aircraft, oldState, state):
    836839        """Check if the fault condition holds."""
    837         return (flight.stage==const.STAGE_BOARDING and \
    838                 state.strobeLightsOn and state.onTheGround) or \
    839                (flight.stage==const.STAGE_TAKEOFF and \
    840                 not state.strobeLightsOn and not state.gearsDown) or \
    841                (flight.stage in [const.STAGE_CLIMB, const.STAGE_CRUISE,
    842                                  const.STAGE_DESCENT] and \
    843                 not state.strobeLightsOn and not state.onTheGround) or \
    844                (flight.stage==const.STAGE_PARKING and \
    845                 state.strobeLightsOn and state.onTheGround)
     840        if aircraft.type in [const.AIRCRAFT_T134,
     841                             const.AIRCRAFT_T154,
     842                             const.AIRCRAFT_YK40]:
     843            return False
     844        else:
     845            return (flight.stage==const.STAGE_BOARDING and \
     846                    state.strobeLightsOn and state.onTheGround) or \
     847                   (flight.stage==const.STAGE_TAKEOFF and \
     848                    not state.strobeLightsOn and not state.gearsDown) or \
     849                   (flight.stage in [const.STAGE_CLIMB, const.STAGE_CRUISE,
     850                                     const.STAGE_DESCENT] and \
     851                   not state.strobeLightsOn and not state.onTheGround) or \
     852                   (flight.stage==const.STAGE_PARKING and \
     853                    state.strobeLightsOn and state.onTheGround)
    846854               
    847855    def logFault(self, flight, aircraft, logger, oldState, state):
Note: See TracChangeset for help on using the changeset viewer.