Changeset 623:33edcb39a260 for src


Ignore:
Timestamp:
04/04/15 09:37:30 (10 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The strobeless speed checker is used for all aircraft to detect the takeoff stage (re #260)

Location:
src/mlx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/acft.py

    r622 r623  
    118118        self.reverseMinSpeed = 50
    119119
    120         self.needNoStrobeSpeedCheck = False
    121 
    122120        self.maxTakeOffPitch = 15.0
    123121        self.maxTouchDownPitch = 15.0
     
    189187        self._checkers.append(checks.PayloadChecker())
    190188
    191         self._checkers.append(checks.NoStrobeSpeedChecker())
    192189        self._checkers.append(checks.SpeedChecker())
    193190        self._checkers.append(checks.VSChecker())
     
    963960        self.reverseMinSpeed = 50
    964961
    965         self.needNoStrobeSpeedCheck = True
    966 
    967962        self.maxTakeOffPitch = 16.0
    968963        self.maxTouchDownPitch = 16.0
     
    10121007        self.reverseMinSpeed = 50
    10131008
    1014         self.needNoStrobeSpeedCheck = True
    1015 
    10161009        self.maxTakeOffPitch = 16.0
    10171010        self.maxTouchDownPitch = 16.0
     
    10581051        self.flapSpeedLimits = { 20 : 165,
    10591052                                 35 : 135 }
    1060 
    1061         self.needNoStrobeSpeedCheck = True
    10621053
    10631054    @property
  • src/mlx/checks.py

    r622 r623  
    5555               (not state.trickMode and state.groundSpeed>5.0):
    5656                aircraft.setStage(state, const.STAGE_PUSHANDTAXI)
    57         elif stage==const.STAGE_PUSHANDTAXI or stage==const.STAGE_RTO:
    58             if state.strobeLightsOn or \
    59               (state.strobeLightsOn is None and state.xpdrC):
    60                 aircraft.setStage(state, const.STAGE_TAKEOFF)
    6157        elif stage==const.STAGE_TAKEOFF:
    6258            if not state.gearsDown or \
     
    14751471#---------------------------------------------------------------------------------------
    14761472
    1477 class SpeedChecker(SimpleFaultChecker):
    1478     """Check if the speed is in the prescribed limits."""
    1479     @staticmethod
    1480     def needNoStrobe(aircraft, state):
    1481         """Determine if the given aircraft and state needs a strobeless speed
    1482         checking."""
    1483         return aircraft.needNoStrobeSpeedCheck or \
    1484                (state.strobeLightsOn is None and state.xpdrC is None)
    1485 
     1473class SpeedChecker(StateChecker):
     1474    """Checker for the ground speed of aircraft.
     1475
     1476    If, during the PUSHANDTAXI stage the speed exceeds 50 knots, the state is
     1477    saved as a provisional takeoff state. If the speed then decreases below 50
     1478    knots, or the plane remains on the ground for more than 40 seconds, a taxi
     1479    speed error is logged with the highest ground speed detected. This state is
     1480    also stored in the flight object as a possible
     1481
     1482    If the plane becomes airborne within 40 seconds, the stage becomes TAKEOFF,
     1483    and the previously saved takeoff state is logged.
     1484
     1485    During the TAXIAFTERLAND stage, if the speed goes above 50 knots, a fault
     1486    is logged based on the actual speed."""
    14861487    @staticmethod
    14871488    def logSpeedFault(flight, state, stage = None, updateID = None):
     
    14971498                                  updateID = updateID)
    14981499
    1499     def isCondition(self, flight, aircraft, oldState, state):
    1500         """Check if the fault condition holds."""
    1501         return not self.needNoStrobe(aircraft, state) and \
    1502             flight.stage in [const.STAGE_PUSHANDTAXI,
    1503                              const.STAGE_RTO,
    1504                              const.STAGE_TAXIAFTERLAND] and \
    1505             state.groundSpeed>50
    1506 
    1507     def logFault(self, flight, aircraft, logger, oldState, state):
    1508         """Log the fault."""
    1509         self.logSpeedFault(flight, state)
    1510 
    1511 #---------------------------------------------------------------------------------------
    1512 
    1513 class NoStrobeSpeedChecker(StateChecker):
    1514     """Checker for the ground speed of aircraft that have no strobe lights by
    1515     which to detect the takeoff stage.
    1516 
    1517     If, during the PUSHANDTAXI stage the speed exceeds 50 knots, the state as
    1518     saved as a provisional takeoff state. If the speed then decreases below 50
    1519     knots, or the plane remains on the ground for more than 40 seconds, a taxi
    1520     speed error is logged with the highest ground speed detected. This state is
    1521     also stored in the flight object as a possible
    1522 
    1523     If the plane becomes airborne within 40 seconds, the stage becomes TAKEOFF,
    1524     and the previously saved takeoff state is logged.
    1525 
    1526     During the TAXIAFTERLAND stage, speed is checked as in case of
    1527     SpeedChecker."""
    15281500    def __init__(self):
    15291501        """Initialize the speed checker."""
     
    15331505    def check(self, flight, aircraft, logger, oldState, state):
    15341506        """Check the state as described above."""
    1535         if SpeedChecker.needNoStrobe(aircraft, state):
    1536             if flight.stage==const.STAGE_PUSHANDTAXI or \
    1537                flight.stage==const.STAGE_RTO:
    1538                 self._checkPushAndTaxi(flight, aircraft, state)
    1539             elif flight.stage==const.STAGE_TAXIAFTERLAND:
    1540                 if state.groundSpeed>50:
    1541                     SpeedChecker.logSpeedFault(flight, state)
    1542             else:
    1543                 self._takeoffState = None
     1507        if flight.stage==const.STAGE_PUSHANDTAXI or \
     1508           flight.stage==const.STAGE_RTO:
     1509            self._checkPushAndTaxi(flight, aircraft, state)
     1510        elif flight.stage==const.STAGE_TAXIAFTERLAND:
     1511            if state.groundSpeed>50:
     1512                self.logSpeedFault(flight, state)
     1513        else:
     1514            self._takeoffState = None
    15441515
    15451516    def _checkPushAndTaxi(self, flight, aircraft, state):
Note: See TracChangeset for help on using the changeset viewer.