Class HardwareTriggeredNexusXmapImpl
- All Implemented Interfaces:
SimulatedTriggerObserver,Detector,HardwareTriggerableDetector,HardwareTriggeredDetector,NexusDetector,HardwareTriggeredNexusXmap,Device,Scannable,PositionCallableProvider<NexusTreeProvider>,XmapDetector,Configurable,Findable,gda.observable.IObservable,gda.observable.IObserver,Serializable
- See Also:
-
Field Summary
Fields inherited from class gda.device.detector.DetectorBase
collectionTimeFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidHook 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 every scanvoidCalled for every Scannable at the start of a group of nested scans (or a single scan if that is the case)voidclear()Clear all MCA'svoidClears all MCAs and starts data collectionvoidTells the detector to begin to collect a set of data, then returns immediately.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.booleanReturns a value which indicates whether the detector creates its own files.doubleReturns the time for which the detector is set to acquire dataLightly to be only implemented on the server.int[][]getData()Returns the data array of all the MCAsint[]getData(int mcaNumber) Returns the data array of the specified MCAString[]Additional names for extra values that returned by getPosition().String[]gets a array of InputNames used by moveTo of this scannable.intReturns current number of Bins/channels for spectrum acquisition in each MCAintReturns the number of MCAs currently connected to the XMap detectorintReturns the total number of ROIs currently setString[]Returns an array of strings which are the format strings to use when pretty printing parts of the outputdoubleReturns the current rate at which data is read in the Epics interfacedoubleReturns the elapsed real time after a read status operationdouble[]getROICounts(int iRoi) Gets the count for each mca for a given ROI.double[]Returns the sum of the corresponding ROIs of all the MCA.intintReturns the status of the detectordoubleReturns the current set rate at which status is read in the Epics interfacegetXmap()booleanDetectors that sample some value at the time of a trigger should return False.booleanisBusy()Check if the Scannable is moving/operating.booleanbooleanbooleanisSlave()booleanisStillWriting(String fileName) voidDefault which should be overridden by subclasses.readout()Returns the latest data collected.doubleReads out the scaler data of the roi counts, corrects for deadtime and returns the sum.voidsetAcquisitionTime(double time) Tells the detector for how many seconds to acquire datavoidsetController(EDXDMappingController controller) voidsetIntegrateBetweenPoints(boolean integrateBetweenPoints) voidsetNthROI(double[][] rois, int roiIndex) Sets a ROI for all of the MCAsvoidsetNumberOfBins(int numberOfBins) Sets maximum numbers of bins/channels to use for spectrum acquisition in each MCAvoidsetReadRate(double readRate) Sets the rate at which data is read in the Epics interfacevoidsetROIs(double[][] rois) Sets the ROIs of all the MCA.voidsetScanNumberOfPoints(int scanNumberOfPoints) voidsetSlave(boolean slave) voidsetStatusRate(double statusRate) Sets the rate at which status is read in the Epics interfacevoidvoidstart()Start data acquisition in all MCA'svoidstop()Stop the current move/operation.voidvoidvoidwaitForFile(String fileName) Methods inherited from class gda.device.detector.hardwaretriggerable.HardwareTriggerableDetectorBase
getHardwareTriggerProvider, getNumberImagesToCollect, isHardwareTriggering, setHardwareTriggering, setHardwareTriggerProvider, setNumberImagesToCollectMethods inherited from class gda.device.detector.DetectorBase
asynchronousMoveTo, checkPositionValid, endCollection, getCollectionTime, getDataDimensions, getPosition, setCollectionTime, toFormattedStringMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanLineEnd, externalToInternal, getLevel, 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.Detector
endCollection, getCollectionTime, getDataDimensions, getFileStructure, setCollectionTime, waitWhileBusyMethods inherited from interface gda.device.Device
close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.device.detector.hardwaretriggerable.HardwareTriggerableDetector
isHardwareTriggering, setHardwareTriggeringMethods inherited from interface gda.device.detector.hardwaretriggerable.HardwareTriggeredDetector
getHardwareTriggerProvider, setNumberImagesToCollectMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObserversMethods inherited from interface gda.device.Scannable
asynchronousMoveTo, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanLineEnd, checkPositionValid, getLevel, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, toFormattedString
-
Constructor Details
-
HardwareTriggeredNexusXmapImpl
public HardwareTriggeredNexusXmapImpl()
-
-
Method Details
-
getXmap
- Specified by:
getXmapin interfaceHardwareTriggeredNexusXmap
-
setXmap
-
getController
-
setController
-
getScanNumberOfPoints
public int getScanNumberOfPoints() -
setScanNumberOfPoints
public void setScanNumberOfPoints(int scanNumberOfPoints) -
configure
public void 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
-
clear
Description copied from interface:XmapDetectorClear all MCA's- Specified by:
clearin interfaceXmapDetector- Throws:
DeviceException
-
clearAndStart
Description copied from interface:XmapDetectorClears all MCAs and starts data collection- Specified by:
clearAndStartin interfaceXmapDetector- Throws:
DeviceException
-
getAcquisitionTime
Description copied from interface:XmapDetectorReturns the time for which the detector is set to acquire data- Specified by:
getAcquisitionTimein interfaceXmapDetector- Returns:
- time
- Throws:
DeviceException
-
getChannelLabels
Description copied from interface:XmapDetectorLightly to be only implemented on the server.- Specified by:
getChannelLabelsin interfaceXmapDetector- Returns:
- the labels for the channels defined by the user.
-
getData
Description copied from interface:XmapDetectorReturns the data array of the specified MCA- Specified by:
getDatain interfaceXmapDetector- Parameters:
mcaNumber-- Returns:
- data array
- Throws:
DeviceException
-
getData
Description copied from interface:XmapDetectorReturns the data array of all the MCAs- Specified by:
getDatain interfaceXmapDetector- Returns:
- array of data arrays
- Throws:
DeviceException
-
getNumberOfBins
Description copied from interface:XmapDetectorReturns current number of Bins/channels for spectrum acquisition in each MCA- Specified by:
getNumberOfBinsin interfaceXmapDetector- Returns:
- numberOfBins
- Throws:
DeviceException
-
getNumberOfMca
Description copied from interface:XmapDetectorReturns the number of MCAs currently connected to the XMap detector- Specified by:
getNumberOfMcain interfaceXmapDetector- Returns:
- number of MCA
- Throws:
DeviceException
-
getNumberOfROIs
Description copied from interface:XmapDetectorReturns the total number of ROIs currently set- Specified by:
getNumberOfROIsin interfaceXmapDetector- Returns:
- number of ROIs
- Throws:
DeviceException
-
getROICounts
Description copied from interface:XmapDetectorGets the count for each mca for a given ROI.- Specified by:
getROICountsin interfaceXmapDetector- Parameters:
iRoi-- Returns:
- double[] of counts per mca for this roi
- Throws:
DeviceException
-
getROIsSum
Description copied from interface:XmapDetectorReturns the sum of the corresponding ROIs of all the MCA. For e.g if the MCAs have three ROIs each say R0, R1 and R2. This method sums up the R0 of all the MCA R1 of all the MCAs and so on- Specified by:
getROIsSumin interfaceXmapDetector- Returns:
- ROI sum array
- Throws:
DeviceException
-
getReadRate
Description copied from interface:XmapDetectorReturns the current rate at which data is read in the Epics interface- Specified by:
getReadRatein interfaceXmapDetector- Returns:
- readRate
- Throws:
DeviceException
-
getRealTime
Description copied from interface:XmapDetectorReturns the elapsed real time after a read status operation- Specified by:
getRealTimein interfaceXmapDetector- Returns:
- real time
- Throws:
DeviceException
-
getStatus
Description copied from interface:XmapDetectorReturns the status of the detector- Specified by:
getStatusin interfaceDetector- Specified by:
getStatusin interfaceXmapDetector- Returns:
- Detector.IDLE/BUSY
- Throws:
DeviceException
-
getStatusRate
Description copied from interface:XmapDetectorReturns the current set rate at which status is read in the Epics interface- Specified by:
getStatusRatein interfaceXmapDetector- Returns:
- status rate
- Throws:
DeviceException
-
readoutScalerData
Description copied from interface:XmapDetectorReads out the scaler data of the roi counts, corrects for deadtime and returns the sum.- Specified by:
readoutScalerDatain interfaceXmapDetector- Returns:
- The FF data
- Throws:
DeviceException
-
setAcquisitionTime
Description copied from interface:XmapDetectorTells the detector for how many seconds to acquire data- Specified by:
setAcquisitionTimein interfaceXmapDetector- Parameters:
time-- Throws:
DeviceException
-
setNthROI
Description copied from interface:XmapDetectorSets a ROI for all of the MCAs- Specified by:
setNthROIin interfaceXmapDetector- Parameters:
rois- This array length should be same as the number of MCAsroiIndex-- Throws:
DeviceException
-
setNumberOfBins
Description copied from interface:XmapDetectorSets maximum numbers of bins/channels to use for spectrum acquisition in each MCA- Specified by:
setNumberOfBinsin interfaceXmapDetector- Parameters:
numberOfBins-- Throws:
DeviceException
-
setROIs
Description copied from interface:XmapDetectorSets the ROIs of all the MCA. Use this method only if you want to set all the MCA with the same ROIs.To set different ROI for each of the MCA use setNthROI method.- Specified by:
setROIsin interfaceXmapDetector- Parameters:
rois- array. Each roi should have a low and high value.- Throws:
DeviceException
-
setReadRate
Description copied from interface:XmapDetectorSets the rate at which data is read in the Epics interface- Specified by:
setReadRatein interfaceXmapDetector- Parameters:
readRate-- Throws:
DeviceException
-
setStatusRate
Description copied from interface:XmapDetectorSets the rate at which status is read in the Epics interface- Specified by:
setStatusRatein interfaceXmapDetector- Parameters:
statusRate-- Throws:
DeviceException
-
getExtraNames
Description copied from interface:ScannableAdditional names for extra values that returned by getPosition().- Specified by:
getExtraNamesin interfaceScannable- Overrides:
getExtraNamesin classScannableBase- Returns:
- array of names of the extra elements if the array returned by getPosition is larger than the array required by moveTo
-
getInputNames
Description copied from interface:Scannablegets a array of InputNames used by moveTo of this scannable.- Specified by:
getInputNamesin interfaceScannable- Overrides:
getInputNamesin classScannableBase- Returns:
- array of the names of the elements of the object returned by getPosition
-
getOutputFormat
Description copied from interface:ScannableReturns an array of strings which are the format strings to use when pretty printing parts of the output- Specified by:
getOutputFormatin interfaceScannable- Overrides:
getOutputFormatin classScannableBase- Returns:
- string array
-
start
Description copied from interface:XmapDetectorStart data acquisition in all MCA's- Specified by:
startin interfaceXmapDetector- Throws:
DeviceException
-
collectData
Description copied from interface:DetectorTells the detector to begin to collect a set of data, then returns immediately. Should cause the hardware to start collecting immediately: if there is any delay then detectors used in the same scan would collect over different times when beam conditions may differ.- Specified by:
collectDatain interfaceDetector- Throws:
DeviceException
-
createsOwnFiles
Description copied from interface:DetectorReturns a value which indicates whether the detector creates its own files. If it does (return true) the readout() method returns the name of the latest file created as a string. If it does not (return false) the readout() method will return the data directly.- Specified by:
createsOwnFilesin interfaceDetector- Returns:
- true if readout() returns filenames
- Throws:
DeviceException
-
getDescription
- Specified by:
getDescriptionin interfaceDetector- Overrides:
getDescriptionin classDetectorBase- Returns:
- A description of the detector.
- Throws:
DeviceException
-
getDetectorID
- Specified by:
getDetectorIDin interfaceDetector- Overrides:
getDetectorIDin classDetectorBase- Returns:
- A identifier for this detector.
- Throws:
DeviceException
-
getDetectorType
- Specified by:
getDetectorTypein interfaceDetector- Overrides:
getDetectorTypein classDetectorBase- Returns:
- The type of detector.
- Throws:
DeviceException
-
readout
Description copied from interface:DetectorReturns the latest data collected. The size of the Object returned must be consistent with the values returned by getDataDimensions and getExtraNames.If
LocalProperties.GDA_SCAN_CONCURRENTSCAN_READOUT_CONCURRENTLYis true then motors may be moved while the detector readouts. The value returned must not be effected by any concurrent motor or shutter movements. SeeDetector.waitWhileBusy()andConcurrentScan. Readout must block until the detector is ready to respond quickly toDetector.collectData()again.- Specified by:
readoutin interfaceDetector- Specified by:
readoutin interfaceNexusDetector- Returns:
- the data collected
- Throws:
DeviceException
-
prepareForCollection
Description copied from class:DetectorBaseDefault which should be overridden by subclasses.- Specified by:
prepareForCollectionin interfaceDetector- Overrides:
prepareForCollectionin classDetectorBase- 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- Specified by:
stopin interfaceXmapDetector- Overrides:
stopin classScannableBase- Throws:
DeviceException- See Also:
-
update
- Specified by:
updatein interfacegda.observable.IObserver
-
getPositionCallable
- Specified by:
getPositionCallablein interfacePositionCallableProvider<NexusTreeProvider>- Throws:
DeviceException
-
atScanLineStart
Description copied from class:ScannableBaseCalled for every Scannable at the start of every scan Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atScanLineStartin interfaceScannable- Overrides:
atScanLineStartin classScannableBase- Throws:
DeviceException- See Also:
-
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:
-
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:
-
waitForCurrentScanFile
- Specified by:
waitForCurrentScanFilein interfaceHardwareTriggeredNexusXmap- Throws:
DeviceExceptionInterruptedException
-
waitForFile
- Specified by:
waitForFilein interfaceHardwareTriggeredNexusXmap- Throws:
DeviceExceptionInterruptedException
-
isStillWriting
- Throws:
DeviceException
-
integratesBetweenPoints
public boolean integratesBetweenPoints()Description copied from interface:HardwareTriggeredDetectorDetectors that sample some value at the time of a trigger should return False. Detectors such as counter timers should return True. If true ,TrajectoryScanLine will generate a trigger half a point before the motor reaches a demanded point such that the resulting bin of data is centred on the demand position. Area detectors that will be triggered by the first pulse should also return true.- Specified by:
integratesBetweenPointsin interfaceHardwareTriggeredDetector- Returns:
- true for detectors that integrates b
-
getHDFFileName
- Specified by:
getHDFFileNamein interfaceHardwareTriggeredNexusXmap- Throws:
DeviceException
-
isInBufferMode
- Specified by:
isInBufferModein interfaceHardwareTriggeredNexusXmap- Throws:
Exception
-
isSlave
public boolean isSlave() -
setSlave
public void setSlave(boolean slave) -
isIntegrateBetweenPoints
public boolean isIntegrateBetweenPoints() -
setIntegrateBetweenPoints
public void setIntegrateBetweenPoints(boolean integrateBetweenPoints) -
isBusy
Description copied from class:DetectorBaseCheck if the Scannable is moving/operating. default implementation is to call the getStatus method- Specified by:
isBusyin interfaceScannable- Overrides:
isBusyin classDetectorBase- Returns:
- true - if operation carried out by moveTo has not completed yet
- Throws:
DeviceException- See Also:
-