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 AccessibleProperty
static final String
final AccessibleProperty
final AccessibleProperty
protected String
the ID of this magnet's main power supplystatic final String
the node typeprotected boolean
Fields 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
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.double
Get the main power supply current in this electromagnet via ca (A)int
Gets the cycle state of the magnet.double
getField()
Get the field in this electromagnet via ca.double
Get the integrated field in this electromagnet T-m/(m^(n-1)), where n = 1 for dipole, 2 for quad, etc.double
Get the field in this electromagnet via ca.double
Get 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.double
Get the value to which the field is set including both the main supply and possible trim supply contributions.boolean
isChannelSettable
(String handle) boolean
Since this is an electro-magnet we override the inherited method to advertise this characteristic.double
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.double
get the main power supply current lower settable limit (A)double
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.double
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.double
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
setCurrent
(double newCurrent) set the main power supply current in the magnet (A)void
setCycleEnable
(boolean enable) Set the cycle enable state of the magnet.void
setField
(double newField) Set the main power supply field contribution in the magnet.void
Set the main power supply for this magnet by id.void
setUseFieldReadback
(boolean useFieldReadback) Set whether or not to use the field readback in the getField() method.final double
toCAFromField
(double field) Convert the field value to a channel access value.final double
toCurrentFromField
(double field) Convert the field value to a current value for the power supply.final double
toFieldFromCA
(double rawValue) Convert the raw channel access value to get the field.final double
toFieldFromCurrent
(double current) Convert the current value in the power supply to field value.void
update
(DataAdaptor adaptor) Update the node with data from the provided adaptor.protected void
updatePowerSupplies
(DataAdaptor powerSupplyAdaptor) Update data from the power supply data adaptor.double
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.double
get the main power supply current lower settable limit (A)double
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.double
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.double
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.boolean
Determines whether the field readback is used in the getField() method.void
write
(DataAdaptor adaptor) Encode data from the node into the provided adaptor.protected void
writePowerSupplies
(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, setMagBucket
Methods 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, 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
-
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:
update
in interfaceDataListener
- Overrides:
update
in 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:
write
in interfaceDataListener
- Overrides:
write
in 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:
getHandles
in classAcceleratorNode
- Returns:
- The channel handles associated with this node
-
getDefaultHandles
- Overrides:
getDefaultHandles
in classAcceleratorNode
- Returns:
- a list with expected channel handles by default.
-
getReadbackHandles
Get the readback handle corresponding to a set channel.- Overrides:
getReadbackHandles
in 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:
getSetHandle
in 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:
findChannel
in 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:
isChannelSettable
in 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:AcceleratorNode
Get a list of properties that can be accessed through EPICS.- Overrides:
getAccessibleProperties
in 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:
isPermanent
in interfaceMagnetType
- Overrides:
isPermanent
in classMagnet
- Returns:
- false since all Electromagnet instances are not permanent magnets.
-