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

Bug in case of other controller

parent bc52e39e
Pipeline #7149 failed with stages
...@@ -2,24 +2,28 @@ ...@@ -2,24 +2,28 @@
with open('config', 'r') as config_file: with open('config', 'r') as config_file:
config = config_file.read() config = config_file.read()
#Get List Off Nodes #Get List Off Nodes
headerNodes="# Device nodes" headerNodes="# Device nodes"
nodes=list(filter(None,config.split(headerNodes)[1].split("# ")[0].split("\n"))) nodes=list(filter(None,config.split(headerNodes)[1].split("# ")[0].split("\n")))
# Motor cntrl steps sign slew base backl accel nada flags mne name
# 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" 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"))) motors=list(filter(None,config.split(headerMotors)[1].split("# ")[0].split("\n")))
#extract icepap from nodes #extract icepap from nodes
icepapIP=[] icepapIP=[]
icepapID=[] icepapID=[]
ID=-1
for idx,node in enumerate(nodes): for idx,node in enumerate(nodes):
infoNode=node.split() infoNode=node.split()
if(infoNode[2]=="icepap"): if (infoNode[0]=="PSE_MAC_MOT"):
ID+=1
if (infoNode[2]=="icepap"):
icepapIP.append(infoNode[4]) icepapIP.append(infoNode[4])
icepapID.append(idx) icepapID.append(ID)
#extract motors with corresponding to icepap #extract motors with corresponding to icepap
...@@ -36,7 +40,7 @@ for motor in motors: ...@@ -36,7 +40,7 @@ for motor in motors:
icepapMOTOR[idx].append(motor) icepapMOTOR[idx].append(motor)
except: except:
pass pass
#convert icepap motors to bliss motor #convert icepap motors to bliss motor
for idx,ip in enumerate(icepapIP): for idx,ip in enumerate(icepapIP):
print("-") print("-")
...@@ -49,7 +53,7 @@ for idx,ip in enumerate(icepapIP): ...@@ -49,7 +53,7 @@ for idx,ip in enumerate(icepapIP):
motorNodeInfo = motorInfo[2].split(":")[1].split("/") motorNodeInfo = motorInfo[2].split(":")[1].split("/")
icepapCrate = int(motorNodeInfo[1]) icepapCrate = int(motorNodeInfo[1])
icepapCard = int(motorNodeInfo[2]) icepapCard = int(motorNodeInfo[2])
steps_per_unit = int(motorInfo[3]) steps_per_unit = float(motorInfo[3])
sign = int(motorInfo[4]) sign = int(motorInfo[4])
accelTime = int(motorInfo[8]) accelTime = int(motorInfo[8])
speed = int(motorInfo[6]) speed = int(motorInfo[6])
...@@ -59,11 +63,11 @@ for idx,ip in enumerate(icepapIP): ...@@ -59,11 +63,11 @@ for idx,ip in enumerate(icepapIP):
print(" name: %s"%mne) print(" name: %s"%mne)
print(" address: %d"%(icepapCrate*10+icepapCard)) print(" address: %d"%(icepapCrate*10+icepapCard))
print(" sign: %d"%(sign)) 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(" velocity: %f"%(speed/(float(steps_per_unit))))
print(" acceleration: %f"%((speed/(float(steps_per_unit))/(float(accelTime)/1000.)))) print(" acceleration: %f"%((speed/(float(steps_per_unit))/(float(accelTime)/1000.))))
print(" backlash: %f"%(backlash/(float(steps_per_unit)))) print(" backlash: %f"%(backlash/(float(steps_per_unit))))
print(" low_limit: -inf") print(" low_limit: -inf")
print(" high_limit: inf") print(" high_limit: inf")
print(" offset: 0") print(" offset: 0")
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