Changeset 99:b55ca557d5e9


Ignore:
Timestamp:
04/21/12 15:08:59 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The delay codes are handled

Location:
src/mlx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/gui.py

    r97 r99  
    243243        """Get the flight defects."""
    244244        return self._flightInfo.flightDefects
     245
     246    @property
     247    def delayCodes(self):
     248        """Get the delay codes."""
     249        return self._flightInfo.delayCodes
    245250
    246251    def run(self):
  • src/mlx/gui/info.py

    r98 r99  
    120120                                            buffer.get_end_iter(), True))
    121121
     122    @property
     123    def delayCodes(self):
     124        """Get the list of delay codes checked by the user."""
     125        codes =  []
     126        for index in range(0, len(FlightInfo._delayCodes)):
     127            if self._delayCodeWidgets[index].get_active():
     128                codes.append(FlightInfo._delayCodes[index][0])
     129        return codes
     130           
    122131    def enable(self):
    123132        """Enable the flight info tab."""
  • 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.