Skip to content
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

Added configurable rate for open_viewer #1309

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
1309 PCDSAreaDetectorTyphos_camviewer_rate
#################

API Breaks
----------
- N/A

Library Features
----------------
- N/A

Device Features
---------------
- Added rate signal to PCDSAreaDetectorTyphos
- Value is passed in open_viewer to open camViewer with the selected rate
- Default is five, but can be changed from gui with a TyphosSlider

New Devices
-----------
- N/A

Bugfixes
--------
- N/A

Maintenance
-----------
- N/A

Contributors
------------
- KaushikMalapati
9 changes: 7 additions & 2 deletions pcdsdevices/areadetector/detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from ophyd.areadetector.trigger_mixins import SingleTrigger
from ophyd.device import Component as Cpt
from ophyd.ophydobj import OphydObject
from ophyd.signal import AttributeSignal, EpicsSignal, EpicsSignalRO
from ophyd.signal import AttributeSignal, EpicsSignal, EpicsSignalRO, Signal
from pcdsutils.ext_scripts import get_hutch_name

from pcdsdevices.variety import set_metadata
Expand Down Expand Up @@ -399,7 +399,9 @@ def open_viewer(self):
'--instrument',
'{}.format(get_hutch_name())',
'--oneline',
'GE:16,{0}:IMAGE1;{0},,{0}'.format(self.prefix[0:-1])]
'GE:16,{0}:IMAGE1;{0},,{0}'.format(self.prefix[0:-1]),
'--rate',
str(self.viewer_rate.get()),]

self.log.info('Opening python viewer for camera...')
subprocess.run(arglist, stdout=subprocess.DEVNULL,
Expand All @@ -408,6 +410,9 @@ def open_viewer(self):
# Make viewer available in Typhos screen
cam_viewer = Cpt(AttributeSignal, attr='_open_screen', kind='normal')
set_metadata(cam_viewer, dict(variety='command-proc', value=1))
viewer_rate = Cpt(Signal, value=5, kind='normal', doc='Rate for camViewer')
set_metadata(viewer_rate, dict(variety='scalar-range',
range={'value': (0, 100), 'source': 'value'}))

@property
def _open_screen(self):
Expand Down