Ignore:
Timestamp:
04/24/24 18:31:17 (7 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

Gate dimensions are retrieved from the server and are used to restrict the set of gates available for a plane (re #386).

File:
1 edited

Legend:

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

    r1152 r1154  
    15001500        self._listStore.clear()
    15011501        self._gateList.set_sensitive(True)
    1502         occupiedGateNumbers = self._wizard._fleet.getOccupiedGateNumbers()
    1503         for gate in lhbpGates.gates:
    1504             if gate.isAvailable(lhbpGates, occupiedGateNumbers):
    1505                 self._listStore.append([gate.number])
     1502        for gate in self._wizard.iterAvailableLHBPGates():
     1503            self._listStore.append([gate.number])
    15061504
    15071505    def finalize(self):
     
    60236021           self._wizard.bookedFlight.arrivalICAO=="LHBP" and \
    60246022           not self._wizard.entranceExam:
    6025             occupiedGateNumbers = self._wizard._fleet.getOccupiedGateNumbers()
    6026             for gate in lhbpGates.gates:
    6027                 if gate.isAvailable(lhbpGates, occupiedGateNumbers):
    6028                     self._gatesModel.append([gate.number])
     6023            for gate in self._wizard.iterAvailableLHBPGates():
     6024                self._gatesModel.append([gate.number])
    60296025            self._gateLabel.set_sensitive(True)
    60306026            self._gate.set_sensitive(True)
     
    68716867            if result.loggedIn:
    68726868                self._loginResult = result
     6869                self._mergeGates()
    68736870                self.gui.loginSuccessful()
    68746871            else:
     
    69606957        self._simBriefingPage.finalizeCEF()
    69616958
     6959    def iterAvailableLHBPGates(self):
     6960        """Iterate over the available gates at LHBP for the current flight's plane."""
     6961        for gate in self._fleet.iterAvailableLHBPGates(self._bookedFlight.tailNumber):
     6962            yield gate
     6963
    69626964    def _connectSimulator(self, simulatorType):
    69636965        """Connect to the simulator."""
     
    69866988        assert False
    69876989
     6990    def _mergeGates(self):
     6991        """Merge the gate information retrieved during login into the
     6992        existing gate information for LHBP."""
     6993        lhbpGates.merge(self._loginResult.gates)
     6994
    69886995#-----------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.