gov.sns.xal.smf.impl
Class Quadrupole

java.lang.Object
  |
  +--gov.sns.xal.smf.AcceleratorNode
        |
        +--gov.sns.xal.smf.impl.Magnet
              |
              +--gov.sns.xal.smf.impl.Electromagnet
                    |
                    +--gov.sns.xal.smf.impl.Quadrupole
All Implemented Interfaces:
DataListener, ElementType, MagnetType
Direct Known Subclasses:
TrimmedQuadrupole

public class Quadrupole
extends Electromagnet

Quadrupole implements an Electromagnet Quadrupole supplied by a single power supply. Unlike many other beam line elements, Quadrupole represents more than one official type (QH and QV) 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 quadrapole isn't of consequence to behavior since the field of the quadrupole (including its sign) and its length characterizes the quadrupole.


Field Summary
static java.lang.String HORIZONTAL_TYPE
           
static java.lang.String s_strType
           
protected  java.lang.String type
           
static java.lang.String VERTICAL_TYPE
           
 
Fields inherited from class gov.sns.xal.smf.impl.Electromagnet
FIELD_RB_HANDLE, mainSupplyId
 
Fields inherited from class gov.sns.xal.smf.impl.Magnet
leff, m_bucMagnet
 
Fields inherited from class gov.sns.xal.smf.AcceleratorNode
channelSuite, m_bolIsSoft, m_bolStatus, m_bolValid, m_bucAlign, m_bucAper, m_bucTwiss, m_dblLen, m_dblPos, m_mapAttrs, m_objAccel, m_seqParent, m_strId
 
Fields inherited from interface gov.sns.xal.smf.impl.qualify.MagnetType
DIPOLE, HORIZONTAL, NO_ORIENTATION, OCT, OCTUPOLE, poles, QUAD, QUADRUPOLE, SEXT, SEXTUPOLE, VERTICAL
 
Constructor Summary
Quadrupole(java.lang.String strId)
          Quadrupole constructor.
 
Method Summary
 double getField()
          Get the field in this electromagnet via ca T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.
 int getOrientation()
          Get the orientation of the magnet as defined by MagnetType.
 java.lang.String getType()
          Override to provide the correct type signature per instance.
 boolean isKindOf(java.lang.String compType)
          Determine if this node is of the specified type.
 boolean isPole(java.lang.String compPole)
          Test if the magnet is of the specified pole type.
 double lowerFieldLimit()
          get the field lower settable limit of the main power supply in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.
 void setField(double newField)
          Set the main power supply field contribution in the magnet.
 void update(DataAdaptor adaptor)
          Update the instance with data from the data adaptor.
 double upperFieldLimit()
          get the field upper settable limit of the main power supply in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.
 
Methods inherited from class gov.sns.xal.smf.impl.Electromagnet
getChannel, getCurrent, getCycleState, getFieldInt, getHandles, getMainSupply, isPermanent, lowerCurrentLimit, setCurrent, setCycleEnable, updatePowerSupplies, upperCurrentLimit, write, writePowerSupplies
 
Methods inherited from class gov.sns.xal.smf.impl.Magnet
addBucket, getDesignField, getDfltField, getEffLength, getMagBucket, getNormField, getPolarity, getTangField, isCorrector, isHorizontal, isMagnet, isSkew, isVertical, setMagBucket
 
Methods inherited from class gov.sns.xal.smf.AcceleratorNode
channelSuite, clear, dataLabel, getAccelerator, getAlign, getAndConnectChannel, getAper, getBucket, getBuckets, getId, getLength, getParent, getPosition, getStatus, getTwiss, getValid, hasBucket, hasParent, lazilyGetAndConnect, removeFromParent, setAccelerator, setAlign, setAper, setLength, setParent, setPosition, setStatus, setTwiss, setValid, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

s_strType

public static final java.lang.String s_strType
See Also:
Constant Field Values

HORIZONTAL_TYPE

public static final java.lang.String HORIZONTAL_TYPE
See Also:
Constant Field Values

VERTICAL_TYPE

public static final java.lang.String VERTICAL_TYPE
See Also:
Constant Field Values

type

protected java.lang.String type
Constructor Detail

Quadrupole

public Quadrupole(java.lang.String strId)
Quadrupole constructor.

Method Detail

getType

public java.lang.String getType()
Override to provide the correct type signature per instance. This is necessary since the Quadrupole class can represent more than one official type (QH or QV).

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 "QH" or "QV".

Specified by:
update in interface DataListener
Overrides:
update in class Electromagnet
Parameters:
adaptor - The data provider.

getField

public double getField()
                throws ConnectionException,
                       GetException
Get the field in this electromagnet via ca T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.

Overrides:
getField in class Electromagnet
ConnectionException
GetException

setField

public void setField(double newField)
              throws ConnectionException,
                     PutException
Set the main power supply field contribution in the magnet. If cycle enable is true then the magnet is cycled before the field is set to the specified value.

Overrides:
setField in class Electromagnet
Parameters:
newField - is the new field level in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.
ConnectionException
PutException

upperFieldLimit

public double upperFieldLimit()
                       throws ConnectionException,
                              GetException
get the field upper settable limit of the main power supply in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.

Overrides:
upperFieldLimit in class Electromagnet
ConnectionException
GetException

lowerFieldLimit

public double lowerFieldLimit()
                       throws ConnectionException,
                              GetException
get the field lower settable limit of the main power supply in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.

Overrides:
lowerFieldLimit in class Electromagnet
ConnectionException
GetException

isPole

public boolean isPole(java.lang.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: QH or QV

Specified by:
getOrientation in interface MagnetType
Overrides:
getOrientation in class Magnet
Returns:
One of HORIZONTAL or VERTICAL

isKindOf

public boolean isKindOf(java.lang.String compType)
Determine if this node is of the specified type. Override the default method since a 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.