更新控制

This commit is contained in:
FrankCV2048
2024-11-03 23:25:05 +08:00
parent e31f7632e8
commit 5df4e7cadb
11 changed files with 824 additions and 209 deletions

View File

@ -12,7 +12,7 @@ class TCPClient:
self.error_count=0
self.IPAddress = ip
self.port = port
self.thread_signal = True
self.connected = False
@ -31,8 +31,8 @@ class TCPClient:
def run(self):
while True:
time.sleep(0.2)
while self.thread_signal:
time.sleep(0.4)
self.connected = (self.error_count <= 3)
try:
if (self.send_Status() and self.send_Command()):
@ -53,7 +53,9 @@ class TCPClient:
except Exception as e2:
print(e2)
def close(self):
self.thread_signal = False
self.client_socket.close()
def send_Command(self):
return False