Package gda.device.detector.pco
Class PCODetector
java.lang.Object
gda.factory.ConfigurableBase
gda.factory.FindableConfigurableBase
gda.device.DeviceBase
gda.device.scannable.ScannableBase
gda.device.detector.DetectorBase
gda.device.detector.pco.PCODetector
- All Implemented Interfaces:
Detector,IPCODetector,Device,Scannable,Configurable,Findable,gda.observable.IObservable,Serializable,org.springframework.beans.factory.InitializingBean
public class PCODetector
extends DetectorBase
implements org.springframework.beans.factory.InitializingBean, IPCODetector
Separating out the detector from the controller - Part of GDA-4231 area detector stuff to get all detectors aligned
to EPICS V1.7
- 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 TypeMethodDescriptionvoidAcquire and wait till the acquisition is complete.voidprocesses after collected data: Archival of data collected Display the last imagevoidvoidCalled on every Scannable at every data point, for scans which are broken down into individual points (i.e.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 a group of nested scans (or a single scan if that is the case)voidprocessing to be done before starting acquire data from detector - create data storage parameters and metadata filevoidcollect the dark image set - users must ensure the shutter is closed and number of images is set in EPICSvoidcollectDarkSet(int numberOfDarks) collect specified number of dark images - users must ensure the shutter is closed before call this methodvoidTells the detector to begin to collect a set of data, then returns immediately.voidcollectFlatSet(int flatSet) collect specified numbers of flat images, users must ensure the shutter is open and sample is outside from the field of view and set the number of flat images required in EPICS.voidcollectFlatSet(int numberOfFlats, int flatSet) collect specified numbers of flat images, users must ensure the shutter is open and sample is outside from the field of view.creates the main file structure and returns the root of the file system.booleanReturns a value which indicates whether the detector creates its own files.gda.device.detector.pco.PCODetector.Windows2LinuxFilePathgetFilePath(String filePath) gda.device.detector.pco.PCODetector.Windows2LinuxFilePathgda.device.detector.pco.PCODetector.Windows2LinuxFilePathintintintReturns the current collecting state of the device.booleanisBusy()Check if the Scannable is moving/operating.booleanbooleanbooleanbooleanbooleanbooleanvoidpreview(double acquireTime) readout()Returns the latest data collected.voidresetAll()In addition to its own resets, this method also calls reset on all pluginsvoidvoidsetADCMode(int mode) The ADC mode is set on the detectorvoidsetCollectionTime(double collectionTime) Sets the collection time, in seconds, to be used during the next call of collectData.voidsetCollectionTime(Object... collectspec) voidsetController(IPCOControllerV17 controller) voidsetDarkFileNameRoot(String darkFileNameRoot) voidsetDemandRawDataStoreWindows2LinuxFileName(gda.device.detector.pco.PCODetector.Windows2LinuxFilePath demandRawDataStoreWindows2LinuxFileName) svoidsetDescription(String description) voidsetDetectorID(String detectorID) voidsetDetectorType(String detectorType) voidsetExternalTriggered(boolean externalTriggered) voidsetFilePath(File filePath) manage the file path mapping between Windows (where the EPICS IOC is running) and Linux (Where data is to be stored).voidsetFlatFileNameRoot(String faltFileNameRoot) voidvoidsetHdfFormat(boolean hdfFormat) voidsetLocalDataStoreWindows2LinuxFileName(gda.device.detector.pco.PCODetector.Windows2LinuxFilePath localDataStoreWindows2LinuxFilePath) voidsetLocalFilePath(String localFilePath) voidvoidsetNonLocalDataStoreWindows2LinuxFileName(gda.device.detector.pco.PCODetector.Windows2LinuxFilePath nonLocalDataStoreWindows2LinuxFilePath) voidsetNumberOfDarkImages(int numberOfDarkImages) voidsetNumberOfFlatImages(int numberOfFlatImages) voidsetNumCapture(int num) voidsetNumImages(int num) voidsetPlotName(String plotName) voidsetProjectionFolderName(String projectionFoldername) voidsetSaveLocal(boolean saveLocal) voidsetScanNumberAlreadyIncremented(boolean scanNumberAlreadyIncremented) voidsetTiffFilePathBasedOnIocOS(String demandRawFilePath) voidsetTimestampMode(int timestampMode) voidsetTriggerPV(String triggerPV) voidsetWindowsIoc(boolean isWindowsIoc) voidstop()Stop the current move/operation.voidMethods inherited from class gda.device.detector.DetectorBase
asynchronousMoveTo, checkPositionValid, endCollection, getCollectionTime, getDataDimensions, getPosition, prepareForCollection, toFormattedStringMethods inherited from class gda.device.scannable.ScannableBase
__call__, __call__, __doc__, __getitem__, __len__, __repr__, __str__, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atScanLineEnd, atScanLineStart, 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
configure, 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
configure, isConfigureAtStartup, isConfigured, reconfigureMethods inherited from interface gda.device.Detector
endCollection, getCollectionTime, getDataDimensions, getFileStructure, prepareForCollection, 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
asynchronousMoveTo, atCommandFailure, atLevelEnd, atLevelMoveStart, atLevelStart, atPointEnd, atScanLineEnd, atScanLineStart, checkPositionValid, getExtraNames, getInputNames, getLevel, getOutputFormat, getPosition, getScanMetadataAttribute, getScanMetadataAttributeNames, getScanMetadataAttributes, isAt, moveTo, setExtraNames, setInputNames, setLevel, setOutputFormat, setScanMetadataAttribute, setScanMetadataAttributes, toFormattedString
-
Constructor Details
-
PCODetector
public PCODetector()
-
-
Method Details
-
preview
- Throws:
Exception
-
isHdfFormat
public boolean isHdfFormat()- Specified by:
isHdfFormatin interfaceIPCODetector- Returns:
- Returns the hdfFormat.
-
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
-
isExternalTriggered
public boolean isExternalTriggered() -
setExternalTriggered
public void setExternalTriggered(boolean externalTriggered) - Specified by:
setExternalTriggeredin interfaceIPCODetector- Parameters:
externalTriggered-
-
setHdfFormat
public void setHdfFormat(boolean hdfFormat) - Specified by:
setHdfFormatin interfaceIPCODetector- Parameters:
hdfFormat- The hdfFormat to set.
-
getStatus
public int getStatus()Description copied from interface:DetectorReturns the current collecting state of the device. -
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- Returns:
- the data collected
- Throws:
DeviceException
-
setCollectionTime
Description copied from interface:DetectorSets the collection time, in seconds, to be used during the next call of collectData.- Specified by:
setCollectionTimein interfaceDetector- Overrides:
setCollectionTimein classDetectorBase- Parameters:
collectionTime- the collection time in seconds- Throws:
DeviceException
-
setCollectionTime
- Throws:
DeviceException
-
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:
-
atPointStart
Description copied from class:ScannableBaseCalled on every Scannable at every data point, for scans which are broken down into individual points (i.e. non-continuous scans) Default behaviour is to do nothing. Inheriting classes have the option to implement this if their specific behaviour requires it.- Specified by:
atPointStartin interfaceScannable- Overrides:
atPointStartin classScannableBase- 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- Overrides:
stopin classScannableBase- Throws:
DeviceException- See Also:
-
resetAll
Description copied from interface:IPCODetectorIn addition to its own resets, this method also calls reset on all plugins- Specified by:
resetAllin interfaceIPCODetector- Throws:
Exception
-
setFormat
-
setNexusFormat
public void setNexusFormat() -
setFilePath
manage the file path mapping between Windows (where the EPICS IOC is running) and Linux (Where data is to be stored).- Specified by:
setFilePathin interfaceIPCODetector- Parameters:
filePath-- Throws:
Exception
-
getFilePath
-
isScanNumberAlreadyIncremented
public boolean isScanNumberAlreadyIncremented() -
setScanNumberAlreadyIncremented
public void setScanNumberAlreadyIncremented(boolean scanNumberAlreadyIncremented) -
afterCollection
public void afterCollection()processes after collected data:- Archival of data collected
- Display the last image
-
beforeCollection
processing to be done before starting acquire data from detector - create data storage parameters and metadata file- Throws:
ExceptionIOExceptionDeviceException
-
collectDarkSet
collect specified number of dark images - users must ensure the shutter is closed before call this method- Specified by:
collectDarkSetin interfaceIPCODetector- Parameters:
numberOfDarks-- Throws:
Exception
-
collectDarkSet
collect the dark image set - users must ensure the shutter is closed and number of images is set in EPICS- Specified by:
collectDarkSetin interfaceIPCODetector- Throws:
Exception
-
collectFlatSet
collect specified numbers of flat images, users must ensure the shutter is open and sample is outside from the field of view.- Specified by:
collectFlatSetin interfaceIPCODetector- Parameters:
numberOfFlats- - number of flat images for each flat setflatSet- - the set number- Throws:
Exception
-
collectFlatSet
collect specified numbers of flat images, users must ensure the shutter is open and sample is outside from the field of view and set the number of flat images required in EPICS.- Throws:
Exception
-
resetFileNumber
- Throws:
Exception
-
createMainFileStructure
Description copied from interface:IPCODetectorcreates the main file structure and returns the root of the file system.- Specified by:
createMainFileStructurein interfaceIPCODetector- Returns:
File- Throws:
IOException
-
isBusy
public boolean 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
- See Also:
-
isWriterBusy
- Specified by:
isWriterBusyin interfaceIPCODetector- Returns:
trueif the writer is busy- Throws:
Exception
-
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
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
setController
-
getController
- Specified by:
getControllerin interfaceIPCODetector- Returns:
IPCOControllerV17- controller associated with the detector.F
-
getDescription
- Specified by:
getDescriptionin interfaceDetector- Overrides:
getDescriptionin classDetectorBase- Returns:
- A description of the detector.
- Throws:
DeviceException
-
setDescription
-
getDetectorID
- Specified by:
getDetectorIDin interfaceDetector- Overrides:
getDetectorIDin classDetectorBase- Returns:
- A identifier for this detector.
- Throws:
DeviceException
-
setDetectorID
-
getDetectorType
- Specified by:
getDetectorTypein interfaceDetector- Overrides:
getDetectorTypein classDetectorBase- Returns:
- The type of detector.
- Throws:
DeviceException
-
setDetectorType
-
setLocalFilePath
-
getLocalFilePath
- Specified by:
getLocalFilePathin interfaceIPCODetector- Returns:
- the local file path
-
getProjectionFolderName
- Specified by:
getProjectionFolderNamein interfaceIPCODetector- Returns:
- the projection folder name
-
setProjectionFolderName
-
setDarkFileNameRoot
-
getDarkFileNameRoot
- Specified by:
getDarkFileNameRootin interfaceIPCODetector- Returns:
- the dark file name root
-
setFlatFileNameRoot
-
getFlatFileNameRoot
- Specified by:
getFlatFileNameRootin interfaceIPCODetector- Returns:
- the flat file name root
-
setNumberOfDarkImages
public void setNumberOfDarkImages(int numberOfDarkImages) -
getNumberOfDarkImages
public int getNumberOfDarkImages()- Specified by:
getNumberOfDarkImagesin interfaceIPCODetector- Returns:
- number of dark images collected
-
setNumberOfFlatImages
public void setNumberOfFlatImages(int numberOfFlatImages) -
getNumberOfFlatImages
public int getNumberOfFlatImages()- Specified by:
getNumberOfFlatImagesin interfaceIPCODetector- Returns:
- the number of flat images collected.
-
getLocalDataStoreWindows2LinuxFilePath
public gda.device.detector.pco.PCODetector.Windows2LinuxFilePath getLocalDataStoreWindows2LinuxFilePath() -
setLocalDataStoreWindows2LinuxFileName
public void setLocalDataStoreWindows2LinuxFileName(gda.device.detector.pco.PCODetector.Windows2LinuxFilePath localDataStoreWindows2LinuxFilePath) -
getNonLocalDataStoreWindows2LinuxFilePath
public gda.device.detector.pco.PCODetector.Windows2LinuxFilePath getNonLocalDataStoreWindows2LinuxFilePath() -
setNonLocalDataStoreWindows2LinuxFileName
public void setNonLocalDataStoreWindows2LinuxFileName(gda.device.detector.pco.PCODetector.Windows2LinuxFilePath nonLocalDataStoreWindows2LinuxFilePath) -
setPlotName
-
getPlotName
- Specified by:
getPlotNamein interfaceIPCODetector- Returns:
- the plot name the is associated with the detector.
-
getFullFilename
- Throws:
Exception
-
setNumImages
- Throws:
Exception
-
setNumCapture
- Throws:
Exception
-
acquireSynchronously
Acquire and wait till the acquisition is complete.- Specified by:
acquireSynchronouslyin interfaceIPCODetector- Throws:
Exception
-
stopCapture
- Specified by:
stopCapturein interfaceIPCODetector- Throws:
Exception
-
setWindowsIoc
public void setWindowsIoc(boolean isWindowsIoc) -
isWindowsIoc
public boolean isWindowsIoc() -
getDemandRawDataStoreWindows2LinuxFileName
public gda.device.detector.pco.PCODetector.Windows2LinuxFilePath getDemandRawDataStoreWindows2LinuxFileName()- Returns:
- Returns the demandRawDataStoreWindows2LinuxFileName.
-
setDemandRawDataStoreWindows2LinuxFileName
public void setDemandRawDataStoreWindows2LinuxFileName(gda.device.detector.pco.PCODetector.Windows2LinuxFilePath demandRawDataStoreWindows2LinuxFileName) s- Parameters:
demandRawDataStoreWindows2LinuxFileName- The demandRawDataStoreWindows2LinuxFileName to set.
-
getTiffImageFileName
- Specified by:
getTiffImageFileNamein interfaceIPCODetector- Throws:
Exception
-
setTiffFilePathBasedOnIocOS
- Specified by:
setTiffFilePathBasedOnIocOSin interfaceIPCODetector- Throws:
Exception
-
setADCMode
Description copied from interface:IPCODetectorThe ADC mode is set on the detector- Specified by:
setADCModein interfaceIPCODetector- Parameters:
mode-- Throws:
Exception
-
setSaveLocal
public void setSaveLocal(boolean saveLocal) -
isSaveLocal
public boolean isSaveLocal() -
setTriggerPV
-
getTriggerPV
-
setTimestampMode
- Throws:
Exception
-