Changeset 592:1d9795bde55c for src/mlx


Ignore:
Timestamp:
12/23/14 09:29:51 (10 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added help about the minimum and recommended (if known) amounts of landing fuel to the fuel page (re #236)

Location:
src/mlx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/acft.py

    r591 r592  
    9191        return _classes[flight.aircraftType](flight)
    9292
    93     def __init__(self, flight, minLandingFuel = None):
     93    def __init__(self, flight, minLandingFuel = None,
     94                 recommendedLandingFuel = None):
    9495        """Construct the aircraft for the given type."""
    9596        self._flight = flight
    9697        self._minLandingFuel = minLandingFuel
     98        self._recommendedLandingFuel = recommendedLandingFuel
    9799
    98100        self._name = None
     
    211213        """Get the flight the aircraft belongs to."""
    212214        return self._flight
     215
     216    @property
     217    def minLandingFuel(self):
     218        """Get the minimum acceptable amount of the landing fuel."""
     219        return self._minLandingFuel
     220
     221    @property
     222    def recommendedLandingFuel(self):
     223        """Get the recommended amount of the landing fuel."""
     224        return self._recommendedLandingFuel
    213225
    214226    @property
     
    639651    - n1: left, right
    640652    - reverser: left, right"""
    641     def __init__(self, flight, minLandingFuel = 2500):
    642         super(Boeing737, self).__init__(flight, minLandingFuel = minLandingFuel)
     653    def __init__(self, flight, minLandingFuel = 2500,
     654                 recommendedLandingFuel = 3500):
     655        super(Boeing737, self).__init__(flight,
     656                                        minLandingFuel = minLandingFuel,
     657                                        recommendedLandingFuel =
     658                                        recommendedLandingFuel)
    643659
    644660        self.gearSpeedLimit = 270
     
    703719    """Base class for the various aircraft in the Boeing 737 Classic family."""
    704720    def __init__(self, flight):
    705         super(Boeing737CL, self).__init__(flight, minLandingFuel = 3500)
     721        super(Boeing737CL, self).__init__(flight, minLandingFuel = 3500,
     722                                          recommendedLandingFuel = None)
    706723
    707724#---------------------------------------------------------------------------------------
  • src/mlx/gui/flight.py

    r590 r592  
    16031603        """Construct the page."""
    16041604        super(FuelPage, self).__init__(wizard, xstr("fuel_title"),
    1605                                        xstr("fuel_help"),
     1605                                       xstr("fuel_help_pre") +
     1606                                       xstr("fuel_help_post"),
    16061607                                       completedHelp = xstr("fuel_chelp"))
    16071608
     
    16251626        """Activate the page."""
    16261627        self._setupTanks(self._wizard._fuelData)
     1628
     1629        aircraft = self._wizard.gui.flight.aircraft
     1630        minLandingFuel = aircraft.minLandingFuel
     1631        recommendedLandingFuel = aircraft.recommendedLandingFuel
     1632
     1633        middleHelp = "" if minLandingFuel is None else \
     1634            (xstr("fuel_help_min") % (minLandingFuel,)) \
     1635            if recommendedLandingFuel is None else \
     1636            (xstr("fuel_help_min_rec") % (minLandingFuel,
     1637                                          recommendedLandingFuel))
     1638        self.setHelp(xstr("fuel_help_pre") + middleHelp + xstr("fuel_help_post"))
    16271639
    16281640    def finalize(self):
Note: See TracChangeset for help on using the changeset viewer.