Class 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 Details

    • PR_CALIBRATION_ENTRY

      public static final int PR_CALIBRATION_ENTRY
      Constant PR_CALIBRATION_ENTRY=7
      See Also:
    • calibrationEntry

      protected String calibrationEntry
      Calibration entry name.
    • calc

      protected IMagnetCalculatorModel calc
      Calibration calculator object.
    • dataInvalidated

      protected boolean dataInvalidated
      Data invalidated.
    • current

      protected double current
      Electrical current in magnets.
  • Constructor Details

    • AbstractCalibratedMagnet

      public AbstractCalibratedMagnet(String name)
      Constructs AbstractCalibratedMagnet with specified name and default parameter's values.
      Parameters:
      name - a String name of transfer element
    • AbstractCalibratedMagnet

      public AbstractCalibratedMagnet(String name, boolean virtual, double position, double relpos, String relFrom, double length, String ps, String calibrationEntry)
      Constructs the AbstractCalibratedMagnet with specified parameters.
      Parameters:
      name - a String object
      virtual - a boolean
      position - a double
      relpos - a double
      relFrom - a String object
      length - a double
      ps - a String object
      calibrationEntry - a String object
  • Method Details

    • getCalibrationEntry

      public String 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()
      Sets DataInvalidated flag to true. 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 interface AbstractUpdateableElement
      Specified by:
      invalidateData in interface IApplyableElement
      See Also:
    • isDataInvalidated

      public boolean isDataInvalidated()
      Returns true 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 interface AbstractUpdateableElement
      Specified by:
      isDataInvalidated in interface IApplyableElement
      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

      public void setWith(Object[] par) throws IllegalStateException
      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 not null object in array.

      setWith.

      setWith.

      setWith.

      setWith.

      Overrides:
      setWith in class AbstractMagnetElement
      Parameters:
      par - an array of Object objects
      Throws:
      IllegalStateException - if element is initialized and inside DataBush.
      See Also:
    • toString

      public String 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 interface ISimpleElement
      Overrides:
      toString in class AbstractMagnetElement
      See Also:
    • updateMatrices

      protected void updateMatrices()

      updateMatrices.