Package gda.device.detector.analyser
Class EpicsMcaController
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.detector.analyser.EpicsMcaController
- All Implemented Interfaces:
Device,InitializationListener,Configurable,Findable,gda.observable.IObservable
Class to communicate with an epics MCA record. The MCA record controls and acquires data from a multi-channel
analyser (MCA).
- Since:
- 7.3
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumtriggers for channel advanceclassmonitors average dead timeclassmonitors instantaneous dead timeclassmonitors real live timestatic enumMCA modesclassmonitor reading array statusclassmonitors elapses real timeclassmonitor the total number of counts of the region of interestclassmonitor the net number of counts of the region of interestclassmonitor value array -
Field Summary
FieldsFields inherited from class gda.device.DeviceBase
DEFAULT_PROTECTION_LEVEL_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionConstructor, initialise this object.EpicsMcaController(String name) Constructor taking a PV name, you must run .configure() to fully initialise the objectEpicsMcaController(String name, String recordName) constructor allowing setting of object name and MCA record name, you must run .configure() to fully initialise the object -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()erases the data array of the MCAvoidobject initialisation - create all EPICS channels requiredvoidActivates the MCA using the Erase invalid input: '&' Start acquire.intgets acquire status from MCA (poll from hardware)gets the absolute acquisition start time from IOCdoublegets the number of actual counts in preset regiondoublegets the average dead time of the detectordoublegets calibration offset from hardwaredoublegets calibration Quadratic from hardwaredoublegets calibration slope from hardwaregets calibration units name from hardwareshortgets the channel advance source in MCS modeintgets the Channel Advance Pre-Scale Factor when in MCS mode and source is "External".int[]getData()doubleGets the Dwell Time (DWEL) per channel, used only in MCS mode and CHAS is internal.doublegets the elapsed live time from hardwaredoublegets the elapsed real time from hardwaredoublegets the instantaneous dead time of the detectorintgets the maximum number of channels (array elements) allocated at iocInit.gets MCA record name - the actual EPICS Record name after remove field namegetMode()sets the the operation mode of the MCAintgets the number of channels read.longgets the number of channels to use for spectrum acquisitionintgets number of region of interestintgets the preset count high channel from hardwareintgets the preset count low channel from hardwareintgets the preset counts from hardwarefloatgets the preset live time from hardware for how many seconds to acquire data according to a clock which counts only when hardware is ready to accept data (live time).floatgets the preset real time from hardware for how many seconds to acquire data according to a free running clock (real time).intgets the preset number of sweeps from hardwareintgetRegionBackground(int regionIndex) gets the Background for the specified region.doublegetRegionCounts(int regionIndex) gets the total number of counts in the specified region.intgetRegionHighChannel(int regionIndex) gets the high channel for the specified region.intgetRegionLowChannel(int regionIndex) gets the low channel for the specified region.getRegionName(int regionIndex) gets the preset count of the specified region.doublegetRegionNetCounts(int regionIndex) gets the net number of counts in the specified region.doublegetRegionPresetCount(int regionIndex) gets the preset count of the specified region.longgets the time sequence number which is the memory region hardware used for data acquisitionget current MCA statusdouble/** gets calibration Two Theta i.e the two theta angle of the detector useful in energy-dispersive diffraction experimentsvoidCalled when all critical channels are connected.booleanisRegionPreset(int regionIndex) gets the is-preset for the specified region.voidinitiates record processvoidread()initiates reading of the MCA's data.voidsetCalibrationOffset(double value) sets the calibration offsetvoidsetCalibrationQuadratic(double value) sets the calibration QuadraticvoidsetCalibrationSlope(double value) sets the calibration slopevoidsetCalibrationUnitsName(String unitName) sets the calibration units namevoidsetChannelAdvanceFactor(int n) sets the Channel Advance pre-Scale factor when in MCS mode and source is "External".voidsetChannelAdvanceSource(int s) sets channel advance source in MCS modevoidsetData(int[] data) sets data array to the MCAvoidsetDwellTime(double time) Sets the dwell time (DWEL) to tell the hardware how many seconds to spend in each channel when the hardware is in MCS mode and the channel advance source is "Internal"voidsetMcaRecordName(String mcaRecordName) sets MCA record name - the actual EPICS Record name after remove field namevoidsets the the operation mode of the MCAvoidsetNumberOfChannels(long channels) sets the number of channels (array elements) to use for spectrum acquisitionvoidsetNumberOfRegions(int numberOfRegions) Sets number of region of interestvoidsetPresetCountHigh(int channel) sets the preset count high channelvoidsetPresetCountLow(int channel) sets the preset count low channelvoidsetPresetCounts(int counts) sets the preset counts which tells the hardware that data acquisition is to be halted when the sum of the numbers of counts acquired in channels PCTL through PCTH inclusive reaches this value.voidsetPresetLiveTime(double time) sets the preset live time to the hardware for how many seconds to acquire data according to a clock which counts only when hardware is ready to accept data (live time).voidsetPresetRealTime(double time) sets the preset real time to the hardware for how many seconds to acquire data according to a free running clock (real time).voidsetPresetSweep(int sweeps) sets the preset number of sweeps which tell the hardware that data acquisition in MCS mode is to continue until the preset number of sweeps have completed.voidsetRegionBackground(int regionIndex, int highChannel) sets the Background for the specified region.voidsetRegionHighChannel(int regionIndex, int highChannel) sets the high channel for the specified region.voidsetRegionLowChannel(int regionIndex, int lowChannel) sets the low channel for the specified region.voidsetRegionName(int regionIndex, String name) sets the name of the specified region.voidsetRegionPreset(int regionIndex, boolean b) sets the is-preset for the specified region.voidsetRegionPresetCount(int regionIndex, double count) sets the preset count of the specified region.voidsetSequence(long sequence) sets the time sequence number which tell the hardware which memory region to use for data acquisition, readout and erasing.voidsetTwoTheta(double value) sets the calibration Two Theta, i.e the two theta angle of the detector useful in energy-dispersive diffraction experimentsvoidstarts data acquisitionvoidstops data acquisitionMethods 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, toString, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigured, reconfigure
-
Field Details
-
NUMBER_OF_REGIONS
public int NUMBER_OF_REGIONSmaximum number of ROI
-
-
Constructor Details
-
EpicsMcaController
public EpicsMcaController()Constructor, initialise this object. -
EpicsMcaController
Constructor taking a PV name, you must run .configure() to fully initialise the object- Parameters:
name- String, the PV name
-
EpicsMcaController
constructor allowing setting of object name and MCA record name, you must run .configure() to fully initialise the object- Parameters:
name- - the object namerecordName- - EPICS MCA record name
-
-
Method Details
-
configure
object initialisation - create all EPICS channels required- 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- See Also:
-
startAcquisition
starts data acquisition- Throws:
DeviceException
-
stopAcquisition
stops data acquisition- Throws:
DeviceException
-
eraseStartAcquisition
Activates the MCA using the Erase invalid input: '&' Start acquire.- Throws:
DeviceException
-
getAcquireStatus
gets acquire status from MCA (poll from hardware)- Returns:
- 0 done, 1 Acquire
- Throws:
DeviceException
-
getStatus
get current MCA status- Returns:
- MCA status
- Throws:
DeviceException
-
processRecord
initiates record process- Throws:
DeviceException
-
read
initiates reading of the MCA's data.- Throws:
DeviceException
-
clear
erases the data array of the MCA- Throws:
DeviceException
-
getChannalAdvanceSource
gets the channel advance source in MCS mode- Returns:
- 0 - Internal clock, 1 - external signal
- Throws:
DeviceException
-
setChannelAdvanceSource
sets channel advance source in MCS mode- Parameters:
s- 0 - Internal clock or 1 - External signal.- Throws:
DeviceException
-
getNumberOfChannels
gets the number of channels to use for spectrum acquisition- Returns:
- the number of channels to use
- Throws:
DeviceException
-
setNumberOfChannels
sets the number of channels (array elements) to use for spectrum acquisition- Parameters:
channels-- Throws:
DeviceException
-
setSequence
sets the time sequence number which tell the hardware which memory region to use for data acquisition, readout and erasing. The main use of this field is for time-resolved spectroscopy, since it permits rapidly changing the location of data acquisition, without having to read and erase the acquisition memory between successive spectra.- Parameters:
sequence-- Throws:
DeviceException
-
getSequence
gets the time sequence number which is the memory region hardware used for data acquisition- Returns:
- the time sequence number
- Throws:
DeviceException
-
getDwellTime
Gets the Dwell Time (DWEL) per channel, used only in MCS mode and CHAS is internal.- Returns:
- Dwell Time
- Throws:
DeviceException
-
setDwellTime
Sets the dwell time (DWEL) to tell the hardware how many seconds to spend in each channel when the hardware is in MCS mode and the channel advance source is "Internal"- Parameters:
time-- Throws:
DeviceException
-
getChannelAdvanceFactor
gets the Channel Advance Pre-Scale Factor when in MCS mode and source is "External". Default is 1.- Returns:
- the channel advance pre-scale factor
- Throws:
DeviceException
-
setChannelAdvanceFactor
sets the Channel Advance pre-Scale factor when in MCS mode and source is "External". The hardware will advance to the next channel after receiving PSCL external pulses. Default is 1.- Parameters:
n-- Throws:
DeviceException
-
getPresetRealTime
gets the preset real time from hardware for how many seconds to acquire data according to a free running clock (real time).- Returns:
- preset real time
- Throws:
DeviceException
-
setPresetRealTime
sets the preset real time to the hardware for how many seconds to acquire data according to a free running clock (real time). sets 0.0 instructs the hardware to ignore it.- Parameters:
time-- Throws:
DeviceException
-
getPresetLiveTime
gets the preset live time from hardware for how many seconds to acquire data according to a clock which counts only when hardware is ready to accept data (live time).- Returns:
- preset live time
- Throws:
DeviceException
-
setPresetLiveTime
sets the preset live time to the hardware for how many seconds to acquire data according to a clock which counts only when hardware is ready to accept data (live time). Sets it to 0.0 instructs the hardware to ignore it.- Parameters:
time-- Throws:
DeviceException
-
getPresetCounts
gets the preset counts from hardware- Returns:
- preset counts
- Throws:
DeviceException
-
setPresetCounts
sets the preset counts which tells the hardware that data acquisition is to be halted when the sum of the numbers of counts acquired in channels PCTL through PCTH inclusive reaches this value. Sets it to 0.0 instructs the hardware to ignore it.- Parameters:
counts-- Throws:
DeviceException
-
getPresetCountLow
gets the preset count low channel from hardware- Returns:
- preset count low channel
- Throws:
DeviceException
-
setPresetCountLow
sets the preset count low channel- Parameters:
channel-- Throws:
DeviceException
-
getPresetCountHigh
gets the preset count high channel from hardware- Returns:
- preset count high channel
- Throws:
DeviceException
-
setPresetCountHigh
sets the preset count high channel- Parameters:
channel-- Throws:
DeviceException
-
getPresetSweep
gets the preset number of sweeps from hardware- Returns:
- number of sweeps
- Throws:
DeviceException
-
setPresetSweep
sets the preset number of sweeps which tell the hardware that data acquisition in MCS mode is to continue until the preset number of sweeps have completed.- Parameters:
sweeps-- Throws:
DeviceException
-
setMode
sets the the operation mode of the MCA- Parameters:
mode-- Throws:
DeviceException
-
getMode
sets the the operation mode of the MCA- Returns:
- mode
- Throws:
DeviceException
-
getCalibrationUnitsName
gets calibration units name from hardware- Returns:
- calibration units name
- Throws:
DeviceException
-
setCalibrationUnitsName
sets the calibration units name- Parameters:
unitName-- Throws:
DeviceException
-
getCalibrationOffset
gets calibration offset from hardware- Returns:
- calibration offset
- Throws:
DeviceException
-
setCalibrationOffset
sets the calibration offset- Parameters:
value-- Throws:
DeviceException
-
getCalibrationSlope
gets calibration slope from hardware- Returns:
- calibration slope
- Throws:
DeviceException
-
setCalibrationSlope
sets the calibration slope- Parameters:
value-- Throws:
DeviceException
-
getCalibrationQuadratic
gets calibration Quadratic from hardware- Returns:
- calibration quadratic
- Throws:
DeviceException
-
setCalibrationQuadratic
sets the calibration Quadratic- Parameters:
value-- Throws:
DeviceException
-
getTwoTheta
/** gets calibration Two Theta i.e the two theta angle of the detector useful in energy-dispersive diffraction experiments- Returns:
- two theta angle of the detector
- Throws:
DeviceException
-
setTwoTheta
sets the calibration Two Theta, i.e the two theta angle of the detector useful in energy-dispersive diffraction experiments- Parameters:
value-- Throws:
DeviceException
-
getElapsedRealTime
gets the elapsed real time from hardware- Returns:
- elapsed real time
- Throws:
DeviceException
-
getElapsedLiveTime
gets the elapsed live time from hardware- Returns:
- elapsed live time
- Throws:
DeviceException
-
getActualCountInPresetRegion
gets the number of actual counts in preset region- Returns:
- number of actual counts
- Throws:
DeviceException
-
getAverageDeadTime
gets the average dead time of the detector- Returns:
- average dead time of the detector
- Throws:
DeviceException
-
getInstantaneousDeadTime
gets the instantaneous dead time of the detector- Returns:
- instantaneous dead time of the detector
- Throws:
DeviceException
-
getAcquisitionStartTime
gets the absolute acquisition start time from IOC- Returns:
- absolute acquisition start time
- Throws:
DeviceException
-
getRegionLowChannel
gets the low channel for the specified region.- Parameters:
regionIndex-- Returns:
- the region's low channel
- Throws:
DeviceException
-
setRegionLowChannel
sets the low channel for the specified region.- Parameters:
regionIndex-lowChannel-- Throws:
DeviceException
-
getRegionHighChannel
gets the high channel for the specified region.- Parameters:
regionIndex-- Returns:
- the region's high channel
- Throws:
DeviceException
-
setRegionHighChannel
sets the high channel for the specified region.- Parameters:
regionIndex-highChannel-- Throws:
DeviceException
-
getRegionBackground
gets the Background for the specified region.- Parameters:
regionIndex-- Returns:
- the region's high channel
- Throws:
DeviceException
-
setRegionBackground
sets the Background for the specified region.- Parameters:
regionIndex-highChannel-- Throws:
DeviceException
-
isRegionPreset
gets the is-preset for the specified region.- Parameters:
regionIndex-- Returns:
- true or false
- Throws:
DeviceException
-
setRegionPreset
sets the is-preset for the specified region.- Parameters:
regionIndex-b- true or false- Throws:
DeviceException
-
getRegionCounts
gets the total number of counts in the specified region.- Parameters:
regionIndex-- Returns:
- the region's counts
- Throws:
DeviceException
-
getRegionNetCounts
gets the net number of counts in the specified region.- Parameters:
regionIndex-- Returns:
- the region's counts
- Throws:
DeviceException
-
getRegionPresetCount
gets the preset count of the specified region.- Parameters:
regionIndex-- Returns:
- the region's preset count
- Throws:
DeviceException
-
setRegionPresetCount
sets the preset count of the specified region.- Parameters:
regionIndex-count-- Throws:
DeviceException
-
getRegionName
gets the preset count of the specified region.- Parameters:
regionIndex-- Returns:
- the region's name
- Throws:
DeviceException
-
setRegionName
sets the name of the specified region.- Parameters:
regionIndex-name-- Throws:
DeviceException
-
getData
- Returns:
- the data array
- Throws:
DeviceException
-
setData
sets data array to the MCA- Parameters:
data-- Throws:
DeviceException
-
getMaxNumberOfChannels
gets the maximum number of channels (array elements) allocated at iocInit.- Returns:
- Maximum number of channels
- Throws:
DeviceException
-
getNumberOfChannelRead
gets the number of channels read.- Returns:
- number of channels read
- Throws:
DeviceException
-
setNumberOfRegions
public void setNumberOfRegions(int numberOfRegions) Sets number of region of interest- Parameters:
numberOfRegions-
-
getNumberOfRegions
public int getNumberOfRegions()gets number of region of interest- Returns:
- number of regions
-
initializationCompleted
public void initializationCompleted()Description copied from interface:InitializationListenerCalled when all critical channels are connected.- Specified by:
initializationCompletedin interfaceInitializationListener
-
getMcaRecordName
gets MCA record name - the actual EPICS Record name after remove field name- Returns:
- MCA record name
-
setMcaRecordName
sets MCA record name - the actual EPICS Record name after remove field name- Parameters:
mcaRecordName-
-