Class DataBush
java.lang.Object
org.scictrl.mp.orbitcorrect.model.optics.DataBush
DataBush holds together objects representation of physical view of Control System
(CS for short). It provides organized access to all elements, manages their
cooindependance and synchronization. DataBush also perform group operations and linear
optics calculations.
DataBush keeps persistance of basic settings and event listeners while DataBush is initialized and cleared as many times as needed.
DataBush keeps persistance of basic settings and event listeners while DataBush is initialized and cleared as many times as needed.
- Author:
- igor@scictrl.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanEnables/disables aditional debug output.static final doubleDataBush default value for BPM's value precision.static final doubleDataBush default value for PowerSupply's current precision.static final longDataBush default value for minimal interval between linear optics updates.static final doubleDataBush default value for position precision. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()This method sets aborted flag on ownDataBushHandlerto true.voidaddActionReportListener(IActionReportListener listener) Adds listener for performed actions on DataBush or its elements.voidaddConnectionListener(IConnectionListener listener) Adds listener for connection events on DataBush elements.voidaddDataBushListener(IDataBushListener listener) Adds listener to DataBush.intapply()Sends values from all DataBush elements to the Control System.intPerform fast apply for elements in list.voidclear()Clears all elements from DataBush.intconnect()Connects all connectable DataBush elements to appropriate Abean objects.intDisconnects all connectable DataBush elements.getAlpha()Returns closed orbit solution for alpha-function.Returns list with values of alpha funtion for all optical elements in DataBush.This method returnIBeamSimulator, which is used.Returns list with all bending magnets in DataBush.getBeta()Returns closed orbit solution for beta-function.Returns list with values of beta-funtion for all optical elements in DataBush.Returns list with all IBindedElement elements in DataBush.getBPMonitor(int index) Returns the BPMonitor at the specified index.Returns list with all BPMonitor elements in DataBush.getBPMonitors(int[] pick) Returns array of BPMonitor elements at the specified indices.doubleReturns precision of BPMonitor beam position value handling.Returns factory for calibration calculators.Returns list with all AbstractCalibratedMagnet elements in DataBush.This method returnIControlSystemEngine, that is used.getCorrector(int index) Returns the AbstractCorrector at the specified index.Returns list with all AbstractCorrector elements in DataBush.getCorrectors(int[] pick) Returns array of AbstractCorrector elements at the specified indices.Returns model for applying current.doubleReturns the precision of PowerSupply electric current value handling.getDataBushElement(String name) Returns AbstractDataBushElement with specified name.Returns DataBushInfo element if present, otherwisenull.Returns closed orbit solution for horizontal momentum dispersion function.Returns list with values of horizontal momentum dispersion function for all optical elements in DataBush.getElement(String name) Returns element with specified name, if contained in this DataBush.getElementMatrix(String name) Returns transfer matrix of AbstractTransferElement with specified name.Returns list with all HorCorrector elements in DataBush.org.apache.logging.log4j.LoggergetLog()getLog.double[][]getMachineFunctions(double[][] dataArray, AbstractOpticalElement oe1, AbstractOpticalElement oe2, int count) Calculates machine functions on specified interval atcountpoints.getMachineFunctions(List<Double>[] dataVectors, AbstractOpticalElement oe1, AbstractOpticalElement oe2, int count) Calculates machine functions on specified interval atcountpoints.Returns list with all AbstractMagnetElement elements in DataBush.doubleReturns minimal optical path length.longReturns the minimal allowed interval in milliseconds between two linear optic calculations.Returns list with all AbstractOpticalElement elements in DataBush.doubleReturns length of orbit.doubleReturns the precision of element's position handling.Returns list with all PowerSupply elements in DataBush.getQ()Returns tune of closed orbit.getQList()Returns list with values of phase of beta-functions, divided by 2 pi, for all optical elements in DataBush.Returns RFGenerator element if present, otherwisenull.intReturns status of DataBush.Returns synchronization lock for DataBush.Returns list with all AbstractTransferElement elements in DataBush.intReturns update mode code.Returns list with all VerCorrector elements in DataBush.booleanReturnstrueif closed orbit solution was foud when last linear optics calculation was performed.voidInitialize DataBush with elements from list.booleanThis method performisSetFiresEvent()method on ownDataBushHandler.booleanReturnstrueif status of DataBush isDBConst.DB_EMPTY- when DataBush in not initialized and contains no elements.booleanReturnstrueif status of DataBush isDBConst.DB_OPERATIONAL- after successful initialization.voidRemoves listener for performed actions on DataBush or its elements.voidremoveConnectionListener(IConnectionListener listener) Removes listener for connection events on DataBush elements.voidremoveDataBushListener(IDataBushListener listener) Removes listener from DataBush.voidsetBeamSimulator(IBeamSimulator newBeamSimulator) This method sets newIBeamSimulatorvoidsetBPMPositionPrecision(double precision) Sets precision of BPMonitor beam position value handling.voidSets the factory for calibration calculators.voidsetControlSystemEngine(IControlSystemEngine newControlSystemEngine) This method setsIControlSystemEngine.voidsetCurrentApplyModel(ICurrentApplyModel newValue) Sets the model for applying current.voidsetCurrentPrecision(double newValue) Sets the precision of PowerSupply electric current value handling.voidsetMinUpdateInterval(long newValue) Sets the minimal allowed interval in milliseconds between two linear optic calculations.voidsetPositionPrecision(double newValue) Sets the precision of element's position handling.voidsetProperySetFiresEvent(boolean newSetProperyFiresEvent) This method performsetSetFiresEvent()method on ownDataBushHandler.voidsetUpdateMode(int mode) Sets update mode code.voidSymulates BPM beam positions with closed orbit calculation.booleanTests power supplies or magnets in lust if are usable.toString()Returns string representation of DataBush.transferMatrix(AbstractOpticalElement first, AbstractOpticalElement last) This method returns first optical element to last.transferMatrix(SimpleData first, SimpleData last) This method returns first optical element to last.intupdate()Reads values from Control System and updates DataBush elements.
-
Field Details
-
debug
public static boolean debugEnables/disables aditional debug output. -
DEFAULT_POSITION_PRECISION
public static final double DEFAULT_POSITION_PRECISIONDataBush default value for position precision.- See Also:
-
DEFAULT_CURRENT_PRECISION
public static final double DEFAULT_CURRENT_PRECISIONDataBush default value for PowerSupply's current precision.- See Also:
-
DEFAULT_BPM_POSITION_PRECISION
public static final double DEFAULT_BPM_POSITION_PRECISIONDataBush default value for BPM's value precision.- See Also:
-
DEFAULT_MIN_UPDATE_INTERVAL
public static final long DEFAULT_MIN_UPDATE_INTERVALDataBush default value for minimal interval between linear optics updates.- See Also:
-
-
Constructor Details
-
DataBush
public DataBush()Constructs empty instance of DataBush. Status of DataBush is set toDBConst.EMPTY. All lists are accessible, but none of DataBush elements, since they don't exsists.
AbeanInitializer is initialized with DataBush. DataBush application by default does not need any aditional ABean initializations in order to work with Abeans.- See Also:
-
-
Method Details
-
abort
public void abort()This method sets aborted flag on ownDataBushHandlerto true. -
addActionReportListener
Adds listener for performed actions on DataBush or its elements.- Parameters:
listener- aIActionReportListenerobject- See Also:
-
addConnectionListener
Adds listener for connection events on DataBush elements.- Parameters:
listener- aIConnectionListenerobject
-
addDataBushListener
Adds listener to DataBush.- Parameters:
listener- aIDataBushListenerobject- See Also:
-
apply
Sends values from all DataBush elements to the Control System. First are applied CalibratedMagnets to PoweSupplies, than currents on PowerSupplies to CS. Returns the code of element with best result returned. Apply is allways performed till last element, than all caught exceptions are thrown with one PackedDBException.- Returns:
- a int the code of element with best result returned
- Throws:
IllegalStateException- thrown if status of DataBush equalsDB_EMPTYDataBushPackedException- contains all exception thrown or caught during invoking apply on all elementsInconsistentDataException- thrown before values are actully send to CS, if PowerSupply is assigned to more than one Magnet and diference betwean different desired current values is to high.
-
applyFast
public int applyFast(ElementList<AbstractDataBushElement> cor) throws IllegalStateException, DataBushPackedException, InconsistentDataException, ControlSystemException Perform fast apply for elements in list. Values are sent to CS one after another as fast as possible with asynchronus sets. If any exception was cought during proccess, it is rethrown with PackedDBException after all sets are finished. Returns the code of element with best result returned. NOTE! This method is not synchronized to synchronization lock.- Parameters:
cor- aElementListobject if any.- Returns:
- a int the code of element with best result returned
- Throws:
DataBushPackedException- contains all exception thrown or caught during invoking apply on specified elementsDataBushPackedException- contains all exception thrown or caught during invoking apply on specified elementsInconsistentDataException- thrown before values are actully send to CS, if PowerSupply is assigned to more than one Magnet and diference betwean different desired current values is to high.ControlSystemException- if any.IllegalStateException- if any.
-
clear
public void clear()Clears all elements from DataBush.statusof DataBush is set toDB_EMPTY. All listeners persist.- See Also:
-
connect
Connects all connectable DataBush elements to appropriate Abean objects. Returns the code of element with best result returned.- Returns:
- a int the code of element with best result returned
- Throws:
IllegalStateException- thrown if status of DataBush equalsDB_EMPTYDataBushPackedException- contains all exception thrown or caught during invoking connect on all elements- See Also:
-
disconnect
Disconnects all connectable DataBush elements. Returns the code of element with best result returned.- Returns:
- a int the code of element with best result returned
- Throws:
IllegalStateException- thrown if status of DataBush equalsDB_EMPTYDataBushPackedException- contains all exception thrown or caught during invoking disconnect on all elements- See Also:
-
getAlpha
Returns closed orbit solution for alpha-function. This is convenience method forgetDataBushInfo().getAlpha().- Returns:
- a
PositionedDataclosed orbit solution for alpha-function
-
getAlphaList
Returns list with values of alpha funtion for all optical elements in DataBush.- Returns:
- a
PositionedDataListlist with values of alpha funtion for all optical elements in DataBushect
-
getBeamSimulator
This method returnIBeamSimulator, which is used. If nobody, returnsDefaultBeamSimulator- Returns:
- IBeamSimulator
-
getBendings
Returns list with all bending magnets in DataBush.- Returns:
- a
BendingListlist with all bending magnets
-
getBeta
Returns closed orbit solution for beta-function. This is convenience method forgetDataBushInfo().getBeta().- Returns:
- a
PositionedDataclosed orbit solution for beta-function
-
getBetaList
Returns list with values of beta-funtion for all optical elements in DataBush.- Returns:
- a
PositionedDataListlist with values of beta-funtion for all optical elements in DataBush
-
getBinded
Returns list with all IBindedElement elements in DataBush.- Returns:
- a
BindedListlist with all IBindedElement elements in DataBush
-
getBPMonitor
Returns the BPMonitor at the specified index.- Parameters:
index- a int index of BPMmonitor to return.- Returns:
- a
BPMonitorthe BPMonitor at the specified index
-
getBPMonitors
Returns list with all BPMonitor elements in DataBush.- Returns:
- a
BPMonitorListlist with all BPMonitor elements in DataBush
-
getBPMonitors
Returns array of BPMonitor elements at the specified indices.- Parameters:
pick- an array ofindices of BPMonitor elements to return.invalid reference
int- Returns:
- an array of
BPMonitorarray of BPMonitor elements at the specified indices
-
getBPMPositionPrecision
public double getBPMPositionPrecision()Returns precision of BPMonitor beam position value handling.- Returns:
- a double precision of BPMonitor bean position value handling
- See Also:
-
getCalculatorModelFactory
Returns factory for calibration calculators.- Returns:
- a
ICalculatorModelFactoryfactory for calibration calculators - See Also:
-
getCalMagnets
Returns list with all AbstractCalibratedMagnet elements in DataBush.- Returns:
- a
CalMagnetListlist with all AbstractCalibratedMagnet elements in DataBush
-
getControlSystemEngine
This method returnIControlSystemEngine, that is used. If noIControlSystemEngineis in use, method return defaultIControlSystemEngine.- Returns:
- IControlSystemEngine
- See Also:
-
getCorrector
Returns the AbstractCorrector at the specified index.- Parameters:
index- a int index of AbstractCorrector to return.- Returns:
- a
AbstractCorrectorthe AbstractCorrector at the specified index
-
getCorrectors
Returns list with all AbstractCorrector elements in DataBush.- Returns:
- a
CorrectorListlist with all AbstractCorrector elements in DataBush
-
getCorrectors
Returns array of AbstractCorrector elements at the specified indices.- Parameters:
pick- an array ofindices of AbstractCorrector elements to return.invalid reference
int- Returns:
- an array of
AbstractCorrectorarray of AbstractCorrector elements at the specified indices
-
getCurrentApplyModel
Returns model for applying current.- Returns:
- a
ICurrentApplyModelmodel for applying current
-
getCurrentPrecision
public double getCurrentPrecision()Returns the precision of PowerSupply electric current value handling.- Returns:
- a double the precision of PowerSupply electric current value handling
- See Also:
-
getDataBushElement
Returns AbstractDataBushElement with specified name. If not exsist,nullis returned.- Parameters:
name- aStringthe name of element to return- Returns:
- a
AbstractDataBushElementAbstractDataBushElement with specified name
-
getDataBushInfo
Returns DataBushInfo element if present, otherwisenull.- Returns:
- a
DataBushInfoe;ement
-
getDispersion
Returns closed orbit solution for horizontal momentum dispersion function. This is convenience method forgetDataBushInfo().getDispersion().- Returns:
- a
DispersionDataclosed orbit solution for horizontal momentum dispersion function
-
getDispersionList
Returns list with values of horizontal momentum dispersion function for all optical elements in DataBush.- Returns:
- a
DispersionDataListlist with values of horizontal momentum dispersion function for all optical elements in DataBush
-
getElement
Returns element with specified name, if contained in this DataBush. If not, null is reurned.- Parameters:
name- aStringobject- Returns:
- element, if contained int this DataBush,
nullotherwise.
-
getLog
public org.apache.logging.log4j.Logger getLog()getLog.
- Returns:
- a
Loggerobject
-
getElementMatrix
Returns transfer matrix of AbstractTransferElement with specified name. If there is no such element, null pointer exception is thrown.- Parameters:
name- aStringthe name of element to return transfer matrix- Returns:
- a
TransferMatrixtransfer matrix of AbstractTransferElement with specified name
-
getHorCorrectors
Returns list with all HorCorrector elements in DataBush.- Returns:
- a
HorCorrectorListlist with all HorCorrector elements in DataBush
-
getMachineFunctions
public double[][] getMachineFunctions(double[][] dataArray, AbstractOpticalElement oe1, AbstractOpticalElement oe2, int count) throws IllegalStateException, IllegalArgumentException, InconsistentDataException Calculates machine functions on specified interval atcountpoints. DataBush tries to spread the points as much equidistant as possible. It allways takes beginning and end position of each DataBush element in interval.
Result is stored indataArraymatrix which should have dimension 9×count. Rows with values are accessed with DBConst constants:MF_POSITION,MF_Q_X,MF_Q_Z,MF_BETA_XMF_BETA_Z,MF_ALPHA_X,MF_ALPHA_Z,MF_D,MF_DP.- Parameters:
dataArray- an array ofa 9×invalid reference
doublecountmatrix to recive the resultoe1- aAbstractOpticalElementthe begining element of intervaloe2- aAbstractOpticalElementthe ending element of intervalcount- a int number of points machine functions to be calculated- Returns:
dataArrayparameter- Throws:
IllegalStateException- thrown if status of DataBush equalsDB_EMPTYIllegalArgumentException- thrown if dataArray does not mach specification or number of points is to low (at least one per optical element)InconsistentDataException- thrown if no closed orbit solutin exsists- See Also:
-
getMachineFunctions
public List<Double>[] getMachineFunctions(List<Double>[] dataVectors, AbstractOpticalElement oe1, AbstractOpticalElement oe2, int count) throws IllegalStateException, IllegalArgumentException, InconsistentDataException Calculates machine functions on specified interval atcountpoints. DataBush tries to spread the points as much equidistant as possible. It allways takes beginning and end position of each DataBush element in interval.
Result is stored indataVectors.dataVectorsmust be array of 9 emptyjava.util.Vectorobjects. Vectors with machine function values are accessed with DBConst constants:MF_POSITION,MF_Q_X,MF_Q_Z,MF_BETA_XMF_BETA_Z,MF_ALPHA_X,MF_ALPHA_Z,MF_D,MF_DP.- Parameters:
dataVectors- an array ofListarray of 9 emptyjava.util.Vectorobjectsoe1- aAbstractOpticalElementthe begining element of intervaloe2- aAbstractOpticalElementthe ending element of intervalcount- a int number of points machine functions to be calculated- Returns:
dataVectorsparameter- Throws:
IllegalStateException- thrown if status of DataBush equalsDB_EMPTYIllegalArgumentException- thrown if dataVectors does not mach specification or number of points is to low (at least one per optical element)InconsistentDataException- thrown if no closed orbit solutin exsists- See Also:
-
getMagnets
Returns list with all AbstractMagnetElement elements in DataBush.- Returns:
- a
MagnetListlist with all AbstractMagnetElement elements in DataBush
-
getMinFreeOpticalLength
Returns minimal optical path length. This is the shortest distance between any optical element beginning and end. For example shortest element length or shortest distance between two elements. Helps to determine minimum required number of points for machine function calculation.- Returns:
- a double minimal optical path length
- Throws:
IllegalStateException- thrown if status of DataBush equalsDB_EMPTY- See Also:
-
getMinUpdateInterval
public long getMinUpdateInterval()Returns the minimal allowed interval in milliseconds between two linear optic calculations.- Returns:
- a long the minimal allowed interval in milliseconds between two linear optic calculations
-
getOptics
Returns list with all AbstractOpticalElement elements in DataBush.- Returns:
- a
OpticsListlist with all AbstractOpticalElement elements in DataBush
-
getOpticsLength
public double getOpticsLength()Returns length of orbit.- Returns:
- a double length of orbit.
-
getPositionPrecision
public double getPositionPrecision()Returns the precision of element's position handling.- Returns:
- a double the precision of element's position handling
- See Also:
-
getPowerSupplies
Returns list with all PowerSupply elements in DataBush.- Returns:
- a
PowerSupplyListlist with all PowerSupply elements in DataBush
-
getQ
Returns tune of closed orbit. This is convenience method forgetDataBushInfo().getQ().- Returns:
- a
PositionedDatatune of closed orbit
-
getQList
Returns list with values of phase of beta-functions, divided by 2 pi, for all optical elements in DataBush.- Returns:
- a
PositionedDataListlist with values of phase of beta-functions, divided by 2 pi, for all optical elements in DataBush
-
getRFGenerator
Returns RFGenerator element if present, otherwisenull.- Returns:
- a
RFGeneratorelement - See Also:
-
getStatus
public int getStatus()Returns status of DataBush. Status has two possible valuesDBConst.DB_EMPTY- when DataBush in not initialized and contains no elements.DBConst.DB_OPERATIONAL- after successful initialization
- Returns:
- status of DataBush
- See Also:
-
isStatusEmpty
public boolean isStatusEmpty()Returnstrueif status of DataBush isDBConst.DB_EMPTY- when DataBush in not initialized and contains no elements.- Returns:
trueif status of DataBush isDBConst.DB_EMPTY- See Also:
-
isStatusOperational
public boolean isStatusOperational()Returnstrueif status of DataBush isDBConst.DB_OPERATIONAL- after successful initialization.- Returns:
trueif status of DataBush isDBConst.DB_OPERATIONAL- See Also:
-
getSynchronizationLock
Returns synchronization lock for DataBush. All DataBush updating, applying is locked inside this lock.- Returns:
- synchronization lock for DataBush
-
getTransfers
Returns list with all AbstractTransferElement elements in DataBush.- Returns:
- a
TransferListlist with all AbstractTransferElement elements in DataBush - See Also:
-
getUpdateMode
public int getUpdateMode()Returns update mode code. Update mode controls how DataBush is updated.- Returns:
- a int update mode code
- See Also:
-
getVerCorrectors
Returns list with all VerCorrector elements in DataBush.- Returns:
- a
VerCorrectorListlist with all VerCorrector elements in DataBush
-
hasClosedOrbitSolution
public boolean hasClosedOrbitSolution()Returnstrueif closed orbit solution was foud when last linear optics calculation was performed.- Returns:
trueif closed orbit solution was foud when last linear optics
-
init
public void init(ElementList<AbstractDataBushElement> l) throws IllegalStateException, DataBushInitializationException Initialize DataBush with elements from list. If initialization sucseds, DataBush become operational (DB_OPERATIONAL).- Parameters:
l- aElementListlist of elements to put in DataBush- Throws:
IllegalStateException- thrown if DataBush allready operational.DataBushInitializationException- thrown, if DataBush was not able to initialize with given elements
-
isProperySetFiresEvent
public boolean isProperySetFiresEvent()This method performisSetFiresEvent()method on ownDataBushHandler.- Returns:
- boolean
- See Also:
-
removeActionReportListener
Removes listener for performed actions on DataBush or its elements.- Parameters:
listener- aIActionReportListenerobject- See Also:
-
removeConnectionListener
Removes listener for connection events on DataBush elements.- Parameters:
listener- aIConnectionListenerobject- See Also:
-
removeDataBushListener
Removes listener from DataBush.- Parameters:
listener- aIDataBushListenerobject- See Also:
-
setBeamSimulator
This method sets newIBeamSimulator- Parameters:
newBeamSimulator- IBeamSimulator
-
setBPMPositionPrecision
public void setBPMPositionPrecision(double precision) Sets precision of BPMonitor beam position value handling. If inUPDATE_ON_EVENTupdate mode BPMonitor gets new value from CS, that is different from current less them precision, it is assumed as same and no event fires.
This value is independent of DataBush status. Can be seted at any time.- Parameters:
precision- a double new precision- See Also:
-
setCalculatorModelFactory
public void setCalculatorModelFactory(ICalculatorModelFactory newValue) throws IllegalStateException Sets the factory for calibration calculators. If none is seted, defaul one is used. To use default one, set to DataBush input file location. It is needed by default factory.
This property can be setted only vhen DataBush is empty, otherwiseIllegalStateExceptionis thrown.- Parameters:
newValue- aICalculatorModelFactorynew factory for calibration calculators- Throws:
IllegalStateException- thrown if status of DataBush equalsDB_OPERATIONAL- See Also:
-
setControlSystemEngine
public void setControlSystemEngine(IControlSystemEngine newControlSystemEngine) throws IllegalStateException This method setsIControlSystemEngine.- Parameters:
newControlSystemEngine- aIControlSystemEngineobject- Throws:
IllegalStateException- if any.- See Also:
-
setCurrentApplyModel
Sets the model for applying current.
This value is independent of DataBush status. Can be seted at any time.- Parameters:
newValue- aICurrentApplyModelnew model for applying current- See Also:
-
setCurrentPrecision
public void setCurrentPrecision(double newValue) Sets the precision of PowerSupply electric current value handling. If inUPDATE_ON_EVENTupdate mode PowerSupply gets new value from CS, that is different from current one less then precision, it is assumed as same and no event fires.
This value is independent of DataBush status. Can be seted at any time.- Parameters:
newValue- a double new precision of PowerSupply current value handling- See Also:
-
setMinUpdateInterval
public void setMinUpdateInterval(long newValue) Sets the minimal allowed interval in milliseconds between two linear optic calculations. This value is used inUPDAT_ON_EVENTupdate mode.
This value is independent of DataBush status. Can be seted at any time.- Parameters:
newValue- a long new minimal allowed interval in milliseconds
-
setPositionPrecision
public void setPositionPrecision(double newValue) Sets the precision of element's position handling. This value is used when element positions are recalculated. If one element ends and other starts within position of this precision, then is assumed, that there is no gap in between.
This value is independent of DataBush status. Can be seted at any time.- Parameters:
newValue- a double- See Also:
-
setProperySetFiresEvent
public void setProperySetFiresEvent(boolean newSetProperyFiresEvent) This method performsetSetFiresEvent()method on ownDataBushHandler.- Parameters:
newSetProperyFiresEvent- a boolean
-
setUpdateMode
Sets update mode code. Update mode controls how DataBush is updated. There are two update modes:DBConst.UPDATE_MANUAL- DataBush is updated, when update method is called. This is defualt mode.DBConst.UPDATE_ON_EVENT- DataBush is updated upon monitor events from Abean family. Manual updating will thow an exception.
This operation can be preformed only on operational DataBush. If DataBush is empty, When DataBush is cleared, update mode is reset toUPDATE_MANUAL.IllegalStateExceptionwill be thrown.- Parameters:
mode- a int update mode code- Throws:
IllegalStateException- thrown if status of DataBush equalsDB_EMPTY- See Also:
-
simulateBPMs
Symulates BPM beam positions with closed orbit calculation. This operation can be preformed only on operational DataBush. If DataBush is empty, When DataBush is cleared, update mode is reset toUPDATE_MANUAL.IllegalStateExceptionwill be thrown.- Throws:
IllegalStateException- thrown if status of DataBush equalsDB_EMPTY
-
testPowerSupplies
public boolean testPowerSupplies(ElementList<AbstractDataBushElement> list) throws IllegalArgumentException, IllegalStateException Tests power supplies or magnets in lust if are usable.- Parameters:
list- aElementListobject- Returns:
- if
trueif all powers supplies are usable,falseotherwise - Throws:
IllegalArgumentException- thrown if lust contains element, which is notPowerSupplynorAbstractMagnetElementelementIllegalStateException- thrown if status of DataBush equalsDB_EMPTY
-
toString
Returns string representation of DataBush. First is returned string representation of DataBushInfo element, than all optical element in optical order and than power supplies. Returned string if formated and can be used as input forDefaultDBReader. -
transferMatrix
public TransferMatrix transferMatrix(AbstractOpticalElement first, AbstractOpticalElement last) throws IllegalStateException, InconsistentDataException This method returns first optical element to last.- Parameters:
first- aAbstractOpticalElementobjectlast- aAbstractOpticalElementobject- Returns:
- TransferMatrix
- Throws:
IllegalStateException- if any.InconsistentDataException- if any.- See Also:
-
transferMatrix
public TransferMatrix transferMatrix(SimpleData first, SimpleData last) throws IllegalStateException, InconsistentDataException This method returns first optical element to last. Elements are represented bySimpleData- Parameters:
first- aSimpleDataobjectlast- aSimpleDataobject- Returns:
- TransferMatrix
- Throws:
IllegalStateException- if any.InconsistentDataException- if any.- See Also:
-
update
Reads values from Control System and updates DataBush elements. First are updated power supplies, BPM's nad DataBushInfo. Than magnets and linear optics data. Returns the code of element with best result returned. Update is allways performed till last element, than all caught exceptions are thrown with one PackedDBException.- Returns:
- a int the code of element with best result returned
- Throws:
IllegalStateException- thrown if status of DataBush equalsDB_EMPTYDataBushPackedException- contains all exception thrown or caught during updating all elements
-