Closed mrakitin closed 5 years ago
The idea was to paramterize this by sub-classing the it as
class SMITwoButtonShutter(TwoButtonShutter):
open_val = 'Inserted'
close_val = 'Retracted'
As this is a property of the server so it should be a class level attribute (at least that was the thinking).
Thanks @tacaswell! That seems to be a good solution. Just one question - should it be open_val
/close_val
, or open_str
/close_str
?
Check the code, but iirc *_val
is the enum string we are watching to make sure it did the thing we told it to and *_str
is the input that we accept through set
.
Yes, that's exactly what's implemented in the code. SMI's case uses different inputs for set
:
# user facing commands
open_str = 'Insert'
close_str = 'Retract'
The rest seems identical. I'll update it at SMI next week.
This will also be resolved with the new version, called EPS_Two_State_device
in nslsii. the PR is here. In addition a temporary workaround is implemented as described above.
Currently, the
TwoButtonShutter
class has hard-coded string values for opening/closing the shutter (open_str = 'Open'
andclose_str = 'Close'
): https://github.com/NSLS-II/nslsii/blob/575b21c1d16dc4af4317c35c284e41e8cd9a35fb/nslsii/devices.py#L9-L25SMI needs
Insert
/Retract
combinations.Some other beamlines may have the same. Maybe SMI can use the same approach as PDF and standardize
Open
/Close
user-facing commands.