gov.sns.xal.smf.impl
Class Magnet

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

public abstract class Magnet
extends AcceleratorNode
implements MagnetType

The abstract Magnet Class element. This class contains elements common to all magnets in an accelerator.


Field Summary
 double leff
          The effective magnetic length (m)
protected  MagnetBucket m_bucMagnet
          The container for the magnet information
 
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
Magnet(java.lang.String strId)
           
 
Method Summary
 void addBucket(AttributeBucket buc)
          Override AcceleratorNode implementation to check for a MultipoleBucket
 double getDesignField()
          get the design field for the magnet (T for dipole, T/m for quad, etc.)
 double getDfltField()
          get the default magnetic field
 double getEffLength()
          get the effective magnetic length (m)
 MagnetBucket getMagBucket()
           
 double[] getNormField()
          get Normal fields
 int getOrientation()
          Get the orientation of the magnet as defined by MagnetType.
 double getPolarity()
          get magnet polarity
 double[] getTangField()
          get tangential fields
 boolean isCorrector()
          Determine whether this magnet is a corrector.
 boolean isHorizontal()
           
 boolean isMagnet()
          Override the inherited method to be true since all magnets are of the magnet type.
 boolean isPermanent()
          Get whether this magnet is a permanent magnet or an electromagnet.
 boolean isPole(java.lang.String compPole)
          Test if the magnet is of the specified pole type.
 boolean isSkew()
          Determine whether this magnet is a skew magnet.
 boolean isVertical()
           
 void setMagBucket(MagnetBucket buc)
          Set the attribute bucket containing the machine magnet info
 
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, getType, getValid, hasBucket, hasParent, isKindOf, lazilyGetAndConnect, removeFromParent, setAccelerator, setAlign, setAper, setLength, setParent, setPosition, setStatus, setTwiss, setValid, toString, update, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gov.sns.xal.smf.impl.qualify.ElementType
isKindOf
 

Field Detail

leff

public double leff
The effective magnetic length (m)


m_bucMagnet

protected MagnetBucket m_bucMagnet
The container for the magnet information

Constructor Detail

Magnet

public Magnet(java.lang.String strId)
Method Detail

getMagBucket

public MagnetBucket getMagBucket()
Returns:
the attribute bucket containing the machine multipole fields

setMagBucket

public void setMagBucket(MagnetBucket buc)
Set the attribute bucket containing the machine magnet info


addBucket

public void addBucket(AttributeBucket buc)
Override AcceleratorNode implementation to check for a MultipoleBucket

Overrides:
addBucket in class AcceleratorNode

isMagnet

public boolean isMagnet()
Override the inherited method to be true since all magnets are of the magnet type.

Specified by:
isMagnet in interface ElementType
Overrides:
isMagnet in class AcceleratorNode
Returns:
true

isPole

public boolean isPole(java.lang.String compPole)
Test if the magnet is of the specified pole type. MagnetType defines the list of accepted pole types.

Specified by:
isPole in interface MagnetType
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.

Specified by:
getOrientation in interface MagnetType
Returns:
One of HORIZONTAL, VERTICAL or NO_ORIENTATION

isHorizontal

public final boolean isHorizontal()
Specified by:
isHorizontal in interface MagnetType

isVertical

public final boolean isVertical()
Specified by:
isVertical in interface MagnetType

isSkew

public boolean isSkew()
Determine whether this magnet is a skew magnet.

Specified by:
isSkew in interface MagnetType
Returns:
true if the magnet is skew and false otherwise.

isPermanent

public boolean isPermanent()
Get whether this magnet is a permanent magnet or an electromagnet.

Specified by:
isPermanent in interface MagnetType
Returns:
true if the magnet is permanent and false otherwise.

isCorrector

public boolean isCorrector()
Determine whether this magnet is a corrector.

Specified by:
isCorrector in interface MagnetType
Returns:
true if this magnet is a corrector.

getDesignField

public double getDesignField()
get the design field for the magnet (T for dipole, T/m for quad, etc.)


getEffLength

public double getEffLength()
get the effective magnetic length (m)


getDfltField

public double getDfltField()
get the default magnetic field


getPolarity

public double getPolarity()
get magnet polarity


getNormField

public double[] getNormField()
get Normal fields


getTangField

public double[] getTangField()
get tangential fields