pcdshub / pcdsdevices

Collection of Ophyd device subclasses for IOCs unique to LCLS PCDS.
https://pcdshub.github.io/pcdsdevices/
Other
5 stars 58 forks source link

TprTrigger Class Not Connecting #1225

Closed slactjohnson closed 4 months ago

slactjohnson commented 4 months ago

Current Behavior

The TprTrigger class appears to not be connecting to all signals. Instantiating the class and checking the connected attr gives false.

This appears to be related to the delay_setpoint signal (see screenshot). When inspecting the PV, the FormattedComponent PV string does not appear to be getting completed, with self.sys not substituted. This appears to be defined almost identically to the label component, which does work.

image

Expected Behavior

All signals work.

Context / environment

I am trying to use the ophyd.device.configure method, but it seems to fail because of this device disconnection.

image

tangkong commented 4 months ago

This is actually a bit more tricky than it appears. The standalone TprTrigger.delay_setpoint is fine, it's the ns_delay_scan component (which itself has a setpoint FCpt) that does not get formatted correctly. That component tries to pass self.sys into the constructor of TprMotor, which isn't immediately allowed.
https://github.com/pcdshub/pcdsdevices/blob/7e70f4f89991687e75bbe19a4f6c7810fa1808ae/pcdsdevices/tpr.py#L84

https://github.com/pcdshub/pcdsdevices/blob/7e70f4f89991687e75bbe19a4f6c7810fa1808ae/pcdsdevices/tpr.py#L44

tangkong commented 4 months ago

Luckily we've walked this path before. We can tell ophyd to fill fields other than the suffix with the add_prefix argument.