slicops.device package

Basic device operations

copyright:

Copyright (c) 2024 The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All Rights Reserved.

license:

http://github.com/slaclab/slicops/LICENSE

exception slicops.device.AccessorPutError[source]

Bases: RuntimeError

This accessor is not writable

class slicops.device.Device(device_name)[source]

Bases: object

Wrapper around physical device

name

name of device

Type:

str

meta

information about device

Type:

slicops.device_db.DeviceMeta

accessor(accessor_name)[source]

Get _Accessor for more complex operations

Parameters:

accessor_name (str) – control system independent name

Returns:

object holding control system state

Return type:

_Accessor

destroy()[source]

Disconnect from accessors and remove state about device

get(accessor_name)[source]

Read from accessor

Parameters:

accessor_name (str)

Returns:

the value from the control system converted to a Python type

Return type:

object

has_accessor(accessor_name)[source]

Check whether device has accessor

Parameters:

accessor_name (str) – control system independent name

Returns:

True if accessor is found for device

Return type:

bool

put(accessor_name, value)[source]

Set accessor to value

Parameters:
  • accessor_name (str) – control system independent name

  • value (object) – Value to write to control system

exception slicops.device.DeviceError[source]

Bases: RuntimeError

Error communicating with accessor

Submodules

slicops.device.screen module

Control a Screen

copyright:

Copyright (c) 2024 The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory (subject to receipt of any required approvals from the U.S. Dept. of Energy). All Rights Reserved.

license:

http://github.com/slaclab/slicops/LICENSE

class slicops.device.screen.ErrorKind(*values)[source]

Bases: Enum

Errors passed to on_screen_device_error

fsm = 1
monitor = 2
upstream = 3
class slicops.device.screen.EventHandler[source]

Bases: object

Clients of DeviceScreen must implement this

abstractmethod on_screen_device_error(exc)[source]
abstractmethod on_screen_device_update(accessor_name, value)[source]
class slicops.device.screen.Screen(beam_path, device_name, handler, *args, **kwargs)[source]

Bases: Device

Augment Device with screen specific operations

destroy()[source]

Disconnect from accessors and remove state about device

move_target(want_in)[source]

Insert or remove the target

Parameters:

want_in (bool) – True to insert, and False to remove

exception slicops.device.screen.ScreenError(**kwargs)[source]

Bases: Exception

class slicops.device.screen.TargetStatus(*values)[source]

Bases: Enum

Errors passed to on_screen_device_error

IN = 2
INCONSISTENT = 3
MOVING = 0
OUT = 1