Changeset 601:16ff9fcc527c for src/mlx


Ignore:
Timestamp:
02/22/15 09:38:21 (10 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The initial climb speed is logged (re #246)

Location:
src/mlx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/acft.py

    r598 r601  
    148148
    149149        self._checkers.append(checks.GearsLogger())
     150        self._checkers.append(checks.InitialClimbSpeedLogger())
    150151        self._checkers.append(checks.CruiseSpeedLogger())
    151152        self._checkers.append(checks.SpoilerLogger())
  • src/mlx/checks.py

    r600 r601  
    169169#---------------------------------------------------------------------------------------
    170170
     171class InitialClimbSpeedLogger(StateChecker):
     172    """Logger for the initial climb speed."""
     173    def __init__(self):
     174        """Construct the logger."""
     175        self._logged = False
     176
     177    def check(self, flight, aircraft, logger, oldState, state):
     178        """Log the initial climb speed if the altitude is reached."""
     179        if not self._logged and \
     180           state.radioAltitude>=aircraft.initialClimbSpeedAltitude and \
     181           flight.stage in [const.STAGE_TAKEOFF, const.STAGE_CLIMB]:
     182            logger.message(state.timestamp,
     183                           "Initial climb speed: %.0f %s - %.0f ft AGL" % \
     184                           (flight.speedFromKnots(state.ias),
     185                            flight.getEnglishSpeedUnit(),
     186                            state.radioAltitude))
     187            self._logged = True
     188
     189#---------------------------------------------------------------------------------------
     190
    171191class CruiseSpeedLogger(StateChecker):
    172192    """Logger for the cruise speed."""
Note: See TracChangeset for help on using the changeset viewer.