Package xal.smf.impl
Class MagnetPowerSupply
java.lang.Object
xal.smf.impl.MagnetPowerSupply
- All Implemented Interfaces:
DataListener
- Direct Known Subclasses:
MagnetMainSupply
,MagnetTrimSupply
PowerSupply is the abstract super class of all power supplies.
- Author:
- tap
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Accelerator
protected final ChannelSuite
final AccessibleProperty
static final String
static final String
static final int
static final String
static final int
final AccessibleProperty
static final int
protected String
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MagnetPowerSupply
(Accelerator anAccelerator) Creates a new instance of PowerSupply using the same channel factory as the provided accelerator -
Method Summary
Modifier and TypeMethodDescriptiondataLabel() provides the name used to identify the class in an external data source.findChannel
(String handle) Find the channel for the specified handle.Get the associated acceleratorprotected List<AccessibleProperty>
getAccessibleProperties
(List<AccessibleProperty> properties, Class<?> cls) getAndConnectChannel
(String handle) Get the channel corresponding to the specified handle and connect it.getChannel
(String handle) Get the channel for the specified handle.Get the channel suite.double
Get the magnet power supply currentint
Gets the cycle state of the magnet.getId()
Get the unique power supply IDgetNodes()
Get the accelerator nodes which are tied to this supply.<T extends AcceleratorNode>
Collection<T>getNodes
(Collection<T> trialNodes) Get the subset of nodes from trialNodes which are supplied by this power supply.String[]
getReadbackHandles
(String setHandle) Get the readback handle corresponding to a set channel.getSetHandle
(String readbackHandle) Get the set handle corresponding to a readback channel.abstract String
getType()
Get the power supply typedouble
get the current lower settable limit (A)void
setCurrent
(double current) Set the magnet power supply current.void
Set supply ID.abstract boolean
suppliesNode
(AcceleratorNode node) Check if the electromagnet is supplied by this power supply.void
update
(DataAdaptor adaptor) Instructs the receiver to update its data based on the given adaptor.double
get the current lower settable limit (A)void
write
(DataAdaptor adaptor) Instructs the receiver to write its data to the adaptor for external storage.
-
Field Details
-
accelerator
-
channelSuite
-
strId
-
CYCLE_INVALID
public static final int CYCLE_INVALID- See Also:
-
CYCLING
public static final int CYCLING- See Also:
-
CYCLE_VALID
public static final int CYCLE_VALID- See Also:
-
CYCLE_STATE_HANDLE
- See Also:
-
CURRENT_SET_HANDLE
- See Also:
-
CURRENT_RB_HANDLE
- See Also:
-
current
-
cycleState
-
-
Constructor Details
-
MagnetPowerSupply
Creates a new instance of PowerSupply using the same channel factory as the provided accelerator
-
-
Method Details
-
setId
Set supply ID.- Parameters:
id
- The power supply ID
-
getId
Get the unique power supply ID- Returns:
- The power supply ID
-
getAccelerator
Get the associated accelerator- Returns:
- the accelerator
-
getType
Get the power supply type- Returns:
- The power supply type
-
dataLabel
dataLabel() provides the name used to identify the class in an external data source.- Specified by:
dataLabel
in interfaceDataListener
- Returns:
- a tag that identifies the receiver's type
-
update
Instructs the receiver to update its data based on the given adaptor.- Specified by:
update
in interfaceDataListener
- Parameters:
adaptor
- The adaptor from which to update the receiver's data
-
write
Instructs the receiver to write its data to the adaptor for external storage.- Specified by:
write
in interfaceDataListener
- Parameters:
adaptor
- The adaptor to which the receiver's data is written
-
getChannelSuite
Get the channel suite.- Returns:
- the channel suite.
-
findChannel
Find the channel for the specified handle.- Parameters:
handle
- The handle for the channel to fetch- Returns:
- the channel if found or null if not found
-
getChannel
Get the channel for the specified handle.- Parameters:
handle
- The handle for the channel to fetch- Returns:
- the channel
- Throws:
NoSuchChannelException
-
getAndConnectChannel
Get the channel corresponding to the specified handle and connect it.- Parameters:
handle
- The handle for the channel to get.- Returns:
- The channel associated with this node and the specified handle or null if there is no match.
- Throws:
NoSuchChannelException
- if no such channel as specified by the handle is associated with this node.ConnectionException
- if the channel cannot be connected
-
getCycleState
Gets the cycle state of the magnet. The magnet may be in one of three states: cycle is invalid (field changed in reverse direction of initial setting), cycling in progress or cycle is valid- Returns:
- One of CYCLE_INVALID, CYCLING or CYCLE_VALID
- Throws:
GetException
-
getCurrent
Get the magnet power supply current- Returns:
- the magnet power supply current in amperes
- Throws:
ConnectionException
- if the readback channel cannot be connectedGetException
- if the readback channel get action fails
-
setCurrent
Set the magnet power supply current.- Parameters:
current
- The current in amperes- Throws:
ConnectionException
- if the put channel cannot be connectedPutException
- if the put channel set action fails
-
upperCurrentLimit
get the current lower settable limit (A)- Throws:
GetException
-
lowerCurrentLimit
get the current lower settable limit (A)- Throws:
GetException
-
getNodes
Get the accelerator nodes which are tied to this supply.- Returns:
- The collection of nodes that use this supply.
-
getNodes
Get the subset of nodes from trialNodes which are supplied by this power supply.- Parameters:
trialNodes
- The collection of nodes from which to check for matches.- Returns:
- The collection of nodes that use this supply.
-
getDefaultHandles
- Returns:
- a list with expected channel handles by default.
-
suppliesNode
Check if the electromagnet is supplied by this power supply.- Parameters:
node
- The electromagnet to check- Returns:
- true if the node is supplied by this supply and false otherwise
-
getReadbackHandles
Get the readback handle corresponding to a set channel.- Parameters:
setHandle
- The set handle.- Returns:
- The corresponding readback handle.
-
getSetHandle
Get the set handle corresponding to a readback channel.- Parameters:
readbackHandle
- The readback handle.- Returns:
- The corresponding set handle.
-
getProperties
- Returns:
- properties that can be accessed via EPICS.
-
getAccessibleProperties
- Returns:
- properties that can be accessed via EPICS.
-
getAccessibleProperties
protected List<AccessibleProperty> getAccessibleProperties(List<AccessibleProperty> properties, Class<?> cls)
-