Changeset 361:297b84854dfc


Ignore:
Timestamp:
12/14/12 18:39:04 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

In case of the DA F70 the transponder is considered to be turned on automatically, so it is checked differently: it should be on not later than 10 seconds after liftoff (#144)

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/checks.py

    r360 r361  
    10701070class TransponderChecker(PatientFaultChecker):
    10711071    """Check if the transponder is used properly."""
    1072     def isCondition(self, flight, aircraft, oldState, state):
    1073         """Check if the fault condition holds."""
     1072    def __init__(self):
     1073        """Construct the transponder checker."""
     1074        super(TransponderChecker, self).__init__()
     1075        self._liftOffTime = None
     1076
     1077    def isCondition(self, flight, aircraft, oldState, state):
     1078        """Check if the fault condition holds."""
     1079        if state.onTheGround:
     1080            self._liftOffTime = None
     1081        elif self._liftOffTime is None:
     1082            self._liftOffTime = state.timestamp
     1083
    10741084        return state.xpdrC is not None and \
    10751085               ((state.xpdrC and flight.stage in
    10761086                 [const.STAGE_BOARDING, const.STAGE_PARKING]) or \
    1077                 (not state.xpdrC and flight.stage in
    1078                  [const.STAGE_TAKEOFF, const.STAGE_RTO, const.STAGE_CLIMB,
    1079                   const.STAGE_CRUISE, const.STAGE_DESCENT,
    1080                   const.STAGE_LANDING, const.STAGE_GOAROUND]))
     1087                (not state.xpdrC and
     1088                 (flight.stage in
     1089                  [const.STAGE_CRUISE, const.STAGE_DESCENT,
     1090                   const.STAGE_LANDING, const.STAGE_GOAROUND] or \
     1091                  ((not state.autoXPDR or \
     1092                    (self._liftOffTime is not None and
     1093                     state.timestamp > (self._liftOffTime+8))) and \
     1094                   flight.stage in
     1095                   [const.STAGE_TAKEOFF, const.STAGE_RTO, const.STAGE_CLIMB])
     1096                  )
     1097                 )
     1098                )
    10811099
    10821100    def logFault(self, flight, aircraft, logger, oldState, state):
  • src/mlx/fs.py

    r341 r361  
    250250    - xpdrC: a boolean indicating whether the transponder is in C mode, or
    251251      None, if the state cannot be read properly
     252    - autoXPDR: a boolean indicating whether the transponder is turned on
     253      automatically if the aircraft becomes airborne
    252254    - apMaster: a boolean indicating whether the autopilot is switched on, or
    253255      None, if the state cannot be read properly
  • src/mlx/fsuipc.py

    r341 r361  
    13941394
    13951395        state.xpdrC = data[self._monidx_xpdrC]==0
     1396        state.autoXPDR = False
    13961397
    13971398        state.apMaster = data[self._monidx_apMaster]!=0
     
    17921793        state.landingLightsOn = None
    17931794        state.nav2_manual = aircraft.flight.stage!=const.STAGE_CRUISE
     1795        self.autoXPDR = True
    17941796
    17951797        return state
  • test/test1.txt

    r360 r361  
    44set gs=0
    55set xpdrC=1
    6 set lights=0
     6set lights=1
    77set noseGear=100
    88set flapsControl=0
     
    1313set parking=yes
    1414set parking=no
    15 set gs=10 ias=10
     15set lights=3
    1616set n1_1=25
    1717set n1_2=25
     18set pitot=yes
     19set gs=10 ias=10
    1820set flapsControl=37.5
    1921set nav2=112.3
    2022set adf1=540
    2123set xpdrC=0
     24set lights=23
    2225set gs=60 ias=60
    23 set lights=21
    2426set gs=80 ias=80
    2527set n1_1=70
     
    4143set altitude=22001
    4244set vs=-200
     45set altitude=15000
    4346set nav1=116.3
     47set altitude=10000
    4448set adf2=540
     49set ias=160 gs=170
    4550set flapsControl=87.5
    4651set ias=130 gs=130
    47 set altitude=557
     52set altitude=3500
    4853set ias=125 gs=125
    4954set radioAltitude=3200
    5055set radioAltitude=1100
    5156set noseGear=100
     57set radioAltitude=50
    5258set radioAltitude=29
    5359set radioAltitude=9
Note: See TracChangeset for help on using the changeset viewer.