Class 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:
  • Constructor Details

    • PCODetector

      public PCODetector()
  • Method Details

    • preview

      public void preview(double acquireTime) throws Exception
      Throws:
      Exception
    • isHdfFormat

      public boolean isHdfFormat()
      Specified by:
      isHdfFormat in interface IPCODetector
      Returns:
      Returns the hdfFormat.
    • collectData

      public void collectData() throws DeviceException
      Description copied from interface: Detector
      Tells 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:
      collectData in interface Detector
      Throws:
      DeviceException
    • isExternalTriggered

      public boolean isExternalTriggered()
    • setExternalTriggered

      public void setExternalTriggered(boolean externalTriggered)
      Specified by:
      setExternalTriggered in interface IPCODetector
      Parameters:
      externalTriggered -
    • setHdfFormat

      public void setHdfFormat(boolean hdfFormat)
      Specified by:
      setHdfFormat in interface IPCODetector
      Parameters:
      hdfFormat - The hdfFormat to set.
    • getStatus

      public int getStatus()
      Description copied from interface: Detector
      Returns the current collecting state of the device.
      Specified by:
      getStatus in interface Detector
      Returns:
      BUSY if the detector has not finished the requested operation(s), IDLE if in an completely idle state and STANDBY if temporarily suspended.
    • readout

      public Object readout() throws DeviceException
      Description copied from interface: Detector
      Returns 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_CONCURRENTLY is true then motors may be moved while the detector readouts. The value returned must not be effected by any concurrent motor or shutter movements. See Detector.waitWhileBusy() and ConcurrentScan. Readout must block until the detector is ready to respond quickly to Detector.collectData() again.

      Specified by:
      readout in interface Detector
      Returns:
      the data collected
      Throws:
      DeviceException
    • setCollectionTime

      public void setCollectionTime(double collectionTime) throws DeviceException
      Description copied from interface: Detector
      Sets the collection time, in seconds, to be used during the next call of collectData.
      Specified by:
      setCollectionTime in interface Detector
      Overrides:
      setCollectionTime in class DetectorBase
      Parameters:
      collectionTime - the collection time in seconds
      Throws:
      DeviceException
    • setCollectionTime

      public void setCollectionTime(Object... collectspec) throws DeviceException
      Throws:
      DeviceException
    • atScanStart

      public void atScanStart() throws DeviceException
      Description copied from class: ScannableBase
      Called 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:
      atScanStart in interface Scannable
      Overrides:
      atScanStart in class ScannableBase
      Throws:
      DeviceException
      See Also:
    • atScanEnd

      public void atScanEnd() throws DeviceException
      Description copied from class: ScannableBase
      Called 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:
      atScanEnd in interface Scannable
      Overrides:
      atScanEnd in class ScannableBase
      Throws:
      DeviceException
      See Also:
    • atPointStart

      public void atPointStart() throws DeviceException
      Description copied from class: ScannableBase
      Called 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:
      atPointStart in interface Scannable
      Overrides:
      atPointStart in class ScannableBase
      Throws:
      DeviceException
      See Also:
    • stop

      public void stop() throws DeviceException
      Description copied from class: ScannableBase
      Stop 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:
      stop in interface Scannable
      Overrides:
      stop in class ScannableBase
      Throws:
      DeviceException
      See Also:
    • resetAll

      public void resetAll() throws Exception
      Description copied from interface: IPCODetector
      In addition to its own resets, this method also calls reset on all plugins
      Specified by:
      resetAll in interface IPCODetector
      Throws:
      Exception
    • setFormat

      public void setFormat(String format)
    • setNexusFormat

      public void setNexusFormat()
    • setFilePath

      public void setFilePath(File filePath) throws Exception
      manage the file path mapping between Windows (where the EPICS IOC is running) and Linux (Where data is to be stored).
      Specified by:
      setFilePath in interface IPCODetector
      Parameters:
      filePath -
      Throws:
      Exception
    • getFilePath

      public String getFilePath(String filePath)
    • 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

      public void beforeCollection() throws Exception, IOException, DeviceException
      processing to be done before starting acquire data from detector - create data storage parameters and metadata file
      Throws:
      Exception
      IOException
      DeviceException
    • collectDarkSet

      public void collectDarkSet(int numberOfDarks) throws Exception
      collect specified number of dark images - users must ensure the shutter is closed before call this method
      Specified by:
      collectDarkSet in interface IPCODetector
      Parameters:
      numberOfDarks -
      Throws:
      Exception
    • collectDarkSet

      public void collectDarkSet() throws Exception
      collect the dark image set - users must ensure the shutter is closed and number of images is set in EPICS
      Specified by:
      collectDarkSet in interface IPCODetector
      Throws:
      Exception
    • collectFlatSet

      public void collectFlatSet(int numberOfFlats, int flatSet) throws Exception
      collect specified numbers of flat images, users must ensure the shutter is open and sample is outside from the field of view.
      Specified by:
      collectFlatSet in interface IPCODetector
      Parameters:
      numberOfFlats - - number of flat images for each flat set
      flatSet - - the set number
      Throws:
      Exception
    • collectFlatSet

      public void collectFlatSet(int flatSet) throws Exception
      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

      public void resetFileNumber() throws Exception
      Throws:
      Exception
    • createMainFileStructure

      public File createMainFileStructure() throws IOException
      Description copied from interface: IPCODetector
      creates the main file structure and returns the root of the file system.
      Specified by:
      createMainFileStructure in interface IPCODetector
      Returns:
      File
      Throws:
      IOException
    • isBusy

      public boolean isBusy()
      Description copied from class: DetectorBase
      Check if the Scannable is moving/operating. default implementation is to call the getStatus method
      Specified by:
      isBusy in interface Scannable
      Overrides:
      isBusy in class DetectorBase
      Returns:
      true - if operation carried out by moveTo has not completed yet
      See Also:
    • isWriterBusy

      public boolean isWriterBusy() throws Exception
      Specified by:
      isWriterBusy in interface IPCODetector
      Returns:
      true if the writer is busy
      Throws:
      Exception
    • createsOwnFiles

      public boolean createsOwnFiles() throws DeviceException
      Description copied from interface: Detector
      Returns 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:
      createsOwnFiles in interface Detector
      Returns:
      true if readout() returns filenames
      Throws:
      DeviceException
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • setController

      public void setController(IPCOControllerV17 controller)
    • getController

      public IPCOControllerV17 getController()
      Specified by:
      getController in interface IPCODetector
      Returns:
      IPCOControllerV17 - controller associated with the detector.F
    • getDescription

      public String getDescription() throws DeviceException
      Specified by:
      getDescription in interface Detector
      Overrides:
      getDescription in class DetectorBase
      Returns:
      A description of the detector.
      Throws:
      DeviceException
    • setDescription

      public void setDescription(String description)
    • getDetectorID

      public String getDetectorID() throws DeviceException
      Specified by:
      getDetectorID in interface Detector
      Overrides:
      getDetectorID in class DetectorBase
      Returns:
      A identifier for this detector.
      Throws:
      DeviceException
    • setDetectorID

      public void setDetectorID(String detectorID)
    • getDetectorType

      public String getDetectorType() throws DeviceException
      Specified by:
      getDetectorType in interface Detector
      Overrides:
      getDetectorType in class DetectorBase
      Returns:
      The type of detector.
      Throws:
      DeviceException
    • setDetectorType

      public void setDetectorType(String detectorType)
    • setLocalFilePath

      public void setLocalFilePath(String localFilePath)
    • getLocalFilePath

      public String getLocalFilePath()
      Specified by:
      getLocalFilePath in interface IPCODetector
      Returns:
      the local file path
    • getProjectionFolderName

      public String getProjectionFolderName()
      Specified by:
      getProjectionFolderName in interface IPCODetector
      Returns:
      the projection folder name
    • setProjectionFolderName

      public void setProjectionFolderName(String projectionFoldername)
    • setDarkFileNameRoot

      public void setDarkFileNameRoot(String darkFileNameRoot)
    • getDarkFileNameRoot

      public String getDarkFileNameRoot()
      Specified by:
      getDarkFileNameRoot in interface IPCODetector
      Returns:
      the dark file name root
    • setFlatFileNameRoot

      public void setFlatFileNameRoot(String faltFileNameRoot)
    • getFlatFileNameRoot

      public String getFlatFileNameRoot()
      Specified by:
      getFlatFileNameRoot in interface IPCODetector
      Returns:
      the flat file name root
    • setNumberOfDarkImages

      public void setNumberOfDarkImages(int numberOfDarkImages)
    • getNumberOfDarkImages

      public int getNumberOfDarkImages()
      Specified by:
      getNumberOfDarkImages in interface IPCODetector
      Returns:
      number of dark images collected
    • setNumberOfFlatImages

      public void setNumberOfFlatImages(int numberOfFlatImages)
    • getNumberOfFlatImages

      public int getNumberOfFlatImages()
      Specified by:
      getNumberOfFlatImages in interface IPCODetector
      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

      public void setPlotName(String plotName)
    • getPlotName

      public String getPlotName()
      Specified by:
      getPlotName in interface IPCODetector
      Returns:
      the plot name the is associated with the detector.
    • getFullFilename

      public String getFullFilename() throws Exception
      Throws:
      Exception
    • setNumImages

      public void setNumImages(int num) throws Exception
      Throws:
      Exception
    • setNumCapture

      public void setNumCapture(int num) throws Exception
      Throws:
      Exception
    • acquireSynchronously

      public void acquireSynchronously() throws Exception
      Acquire and wait till the acquisition is complete.
      Specified by:
      acquireSynchronously in interface IPCODetector
      Throws:
      Exception
    • stopCapture

      public void stopCapture() throws Exception
      Specified by:
      stopCapture in interface IPCODetector
      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

      public String getTiffImageFileName() throws Exception
      Specified by:
      getTiffImageFileName in interface IPCODetector
      Throws:
      Exception
    • setTiffFilePathBasedOnIocOS

      public void setTiffFilePathBasedOnIocOS(String demandRawFilePath) throws Exception
      Specified by:
      setTiffFilePathBasedOnIocOS in interface IPCODetector
      Throws:
      Exception
    • setADCMode

      public void setADCMode(int mode) throws Exception
      Description copied from interface: IPCODetector
      The ADC mode is set on the detector
      Specified by:
      setADCMode in interface IPCODetector
      Parameters:
      mode -
      Throws:
      Exception
    • setSaveLocal

      public void setSaveLocal(boolean saveLocal)
    • isSaveLocal

      public boolean isSaveLocal()
    • setTriggerPV

      public void setTriggerPV(String triggerPV)
    • getTriggerPV

      public String getTriggerPV()
    • setTimestampMode

      public void setTimestampMode(int timestampMode) throws Exception
      Throws:
      Exception