Skip to content
Draft
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions nslsii/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@

_time_fmtstr = '%Y-%m-%d %H:%M:%S'


class TwoButtonShutter(Device):
# TODO: this needs to be fixed in EPICS as these names make no sense
# the value coming out of the PV does not match what is shown in CSS
class TwoButtonActuator(Device):
RETRY_PERIOD = 0.5
MAX_ATTEMPTS = 10
open_cmd = Cpt(EpicsSignal, 'Cmd:Opn-Cmd', string=True)
Expand Down Expand Up @@ -128,3 +125,12 @@ def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._set_st = None
self.read_attrs = ['status']


class TwoButtonActuatorAutoClose(TwoButtonActuator):
def stop(self, *, success=False):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now does not close despite the name.

The default stop method is a no-op so we should move the stop from the other class to this one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if I just made it worse.

# overide the stop method to always close the shutter
...
Comment thread
tacaswell marked this conversation as resolved.
Outdated

class TwoButtonShutter(TwoButtonActuatorAutoClose):
pass