Changeset 1105:2d0d642d122d


Ignore:
Timestamp:
09/19/23 11:04:18 (14 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

The gate information includes if it is taxi-through (re #371)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gates.py

    r619 r1105  
    1111    """Information about a gate."""
    1212    def __init__(self, number, terminal, type,
    13                  availableFn = None):
     13                 availableFn = None, taxiThrough = False):
    1414        """Construct the gate with the given information.
    1515
     
    2525        self._type = type
    2626        self._availableFn = availableFn
     27        self._taxiThrough = taxiThrough
    2728
    2829    @property
     
    3031        """Get the number of the gate."""
    3132        return self._number
     33
     34    @property
     35    def taxiThrough(self):
     36        """Get if the gate is a taxi through one."""
     37        return self._taxiThrough
    3238
    3339    def isAvailable(self, gates, occupiedGateNumbers):
     
    8995        self._displayInfos.append((Gates.DISPLAY_GATE, gate))
    9096        self._addRow()
     97
     98    def find(self, gateNumber):
     99        """Find a gate by its number."""
     100        for gate in self._gates:
     101            if gate.number == gateNumber:
     102                return gate
    91103
    92104    def addSpace(self):
     
    182194
    183195lhbpGates.add(Gate("R210", "2A", "S",
    184                    availableFn = getAvilableIf(othersAvailable = ["R212A"])))
     196                   availableFn = getAvilableIf(othersAvailable = ["R212A"]),
     197                   taxiThrough = True))
    185198lhbpGates.add(Gate("R211", "2A", "S",
    186                    availableFn = getAvilableIf(othersAvailable = ["R212A"])))
     199                   availableFn = getAvilableIf(othersAvailable = ["R212A"]),
     200                   taxiThrough = True))
    187201lhbpGates.add(Gate("R212", "2A", "S",
    188                    availableFn = getAvilableIf(othersAvailable = ["R212A"])))
     202                   availableFn = getAvilableIf(othersAvailable = ["R212A"]),
     203                   taxiThrough = True))
    189204lhbpGates.add(Gate("R212A", "2A", "S",
    190                    availableFn = getAvilableIf(othersAvailable = ["R210", "R211", "R212"])))
     205                   availableFn = getAvilableIf(othersAvailable = ["R210", "R211", "R212"]),
     206                   taxiThrough = True))
    191207lhbpGates.addSpace()
    192208
     
    211227lhbpGates.add(Gate("R277", "2A", "S"))
    212228lhbpGates.add(Gate("R278", "2A", "S",
    213                    availableFn = getAvilableIf(othersAvailable = ["R278A"])))
     229                   availableFn = getAvilableIf(othersAvailable = ["R278A"]),
     230                   taxiThrough = True))
    214231lhbpGates.add(Gate("R278A", "2A", "S",
    215                    availableFn = getAvilableIf(othersAvailable = ["R278", "R279"])))
     232                   availableFn = getAvilableIf(othersAvailable = ["R278", "R279"]),
     233                   taxiThrough = True))
    216234lhbpGates.add(Gate("R279", "2A", "S",
    217                    availableFn = getAvilableIf(othersAvailable = ["R278A"])))
     235                   availableFn = getAvilableIf(othersAvailable = ["R278A"]),
     236                   taxiThrough = True))
Note: See TracChangeset for help on using the changeset viewer.