Skip to content

Commit

Permalink
first pass of the 'ARI M1' mirror caproto IOC
Browse files Browse the repository at this point in the history
  • Loading branch information
awalter-bnl committed Apr 5, 2024
1 parent 5b78bf3 commit f26f626
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions src/ari_sxn_simbeamline/Caproto_servers/Mirror_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from textwrap import dedent


class Mirror(PVGroup):
class AriM1Mirror(PVGroup):
"""
A PVGroup that generates the PVs associated with a beamline mirror system.
A PVGroup that generates the PVs associated with the ARI M1 mirror system.
This class should be used to define the mirror systems for a beamline, each
mirror system will consist of motors for each mirror axis as well as the
This class should be used to define the M1 mirror system PVs for the ARI beamline.
It will consist of PVs for each of the motors for each mirror axis as well as the
related vacuum component PVs.
TODO:
Expand All @@ -27,35 +27,34 @@ class Mirror(PVGroup):
----------
*args : list
The arguments passed to the PVGroup parent class
axes : {axis_name:{key_1:val_1, ... ,key_n,val_n}}, optional
A dictionary mapping axis names to a 'parameter' dictionary of args/kwargs
passed to the caproto.ioc_examples.fake_motor_record.FakeMotor PVGroup for
the given axis. See the caproto.ioc_examples.fake_motor_record.FakeMotor
for a description of available parameters and their descriptions. An
example with a single (pitch) axes would be:
axes={'pitch':{'velocity':0.1, 'precision':3, 'acceleration'=1.0,
'resolution'=1E-6,'user_limits'=(0.0,100.0),
'tick_rate_hz'=10.}}
**kwargs : list, optional
The Keyword arguments passed to the PVGroup parent class
"""

def __init__(self, *args, axes, **kwargs):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) # call the PVGroup __init__ function
for axis_name, axis_kwargs in axes.items(): # create the axis attributes
setattr(self, axis_name, SubGroup(FakeMotor, **axis_kwargs,
doc=f'The {axis_name} mirror axis'))

Ry_coarse = SubGroup(FakeMotor, velocity=0.1, precision=6E-5, acceleration=1.0,
resolution=6E-5, user_limits=(-3.15, -1.15), tick_rate_hz=10.,
prefix='Ry_coarse')
Ry_fine = SubGroup(FakeMotor, velocity=0.1, precision=6E-7, acceleration=1.0,
resolution=6E-7, user_limits=(-0.03, 0.03), tick_rate_hz=10.,
prefix='Ry_fine')
Rz = SubGroup(FakeMotor, velocity=0.1, precision=6E-5, acceleration=1.0,
resolution=6E-5, user_limits=(-2.3, 2.3), tick_rate_hz=10.,
prefix='Rz')
x = SubGroup(FakeMotor, velocity=0.0001, precision=5., acceleration=1.0,
resolution=5., user_limits=(-10000., 10000.), tick_rate_hz=1E-3,
prefix='x')
y = SubGroup(FakeMotor, velocity=0.1, precision=5., acceleration=1.0,
resolution=5., user_limits=(-10000., 10000.), tick_rate_hz=10.,
prefix='y')


# Add some code to start a version of the server if this file is 'run'.
if __name__ == "__main__":
axes_params = {'velocity': 0.1, 'precision': 3, 'acceleration': 1.0,
'resolution': 1E-6, 'user_limits': (0.0, 100.0),
'tick_rate_hz': 10.}
default_axes = {'x': axes_params, 'y': axes_params, 'z': axes_params,
'pitch': axes_params, 'yaw': axes_params, 'roll': axes_params}
ioc_options, run_options = ioc_arg_parser(
default_prefix="Beamline:M1:",
desc=dedent(Mirror.__doc__))
ioc = Mirror(**ioc_options, axes=default_axes)
default_prefix="ARI:M1:",
desc=dedent(AriM1Mirror.__doc__))
ioc = AriM1Mirror(**ioc_options)
run(ioc.pvdb, **run_options)

0 comments on commit f26f626

Please sign in to comment.