From a2e6bb64c1e8939fa4a4c07b7ea50a25d6ab753c Mon Sep 17 00:00:00 2001 From: Nick Waters Date: Tue, 24 Sep 2024 16:22:17 -0700 Subject: [PATCH 1/3] ENH: add state support for MR1K2, SP1K1, and MR1K1 --- pcdsdevices/mirror.py | 68 ++++++++++++++++++++++++------------- pcdsdevices/spectrometer.py | 14 ++++++-- 2 files changed, 57 insertions(+), 25 deletions(-) diff --git a/pcdsdevices/mirror.py b/pcdsdevices/mirror.py index b7a50454c46..6883e03f64b 100644 --- a/pcdsdevices/mirror.py +++ b/pcdsdevices/mirror.py @@ -765,6 +765,43 @@ class XOffsetMirrorNoBend(XOffsetMirror): variable_cool = Cpt(PytmcSignal, ':VCV', kind='normal', io='io', doc='Activates variable cooling valve') +class TwinCATMirrorStripe(TwinCATStatePMPS): + """ + Subclass of TwinCATStatePMPS for the mirror coatings. + + Unless most TwinCATStatePMPS, we have: + - Only in_states + - No in_states block the beam + + We also clear the states_list and set _in_if_not_out to True + to automatically pick up the coatings from each mirror enum. + """ + states_list = [] + in_states = [] + out_states = [] + _in_if_not_out = True + config = UpCpt(state_count=2) + + @property + def transmission(self): + """The mirror coating never blocks the beam.""" + return 1 + + +class MirrorStripe2D2P(TwinCATMirrorStripe): + """ + 2D Coating states with 4 positons and PMPS. + + Currently services MR1L0. + """ + config = UpCpt(state_count=2, motor_count=2) + + +@reorder_components( + start_with=[ + 'coating' + ] +) class XOffsetMirrorBend(XOffsetMirror): """ X-ray Offset Mirror with 2 bender acutators. @@ -773,6 +810,8 @@ class XOffsetMirrorBend(XOffsetMirror): Currently (09/28/2022) services: mr1k1 + With 2 dimensional coating selection and OUT state. + Parameters ---------- prefix : str @@ -788,6 +827,9 @@ class XOffsetMirrorBend(XOffsetMirror): bender = None bender_enc_rms = None + coating = Cpt(MirrorStripe2D2P, ':COATING:STATE', kind='hinted', + doc='Control of the coating states via saved positions.') + # Motor components: can read/write positions bender_us = Cpt(BeckhoffAxisNoOffset, ':MMS:US', kind='hinted') bender_ds = Cpt(BeckhoffAxisNoOffset, ':MMS:DS', kind='hinted') @@ -902,6 +944,9 @@ class XOffsetMirrorSwitch(XOffsetMirror): bender = None bender_enc_rms = None + coating = Cpt(TwinCATMirrorStripe, ':COATING:STATE', kind='hinted', + doc='Control of the coating states via saved positions.') + # Motor components: can read/write positions y_left = Cpt(BeckhoffAxisNoOffset, ':MMS:YLEFT', kind='hinted', doc='Yleft master axis [um]') @@ -1263,29 +1308,6 @@ class FFMirrorZ(FFMirror): cool_press = Cpt(EpicsSignalRO, ':PRSM:1_RBV', kind='normal', doc="Axilon Panel Pressure Meter") -class TwinCATMirrorStripe(TwinCATStatePMPS): - """ - Subclass of TwinCATStatePMPS for the mirror coatings. - - Unless most TwinCATStatePMPS, we have: - - Only in_states - - No in_states block the beam - - We also clear the states_list and set _in_if_not_out to True - to automatically pick up the coatings from each mirror enum. - """ - states_list = [] - in_states = [] - out_states = [] - _in_if_not_out = True - config = UpCpt(state_count=2) - - @property - def transmission(self): - """The mirror coating never blocks the beam.""" - return 1 - - class MirrorStripe2D4P(TwinCATMirrorStripe): """ 2D Coating states with 4 positons and PMPS. diff --git a/pcdsdevices/spectrometer.py b/pcdsdevices/spectrometer.py index 139b2a7b38d..c97fcc7aa69 100644 --- a/pcdsdevices/spectrometer.py +++ b/pcdsdevices/spectrometer.py @@ -252,11 +252,19 @@ class VonHamos6Crystal(BaseInterface, GroupDevice): x_top = Cpt(BeckhoffAxis, ':T3', kind='normal') +class MonoGratingStates(TwinCATStatePMPS): + """ + SP1K1 Mono Grating States Axis G_H with PMPS. + + """ + config = UpCpt(state_count=6) + + class Mono(BaseInterface, GroupDevice, LightpathMixin): """ L2S-I NEH 2.X Monochromator - Axilon mechatronic desig with LCLS-II Beckhoff motion architecture. + Axilon mechatronic design with LCLS-II Beckhoff motion architecture. Parameters: ----------- @@ -268,7 +276,9 @@ class Mono(BaseInterface, GroupDevice, LightpathMixin): """ # UI representation _icon = 'fa.minus-square' - + # G_H states + grating_states = Cpt(MonoGratingStates, ':GRATING:STATE', kind='normal', + doc="mono grating states g_h") # Motor components: can read/write positions m_pi = Cpt(BeckhoffAxisNoOffset, ':MMS:M_PI', kind='normal', doc='mirror pitch [urad]') From 89f1aa80e76c6e7f5a129b72a53de0c6044dec93 Mon Sep 17 00:00:00 2001 From: Nick Waters Date: Tue, 24 Sep 2024 16:28:08 -0700 Subject: [PATCH 2/3] DOC: update 2D4P stripe class --- pcdsdevices/mirror.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcdsdevices/mirror.py b/pcdsdevices/mirror.py index 6883e03f64b..9459dc11a21 100644 --- a/pcdsdevices/mirror.py +++ b/pcdsdevices/mirror.py @@ -790,9 +790,9 @@ def transmission(self): class MirrorStripe2D2P(TwinCATMirrorStripe): """ - 2D Coating states with 4 positons and PMPS. + 2D Coating states with 2 positons and PMPS. - Currently services MR1L0. + Currently services MR1K1. """ config = UpCpt(state_count=2, motor_count=2) From d0b500beea28c69804337d0e910d99e5c7adbe8f Mon Sep 17 00:00:00 2001 From: Nick Waters Date: Tue, 24 Sep 2024 16:41:54 -0700 Subject: [PATCH 3/3] DOC: run doc script --- .../1290-rix-states.rst | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 docs/source/upcoming_release_notes/1290-rix-states.rst diff --git a/docs/source/upcoming_release_notes/1290-rix-states.rst b/docs/source/upcoming_release_notes/1290-rix-states.rst new file mode 100644 index 00000000000..2106b19afdb --- /dev/null +++ b/docs/source/upcoming_release_notes/1290-rix-states.rst @@ -0,0 +1,33 @@ +1290 rix-states +################# + +API Breaks +---------- +- N/A + +Library Features +---------------- +- N/A + +Device Features +--------------- +- `Mono` in `spectrometer.py` gets `MonoGratingStates` +- `XOffsetMirrorSwitch` in `mirror.py` gets `TwinCATMirrorStripe` +- `XOffsetMirrorBend` in `mirror.py` gets `MirrorStripe2D2P` + +New Devices +----------- +- `MonoGratingStates` +- `MirrorStripe2D2P` + +Bugfixes +-------- +- N/A + +Maintenance +----------- +- N/A + +Contributors +------------ +- nrwslac