Package xal.sim.sync

Class SynchronizationManager

java.lang.Object
xal.sim.sync.SynchronizationManager

public class SynchronizationManager extends Object
Manages synchronization mappings between accelerator node proxies and lattice elements.
Author:
Craig McChesney
  • Field Details

  • Constructor Details

    • SynchronizationManager

      public SynchronizationManager()
  • Method Details

    • syncModes

      public static List<String> syncModes()
    • setSynchronizationMode

      public void setSynchronizationMode(String newMode)
      Set the synchronization mode
    • getSynchronizationMode

      public String getSynchronizationMode()
      Get the synchronization mode
    • resync

      public void resync() throws SynchronizationException
      Throws:
      SynchronizationException
    • resyncFromCache

      public void resyncFromCache() throws SynchronizationException
      use the cached values modified by the model inputs and resync the model
      Throws:
      SynchronizationException
    • resync

      public static void resync(IComponent aComp, Map<String,Double> valueMap) throws SynchronizationException
      Synchronizes anElem to the property values contained in valueMap.
      Parameters:
      aComp - element to synchronize
      valueMap - a Map whose keys are property names and values are String property values
      Throws:
      SynchronizationException
    • synchronize

      public void synchronize(IComponent aComp, AcceleratorNode aNode)
      Creates a synchronization between the specified element and accelerator node. Request is ignored if there is no synchronizer for the specified element type. Request is also ignored if there is no accessor for the specified node type, because the system doesn't know how to access data from that type of node.
      Parameters:
      aComp - the lattice component to create synchronization for
      aNode - the accelerator node to synchronize the element with
    • propertiesForNode

      public Map<String,Double> propertiesForNode(AcceleratorNode aNode)
    • allComponentsMappedTo

      public List<IComponent> allComponentsMappedTo(AcceleratorNode aNode)
    • synchronizedComponentsMappedTo

      protected List<IComponent> synchronizedComponentsMappedTo(AcceleratorNode aNode)
    • setModelInput

      public ModelInput setModelInput(AcceleratorNode aNode, String property, double value)
      Sets the specified node's property to the specified value. Replaces the existing value if there is one.
      Parameters:
      aNode - node whose property to set
      property - name of property to set
      value - double value for property
    • getModelInput

      public ModelInput getModelInput(AcceleratorNode aNode, String propName)
      Returns the ModelInput for the specified node's property.
      Parameters:
      aNode - node whose property to get a ModelInput for
      propName - name of property to get a ModelInput for
    • removeModelInput

      public void removeModelInput(AcceleratorNode aNode, String property)
    • debugPrint

      protected void debugPrint()
    • checkSynchronization

      public boolean checkSynchronization(AcceleratorNode aNode, Map<String,Double> values) throws SynchronizationException
      Throws:
      SynchronizationException