-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make PSS Shutter devices more flexible for different beamlines #838
Comments
Also, there are no unit tests on the shutter classes. |
This code should become more flexible: apstools/apstools/devices/shutters.py Lines 406 to 407 in 199c178
|
@canismarko - Looking at the haven code, this looks like an unusual API signature. I'm expecting prefix to be the first argument, such as: apstools/apstools/devices/shutters.py Line 495 in 199c178
I plan to make the API here similar, allowing for |
As in: class ApsPssShutter(ShutterBase):
# ...
open_signal = FormattedComponent(EpicsSignal, "{self.open_pv}")
close_signal = FormattedComponent(EpicsSignal, "{self.close_pv}")
def __init__(self, prefix, *args, close_pv=None, open_pv=None, **kwargs):
self.open_pv = open_pv or f"{prefix}Open"
self.close_pv = close_pv or f"{prefix}Close"
# TODO" ?? what about prefix if open_pv and/or close_pv are not None ??
super().__init__(prefix, *args, **kwargs)
# ... The |
Shutter might be in /home/runner/work/apstools/apstools/apstools/devices/tests/test_shutters.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
shutter = EpicsMotorShutter(prefix='gp:m16', name='shutter', read_attrs=['busy', 'signal', 'signal.user_readback', 'signal.user_...signal', 'signal.user_offset', 'signal.user_offset_dir', 'signal.velocity', 'signal.acceleration', 'signal.motor_egu'])
def operate_shutter(shutter):
shutter.open()
timed_pause()
> assert shutter.state == "open"
E AssertionError: assert 'unknown' == 'open'
E - open
E + unknown |
The ApsPssShutter does not match our beamline configuration (25-ID).
The open signal is created as
{PREFIX}_Open
but should be{PREFIX}_OPEN_EPICS
to work on our hardware. The close signal is the same (but with "Close", etc.).Here is the subclass of ApsPssShutterWithStatus that matches our hardware: https://github.com/spc-group/haven/blob/main/haven/instrument/shutter.py
The text was updated successfully, but these errors were encountered: