thread_qt.py
Go to the documentation of this file.
1 import sys
2 import time
3 from PyQt5.QtCore import QThread, pyqtSignal, pyqtSlot
4 import wifi
5 
6 
7 class WifiThread(QThread):
8  updated = pyqtSignal()
9 
10  def __init__(self):
11  QThread.__init__(self)
12  self.wifi_device_name = 'unknown'
13  self.wifi_status = 'unknown'
14  self.wifi_active = False
15  self.wifi_ssid = 'unknown'
16 
17  def __del__(self):
18  self.wait()
19 
20  def update(self):
23  self.wifi_active = True if self.wifi_status == 'active' else False
24  self.wifi_ssid = (wifi.get_ssid() if self.wifi_active else '-')
25  self.updated.emit()
26 
27  def run(self):
28  self.update()
29  while True:
30  wifi.wait()
31  self.update()
32  self.sleep(1)
def __del__(self)
Definition: thread_qt.py:17
def get_status(device_name=get_device_name())
Definition: wifi.py:26
def update(self)
Definition: thread_qt.py:20
def wait()
Definition: wifi.py:60
def __init__(self)
Definition: thread_qt.py:10
def get_device_name()
Definition: wifi.py:6
def get_ssid(device_name=get_device_name())
Definition: wifi.py:44


tello_driver
Author(s): Jordy van Appeven
autogenerated on Wed May 13 2020 03:34:54