Ignore:
Timestamp:
04/07/12 09:39:40 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Implemented the payload setup page.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/checks.py

    r30 r60  
    697697
    698698class MZFWChecker(WeightChecker):
    699     """Checks if the MTOW is not exceeded on landing."""
     699    """Checks if the MZFW is not exceeded on landing."""
    700700    def __init__(self):
    701701        """Construct the checker."""
     
    750750    """Check if the payload matches the specification."""
    751751    TOLERANCE=550
     752
     753    @staticmethod
     754    def isZFWFaulty(aircraftZFW, flightZFW):
     755        """Check if the given aircraft's ZFW is outside of the limits."""
     756        return aircraftZFW < (flightZFW - PayloadChecker.TOLERANCE) or \
     757               aircraftZFW > (flightZFW + PayloadChecker.TOLERANCE)       
    752758   
    753759    def isCondition(self, flight, aircraft, oldState, state):
    754760        """Check if the fault condition holds."""
    755761        return flight.stage==const.STAGE_PUSHANDTAXI and \
    756                (state.zfw < (flight.zfw - PayloadChecker.TOLERANCE) or \
    757                 state.zfw > (flight.zfw + PayloadChecker.TOLERANCE))
     762               PayloadChecker.isZFWFaulty(state.zfw, flight.zfw)
    758763               
    759764    def logFault(self, flight, aircraft, logger, oldState, state):
Note: See TracChangeset for help on using the changeset viewer.