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
Modifier and TypeFieldDescriptionstatic boolean
Enables/disables aditional debug output.static final double
DataBush default value for BPM's value precision.static final double
DataBush default value for PowerSupply's current precision.static final long
DataBush default value for minimal interval between linear optics updates.static final double
DataBush default value for position precision. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
This method sets aborted flag on ownDataBushHandler
to true.void
addActionReportListener
(IActionReportListener listener) Adds listener for performed actions on DataBush or its elements.void
addConnectionListener
(IConnectionListener listener) Adds listener for connection events on DataBush elements.void
addDataBushListener
(IDataBushListener listener) Adds listener to DataBush.int
apply()
Sends values from all DataBush elements to the Control System.int
Perform fast apply for elements in list.void
clear()
Clears all elements from DataBush.int
connect()
Connects all connectable DataBush elements to appropriate Abean objects.int
Disconnects 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.double
Returns 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.double
Returns 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.Logger
getLog()
getLog.double[][]
getMachineFunctions
(double[][] dataArray, AbstractOpticalElement oe1, AbstractOpticalElement oe2, int count) Calculates machine functions on specified interval atcount
points.getMachineFunctions
(List<Double>[] dataVectors, AbstractOpticalElement oe1, AbstractOpticalElement oe2, int count) Calculates machine functions on specified interval atcount
points.Returns list with all AbstractMagnetElement elements in DataBush.double
Returns minimal optical path length.long
Returns the minimal allowed interval in milliseconds between two linear optic calculations.Returns list with all AbstractOpticalElement elements in DataBush.double
Returns length of orbit.double
Returns 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
.int
Returns status of DataBush.Returns synchronization lock for DataBush.Returns list with all AbstractTransferElement elements in DataBush.int
Returns update mode code.Returns list with all VerCorrector elements in DataBush.boolean
Returnstrue
if closed orbit solution was foud when last linear optics calculation was performed.void
Initialize DataBush with elements from list.boolean
This method performisSetFiresEvent()
method on ownDataBushHandler
.boolean
Returnstrue
if status of DataBush isDBConst.DB_EMPTY
- when DataBush in not initialized and contains no elements.boolean
Returnstrue
if status of DataBush isDBConst.DB_OPERATIONAL
- after successful initialization.void
Removes listener for performed actions on DataBush or its elements.void
removeConnectionListener
(IConnectionListener listener) Removes listener for connection events on DataBush elements.void
removeDataBushListener
(IDataBushListener listener) Removes listener from DataBush.void
setBeamSimulator
(IBeamSimulator newBeamSimulator) This method sets newIBeamSimulator
void
setBPMPositionPrecision
(double precision) Sets precision of BPMonitor beam position value handling.void
Sets the factory for calibration calculators.void
setControlSystemEngine
(IControlSystemEngine newControlSystemEngine) This method setsIControlSystemEngine
.void
setCurrentApplyModel
(ICurrentApplyModel newValue) Sets the model for applying current.void
setCurrentPrecision
(double newValue) Sets the precision of PowerSupply electric current value handling.void
setMinUpdateInterval
(long newValue) Sets the minimal allowed interval in milliseconds between two linear optic calculations.void
setPositionPrecision
(double newValue) Sets the precision of element's position handling.void
setProperySetFiresEvent
(boolean newSetProperyFiresEvent) This method performsetSetFiresEvent()
method on ownDataBushHandler
.void
setUpdateMode
(int mode) Sets update mode code.void
Symulates BPM beam positions with closed orbit calculation.boolean
Tests 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.int
update()
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 ownDataBushHandler
to true. -
addActionReportListener
Adds listener for performed actions on DataBush or its elements.- Parameters:
listener
- aIActionReportListener
object- See Also:
-
addConnectionListener
Adds listener for connection events on DataBush elements.- Parameters:
listener
- aIConnectionListener
object
-
addDataBushListener
Adds listener to DataBush.- Parameters:
listener
- aIDataBushListener
object- 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_EMPTY
DataBushPackedException
- 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
- aElementList
object 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.status
of 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_EMPTY
DataBushPackedException
- 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_EMPTY
DataBushPackedException
- 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
PositionedData
closed orbit solution for alpha-function
-
getAlphaList
Returns list with values of alpha funtion for all optical elements in DataBush.- Returns:
- a
PositionedDataList
list 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
BendingList
list with all bending magnets
-
getBeta
Returns closed orbit solution for beta-function. This is convenience method forgetDataBushInfo().getBeta()
.- Returns:
- a
PositionedData
closed orbit solution for beta-function
-
getBetaList
Returns list with values of beta-funtion for all optical elements in DataBush.- Returns:
- a
PositionedDataList
list with values of beta-funtion for all optical elements in DataBush
-
getBinded
Returns list with all IBindedElement elements in DataBush.- Returns:
- a
BindedList
list 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
BPMonitor
the BPMonitor at the specified index
-
getBPMonitors
Returns list with all BPMonitor elements in DataBush.- Returns:
- a
BPMonitorList
list with all BPMonitor elements in DataBush
-
getBPMonitors
Returns array of BPMonitor elements at the specified indices.- Parameters:
pick
- an array ofinvalid reference
int
- Returns:
- an array of
BPMonitor
array 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
ICalculatorModelFactory
factory for calibration calculators - See Also:
-
getCalMagnets
Returns list with all AbstractCalibratedMagnet elements in DataBush.- Returns:
- a
CalMagnetList
list with all AbstractCalibratedMagnet elements in DataBush
-
getControlSystemEngine
This method returnIControlSystemEngine
, that is used. If noIControlSystemEngine
is 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
AbstractCorrector
the AbstractCorrector at the specified index
-
getCorrectors
Returns list with all AbstractCorrector elements in DataBush.- Returns:
- a
CorrectorList
list with all AbstractCorrector elements in DataBush
-
getCorrectors
Returns array of AbstractCorrector elements at the specified indices.- Parameters:
pick
- an array ofinvalid reference
int
- Returns:
- an array of
AbstractCorrector
array of AbstractCorrector elements at the specified indices
-
getCurrentApplyModel
Returns model for applying current.- Returns:
- a
ICurrentApplyModel
model 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,null
is returned.- Parameters:
name
- aString
the name of element to return- Returns:
- a
AbstractDataBushElement
AbstractDataBushElement with specified name
-
getDataBushInfo
Returns DataBushInfo element if present, otherwisenull
.- Returns:
- a
DataBushInfo
e;ement
-
getDispersion
Returns closed orbit solution for horizontal momentum dispersion function. This is convenience method forgetDataBushInfo().getDispersion()
.- Returns:
- a
DispersionData
closed 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
DispersionDataList
list 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
- aString
object- Returns:
- element, if contained int this DataBush,
null
otherwise.
-
getLog
public org.apache.logging.log4j.Logger getLog()getLog.
- Returns:
- a
Logger
object
-
getElementMatrix
Returns transfer matrix of AbstractTransferElement with specified name. If there is no such element, null pointer exception is thrown.- Parameters:
name
- aString
the name of element to return transfer matrix- Returns:
- a
TransferMatrix
transfer matrix of AbstractTransferElement with specified name
-
getHorCorrectors
Returns list with all HorCorrector elements in DataBush.- Returns:
- a
HorCorrectorList
list 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 atcount
points. 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 indataArray
matrix which should have dimension 9×count
. Rows with values are accessed with DBConst constants:MF_POSITION
,MF_Q_X
,MF_Q_Z
,MF_BETA_X
MF_BETA_Z
,MF_ALPHA_X
,MF_ALPHA_Z
,MF_D
,MF_DP
.- Parameters:
dataArray
- an array ofinvalid reference
double
count
matrix to recive the resultoe1
- aAbstractOpticalElement
the begining element of intervaloe2
- aAbstractOpticalElement
the ending element of intervalcount
- a int number of points machine functions to be calculated- Returns:
dataArray
parameter- Throws:
IllegalStateException
- thrown if status of DataBush equalsDB_EMPTY
IllegalArgumentException
- 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 atcount
points. 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
.dataVectors
must be array of 9 emptyjava.util.Vector
objects. Vectors with machine function values are accessed with DBConst constants:MF_POSITION
,MF_Q_X
,MF_Q_Z
,MF_BETA_X
MF_BETA_Z
,MF_ALPHA_X
,MF_ALPHA_Z
,MF_D
,MF_DP
.- Parameters:
dataVectors
- an array ofList
array of 9 emptyjava.util.Vector
objectsoe1
- aAbstractOpticalElement
the begining element of intervaloe2
- aAbstractOpticalElement
the ending element of intervalcount
- a int number of points machine functions to be calculated- Returns:
dataVectors
parameter- Throws:
IllegalStateException
- thrown if status of DataBush equalsDB_EMPTY
IllegalArgumentException
- 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
MagnetList
list 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
OpticsList
list 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
PowerSupplyList
list with all PowerSupply elements in DataBush
-
getQ
Returns tune of closed orbit. This is convenience method forgetDataBushInfo().getQ()
.- Returns:
- a
PositionedData
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:
- a
PositionedDataList
list 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
RFGenerator
element - 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()Returnstrue
if status of DataBush isDBConst.DB_EMPTY
- when DataBush in not initialized and contains no elements.- Returns:
true
if status of DataBush isDBConst.DB_EMPTY
- See Also:
-
isStatusOperational
public boolean isStatusOperational()Returnstrue
if status of DataBush isDBConst.DB_OPERATIONAL
- after successful initialization.- Returns:
true
if 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
TransferList
list 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
VerCorrectorList
list with all VerCorrector elements in DataBush
-
hasClosedOrbitSolution
public boolean hasClosedOrbitSolution()Returnstrue
if closed orbit solution was foud when last linear optics calculation was performed.- Returns:
true
if 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
- aElementList
list 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
- aIActionReportListener
object- See Also:
-
removeConnectionListener
Removes listener for connection events on DataBush elements.- Parameters:
listener
- aIConnectionListener
object- See Also:
-
removeDataBushListener
Removes listener from DataBush.- Parameters:
listener
- aIDataBushListener
object- 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_EVENT
update 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, otherwiseIllegalStateException
is thrown.- Parameters:
newValue
- aICalculatorModelFactory
new 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
- aIControlSystemEngine
object- 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
- aICurrentApplyModel
new model for applying current- See Also:
-
setCurrentPrecision
public void setCurrentPrecision(double newValue) Sets the precision of PowerSupply electric current value handling. If inUPDATE_ON_EVENT
update 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_EVENT
update 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
.IllegalStateException
will 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
.IllegalStateException
will 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
- aElementList
object- Returns:
- if
true
if all powers supplies are usable,false
otherwise - Throws:
IllegalArgumentException
- thrown if lust contains element, which is notPowerSupply
norAbstractMagnetElement
elementIllegalStateException
- 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
- aAbstractOpticalElement
objectlast
- aAbstractOpticalElement
object- 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
- aSimpleData
objectlast
- aSimpleData
object- 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_EMPTY
DataBushPackedException
- contains all exception thrown or caught during updating all elements
-