Changeset 439:21a64d42fa00


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

Implemented the code and PO file generator for the delay codes with a small number of delay codes (re #154)

Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • Makefile

    r276 r439  
    33all: $(foreach lang,$(LANGUAGES),locale/$(lang)/LC_MESSAGES/mlx.mo)
    44
    5 locale/%/LC_MESSAGES/mlx.mo: locale/%/mlx.po
     5locale/%/LC_MESSAGES/mlx.mo: locale/%/mlx.po locale/%/mlx_delay.po
    66        mkdir -p `dirname $@`
    7         msgfmt -o $@ $^
     7        msgcat $^ | msgfmt -o $@ -
     8
     9locale/hu/mlx_delay.po locale/en/mlx_delay.po: dcdatagen.py
     10        ./dcdatagen.py
  • src/mlx/gui/delaycodes.py

    r438 r439  
    22
    33#------------------------------------------------------------------------------
     4
     5from dcdata import CAPTION, DELAYCODE, getTable
    46
    57from mlx.gui.common import *
     
    195197#------------------------------------------------------------------------------
    196198
    197 CAPTION = 1
    198 
    199 DELAYCODE = 2
    200 
    201 _data1 = ( lambda row: row[0].strip(),
    202            ["Num", "Code", "Title", "Description"],
    203            [ (CAPTION, "Others"),
    204              (DELAYCODE, ("        6", "OA     ", "NO GATES/STAND AVAILABLE",
    205                           "Due to own airline activity")),
    206              (DELAYCODE, ("9", "SG", "SCHEDULED GROUND TIME",
    207                           "Planned turnaround time less than declared minimum")),
    208              (CAPTION, "Passenger and baggage"),
    209              (DELAYCODE, ("11", "PD", "LATE CHECK-IN",
    210                           "Check-in reopened for late passengers")),
    211              (DELAYCODE, ("12", "PL", "LATE CHECK-IN",
    212                           "Check-in not completed by flight closure time")),
    213              (DELAYCODE, ("13", "PE", "CHECK-IN ERROR",
    214                           "Error with passenger or baggage details")) ] )
    215 
    216 _data2 = ( lambda row: row[0].strip(),
    217            ["MA", "IATA", "Description"],
    218            [ (CAPTION, "Passenger and baggage"),
    219              (DELAYCODE, (" 012", "01   ",
    220                           "Late shipping of parts and/or materials")),
    221              (DELAYCODE, (" 111", "11",
    222                           "Check-in reopened for late passengers")),
    223              (DELAYCODE, (" 121", "12",
    224                           "Check-in not completed by flight closure time")),
    225              (DELAYCODE, (" 132", "13",
    226                           "Error with passenger or baggage details"))
    227             ])
     199# CAPTION = 1
     200
     201# DELAYCODE = 2
     202
     203# _data1 = ( lambda row: row[0].strip(),
     204#            ["Num", "Code", "Title", "Description"],
     205#            [ (CAPTION, "Others"),
     206#              (DELAYCODE, ("        6", "OA     ", "NO GATES/STAND AVAILABLE",
     207#                           "Due to own airline activity")),
     208#              (DELAYCODE, ("9", "SG", "SCHEDULED GROUND TIME",
     209#                           "Planned turnaround time less than declared minimum")),
     210#              (CAPTION, "Passenger and baggage"),
     211#              (DELAYCODE, ("11", "PD", "LATE CHECK-IN",
     212#                           "Check-in reopened for late passengers")),
     213#              (DELAYCODE, ("12", "PL", "LATE CHECK-IN",
     214#                           "Check-in not completed by flight closure time")),
     215#              (DELAYCODE, ("13", "PE", "CHECK-IN ERROR",
     216#                           "Error with passenger or baggage details")) ] )
     217
     218# _data2 = ( lambda row: row[0].strip(),
     219#            ["MA", "IATA", "Description"],
     220#            [ (CAPTION, "Passenger and baggage"),
     221#              (DELAYCODE, (" 012", "01   ",
     222#                           "Late shipping of parts and/or materials")),
     223#              (DELAYCODE, (" 111", "11",
     224#                           "Check-in reopened for late passengers")),
     225#              (DELAYCODE, (" 121", "12",
     226#                           "Check-in not completed by flight closure time")),
     227#              (DELAYCODE, (" 132", "13",
     228#                           "Error with passenger or baggage details"))
     229#             ])
    228230
    229231#------------------------------------------------------------------------------
     
    285287    def setType(self, aircraftType):
    286288        """Setup the delay code table according to the given aircraft type."""
    287         if aircraftType==const.AIRCRAFT_B736:
    288             data = _data1
    289         else:
    290             data = _data2
    291 
    292         self._delayCodeData = data
     289        self._delayCodeData = data = getTable(aircraftType)
     290        if data is None:
     291            return
    293292
    294293        columns = self._treeView.get_columns()
     
    343342                for j in range(0, numColumns-1):
    344343                    label = gtk.Label(elements[j])
    345                     label.set_alignment(1.0 if j==0 else 0.0, 0.5)
     344                    label.set_alignment(0.0, 0.5)
    346345                    alignment = Alignment(xalign = 0.5, yalign = 0.5,
    347346                                          xscale = 1.0)
Note: See TracChangeset for help on using the changeset viewer.