Example #1
0
    def __init__(self, args, kwargs):
        """ Initialize the socket connections """
        # Call the constructor of the parent class
        DatastreamManager.__init__(self, args, kwargs)

        self.time_sync = kwargs.get('time_sync', False)
        self.sync_port = kwargs.get('sync_port', -1)

        if self.time_sync:
            if self.sync_port == -1:
                logger.error(
                    "time_sync is required, but sync_port is not configured")
                raise MorseMiddlewareError("sync_port is not configured")
            else:
                self._init_trigger()

        # port -> MorseSocketServ
        self._server_dict = {}

        # component name (string)  -> Port (int)
        self._component_nameservice = {}

        # Base port
        self._base_port = 60000

        # Register two special services in the socket service manager:

        # TODO To use a new special component instead of 'simulation',
        # uncomment the line :-)
        # blenderapi.persistantstorage().morse_services.register_request_manager_mapping("streams", "SocketRequestManager")
        services.do_service_registration(self.list_streams, 'simulation')
        services.do_service_registration(self.get_stream_port, 'simulation')
        services.do_service_registration(self.get_all_stream_ports,
                                         'simulation')
Example #2
0
    def __init__(self, args, kwargs):
        """ Initialize the socket connections """
        # Call the constructor of the parent class
        DatastreamManager.__init__(self, args, kwargs)

        self.time_sync = kwargs.get('time_sync', False)
        self.sync_port = kwargs.get('sync_port', -1)

        if self.time_sync:
            if self.sync_port == -1:
                logger.error("time_sync is required, but sync_port is not configured")
                raise MorseMiddlewareError("sync_port is not configured")
            else:
                self._init_trigger()

        # port -> MorseSocketServ
        self._server_dict = {}

        # component name (string)  -> Port (int)
        self._component_nameservice = {}

        # Base port
        self._base_port = 60000

        # Register two special services in the socket service manager:

        # TODO To use a new special component instead of 'simulation',
        # uncomment the line :-)
        # blenderapi.persistantstorage().morse_services.register_request_manager_mapping("streams", "SocketRequestManager")
        services.do_service_registration(self.list_streams, 'simulation')
        services.do_service_registration(self.get_stream_port, 'simulation')
        services.do_service_registration(self.get_all_stream_ports, 'simulation')
Example #3
0
    def __init__(self, args, kwargs):
        """ Initialize the socket connections """
        # Call the constructor of the parent class
        DatastreamManager.__init__(self, args, kwargs)
        self._time_initialized = False

        try:
            fom = kwargs["fom"]
            node_name = kwargs["name"]
            federation = kwargs["federation"]
            sync_point = kwargs.get("sync_point", None)
            sync_register = kwargs.get("sync_register", False)
            self.time_sync = kwargs.get("time_sync", False)
            timestep = kwargs.get("timestep", 1.0 / blenderapi.getfrequency())
            lookahead = kwargs.get("lookahead", timestep)
            self.stop_time = kwargs.get("stop_time", float("inf"))

            self.node = HLABaseNode(
                MorseBaseAmbassador,
                fom,
                node_name,
                federation,
                sync_point,
                sync_register,
                self.time_sync,
                timestep,
                lookahead,
            )
        except KeyError as error:
            logger.error(
                "One of [fom, name, federation] attribute is not configured: " "Cannot create HLADatastreamManager"
            )
            raise
Example #4
0
    def __init__(self, args, kwargs):
        """ Initialize the socket connections """
        # Call the constructor of the parent class
        DatastreamManager.__init__(self, args, kwargs)
        self._time_initialized = False

        try:
            fom = kwargs["fom"]
            node_name = kwargs["name"]
            federation = kwargs["federation"]
            sync_point = kwargs.get("sync_point", None)
            sync_register = kwargs.get("sync_register", False)
            self.time_sync = kwargs.get("time_sync", False)
            timestep = kwargs.get("timestep", 1.0 / blenderapi.getfrequency())
            lookahead = kwargs.get("lookahead", timestep)
            self.stop_time = kwargs.get("stop_time", float("inf"))

            self.node = HLABaseNode(MorseBaseAmbassador, fom, node_name,
                                    federation, sync_point, sync_register,
                                    self.time_sync, timestep, lookahead)
        except KeyError as error:
            logger.error(
                "One of [fom, name, federation] attribute is not configured: "
                "Cannot create HLADatastreamManager")
            raise
Example #5
0
    def __init__(self, args, kwargs):
        """ Initialize the socket connections """
        # Call the constructor of the parent class
        DatastreamManager.__init__(self, args, kwargs)

        self._mav = mavlink.MAVLink(None)
        self._conn_manager = MavlinkConnManager(self._mav)
        self._boot_time = blenderapi.persistantstorage().time.time
Example #6
0
    def __init__(self, args, kwargs):
        """ Initialize the socket connections """
        # Call the constructor of the parent class
        DatastreamManager.__init__(self, args, kwargs)

        self._mav = mavlink.MAVLink(None)
        self._conn_manager = MavlinkConnManager(self._mav)
        self._boot_time = blenderapi.persistantstorage().time.time
    def __init__(self):
        """ Initialize the socket connections """
        # Call the constructor of the parent class
        DatastreamManager.__init__(self)

        # port -> MorseSocketServ
        self._server_dict = {}

        # component name (string)  -> Port (int)
        self._component_nameservice = {}

        # Register two special services in the socket service manager:

        # TODO To use a new special component instead of 'simulation',
        # uncomment the line :-)
        # blenderapi.persistantstorage().morse_services.register_request_manager_mapping("streams", "SocketRequestManager")
        services.do_service_registration(self.list_streams, 'simulation')
        services.do_service_registration(self.get_stream_port, 'simulation')
        services.do_service_registration(self.get_all_stream_ports, 'simulation')
Example #8
0
    def __init__(self, args, kwargs):
        """ Initialize the socket connections """
        # Call the constructor of the parent class
        DatastreamManager.__init__(self, args, kwargs)

        try:
            fom = kwargs["fom"]
            node_name = kwargs["name"]
            federation = kwargs["federation"]
            sync_point = kwargs.get("sync_point", None)
            sync_register = kwargs.get("sync_register", False)
            time_sync = kwargs.get("time_sync", False)

            self.node = HLABaseNode(MorseBaseAmbassador, fom, node_name,
                                    federation, sync_point, sync_register,
                                    time_sync)
        except KeyError as error:
            logger.error(
                "One of [fom, name, federation] attribute is not configured: "
                "Cannot create HLADatastreamManager")
            raise