Changeset 591:347c98077c1f for src


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

Added a check for the amount of landing fuel being not less than the minimum (re #236)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/acft.py

    r539 r591  
    9191        return _classes[flight.aircraftType](flight)
    9292
    93     def __init__(self, flight):
     93    def __init__(self, flight, minLandingFuel = None):
    9494        """Construct the aircraft for the given type."""
    9595        self._flight = flight
     96        self._minLandingFuel = minLandingFuel
    9697
    9798        self._name = None
     
    359360                self.logger.message(aircraftState.timestamp, "Flight time end")
    360361                self._flight.logFuel(aircraftState)
     362                if self._minLandingFuel is not None and \
     363                   aircraftState.totalFuel<self._minLandingFuel:
     364                    self._flight.handleNoGo(self.__class__,
     365                                            aircraftState.timestamp,
     366                                            "The amount of the landing fuel is less than the minimum for this type: %ukgs" %
     367                                            (self._minLandingFuel,),
     368                                            "LANDING FUEL NO GO")
    361369                self.logger.message(aircraftState.timestamp,
    362370                                    "Landing weight: %.0f kg, MLW: %.0f" % \
     
    631639    - n1: left, right
    632640    - reverser: left, right"""
    633     def __init__(self, flight):
    634         super(Boeing737, self).__init__(flight)
     641    def __init__(self, flight, minLandingFuel = 2500):
     642        super(Boeing737, self).__init__(flight, minLandingFuel = minLandingFuel)
    635643
    636644        self.gearSpeedLimit = 270
     
    692700#---------------------------------------------------------------------------------------
    693701
    694 class B733(Boeing737):
     702class Boeing737CL(Boeing737):
     703    """Base class for the various aircraft in the Boeing 737 Classic family."""
     704    def __init__(self, flight):
     705        super(Boeing737CL, self).__init__(flight, minLandingFuel = 3500)
     706
     707#---------------------------------------------------------------------------------------
     708
     709class B733(Boeing737CL):
    695710    """Boeing 737-300 aircraft."""
    696711    def __init__(self, flight):
     
    703718#---------------------------------------------------------------------------------------
    704719
    705 class B734(Boeing737):
     720class B734(Boeing737CL):
    706721    """Boeing 737-400 aircraft."""
    707722    def __init__(self, flight):
     
    714729#---------------------------------------------------------------------------------------
    715730
    716 class B735(Boeing737):
     731class B735(Boeing737CL):
    717732    """Boeing 737-500 aircraft."""
    718733    def __init__(self, flight):
     
    735750
    736751    def __init__(self, flight):
    737         super(DH8D, self).__init__(flight)
     752        super(DH8D, self).__init__(flight, minLandingFuel = 2000)
    738753        self.dow = 17185
    739754        self.mtow = 29257
     
    757772    - reverser: left, right"""
    758773
    759     def __init__(self, flight):
    760         super(Boeing767, self).__init__(flight)
     774    def __init__(self, flight, minLandingFuel = 9000):
     775        super(Boeing767, self).__init__(flight, minLandingFuel = minLandingFuel)
    761776        self.gearSpeedLimit = 270
    762777        self.flapSpeedLimits = { 1 : 255,
     
    805820    - reverser: left, right."""
    806821    def __init__(self, flight):
    807         super(CRJ2, self).__init__(flight)
     822        super(CRJ2, self).__init__(flight, minLandingFuel = 1000)
    808823        self.dow = 14549
    809824        self.mtow = 22995
     
    827842    - reverser: left, right."""
    828843    def __init__(self, flight):
    829         super(F70, self).__init__(flight)
     844        super(F70, self).__init__(flight, minLandingFuel = 1900)
    830845        self.dow = 24283
    831846        self.mtow = 38100 # FIXME: differentiate by registration number,
     
    886901    - reverser: left, right."""
    887902    def __init__(self, flight):
    888         super(T134, self).__init__(flight)
     903        super(T134, self).__init__(flight, minLandingFuel = 3000)
    889904        self.dow = 29500
    890905        self.mtow = 49000
     
    932947    - reverser: left, right"""
    933948    def __init__(self, flight):
    934         super(T154, self).__init__(flight)
     949        super(T154, self).__init__(flight, minLandingFuel = 5000)
    935950        self.dow = 53259
    936951        self.mtow = 98000
Note: See TracChangeset for help on using the changeset viewer.