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

LasBasler User Presets #1328

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
31 changes: 31 additions & 0 deletions docs/source/upcoming_release_notes/1327-LasBasler_User_Presets.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
1327 LasBasler User Presets
#################

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

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

Device Features
---------------
- Adds long_names to signals in LasBasler detector class
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: these should be prefaced with the name of the device(s) that was modified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I did? LasBasler is the device class that is edited, the other BaslerNF and BaslerFF classes subclass it.

- Adds UserPresetSelector and UserPresetDefaultSe signals to the class

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

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

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

Contributors
------------
- aberges-SLAC
58 changes: 58 additions & 0 deletions pcdsdevices/areadetector/detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,64 @@ def _auto_configure(self):
def _auto_configure(self, value):
self.configure(self._conf_d)

# Handle UserPresets configuration
default_preset = Cpt(EpicsSignal, 'UserSetDefaultSe_RBV', write_pv='UserSetDefaultSe',
Copy link
Contributor

Choose a reason for hiding this comment

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

Did they really leave off the 't' in 'Set', or is this a typo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The property name is actually UserSetDefaultSelector but the common ioc truncates it 🤷

kind='config',
doc='Default Preset to use on startup. See UserSetSelector'
' for more options')
user_preset = Cpt(EpicsSignal, 'UserSetSelector_RBV', write_pv='UserSetSelector',
Copy link
Contributor

Choose a reason for hiding this comment

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

Dumb question: if these are called "User Sets", why are we calling them presets here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mainly because I hear folks call them "presets" vs. "user sets". I think the official vendor documentation calls them "User Sets".

I felt that something like camera.user_set would be an unclear signal name and imply being a setter and not an actual config option.

kind='config',
doc='Current User Preset to save/load')
save_preset = Cpt(EpicsSignal, 'UserSetSave.PROC', kind='config',
doc='Save current settings into selected user preset')
set_metadata(save_preset, dict(variety='command-proc', value=1))
load_preset = Cpt(EpicsSignal, 'UserSetLoad.PROC', kind='config',
doc='Load current settings into selected user preset')
set_metadata(load_preset, dict(variety='command-proc', value=1))

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Add some long_names
Copy link
Contributor

Choose a reason for hiding this comment

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

Are all of these long name updates just a ride-along update for readability, or are they related to the user set stuff somehow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both. Ride-along for better general readability and also for clarity on the newly added signals.

self.reset.long_name = 'Reset'
self.packet_size.long_name = 'Packet Size'
self.enet_bw.long_name = 'eNet Bandwidth'
self.manufacturer.long_name = 'Manufacturer'
self.camera_model.long_name = 'Camera Model'
self.sensor_size_x.long_name = 'Sensor Size (X)'
self.sensor_size_y.long_name = 'Sensor Size (Y)'
self.data_type.long_name = 'Data Type'
self.exposure.long_name = 'Exposure (s)'
self.gain.long_name = 'Gain'
self.num_images.long_name = 'Number of Images'
self.image_mode.long_name = 'Image Mode'
self.trigger_mode.long_name = 'Trigger Mode'
self.acquisition_period.long_name = 'Acquisition Period'
self.bin_x.long_name = 'Software Bin X'
self.bin_y.long_name = 'Software Bin Y'
self.region_start_x.long_name = 'Region Start (X)'
self.region_size_x.long_name = 'Region Size (X)'
self.region_start_y.long_name = 'Region Start (Y)'
self.region_size_y.long_name = 'Region Size (Y)'
self.acquire.long_name = 'Set Acquire'
self.acquire_rbv.long_name = 'Acquire State'
self.image_counter.long_name = 'Image Counter'
self.event_code.long_name = 'Event Code'
self.event_rate.long_name = 'Event Rate'
self.stats_enable.long_name = 'Enable Stats'
self.centroid_x.long_name = 'Centroid (X)'
self.centroid_y.long_name = 'Centroid (Y)'
self.sigma_x.long_name = 'Sigma (X)'
self.sigma_y.long_name = 'Sigma (Y)'
self.centroid_threshold.long_name = 'Centroid Threshold'
self.centroid_enable.long_name = 'Enable Centroid'
self.target_x.long_name = 'Target X'
self.target_y.long_name = 'Target Y'
self.auto_configure.long_name = 'Auto-configure'
self.default_preset.long_name = 'Default Preset'
self.user_preset.long_name = 'Current Preset'
self.save_preset.long_name = 'Save Preset'
self.load_preset.long_name = 'Load Preset'


class LasBaslerNF(LasBasler):
"""
Expand Down
Loading