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
FieldsModifier and TypeFieldDescriptionprotected IMagnetCalculatorModelCalibration calculator object.protected StringCalibration entry name.protected doubleElectrical current in magnets.protected booleanData invalidated.static final intConstantPR_CALIBRATION_ENTRY=7Fields inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractMagnetElement
PR_POWER_SUPPLY, psHFields inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractTransferElement
length, matrices, matrix, PR_LENGTHFields inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractOpticalElement
PR_POSITION, PR_REL_FROM, PR_REL_POSITIONFields inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractDataBushElement
lastActionResult, owner, PR_ELEMENT_NAME, PR_VIRTUAL -
Constructor Summary
ConstructorsConstructorDescriptionConstructsAbstractCalibratedMagnetwith 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 theAbstractCalibratedMagnetwith specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionThis method return the name of calculator, that do the current-field calculationdoubleThis method return current on this element.voidSetsDataInvalidatedflag totrue.booleanReturnstrueif element's data is not synchronized with associated element or Abean.voidsetCurrent(double newCurrent) This method sets current on this element.voidSets parameters values of this element to those in parameter array.toString()Returns the string representation of this element.protected voidupdateMatrices.Methods inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractMagnetElement
getPowerSupply, getPSMethods inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractTransferElement
clone, getAlpha1, getAlpha2, getBeta1, getBeta2, getDispersion1, getDispersion2, getLength, getMatrix, getQ1, getQ2, newMatrix, newMatrix, setLengthMethods inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractOpticalElement
getAlpha, getBeta, getDispersion, getIndex, getPosition, getQ, getRelFrom, getRelPosition, setPosition, setRelFrom, setRelPositionMethods inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractDataBushElement
descriptor, elType, equals, getLastActionResult, getName, getOwner, getVirtual, hashCode, isInitialized, isVirtual, setVirtual, throwISEMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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
ConstructsAbstractCalibratedMagnetwith specified name and default parameter's values.- Parameters:
name- aStringname of transfer element
-
AbstractCalibratedMagnet
public AbstractCalibratedMagnet(String name, boolean virtual, double position, double relpos, String relFrom, double length, String ps, String calibrationEntry) Constructs theAbstractCalibratedMagnetwith specified parameters.
-
-
Method Details
-
getCalibrationEntry
This method return the name of calculator, that do the current-field calculation- Returns:
- a
Stringobject
-
getCurrent
public double getCurrent()This method return current on this element.- Returns:
- a double
-
invalidateData
public void invalidateData()SetsDataInvalidatedflag 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:
invalidateDatain interfaceAbstractUpdateableElement- Specified by:
invalidateDatain interfaceIApplyableElement- See Also:
-
isDataInvalidated
public boolean isDataInvalidated()Returnstrueif 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:
isDataInvalidatedin interfaceAbstractUpdateableElement- Specified by:
isDataInvalidatedin interfaceIApplyableElement- Returns:
trueif 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 notnullobject in array.setWith.
setWith.
setWith.
setWith.
- Overrides:
setWithin classAbstractMagnetElement- Parameters:
par- an array ofObjectobjects- 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:
toStringin interfaceISimpleElement- Overrides:
toStringin classAbstractMagnetElement- See Also:
-
updateMatrices
protected void updateMatrices()updateMatrices.
-