-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1273 from tongju12/pf1k4-pf-y
adding PA1K4-PF device in TMO beamline
- Loading branch information
Showing
2 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
docs/source/upcoming_release_notes/1273-adding_pa1k4-pf_device.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
1273 adding pa1k4-pf device | ||
################# | ||
|
||
API Breaks | ||
---------- | ||
- N/A | ||
|
||
Features | ||
-------- | ||
- N/A | ||
|
||
Device Updates | ||
-------------- | ||
- N/A | ||
|
||
New Devices | ||
----------- | ||
- adding new device PA1K4-PF | ||
|
||
Bugfixes | ||
-------- | ||
- N/A | ||
|
||
Maintenance | ||
----------- | ||
- N/A | ||
|
||
Contributors | ||
------------ | ||
- tongju12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"""TMO sample calibration foil to work with spectrometer""" | ||
from lightpath import LightpathState | ||
from ophyd.device import Component as Cpt | ||
|
||
from .device import GroupDevice | ||
from .device import UpdateComponent as UpCpt | ||
from .epics_motor import BeckhoffAxis | ||
from .interface import BaseInterface, LightpathMixin | ||
from .pmps import TwinCATStatePMPS | ||
|
||
|
||
class CalibrationAxis(TwinCATStatePMPS): | ||
""" | ||
Sample calibration 1D State Setup | ||
Here, we specify 5 states, and 1 motor, for Y | ||
axe. | ||
""" | ||
config = UpCpt(state_count=5, motor_count=1) | ||
|
||
|
||
class SCaFoil(BaseInterface, GroupDevice, LightpathMixin): | ||
""" | ||
TMO PMPS1D sample calibration class. | ||
Parameters: | ||
----------- | ||
prefix : str | ||
Base PV for the motion system | ||
name : str | ||
Alias for the device | ||
""" | ||
# UI Representation | ||
_icon = 'fa.minus-square' | ||
tab_component_names = True | ||
|
||
# Sample calibration Y axis | ||
|
||
pf_state = Cpt(CalibrationAxis, ':STATE', kind='normal') | ||
pf_y = Cpt(BeckhoffAxis, ':MMS:Y', doc="Y-axis of photo filter pa1k4", kind='normal') | ||
removed = False | ||
transmission = 1 | ||
SUB_STATE = 'state' | ||
|
||
# dummy signal, state is always the same | ||
lightpath_cpts = ['cali_foil.user_readback'] | ||
|
||
def calc_lightpath_state(self, **kwargs) -> LightpathState: | ||
return LightpathState( | ||
inserted=True, | ||
removed=False, | ||
output={self.output_branches[0]: 1} | ||
) |