update 增加停止,暂停,重连,报警消除等

This commit is contained in:
FrankCV2048
2024-09-11 23:41:56 +08:00
parent f46f71b176
commit d24a79c21c
7 changed files with 305 additions and 98 deletions

View File

@ -98,10 +98,17 @@ class DATAReply:
class CMDRequest:
def __init__(self):
self.dsID = 'www.hc-system.com.HCRemoteCommand'
self.dsID = 'www.hc-system.com.RemoteMonitor'
self.reqType = 'command'
self.cmdData = []
return
def toString(self):
model_str = '{'+f'"dsID":"{self.dsID}","reqType":"{self.reqType}","cmdData":'
if len(self.cmdData) != 0:
model_str = model_str+"["+','.join(f'"{item}"' for item in self.cmdData)+"]"+"}"
else:
model_str = model_str+"}"
return model_str
class CMDReply:
def __init__(self):
@ -110,6 +117,7 @@ class CMDReply:
self.cmdData = []
return
class Instruction:
def __init__(self):
self.oneshot = 1
@ -130,7 +138,7 @@ class Instruction:
model_str = f'"oneshot":"{self.oneshot}","action":"{self.action}","m0":"{self.m0}","m1":"{self.m1}","m2":"{self.m2}",' \
f'"m3":"{self.m3}","m4":"{self.m4}","m5":"{self.m5}","ckStatus":"{self.ckStatus}","speed":"{self.speed}",' \
f'"delay":"{self.delay}","smooth":"{self.smooth}","tool":"{self.tool}"'
print(model_str)
return model_str
@ -143,8 +151,12 @@ class CMDInstructRequest:
self.instructions = []
def toString(self):
model_str = '{'+f'"dsID":"{self.dsID}","reqType":"{self.reqType}","emptyList":"{self.emptyList}","instructions":'
model_str = model_str+"[{"+self.instructions[0].toString()+"}]"+"}"
model_str = '{'+f'"dsID":"{self.dsID}","reqType":"{self.reqType}","emptyList":"{self.emptyList}"'
if len(self.instructions) != 0:
model_str = model_str+',"instructions":'+"[{"+self.instructions[0].toString()+"}]"+"}"
else:
model_str = model_str+"}"
print(model_str)
return model_str
class CMDInstructReply: