Class JMadModelDelegate
- java.lang.Object
-
- cern.accsoft.steering.aloha.model.JMadModelDelegate
-
- All Implemented Interfaces:
ModelDelegate
public class JMadModelDelegate extends java.lang.Object implements ModelDelegate
-
-
Constructor Summary
Constructors Constructor Description JMadModelDelegate(cern.accsoft.steering.jmad.model.JMadModel model, MachineElementsManager machineElementsManager, JMadModelAdapter modelAdapter)
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Constructor Detail
-
JMadModelDelegate
public JMadModelDelegate(cern.accsoft.steering.jmad.model.JMadModel model, MachineElementsManager machineElementsManager, JMadModelAdapter modelAdapter)
-
-
Method Detail
-
reset
public void reset()
Description copied from interface:ModelDelegateresets the model- Specified by:
resetin interfaceModelDelegate
-
getJMadModel
public cern.accsoft.steering.jmad.model.JMadModel getJMadModel()
- Specified by:
getJMadModelin interfaceModelDelegate- Returns:
- the madxModel
-
addListener
public void addListener(ModelDelegateListener listener)
- Specified by:
addListenerin interfaceModelDelegate- Parameters:
listener- the listener to add
-
removeListener
public void removeListener(ModelDelegateListener listener)
- Specified by:
removeListenerin interfaceModelDelegate- Parameters:
listener- the listener to remove
-
cleanup
public void cleanup()
Description copied from interface:ModelDelegateclean up the model- Specified by:
cleanupin interfaceModelDelegate
-
createReadSelectionFilter
public NameListReadSelectionFilter createReadSelectionFilter(BeamNumber beamNumber)
Description copied from interface:ModelDelegatecreates a selection filter for reading yasp-files- Specified by:
createReadSelectionFilterin interfaceModelDelegate- Returns:
- the selection filter
-
isInitialized
public boolean isInitialized()
- Specified by:
isInitializedin interfaceModelDelegate- Returns:
- true, if the model is initialized
-
applyTrim
public void applyTrim(TrimData trimData)
Description copied from interface:ModelDelegatesets the Correctors of the model to the values given inTrimData- Specified by:
applyTrimin interfaceModelDelegate- Parameters:
trimData- the trim-data to apply to the model
-
applyAlignment
public void applyAlignment(AlignmentData alignmentData)
Description copied from interface:ModelDelegatesets the misalignments to the elements, as they are given in the alignmentData- Specified by:
applyAlignmentin interfaceModelDelegate
-
getModelOpticsData
public ModelOpticsData getModelOpticsData()
- Specified by:
getModelOpticsDatain interfaceModelDelegate- Returns:
- an object containing all kind of information of the current model-optic.
-
setSuppressEvents
public void setSuppressEvents(boolean suppressEvents)
Description copied from interface:ModelDelegateif 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!
- Specified by:
setSuppressEventsin interfaceModelDelegate- Parameters:
suppressEvents- true to suppress the event, false for nominal behaviour.
-
getMonitorRegexps
public java.util.List<java.lang.String> getMonitorRegexps()
- Specified by:
getMonitorRegexpsin interfaceModelDelegate- Returns:
- a list of regexpressions representing the monitors, or an empty list. This can be used e.g. for calculating the response matrix.
-
-