Ignore:
Timestamp:
04/24/24 18:31:17 (3 weeks ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, '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/rpccommon.py

    r919 r1154  
    44
    55from . import const
     6from .gates import lhbpGates
    67
    78#------------------------------------------------------------------------------
     
    5152        """Check if the gate of the given plane conflicts with another plane's
    5253        position."""
     54        gate = lhbpGates.find(plane.gateNumber)
    5355        for p in self._planes.values():
    5456            if p.tailNumber!=plane.tailNumber and \
    55                p.status==const.PLANE_HOME and \
    56                p.gateNumber==plane.gateNumber:
    57                 return True
     57               p.status==const.PLANE_HOME:
     58                if p.gateNumber==plane.gateNumber:
     59                    return True
     60                if gate is not None and not gate.isAvailable(plane,
     61                                                             lhbpGates,
     62                                                             [p.gateNumber]):
     63                    return True
    5864
    5965        return False
     
    6672                gateNumbers.add(p.gateNumber)
    6773        return gateNumbers
     74
     75    def iterAvailableLHBPGates(self, tailNumber):
     76        """Iterate over the available gates at LHBP."""
     77        occupiedGateNumbers = self.getOccupiedGateNumbers()
     78        plane = self.__getitem__(tailNumber)
     79        for gate in lhbpGates.gates:
     80            if gate.isAvailable(plane, lhbpGates, occupiedGateNumbers):
     81                yield gate
    6882
    6983    def updatePlane(self, tailNumber, status, gateNumber = None):
Note: See TracChangeset for help on using the changeset viewer.