fixed a problem with the pvs that are broadcasted

This commit is contained in:
gac-bernina
2024-06-07 10:00:38 +02:00
parent 8f09490490
commit 5f5128145c
2 changed files with 26 additions and 2 deletions

View File

@@ -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")})

View File

@@ -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())