Exemple #1
0
    def __init__(self, params: GridParams, stats):
        super().__init__(params, stats)
        self.params = params
        if params.multi_agent:
            self.num_agents = params.num_agents_range[0]
        else:
            self.num_agents = 1

        self.device_list = None
        self.device_manager = DeviceManager(self.params.device_manager)

        free_space = np.logical_not(
            np.logical_or(self.map_image.obstacles,
                          self.map_image.start_land_zone))
        free_idcs = np.where(free_space)
        self.device_positions = list(zip(free_idcs[1], free_idcs[0]))
Exemple #2
0
    def __init__(self, root):
        self.root = root
        self.root.protocol("WM_DELETE_WINDOW", self.exit)

        self.dev_views = dict()  # Кортеж видов для устройств

        self.log = LogGetter.get_logger()  # Создаем логер
        self.settings = None  # Создаем настройки
        self.dm = DeviceManager(self.log)  # Создаем менеджер устройств
        for dev_name in DEV_LIST:  # Добовляем устройства к менеджеру
            self.dm.add_device(dev_name)

        self.init_gui()  # Создаем форму

        self.task_ctrl.load_settings()
        for dev_view in self.dev_views.values():  # Обновляем список устройств
            dev_view.refresh_devices()  # для каждого вида
Exemple #3
0
def test_add_device():
    dm = DeviceManager(Fake_log())
    dm.add_device('123')
 def __init__(self):
     Cmd.__init__(self)
     self.DeviceManager = DeviceManager()
     self.intro = """
Exemple #5
0
def test_init():
    dm = DeviceManager(Fake_log())