Class AbstractCalibratedMagnet
java.lang.Object
org.scictrl.mp.orbitcorrect.model.optics.AbstractDataBushElement
org.scictrl.mp.orbitcorrect.model.optics.AbstractOpticalElement
org.scictrl.mp.orbitcorrect.model.optics.AbstractTransferElement
org.scictrl.mp.orbitcorrect.model.optics.AbstractMagnetElement
org.scictrl.mp.orbitcorrect.model.optics.AbstractCalibratedMagnet
- All Implemented Interfaces:
Cloneable
,ISimpleElement
,AbstractUpdateableElement
,IApplyableElement
- Direct Known Subclasses:
AbstractBending
,AbstractCorrector
,Quadrupole
,Sextupole
public abstract class AbstractCalibratedMagnet
extends AbstractMagnetElement
implements AbstractUpdateableElement, IApplyableElement
This magnet has calibration. It means that can transfers current to magnetic field and back.
- Author:
- igor@scictrl.com
-
Field Summary
Modifier and TypeFieldDescriptionprotected IMagnetCalculatorModel
Calibration calculator object.protected String
Calibration entry name.protected double
Electrical current in magnets.protected boolean
Data invalidated.static final int
ConstantPR_CALIBRATION_ENTRY=7
Fields inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractMagnetElement
PR_POWER_SUPPLY, psH
Fields inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractTransferElement
length, matrices, matrix, PR_LENGTH
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
ConstructorDescriptionConstructsAbstractCalibratedMagnet
with specified name and default parameter's values.AbstractCalibratedMagnet
(String name, boolean virtual, double position, double relpos, String relFrom, double length, String ps, String calibrationEntry) Constructs theAbstractCalibratedMagnet
with specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionThis method return the name of calculator, that do the current-field calculationdouble
This method return current on this element.void
SetsDataInvalidated
flag totrue
.boolean
Returnstrue
if element's data is not synchronized with associated element or Abean.void
setCurrent
(double newCurrent) This method sets current on this element.void
Sets parameters values of this element to those in parameter array.toString()
Returns the string representation of this element.protected void
updateMatrices.Methods inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractMagnetElement
getPowerSupply, getPS
Methods inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractTransferElement
clone, getAlpha1, getAlpha2, getBeta1, getBeta2, getDispersion1, getDispersion2, getLength, getMatrix, getQ1, getQ2, newMatrix, newMatrix, setLength
Methods inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractOpticalElement
getAlpha, getBeta, getDispersion, getIndex, getPosition, getQ, getRelFrom, getRelPosition, setPosition, setRelFrom, setRelPosition
Methods inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractDataBushElement
descriptor, elType, 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.model.optics.AbstractUpdateableElement
update
-
Field Details
-
PR_CALIBRATION_ENTRY
public static final int PR_CALIBRATION_ENTRYConstantPR_CALIBRATION_ENTRY=7
- See Also:
-
calibrationEntry
Calibration entry name. -
calc
Calibration calculator object. -
dataInvalidated
protected boolean dataInvalidatedData invalidated. -
current
protected double currentElectrical current in magnets.
-
-
Constructor Details
-
AbstractCalibratedMagnet
ConstructsAbstractCalibratedMagnet
with specified name and default parameter's values.- Parameters:
name
- aString
name of transfer element
-
AbstractCalibratedMagnet
public AbstractCalibratedMagnet(String name, boolean virtual, double position, double relpos, String relFrom, double length, String ps, String calibrationEntry) Constructs theAbstractCalibratedMagnet
with specified parameters.
-
-
Method Details
-
getCalibrationEntry
This method return the name of calculator, that do the current-field calculation- Returns:
- a
String
object
-
getCurrent
public double getCurrent()This method return current on this element.- Returns:
- a double
-
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
- Specified by:
invalidateData
in interfaceIApplyableElement
- 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
- Specified by:
isDataInvalidated
in interfaceIApplyableElement
- Returns:
true
if element's data is not synchronized with associated element or Abean.- See Also:
-
setCurrent
public void setCurrent(double newCurrent) This method sets current on this element.- Parameters:
newCurrent
- a double
-
setWith
Sets parameters values of this element to those in parameter array. As parameter must be used such array as for dynamical construction of new instance of this class. Current values are overriden for each notnull
object in array.setWith.
setWith.
setWith.
setWith.
- Overrides:
setWith
in classAbstractMagnetElement
- Parameters:
par
- an array ofObject
objects- Throws:
IllegalStateException
- if element is initialized and inside DataBush.- See Also:
-
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.toString.
toString.
toString.
- Specified by:
toString
in interfaceISimpleElement
- Overrides:
toString
in classAbstractMagnetElement
- See Also:
-
updateMatrices
protected void updateMatrices()updateMatrices.
-