Package xal.smf.impl
Class Magnet
java.lang.Object
xal.smf.AcceleratorNode
xal.smf.impl.Magnet
- All Implemented Interfaces:
Comparable
,ElementType
,MagnetType
,DataListener
- Direct Known Subclasses:
Electromagnet
,PermanentMagnet
The abstract Magnet Class element. This class contains elements common to all
magnets in an accelerator.
- Author:
- J. Galambos
-
Field Summary
FieldsFields inherited from class xal.smf.AcceleratorNode
bolIsSoft, bolStatus, bolValid, bucAlign, bucAper, bucTwiss, channelSuite, dblLen, dblPos, dblS, mapAttrs, objAccel, seqParent, strEId, strId, strPId
Fields inherited from interface xal.smf.impl.qualify.MagnetType
DIPOLE, HORIZONTAL, NO_ORIENTATION, OCT, OCTUPOLE, poles, QUAD, QUADRUPOLE, SEXT, SEXTUPOLE, SOL, SOLENOID, VERTICAL
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructorprotected
Magnet
(String strId, ChannelFactory channelFactory) Primary Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBucket
(AttributeBucket buc) Override AcceleratorNode implementation to check for a MultipoleBucketdouble
A magnet may have defined a (simple) conversion factor between the effective magnetic field and the current applied.double
get the design field for the magnet (T for dipole, T/m for quad, etc.)double
get the default magnetic fielddouble
get the effective magnetic length (m)double[]
get Normal fieldsint
Get the orientation of the magnet as defined by MagnetType.double
get magnet polaritydouble[]
get tangential fieldsboolean
Determine whether this magnet is a corrector.final boolean
Determine whether this magnet is oriented horizontally.boolean
isMagnet()
Override the inherited method to be true since all magnets are of the magnet type.boolean
Get whether this magnet is a permanent magnet or an electromagnet.boolean
Test if the magnet is of the specified pole type.boolean
isSkew()
Determine whether this magnet is a skew magnet.final boolean
Determine whether this magnet is oriented vertically.void
setDfltField
(double field) Method setDfltFieldvoid
setMagBucket
(MagnetBucket buc) Set the attribute bucket containing the machine magnet infoMethods inherited from class xal.smf.AcceleratorNode
batchConnectAllHandles, batchConnectAllHandlesAndWait, channelSuite, clear, compareTo, dataLabel, findChannel, getAccelerator, getAccessibleProperties, getAccessibleProperties, getAlign, getAllChannels, getAndConnectChannel, getAndConnectChannelSetAndReadback, getAper, getBucket, getBuckets, getChannel, getDefaultHandles, getDesignPropertyValue, getEId, getHandles, getId, getLength, getLivePropertyChannels, getLivePropertyValue, getParent, getPId, getPitchAngle, getPosition, getPrimaryAncestor, getProperties, getReadbackHandles, getRollAngle, getSDisplay, getSetHandle, getSoftType, getStatus, getTwiss, getType, getValid, getXOffset, getYawAngle, getYOffset, getZOffset, hasBucket, hasParent, isChannelSettable, isKindOf, lazilyGetAndConnect, removeFromParent, setAccelerator, setAlign, setAper, setDesignPropertyValue, setLength, setLivePropertyValue, setParent, setPitchAngle, setPosition, setRollAngle, setSDisplay, setStatus, setTwiss, setValid, setValueAndVerify, setXOffset, setYawAngle, setYOffset, setZOffset, toString, update, write, writeAttributes, writeStatus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface xal.smf.impl.qualify.ElementType
isKindOf
-
Field Details
-
bucMagnet
The container for the magnet information
-
-
Constructor Details
-
Magnet
Primary Constructor -
Magnet
Constructor
-
-
Method Details
-
getMagBucket
- Returns:
- the attribute bucket containing the machine multipole fields
-
setMagBucket
Set the attribute bucket containing the machine magnet info -
addBucket
Override AcceleratorNode implementation to check for a MultipoleBucket- Overrides:
addBucket
in classAcceleratorNode
-
isMagnet
public boolean isMagnet()Override the inherited method to be true since all magnets are of the magnet type.- Specified by:
isMagnet
in interfaceElementType
- Overrides:
isMagnet
in classAcceleratorNode
- Returns:
- true
-
isPole
Test if the magnet is of the specified pole type. MagnetType defines the list of accepted pole types.- Specified by:
isPole
in interfaceMagnetType
- 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 interfaceMagnetType
- Returns:
- One of HORIZONTAL, VERTICAL or NO_ORIENTATION
-
isHorizontal
public final boolean isHorizontal()Determine whether this magnet is oriented horizontally.- Specified by:
isHorizontal
in interfaceMagnetType
- Returns:
- true if this magnet is oriented horizontally; false otherwise.
-
isVertical
public final boolean isVertical()Determine whether this magnet is oriented vertically.- Specified by:
isVertical
in interfaceMagnetType
- Returns:
- true if this magnet is oriented vertically; false otherwise.
-
isSkew
public boolean isSkew()Determine whether this magnet is a skew magnet.- Specified by:
isSkew
in interfaceMagnetType
- 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 interfaceMagnetType
- 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 interfaceMagnetType
- 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 -
getConversionFactor
public double getConversionFactor()A magnet may have defined a (simple) conversion factor between the effective magnetic field and the current applied. Useful for simulating with current parameters.- Returns:
- The conversion factor field/current [T/m^n/A]
-
getNormField
public double[] getNormField()get Normal fields -
getTangField
public double[] getTangField()get tangential fields -
setDfltField
public void setDfltField(double field) Method setDfltField- Parameters:
field
- the default magnetic field to be changed to.
-