예제 #1
0
 def back_to_factory_defaults(self):
     self._Procedures.reset_to_factory_defaults()
     for device in self._devices_pool:
         device.stop()
     self.clear_device_pool()
     devutils.save(self._devices_pool, self._pool_dump_path)
     return True
예제 #2
0
    def remove_device(self, short_id, long_id=0):
        short_id = int(short_id, 0)
        device = self._find_device(short_id, 0)
        if not device:
            log.write("Can't found such device")
            return False
        device.stop()
        result = self._Procedures.remove_device(short_id)
        self._devices_pool.remove(device)
        devutils.save(self._devices_pool, self._pool_dump_path)
        if not result:
            log.write("Can't delete device")
        return False

        #log.write("device_idx="  + str(device_idx))
        device.stop()
        #log.write("Device stoped, is alive = " + str(device._ka_thread.isAlive()))
        self._devices_pool.remove(device)
        del(device)
        devutils.save(self._devices_pool, self._pool_dump_path)
        return True
예제 #3
0
 def _add_device(self, Device):
     self._devices_pool.append(Device)
     devutils.save(self._devices_pool, self._pool_dump_path)
예제 #4
0
 def clear_device_pool(self):
     del self._devices_pool[:]
     devutils.save(self._devices_pool, self._pool_dump_path)
예제 #5
0
 def remove_all_devices(self):
     result = self._Procedures.remove_device(0xFF)
     for device in self._devices_pool:
         device.stop()
     self.clear_device_pool()
     devutils.save(self._devices_pool, self._pool_dump_path)