19 lines
546 B
Python
19 lines
546 B
Python
from threading import Thread
|
|
from core.Monitor import Monitor
|
|
|
|
class MainAgent:
|
|
def __init__(self) -> None:
|
|
self.monitor = Monitor()
|
|
self.screenThread = None
|
|
|
|
def startScreenCaptureThread(self):
|
|
self.screenThread = Thread(target=self.monitor.updateScreen, args=(self,), name="Update screen thread", daemon=True)
|
|
self.screenThread.start()
|
|
print("Main Agent: Thread started")
|
|
|
|
def stopScreenCaptureThread(self):
|
|
if (self.screenThread):
|
|
self.screenThread.terminate()
|
|
print("Main Agent: Thread terminated")
|
|
|