Package gda.px
Class WheelAttenuators
- All Implemented Interfaces:
Attenuator,Device,Scannable,InitializationListener,Configurable,Findable,gda.observable.IObservable,gov.aps.jca.event.MonitorListener,EventListener
@ServiceInterface(Attenuator.class)
public class WheelAttenuators
extends ScannableBase
implements Attenuator, gov.aps.jca.event.MonitorListener, InitializationListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected gov.aps.jca.Channelprotected gov.aps.jca.Channelprotected EpicsChannelManagerprotected EpicsControllerprotected gov.aps.jca.Channelprotected gov.aps.jca.Channelprotected gov.aps.jca.Channel[]protected gov.aps.jca.Channelprotected gov.aps.jca.Channelprotected gov.aps.jca.ChannelFields inherited from class gda.device.scannable.ScannableBase
__doc__, DEFAULT_INPUT_NAME, DEFAULT_OUTPUT_FORMAT, extraNames, inputNames, level, outputFormatFields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTYFields inherited from interface gda.device.Scannable
ATTR_NEXUS_CATEGORY, ATTR_NX_CLASS, VALUE_UNAVAILABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidDefault implementation for classes that do not have to do any specific configuration.
Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.doubledoublegetClosestMatchTransmission(double transmission) Using the current beam energy, calculates the closest achievable transmission value to the given value with the set of filtersgetClosestMatchTransmission(double transmission, double energyInKeV) Uses the given energy in the calculationdoubleboolean[]Returns array (indexing over filter elements) answering the question:
"Is this filter required to be in the beam (to achieve the closest match transmission)?",
as per the requested transmission most recently supplied to theAttenuator.getClosestMatchTransmission(double)method.doubleReturns the stored desired transmission value.String[]Names available filtersboolean[]Returns array (indexing over filter elements) answering the question:
"Is filter (presently) in the beam?".intCounts the filters availabledoubleThe current transmission, assuming the energy has not changed since the last filter adjustment.voidCalled when all critical channels are connected.booleanisBusy()Check if the Scannable is moving/operating.booleanisReady()Determines if correct filters are in place (as attenuator makes a change of transmission): Compares the results ofAttenuator.getFilterPositions()withAttenuator.getDesiredFilterPositions().voidmonitorChanged(gov.aps.jca.event.MonitorEvent arg0) voidTrigger a move/operation and block until completion.voidrawAsynchronousMoveTo(Object position) [Consider abstract] Trigger a move/operation to an internal/hardware position and return immediately.voidsetAutoMoveAlwaysYes(boolean autoMoveAlwaysYes) voidvoidsetDoneChannelPvs(List<String> doneChannelPvs) voidsetToggleAuto(boolean toggleAuto) doublesetTransmission(double transmission) Changes the attenuation level to the closest achievable transmission to the given value.Methods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, asynchronousMoveTo, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, checkPositionValid, externalToInternal, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, rawGetPosition, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, throwExceptionIfInvalidTarget, toFormattedString, toString, validateScannable, valueUnavailableString, waitWhileBusy, waitWhileBusyMethods inherited from class gda.device.DeviceBase
addIObserver, close, deleteIObserver, deleteIObservers, getAttribute, getName, getProtectionLevel, isBeingObserved, isConfigureAtStartup, notifyIObservers, setAttribute, setConfigureAtStartup, setName, setProtectionLevelMethods inherited from class gda.factory.ConfigurableBase
isConfigured, reconfigure, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.device.Device
close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObservers
-
Field Details
-
controller
-
channelManager
-
desiredEnergy
protected gov.aps.jca.Channel desiredEnergy -
actualEnergy
protected gov.aps.jca.Channel actualEnergy -
desiredTransmission
protected gov.aps.jca.Channel desiredTransmission -
actualTransmission
protected gov.aps.jca.Channel actualTransmission -
moveAutomatically
protected gov.aps.jca.Channel moveAutomatically -
moveToCurrentValues
protected gov.aps.jca.Channel moveToCurrentValues -
doneChannels
protected gov.aps.jca.Channel[] doneChannels -
useCurrentEnergy
protected gov.aps.jca.Channel useCurrentEnergy
-
-
Constructor Details
-
WheelAttenuators
public WheelAttenuators()
-
-
Method Details
-
setBasePv
-
setToggleAuto
public void setToggleAuto(boolean toggleAuto) -
setAutoMoveAlwaysYes
public void setAutoMoveAlwaysYes(boolean autoMoveAlwaysYes) -
getDoneChannelPvs
-
setDoneChannelPvs
-
configure
Description copied from class:ConfigurableBaseDefault implementation for classes that do not have to do any specific configuration.
Classes that do their own configuration should *not* call this superclass function, as it may cause the object to appear configured before it really is.- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classConfigurableBase- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
getClosestMatchEnergy
- Specified by:
getClosestMatchEnergyin interfaceAttenuator- Returns:
- double - the actual energy used in calculations to determine the filter set to achieve the desired transmission
- Throws:
DeviceException
-
getClosestMatchTransmission
Description copied from interface:AttenuatorUsing the current beam energy, calculates the closest achievable transmission value to the given value with the set of filters- Specified by:
getClosestMatchTransmissionin interfaceAttenuator- Parameters:
transmission-- Returns:
- double the closest transmission value that could be achieved
- Throws:
DeviceException
-
getClosestMatchTransmission
public ClosestMatchTransmission getClosestMatchTransmission(double transmission, double energyInKeV) throws DeviceException Description copied from interface:AttenuatorUses the given energy in the calculation- Specified by:
getClosestMatchTransmissionin interfaceAttenuator- Parameters:
transmission- transmission (0 to 1)energyInKeV- x-ray energy in the stated units- Throws:
DeviceException
-
getDesiredEnergy
- Specified by:
getDesiredEnergyin interfaceAttenuator- Returns:
- double - the desired energy to use in calculations to determine the filter set to achieve the desired transmission
- Throws:
DeviceException
-
getDesiredFilterPositions
Description copied from interface:AttenuatorReturns array (indexing over filter elements) answering the question:
"Is this filter required to be in the beam (to achieve the closest match transmission)?",
as per the requested transmission most recently supplied to theAttenuator.getClosestMatchTransmission(double)method.- Specified by:
getDesiredFilterPositionsin interfaceAttenuator- Throws:
DeviceException
-
getDesiredTransmission
Description copied from interface:AttenuatorReturns the stored desired transmission value.- Specified by:
getDesiredTransmissionin interfaceAttenuator- Returns:
- the stored desired transmission value
- Throws:
DeviceException
-
getFilterNames
Description copied from interface:AttenuatorNames available filters- Specified by:
getFilterNamesin interfaceAttenuator- Returns:
- the names of the filters in this attenuator
- Throws:
DeviceException
-
getFilterPositions
Description copied from interface:AttenuatorReturns array (indexing over filter elements) answering the question:
"Is filter (presently) in the beam?".- Specified by:
getFilterPositionsin interfaceAttenuator- Throws:
DeviceException
-
isReady
Description copied from interface:AttenuatorDetermines if correct filters are in place (as attenuator makes a change of transmission): Compares the results ofAttenuator.getFilterPositions()withAttenuator.getDesiredFilterPositions().- Specified by:
isReadyin interfaceAttenuator- Throws:
DeviceException
-
getNumberFilters
Description copied from interface:AttenuatorCounts the filters available- Specified by:
getNumberFiltersin interfaceAttenuator- Returns:
- the number of filters in this attenuator
- Throws:
DeviceException
-
getTransmission
Description copied from interface:AttenuatorThe current transmission, assuming the energy has not changed since the last filter adjustment.- Specified by:
getTransmissionin interfaceAttenuator- Returns:
- the current actual transmission
- Throws:
DeviceException
-
setTransmission
Description copied from interface:AttenuatorChanges the attenuation level to the closest achievable transmission to the given value. This uses the current beam energy in its calculations.- Specified by:
setTransmissionin interfaceAttenuator- Parameters:
transmission- the desired transmission- Returns:
- the actual transmission value achieved
- Throws:
DeviceException
-
rawAsynchronousMoveTo
Description copied from class:ScannableBase[Consider abstract] Trigger a move/operation to an internal/hardware position and return immediately.- Overrides:
rawAsynchronousMoveToin classScannableBase- Parameters:
position- Position in its internal/hardware representation. e.g. with units and offsets removed- Throws:
DeviceException- See Also:
-
moveTo
Description copied from class:ScannableBaseTrigger a move/operation and block until completion. If this is overridden, asynchronousMoveTo must also be valid, and the externalToInternal conversion must be applied.- Specified by:
moveToin interfaceScannable- Overrides:
moveToin classScannableBase- Parameters:
position-- Throws:
DeviceException
-
monitorChanged
public void monitorChanged(gov.aps.jca.event.MonitorEvent arg0) - Specified by:
monitorChangedin interfacegov.aps.jca.event.MonitorListener
-
initializationCompleted
public void initializationCompleted() throws InterruptedException, DeviceException, gov.aps.jca.TimeoutException, gov.aps.jca.CAExceptionDescription copied from interface:InitializationListenerCalled when all critical channels are connected.- Specified by:
initializationCompletedin interfaceInitializationListener- Throws:
InterruptedExceptionDeviceExceptiongov.aps.jca.TimeoutExceptiongov.aps.jca.CAException
-
isBusy
Description copied from interface:ScannableCheck if the Scannable is moving/operating.- Specified by:
isBusyin interfaceScannable- Returns:
- true - if operation carried out by moveTo has not completed yet
- Throws:
DeviceException
-