Class Quadrupole

All Implemented Interfaces:
Cloneable, ISimpleElement, AbstractUpdateableElement, IApplyableElement

public class Quadrupole extends AbstractCalibratedMagnet
Quadrupole is magnetic element that holds mainly quadrupole strength.
Author:
igor@scictrl.com
  • Field Details

    • PR_QUADRUPOLE_STRENGTH

      public static final int PR_QUADRUPOLE_STRENGTH
      Constant PR_QUADRUPOLE_STRENGTH=8
      See Also:
  • Constructor Details

    • Quadrupole

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

      public Quadrupole(String name, boolean virtual, double position, double relpos, String relFrom, double length, String ps, String calibrationEntry, double quadrupoleStrength)
      Constructs the Quadrupole 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
      quadrupoleStrength - a double
  • Method Details

    • applyField

      public int applyField() throws IllegalStateException
      This method sends current to PowerSupply
      Returns:
      int indicate if method succeded
      Throws:
      IllegalStateException - if any.
    • clone

      public Object 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:
      clone in interface ISimpleElement
      Overrides:
      clone in class AbstractTransferElement
      Returns:
      a Object the clone of this element.
      See Also:
    • descriptor

      public DBElementDescriptor descriptor()
      Returns the descriptor object for this element. DBElementDescriptor helps manipulating DataBush elements dynamically.

      descriptor.

      Specified by:
      descriptor in class AbstractDataBushElement
      Returns:
      the descriptor object for this element.
      See Also:
    • elType

      public int elType()
      Returns the code of element's type.

      elType.

      Specified by:
      elType in class AbstractDataBushElement
      Returns:
      the code of element's type.
      See Also:
    • getCalculator

      public IMagnetCalculatorModel getCalculator()
      This method returns IMagnetCalculatorModel.
      Returns:
      a IMagnetCalculatorModel object
      See Also:
    • getMaxQuadrupoleStrength

      public double getMaxQuadrupoleStrength() throws ControlSystemException
      This method returns maximal quadrupole strength, which can be achived. It depends of maximal current.
      Returns:
      a double
      Throws:
      ControlSystemException - if any.
    • getMinQuadrupoleStrength

      public double getMinQuadrupoleStrength() throws ControlSystemException
      This method returns minimal quadrupole strength, which can be achived. It depends of minimal current.
      Returns:
      a double
      Throws:
      ControlSystemException - if any.
    • getQuadrupoleStrength

      public double getQuadrupoleStrength()
      This method returns quadrupole strength.
      Returns:
      a double
    • newMatrix

      public TransferMatrix 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:
      newMatrix in class AbstractTransferElement
      Returns:
      a TransferMatrix object
      See Also:
    • newMatrix

      public TransferMatrix newMatrix(double length)
      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:
      newMatrix in class AbstractTransferElement
      Parameters:
      length - a double
      Returns:
      a TransferMatrix object
      See Also:
    • setCurrent

      public void setCurrent(double value)
      This method sets current on this element. This method sets current.
      Overrides:
      setCurrent in class AbstractCalibratedMagnet
      Parameters:
      value - a double
    • setQuadrupoleStrength

      public void setQuadrupoleStrength(double value)
      This method sets quadrupole strength. ICalculatorModelFactory calculate necessary current and this method sets it.
      Parameters:
      value - 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.

      setWith.

      Overrides:
      setWith in class AbstractCalibratedMagnet
      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.

      toString.

      Specified by:
      toString in interface ISimpleElement
      Overrides:
      toString in class AbstractCalibratedMagnet
      See Also:
    • update

      public int update() throws IllegalStateException, DataBushPackedException
      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 checks isDataInvalidated() 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 to false. 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 energy from PowerSupply and transform it to magnetic properties of this element.
      Returns:
      a int the return code indicating success
      Throws:
      IllegalStateException - thrown if status of DataBush equals DB_EMPTY
      DataBushPackedException - contains all exception thrown or caught during updating element