All devices instantiate
This commit is contained in:
parent
c483b50043
commit
fd7208ed3e
@ -53,10 +53,14 @@ def createProxy(name: str, connect=True) -> OphydObject:
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
num_errors = 0
|
||||
for key in lut_db:
|
||||
try:
|
||||
dut = createProxy(str(key))
|
||||
# print(f"{key}\t: {type(dut)}\t{dut.read()}")
|
||||
print(f"{key}\t: {type(dut)}")
|
||||
except Exception as ex:
|
||||
num_errors += 1
|
||||
print(key)
|
||||
print(ex)
|
||||
print(f"\nTotal number of errors: {num_errors}")
|
||||
|
@ -162,7 +162,7 @@ motrz1:
|
||||
motrz1e:
|
||||
desc: 'Monochromator crystal 1 axial movement encoder'
|
||||
acquisition: {schedule: sync}
|
||||
config: {name: motrz1e, prefix: 'X12SA-OP-MO:ECZ1'}
|
||||
config: {name: motrz1e, read_pv: 'X12SA-OP-MO:ECZ1'}
|
||||
deviceGroup: monitor
|
||||
status: {enabled: true}
|
||||
type: EpicsSignalRO
|
||||
@ -176,7 +176,7 @@ motrz1e:
|
||||
moth1e:
|
||||
desc: 'Monochromator crystal 1 theta encoder'
|
||||
acquisition: {schedule: sync}
|
||||
config: {name: moth1e, prefix: 'X12SA-OP-MO:ECX1'}
|
||||
config: {name: moth1e, read_pv: 'X12SA-OP-MO:ECX1'}
|
||||
deviceGroup: monitor
|
||||
status: {enabled: true}
|
||||
type: EpicsSignalRO
|
||||
@ -211,7 +211,7 @@ motry2:
|
||||
moth2e:
|
||||
desc: 'Monochromator crystal 2 theta encoder'
|
||||
acquisition: {schedule: sync}
|
||||
config: {name: moth2e, prefix: 'X12SA-OP-MO:ECX2'}
|
||||
config: {name: moth2e, read_pv: 'X12SA-OP-MO:ECX2'}
|
||||
deviceGroup: monitor
|
||||
status: {enabled: true}
|
||||
type: EpicsSignalRO
|
||||
|
28
ophyd_devices/epics/devices/cSaxsVirtualMotors.py
Normal file
28
ophyd_devices/epics/devices/cSaxsVirtualMotors.py
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
TABLES_DT_PUSH_DIST_MM = 890
|
||||
|
||||
|
||||
class DetectorTableTheta(PseudoPositioner):
|
||||
"""Detector table tilt motor
|
||||
|
||||
Small wrapper to adjust the detector table tilt as angle.
|
||||
The table is pushed from one side by a single vertical motor.
|
||||
|
||||
Note: Rarely used!
|
||||
"""
|
||||
|
||||
# Real axis (in degrees)
|
||||
pusher = Component(EpicsMotor, "", name="pusher")
|
||||
# Virtual axis
|
||||
theta = Component(PseudoSingle, name="theta")
|
||||
|
||||
_real = ["pusher"]
|
||||
|
||||
@pseudo_position_argument
|
||||
def forward(self, pseudo_pos):
|
||||
return self.RealPosition(pusher = tan(pseudo_pos.theta * 3.141592 / 180.0) * TABLES_DT_PUSH_DIST_MM)
|
||||
|
||||
@real_position_argument
|
||||
def inverse(self, real_pos):
|
||||
return self.PseudoPosition(theta = -180 * atan(real_pos.pusher / TABLES_DT_PUSH_DIST_MM) / 3.141592)
|
@ -8,7 +8,7 @@ IMPORTANT: Virtual monochromator axes should be implemented already in EPICS!!!
|
||||
"""
|
||||
|
||||
import numpy as np
|
||||
from math import isclose
|
||||
from math import isclose, tan, atan
|
||||
from ophyd import (
|
||||
EpicsSignal,
|
||||
EpicsSignalRO,
|
||||
@ -20,7 +20,7 @@ from ophyd import (
|
||||
Kind,
|
||||
)
|
||||
from ophyd.pseudopos import pseudo_position_argument, real_position_argument
|
||||
from ophyd.sim import SynAxis, Syn2DGauss
|
||||
|
||||
|
||||
|
||||
class PmMonoBender(PseudoPositioner):
|
||||
|
Loading…
x
Reference in New Issue
Block a user