Skip to content

Commit

Permalink
Merge pull request #1274 from c-tsoi/hxr_diff
Browse files Browse the repository at this point in the history
Adding base class for HxrDiffractometer
  • Loading branch information
ZLLentz authored Oct 1, 2024
2 parents 3495885 + 5d34e84 commit 50e9f4b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
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

0 comments on commit 50e9f4b

Please sign in to comment.