Package gda.device.monitor
Class IonChamberBeamMonitor
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.monitor.MonitorBase
gda.device.monitor.IonChamberBeamMonitor
- All Implemented Interfaces:
Device,IBeamMonitor,Monitor,Scannable,Configurable,Findable,gda.observable.IObservable,gda.observable.IObserver
@ServiceInterface(IBeamMonitor.class)
public class IonChamberBeamMonitor
extends MonitorBase
implements gda.observable.IObserver, IBeamMonitor
A worker object operating at background to monitor the photon beam availability using an ion chamber. This class
monitors the specified ion chamber amplifier value and checks whether it has fallen below a specified threshold. If
so any scan is paused. On reading above the threshold, the paused scan is either resumed or restarted depending on a
java parameter
gda.device.monitor.resumeScan setting. This monitor behaviour can be switched on and off as
required.-
Field Summary
Fields 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, DEFAULT_INPUT_NAME, VALUE_UNAVAILABLE -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor for Castor configuration.IonChamberBeamMonitor(String detectorName, double threshold) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled for every Scannable at the end of a group of nested scans (or a single scan if that is the case).voidCalled for every Scannable at the start of a group of nested scans (or a single scan if that is the case)voidDefault 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.doubleReturns the current value of this monitor.intreturns the number of elements in this monitor.gets the current amplifier objectgets monitor nameReturns the current position of the Scannable.doublegetUnit()gets the physical unit of the monitor.booleanisBeamOn()check if X-ray beam is on or notbooleanchecks beam monitor flagvoidoff()switch off beam monitoringvoidon()switch on beam monitoringvoidsetBeamOn(boolean beamOn) voidsetMonitor(CurrentAmplifier monitor) sets the current amplifier objectvoidsetMonitorName(String monitorName) sets monitor namevoidsetMonitorOn(boolean monitorOn) set beam monitor flagvoidsetThreshold(double threshold) Returns a string representation of the Scannable and its current position/value/statusvoida given number (the default is 5) consecutiveMethods inherited from class gda.device.monitor.MonitorBase
asynchronousMoveTo, isBusyMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanLineEnd, atScanLineStart, checkPositionValid, externalToInternal, getExtraNames, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, internalToExternal, isAt, moveTo, rawAsynchronousMoveTo, rawGetPosition, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, throwExceptionIfInvalidTarget, 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, deleteIObserversMethods inherited from interface gda.device.Scannable
atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanLineEnd, atScanLineStart, checkPositionValid, getExtraNames, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, stop, waitWhileBusy
-
Constructor Details
-
IonChamberBeamMonitor
public IonChamberBeamMonitor()Empty constructor for Castor configuration. -
IonChamberBeamMonitor
Constructor- Parameters:
detectorName- the name of the detector instance.threshold- the threshold when the scan is paused/resumed.
-
-
Method Details
-
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
-
atScanStart
public void atScanStart()Description copied from class:ScannableBaseCalled for every Scannable at the start of a group of nested scans (or a single scan if that is the case) Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atScanStartin interfaceScannable- Overrides:
atScanStartin classScannableBase- See Also:
-
atScanEnd
public void atScanEnd()Description copied from class:ScannableBaseCalled for every Scannable at the end of a group of nested scans (or a single scan if that is the case).Note that this is only called if the Scan finishes normally, or has been requested to finish early. This will not be called if the scan finishes due to an exception of any kind. See
Scannable.atCommandFailure()Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atScanEndin interfaceScannable- Overrides:
atScanEndin classScannableBase- See Also:
-
getThreshold
public double getThreshold()- Returns:
- Returns the threshold.
-
setThreshold
public void setThreshold(double threshold) - Parameters:
threshold- The threshold to set.
-
getPosition
Description copied from class:ScannableBaseReturns the current position of the Scannable. Called by ConcurentScan at the end of the point. Reads an internal (hardware) position from rawGetPosition, converts this to an external (user) position and returns it.- Specified by:
getPositionin interfaceScannable- Overrides:
getPositionin classScannableBase- Returns:
- Current position with an element for each input and extra field. null if their are no fields.
- Throws:
DeviceException
-
getElementCount
Description copied from interface:Monitorreturns the number of elements in this monitor.- Specified by:
getElementCountin interfaceMonitor- Overrides:
getElementCountin classMonitorBase- Returns:
- int the element count
- Throws:
DeviceException
-
getUnit
Description copied from interface:Monitorgets the physical unit of the monitor.- Specified by:
getUnitin interfaceMonitor- Overrides:
getUnitin classMonitorBase- Returns:
- String the physical unit
- Throws:
DeviceException
-
update
a given number (the default is 5) consecutive- Specified by:
updatein interfacegda.observable.IObserver- See Also:
-
isMonitorOn
public boolean isMonitorOn()checks beam monitor flag- Specified by:
isMonitorOnin interfaceIBeamMonitor- Returns:
- boolean
-
setMonitorOn
public void setMonitorOn(boolean monitorOn) set beam monitor flag- Parameters:
monitorOn-
-
on
public void on()switch on beam monitoring- Specified by:
onin interfaceIBeamMonitor
-
off
public void off()switch off beam monitoring- Specified by:
offin interfaceIBeamMonitor
-
toFormattedString
Description copied from interface:ScannableReturns a string representation of the Scannable and its current position/value/statusTypically should return:
name : position
or for detectors, name : status
If the position/status cannot be determined, the function should return
Scannable.VALUE_UNAVAILABLEin its place.- Specified by:
toFormattedStringin interfaceScannable- Overrides:
toFormattedStringin classScannableBase- Returns:
- string as defined above
-
getMonitorName
gets monitor name- Returns:
- monitor name
-
setMonitorName
sets monitor name- Parameters:
monitorName-
-
getMonitor
gets the current amplifier object- Returns:
- the current amplifier object
-
setMonitor
sets the current amplifier object- Parameters:
monitor-
-
isBeamOn
public boolean isBeamOn()Description copied from interface:IBeamMonitorcheck if X-ray beam is on or not- Specified by:
isBeamOnin interfaceIBeamMonitor- Returns:
- boolean
-
setBeamOn
public void setBeamOn(boolean beamOn) - Parameters:
beamOn-
-
getCurrentValue
public double getCurrentValue()Returns the current value of this monitor.- Returns:
- the current value
-