Ignore:
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/checks.py

    r496 r521  
    641641#---------------------------------------------------------------------------------------
    642642
    643 class FlapsLogger(StateChangeLogger, SingleValueMixin, SimpleChangeMixin):
     643class FlapsLogger(StateChangeLogger, SingleValueMixin, DelayedChangeMixin):
    644644    """Logger for the flaps setting."""
    645645    def __init__(self):
     
    652652                                    const.STAGE_TAKEOFF])
    653653        SingleValueMixin.__init__(self, "flapsSet")
     654        DelayedChangeMixin.__init__(self)
     655        self._getLogTimestamp = \
     656            lambda state, forced: \
     657            DelayedChangeMixin._getLogTimestamp(self, state, forced)
    654658
    655659    def _getMessage(self, flight, state, forced):
    656660        """Get the message to log on a change."""
    657         speed = state.groundSpeed if state.groundSpeed<80.0 else state.ias
     661        logState = self._lastChangeState if \
     662                   self._lastChangeState is not None else state
     663        speed = logState.groundSpeed if logState.groundSpeed<80.0 \
     664                else logState.ias
    658665        return "Flaps %.0f - %.0f %s" % \
    659                (state.flapsSet, flight.speedFromKnots(speed),
     666               (logState.flapsSet, flight.speedFromKnots(speed),
    660667                flight.getEnglishSpeedUnit())
    661668
     
    910917    def isCondition(self, flight, aircraft, oldState, state):
    911918        """Check if the fault condition holds."""
    912         return (flight.stage!=const.STAGE_PARKING or \
    913                 not flight.config.usingFS2Crew) and \
     919        return (not flight.config.usingFS2Crew or not state.parking or
     920                flight.stage!=const.STAGE_TAXIAFTERLAND) and \
    914921                not state.antiCollisionLightsOn and \
    915922                self.isEngineCondition(state)
     
    11261133                  [const.STAGE_CRUISE, const.STAGE_DESCENT,
    11271134                   const.STAGE_GOAROUND] or \
    1128                   (flight.stage==const.STAGE_LANDING  and
     1135                  (flight.stage==const.STAGE_LANDING and
    11291136                   state.groundSpeed>50.0) or \
    11301137                  ((not state.autoXPDR or \
    11311138                    (self._liftOffTime is not None and
    11321139                     state.timestamp > (self._liftOffTime+8))) and \
    1133                    flight.stage in
    1134                    [const.STAGE_TAKEOFF, const.STAGE_RTO, const.STAGE_CLIMB])
     1140                   ((flight.stage==const.STAGE_TAKEOFF and
     1141                     not state.onTheGround) or flight.stage==const.STAGE_CLIMB))
    11351142                  )
    11361143                 )
  • src/mlx/const.py

    r516 r521  
    1111
    1212## The version of the program
    13 VERSION="0.20xpl"
     13VERSION="0.21xpl"
    1414
    1515#-------------------------------------------------------------------------------
  • test/test1.txt

    r415 r519  
    1414set adf1=382
    1515set parking=yes
     16
    1617set parking=no
    1718set lights=3
     
    2728set xpdrC=0
    2829set altimeter=1004
     30
    2931set lights=23
    3032set gs=60 ias=60
     
    3537set n1_1=90
    3638set n1_2=90
     39
    3740set gs=100 ias=100
    3841set gs=120 ias=120
    3942set onTheGround=no
    4043set altitude=600
     44
    4145set noseGear=0
    4246set altitude=2000
    4347set nav1=111.5
    4448set flapsControl=0
     49
    4550set altimeter=1013.25
    4651set altitude=10000
     
    4853set ias=400
    4954set altitude=22001
     55
    5056set vs=-200
    5157set altitude=15000
     
    5864set flapsControl=87.5
    5965set ias=130 gs=130
     66
    6067set altitude=3500
    6168set ias=125 gs=125
     
    6976set latitude=47.49 longitude=21.62
    7077set lights=23
     78
    7179set onTheGround=yes
    7280set n1_1=-10
    7381set n1_2=-10
    74 set n1_1=0
    75 set n1_2=0
     82set lights=19
     83set n1_1=20
     84set n1_2=20
    7685set ias=45 gs=45
    77 set lights=19
    7886set ias=35 gs=35
    7987set ias=20 gs=20
    8088set xpdrC=1
     89
     90set parking=yes
     91set n1_1=0
     92set n1_2=0
     93set lights=17
    8194set ias=0 gs=0
    82 set parking=yes
     95set lights=1
Note: See TracChangeset for help on using the changeset viewer.