Class HidenRGAScannable
- All Implemented Interfaces:
Device,HidenRGA,Scannable,Configurable,Findable,gda.observable.IObservable,gda.observable.IObserver
It will be shared across different beamlines but only Spectroscopy ones for the moment. If other beamlines need this then this class maybe should be moved into its a different repository.
This class operates in two modes: either it can be part of a stwp scan, but it will force the scan to run slow enough that the Hiden can take a new reading for every data point.
Alternatively it will write its own file and take readings as fast as it can and add timestamps so that the data can be compared with fly scan data offline.
If it is already recording to a file and it is included in a scan that it will throw an exception which will abort the scan.
-
Field Summary
FieldsFields 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 TypeMethodDescriptionvoidaddToOutputFile(String message) Add a message to the RGA data file.voidHook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred.voidCalled 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.doubleintintReturns the current position of the Scannable.booleanisBusy()Check if the Scannable is moving/operating.booleanvoidsetCollectionRate(double collectionRate) Set the time in seconds between writing data to file in recording mode.voidsetController(HidenRGAController controller) voidsetEpicsPrefix(String epicsPrefix) voidsetMasses(int[] masses) voidsetUseAuxiliaryInputs(boolean useAuxiliaryInputs) voidStart recording RGA data to an ASCII file with a unique name in the current visit data directory.voidstop()Stop the current move/operation.voidReturns a string representation of the Scannable and its current position/value/statusvoidMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, asynchronousMoveTo, 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, 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, deleteIObservers
-
Field Details
-
RECORDING_STARTED
- See Also:
-
RECORDING_STOPPED
- See Also:
-
-
Constructor Details
-
HidenRGAScannable
public HidenRGAScannable()
-
-
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
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- Throws:
DeviceException- See Also:
-
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- Throws:
DeviceException- See Also:
-
stop
Description copied from class:ScannableBaseStop the current move/operation. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
stopin interfaceScannable- Overrides:
stopin classScannableBase- Throws:
DeviceException- See Also:
-
atCommandFailure
Description copied from class:ScannableBaseHook to be used by Scan and pos commands to inform the Scannable that an exception, such as a DeviceExcpetion, has occurred. However not called when the command is aborted using an InterruptionException. If a Scan is aborted then onlyScannable.stop()will be called by the Scan or pos command.Useful for telling Scannables which hold state during a scan for example, to reset themselves. Used for example by CoordinatedMotionScannables. This hook should be used not in the same way as the stop hook. Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.
- Specified by:
atCommandFailurein interfaceScannable- Overrides:
atCommandFailurein classScannableBase- Throws:
DeviceException- See Also:
-
startRecording
Description copied from interface:HidenRGAStart recording RGA data to an ASCII file with a unique name in the current visit data directory.The rate at which data is recording is determined by the collection rate attribute.
- Specified by:
startRecordingin interfaceHidenRGA- Throws:
IOException
-
stopRecording
public void stopRecording()- Specified by:
stopRecordingin interfaceHidenRGA
-
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
-
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
-
isBusy
Description copied from interface:ScannableCheck if the Scannable is moving/operating.- Specified by:
isBusyin interfaceHidenRGA- Specified by:
isBusyin interfaceScannable- Returns:
- true - if operation carried out by moveTo has not completed yet
- Throws:
DeviceException
-
getController
-
setController
-
getEpicsPrefix
-
setEpicsPrefix
-
getMasses
-
setMasses
public void setMasses(int[] masses) -
getCollectionRate
public double getCollectionRate()- Specified by:
getCollectionRatein interfaceHidenRGA
-
setCollectionRate
public void setCollectionRate(double collectionRate) Description copied from interface:HidenRGASet the time in seconds between writing data to file in recording mode.If invalid input: '<'= 0 then data will be recorded as fast as the RGA collects it, if >=1 then GDA will wait a minimum of that value in seconds before recording the next line of data.
- Specified by:
setCollectionRatein interfaceHidenRGA
-
update
- Specified by:
updatein interfacegda.observable.IObserver
-
isUseAuxiliaryInputs
public boolean isUseAuxiliaryInputs() -
setUseAuxiliaryInputs
public void setUseAuxiliaryInputs(boolean useAuxiliaryInputs) -
addToOutputFile
Add a message to the RGA data file. This can be used for recording, say, scan numbers and sample conditions to allow them to be easily linked to the corresponding RGA data- Parameters:
message-
-
getBarChartPressures
- Specified by:
getBarChartPressuresin interfaceHidenRGA- Throws:
IOException
-
getNumBarChartPressures
public int getNumBarChartPressures()- Specified by:
getNumBarChartPressuresin interfaceHidenRGA
-
getNumberOfMassChannels
public int getNumberOfMassChannels()- Specified by:
getNumberOfMassChannelsin interfaceHidenRGA
-