Exemplo n.º 1
0
 def __init__(self,
              controller=ControllerAbstract(),
              udp_sett_entity=SettingsEntity(""),
              **kwargs):
     BaseComponent.__init__(self)
     EventlessUDPReceiver.__init__(self, controller, udp_sett_entity,
                                   **kwargs)
     self.udp_conn = udp_sett_entity.get_settings()
     self.udp = UDPEntity(**self.udp_conn).register(self)
Exemplo n.º 2
0
	def __init__(self):
		BaseComponent.__init__(self)
		http = HTTP(channel=self.channel)
		self += http
		self += Logger(channel=self.channel)
		http += TCPServer(('localhost', 8090), channel=self.channel)
		self.domains = DomainRouter(channel=self.channel)
		self += self.domains

		self.localhost = Domain('localhost')
		self.domains += self.localhost
Exemplo n.º 3
0
    def setUp(self):
        self.propulsion_key = SettingsKeys.PROPULSION
        self.manipulator_key = SettingsKeys.MANIPULATOR
        self.udp_key = SettingsKeys.UDP

        # key, data
        self.propulsion_serial_port = (SettingsSerialEntity.PORT, "/dev/ttyUSB0")
        self.propulsion_serial_baudrate = (SettingsSerialEntity.BAUDRATE, 115200)
        self.propulsion_serial_channel = (SettingsSerialEntity.CHANNEL, "propulsion")

        self.manipulator_serial_port = (SettingsSerialEntity.PORT, "/dev/ttyACM0")
        self.manipulator_serial_baudrate = (SettingsSerialEntity.BAUDRATE, 115200)
        self.manipulator_serial_channel = (SettingsSerialEntity.CHANNEL, "manipulator")

        self.udp_server_ip = (SettingsUDPEntity.IP, "127.0.0.1")
        self.udp_server_port = (SettingsUDPEntity.PORT, 5000)
        self.udp_server_channel = (SettingsUDPEntity.CHANNEL, "UDPServer")

        # compare
        self.propulsion_dict = {}
        add_to_dict(self.propulsion_dict, *self.propulsion_serial_port)
        add_to_dict(self.propulsion_dict, *self.propulsion_serial_baudrate)
        add_to_dict(self.propulsion_dict, *self.propulsion_serial_channel)

        self.manipulator_dict = {}
        add_to_dict(self.manipulator_dict, *self.manipulator_serial_port)
        add_to_dict(self.manipulator_dict, *self.manipulator_serial_baudrate)
        add_to_dict(self.manipulator_dict, *self.manipulator_serial_channel)

        self.udp_dict = {}
        add_to_dict(self.udp_dict, *self.udp_server_ip)
        add_to_dict(self.udp_dict, *self.udp_server_port)
        add_to_dict(self.udp_dict, *self.udp_server_channel)

        self.base_component = BaseComponent()
 def setUp(self):
     self.eventless_mgr = EventlessContainersManager()
     self.null_mgr = NullContainersManager()
     self.sample_data = {"sample": "data"}
     self.data = CreateDeviceData()
     self.base_component = BaseComponent()
Exemplo n.º 5
0
 def __init__(self, serial_sett_entity=SettingsEntity("")):
     BaseComponent.__init__(self)
     NullDeviceManager.__init__(self, serial_sett_entity)
Exemplo n.º 6
0
 def __init__(self, serial_sett_entity=SettingsEntity("")):
     BaseComponent.__init__(self)
     EventlessDeviceManager.__init__(self, serial_sett_entity)
     self.device = SerialEntity(**self.device_conn).register(self)
Exemplo n.º 7
0
 def setUp(self):
     self.data = CreateDeviceData()
     self.propulsion_settings_entity = self.data.create_propulsion_settings_entity()
     self.manipulator_settings_entity = self.data.create_manipulator_settings_entity()
     self.containers_settings_entity = self.data.create_containers_settings_entity()
     self.base_component = BaseComponent()
Exemplo n.º 8
0
 def __init__(self, channel):
     BaseComponent.__init__(self, channel=channel)
     self.routes = set()
Exemplo n.º 9
0
 def resource(self, resource):
     self.__class__ = type('Method', (type(self), BaseComponent), {})
     BaseComponent.__init__(self, channel=resource.channel)
     self.register(resource)
Exemplo n.º 10
0
 def setUp(self):
     self.base_component = BaseComponent()
     self.data = CreateDeviceData()
Exemplo n.º 11
0
	def resource(self, resource):
		self.__class__ = type('Method', (type(self), BaseComponent), {})
		BaseComponent.__init__(self, channel=resource.channel)
		self.register(resource)