Changeset 409:c580507072c1


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)

Files:
3 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:
  • test/test1.txt

    r391 r409  
     1set qnh=1004
     2set altimeter=1013
    13set n1_1=0
    24set n1_2=0
     
    2426set adf1=540
    2527set xpdrC=0
     28set altimeter=1004
    2629set lights=23
    2730set gs=60 ias=60
     
    4043set nav1=111.5
    4144set flapsControl=0
     45set altimeter=1013.25
    4246set altitude=10000
    4347set lights=19
     
    4650set vs=-200
    4751set altitude=15000
     52set qnh=1007
    4853set nav1=116.3
    4954set altitude=10000
     55set altimeter=1007
    5056set adf2=540
    5157set ias=160 gs=170
Note: See TracChangeset for help on using the changeset viewer.