Package xal.smf.impl

Class PermQuadrupole

All Implemented Interfaces:
Comparable, ElementType, MagnetType, DataListener

public class PermQuadrupole extends PermanentMagnet
PermQuadrupole implements an Permanent magnet Quadrupole. Unlike many other beam line elements, PermQuadrupole represents more than one official type (PMQH and PMQV) as specified by the naming convention. In order to support this feature we override the getType(), update() and isKindOf() methods. The vertical and horizontal reference to a quadrupole isn't of consequence to behavior since the field of the quadrupole (including its sign) and its length characterizes the quadrupole.
Author:
tap
  • Field Details

  • Constructor Details

    • PermQuadrupole

      public PermQuadrupole(String strId, ChannelFactory channelFactory)
      PermQuadrupole constructor
    • PermQuadrupole

      public PermQuadrupole(String strId)
      PermQuadrupole constructor
  • Method Details

    • getType

      public String getType()
      Override to provide the correct type signature per instance. This is necessary since the PermQuadrupole class can represent more than one official type (PMQH or PMQV).
      Specified by:
      getType in class AcceleratorNode
      Returns:
      The official type consistent with the naming convention.
    • update

      public void update(DataAdaptor adaptor)
      Update the instance with data from the data adaptor. Overrides the default implementation to set the quadrupole type since a quadrupole type can be either "PMQH" or "PMQV".
      Specified by:
      update in interface DataListener
      Overrides:
      update in class AcceleratorNode
      Parameters:
      adaptor - The data provider.
    • isPole

      public boolean isPole(String compPole)
      Description copied from class: Magnet
      Test if the magnet is of the specified pole type. MagnetType defines the list of accepted pole types.
      Specified by:
      isPole in interface MagnetType
      Overrides:
      isPole in class Magnet
      Parameters:
      compPole - Comparison pole which should be one of MagnetType.poles
      Returns:
      true if the magnet is of the specified pole.
    • getOrientation

      public int getOrientation()
      Get the orientation of the magnet as defined by MagnetType. The orientation of the quad is determined by its type: PMQH or PMQV
      Specified by:
      getOrientation in interface MagnetType
      Overrides:
      getOrientation in class Magnet
      Returns:
      One of HORIZONTAL or VERTICAL
    • isKindOf

      public boolean isKindOf(String compType)
      Determine if this node is of the specified type. Override the default method since a permanent quadrupole could represent either a vertical or horizontal type. Must also handle inheritance checking so we must or the direct type comparison with the inherited type checking.
      Specified by:
      isKindOf in interface ElementType
      Overrides:
      isKindOf in class AcceleratorNode
      Parameters:
      compType - The type to compare against.
      Returns:
      true if the node is a match and false otherwise.