public class ModelProxy
extends java.lang.Object
accelerator sequence
, to run the model, to synchronize the model with the real accelerator,
and to extract results from a model run.Modifier and Type | Field and Description |
---|---|
protected AcceleratorSeq |
acceleratorSequence |
static int |
DIAGNOSTIC_PROBE
Probe type indicating a diagnostic probe.
|
static int |
ENSEMBLE_PROBE
Probe type indicating an ensemble probe.
|
static int |
ENVELOPE_PROBE
Probe type indicating an envelope probe.
|
static java.lang.String |
PARAMSRC_DESIGN |
static java.lang.String |
PARAMSRC_LIVE |
static java.lang.String |
PARAMSRC_RF_DESIGN |
static int |
PARTICLE_PROBE
Probe type indicating a particle probe.
|
protected Probe<?> |
probe |
protected Scenario |
scenario |
static int |
TRANSFERMAP_PROBE |
Constructor and Description |
---|
ModelProxy()
Create a new (empty) model proxy.
|
ModelProxy(java.lang.String paramSrc)
Create a new (empty) model proxy.
|
Modifier and Type | Method and Description |
---|---|
void |
addModelProxyListener(ModelProxyListener listener)
Add a ModelProxyListener to the internal list of event listeners.
|
void |
checkLattice()
Check whether the model proxy has a valid lattice and take actions.
|
void |
checkProbe()
Check wether the model proxy has a valid probe and take actions.
|
AcceleratorSeq |
getAcceleratorSequence()
Returns last selected sequence.
|
java.lang.String |
getChannelSource()
Getter for the channel source flag
|
protected ModelProxyListener[] |
getModelProxyListeners()
Getter for the ModelProxyListener event list property.
|
Lattice |
getOnLineModelLattice()
Getter for the
on-line-model lattice property. |
org.w3c.dom.Document |
getOnLineModelLatticeAsDocument()
Getter for the
on-line-model lattice property. |
Probe<?> |
getProbe()
Getter for the on-line-model
probe property. |
org.w3c.dom.Document |
getProbeAsDocument()
Getter for the probe DOM property.
|
java.io.File |
getProbeMasterFile()
Getter for the xml-file defining the probe.
|
int |
getProbeType()
Getter for the probe type.
|
boolean |
hasLattice()
Test the model proxy for a valid lattice.
|
boolean |
hasProbe()
Test the model proxy for a valid probe.
|
protected boolean |
isProbePropagated()
Returns true if the probe has been propagated, false otherwise.
|
protected void |
notifyListeners(int cause)
Notify registered ModelProxyListeners.
|
void |
removeModelProxyListener(ModelProxyListener listener)
Remove a ModelProxyListener from the internal list of event listeners.
|
void |
resetProbe()
Reset the probe to its initial values.
|
void |
runModel()
Run the model.
|
void |
setAcceleratorSeq(AcceleratorSeq seq)
Setter for the
accelerator sequence property. |
boolean |
setChannelSource(java.lang.String src)
Setter for the data source flag.
|
void |
setNewProbe(java.io.File probeFile)
Setter for the
probe property. |
void |
setNewProbe(Probe<?> aProbe)
Setter for a new probe.
|
ProbeState<?> |
stateForElement(java.lang.String id)
Find the probe's state for a given
accelerator node . |
ProbeState<?>[] |
statesForElement(java.lang.String id)
Find all probe states for a given
accelerator node . |
void |
synchronizeAcceleratorSeq()
Synchronize the model with according to current sync mode.
|
protected AcceleratorSeq acceleratorSequence
protected Scenario scenario
protected Probe<?> probe
public static final java.lang.String PARAMSRC_DESIGN
public static final java.lang.String PARAMSRC_RF_DESIGN
public static final java.lang.String PARAMSRC_LIVE
public static final int DIAGNOSTIC_PROBE
public static final int ENSEMBLE_PROBE
public static final int ENVELOPE_PROBE
public static final int PARTICLE_PROBE
public static final int TRANSFERMAP_PROBE
public ModelProxy()
public ModelProxy(java.lang.String paramSrc)
paramSrc
- an integer to indicate where to synchronize from. If true
the proxy
will use channel access to read settings of lattice elements, if false
the element
settings will be taken from design values defined in the accelerator database.public void addModelProxyListener(ModelProxyListener listener)
listener
- the listener.public void removeModelProxyListener(ModelProxyListener listener)
listener
- the listener.protected ModelProxyListener[] getModelProxyListeners()
public void runModel() throws ModelException
modelResultsChanged
.ModelException
protected void notifyListeners(int cause)
cause
- what to notify. Cause can be either of:
ModelProxyListener.ACCEL_CHANGED
,
ModelProxyListener.PROBE_CHANGED
,
ModelProxyListener.SEQUENCE_CHANGED
,
ModelProxyListener.RESULTS_CHANGED
,
ModelProxyListener.MISSING_INPUT
. If neither
of these values no notification is issued.public void synchronizeAcceleratorSeq() throws LatticeError
LatticeError
- synchronization exception, actuallypublic void resetProbe()
public void setAcceleratorSeq(AcceleratorSeq seq) throws LatticeError
accelerator sequence
property.
As a result of calling this member a new Scenario will be generated. In Addition all registered ModelproxyListeners will be notified
by accelSequenceChanged
.seq
- the accelerator sequence.LatticeError
public void setNewProbe(java.io.File probeFile) throws LatticeError
probe
property. All
registered ModleProxyListeners will be notified by
probeMasterChanged
.probeFile
- the file for the probe definition in XML.LatticeError
public void setNewProbe(Probe<?> aProbe)
aProbe
- the new probe object.public boolean setChannelSource(java.lang.String src)
src
- a constant to indicate the channel source. May be one of
Synchronization.PARAMSRC_DESIGN
Synchronization.PARAMSRC_LIVE
public AcceleratorSeq getAcceleratorSequence()
null
is returned.public java.lang.String getChannelSource()
public Lattice getOnLineModelLattice()
on-line-model lattice
property.public int getProbeType()
DIAGNOSTIC_PROBE
,
ENSEMBLE_PROBE
,
ENVELOPE_PROBE
,
PARTICLE_PROBE
public Probe<?> getProbe()
probe
property.null
is retuned.public java.io.File getProbeMasterFile()
null
is returned.public org.w3c.dom.Document getOnLineModelLatticeAsDocument()
on-line-model lattice
property.null
is returned.public org.w3c.dom.Document getProbeAsDocument()
null
is returned.public ProbeState<?> stateForElement(java.lang.String id) throws ModelException
accelerator node
.id
- the identifier of the given accelerator node.ModelException
public ProbeState<?>[] statesForElement(java.lang.String id) throws ModelException
accelerator node
.id
- the identifier of the given accelerator node.ModelException
public void checkLattice() throws LatticeError
missingInputToRunModel
and and an Error
will be thrown.java.lang.Error
LatticeError
public void checkProbe() throws LatticeError
missingInputToRunModel
and and an Error
will be thrown.java.lang.Error
LatticeError
public boolean hasLattice()
true
if the model has a valid lattice , false
if not.public boolean hasProbe()
true
if the model has a valid probe , false
if not.protected boolean isProbePropagated()