Ignore:
Timestamp:
05/10/15 06:57:21 (9 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The AGL altitude values are logged with aircraft type-specific units (re #264)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/flight.py

    r609 r635  
    321321        knots."""
    322322        return self.aircraft.speedInKnots if self.aircraft is not None \
     323               else True
     324
     325    @property
     326    def aglInFeet(self):
     327        """Determine if the AGL altutides for the flight are to be expressed in
     328        feet."""
     329        return self.aircraft.aglInFeet if self.aircraft is not None \
    323330               else True
    324331
     
    506513        return knots if self.speedInKnots else knots * const.KNOTSTOKMPH
    507514
     515    def aglFromFeet(self, feet):
     516        """Convert the given AGL altitude value expressed in feet into the
     517        flight's AGL altitude unit."""
     518        return feet if self.aglInFeet else feet * const.FEETTOMETRES
     519
    508520    def speedToKnots(self, speed):
    509521        """Convert the given speed expressed in the flight's speed unit into
     
    514526        """Get the English name of the speed unit used by the flight."""
    515527        return "knots" if self.speedInKnots else "km/h"
     528
     529    def getEnglishAGLUnit(self):
     530        """Get the English name of the AGL unit used by the flight."""
     531        return "ft" if self.aglInFeet else "m"
    516532
    517533    def getI18NSpeedUnit(self):
Note: See TracChangeset for help on using the changeset viewer.