From 5f5128145ce47ae2c42999c3bb94f8d03ea0edb7 Mon Sep 17 00:00:00 2001 From: gac-bernina Date: Fri, 7 Jun 2024 10:00:38 +0200 Subject: [PATCH] fixed a problem with the pvs that are broadcasted --- script/devices/RobotBernina.py | 27 +++++++++++++++++++++++++-- script/devices/RobotTCP.py | 1 + 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/script/devices/RobotBernina.py b/script/devices/RobotBernina.py index c8665d9..b986529 100644 --- a/script/devices/RobotBernina.py +++ b/script/devices/RobotBernina.py @@ -590,9 +590,12 @@ class DummySTP(RegisterBase): class MotorConfigPV(ReadonlyRegisterBase): def __init__(self, Motor, fieldname): self.motor = Motor + self.fieldname = fieldname self.initialize() def doRead(self): - return self.motor.config.getFieldValue(fieldname) + return self.motor.config.getFieldValue(self.fieldname) + def getUnit(self): + return self.motor.getUnit() def make_archivable(Motor): base = PVBASE + Motor.name @@ -601,10 +604,14 @@ def make_archivable(Motor): ".VAL": [Motor, "double"], ".RBV": [Motor.readback, "double"], ".EGU": [MotorConfigPV(Motor, "unit"), "string"], - ".ADEL": [DummySTP(0.002), "double"], + ".ADEL": [DummySTP(-1), "double"], + #".ADEL": [DummySTP(0.002), "double"], + ".MDEL": [DummySTP(0), "double"], + ".RTYP": [DummySTP("motor"), "string"], ".SCAN": [DummySTP("passive"), "string"], ".PINI": [DummySTP("No"), "string"], ".PHAS": [DummySTP(0), "short"], + ".PREC": [DummySTP(3), "short"], ".EVNT": [DummySTP(""), "string"], ".PRIO": [DummySTP(0), "short"],#should be ENUM with 0,1,3 being LOW, MEDIUM, HIGH ".DISV": [DummySTP(1), "short"], @@ -614,6 +621,22 @@ def make_archivable(Motor): ".DISS": [DummySTP(0), "short"],#should be ENUM with 0,1,2,3 being NO?ALARM, MINOR, MAJOR, INVALID ".LCNT": [DummySTP(0), "short"],#should be uchar ".PACT": [DummySTP(0), "short"],#should be uchar + ".NAME": [DummySTP(base), "string"], + ".DESC": [DummySTP(base), "string"], + ".ASG": [DummySTP(""), "string"], + ".TSE": [DummySTP(0), "short"], + ".TSEL": [DummySTP(""), "string"], + ".DTYP": [DummySTP("asynMotor"), "string"], + ".DISP": [DummySTP(0), "double"], + ".PUTF": [DummySTP(0), "double"], + ".PPRO": [DummySTP(0), "double"], + ".TPRO": [DummySTP(0), "double"], + ".STAT": [DummySTP(0), "short"], + ".SEVR": [DummySTP(0), "short"], + ".NSTA": [DummySTP(0), "short"], + ".NSEV": [DummySTP(0), "short"], + ".ACKS": [DummySTP(2), "short"], + ".ACKT": [DummySTP(0), "short"], } epics_pvs = {base + field: CAS((base+field).upper(), device, dtype) for field, [device, dtype] in pv_def.items()} epics_pvs.update({base + ".FLNK": CAS((base+".FLNK").upper(), DummySTP((base+".RBV").upper()), "string")}) diff --git a/script/devices/RobotTCP.py b/script/devices/RobotTCP.py index 23dc198..87d1654 100644 --- a/script/devices/RobotTCP.py +++ b/script/devices/RobotTCP.py @@ -693,6 +693,7 @@ class RobotTCP(TcpDevice, Stoppable): #self.setState(State.Busy if self.status=="move" else State.Ready) if self.state==State.Offline: print "Communication resumed" + sleep(5) robot.set_default_desc(DESC_DEFAULT) robot.default_speed = DEFAULT_SPEED robot.set_frame(self.frame_persistent())