Interface ModelDelegate
-
- All Known Implementing Classes:
JMadModelDelegate
public interface ModelDelegatethis is the interface for an abstraction layer between aloha and the model. It provides matrices and vectors in the correct dimensions, according the actually selected monitors/correctors. Additionaly it is possible, to set the gain-factors for correctors and monitors from outside.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddListener(ModelDelegateListener listener)voidapplyAlignment(AlignmentData alignmentData)sets the misalignments to the elements, as they are given in the alignmentDatavoidapplyTrim(TrimData trimData)sets the Correctors of the model to the values given inTrimDatavoidcleanup()clean up the modelNameListReadSelectionFiltercreateReadSelectionFilter(BeamNumber beamNumber)creates a selection filter for reading yasp-filescern.accsoft.steering.jmad.model.JMadModelgetJMadModel()ModelOpticsDatagetModelOpticsData()java.util.List<java.lang.String>getMonitorRegexps()booleanisInitialized()voidremoveListener(ModelDelegateListener listener)voidreset()resets the modelvoidsetSuppressEvents(boolean suppressEvents)if this is set to true, then the listener event (becameDirty) are not fired.
-
-
-
Method Detail
-
reset
void reset()
resets the model
-
cleanup
void cleanup()
clean up the model
-
addListener
void addListener(ModelDelegateListener listener)
- Parameters:
listener- the listener to add
-
removeListener
void removeListener(ModelDelegateListener listener)
- Parameters:
listener- the listener to remove
-
createReadSelectionFilter
NameListReadSelectionFilter createReadSelectionFilter(BeamNumber beamNumber)
creates a selection filter for reading yasp-files- Returns:
- the selection filter
-
isInitialized
boolean isInitialized()
- Returns:
- true, if the model is initialized
-
applyTrim
void applyTrim(TrimData trimData)
sets the Correctors of the model to the values given inTrimData- Parameters:
trimData- the trim-data to apply to the model
-
applyAlignment
void applyAlignment(AlignmentData alignmentData)
sets the misalignments to the elements, as they are given in the alignmentData- Parameters:
alignmentData-
-
getJMadModel
cern.accsoft.steering.jmad.model.JMadModel getJMadModel()
- Returns:
- the jmad-model instance used by this delegate
-
getModelOpticsData
ModelOpticsData getModelOpticsData()
- Returns:
- an object containing all kind of information of the current model-optic.
-
getMonitorRegexps
java.util.List<java.lang.String> getMonitorRegexps()
- Returns:
- a list of regexpressions representing the monitors, or an empty list. This can be used e.g. for calculating the response matrix.
-
setSuppressEvents
void setSuppressEvents(boolean suppressEvents)
if this is set to true, then the listener event (becameDirty) are not fired. This is useful if on is modifying the model several times during a complicated calculation (e.g. calculating the response matrix) and one wants to avoid that all clients of the ModelDelegate get notified that the model bacame dirty and therefore recalculate their values, although the model did not change permanently, but only temporarily.NOTE: The client is responsible to restore the same state of the model as before!
- Parameters:
suppressEvents- true to suppress the event, false for nominal behaviour.
-
-