Skip to content

Commit

Permalink
Merge branch 'master' into new-vfv-device
Browse files Browse the repository at this point in the history
  • Loading branch information
jozamudi authored Sep 27, 2024
2 parents 408bd92 + 5b66edb commit 3656689
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 25 deletions.
33 changes: 33 additions & 0 deletions docs/source/upcoming_release_notes/1290-rix-states.rst
Original file line number Diff line number Diff line change
@@ -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
68 changes: 45 additions & 23 deletions pcdsdevices/mirror.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 2 positons and PMPS.
Currently services MR1K1.
"""
config = UpCpt(state_count=2, motor_count=2)


@reorder_components(
start_with=[
'coating'
]
)
class XOffsetMirrorBend(XOffsetMirror):
"""
X-ray Offset Mirror with 2 bender acutators.
Expand All @@ -773,6 +810,8 @@ class XOffsetMirrorBend(XOffsetMirror):
Currently (09/28/2022) services: mr1k1
With 2 dimensional coating selection and OUT state.
Parameters
----------
prefix : str
Expand All @@ -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')
Expand Down Expand Up @@ -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]')
Expand Down Expand Up @@ -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.
Expand Down
14 changes: 12 additions & 2 deletions pcdsdevices/spectrometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
-----------
Expand All @@ -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]')
Expand Down

0 comments on commit 3656689

Please sign in to comment.