Ejemplo n.º 1
0
    def connect(self):
        try:
            a = open_driver()
            open_deviceusb()
            c = establishinglink()
            if a is True and c is True:
                self.console.raise_text("Open Device = {}".format(a), 2)
                time.sleep(1)
                # self.console.save_log("Open Device = {}".format(a))
                self.console.raise_text("Established Link = {}".format(c), 2)
                time.sleep(1)
                # self.console.save_log("Established Link = {}".format(c))
                self.console.raise_text("Successfully connected!", 2)
                time.sleep(1)
                # self.console.save_log("Successfully connected!")
                self.set_firmware_and_model_values()
                self.is_connected = True
                '''
                Fan Field sera atualizado automaticamente
                atualizado pela thread de refresh temp.
                '''
                # self.fan.refresh_fan_status()
                return True
            else:
                self.is_connected = False
                self.console.raise_text("Connection error", 3)

        except Exception as e:
            self.is_connected = False
            self.console.raise_text(
                'Failed to connect the camera!\n{}'.format(e), 3)

        return False
Ejemplo n.º 2
0
 def camera_connect(self):
     try:
         self.lock.set_acquire()
         a = open_driver()
         open_deviceusb()
         c = establishinglink()
         if a is True and c is True:
             self.text = "Successfully connected! {} {}".format(a, c)
         else:
             self.text = "Error in connection"
     except Exception as e:
         self.text = 'Failed to connect to camera!\n{}'.format(e)
     finally:
         self.lock.set_release()
Ejemplo n.º 3
0
 def camera_connect(self):
     try:
         self.lock.set_acquire()
         a = open_driver()
         open_deviceusb()
         c = establishinglink()
         if a is True and c is True:
             self.text = "Successfully connected! {} {}".format(a, c)
         else:
             self.text = "Error in connection"
     except Exception as e:
         self.text = "Failed to connect to camera!\n{}".format(e)
     finally:
         self.lock.set_release()
Ejemplo n.º 4
0
    def connect(self):
        try:
            a = open_driver()
            open_deviceusb()
            c = establishinglink()
            if a is True and c is True:
                self.console.raise_text("Successfully connected! {} {}".format(a, c), 2)
                self.set_firmware_and_model_values()

                '''
                    Fan Field sera atualizado automaticamente
                    atualizado pela thread de refresh temp.
                '''
                # self.fan.refresh_fan_status()
                return True
            else:
                self.console.raise_text("Connection error", 3)

        except Exception as e:
            self.console.raise_text('Failed to connect the camera!\n{}'.format(e), 3)

        return False