gov.sns.xal.smf
Class AcceleratorNode

java.lang.Object
  |
  +--gov.sns.xal.smf.AcceleratorNode
All Implemented Interfaces:
DataListener, ElementType
Direct Known Subclasses:
AcceleratorSeq, BLM, BPM, CurrentMonitor, GenericNode, Magnet, ProfileMonitor, RfGap, Vacuum

public abstract class AcceleratorNode
extends java.lang.Object
implements ElementType, DataListener

The base class in the hierarchy of different accelerator node types.


Field Summary
protected  ChannelSuite channelSuite
          channel suite associated with this node
protected  boolean m_bolIsSoft
          Indicator if this node is a "softNode" copy
protected  boolean m_bolStatus
          Indicator as to whether the Accelerator Node is functional
protected  boolean m_bolValid
          Indicator as to whether accelerator node is valid
protected  AlignmentBucket m_bucAlign
          alignment attribute bucket for node
protected  ApertureBucket m_bucAper
          aperture parameters for node
protected  TwissBucket m_bucTwiss
          twiss parameter bucket for node
protected  double m_dblLen
          length of node
protected  double m_dblPos
          position of node
protected  java.util.HashMap m_mapAttrs
          all attribute buckets for node
protected  Accelerator m_objAccel
          the associated Accelerator object
protected  AcceleratorSeq m_seqParent
          parent sequence object
protected  java.lang.String m_strId
          node identifier
 
Constructor Summary
AcceleratorNode(java.lang.String strId)
          base constructor for an Accelector Node
 
Method Summary
 void addBucket(AttributeBucket buc)
          General attribute buckets support
 ChannelSuite channelSuite()
          channel suite accessor
 void clear()
          remove this node from the accelerator hieracrhcy
 java.lang.String dataLabel()
          implement DataListener interface
 Accelerator getAccelerator()
          return the top level accelerator that this node belongs to
 AlignmentBucket getAlign()
          returns the bucket containing the alignment parameters - see attr.AlignBucket
 Channel getAndConnectChannel(java.lang.String handle)
          Get the channel corresponding to the specified handle and connect it.
 ApertureBucket getAper()
          returns the bucket containing the Aperture parameters - see attr.ApertureBucket
 AttributeBucket getBucket(java.lang.String type)
           
 java.util.Collection getBuckets()
           
 Channel getChannel(java.lang.String chanHandle)
          this method returns the Channel object of this node, associated with a prescibed PV name.
 java.util.Collection getHandles()
          accessor to channel suite handles
 java.lang.String getId()
          return the ID of this node
 double getLength()
          return the physical length of this node (m)
 AcceleratorNode getParent()
          return the parent sequence that this node belongs to
 double getPosition()
          return the position of this node, along the reference orbit within its sequence (m)
 boolean getStatus()
          Runtime indication of accelerator component operation
 TwissBucket getTwiss()
          returns the bucket containing the twiss parameters - see attr.TwissBucket
abstract  java.lang.String getType()
          Derived class must furnish a unique type id
 boolean getValid()
          Runtime indication of the validatity of component operation
 boolean hasBucket(AttributeBucket bucket)
           
 boolean hasParent()
          Indicates if the node has a parent set
 boolean isKindOf(java.lang.String compType)
          Determine if a node is of the specified type.
 boolean isMagnet()
          Determine if the node is a magnet.
 Channel lazilyGetAndConnect(java.lang.String chanHandle, Channel channel)
          A method to make an EPICS ca connection for a given PV name The channel connection is initiated, and no extra work is done, if the channel connection already exists
protected  void removeFromParent()
          remove this node from its immediate parent sequence
protected  void setAccelerator(Accelerator accel)
          set the top level accelerator for this node
 void setAlign(AlignmentBucket buc)
          sets the bucket containing the twiss parameters - see attr.TwissBucket
 void setAper(ApertureBucket buc)
          sets the bucket containing the Aperture parameters - see attr.ApertureBucket
 void setLength(double dblLen)
           
protected  void setParent(AcceleratorSeq parent)
          define the parent sequence for this node
 void setPosition(double dblPos)
           
 void setStatus(boolean bolStatus)
          Runtime indication of accelerator operation
 void setTwiss(TwissBucket buc)
          sets the bucket containing the alignment parameters - see attr.AlignBucket
 void setValid(boolean bolValid)
          Runtime indication of the validatity of component operation
 java.lang.String toString()
          Identify the node by its unique ID
 void update(DataAdaptor adaptor)
          implement DataListener interface
 void write(DataAdaptor adaptor)
          implement DataListener interface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_strId

protected java.lang.String m_strId
node identifier


m_dblPos

protected double m_dblPos
position of node


m_dblLen

protected double m_dblLen
length of node


m_seqParent

protected AcceleratorSeq m_seqParent
parent sequence object


m_objAccel

protected Accelerator m_objAccel
the associated Accelerator object


m_mapAttrs

protected java.util.HashMap m_mapAttrs
all attribute buckets for node


m_bucAlign

protected AlignmentBucket m_bucAlign
alignment attribute bucket for node


m_bucTwiss

protected TwissBucket m_bucTwiss
twiss parameter bucket for node


m_bucAper

protected ApertureBucket m_bucAper
aperture parameters for node


m_bolStatus

protected boolean m_bolStatus
Indicator as to whether the Accelerator Node is functional


m_bolValid

protected boolean m_bolValid
Indicator as to whether accelerator node is valid


m_bolIsSoft

protected boolean m_bolIsSoft
Indicator if this node is a "softNode" copy


channelSuite

protected ChannelSuite channelSuite
channel suite associated with this node

Constructor Detail

AcceleratorNode

public AcceleratorNode(java.lang.String strId)
base constructor for an Accelector Node

Parameters:
strId - the string ID for this node
Method Detail

getType

public abstract java.lang.String getType()
Derived class must furnish a unique type id


dataLabel

public java.lang.String dataLabel()
implement DataListener interface

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

update

public void update(DataAdaptor adaptor)
            throws java.lang.NumberFormatException
implement DataListener interface

Specified by:
update in interface DataListener
Parameters:
adaptor - The adaptor from which to update the data
java.lang.NumberFormatException

write

public void write(DataAdaptor adaptor)
implement DataListener interface

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

toString

public java.lang.String toString()
Identify the node by its unique ID

Overrides:
toString in class java.lang.Object

getChannel

public Channel getChannel(java.lang.String chanHandle)
                   throws NoSuchChannelException
this method returns the Channel object of this node, associated with a prescibed PV name. Note - xal interacts with EPICS via Channel objects.

Parameters:
chanHandle - The handle to the epics channel in stored in the channel suite
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

lazilyGetAndConnect

public Channel lazilyGetAndConnect(java.lang.String chanHandle,
                                   Channel channel)
                            throws ConnectionException,
                                   NoSuchChannelException
A method to make an EPICS ca connection for a given PV name The channel connection is initiated, and no extra work is done, if the channel connection already exists

ConnectionException
NoSuchChannelException

getId

public java.lang.String getId()
return the ID of this node


getLength

public double getLength()
return the physical length of this node (m)


getPosition

public double getPosition()
return the position of this node, along the reference orbit within its sequence (m)


getAccelerator

public Accelerator getAccelerator()
return the top level accelerator that this node belongs to


getParent

public AcceleratorNode getParent()
return the parent sequence that this node belongs to


hasParent

public boolean hasParent()
Indicates if the node has a parent set


getStatus

public boolean getStatus()
Runtime indication of accelerator component operation

Returns:
true(up and running) false(down)

getValid

public boolean getValid()
Runtime indication of the validatity of component operation

Returns:
true(valid operation) false(questionable operation)

setPosition

public void setPosition(double dblPos)

setLength

public void setLength(double dblLen)

setStatus

public void setStatus(boolean bolStatus)
Runtime indication of accelerator operation

Parameters:
bolStatus - true(up and running) false(down)

setValid

public void setValid(boolean bolValid)
Runtime indication of the validatity of component operation

Parameters:
bolValid - true(valid operation) false(questionable operation)

addBucket

public void addBucket(AttributeBucket buc)
General attribute buckets support


getBuckets

public java.util.Collection getBuckets()

getBucket

public AttributeBucket getBucket(java.lang.String type)

hasBucket

public boolean hasBucket(AttributeBucket bucket)

getTwiss

public TwissBucket getTwiss()
returns the bucket containing the twiss parameters - see attr.TwissBucket


getAlign

public AlignmentBucket getAlign()
returns the bucket containing the alignment parameters - see attr.AlignBucket


getAper

public ApertureBucket getAper()
returns the bucket containing the Aperture parameters - see attr.ApertureBucket


setAlign

public void setAlign(AlignmentBucket buc)
sets the bucket containing the twiss parameters - see attr.TwissBucket


setTwiss

public void setTwiss(TwissBucket buc)
sets the bucket containing the alignment parameters - see attr.AlignBucket


setAper

public void setAper(ApertureBucket buc)
sets the bucket containing the Aperture parameters - see attr.ApertureBucket


clear

public void clear()
remove this node from the accelerator hieracrhcy


removeFromParent

protected void removeFromParent()
remove this node from its immediate parent sequence


setParent

protected void setParent(AcceleratorSeq parent)
define the parent sequence for this node


setAccelerator

protected void setAccelerator(Accelerator accel)
set the top level accelerator for this node


channelSuite

public ChannelSuite channelSuite()
channel suite accessor


getHandles

public java.util.Collection getHandles()
accessor to channel suite handles


isKindOf

public boolean isKindOf(java.lang.String compType)
Determine if a node is of the specified type. The comparison is based upon the node's class and the element type manager handles checking for inherited classes to types get inherited. Subclasses can override this method if the types comparison is more complicated (e.g. if more than one type can be associated with the same node class).

Specified by:
isKindOf in interface ElementType
Parameters:
compType - The type against which to compare.
Returns:
true if the node is of the specified type; false otherwise.

isMagnet

public boolean isMagnet()
Determine if the node is a magnet.

Specified by:
isMagnet in interface ElementType
Returns:
true if the node is a magnet; false other.