- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/checks.py
r496 r521 641 641 #--------------------------------------------------------------------------------------- 642 642 643 class FlapsLogger(StateChangeLogger, SingleValueMixin, SimpleChangeMixin):643 class FlapsLogger(StateChangeLogger, SingleValueMixin, DelayedChangeMixin): 644 644 """Logger for the flaps setting.""" 645 645 def __init__(self): … … 652 652 const.STAGE_TAKEOFF]) 653 653 SingleValueMixin.__init__(self, "flapsSet") 654 DelayedChangeMixin.__init__(self) 655 self._getLogTimestamp = \ 656 lambda state, forced: \ 657 DelayedChangeMixin._getLogTimestamp(self, state, forced) 654 658 655 659 def _getMessage(self, flight, state, forced): 656 660 """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 658 665 return "Flaps %.0f - %.0f %s" % \ 659 ( state.flapsSet, flight.speedFromKnots(speed),666 (logState.flapsSet, flight.speedFromKnots(speed), 660 667 flight.getEnglishSpeedUnit()) 661 668 … … 910 917 def isCondition(self, flight, aircraft, oldState, state): 911 918 """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 \ 914 921 not state.antiCollisionLightsOn and \ 915 922 self.isEngineCondition(state) … … 1126 1133 [const.STAGE_CRUISE, const.STAGE_DESCENT, 1127 1134 const.STAGE_GOAROUND] or \ 1128 (flight.stage==const.STAGE_LANDING 1135 (flight.stage==const.STAGE_LANDING and 1129 1136 state.groundSpeed>50.0) or \ 1130 1137 ((not state.autoXPDR or \ 1131 1138 (self._liftOffTime is not None and 1132 1139 state.timestamp > (self._liftOffTime+8))) and \ 1133 flight.stage in1134 [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)) 1135 1142 ) 1136 1143 )
Note:
See TracChangeset
for help on using the changeset viewer.