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

Adding base class for HxrDiffractometer #1274

Merged
merged 9 commits into from
Oct 1, 2024
Merged
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,30 @@
1274 Adding base class for hxr diffractometer.
#################

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

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

Device Features
---------------
- N/A

New Devices
-----------
- Adding base class for hxr diffractometer, this class needs the base prefix to be passed in e.g. HXR:GON:MMS. The stage suffixes are hardcoded.

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

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

Contributors
------------
- c-tsoi
28 changes: 27 additions & 1 deletion pcdsdevices/gon.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
import logging

import numpy as np
from ophyd import Device
from ophyd import FormattedComponent as FCpt
from ophyd.device import Component as Cpt
from ophyd.status import DeviceStatus
from prettytable import PrettyTable

from .device import GroupDevice
from .epics_motor import IMS
from .epics_motor import IMS, BeckhoffAxis
from .interface import BaseInterface
from .pseudopos import (PseudoPositioner, PseudoSingleInterface,
pseudo_position_argument, real_position_argument)
Expand Down Expand Up @@ -657,6 +658,31 @@ def format_status_info(self, status_info):
"""


class HxrDiffractometer(BaseInterface, Device):
"""
Class for diffractometer.

Parameters
----------
name : str
A name to refer to the device

prefix_base : str
The EPICS base PV of the diffractometer stages
"""

base_h = Cpt(BeckhoffAxis, 'BASE_H', kind='normal')
base_v = Cpt(BeckhoffAxis, 'BASE_V', kind='normal')
th = Cpt(BeckhoffAxis, 'TH', kind='normal')
tth = Cpt(BeckhoffAxis, 'TTH', kind='normal')
chi = Cpt(BeckhoffAxis, 'CHI', kind='normal')

tab_component_names = True

def __init__(self, prefix, name, **kwargs):
super().__init__(prefix, name=name, **kwargs)


class SimSampleStage(KappaXYZStage):
x = Cpt(FastMotor, limits=(-100, 100))
y = Cpt(FastMotor, limits=(-100, 100))
Expand Down