Example #1
0
 def onCameraImageReady(self, _id, captured_image):
     if self.readImageQR(captured_image.image()):
         self.closeCamera()
     else:
         QThread.sleep(1)
         self.camera.searchAndLock()
         self.img_capture.capture()
         self.camera.unlock()
Example #2
0
 def test(self, thread):
     print("pierwsze")
     print(self.listThread)
     thread.quit()
     thread.deleteLater()
     self.listThread.remove(thread)
     QThread.sleep(1)
     print("drugie")
     print(self.listThread)
     if not self.listThread:  # and (not self.listWorker):
         self.parent.set_text_remote_status(Language.Listening)
         print("zmieniam opis na ", Language.Listening)
Example #3
0
 def start(self):
     if not self.disco_process_started or not self._disco_process_is_alive(
     ):
         for proc in psutil.process_iter():
             # check whether the process name matches
             if 'discovery_driver.py' in proc.cmdline():
                 proc.kill()
         if os.path.exists('discovery_driver.py'):
             self.disco_process = subprocess.Popen(
                 ['python', 'discovery_driver.py'])
         else:
             self.disco_process = subprocess.Popen(
                 ['Juice_Discovery_Driver'])
         QThread.sleep(2.)
         self.disco_process_started = True
Example #4
0
 def run(self) -> None:
     while True:
         journal = parseLogs(logger=self.logger)
         stateList = showAllTrueStatus()
         guiFocus = getGuiFocus()
         data = IOMsg(journal, stateList, guiFocus)
         self._ioSignal.emit(data)
         isEmergency = 'UnderAttack' in journal.signs or 'Scanned' in journal.signs
         if isEmergency and self.usingWatchdog and isProcessExist(
                 globalProcessName):  # Force terminating...
             if self.logger is not None:
                 self.logger.critical("Watchdog: killing process")
             else:
                 print("Watchdog: killing process")
             killProcess(globalProcessName)
         QThread.sleep(IO_TIMEOUT)
Example #5
0
 def stop(self):
     if self.disco_process_started:
         self.disco_process_started = False
         self.disco_process.kill()
         QThread.sleep(1.)
Example #6
0
 def run(self):
     print("Separate thread running")
     QThread.sleep(1)