Changeset 1184:c2100c410a84


Ignore:
Timestamp:
04/30/25 15:05:04 (37 hours ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

The "real" and "extended" ICAO codes of airplanes are distinguished.

Location:
src/mlx
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/config.py

    r1168 r1184  
    7777        """Create a checklist for the given aircraft type from the given
    7878        config."""
    79         baseName = "checklist." + const.icaoCodes[aircraftType] + "."
     79        baseName = "checklist." + const.extendedICAOCodes[aircraftType] + "."
    8080        fileList = []
    8181        while True:
     
    9898    def toConfig(self, config, aircraftType):
    9999        """Add this checklist to the given config."""
    100         baseName = "checklist." + const.icaoCodes[aircraftType] + "."
     100        baseName = "checklist." + const.extendedICAOCodes[aircraftType] + "."
    101101        for index in range(0, len(self._fileList)):
    102102            option = baseName + str(index)
     
    135135        """Create a checklist for the given aircraft type from the given
    136136        config."""
    137         baseName = "callouts." + const.icaoCodes[aircraftType] + "."
     137        baseName = "callouts." + const.extendedICAOCodes[aircraftType] + "."
    138138        mapping = {}
    139139        while True:
     
    161161    def toConfig(self, config, aircraftType):
    162162        """Add this checklist to the given config."""
    163         baseName = "callouts." + const.icaoCodes[aircraftType] + "."
     163        baseName = "callouts." + const.extendedICAOCodes[aircraftType] + "."
    164164        index = 0
    165165        for (altitude, path) in self._mapping.items():
     
    11471147        print("  checklists:")
    11481148        for (type, checklist) in self._checklists.items():
    1149             print("    %s:" % (const.icaoCodes[type],))
     1149            print("    %s:" % (const.extendedICAOCodes[type],))
    11501150            for path in checklist:
    11511151                print("      " + path)
     
    11531153        print("  approachCallouts:")
    11541154        for (type, approachCallouts) in self._approachCallouts.items():
    1155             print("    %s:" % (const.icaoCodes[type],))
     1155            print("    %s:" % (const.extendedICAOCodes[type],))
    11561156            for (altitude, path) in approachCallouts:
    11571157                print("      %d: %s" % (altitude, path))
  • src/mlx/const.py

    r1183 r1184  
    214214              AIRCRAFT_B737  : "B737",
    215215              AIRCRAFT_B738  : "B738",
    216               AIRCRAFT_B738C : "B738C",
     216              AIRCRAFT_B738C : "B738",
    217217              AIRCRAFT_B732  : "B732",
    218218              AIRCRAFT_B733  : "B733",
     
    230230              AIRCRAFT_B462  : "B462" }
    231231
     232## A mapping of aircraft types to their 'extended' ICAO codes, which
     233# are usually the same as the 'internal' ones above, but in certain
     234# cases 'sub-types' are distinguished
     235extendedICAOCodes = icaoCodes.copy()
     236extendedICAOCodes[AIRCRAFT_B738C] = "B738C"
     237
    232238#-------------------------------------------------------------------------------
    233239
  • src/mlx/gui/flightlist.py

    r1033 r1184  
    246246        type."""
    247247        return tailNumber + \
    248             " (" + const.icaoCodes[bookedFlight.aircraftType] + ")"
     248            " (" + const.extendedICAOCodes[bookedFlight.aircraftType] + ")"
    249249
    250250    def _getAcft(tailNumber, bookedFlight):
  • src/mlx/gui/pirep.py

    r1079 r1184  
    323323        self._callsign.set_text(bookedFlight.callsign)
    324324        self._tailNumber.set_text(bookedFlight.tailNumber)
    325         aircraftType = xstr("aircraft_" + icaoCodes[bookedFlight.aircraftType].lower())
     325        aircraftType = xstr("aircraft_" + extendedICAOCodes[bookedFlight.aircraftType].lower())
    326326        self._aircraftType.set_text(aircraftType)
    327327
     
    888888        self._callsign.set_text(bookedFlight.callsign)
    889889        self._tailNumber.set_text(bookedFlight.tailNumber)
    890         aircraftType = xstr("aircraft_" + icaoCodes[bookedFlight.aircraftType].lower())
     890        aircraftType = xstr("aircraft_" + extendedICAOCodes[bookedFlight.aircraftType].lower())
    891891        self._aircraftType.set_text(aircraftType)
    892892
Note: See TracChangeset for help on using the changeset viewer.