增加速度调试和IO控制

This commit is contained in:
hjw
2024-10-26 14:32:51 +08:00
parent 60f145c608
commit 5abda1c6b0
5 changed files with 206 additions and 4 deletions

View File

@ -55,6 +55,8 @@ class DataAddress:
self.isMoving = False
self.M_n = ''
self.RemoteCmdLen = 0
self.toolCoord=''
#return
def setPosition(self,w0,w1,w2,w3,w4,w5,a0,a1,a2,a3,a4,a5):
self.world_0 = float(w0)
@ -81,7 +83,7 @@ class DataAddress:
def toString(self):
model_str = f'"curMode",' \
f'"world-0","world-1","world-2","world-3","world-4","world-5","axis-0","axis-1","axis-2","axis-3","axis-4","axis-5",' \
f'"curAlarm","isMoving","RemoteCmdLen"'
f'"curAlarm","isMoving","RemoteCmdLen","toolCoord","input-n","output-n","curSpeed-n"'
return model_str
@ -136,16 +138,26 @@ class Instruction:
self.delay = 1.0
self.smooth = 0
self.tool=2
self.IO = False
self.type = 0
self.io_status=1
self.point = 0
self.delay = 0
def toString(self):
model_str = f'"oneshot":"{self.oneshot}","action":"{self.action}","m0":"{self.m0}","m1":"{self.m1}","m2":"{self.m2}",' \
if not self.IO :
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}"'
else:
model_str = f'"oneshot":"{self.oneshot}","action":"{200}","type":"{self.type}","io_status":"{self.io_status}"' \
f',"point":"{self.point}","delay":"{self.delay}"'
return model_str
class CMDInstructRequest:
def __init__(self):
self.dsID = 'www.hc-system.com.HCRemoteCommand'