Testing OP25 Improvements
- New system of handling thread
This commit is contained in:
@@ -15,14 +15,37 @@ class OP25Handler(threading.Thread):
|
||||
|
||||
self.HTTP_ENABLED = False
|
||||
|
||||
#def start(self) -> None:
|
||||
self.Start_OP25 = False
|
||||
|
||||
self.Stop_OP25 = False
|
||||
|
||||
def run(self) -> None:
|
||||
self.open_op25()
|
||||
while True:
|
||||
if self.Start_OP25:
|
||||
self.open_op25()
|
||||
|
||||
def set_op25_parameters(self, _frequency, _http_enabled: bool = True):
|
||||
self.Frequency = _frequency
|
||||
self.Start_OP25 = False
|
||||
self.Stop_OP25 = False
|
||||
|
||||
self.HTTP_ENABLED = _http_enabled
|
||||
while not self.Stop_OP25:
|
||||
time.sleep(1)
|
||||
|
||||
self.close_op25()
|
||||
|
||||
time.sleep(.5)
|
||||
|
||||
def set_op25_parameters(self, _frequency: str = False, _http_enabled: bool = True, _start: bool = False, _stop: bool = False):
|
||||
if _frequency:
|
||||
self.Frequency = _frequency
|
||||
|
||||
if _start:
|
||||
self.Start_OP25 = _start
|
||||
|
||||
if _stop:
|
||||
self.Stop_OP25 = _stop
|
||||
|
||||
if _http_enabled:
|
||||
self.HTTP_ENABLED = _http_enabled
|
||||
|
||||
def open_op25(self):
|
||||
if self.OP25Proc is not None:
|
||||
|
||||
Reference in New Issue
Block a user