gov.sns.xal.smf
Class Accelerator

java.lang.Object
  |
  +--gov.sns.xal.smf.AcceleratorNode
        |
        +--gov.sns.xal.smf.AcceleratorSeq
              |
              +--gov.sns.xal.smf.Accelerator
All Implemented Interfaces:
DataListener, ElementType

public class Accelerator
extends AcceleratorSeq
implements DataListener

The hierarchical tree of accelerator nodes, elements and sequences of elements.


Nested Class Summary
static interface Accelerator.EditContextPost
          Interface for posting change of default edit context
 
Field Summary
protected  java.util.Map _comboSequences
          Map of predefined combo sequences mapped by combo sequence ID
protected  java.util.Map magnetMainSupplies
          Map of main power supplies keyed by the power supply id
protected  java.util.Map magnetTrimSupplies
          Map of trim power supplies keyed by the power supply id
 
Fields inherited from class gov.sns.xal.smf.AcceleratorSeq
m_arrNodes, m_bucSequence, nodeTable, s_strType
 
Fields inherited from class gov.sns.xal.smf.AcceleratorNode
channelSuite, m_bolIsSoft, m_bolStatus, m_bolValid, m_bucAlign, m_bucAper, m_bucTwiss, m_dblLen, m_dblPos, m_mapAttrs, m_objAccel, m_seqParent, m_strId
 
Constructor Summary
Accelerator()
           
Accelerator(java.lang.String sysId)
          Primary constructor
 
Method Summary
protected  void addComboSequence(AcceleratorSeqCombo comboSequence)
          Add a combo sequence generated from the comboAdaptor
 java.lang.String dataLabel()
          dataLabel() provides the name used to identify the accelerator in an external data source.
 EditContext editContext()
          Get this accelerator's edit context
 AcceleratorSeq findSequence(java.lang.String sequenceID)
          Find a sequence with the specified ID.
 Accelerator getAccelerator()
          return the top level accelerator that this node belongs to
 AcceleratorSeqCombo getComboSequence(java.lang.String comboID)
          Fetch the predefined combo sequence based on its ID
 java.util.List getComboSequences()
          Get the list of predefined combo sequences ordered by ID.
 java.lang.String getDate()
           
 java.util.Collection getMagnetMainSupplies()
          Get the set of all magnet main supplies
 MagnetMainSupply getMagnetMainSupply(java.lang.String supplyId)
          Get a main power supply whose id is supplyId
 java.util.Collection getMagnetTrimSupplies()
          Get the set of all magnet trim supplies
 MagnetTrimSupply getMagnetTrimSupply(java.lang.String supplyId)
          Get a main power supply whose id is supplyId
 AcceleratorNode getNode(java.lang.String strId)
          Returns the AcceleratorNode with a requsted name
 Ring getRing(java.lang.String ringID)
          Get the ring in this accelerator with the specified ID
 java.util.List getRings()
          Get the list of all rings in the accelerator
 AcceleratorSeq getRoot()
           
 java.lang.String getSystemId()
           
 TimingCenter getTimingCenter()
          Get this accelerator's timing center
 java.lang.String getVersion()
           
protected  void nodeAdded(AcceleratorNode p_node)
          Handle the event indicating that a node has been added.
protected  void nodeRemoved(AcceleratorNode p_node)
          Handle the event indicating that a node has been removed.
 void setDate(java.lang.String strDate)
           
 void setEditContext(EditContext newContext)
          Set this accelerator's edit context
 void setTimingCenter(TimingCenter timingCenter)
          Set this accelerator's timing center
 void setVersion(java.lang.String strVer)
           
 void update(DataAdaptor adaptor)
          Instructs the accelerator to update its data based on the given adaptor.
protected  void updatePowerSupplies(DataAdaptor adaptor)
          Update the power supplies given the power supply adaptor
 void write(DataAdaptor adaptor)
          Instructs the accelerator to write its data to the adaptor for external storage.
 
Methods inherited from class gov.sns.xal.smf.AcceleratorSeq
addBucket, addNode, addNodeAt, addSequenceChain, addSoft, canPrecede, contains, formsRing, getAllNodes, getAllNodesOfType, getAllNodesWithQualifier, getAllSeqs, getIndexOfNode, getLeaves, getLength, getNodeAt, getNodeCount, getNodes, getNodesOfType, getNodesWithQualifier, getNodesWithQualifier, getNodeWithId, getPosition, getPredecessors, getSequence, getSequenceBuc, getSequences, getType, indexToAddNode, isLinear, orderSequences, recurNodeSearch, recurSeqSearch, removeAllNodes, removeNode, setSequence, sortNodes
 
Methods inherited from class gov.sns.xal.smf.AcceleratorNode
channelSuite, clear, getAlign, getAndConnectChannel, getAper, getBucket, getBuckets, getChannel, getHandles, getId, getParent, getPosition, getStatus, getTwiss, getValid, hasBucket, hasParent, isKindOf, isMagnet, lazilyGetAndConnect, removeFromParent, setAccelerator, setAlign, setAper, setLength, setParent, setPosition, setStatus, setTwiss, setValid, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_comboSequences

protected java.util.Map _comboSequences
Map of predefined combo sequences mapped by combo sequence ID


magnetMainSupplies

protected java.util.Map magnetMainSupplies
Map of main power supplies keyed by the power supply id


magnetTrimSupplies

protected java.util.Map magnetTrimSupplies
Map of trim power supplies keyed by the power supply id

Constructor Detail

Accelerator

public Accelerator()

Accelerator

public Accelerator(java.lang.String sysId)
Primary constructor

Method Detail

dataLabel

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

Specified by:
dataLabel in interface DataListener
Overrides:
dataLabel in class AcceleratorSeq
Returns:
The accelerator's tag

update

public void update(DataAdaptor adaptor)
            throws java.lang.NumberFormatException
Instructs the accelerator to update its data based on the given adaptor.

Specified by:
update in interface DataListener
Overrides:
update in class AcceleratorSeq
Parameters:
adaptor - The adaptor from which to update the accelerator's data
java.lang.NumberFormatException

updatePowerSupplies

protected void updatePowerSupplies(DataAdaptor adaptor)
Update the power supplies given the power supply adaptor

Parameters:
adaptor - The adaptor for the accelerator power supplies

write

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

Specified by:
write in interface DataListener
Overrides:
write in class AcceleratorSeq
Parameters:
adaptor - The adaptor to which the accelerator's data is written

nodeAdded

protected void nodeAdded(AcceleratorNode p_node)
Handle the event indicating that a node has been added.

Parameters:
p_node - the node that has been added

nodeRemoved

protected void nodeRemoved(AcceleratorNode p_node)
Handle the event indicating that a node has been removed.

Parameters:
p_node - the node that has been removed

getSystemId

public java.lang.String getSystemId()

getDate

public java.lang.String getDate()

getVersion

public java.lang.String getVersion()

getRoot

public AcceleratorSeq getRoot()

getAccelerator

public Accelerator getAccelerator()
Description copied from class: AcceleratorNode
return the top level accelerator that this node belongs to

Overrides:
getAccelerator in class AcceleratorNode

setDate

public void setDate(java.lang.String strDate)

setVersion

public void setVersion(java.lang.String strVer)

editContext

public EditContext editContext()
Get this accelerator's edit context

Returns:
This accelerator's edit context

setEditContext

public void setEditContext(EditContext newContext)
Set this accelerator's edit context

Parameters:
newContext - the accelerator's new edit context

getTimingCenter

public TimingCenter getTimingCenter()
Get this accelerator's timing center

Returns:
This accelerator's timing center

setTimingCenter

public void setTimingCenter(TimingCenter timingCenter)
Set this accelerator's timing center

Parameters:
timingCenter - the accelerator's new timing center

addComboSequence

protected void addComboSequence(AcceleratorSeqCombo comboSequence)
Add a combo sequence generated from the comboAdaptor


getComboSequence

public AcceleratorSeqCombo getComboSequence(java.lang.String comboID)
Fetch the predefined combo sequence based on its ID

Parameters:
comboID - the id identifying the combo sequence
Returns:
the combo sequence for the ID or null if none matches

getComboSequences

public java.util.List getComboSequences()
Get the list of predefined combo sequences ordered by ID.

Returns:
the list of predefined combo sequences ordered by ID.

getRing

public Ring getRing(java.lang.String ringID)
Get the ring in this accelerator with the specified ID

Parameters:
ringID - the ID of the ring to get
Returns:
the ring in this accelerator with the specified ID or null if none exists

getRings

public java.util.List getRings()
Get the list of all rings in the accelerator

Returns:
a list of all rings in the accelerator

findSequence

public AcceleratorSeq findSequence(java.lang.String sequenceID)
Find a sequence with the specified ID. The sequence may either be a direct child sequence or a predefined combo sequence.

Parameters:
sequenceID - the id identifying the desired sequence
Returns:
the sequence for the ID or null if none matches

getNode

public AcceleratorNode getNode(java.lang.String strId)
Returns the AcceleratorNode with a requsted name

Parameters:
strId - - the name to match

getMagnetMainSupplies

public java.util.Collection getMagnetMainSupplies()
Get the set of all magnet main supplies

Returns:
the set of all magnet main supplies

getMagnetMainSupply

public MagnetMainSupply getMagnetMainSupply(java.lang.String supplyId)
Get a main power supply whose id is supplyId

Parameters:
supplyId - The id of the main power supply to get
Returns:
The main power supply or null if the supplyId is not found

getMagnetTrimSupplies

public java.util.Collection getMagnetTrimSupplies()
Get the set of all magnet trim supplies

Returns:
the set of all magnet trim supplies

getMagnetTrimSupply

public MagnetTrimSupply getMagnetTrimSupply(java.lang.String supplyId)
Get a main power supply whose id is supplyId

Parameters:
supplyId - The id of the main power supply to get
Returns:
The main power supply or null if the supplyId is not found