Package xal.sim.sync
Class SynchronizationManager
java.lang.Object
xal.sim.sync.SynchronizationManager
Manages synchronization mappings between accelerator node proxies and lattice
elements.
- Author:
- Craig McChesney
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkSynchronization
(AcceleratorNode aNode, Map<String, Double> values) protected void
getModelInput
(AcceleratorNode aNode, String propName) Returns the ModelInput for the specified node's property.Get the synchronization modepropertiesForNode
(AcceleratorNode aNode) void
removeModelInput
(AcceleratorNode aNode, String property) void
resync()
static void
resync
(IComponent aComp, Map<String, Double> valueMap) Synchronizes anElem to the property values contained in valueMap.void
use the cached values modified by the model inputs and resync the modelsetModelInput
(AcceleratorNode aNode, String property, double value) Sets the specified node's property to the specified value.void
setSynchronizationMode
(String newMode) Set the synchronization modevoid
synchronize
(IComponent aComp, AcceleratorNode aNode) Creates a synchronization between the specified element and accelerator node.protected List<IComponent>
-
Field Details
-
DEFAULT_SYNC_MODE
- See Also:
-
-
Constructor Details
-
SynchronizationManager
public SynchronizationManager()
-
-
Method Details
-
syncModes
-
setSynchronizationMode
Set the synchronization mode -
getSynchronizationMode
Get the synchronization mode -
resync
- Throws:
SynchronizationException
-
resyncFromCache
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 SynchronizationExceptionSynchronizes anElem to the property values contained in valueMap.- Parameters:
aComp
- element to synchronizevalueMap
- a Map whose keys are property names and values are String property values- Throws:
SynchronizationException
-
synchronize
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 foraNode
- the accelerator node to synchronize the element with
-
propertiesForNode
-
allComponentsMappedTo
-
synchronizedComponentsMappedTo
-
setModelInput
Sets the specified node's property to the specified value. Replaces the existing value if there is one.- Parameters:
aNode
- node whose property to setproperty
- name of property to setvalue
- double value for property
-
getModelInput
Returns the ModelInput for the specified node's property.- Parameters:
aNode
- node whose property to get a ModelInput forpropName
- name of property to get a ModelInput for
-
removeModelInput
-
debugPrint
protected void debugPrint() -
checkSynchronization
public boolean checkSynchronization(AcceleratorNode aNode, Map<String, Double> values) throws SynchronizationException- Throws:
SynchronizationException
-