Ignore:
Timestamp:
04/21/12 15:08:59 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

The delay codes are handled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/pirep.py

    r97 r99  
    99class PIREP(object):
    1010    """A pilot's report of a flight."""
     11    _delayCodeNames = { const.DELAYCODE_LOADING : "Loading Problems",
     12                        const.DELAYCODE_NETWORK : "Net Problems",
     13                        const.DELAYCODE_SYSTEM : "System Crash/Freezing",
     14                        const.DELAYCODE_TRAFFIC : "Traffic Problems",
     15                        const.DELAYCODE_WEATHER : "Weather Problems",
     16                        const.DELAYCODE_VATSIM : "VATSIM Problem",
     17                        const.DELAYCODE_CONTROLLER : "Controller's Fault",
     18                        const.DELAYCODE_NAVIGATION : "Navigation Problem",
     19                        const.DELAYCODE_APRON : "Apron Navigation Problems",
     20                        const.DELAYCODE_PERSONAL : "Personal Reasons" }
     21
    1122    @staticmethod
    1223    def _formatLine(timeStr, line):
     
    4051        self.comments = gui.comments
    4152        self.flightDefects = gui.flightDefects
     53        self.delayCodes = gui.delayCodes
    4254       
    4355        flight = gui.flight
     
    8698
    8799        This is basically a collection of the delay codes, if any."""
    88         # FIXME: implement the proper delay codes
    89         return "UTC"
     100        if not self.delayCodes:
     101            return "UTC"
     102        else:
     103            s = ""
     104            for code in self.delayCodes:
     105                if s: s += ", "
     106                s += PIREP._delayCodeNames[code]
     107            return s
    90108
    91109    def getSTAR(self):
Note: See TracChangeset for help on using the changeset viewer.