Class BPMonitor
java.lang.Object
org.scictrl.mp.orbitcorrect.model.optics.AbstractDataBushElement
org.scictrl.mp.orbitcorrect.model.optics.AbstractOpticalElement
org.scictrl.mp.orbitcorrect.model.optics.BPMonitor
- All Implemented Interfaces:
Cloneable
,ISimpleElement
,AbstractUpdateableElement
,IBindedElement<Double[]>
public class BPMonitor
extends AbstractOpticalElement
implements IBindedElement<Double[]>, AbstractUpdateableElement
This class represent beam position monitor. It hold position of electron beam.
It connects to BeamPositionMonitor and reads beam displacment
- Author:
- igor@scictrl.com
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Data is invalidated.static final String
ConstantHOR_POSITION="horPosition"
static final String
ConstantVER_POSITION="verPosition"
Fields inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractOpticalElement
PR_POSITION, PR_REL_FROM, PR_REL_POSITION
Fields inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractDataBushElement
lastActionResult, owner, PR_ELEMENT_NAME, PR_VIRTUAL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns the clone of this element.int
connect()
Binds to remote object.Returns the descriptor object for this element.int
Destroys connection.int
elType()
Returns the code of element's type.This method return the position of the electron beam, that was measured before lastupdate()
call.void
SetsDataInvalidated
flag totrue
.boolean
Returnstrue
if element is binded,false
otherwise.boolean
Returnstrue
if element's data is not synchronized with associated element or Abean.boolean
isUseable.void
notifyDataUpdate
(Double[] data) Called by data connection when new value update arrivesvoid
setBeamPosTo
(double x, double z) This method sets value, that holds beam position to specified value.boolean
test()
This method tests if BPM is usable.toString()
Returns the string representation of this element.int
update()
Reads value from associated element or Abean and calculates it's new values.Methods inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractOpticalElement
getAlpha, getBeta, getDispersion, getIndex, getPosition, getQ, getRelFrom, getRelPosition, setPosition, setRelFrom, setRelPosition, setWith
Methods inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractDataBushElement
equals, getLastActionResult, getName, getOwner, getVirtual, hashCode, isInitialized, isVirtual, setVirtual, throwISE
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.scictrl.mp.orbitcorrect.ISimpleElement
getName
-
Field Details
-
HOR_POSITION
ConstantHOR_POSITION="horPosition"
- See Also:
-
VER_POSITION
ConstantVER_POSITION="verPosition"
- See Also:
-
dataInvalidated
protected boolean dataInvalidatedData is invalidated.
-
-
Constructor Details
-
Method Details
-
notifyDataUpdate
Called by data connection when new value update arrives- Specified by:
notifyDataUpdate
in interfaceIBindedElement<Double[]>
- Parameters:
data
- new data, if value is OK,null
if last arrive value signals problems and can not be thrusted
-
clone
Returns the clone of this element. Returns not initialized clone of this element. All data is copied to the clone. Returns not initialized clone of this element. All data is copied to the clone.clone.
- Specified by:
clone
in interfaceISimpleElement
- Overrides:
clone
in classAbstractOpticalElement
- Returns:
- a
Object
the clone of this element. - See Also:
-
connect
Binds to remote object. Returns the code indication success of bind. Connects element to InfoServerBean device. Returns the success code of operation.- Specified by:
connect
in interfaceIBindedElement<Double[]>
- Returns:
- the code indication success of bind.
- Throws:
DataBushPackedException
- if bind exception occurs.IllegalStateException
- See Also:
-
descriptor
Returns the descriptor object for this element.DBElementDescriptor
helps manipulating DataBush elements dynamically.descriptor.
- Specified by:
descriptor
in classAbstractDataBushElement
- Returns:
- the descriptor object for this element.
- See Also:
-
disconnect
Destroys connection. Returns the code indication success of destroy. Disconnects element from InfoServerBean device. Returns the success code of operation.- Specified by:
disconnect
in interfaceIBindedElement<Double[]>
- Returns:
- the code indication success of destroy.
- Throws:
IllegalStateException
- See Also:
-
elType
public int elType()Returns the code of element's type. Returns the code of element's type.- Specified by:
elType
in classAbstractDataBushElement
- Returns:
- the code of element's type.
- See Also:
-
getBeamPos
This method return the position of the electron beam, that was measured before lastupdate()
call.- Returns:
- PositionedData
-
invalidateData
public void invalidateData()SetsDataInvalidated
flag totrue
. This method invalidate data which means that at least one data in this object is not consistent with other object's data. It is necessary to update this object or apply (if possible).- Specified by:
invalidateData
in interfaceAbstractUpdateableElement
- See Also:
-
isConnected
public boolean isConnected()Returnstrue
if element is binded,false
otherwise. This method tests ifBPMonitor
is connected.- Specified by:
isConnected
in interfaceIBindedElement<Double[]>
- Returns:
true
if element is binded,false
otherwise.- See Also:
-
isDataInvalidated
public boolean isDataInvalidated()Returnstrue
if element's data is not synchronized with associated element or Abean. This fag goes to false after update or apply. This method tests if data is invalidated.- Specified by:
isDataInvalidated
in interfaceAbstractUpdateableElement
- Returns:
true
if element's data is not synchronized with associated element or Abean.- See Also:
-
setBeamPosTo
This method sets value, that holds beam position to specified value.- Parameters:
x
- double position in x directionz
- double position in z direction- Throws:
IllegalStateException
- if any.
-
toString
Returns the string representation of this element. Returns string describing this element. String is formated in input-file code. Returns a String that represents the value of this object. Returns a String that represents the value of this object.- Specified by:
toString
in interfaceISimpleElement
- Overrides:
toString
in classAbstractOpticalElement
-
update
Reads value from associated element or Abean and calculates it's new values. Metod reads data from other databush elements or from remote devices represented with Abean. Metod also checksisDataInvalidated()
on depending databush elements, if value has changed. Return value is identification code of error. Note! Update is performed only if virtual flag is set tofalse
. Note! All update methods are synchronized, so only one update is called at time. For update od group of elements call update on appropriate element-list or DataBush. This method reads electron beam position fromBeamPositionMonitorBean
and save it to private field of this class- Specified by:
update
in interfaceAbstractUpdateableElement
- Returns:
- a int the return code indicating success
- Throws:
IllegalStateException
- thrown if status of DataBush equalsDB_EMPTY
DataBushPackedException
- contains all exception thrown or caught during updating element
-
test
public boolean test()This method tests if BPM is usable.- Returns:
true
if it is.
-
isUseable
public boolean isUseable()isUseable.
- Returns:
- a boolean
-