Changeset 25:d3bf7580e98e for src


Ignore:
Timestamp:
02/16/12 18:41:00 (13 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Eliminated the detection of multiple flare-touchdown sequences when bouncing after landing and some other small fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/checks.py

    r22 r25  
    2222class StageChecker(StateChecker):
    2323    """Check the flight stage transitions."""
     24    def __init__(self):
     25        """Construct the stage checker."""
     26        self._flareStarted = False
     27
    2428    def check(self, flight, aircraft, logger, oldState, state):
    2529        """Check the stage of the aircraft."""
     
    6367            elif not state.gearsDown:
    6468                aircraft.setStage(state, const.STAGE_GOAROUND)
    65             elif state.radioAltitude>200:
     69            elif state.radioAltitude>200 and self._flareStarted:
    6670                aircraft.cancelFlare()
    67             elif state.radioAltitude<150 and not state.onTheGround:
     71                self._flareStarted = False
     72            elif state.radioAltitude<150 and not state.onTheGround and \
     73                 not self._flareStarted:
     74                self._flareStarted = True
    6875                aircraft.prepareFlare()
    6976        elif stage==const.STAGE_TAXIAFTERLAND:
     
    572579    def logFault(self, flight, aircraft, logger, oldState, state):
    573580        """Log the fault."""
    574         logger.fault(GearSpeedLinmitChecker, state.timestamp,
     581        logger.fault(GearSpeedLimitChecker, state.timestamp,
    575582                     FaultChecker._appendDuring(flight, "Gear speed limit fault"),
    576583                     5)
     
    780787        return flight.stage in [const.STAGE_DESCENT, const.STAGE_LANDING,
    781788                                const.STAGE_TAXIAFTERLAND] and \
    782             state.groundSpeed<80 and max(state.reverser)
     789            state.groundSpeed<60 and max(state.reverser)
    783790                           
    784791    def logFault(self, flight, aircraft, logger, oldState, state):
     
    858865        """Log the fault."""
    859866        print state.n1
    860         logger.fault(LandingLightsChecker, state.timestamp,
     867        logger.fault(ThrustChecker, state.timestamp,
    861868                     FaultChecker._appendDuring(flight, "Thrust setting was too high (>97%)"),
    862869                     FaultChecker._getLinearScore(97, 110, 0, 10, max(state.n1)))
Note: See TracChangeset for help on using the changeset viewer.