gov.sns.xal.smf.impl
Class PermQuadrupole
java.lang.Object
|
+--gov.sns.xal.smf.AcceleratorNode
|
+--gov.sns.xal.smf.impl.Magnet
|
+--gov.sns.xal.smf.impl.PermanentMagnet
|
+--gov.sns.xal.smf.impl.PermQuadrupole
- All Implemented Interfaces:
- DataListener, ElementType, MagnetType
- 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 quadrapole isn't of consequence to behavior since the
field of the quadrupole (including its sign) and its length characterizes
the quadrupole.
| 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 |
PermQuadrupole(java.lang.String strId)
PermQuadrupole constructor |
|
Method Summary |
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. |
void |
update(DataAdaptor adaptor)
Update the instance with data from the data adaptor. |
| 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, getChannel, getHandles, getId, getLength, getParent, getPosition, getStatus, getTwiss, getValid, hasBucket, hasParent, lazilyGetAndConnect, removeFromParent, setAccelerator, setAlign, setAper, setLength, setParent, setPosition, setStatus, setTwiss, setValid, toString, write |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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
PermQuadrupole
public PermQuadrupole(java.lang.String strId)
- PermQuadrupole constructor
getType
public java.lang.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(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: PMQH or PMQV
- 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 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.