Package xal.smf.impl
Class Electromagnet
java.lang.Object
xal.smf.AcceleratorNode
xal.smf.impl.Magnet
xal.smf.impl.Electromagnet
- All Implemented Interfaces:
Comparable,ElementType,MagnetType,DataListener
- Direct Known Subclasses:
Dipole,MagFieldMap,Quadrupole,Sextupole,Solenoid
Electromagnet is the base class representation of an electromagnet.
- Author:
- tap
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal AccessiblePropertystatic final Stringfinal AccessiblePropertyfinal AccessiblePropertyprotected Stringthe ID of this magnet's main power supplystatic final Stringthe node typeprotected booleanFields inherited from class xal.smf.AcceleratorNode
bolIsSoft, bolStatus, bolValid, bucAlign, bucAper, bucTwiss, channelSuite, dblLen, dblPos, dblS, mapAttrs, objAccel, seqParent, strEId, strId, strPIdFields inherited from interface xal.smf.impl.qualify.MagnetType
DIPOLE, HORIZONTAL, NO_ORIENTATION, OCT, OCTUPOLE, poles, QUAD, QUADRUPOLE, SEXT, SEXTUPOLE, SOL, SOLENOID, VERTICAL -
Constructor Summary
ConstructorsConstructorDescriptionElectromagnet(String strId) ConstructorElectromagnet(String strId, ChannelFactory channelFactory) Primary Constructor -
Method Summary
Modifier and TypeMethodDescriptionfindChannel(String handle) Find the channel for the specified handle searching the main supply if necessary.Get a list of properties that can be accessed through EPICS.doubleGet the main power supply current in this electromagnet via ca (A)intGets the cycle state of the magnet.doublegetField()Get the field in this electromagnet via ca.doubleGet the integrated field in this electromagnet T-m/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.doubleGet the field in this electromagnet via ca.doubleGet the value to which the main power supply's field contribution is set.Get the channel handles.Get the main power supply for this magnet.String[]getReadbackHandles(String setHandle) Get the readback handle corresponding to a set channel.getSetHandle(String readbackHandle) Get the set handle corresponding to a readback channel.doubleGet the value to which the field is set including both the main supply and possible trim supply contributions.booleanisChannelSettable(String handle) booleanSince this is an electro-magnet we override the inherited method to advertise this characteristic.doubleGet the field lower settable limit of the main power supply in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.doubleget the main power supply current lower settable limit (A)doubleGet the field lower settable limit of the main power supply in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.doubleGet the field lower settable limit of the main power supply in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.doubleGet the field lower settable limit of the main power supply in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.voidsetCurrent(double newCurrent) set the main power supply current in the magnet (A)voidsetCycleEnable(boolean enable) Set the cycle enable state of the magnet.voidsetField(double newField) Set the main power supply field contribution in the magnet.voidSet the main power supply for this magnet by id.voidsetUseFieldReadback(boolean useFieldReadback) Set whether or not to use the field readback in the getField() method.final doubletoCAFromField(double field) Convert the field value to a channel access value.final doubletoCurrentFromField(double field) Convert the field value to a current value for the power supply.final doubletoFieldFromCA(double rawValue) Convert the raw channel access value to get the field.final doubletoFieldFromCurrent(double current) Convert the current value in the power supply to field value.voidupdate(DataAdaptor adaptor) Update the node with data from the provided adaptor.protected voidupdatePowerSupplies(DataAdaptor powerSupplyAdaptor) Update data from the power supply data adaptor.doubleGet the field upper settable limit of the main power supply in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.doubleget the main power supply current lower settable limit (A)doubleGet the field upper settable limit of the main power supply in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.doubleGet the field upper settable limit of the main power supply in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.doubleGet the field upper settable limit of the main power supply in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.booleanDetermines whether the field readback is used in the getField() method.voidwrite(DataAdaptor adaptor) Encode data from the node into the provided adaptor.protected voidwritePowerSupplies(DataAdaptor powerSupplyAdaptor) Write data to the power supply data adaptor.Methods inherited from class xal.smf.impl.Magnet
addBucket, getConversionFactor, getDesignField, getDfltField, getEffLength, getMagBucket, getNormField, getOrientation, getPolarity, getTangField, isCorrector, isHorizontal, isMagnet, isPole, isSkew, isVertical, setDfltField, setMagBucketMethods inherited from class xal.smf.AcceleratorNode
batchConnectAllHandles, batchConnectAllHandlesAndWait, channelSuite, clear, compareTo, dataLabel, getAccelerator, getAccessibleProperties, getAlign, getAllChannels, getAndConnectChannel, getAndConnectChannelSetAndReadback, getAper, getBucket, getBuckets, getChannel, getDesignPropertyValue, getEId, getId, getLength, getLivePropertyChannels, getLivePropertyValue, getParent, getPId, getPitchAngle, getPosition, getPrimaryAncestor, getProperties, getRollAngle, getSDisplay, getSoftType, getStatus, getTwiss, getType, getValid, getXOffset, getYawAngle, getYOffset, getZOffset, hasBucket, hasParent, isKindOf, lazilyGetAndConnect, removeFromParent, setAccelerator, setAlign, setAper, setDesignPropertyValue, setLength, setLivePropertyValue, setParent, setPitchAngle, setPosition, setRollAngle, setSDisplay, setStatus, setTwiss, setValid, setValueAndVerify, setXOffset, setYawAngle, setYOffset, setZOffset, toString, writeAttributes, writeStatusMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface xal.smf.impl.qualify.ElementType
isKindOf
-
Field Details
-
TYPE
the node type- See Also:
-
FIELD_RB_HANDLE
- See Also:
-
field
-
fieldRBProperty
-
fieldFromCurrent
-
useFieldReadback
protected boolean useFieldReadback -
mainSupplyId
the ID of this magnet's main power supply
-
-
Constructor Details
-
Electromagnet
Primary Constructor -
Electromagnet
Constructor
-
-
Method Details
-
update
Update the node with data from the provided adaptor.- Specified by:
updatein interfaceDataListener- Overrides:
updatein classAcceleratorNode- Parameters:
adaptor- The data provider- Throws:
NumberFormatException
-
updatePowerSupplies
Update data from the power supply data adaptor. Get the main power supply information.- Parameters:
powerSupplyAdaptor- The data provider of power supply information.
-
write
Encode data from the node into the provided adaptor. Overrides to provide support for power supplies.- Specified by:
writein interfaceDataListener- Overrides:
writein classAcceleratorNode- Parameters:
adaptor- The data store
-
writePowerSupplies
Write data to the power supply data adaptor. Put the information about the main power supply into the data adaptor.- Parameters:
powerSupplyAdaptor- The data sink for the power supply information
-
setUseFieldReadback
public void setUseFieldReadback(boolean useFieldReadback) Set whether or not to use the field readback in the getField() method.- Parameters:
useFieldReadback- true to use the field readback and false to use the field setting.
-
useFieldReadback
public boolean useFieldReadback()Determines whether the field readback is used in the getField() method.- Returns:
- true if the field readback is used in getField() and false if instead the field setting is used.
-
getHandles
Get the channel handles. Overrides the default method to add handles from the main power supply.- Overrides:
getHandlesin classAcceleratorNode- Returns:
- The channel handles associated with this node
-
getDefaultHandles
- Overrides:
getDefaultHandlesin classAcceleratorNode- Returns:
- a list with expected channel handles by default.
-
getReadbackHandles
Get the readback handle corresponding to a set channel.- Overrides:
getReadbackHandlesin classAcceleratorNode- Parameters:
setHandle- The set handle. public String getReadbackHandle(String setHandle) {- Returns:
- The corresponding readback handle.
-
getSetHandle
Get the set handle corresponding to a readback channel.- Overrides:
getSetHandlein classAcceleratorNode- Parameters:
readbackHandle- The readback handle.- Returns:
- The corresponding set handle.
-
findChannel
Find the channel for the specified handle searching the main supply if necessary.- Overrides:
findChannelin classAcceleratorNode- Parameters:
handle- The handle for the channel to get.- Returns:
- The channel associated with this node and the specified handle or null if there is no match.
-
isChannelSettable
- Overrides:
isChannelSettablein classAcceleratorNode
-
getMainSupply
Get the main power supply for this magnet.- Returns:
- The main power supply for this magnet
-
setMainSupplyId
Set the main power supply for this magnet by id.- Parameters:
id- Id of main power supply;
-
getAccessibleProperties
Description copied from class:AcceleratorNodeGet a list of properties that can be accessed through EPICS.- Overrides:
getAccessiblePropertiesin classAcceleratorNode- Returns:
- properties that can be accessed via EPICS.
-
setCycleEnable
Set the cycle enable state of the magnet. If enabled, the magnet will be cycled when the field is set.- Parameters:
enable- True to enable cycling; false to disable cycling.- Throws:
PutException
-
getCycleState
Gets the cycle state of the magnet. The magnet may be in one of three states: cycle is invalid (field changed in reverse direction of initial setting), cycling in progress or cycle is valid- Returns:
- One of CYCLE_INVALID, CYCLING or CYCLE_VALID
- Throws:
GetException
-
getField
Get the field in this electromagnet via ca.- Returns:
- the field in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.
- Throws:
GetException
-
getFieldReadback
Get the field in this electromagnet via ca.- Returns:
- the readback field in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.
- Throws:
GetException
-
getFieldInt
Get the integrated field in this electromagnet T-m/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.- Throws:
GetException
-
setField
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.- Parameters:
newField- is the new field level in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.- Throws:
PutException
-
getFieldSetting
Get the value to which the main power supply's field contribution is set. Note that this is not the readback.- Returns:
- the field setting in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.
- Throws:
GetException
-
getTotalFieldSetting
Get the value to which the field is set including both the main supply and possible trim supply contributions. Note that this is not the readback.- Returns:
- the field setting in T/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.
- Throws:
GetException
-
toFieldFromCA
public final double toFieldFromCA(double rawValue) Convert the raw channel access value to get the field.- Parameters:
rawValue- the raw channel value- Returns:
- the magnetic field in T/m^(n-1)
-
toCAFromField
public final double toCAFromField(double field) Convert the field value to a channel access value.- Parameters:
field- the magnetic field in T/m^(n-1)- Returns:
- the channel access value
-
toFieldFromCurrent
public final double toFieldFromCurrent(double current) Convert the current value in the power supply to field value.- Parameters:
current- the current in the magnet in A- Returns:
- the channel access value
-
toCurrentFromField
public final double toCurrentFromField(double field) Convert the field value to a current value for the power supply.- Parameters:
field- the magnetic field in T/m^(n-1)- Returns:
- the channel access value
-
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.- Throws:
GetException
-
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.- Throws:
GetException
-
upperDisplayFieldLimit
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.- Throws:
GetException
-
lowerDisplayFieldLimit
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.- Throws:
GetException
-
upperWarningFieldLimit
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.- Throws:
GetException
-
lowerWarningFieldLimit
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.- Throws:
GetException
-
upperAlarmFieldLimit
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.- Throws:
GetException
-
lowerAlarmFieldLimit
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.- Throws:
GetException
-
getCurrent
Get the main power supply current in this electromagnet via ca (A)- Throws:
GetException
-
setCurrent
set the main power supply current in the magnet (A)- Parameters:
newCurrent- is the new current (A)- Throws:
PutException
-
upperCurrentLimit
get the main power supply current lower settable limit (A)- Throws:
GetException
-
lowerCurrentLimit
get the main power supply current lower settable limit (A)- Throws:
GetException
-
isPermanent
public boolean isPermanent()Since this is an electro-magnet we override the inherited method to advertise this characteristic.- Specified by:
isPermanentin interfaceMagnetType- Overrides:
isPermanentin classMagnet- Returns:
- false since all Electromagnet instances are not permanent magnets.
-