Class EpicsXspress3Controller
- All Implemented Interfaces:
Configurable,Findable,Xspress3Controller
- Direct Known Subclasses:
EpicsXspress3MiniController
Functionality outside of the this class which is relevant: file saving,
-
Field Summary
Fields -
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.voidconfigureHDFDimensions(int[] scanDimensions) Set HDF writer 'extra dimensions' PVs from the scan dimensions (up to 3-dimensional shape).protected EpicsXspress3ControllerPvProvidercreatePvProvider(String epicsTemplate, int defaultNumberOfDetectorChannels) voiddoErase()voiddoReset()voiddoStart()voiddoStop()voidStop the hdf file writervoidenableChannel(int channel, boolean doEnable) intintintUsed to derive the available PVs.intintintprotected EpicsXspress3ControllerPvProviderInteger[]getROILimits(int channel, int roiNumber) getSCAAttrName(int channel, int scaler) intintintInteger[]getWindows(int channel, int windowNumber) protected Integer[][]invertIntegerArray(Integer[][] returnValuesWrongOrder) isBusy()booleanisChannelEnabled(int channel) booleanbooleanmonitorReadyForNextRow(ReadyForNextRow readyForNextRow) protected Double[][]readDoubleWaveform(ReadOnlyPV<Double[]>[] pvs, int startFrame, int finalFrame, int startChannel, int finalChannel) protected Integer[][]readIntegerWaveform(ReadOnlyPV<Integer[]>[] pvs, int startFrame, int finalFrame, int startChannel, int finalChannel) double[][]readoutDTCorrectedLatestMCA(int startChannel, int finalChannel) The latest available MCA in the record.double[][]readoutDTCorrectedLatestSummedMCA(int startChannel, int finalChannel) Double[][][]readoutDTCorrectedROI(int startFrame, int finalFrame, int startChannel, int finalChannel) The deadtime corrected number of counts in each ROI.Double[][]readoutDTCorrectedSCA1(int startFrame, int finalFrame, int startChannel, int finalChannel) Dead-time corrected in-window scaler counts, for window 1Double[][]readoutDTCorrectedSCA2(int startFrame, int finalFrame, int startChannel, int finalChannel) Dead-time corrected in-window scaler counts, for window 2Integer[][]readoutDTCParameters(int startChannel, int finalChannel) The dead-time parametersInteger[][][]readoutScalerValues(int startFrame, int finalFrame, int startChannel, int finalChannel) Array of scaler stats.protected Integer[][][]reorderScalerValues(Integer[][][] returnValuesWrongOrder) voidsetArrayCounter(int n) voidvoidsetDefaultNumberOfChannels(int defaultNumberOfDetectorChannels) voidsetEpicsTemplate(String epicsTemplate) voidsetFileArrayCounter(int arrayCounter) voidsetFileCaptureMode(CAPTURE_MODE captureMode) voidsetFileEnableCallBacks(UPDATE_CTRL callback) voidsetFilePath(String path) voidsetFilePrefix(String template) voidsetFileTemplate(String fileTemplate) voidsetHDFAttributes(boolean b) voidsetHDFExtraDimensions(int extraDimensions) voidsetHDFFileAutoIncrement(boolean b) voidsetHDFLazyOpen(boolean b) voidsetHDFNDArrayPort(String port) voidsetHDFNDAttributeChunk(int chunk) voidsetHDFNumFramesChunks(int i) voidsetHDFNumFramesToAcquire(int i) voidsetHDFPerformance(boolean b) voidsetHDFPositionMode(boolean positionMode) voidvoidsetIocVersion3(boolean version3) voidsetNextFileNumber(int nextNumber) voidsetNumberROIToRead(int numRoiToRead) voidsetNumFramesToAcquire(Integer numFrames) voidsetPerformROICalculations(Boolean doCalcs) voidsetPerformROIUpdates(Boolean doUpdates) voidsetPointsPerRow(Integer pointsPerRow) voidsetROILimits(int channel, int roiNumber, int[] lowHighMCAChannels) voidsetSavingFiles(Boolean saveFiles) voidsetStoreAttributesUsingExraDims(boolean useExtraDims) voidsetTriggerMode(TRIGGER_MODE mode) voidsetUseErasePv(boolean useErasePv) voidsetUseNewEpicsInterface(boolean useNewEpicsInterface) voidsetWindows(int channel, int windowNumber, int[] lowHighScalerWindowChannels) protected voidintwaitUntilFrameAvailable(int desiredPoint) Methods inherited from class gda.factory.FindableConfigurableBase
getName, setNameMethods inherited from class gda.factory.ConfigurableBase
isConfigureAtStartup, isConfigured, reconfigure, setConfigured
-
Field Details
-
epicsTemplate
-
defaultNumberOfDetectorChannels
protected int defaultNumberOfDetectorChannels
-
-
Constructor Details
-
EpicsXspress3Controller
public EpicsXspress3Controller()
-
-
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- Specified by:
configurein interfaceXspress3Controller- Overrides:
configurein classConfigurableBase- Throws:
FactoryException- if there is an error in configuration e.g. required variable not set or cannot connect to device
-
getPvProvider
- Throws:
DeviceException
-
createPvProvider
protected EpicsXspress3ControllerPvProvider createPvProvider(String epicsTemplate, int defaultNumberOfDetectorChannels) -
getNumberROIToRead
public int getNumberROIToRead()- Specified by:
getNumberROIToReadin interfaceXspress3Controller- Returns:
- the number of roi which will be read out by the readoutDTCorrectedROI method.
-
setNumberROIToRead
- Specified by:
setNumberROIToReadin interfaceXspress3Controller- Throws:
IllegalArgumentException- - if the value given is too high for the implementation
-
getNumberOfChannels
public int getNumberOfChannels()Used to derive the available PVs.- Specified by:
getNumberOfChannelsin interfaceXspress3Controller
-
setDefaultNumberOfChannels
public void setDefaultNumberOfChannels(int defaultNumberOfDetectorChannels) -
doStart
- Specified by:
doStartin interfaceXspress3Controller- Throws:
DeviceException
-
isSavingFiles
- Specified by:
isSavingFilesin interfaceXspress3Controller- Throws:
DeviceException
-
setSavingFiles
- Specified by:
setSavingFilesin interfaceXspress3Controller- Throws:
DeviceException
-
doStopSavingFiles
Description copied from interface:Xspress3ControllerStop the hdf file writer- Specified by:
doStopSavingFilesin interfaceXspress3Controller- Throws:
DeviceException
-
doStop
- Specified by:
doStopin interfaceXspress3Controller- Throws:
DeviceException
-
doErase
- Specified by:
doErasein interfaceXspress3Controller- Throws:
DeviceException
-
doReset
- Specified by:
doResetin interfaceXspress3Controller- Throws:
DeviceException
-
setArrayCounter
- Specified by:
setArrayCounterin interfaceXspress3Controller- Throws:
DeviceException
-
getNumFramesToAcquire
- Specified by:
getNumFramesToAcquirein interfaceXspress3Controller- Throws:
DeviceException
-
setNumFramesToAcquire
- Specified by:
setNumFramesToAcquirein interfaceXspress3Controller- Throws:
DeviceException
-
setPointsPerRow
- Specified by:
setPointsPerRowin interfaceXspress3Controller- Throws:
DeviceException
-
setPerformROICalculations
- Specified by:
setPerformROICalculationsin interfaceXspress3Controller- Throws:
DeviceException
-
getPerformROICalculations
- Throws:
DeviceException
-
setTriggerMode
- Specified by:
setTriggerModein interfaceXspress3Controller- Throws:
DeviceException
-
getTriggerMode
- Specified by:
getTriggerModein interfaceXspress3Controller- Throws:
DeviceException
-
setFileEnableCallBacks
- Specified by:
setFileEnableCallBacksin interfaceXspress3Controller- Throws:
DeviceException
-
setFileCaptureMode
- Specified by:
setFileCaptureModein interfaceXspress3Controller- Throws:
DeviceException
-
setFileArrayCounter
- Specified by:
setFileArrayCounterin interfaceXspress3Controller- Throws:
DeviceException
-
isBusy
- Specified by:
isBusyin interfaceXspress3Controller- Throws:
DeviceException
-
isConnected
- Specified by:
isConnectedin interfaceXspress3Controller- Throws:
DeviceException
-
getStatusMessage
- Specified by:
getStatusMessagein interfaceXspress3Controller- Throws:
DeviceException
-
getStatus
- Specified by:
getStatusin interfaceXspress3Controller- Returns:
- - matches values in the Detector interface getStatus().
}
invalid @link
{@link #Detector.getStatus() - Throws:
DeviceException
-
getNumFramesPerReadout
- Specified by:
getNumFramesPerReadoutin interfaceXspress3Controller- Returns:
- - the number of frames EPICS reads per readout
- Throws:
DeviceException
-
getTotalFramesAvailable
- Specified by:
getTotalFramesAvailablein interfaceXspress3Controller- Returns:
- - the total number of frames of data available in memory for reading out.
- Throws:
DeviceException
-
getTotalHDFFramesAvailable
- Specified by:
getTotalHDFFramesAvailablein interfaceXspress3Controller- Throws:
DeviceException
-
getMaxNumberFrames
- Specified by:
getMaxNumberFramesin interfaceXspress3Controller- Throws:
DeviceException
-
setPerformROIUpdates
- Throws:
DeviceException
-
getPerformROIUpdates
- Throws:
DeviceException
-
readoutDTCorrectedSCA1
public Double[][] readoutDTCorrectedSCA1(int startFrame, int finalFrame, int startChannel, int finalChannel) throws DeviceException Description copied from interface:Xspress3ControllerDead-time corrected in-window scaler counts, for window 1Use the value from
Xspress3Controller.getTotalFramesAvailable()to know what frames will have valid data in- Specified by:
readoutDTCorrectedSCA1in interfaceXspress3Controller- Parameters:
startFrame-finalFrame-startChannel-finalChannel-- Returns:
- Double[frame][channel]
- Throws:
DeviceException
-
readoutDTCorrectedSCA2
public Double[][] readoutDTCorrectedSCA2(int startFrame, int finalFrame, int startChannel, int finalChannel) throws DeviceException Description copied from interface:Xspress3ControllerDead-time corrected in-window scaler counts, for window 2Use the value from
Xspress3Controller.getTotalFramesAvailable()to know what frames will have valid data in- Specified by:
readoutDTCorrectedSCA2in interfaceXspress3Controller- Parameters:
startFrame-finalFrame-startChannel-finalChannel-- Returns:
- Double[frame][channel]
- Throws:
DeviceException
-
readoutScalerValues
public Integer[][][] readoutScalerValues(int startFrame, int finalFrame, int startChannel, int finalChannel) throws DeviceException Description copied from interface:Xspress3ControllerArray of scaler stats.Use the value from
Xspress3Controller.getTotalFramesAvailable()to know what frames will have valid data in- Specified by:
readoutScalerValuesin interfaceXspress3Controller- Parameters:
startFrame-finalFrame-startChannel-finalChannel-- Returns:
- int[frame][channel][time,reset ticks, reset counts,all events, all goodEvents, pileup counts]
- Throws:
DeviceException
-
reorderScalerValues
-
readoutDTCParameters
Description copied from interface:Xspress3ControllerThe dead-time parametersUse the value from
Xspress3Controller.getTotalFramesAvailable()to know what frames will have valid data in- Specified by:
readoutDTCParametersin interfaceXspress3Controller- Parameters:
startChannel-finalChannel-- Returns:
- int[channel][allGoodGradient,allGoodOffset,inWindowGradient, inWindowOffset]
- Throws:
DeviceException
-
readoutDTCorrectedROI
public Double[][][] readoutDTCorrectedROI(int startFrame, int finalFrame, int startChannel, int finalChannel) throws DeviceException Description copied from interface:Xspress3ControllerThe deadtime corrected number of counts in each ROI.Use the value from
Xspress3Controller.getTotalFramesAvailable()to know what frames will have valid data in- Specified by:
readoutDTCorrectedROIin interfaceXspress3Controller- Parameters:
startFrame-finalFrame-startChannel-finalChannel-- Returns:
- Double[frame][detector channel][ROIs]
- Throws:
DeviceException
-
readoutDTCorrectedLatestMCA
public double[][] readoutDTCorrectedLatestMCA(int startChannel, int finalChannel) throws DeviceException Description copied from interface:Xspress3ControllerThe latest available MCA in the record. When running a series of time frames, there is no guarentee how up to date this is.This is only for indicating the quality of the MCA rather than returning a specific MCA spectrum.
The MCA will be written to file by the underlying EPICS.
- Specified by:
readoutDTCorrectedLatestMCAin interfaceXspress3Controller- Parameters:
startChannel-finalChannel-- Returns:
- Double[detector channel][mca channel]
- Throws:
DeviceException
-
setDeadTimeCorrectionInputArrayPort
- Specified by:
setDeadTimeCorrectionInputArrayPortin interfaceXspress3Controller- Throws:
DeviceException
-
updateArrays
- Throws:
DeviceException
-
readoutDTCorrectedLatestSummedMCA
public double[][] readoutDTCorrectedLatestSummedMCA(int startChannel, int finalChannel) throws DeviceException - Specified by:
readoutDTCorrectedLatestSummedMCAin interfaceXspress3Controller- Parameters:
startChannel-finalChannel-- Returns:
- Double[detector channel][mca channel]
- Throws:
DeviceException
-
setROILimits
public void setROILimits(int channel, int roiNumber, int[] lowHighMCAChannels) throws DeviceException - Specified by:
setROILimitsin interfaceXspress3Controller- Parameters:
channel-roiNumber-lowHighMCAChannels- [lowChannel,highChannel]- Throws:
DeviceException
-
getROILimits
- Specified by:
getROILimitsin interfaceXspress3Controller- Parameters:
channel-roiNumber-- Returns:
- int[] [lowChannel,highChannel]
- Throws:
DeviceException
-
setWindows
public void setWindows(int channel, int windowNumber, int[] lowHighScalerWindowChannels) throws DeviceException - Specified by:
setWindowsin interfaceXspress3Controller- Parameters:
channel-windowNumber-lowHighScalerWindowChannels- [lowChannel,highChannel]- Throws:
DeviceException
-
getWindows
- Specified by:
getWindowsin interfaceXspress3Controller- Parameters:
channel-windowNumber-- Returns:
- int[] [lowChannel,highChannel]
- Throws:
DeviceException
-
getEpicsTemplate
-
setEpicsTemplate
-
readDoubleWaveform
protected Double[][] readDoubleWaveform(ReadOnlyPV<Double[]>[] pvs, int startFrame, int finalFrame, int startChannel, int finalChannel) throws DeviceException - Throws:
DeviceException
-
readIntegerWaveform
protected Integer[][] readIntegerWaveform(ReadOnlyPV<Integer[]>[] pvs, int startFrame, int finalFrame, int startChannel, int finalChannel) throws DeviceException - Throws:
DeviceException
-
invertIntegerArray
-
setFilePath
- Specified by:
setFilePathin interfaceXspress3Controller- Throws:
DeviceException
-
setFilePrefix
- Specified by:
setFilePrefixin interfaceXspress3Controller- Throws:
DeviceException
-
setNextFileNumber
- Specified by:
setNextFileNumberin interfaceXspress3Controller- Throws:
DeviceException
-
getFilePath
- Specified by:
getFilePathin interfaceXspress3Controller- Throws:
DeviceException
-
getFilePrefix
- Specified by:
getFilePrefixin interfaceXspress3Controller- Throws:
DeviceException
-
getNextFileNumber
- Specified by:
getNextFileNumberin interfaceXspress3Controller- Throws:
DeviceException
-
getFullFileName
- Specified by:
getFullFileNamein interfaceXspress3Controller- Returns:
- String - the full file path of the HDF file being written, or the last one written
- Throws:
DeviceException
-
setHDFFileAutoIncrement
- Specified by:
setHDFFileAutoIncrementin interfaceXspress3Controller- Throws:
DeviceException
-
setHDFAttributes
- Specified by:
setHDFAttributesin interfaceXspress3Controller- Throws:
DeviceException
-
setHDFPerformance
- Specified by:
setHDFPerformancein interfaceXspress3Controller- Throws:
DeviceException
-
setHDFLazyOpen
- Specified by:
setHDFLazyOpenin interfaceXspress3Controller- Throws:
DeviceException
-
setHDFNumFramesChunks
- Specified by:
setHDFNumFramesChunksin interfaceXspress3Controller- Throws:
DeviceException
-
setHDFNumFramesToAcquire
- Specified by:
setHDFNumFramesToAcquirein interfaceXspress3Controller- Throws:
DeviceException
-
isChannelEnabled
- Specified by:
isChannelEnabledin interfaceXspress3Controller- Throws:
DeviceException
-
enableChannel
- Specified by:
enableChannelin interfaceXspress3Controller- Throws:
DeviceException
-
getNumberOfRois
public int getNumberOfRois()- Specified by:
getNumberOfRoisin interfaceXspress3Controller
-
getMcaSize
public int getMcaSize()- Specified by:
getMcaSizein interfaceXspress3Controller
-
waitUntilFrameAvailable
- Specified by:
waitUntilFrameAvailablein interfaceXspress3Controller- Throws:
DeviceException
-
monitorReadyForNextRow
public ReadyForNextRow monitorReadyForNextRow(ReadyForNextRow readyForNextRow) throws DeviceException - Specified by:
monitorReadyForNextRowin interfaceXspress3Controller- Throws:
DeviceException
-
setIocVersion3
public void setIocVersion3(boolean version3) -
getSCAAttrName
- Throws:
IOExceptionDeviceException
-
setUseNewEpicsInterface
public void setUseNewEpicsInterface(boolean useNewEpicsInterface) -
configureHDFDimensions
Description copied from interface:Xspress3ControllerSet HDF writer 'extra dimensions' PVs from the scan dimensions (up to 3-dimensional shape). The number of extra dimensions is set to 0 for a 1-dimensional scan.- Specified by:
configureHDFDimensionsin interfaceXspress3Controller- Parameters:
scanDimensions- - number of points in each dimension of the scan- Throws:
DeviceException
-
setHDFExtraDimensions
- Specified by:
setHDFExtraDimensionsin interfaceXspress3Controller- Throws:
DeviceException
-
setStoreAttributesUsingExraDims
- Specified by:
setStoreAttributesUsingExraDimsin interfaceXspress3Controller- Throws:
DeviceException
-
setHDFNDArrayPort
- Specified by:
setHDFNDArrayPortin interfaceXspress3Controller- Throws:
DeviceException
-
setFileTemplate
- Specified by:
setFileTemplatein interfaceXspress3Controller- Throws:
DeviceException
-
setHDFXML
- Specified by:
setHDFXMLin interfaceXspress3Controller- Throws:
DeviceException
-
setHDFNDAttributeChunk
- Specified by:
setHDFNDAttributeChunkin interfaceXspress3Controller- Throws:
DeviceException
-
setHDFPositionMode
- Specified by:
setHDFPositionModein interfaceXspress3Controller- Throws:
DeviceException
-
isUseErasePv
public boolean isUseErasePv() -
setUseErasePv
public void setUseErasePv(boolean useErasePv)
-