update 日志模块初见
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user