gov.sns.xal.smf.impl
Class MagnetPowerSupply

java.lang.Object
  |
  +--gov.sns.xal.smf.impl.MagnetPowerSupply
All Implemented Interfaces:
DataListener
Direct Known Subclasses:
MagnetMainSupply, MagnetTrimSupply

public abstract class MagnetPowerSupply
extends java.lang.Object
implements DataListener

PowerSupply is the abstract super class of all power supplies.


Field Summary
protected  Accelerator accelerator
           
protected  ChannelSuite channelSuite
           
static java.lang.String CURRENT_RB_HANDLE
           
static java.lang.String CURRENT_SET_HANDLE
           
static int CYCLE_INVALID
           
static java.lang.String CYCLE_STATE_HANDLE
           
static int CYCLE_VALID
           
static int CYCLING
           
protected  java.lang.String strId
           
 
Constructor Summary
MagnetPowerSupply(Accelerator anAccelerator)
          Creates a new instance of PowerSupply
 
Method Summary
 java.lang.String dataLabel()
          dataLabel() provides the name used to identify the class in an external data source.
 Channel getAndConnectChannel(java.lang.String handle)
          Get the channel corresponding to the specified handle and connect it.
 Channel getChannel(java.lang.String handle)
          Get the channel for the specified handle.
 ChannelSuite getChannelSuite()
          Get the channel suite.
 double getCurrent()
          Get the magnet power supply current
 int getCycleState()
          Gets the cycle state of the magnet.
 java.lang.String getId()
          Get the unique power supply ID
 java.util.Collection getNodes()
          Get the accelerator nodes which are tied to this supply.
 java.util.Collection getNodes(java.util.Collection trialNodes)
          Get the subset of nodes from trialNodes which are supplied by this power supply.
abstract  java.lang.String getType()
          Get the power supply type
 double lowerCurrentLimit()
          get the current lower settable limit (A)
 void setCurrent(double current)
          Set the magnet power supply current.
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 upperCurrentLimit()
          get the current lower settable limit (A)
 void write(DataAdaptor adaptor)
          Instructs the receiver to write its data to the adaptor for external storage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

accelerator

protected Accelerator accelerator

channelSuite

protected ChannelSuite channelSuite

strId

protected java.lang.String strId

CYCLE_INVALID

public static final int CYCLE_INVALID
See Also:
Constant Field Values

CYCLING

public static final int CYCLING
See Also:
Constant Field Values

CYCLE_VALID

public static final int CYCLE_VALID
See Also:
Constant Field Values

CYCLE_STATE_HANDLE

public static final java.lang.String CYCLE_STATE_HANDLE
See Also:
Constant Field Values

CURRENT_SET_HANDLE

public static final java.lang.String CURRENT_SET_HANDLE
See Also:
Constant Field Values

CURRENT_RB_HANDLE

public static final java.lang.String CURRENT_RB_HANDLE
See Also:
Constant Field Values
Constructor Detail

MagnetPowerSupply

public MagnetPowerSupply(Accelerator anAccelerator)
Creates a new instance of PowerSupply

Method Detail

getId

public java.lang.String getId()
Get the unique power supply ID

Returns:
The power supply ID

getType

public abstract java.lang.String getType()
Get the power supply type

Returns:
The power supply type

dataLabel

public java.lang.String dataLabel()
dataLabel() provides the name used to identify the class in an external data source.

Specified by:
dataLabel in interface DataListener
Returns:
a tag that identifies the receiver's type

update

public void update(DataAdaptor adaptor)
Instructs the receiver to update its data based on the given adaptor.

Specified by:
update in interface DataListener
Parameters:
adaptor - The adaptor from which to update the receiver's data

write

public void write(DataAdaptor adaptor)
Instructs the receiver to write its data to the adaptor for external storage.

Specified by:
write in interface DataListener
Parameters:
adaptor - The adaptor to which the receiver's data is written

getChannelSuite

public ChannelSuite getChannelSuite()
Get the channel suite.

Returns:
the channel suite.

getChannel

public Channel getChannel(java.lang.String handle)
                   throws NoSuchChannelException
Get the channel for the specified handle.

Parameters:
handle - The handle for the channel to fetch
Returns:
the channel
NoSuchChannelException

getAndConnectChannel

public Channel getAndConnectChannel(java.lang.String handle)
                             throws NoSuchChannelException,
                                    ConnectionException
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

public int getCycleState()
                  throws ConnectionException,
                         GetException
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
ConnectionException
GetException

getCurrent

public double getCurrent()
                  throws ConnectionException,
                         GetException
Get the magnet power supply current

Returns:
the magnet power supply current in amperes
Throws:
ConnectionException - if the readback channel cannot be connected
GetException - if the readback channel get action fails

setCurrent

public void setCurrent(double current)
                throws ConnectionException,
                       PutException
Set the magnet power supply current.

Parameters:
current - The current in amperes
Throws:
ConnectionException - if the put channel cannot be connected
PutException - if the put channel set action fails

upperCurrentLimit

public double upperCurrentLimit()
                         throws ConnectionException,
                                GetException
get the current lower settable limit (A)

ConnectionException
GetException

lowerCurrentLimit

public double lowerCurrentLimit()
                         throws ConnectionException,
                                GetException
get the current lower settable limit (A)

ConnectionException
GetException

getNodes

public java.util.Collection getNodes()
Get the accelerator nodes which are tied to this supply.

Returns:
The collection of nodes that use this supply.

getNodes

public java.util.Collection getNodes(java.util.Collection trialNodes)
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.

suppliesNode

public abstract boolean suppliesNode(AcceleratorNode node)
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