csaxs_bec.devices.omny.galil.ogalil_ophyd.OMNYGalilController#
- class OMNYGalilController(*args, **kwargs)[source]#
Bases:
GalilControllerMethods
Register a callback which will receive each OphydObject instance.
Check if all axes are referenced.
axis_Id_numeric_to_alphaaxis_Id_to_numericaxis_is_referencedCheck if the value is valid for this object
Remove a subscription, given the original callback function
describeDisconnect the object from the underlying control layer
Drive an axis to the limit in a specified direction.
Find the reference of an axis.
folerr_statusgalil_show_allGet device instance for a specified controller axis.
Get an axis by name.
get_digital_inputGet the status of the motor limit switches.
is_axis_movingis_motor_onis_thread_activemotor_temperatureClose the socket connection to the controller
Open a new socket connection to the controller
Remove 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.
show_running_threadsShow additional device-specific status information.
Receive 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.
Send message to controller and ensure that it is received by checking that the socket receives a colon.
stop_all_axesSubscribe to events this event_type generates.
Remove a subscription
unsubscribe_allAttributes
ENDCFAILOKBLUEOKCYANOKGREENSUB_CONNECTION_CHANGEUSER_ACCESSWARNINGattr_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.
- all_axes_referenced() bool#
Check if all axes are referenced.
- 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
- drive_axis_to_limit(axis_Id_numeric: int, direction: str, verbose=0) None#
Drive an axis to the limit in a specified direction.
- Parameters:
axis_Id_numeric (int) – Axis number
direction (str) – Direction in which the axis should be driven to the limit. Either ‘forward’ or ‘reverse’.
- property event_types#
Events that can be subscribed to via
obj.subscribe
- find_reference(axis_Id_numeric: int, verbose=0, raise_error=1) None#
Find the reference of an axis.
- Parameters:
axis_Id_numeric (int) – Axis number
- 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
- get_motor_limit_switch(axis_Id) list#
Get the status of the motor limit switches.
- Parameters:
axis_Id (str) – Axis identifier (e.g. ‘A’, ‘B’, ‘C’, …)
- Returns:
List of two booleans indicating if the low and high limit switch is active, respectively.
- Return type:
list
- property name#
name of the device
- off(update_config: bool = True) None#
Close the socket connection to the controller
- 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
- show_status_other()[source]#
Show additional device-specific status information. Override in subclasses.
- socket_get()#
Receive a response from the controller through the socket.
- socket_put(val: str) None#
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.
- socket_put_confirmed(val: str) None#
Send message to controller and ensure that it is received by checking that the socket receives a colon.
- Parameters:
val (str) – Message that should be sent to the socket
- Raises:
GalilCommunicationError – Raised if the return value is not a colon.
- 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()