Changeset 521:9f6c08020c54 for src


Ignore:
Timestamp:
06/05/13 15:42:56 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
xplane
Parents:
516:71fe9bfad86e (diff), 520:6a09d031f8f0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merged changes from the default branch

Location:
src/mlx
Files:
4 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/checks.py

    r520 r521  
    964964        """Check if the fault condition holds."""
    965965        if flight.stage==const.STAGE_CRUISE:
    966             bankLimit = 30
     966            isDH8DXplane = flight.aircraftType==const.AIRCRAFT_DH8D and \
     967                           (flight.fsType==const.SIM_XPLANE10 or
     968                            flight.fsType==const.SIM_XPLANE9)
     969            bankLimit = 35 if isDH8DXplane else 30
    967970        elif flight.stage in [const.STAGE_TAKEOFF, const.STAGE_CLIMB,
    968971                              const.STAGE_DESCENT, const.STAGE_LANDING]:
     
    975978    def logFault(self, flight, aircraft, logger, oldState, state):
    976979        """Log the fault."""
     980        message = "Bank too steep (%.1f)" % (state.bank,)
    977981        flight.handleFault(BankChecker, state.timestamp,
    978                            FaultChecker._appendDuring(flight, "Bank too steep"),
     982                           FaultChecker._appendDuring(flight, message),
    979983                           2)
    980984
  • src/mlx/const.py

    r516 r521  
    1111
    1212## The version of the program
    13 VERSION="0.20xpl"
     13VERSION="0.21xpl"
    1414
    1515#-------------------------------------------------------------------------------
  • src/mlx/const.py

    r517 r521  
    1111
    1212## The version of the program
    13 VERSION="0.21"
     13VERSION="0.21xpl"
    1414
    1515#-------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.