Interfaces¶
The Lightpath application depends on an a specific API for devices. For maximum flexibility, and in order to avoid duplicating object implementations, any object can be entered into the path as long as it agrees with one of the interfaces below.
The LightInterface
covers the majority of LCLS devices. The logical
implementation of reading PVs and updating the reported state of the device is
up to the object to implement, the lightpath will count on these functions to
be accurate in order to determine the state of the beamline as a whole. The
LightInterface
simplifies a device down to one of two states,
inserted and removed. If a device is not found in either of these states it is
considered unknown and a possible impediment to the path. There are a number
of devices that are regularly inserted into the beamline that do not block
photons completely such as IPIMB targets and attenutators. These devices are
incorporated by adjusting the LightInterface.transmission
, either to a
fixed value or one which depends on other device readbacks. The only type of
devices that require a more copmlex interface are those that have the potential
that mark the transition from one beamline to another. These device will use
the BranchingInterface
. This includes mirrors and crystals that
different hutches use to manipulate from the common line.
Device Interfaces¶
-
class
pcdsdevices.interface.
LightInterface
¶ Interface for a basic lightpath device
-
beamline
¶ Specific beamline the device is on
-
inserted
¶ Report if the device is currently inserted into the beam
-
removed
¶ Report if the device is currently removed from the beam
-
subscribe
(cb, event_type=None, run=False, **kwargs)¶ Subscribe a callback function to run when the device changes state
Parameters: - cb (callable) – Function to be run upon change
- event_type (str, optional) – Type of event the function will be called after
- run (bool, optional) – Run the callable immediately or wait for an event.
-
transmission
¶ Approximate transmission percentage of X-rays through device. Most devices will have 0.0 transmission, as in they block the beam completely
-
z
¶ Z position along the beamline in meters
-
-
class
pcdsdevices.interface.
BranchingInterface
¶ Bases:
pcdsdevices.interface.LightInterface
Interface for a branching device
-
branches
¶ List of possible beamlines the device is available to send photons
-
destination
¶ Current destinations of the branching device. Should always be returned as a list to accomodate branches that can send beam to multiple positions
-
MPS Interface¶
-
class
pcdsdevices.interface.
MPSInterface
¶ Interface for MPS device
The lightpath surveys devices for an attribute
mps
. It is expected that if a device is in the MPS system, this attribute will return a sub-device that uses this interface-
bypassed
¶ Bypass state of the MPS bit
-
faulted
¶ Boolean of whether MPS is faulted or not
-
veto_capable
¶ Whether the device causes downstream faults to be ignored
-