Class AbstractBending
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
org.scictrl.mp.orbitcorrect.model.optics.AbstractBending
- All Implemented Interfaces:
Cloneable,ISimpleElement,AbstractUpdateableElement,IApplyableElement
Bending magnet has three dynamical values, the values that are changed as
current changes. These are energy, dipole field, quadrupole field. These
values are combined, for this reason is setting these values to bending
magnet synchronized.
- Author:
- igor@scictrl.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstantPR_DFIELD=10static final intConstantPR_ENERGY=11static final intConstantPR_QUADRUPOLE_STRENGTH=8static final intConstantPR_RADIUS=9protected doubleQuadruple strengthprotected doubleBending radius.Fields inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractCalibratedMagnet
calibrationEntry, current, dataInvalidated, PR_CALIBRATION_ENTRYFields 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
ConstructorsConstructorDescriptionAbstractBending(String name) ConstructsAbstractBendingwith specified name and default parameter's values.AbstractBending(String name, boolean virtual, double position, double relpos, String relFrom, double length, String ps, String calibrationEntry, double quadrupoleStrength, double radius, double dipoleField, double energy) Constructs theAbstractBendingwith specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionintThis method transforms magnetic properties to current and sends it toPowerSupplyclone()Returns the clone of this element.This method returnIBendingCalculatorModel.doubleThis method return dipole field strengthdoubleThis method return energy, which is specified by dipole magnetic strength.doubleThis method return miximal energy that can be safely exceeded by this magnet.doubleThis method return minimal energy that can be exceeded by this magnet.doubleThis method return quadruploe strength.doubleThis method return radius, which is specified by dipole magnetic strength.This method return transfer matrix of drift with the same length as this element.newMatrix(double length) This method return transfer matrix of drift with the specified length.voidsetCurrent(double value) This method sets current on this element.voidsetDipoleField(double value) This method sets dipole field.voidsetEnergy(double value) This method sets energy.voidsetQuadrupoleStrength(double value) This method sets quadrupole strength.voidsetRadius(double value) This method sets radius.voidSets parameters values of this element to those in parameter array.toString()Returns the string representation of this element.intupdate()Reads value from associated element or Abean and calculates it's new values.Methods inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractCalibratedMagnet
getCalibrationEntry, getCurrent, invalidateData, isDataInvalidated, updateMatricesMethods inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractMagnetElement
getPowerSupply, getPSMethods inherited from class org.scictrl.mp.orbitcorrect.model.optics.AbstractTransferElement
getAlpha1, getAlpha2, getBeta1, getBeta2, getDispersion1, getDispersion2, getLength, getMatrix, getQ1, getQ2, 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, throwISE
-
Field Details
-
radius
protected double radiusBending radius. -
quadrupoleStrength
protected double quadrupoleStrengthQuadruple strength -
PR_QUADRUPOLE_STRENGTH
public static final int PR_QUADRUPOLE_STRENGTHConstantPR_QUADRUPOLE_STRENGTH=8- See Also:
-
PR_RADIUS
public static final int PR_RADIUSConstantPR_RADIUS=9- See Also:
-
PR_DFIELD
public static final int PR_DFIELDConstantPR_DFIELD=10- See Also:
-
PR_ENERGY
public static final int PR_ENERGYConstantPR_ENERGY=11- See Also:
-
-
Constructor Details
-
AbstractBending
ConstructsAbstractBendingwith specified name and default parameter's values.- Parameters:
name- aStringthe name of abstract bending
-
AbstractBending
public AbstractBending(String name, boolean virtual, double position, double relpos, String relFrom, double length, String ps, String calibrationEntry, double quadrupoleStrength, double radius, double dipoleField, double energy) Constructs theAbstractBendingwith specified parameters.
-
-
Method Details
-
applyField
This method transforms magnetic properties to current and sends it toPowerSupply- Returns:
intindicate if method succeded- Throws:
IllegalStateException- if any.
-
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.
clone.
- Specified by:
clonein interfaceISimpleElement- Overrides:
clonein classAbstractTransferElement- Returns:
- a
Objectthe clone of this element. - See Also:
-
getCalculator
This method returnIBendingCalculatorModel.- Returns:
- a
IBendingCalculatorModelobject - See Also:
-
getDipoleField
public double getDipoleField()This method return dipole field strength- Returns:
- a double
-
getEnergy
public double getEnergy()This method return energy, which is specified by dipole magnetic strength.- Returns:
- a double
-
getMaxEnergy
This method return miximal energy that can be safely exceeded by this magnet.- Returns:
- a double
- Throws:
ControlSystemException- if any.
-
getMinEnergy
This method return minimal energy that can be exceeded by this magnet.- Returns:
- a double
- Throws:
ControlSystemException- if any.
-
getQuadrupoleStrength
public double getQuadrupoleStrength()This method return quadruploe strength.- Returns:
- a double
-
getRadius
public double getRadius()This method return radius, which is specified by dipole magnetic strength.- Returns:
- a double
-
newMatrix
This method return transfer matrix of drift with the same length as this element. This method return transfer matrix, calculated with current length, quadrupole strength and radius.- Overrides:
newMatrixin classAbstractTransferElement- Returns:
- a
TransferMatrixobject - See Also:
-
newMatrix
This method return transfer matrix of drift with the specified length. This method return transfer matrix, calculated with current quadrupole strength, radius and as parameter specified length.- Overrides:
newMatrixin classAbstractTransferElement- Parameters:
length- a double- Returns:
- a
TransferMatrixobject - See Also:
-
setCurrent
public void setCurrent(double value) This method sets current on this element. This method sets current.- Overrides:
setCurrentin classAbstractCalibratedMagnet- Parameters:
value- a double
-
setDipoleField
public void setDipoleField(double value) This method sets dipole field.- Parameters:
value- a double
-
setEnergy
public void setEnergy(double value) This method sets energy.- Parameters:
value- a double
-
setQuadrupoleStrength
public void setQuadrupoleStrength(double value) This method sets quadrupole strength.- Parameters:
value- a double
-
setRadius
This method sets radius.- Parameters:
value- a double- Throws:
IllegalStateException- if any.
-
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.
setWith.
- Overrides:
setWithin classAbstractCalibratedMagnet- 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.
toString.
- Specified by:
toStringin interfaceISimpleElement- Overrides:
toStringin classAbstractCalibratedMagnet- See Also:
-
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 current fromPowerSupplyand transform it to magnetic properties.- Returns:
- a int the return code indicating success
- Throws:
IllegalStateException- thrown if status of DataBush equalsDB_EMPTYDataBushPackedException- contains all exception thrown or caught during updating element
-