Package gda.device.detector.xmap.edxd
Class EDXDController
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.detector.DetectorBase
gda.device.detector.xmap.edxd.EDXDController
- All Implemented Interfaces:
Detector,Device,Scannable,Configurable,Findable,gda.observable.IObservable,Serializable
- Direct Known Subclasses:
EDXDControllerQMap,EDXDMappingController
This class describes an EDXD detector made up of multiple subdetectors, as specified by
numberOfElements- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected DeviceExceptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected intprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected final List<IEDXDElement> protected IFindableEpicsDeviceFields 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 TypeMethodDescriptionvoidActivate the ROI mode in the controllerprotected voidvoidTells 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.voidDisable the ROI mode in the ControllerdoubleGet the acquisition/collection/preset time in the hardwareintgetBins()double[]getData(int mcaNumber) read the data from the specified mca elementintgetEvents(int mcaNumber) Read the counts from the sub detectordoublegetICR(int mcaNumber) intget the maximum number of ROI allowed per mca elementintGet the number of the mca elements attached to the controllerdoublegetOCR(int mcaNumber) intGet the acquisition mode in the hardwareintReturns the current collecting state of the device.getSubDetector(int index) Get one of the elements specifialy by namegetXmap()This method shows all the savefiles for the EDXD detectorloadSettings(String name) Loads a setting from the persistancereadout()Returns the latest data collected.voidRe-initialisation of values and states.voidsaveCurrentSettings(String name) Save all the xmap settings, with no descriptionvoidsaveCurrentSettings(String name, String description) Save all the xmap settings along with the given descriptionvoidsetAquisitionTime(double collectionTime) set the acquisition/collection/preset time in the controllervoidsetBaseLength(int baseLength) Set the baseLength for all elementsvoidsetBaseThreshold(double baseThreshold) Set the baseThreshold for all elementsintsetBins(int numberOfBins) Sets the number of bins that are used by the xmap.voidsetBinWidth(double binWidth) Sets the energy per bindoublesetDynamicRange(double dynamicRange) Sets the dynamic range of the detectorvoidsetEnergyThreshold(double energyThreshold) Set the energyThreshold for all elementsvoidsetGapTime(double gapTime) Set the gapTime for all elementsvoidsetMaxWidth(double maxWidth) Set the maxWidth for all elementsvoidsetNumberOfElements(int numberOfElements) Set the number of mca elements attached to the controllervoidsetPeakTime(double peakTime) Set the peakTime for all elementsvoidsetPreampGain(double preampGain) Set the preampGain for all elementsvoidset the acquisition mode defined in PRESET_MODES in the controllervoidsetResetDelay(double resetDelay) Set the resetDelay for all elementsvoidsetResume(boolean resume) Controller has two modes of operation.voidsetTriggerGapTime(double triggerGapTime) Set the triggerGapTime for all elementsvoidsetTriggerPeakTime(double triggerPeakTime) Set the triggerPeakTime for all elementsvoidsetTriggerThreshold(double triggerThreshold) Set the triggerThreshold for all elementsvoidsetup(double maxEnergy, int numberOfBins) Simple method which sets up the EDXD with some basic assumptionsvoidsetXmap(IFindableEpicsDevice xmap) voidstart()Start data acquisition in the controller.voidstop()Stop the current move/operation.voidCheck for any exception during data collectionMethods inherited from class gda.device.detector.DetectorBase
asynchronousMoveTo, checkPositionValid, endCollection, getCollectionTime, getDataDimensions, getPosition, isBusy, prepareForCollection, setCollectionTime, toFormattedStringMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, 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, setConfiguredMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface gda.factory.Configurable
isConfigureAtStartup, isConfiguredMethods inherited from interface gda.device.Detector
getFileStructure, waitWhileBusyMethods inherited from interface gda.device.Device
close, getAttribute, getProtectionLevel, setAttribute, setProtectionLevelMethods inherited from interface gda.observable.IObservable
addIObserver, deleteIObserver, deleteIObserversMethods inherited from interface gda.device.Scannable
atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atPointStart, atScanEnd, atScanLineEnd, atScanLineStart, atScanStart, getExtraNames, getInputNames, getLevel, getOutputFormat, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes
-
Field Details
-
numberOfElements
protected int numberOfElements -
xmap
-
subDetectors
-
collectDataException
-
ACQUIRE
- See Also:
-
ACQUIRING
- See Also:
-
GETDYNRANGE
- See Also:
-
GETDYNRANGE0
- See Also:
-
GETNBINS
- See Also:
-
GETPRESETTYPE
- See Also:
-
GETPRESETVALUE
- See Also:
-
SETRESUME
- See Also:
-
SCAACTIVATE
- See Also:
-
SCAELEMENTS
- See Also:
-
SETBINWIDTH
- See Also:
-
SETDYNRANGE
- See Also:
-
SETNBINS
- See Also:
-
SETPRESETTYPE
- See Also:
-
SETPRESETVALUE
- See Also:
-
-
Constructor Details
-
EDXDController
public EDXDController()
-
-
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
-
addElements
protected void addElements() -
reconfigure
Description copied from interface:ConfigurableRe-initialisation of values and states.Moved from Reconfigurable which has been deleted
- Specified by:
reconfigurein interfaceConfigurable- Overrides:
reconfigurein classConfigurableBase- Throws:
FactoryException
-
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.- 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
-
getStatus
Description copied from interface:DetectorReturns the current collecting state of the device.- Returns:
- BUSY if the detector has not finished the requested operation(s), IDLE if in an completely idle state and STANDBY if temporarily suspended.
- Throws:
DeviceException
-
getAcquisitionTime
Get the acquisition/collection/preset time in the hardware- Returns:
- collection time
- Throws:
DeviceException
-
getPresetType
Get the acquisition mode in the hardware- Returns:
- mode
- 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.- Returns:
- true if readout() returns filenames
- Throws:
DeviceException
-
verifyData
Check for any exception during data collection- Throws:
DeviceException
-
getNumberOfElements
public int getNumberOfElements()Get the number of the mca elements attached to the controller- Returns:
- number of mca elements
-
setNumberOfElements
public void setNumberOfElements(int numberOfElements) Set the number of mca elements attached to the controller- Parameters:
numberOfElements-
-
setBins
Sets the number of bins that are used by the xmap.- Parameters:
numberOfBins- a number up to 16k- Returns:
- the number of bins which are actualy set.
- Throws:
DeviceException
-
getBins
- Returns:
- The number of bins the xmap is curently set to
- Throws:
DeviceException
-
setDynamicRange
Sets the dynamic range of the detector- Parameters:
dynamicRange- the dynamic range in KeV- Returns:
- the actual value which has been set
- Throws:
DeviceException
-
setBinWidth
Sets the energy per bin- Parameters:
binWidth- in eV- Throws:
DeviceException
-
setup
Simple method which sets up the EDXD with some basic assumptions- Parameters:
maxEnergy- The maxim energy expected in KeVnumberOfBins- the number of bins that are wanted, i.e the resolution- Throws:
DeviceException
-
saveCurrentSettings
public void saveCurrentSettings(String name) throws ObjectShelfException, LocalDatabase.LocalDatabaseException, DeviceException Save all the xmap settings, with no description- Parameters:
name-- Throws:
ObjectShelfExceptionLocalDatabase.LocalDatabaseExceptionDeviceException
-
saveCurrentSettings
public void saveCurrentSettings(String name, String description) throws ObjectShelfException, LocalDatabase.LocalDatabaseException, DeviceException Save all the xmap settings along with the given description- Parameters:
name-description-- Throws:
ObjectShelfExceptionLocalDatabase.LocalDatabaseExceptionDeviceException
-
loadSettings
public String loadSettings(String name) throws DeviceException, ObjectShelfException, LocalDatabase.LocalDatabaseException Loads a setting from the persistance- Parameters:
name-- Returns:
- The description of the configuration loaded
- Throws:
DeviceExceptionObjectShelfExceptionLocalDatabase.LocalDatabaseException
-
listSettings
This method shows all the savefiles for the EDXD detector- Returns:
- a string containing all the files
- Throws:
LocalDatabase.LocalDatabaseExceptionObjectShelfExceptionLocalDatabase.LocalDatabaseExceptionObjectShelfException
-
setPreampGain
Set the preampGain for all elements- Parameters:
preampGain-- Throws:
DeviceException
-
setPeakTime
Set the peakTime for all elements- Parameters:
peakTime-- Throws:
DeviceException
-
setTriggerThreshold
Set the triggerThreshold for all elements- Parameters:
triggerThreshold-- Throws:
DeviceException
-
setBaseThreshold
Set the baseThreshold for all elements- Parameters:
baseThreshold-- Throws:
DeviceException
-
setBaseLength
Set the baseLength for all elements- Parameters:
baseLength-- Throws:
DeviceException
-
setEnergyThreshold
Set the energyThreshold for all elements- Parameters:
energyThreshold-- Throws:
DeviceException
-
setResetDelay
Set the resetDelay for all elements- Parameters:
resetDelay-- Throws:
DeviceException
-
setGapTime
Set the gapTime for all elements- Parameters:
gapTime-- Throws:
DeviceException
-
setTriggerPeakTime
Set the triggerPeakTime for all elements- Parameters:
triggerPeakTime-- Throws:
DeviceException
-
setTriggerGapTime
Set the triggerGapTime for all elements- Parameters:
triggerGapTime-- Throws:
DeviceException
-
setMaxWidth
Set the maxWidth for all elements- Parameters:
maxWidth-- Throws:
DeviceException
-
getSubDetector
Get one of the elements specifialy by name- Parameters:
index-- Returns:
- An the EDXDElement requested
-
setResume
Controller has two modes of operation. clear on start or resume acquiring into the same spectrum- Parameters:
resume-- Throws:
DeviceException
-
getData
read the data from the specified mca element- Parameters:
mcaNumber-- Returns:
- data array
- Throws:
DeviceException
-
setAquisitionTime
set the acquisition/collection/preset time in the controller- Parameters:
collectionTime-- Throws:
DeviceException
-
setPresetType
set the acquisition mode defined in PRESET_MODES in the controller- Parameters:
mode-- Throws:
DeviceException
-
start
Start data acquisition in the controller. Uses the existing resume mode- Throws:
DeviceException
-
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:
-
activateROI
Activate the ROI mode in the controller- Throws:
DeviceException
-
deactivateROI
Disable the ROI mode in the Controller- Throws:
DeviceException
-
getMaxAllowedROIs
get the maximum number of ROI allowed per mca element- Returns:
- number of rois
- 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.- Returns:
- the data collected
- Throws:
DeviceException
-
getEvents
Read the counts from the sub detector- Parameters:
mcaNumber-- Returns:
- data array
- Throws:
DeviceException
-
getICR
- Throws:
DeviceException
-
getOCR
- Throws:
DeviceException
-
getXmap
-
setXmap
-