|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.xal.model.scenario.Scenario
Packages an on-line model scenario, including accelerator node proxy manager, lattice, probe, and synchronization manager.
| Field Summary | |
static java.lang.String |
SYNC_MODE_DESIGN
|
static java.lang.String |
SYNC_MODE_LIVE
|
static java.lang.String |
SYNC_MODE_RF_DESIGN
|
| Constructor Summary | |
protected |
Scenario(AcceleratorSeq aSeq,
Lattice aLattice,
SynchronizationManager aSyncMgr)
|
| Method Summary | |
boolean |
checkSynchronization(AcceleratorNode aNode,
java.util.Map values)
|
java.util.List |
elementsMappedTo(AcceleratorNode aNode)
Returns a List of elements mapped to the specified node. |
Lattice |
getLattice()
Returns the lattice. |
ModelInput |
getModelInput(AcceleratorNode aNode,
java.lang.String propName)
Returns the ModelInput for the specified node's property. |
Probe |
getProbe()
Returns the scenario's current probe, or null if there is none. |
java.lang.String |
getStartElementId()
Return the string identifier of the modeling element where propagation starts. |
java.lang.String |
getStopElementId()
Return the string identifier of the modeling element where propagation stops. |
Trajectory |
getTrajectory()
Returns the trajectory obtained by running the model. |
static Scenario |
newAndImprovedScenarioFor(AcceleratorSeq aSeq)
|
static Scenario |
newScenarioFor(AcceleratorSeq smfSeq)
Creates a new Scenario for the supplied accelerator sequence. |
static Scenario |
newScenarioFor(Ring smfRing)
Creates a new Scenario object for the explicit case where
the AcceleratorSeq object is of type
gov.sns.xal.smf.Ring. |
AcceleratorNode |
nodeWithId(java.lang.String id)
Returns the accelerator node with the specified id, or null if there is none. |
java.util.Map |
propertiesForNode(AcceleratorNode aNode)
Returns a map of property values (key = String property name, value = double property value) for the supplied node. |
void |
removeModelInput(AcceleratorNode aNode,
java.lang.String property)
Removes the model input for the specified property on the specified node, if there is one. |
void |
resetProbe()
Resets the probe to its initial state - before propagation (e.g., the state specified in the probe xml file). |
void |
resync()
Synchronizes each lattice element to the appropriate data source. |
void |
run()
Runs the model (propagate probe through lattice). |
ModelInput |
setModelInput(AcceleratorNode aNode,
java.lang.String propName,
double val)
Sets the specified node's property to the specified value. |
void |
setProbe(Probe aProbe)
Sets the supplied probe for this scenario. |
void |
setStartElement(IElement start)
Sets the model to start propagation from the specified IElement. |
void |
setStartElementId(java.lang.String elemId)
Set the "start" element by String id |
void |
setStartNode(java.lang.String nodeId)
Sets the model to start propagation from the AcceleratorNode with the specified id. |
void |
setStopElement(IElement stop)
Sets the model to stop propagation before the specified IElement. |
void |
setStopElementId(java.lang.String elemId)
Set the "stop" element by String id |
void |
setStopNode(java.lang.String nodeId)
Sets the model to stop propagation before the AcceleratorNode with the specified id. |
void |
setSynchronizationMode(java.lang.String newMode)
Sets the synchronization mode for the sync manager to a known sync mode, such as SynchronizationManager.SYNC_MODE_LIVE or SYNC_MODE_DESIGN. |
ProbeState[] |
trajectoryStatesForElement(java.lang.String id)
Returns an array of the trajectory states for the specified element id. |
void |
unsetStartNode()
remove previously set Start point |
void |
unsetStopNode()
remove previously set Stop point |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String SYNC_MODE_LIVE
public static final java.lang.String SYNC_MODE_DESIGN
public static final java.lang.String SYNC_MODE_RF_DESIGN
| Constructor Detail |
protected Scenario(AcceleratorSeq aSeq,
Lattice aLattice,
SynchronizationManager aSyncMgr)
| Method Detail |
public static Scenario newScenarioFor(AcceleratorSeq smfSeq)
throws ModelException
smfSeq - the accelerator sequence to build a scenario for
ModelException - error building Scenario
public static Scenario newScenarioFor(Ring smfRing)
throws ModelException
Scenario object for the explicit case where
the AcceleratorSeq object is of type
gov.sns.xal.smf.Ring.
smfRing - target hardware (SMF) ring object
Scenario object encapsulating ring
ModelException - unable to build modeling scenario
public static Scenario newAndImprovedScenarioFor(AcceleratorSeq aSeq)
throws ModelException
ModelExceptionpublic void setSynchronizationMode(java.lang.String newMode)
newMode - String specifying mode to set to
java.lang.IllegalArgumentException - if the specified mode is unknown
public void resync()
throws SynchronizationException
SynchronizationException - if an error is encountered reading a data source
public void setStartNode(java.lang.String nodeId)
throws ModelException
nodeId - ID of AcceleratorNode to start from
ModelException - if the node is not found, or no elements are mapped
to it
public void setStopNode(java.lang.String nodeId)
throws ModelException
nodeId - ID of the AcceleratorNode to stop after
ModelException - if the node is not found, or no elements are mapped to itpublic void setStartElement(IElement start)
start - Element to start propagation frompublic void setStopElement(IElement stop)
stop - Element to stop propagation after
public void run()
throws ModelException
ModelException - if there is an error propagating the probe
java.lang.IllegalStateException - if the lattice or probe is not properly initializedpublic Lattice getLattice()
public Trajectory getTrajectory()
java.lang.IllegalStateException - if the probe or trajectory is null
public java.util.Map propertiesForNode(AcceleratorNode aNode)
throws SynchronizationException
aNode - AcceleratorNode whose properties to get
ModelException - if error getting properties
java.lang.IllegalArgumentException - if aNode is null
SynchronizationExceptionpublic AcceleratorNode nodeWithId(java.lang.String id)
id - String id of the node to return
public java.util.List elementsMappedTo(AcceleratorNode aNode)
aNode - node to get elements mapped to
public ProbeState[] trajectoryStatesForElement(java.lang.String id)
throws ModelException
id - element id to find states for
ModelException - if the probe is not yet propagatedpublic java.lang.String getStartElementId()
public void setStartElementId(java.lang.String elemId)
elemId - Start element Idpublic java.lang.String getStopElementId()
public void setStopElementId(java.lang.String elemId)
elemId - Stop element Id
public ModelInput setModelInput(AcceleratorNode aNode,
java.lang.String propName,
double val)
aNode - node whose property to setpropName - name of property to setval - double value for property
public ModelInput getModelInput(AcceleratorNode aNode,
java.lang.String propName)
aNode - node whose property to get a ModelInput forpropName - name of property to get a ModelInput for
public void removeModelInput(AcceleratorNode aNode,
java.lang.String property)
aNode - node whose input to removeproperty - name of property whose input to removepublic void setProbe(Probe aProbe)
aProbe - the probe to be used by the scenariopublic Probe getProbe()
public void resetProbe()
public boolean checkSynchronization(AcceleratorNode aNode,
java.util.Map values)
throws SynchronizationException
SynchronizationExceptionpublic void unsetStartNode()
public void unsetStopNode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||