Package xal.smf

Class Accelerator

All Implemented Interfaces:
Comparable, ElementType, DataListener
Direct Known Subclasses:
ESSAccelerator

public class Accelerator extends AcceleratorSeq implements DataListener
The hierarchical tree of accelerator nodes, elements and sequences of elements.
Author:
Nikolay Malitsky, Christopher K. Allen
  • Constructor Details

    • Accelerator

      public Accelerator()
    • Accelerator

      public Accelerator(String sysId)
      Primary constructor
    • Accelerator

      public Accelerator(ChannelFactory channelFactory)
      Primary constructor
    • Accelerator

      public Accelerator(String sysId, ChannelFactory channelFactory)
      Primary constructor
  • Method Details

    • dataLabel

      public 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
    • hasStatusFile

      public boolean hasStatusFile()
    • setStatusFile

      public void setStatusFile(boolean statusFile)
    • hasPowerSuppliesFile

      public boolean hasPowerSuppliesFile()
    • setPowerSuppliesFile

      public void setPowerSuppliesFile(boolean powerSuppliesFile)
    • update

      public void update(DataAdaptor adaptor) throws 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
      Throws:
      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
    • putMagnetMainSupply

      public void putMagnetMainSupply(MagnetMainSupply mainSupply) throws IllegalArgumentException
      Programmatically add or replace a magnet main supply keyed by its ID. If a power supply has the same ID as another power supply in this accelerator then it will replace that one.
      Parameters:
      mainSupply - main power supply to add or replace
      Throws:
      IllegalArgumentException - if the power supply's accelerator does not match this accelerator to which it is being put
    • putMagnetTrimSupply

      public void putMagnetTrimSupply(MagnetTrimSupply trimSupply)
      Programmatically add or replace a magnet trim supply keyed by its ID. If a power supply has the same ID as another power supply in this accelerator then it will replace that one.
      Parameters:
      trimSupply - trim power supply to add or replace
      Throws:
      IllegalArgumentException - if the power supply's accelerator does not match this accelerator to which it is being put
    • 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
    • writePowerSupplies

      public void writePowerSupplies(DataAdaptor adaptor)
      Write power supplies to the given data adaptor, including the accelerator node.
      Parameters:
      adaptor -
    • writeAttributes

      protected void writeAttributes(DataAdaptor adaptor)
      Description copied from class: AcceleratorNode
      write the attributes of the Node. Subclasses can be override this method to write a different set of attributes
      Overrides:
      writeAttributes in class AcceleratorSeq
    • writeStatus

      public void writeStatus(DataAdaptor adaptor)
      method to write status of the node into a separate file
      Overrides:
      writeStatus in class AcceleratorSeq
    • nodeAdded

      protected void nodeAdded(AcceleratorNode node)
      Handle the event indicating that a node has been added.
      Parameters:
      node - the node that has been added
    • nodeRemoved

      protected void nodeRemoved(AcceleratorNode node)
      Handle the event indicating that a node has been removed.
      Parameters:
      node - the node that has been removed
    • getSystemId

      public String getSystemId()
    • getDate

      public String getDate()
    • getVersion

      public 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(String strDate)
    • setVersion

      public void setVersion(String strVer)
    • getNodeFactory

      public AcceleratorNodeFactory getNodeFactory()
      Get the accelerator node factory
    • setNodeFactory

      public void setNodeFactory(AcceleratorNodeFactory nodeFactory)
      Set the factory used to generate new accelerator nodes
    • setElementMapping

      public void setElementMapping(ElementMapping elementMapping)
      Sets the model element mapping used by this accelerator object.
      Parameters:
      elementMapping - the new element mapping
    • getElementMapping

      public ElementMapping getElementMapping()
      Returns the model element mapping currently in use by this accelerator.
      Returns:
      accelerator's model element mapping
    • updateChannelFactory

      public void updateChannelFactory(ChannelFactory channelFactory)
      Updates the channel suites with the new ChannelFactory. This method is useful when running a CA server after the context is disposed.
      Parameters:
      channelFactory - - the new ChannelFactory added by Juan
    • 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

      public void addComboSequence(AcceleratorSeqCombo comboSequence)
      Add a combo sequence to this accelerator
      Parameters:
      comboSequence - The combo sequence to add
    • removeComboSequence

      public void removeComboSequence(String comboSequenceId)
      Remove a combo sequence from this accelerator
      Parameters:
      comboSequenceId - The ID of the combo sequence to remove.
    • getComboSequence

      public AcceleratorSeqCombo getComboSequence(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 List<AcceleratorSeqCombo> 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(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 List<Ring> getRings()
      Get the list of all rings in the accelerator
      Returns:
      a list of all rings in the accelerator
    • findSequence

      public AcceleratorSeq findSequence(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(String nodeID)
      Returns the AcceleratorNode with a requested name
      Parameters:
      nodeID - - the name to match
    • getMagnetMainSupplies

      public Collection<MagnetMainSupply> getMagnetMainSupplies()
      Get the set of all magnet main supplies
      Returns:
      the set of all magnet main supplies
    • getMagnetMainSupply

      public MagnetMainSupply getMagnetMainSupply(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 Collection<MagnetTrimSupply> getMagnetTrimSupplies()
      Get the set of all magnet trim supplies
      Returns:
      the set of all magnet trim supplies
    • getMagnetTrimSupply

      public MagnetTrimSupply getMagnetTrimSupply(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
    • getFieldMapPath

      public String getFieldMapPath()
    • setFieldMapPath

      public void setFieldMapPath(String absoluteUrlSpec)