csaxs_bec.devices.omny.rt.rt_flomni_ophyd.RtFlomniController#
- class RtFlomniController(*args, **kwargs)[source]#
Bases:
ControllerMethods
Register a callback which will receive each OphydObject instance.
add_pos_to_scanCheck if the value is valid for this object
Remove a subscription, given the original callback function
clear_trajectory_generatorDisconnect the object from the underlying control layer
feedback_disablefeedback_enable_with_resetfeedback_enable_without_resetfeedback_is_runningGet device instance for a specified controller axis.
Get an axis by name.
get_pid_xget_scan_statusis_axis_movinglaser_tracker_check_enabledlaser_tracker_check_signalstrengthlaser_tracker_galil_enablelaser_tracker_offlaser_tracker_onlaser_tracker_on_targetlaser_tracker_show_alllaser_tracker_wait_on_targetlaser_update_tracker_infomove_samx_to_scan_regionmove_to_zeroClose the socket connection to the controller
Open a new socket connection to the controller
pid_yread_ssi_interferometerRemove the device instance assigned to a controller axis.
Enable or disable all devices registered for the controller.
Assign an axis to a device instance.
Enable/disable a device.
Change the read-only status of a device.
set_rotation_angleshow_cyclic_error_compensationshow_signal_strength_interferometerslew_rate_limiters_on_targetReceive a response from the controller through the socket.
Send a command to the controller through the socket.
Send a command to the controller and receive the response.
start_scanstop_all_axesSubscribe to events this event_type generates.
Remove a subscription
unsubscribe_allAttributes
SUB_CONNECTION_CHANGEUSER_ACCESSattr_nameIf the device is connected.
Return the dotted name
Events that can be subscribed to via
obj.subscribekindname of the device
The parent of the ophyd object.
A report on the object.
Walk parents to find ultimate ancestor (parent's parent...).
subscriptions- classmethod add_instantiation_callback(callback, fail_if_late=False)#
Register a callback which will receive each OphydObject instance.
- Parameters:
callback (callable) – Expected signature:
f(ophydobj_instance)fail_if_late (boolean) – If True, verify that OphydObj has not yet been instantiated and raise
RuntimeErrorif it has, as a way of verify that no instances will be “missed” by this registry. False by default.
- check_value(value, **kwargs)#
Check if the value is valid for this object
This function does no normalization, but may raise if the value is invalid.
- Raises:
ValueError –
- clear_sub(cb, event_type=None)#
Remove a subscription, given the original callback function
See also
subscribe(),unsubscribe()- Parameters:
cb (callable) – The callback
event_type (str, optional) – The event to unsubscribe from (if None, removes it from all event types)
- property connected#
If the device is connected.
Subclasses should override this
- destroy()#
Disconnect the object from the underlying control layer
- property dotted_name: str#
Return the dotted name
- property event_types#
Events that can be subscribed to via
obj.subscribe
- get_axis(axis_nr: int) Device#
Get device instance for a specified controller axis.
- Parameters:
axis_nr (int) – Controller axis number
- Returns:
Device instance (e.g. GalilMotor)
- Return type:
Device
- get_axis_by_name(name: str) Device#
Get an axis by name.
- Parameters:
name (str) – Name of the axis
- Returns:
Device instance
- Return type:
Device
- property name#
name of the device
- off(update_config: bool = True) None#
Close the socket connection to the controller
- on(timeout: int = 10) None#
Open a new socket connection to the controller
- Parameters:
timeout (int) – Time in seconds to wait for connection
- property parent#
The parent of the ophyd object.
If at the top of its hierarchy, parent will be None
- remove_axis(*, axis_nr: int) None#
Remove the device instance assigned to a controller axis.
- Parameters:
axis_nr (int) – Controller axis number
- property report#
A report on the object.
- property root#
Walk parents to find ultimate ancestor (parent’s parent…).
- set_all_devices_enabled(enabled: bool) None#
Enable or disable all devices registered for the controller.
- Parameters:
enabled (bool) – Enable or disable all devices
- set_axis(*, axis: Device, axis_nr: int) None#
Assign an axis to a device instance.
- Parameters:
axis (Device) – Device instance (e.g. GalilMotor)
axis_nr (int) – Controller axis number
- set_device_enabled(device_name: str, enabled: bool) None#
Enable/disable a device. If the device is not configured, a warning is logged.
- Parameters:
device_name (str) – Name of the device
enabled (bool) – Enable or disable the device
- set_device_read_write(device_name: str, enabled: bool) None#
Change the read-only status of a device. If the device is not configured, a warning is logged.
- Parameters:
device_name (str) – Name of the device
enabled (bool) – Set device to read-only or writable
- socket_get()#
Receive a response from the controller through the socket.
- socket_put(val: str)#
Send a command to the controller through the socket.
- Parameters:
val (str) – Command to send
- socket_put_and_receive(val: str, remove_trailing_chars=True) str#
Send a command to the controller and receive the response. Override this method in the derived class if necessary, especially if the response needs to be parsed differently.
- subscribe(callback, event_type=None, run=True)#
Subscribe to events this event_type generates.
The callback will be called as
cb(*args, **kwargs)with the values passed to _run_subs with the following additional keys:sub_type : the string value of the event_type obj : the host object, added if ‘obj’ not already in kwargs
if the key ‘timestamp’ is in kwargs _and_ is None, then it will be replaced with the current time before running the callback.
The
*args,**kwargspassed to _run_subs will be cached as shallow copies, be aware of passing in mutable data.Warning
If the callback raises any exceptions when run they will be silently ignored.
- Parameters:
callback (callable) –
A callable function (that takes kwargs) to be run when the event is generated. The expected signature is
def cb(*args, obj: OphydObject, sub_type: str, **kwargs) -> None:
The exact args/kwargs passed are whatever are passed to
_run_subsevent_type (str, optional) –
The name of the event to subscribe to (if None, defaults to the default sub for the instance - obj._default_sub)
This maps to the
sub_typekwargs in _run_subsrun (bool, optional) – Run the callback now
See also
clear_sub,_run_subs- Returns:
cid – id of callback, can be passed to unsubscribe to remove the callback
- Return type:
int
- unsubscribe(cid)#
Remove a subscription
See also
subscribe(),clear_sub()- Parameters:
cid (int) – token return by
subscribe()