Class DummyXspress4Controller
java.lang.Object
gda.factory.FindableBase
uk.ac.gda.devices.detector.xspress4.DummyXspress4Controller
- All Implemented Interfaces:
Findable,org.springframework.beans.factory.InitializingBean,Xspress4Controller
public class DummyXspress4Controller
extends FindableBase
implements Xspress4Controller, org.springframework.beans.factory.InitializingBean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleancheckScalerWindowIsSet(int channel, int windowNumber, int lowLimit, int highLimit) doubledouble[]Return deadtime correction factor for each detector element.intintdouble[][]Return array with current values of MCA data for all detector elementsdouble[]getMcaData(int element) Return array with current values of MCA data for single detector element.intintintintdouble[]getResGradeArrays(int element, int window) Return array of resolution grade values for a detector element.double[]getScalerArray(int element) Return array of scaler values for a detector element.double[][]getScalerTimeseries(int element, int startFrame, int finalFrame) Return time series array of the scaler values for detector elementdoublegetScalerValue(int element, int scalerNumber) Return individual scaler value for detector elementintintReturn total number of frames available to readout (ArrayCounter_RBV)intvoidprepareForMcaCollection(double timeMillis) voidReset the counter used to indicate the number of frames read out back to zero.voidvoidsetAcquireTime(double time) Set collection time ('Acquire time') - used when doing software triggered step scans.voidsetDeadtimeCorrectionEnergy(double energyKev) Set the deadtime correction energy value (energy in keV).voidsetHdfFileName(String name) voidsetHdfFilePath(String path) voidsetHdfNumFrames(int numFrames) Set the number of frames to capture in Hdf writervoidsetNumElements(int numElements) Set the number of detector elements.voidsetNumImages(int numImages) voidsetNumMcaChannels(int numMcaChannels) Set number of MCA channelsvoidsetNumResGrades(int numResGrades) voidsetNumScalers(int numScalers) Set the number of scaler values available.booleansetSaveResolutionGradeData(boolean saveResGradeData) Set whether the detector to record resolution grade data in the hdf file.voidsetScalerWindow(int channel, int windowNumber, int lowLimit, int highLimit) voidsetSimulationFileName(String filename) An hdf file containing MCA data.voidsetTimeSeriesNumPoints(int timeSeriesNumPoints) voidsetTotalNumFramesAvailable(int totalNumFramesAvailable) Set total number of frames available to readout (ArrayCounter_RBV)voidsetTriggerMode(int triggerMode) Set the trigger mode.voidvoidvoidvoidvoidvoidvoidwaitForAcquireState(ACQUIRE_STATE state) voidwaitForCaptureState(boolean state) Wait for Hdf file image capture capture to start/stopvoidwaitForCounterToIncrement(int currentCount, long timeoutMillis) Block unit 'number of frames acquired counter' increments from specified valueMethods inherited from class gda.factory.FindableBase
equals, getName, hashCode, setName
-
Constructor Details
-
DummyXspress4Controller
public DummyXspress4Controller()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getScalerValue
public double getScalerValue(int element, int scalerNumber) Description copied from interface:Xspress4ControllerReturn individual scaler value for detector element- Specified by:
getScalerValuein interfaceXspress4Controller- Parameters:
element-scalerNumber- index of scaler- Returns:
-
getScalerArray
public double[] getScalerArray(int element) Description copied from interface:Xspress4ControllerReturn array of scaler values for a detector element. These are the SCA0, SCA1 ... SCA8 values.- Specified by:
getScalerArrayin interfaceXspress4Controller- Parameters:
element-- Returns:
- array [num scalers]
-
getScalerTimeseries
public double[][] getScalerTimeseries(int element, int startFrame, int finalFrame) Description copied from interface:Xspress4ControllerReturn time series array of the scaler values for detector element- Specified by:
getScalerTimeseriesin interfaceXspress4Controller- Parameters:
element-- Returns:
- array of values [num scalers][numValues]
-
startTimeSeries
- Specified by:
startTimeSeriesin interfaceXspress4Controller- Throws:
DeviceException
-
stopTimeSeries
- Specified by:
stopTimeSeriesin interfaceXspress4Controller- Throws:
DeviceException
-
getTimeSeriesNumPoints
- Specified by:
getTimeSeriesNumPointsin interfaceXspress4Controller- Throws:
DeviceException
-
setTimeSeriesNumPoints
- Throws:
DeviceException
-
getResGradeArrays
public double[] getResGradeArrays(int element, int window) Description copied from interface:Xspress4ControllerReturn array of resolution grade values for a detector element. These are in-'window counts' for each resolution grade (normally 16)- Specified by:
getResGradeArraysin interfaceXspress4Controller- Parameters:
element-window-- Returns:
- array of data [num resolution grades]
-
getMcaData
public double[] getMcaData(int element) Description copied from interface:Xspress4ControllerReturn array with current values of MCA data for single detector element.- Specified by:
getMcaDatain interfaceXspress4Controller- Returns:
- array of data [number of MCA channels]
-
getMcaData
Description copied from interface:Xspress4ControllerReturn array with current values of MCA data for all detector elements- Specified by:
getMcaDatain interfaceXspress4Controller- Returns:
- array of data [num detector elements, number of MCA channels]
- Throws:
DeviceException
-
getDeadtimeCorrectionFactors
Description copied from interface:Xspress4ControllerReturn deadtime correction factor for each detector element. This is a multiplicative factor that can be applied to in-window scaler counts to correct for missed photon counts.- Specified by:
getDeadtimeCorrectionFactorsin interfaceXspress4Controller- Returns:
- array of data [num detector elements]
- Throws:
DeviceException
-
setSaveResolutionGradeData
Description copied from interface:Xspress4ControllerSet whether the detector to record resolution grade data in the hdf file. This is done by setting the binning to use for the 'resolution grade' dimension of the MCA dataset in the hdf writer to either :- 1 == save each grade (used for 'Region of interest' readout mode).
- 16 == don't save the grades, i.e. integrate over grades (used for 'MCA', 'MCA + scalers' readout mode).
- Specified by:
setSaveResolutionGradeDatain interfaceXspress4Controller- Parameters:
saveResGradeData-- Returns:
- true if binning was changed, false otherwise.
- Throws:
DeviceException
-
setDeadtimeCorrectionEnergy
Description copied from interface:Xspress4ControllerSet the deadtime correction energy value (energy in keV).- Specified by:
setDeadtimeCorrectionEnergyin interfaceXspress4Controller- Parameters:
energyKev- energy in keV.- Throws:
DeviceException
-
getDeadtimeCorrectionEnergy
- Specified by:
getDeadtimeCorrectionEnergyin interfaceXspress4Controller- Throws:
DeviceException
-
resetFramesReadOut
Description copied from interface:Xspress4ControllerReset the counter used to indicate the number of frames read out back to zero. (this counter is not used during data collection).- Specified by:
resetFramesReadOutin interfaceXspress4Controller- Throws:
DeviceException
-
getTotalFramesAvailable
Description copied from interface:Xspress4ControllerReturn total number of frames available to readout (ArrayCounter_RBV)- Specified by:
getTotalFramesAvailablein interfaceXspress4Controller- Returns:
- Throws:
DeviceException
-
setTotalNumFramesAvailable
public void setTotalNumFramesAvailable(int totalNumFramesAvailable) Set total number of frames available to readout (ArrayCounter_RBV)- Parameters:
totalNumFramesAvailable-
-
setAcquireTime
Description copied from interface:Xspress4ControllerSet collection time ('Acquire time') - used when doing software triggered step scans.- Specified by:
setAcquireTimein interfaceXspress4Controller- Parameters:
time- frame time in seconds.- Throws:
DeviceException
-
setTriggerMode
Description copied from interface:Xspress4ControllerSet the trigger mode. The integer is the index in the trigger mode enum PV to select.- Specified by:
setTriggerModein interfaceXspress4Controller- Parameters:
triggerMode- index of the trigger mode.- Throws:
DeviceException
-
getTriggerMode
- Specified by:
getTriggerModein interfaceXspress4Controller- Throws:
DeviceException
-
getNumElements
public int getNumElements()- Specified by:
getNumElementsin interfaceXspress4Controller- Returns:
- The number of detector elements (called 'Num Channels' in 'System Configuration' EDM settings)
-
setNumElements
public void setNumElements(int numElements) Description copied from interface:Xspress4ControllerSet the number of detector elements.- Specified by:
setNumElementsin interfaceXspress4Controller- Parameters:
numElements-
-
getNumScalers
public int getNumScalers()- Specified by:
getNumScalersin interfaceXspress4Controller
-
setNumScalers
public void setNumScalers(int numScalers) Description copied from interface:Xspress4ControllerSet the number of scaler values available. (Does not set value on PV)- Specified by:
setNumScalersin interfaceXspress4Controller- Parameters:
numScalers-
-
waitForCounterToIncrement
public void waitForCounterToIncrement(int currentCount, long timeoutMillis) throws DeviceException, InterruptedException Description copied from interface:Xspress4ControllerBlock unit 'number of frames acquired counter' increments from specified value- Specified by:
waitForCounterToIncrementin interfaceXspress4Controller- Parameters:
timeoutMillis-- Throws:
DeviceExceptionInterruptedException
-
getNumResGrades
public int getNumResGrades() -
setNumResGrades
public void setNumResGrades(int numResGrades) -
getNumMcaChannels
public int getNumMcaChannels()- Specified by:
getNumMcaChannelsin interfaceXspress4Controller- Returns:
- Number of MCA channels of data associated with each detector element (called 'Max MCA Elements' in 'System Configuration' EDM settings)
-
setNumMcaChannels
public void setNumMcaChannels(int numMcaChannels) Description copied from interface:Xspress4ControllerSet number of MCA channels- Specified by:
setNumMcaChannelsin interfaceXspress4Controller- Parameters:
numMcaChannels-
-
getDetectorState
- Specified by:
getDetectorStatein interfaceXspress4Controller- Throws:
DeviceException
-
stopAcquire
- Specified by:
stopAcquirein interfaceXspress4Controller- Throws:
DeviceException
-
startAcquire
- Specified by:
startAcquirein interfaceXspress4Controller- Throws:
DeviceException
-
setNumImages
public void setNumImages(int numImages) - Specified by:
setNumImagesin interfaceXspress4Controller
-
sendSoftwareTrigger
- Specified by:
sendSoftwareTriggerin interfaceXspress4Controller- Throws:
DeviceException
-
startHdfWriter
- Specified by:
startHdfWriterin interfaceXspress4Controller- Throws:
DeviceException
-
stopHdfWriter
- Specified by:
stopHdfWriterin interfaceXspress4Controller- Throws:
DeviceException
-
setHdfFilePath
- Specified by:
setHdfFilePathin interfaceXspress4Controller- Throws:
DeviceException
-
setHdfFileName
- Specified by:
setHdfFileNamein interfaceXspress4Controller- Throws:
DeviceException
-
getHdfFullFileName
- Specified by:
getHdfFullFileNamein interfaceXspress4Controller- Throws:
DeviceException
-
setHdfNumFrames
Description copied from interface:Xspress4ControllerSet the number of frames to capture in Hdf writer- Specified by:
setHdfNumFramesin interfaceXspress4Controller- Throws:
DeviceException
-
getHdfNumCapturedFrames
- Specified by:
getHdfNumCapturedFramesin interfaceXspress4Controller- Returns:
- Total number of captured frames in Hdf writer
- Throws:
DeviceException
-
waitForCaptureState
Description copied from interface:Xspress4ControllerWait for Hdf file image capture capture to start/stop- Specified by:
waitForCaptureStatein interfaceXspress4Controller- Parameters:
state- : true == wait for start, false = wait for stop.- Throws:
DeviceException
-
getHdfNumFramesRbv
- Specified by:
getHdfNumFramesRbvin interfaceXspress4Controller- Returns:
- Readback value of number of frames to capture in Hdf writer
- Throws:
DeviceException
-
getHdfFilePath
- Specified by:
getHdfFilePathin interfaceXspress4Controller- Throws:
DeviceException
-
setScalerWindow
public void setScalerWindow(int channel, int windowNumber, int lowLimit, int highLimit) throws DeviceException - Specified by:
setScalerWindowin interfaceXspress4Controller- Throws:
DeviceException
-
setSimulationFileName
An hdf file containing MCA data.- Parameters:
filename-
-
checkScalerWindowIsSet
public boolean checkScalerWindowIsSet(int channel, int windowNumber, int lowLimit, int highLimit) throws DeviceException - Specified by:
checkScalerWindowIsSetin interfaceXspress4Controller- Throws:
DeviceException
-
waitForAcquireState
- Specified by:
waitForAcquireStatein interfaceXspress4Controller- Throws:
DeviceException
-
prepareForMcaCollection
- Specified by:
prepareForMcaCollectionin interfaceXspress4Controller- Throws:
DeviceException
-