id4_common.devices.ringlight#

Ringlight illuminator (PVA NTEnum, e.g. RINGLIGHT:STATE).

The IOC exposes a single NTEnum control PV with these choices:

index choice convenience method —– ——- ——————- 0 OFF off() 1 100% full() 2 50% half() 3 25% quarter() 4 12.5% eighth() 5 RAINBOW rainbow()

Implemented with classic ophyd Device + a small Signal subclass wrapping pvapy.Channel (same pattern this beamline uses for the PositionerStream PVA controls). pvapy is the working PVA client in this environment; p4p/ophyd_async PVA backends time out on this IOC.

Module Contents#

class id4_common.devices.ringlight.PVANTEnumSignal(*args, pv_name, **kwargs)#

Bases: ophyd.Signal

Read/write an NTEnum PV via pvapy.

The PV’s value is a struct {index: int, choices: [str]}. get() returns the human-readable choice string; put() accepts either an integer index or a choice string.

get(**kwargs)#

Return the current NTEnum choice string (with trailing % stripped).

put(value, **kwargs)#

Write a new NTEnum value (int index or choice-label string).

set(value, **kwargs)#

Synchronous put + already-finished Status, matching PositionerStream.

wait_for_connection(timeout=5.0)#

Raise if the PV cannot be reached within timeout seconds.

class id4_common.devices.ringlight.Ringlight(prefix, *, name='', labels=None, **kwargs)#

Bases: ophyd.Device

Sample-area ringlight controlled via a single NTEnum state PV (PVA).

STATES#
state#
set_state(value)#

Write a state.

Accepts an integer index (0-5), a short name (off/full/half/quarter/eighth/rainbow), or the raw NTEnum choice string (e.g. "100%", "OFF").

off()#

Turn the ringlight off.

full()#

100% intensity.

half()#

50% intensity.

quarter()#

25% intensity.

eighth()#

12.5% intensity.

rainbow()#

Rainbow color cycle.