Changeset 409:c580507072c1 for src/mlx


Ignore:
Timestamp:
12/28/12 12:23:53 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Implemented the logging of the value of QNH along with the altimeter setting (re #175)

Location:
src/mlx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/acft.py

    r407 r409  
    289289                                    "Takeoff weight: %.0f kg, MTOW: %.0f kg" % \
    290290                                    (aircraftState.grossWeight, self.mtow))
     291                self._logQNH(aircraftState)
    291292                self.logger.message(aircraftState.timestamp,
    292293                                    "Wind %03.0f/%.0f" % \
     
    299300            elif newStage==const.STAGE_DESCENT or newStage==const.STAGE_LANDING:
    300301                self._logRadios(aircraftState)
     302                if newStage==const.STAGE_LANDING:
     303                    self._logQNH(aircraftState)
    301304            elif newStage==const.STAGE_TAXIAFTERLAND:
    302305                flight = self._flight
     
    350353        self.logger.message(self._aircraftState.timestamp,
    351354                            "Visibility: %.0f metres" % (visibility,))
    352         self.logger.message(self._aircraftState.timestamp,
    353                             "Altimeter setting: %.0f hPa" % \
    354                             (self._aircraftState.altimeter,))
     355        self._logQNH(self._aircraftState)
    355356        self._logVRef()
    356357        self._logLandingAntiIce(self._aircraftState)
     
    569570        self._adf2Logger.forceLog(flight, logger, aircraftState)
    570571
     572    def _logQNH(self, aircraftState):
     573        """Log the current QNH along with the altimeter setting."""
     574        self.logger.message(aircraftState.timestamp,
     575                            "QNH: %.2f hPa, altimeter: %.2f hPa" % \
     576                            (aircraftState.qnh, aircraftState.altimeter))
     577
    571578    def _logNameAndModel(self, timestamp):
    572579        """Log the aircraft's name and model with taking the timestamp from the
  • src/mlx/checks.py

    r405 r409  
    465465        logState = self._lastChangeState if \
    466466                   self._lastChangeState is not None else state
    467         message = "Altimeter: %.0f hPa at %.0f feet" % \
     467        message = "Altimeter: %.2f hPa at %.0f feet" % \
    468468                  (logState.altimeter, logState.altitude)
    469469        if not logState.altimeterReliable:
Note: See TracChangeset for help on using the changeset viewer.