update 日志模块初见

This commit is contained in:
FrankCV2048
2024-09-08 22:27:26 +08:00
parent ab2545895b
commit 55227fc898
6 changed files with 162 additions and 53 deletions

View File

@ -28,13 +28,15 @@ class TCPClient:
def run(self):
while True:
time.sleep(0.2)
self.connected = self.error_count > 0
self.connected = (self.error_count == 0)
try:
if (self.send_Status() and self.send_Command()):
self.error_count = 0
except Exception as e:
self.error_count += 1
if self.error_count> 5:
print("Error: TCPClient is not connected")
self.CreatConnect()
def send_Command(self):
return False