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/rpc.py

    r1153 r1154  
    11from . import const
    22from . import rpccommon
     3from . import gates
    34
    45from .common import MAVA_BASE_URL, fixUnpickled
     
    630631#---------------------------------------------------------------------------------------
    631632
     633class Gate(gates.Gate, RPCObject):
     634    """A gate."""
     635    _instructions = {
     636        "number": str,
     637        "terminal": str,
     638        "type": str,
     639        "maxSpan": float,
     640        "maxLength": float
     641    }
     642
     643    def __init__(self, value):
     644        """Construct the gate."""
     645        RPCObject.__init__(self, value, instructions = Gate._instructions)
     646
     647#---------------------------------------------------------------------------------------
     648
     649class Gates(gates.Gates):
     650    """The gates."""
     651    def __init__(self, value):
     652        """Construct the gates."""
     653        super(Gates, self).__init__()
     654        for gateValue in value:
     655            self.add(Gate(gateValue))
     656
     657#---------------------------------------------------------------------------------------
     658
    632659class Registration(object):
    633660    """Data for registration."""
     
    808835        return Fleet(value)
    809836
     837    def getGates(self):
     838        """Query and return the gate information."""
     839        value = self._performCall(lambda sessionID:
     840                                  self._server.getGates(sessionID))
     841
     842        return Gates(value)
     843
    810844    def updatePlane(self, tailNumber, status, gateNumber):
    811845        """Update the state and position of the plane with the given tail
Note: See TracChangeset for help on using the changeset viewer.