csaxs_bec.devices.omny.galil.fupr_ophyd.FuprGalilController#

class FuprGalilController(*args, **kwargs)[source]#

Bases: GalilController

Methods

add_instantiation_callback

Register a callback which will receive each OphydObject instance.

all_axes_referenced

Check if all axes are referenced.

axis_Id_numeric_to_alpha

axis_Id_to_numeric

axis_is_referenced

check_value

Check if the value is valid for this object

clear_sub

Remove a subscription, given the original callback function

describe

destroy

Disconnect the object from the underlying control layer

drive_axis_to_limit

Drive an axis to the limit in a specified direction.

find_reference

Find the reference of an axis.

folerr_status

galil_show_all

get_axis

Get device instance for a specified controller axis.

get_axis_by_name

Get an axis by name.

get_digital_input

get_motor_limit_switch

Get the status of the motor limit switches.

is_axis_moving

is_motor_on

is_thread_active

motor_temperature

off

Close the socket connection to the controller

on

Open a new socket connection to the controller

remove_axis

Remove the device instance assigned to a controller axis.

set_all_devices_enabled

Enable or disable all devices registered for the controller.

set_axis

Assign an axis to a device instance.

set_device_enabled

Enable/disable a device.

set_device_read_write

Change the read-only status of a device.

show_running_threads

show_status_other

Show additional device-specific status information.

socket_get

Receive a response from the controller through the socket.

socket_put

Send a command to the controller through the socket.

socket_put_and_receive

Send a command to the controller and receive the response.

socket_put_confirmed

Send message to controller and ensure that it is received by checking that the socket receives a colon.

stop_all_axes

subscribe

Subscribe to events this event_type generates.

unsubscribe

Remove a subscription

unsubscribe_all

Attributes

ENDC

FAIL

OKBLUE

OKCYAN

OKGREEN

SUB_CONNECTION_CHANGE

USER_ACCESS

WARNING

attr_name

connected

If the device is connected.

dotted_name

Return the dotted name

event_types

Events that can be subscribed to via obj.subscribe

kind

name

name of the device

parent

The parent of the ophyd object.

report

A report on the object.

root

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 RuntimeError if it has, as a way of verify that no instances will be “missed” by this registry. False by default.

all_axes_referenced() bool[source]#

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, direction: str) None[source]#

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

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

show_status_other() None#

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, **kwargs passed 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_subs

  • event_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_type kwargs in _run_subs

  • run (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()