Closed mrakitin closed 3 years ago
I see some caput
:
plans/03-plan.py: from epics import caget, caput
plans/03-plan.py: caput('XF:02IDA-OP{Mir:1-Ax:4_Pitch}Cmd:Kill-Cmd',1 )
plans/03-plan.py: caput('XF:02IDA-OP{Mir:1-Ax:4_Pitch}Cmd:Kill-Cmd',1 )
Also, .put
:
startup/04-epu.py: self.setpoint.put(self.position)
startup/04-epu.py: self.setpoint.put(position, wait=False)
startup/21-areadetector.py: getattr(self, 'roi' + str(roi_num) + '.min_xyz.min_x').put(min_x)
startup/21-areadetector.py: getattr(self, 'roi' + str(roi_num) + '.size.x').put(size_x)
startup/21-areadetector.py: getattr(self, 'roi' + str(roi_num) + '.min_xyz.min_y').put(min_y)
startup/21-areadetector.py: getattr(self, 'roi' + str(roi_num) + '.size.y').put(size_y)
startup/21-areadetector.py: getattr(self, 'roi' + str(roi_num) + '.min_xyz.min_z').put(min_z)
startup/21-areadetector.py: getattr(self, 'roi' + str(roi_num) + '.size.z').put(size_z)
startup/22-rixscam.py: self._acquisition_signal.put(1, wait=False)
startup/November 2018 22-rixscam.pyno: self._acquisition_signal.put(1, wait=False)
PR #31 contains my proposed .get()
changes.
PR #31 is merged, testing now. The .put
and caput
mentioned above have not been changed.
Looking at that PV
XF:02IDA-OP{Mir:1-Ax:4_Pitch}Cmd:Kill-Cmd
they have an ophyd Device connected to that hardware, or so I infer based on the matching PV prefix:
startup/10-mirror.py:m1 = M1('XF:02IDA-OP{Mir:1-Ax:4', name='m1')
An M1
is a custom compound device defined in that same file:
from ophyd import Device, EpicsMotor
from ophyd import Component as Cpt
class M1(Device):
x = Cpt(EpicsMotor, '_Trans}Mtr')
pit = Cpt(EpicsMotor, '_Pitch}Mtr')
rol = Cpt(EpicsMotor, '_Roll}Mtr')
but EpicsMotor
has no signal connected to the Kill-Cmd
PV, as you can verify in https://github.com/bluesky/ophyd/blob/master/ophyd/epics_motor.py.
I do not know off the top of my head if Kill-Cmd
is common to all EpicsMotors or particular to these. We should investigate that, and then decide whether to add that to EpicsMotor
or a special subclass here.
startup/04-epu.py: self.setpoint.put(self.position)
startup/04-epu.py: self.setpoint.put(position, wait=False)
startup/22-rixscam.py: self._acquisition_signal.put(1, wait=False)
These are correct because they are called inside methods on custom ophyd Devices.
startup/21-areadetector.py: getattr(self, 'roi' + str(roi_num) + '.min_xyz.min_x').put(min_x)
startup/21-areadetector.py: getattr(self, 'roi' + str(roi_num) + '.size.x').put(size_x)
startup/21-areadetector.py: getattr(self, 'roi' + str(roi_num) + '.min_xyz.min_y').put(min_y)
startup/21-areadetector.py: getattr(self, 'roi' + str(roi_num) + '.size.y').put(size_y)
startup/21-areadetector.py: getattr(self, 'roi' + str(roi_num) + '.min_xyz.min_z').put(min_z)
startup/21-areadetector.py: getattr(self, 'roi' + str(roi_num) + '.size.z').put(size_z)
...and same here, though a minor refactor could make that code a bit prettier.
Previsit
profile_collection
bsui
remotely (does it touch any hardware?) - usegit grep .put
orgit grep caput
Housekeeping
Test deployment
~/.bashrc
add the following and remember tosource ~/.bashrc
afterward.and (if needed) create those directories, making them world-read/write-able.
00-startup.py
https://gist.github.com/jklynch/a4366b8900ec0c03883403455ae711b2BS_ENV=collection-2020-2.0rc7 bsui
.value
->.get()
if it's in aDevice
, or withyield from bps.read()
if in a planhistory.sqlite
issue - see https://blueskyproject.io/bluesky/metadata.html#persistence-between-sessions2020C2.0