Commit 4acf6ceb authored by bliss administrator's avatar bliss administrator

Bug in case of other controller

parent bc52e39e
Pipeline #7149 failed with stages
......@@ -7,6 +7,7 @@ with open('config', 'r') as config_file:
headerNodes="# Device nodes"
nodes=list(filter(None,config.split(headerNodes)[1].split("# ")[0].split("\n")))
# Motor cntrl steps sign slew base backl accel nada flags mne name
headerMotors="# Motor cntrl steps sign slew base backl accel nada flags mne name"
motors=list(filter(None,config.split(headerMotors)[1].split("# ")[0].split("\n")))
......@@ -15,11 +16,14 @@ with open('config', 'r') as config_file:
#extract icepap from nodes
icepapIP=[]
icepapID=[]
ID=-1
for idx,node in enumerate(nodes):
infoNode=node.split()
if(infoNode[2]=="icepap"):
if (infoNode[0]=="PSE_MAC_MOT"):
ID+=1
if (infoNode[2]=="icepap"):
icepapIP.append(infoNode[4])
icepapID.append(idx)
icepapID.append(ID)
#extract motors with corresponding to icepap
......@@ -49,7 +53,7 @@ for idx,ip in enumerate(icepapIP):
motorNodeInfo = motorInfo[2].split(":")[1].split("/")
icepapCrate = int(motorNodeInfo[1])
icepapCard = int(motorNodeInfo[2])
steps_per_unit = int(motorInfo[3])
steps_per_unit = float(motorInfo[3])
sign = int(motorInfo[4])
accelTime = int(motorInfo[8])
speed = int(motorInfo[6])
......@@ -59,7 +63,7 @@ for idx,ip in enumerate(icepapIP):
print(" name: %s"%mne)
print(" address: %d"%(icepapCrate*10+icepapCard))
print(" sign: %d"%(sign))
print(" steps_per_unit: %d"%steps_per_unit)
print(" steps_per_unit: %f"%steps_per_unit)
print(" velocity: %f"%(speed/(float(steps_per_unit))))
print(" acceleration: %f"%((speed/(float(steps_per_unit))/(float(accelTime)/1000.))))
print(" backlash: %f"%(backlash/(float(steps_per_unit))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment