Class DatasetNexusDetector

All Implemented Interfaces:
Detector, NexusDetector, Device, Scannable, Configurable, Findable, gda.observable.IObservable, Serializable
Direct Known Subclasses:
MoveableImageDetector, ReadbackDemandDifference

public abstract class DatasetNexusDetector extends DetectorBase implements NexusDetector
NexusDetector implementation that returns a Nexus tree containing a Dataset. The readout() method returns a NexusTreeProvider object containing the dataset produced by getDataset() method.
See Also:
  • Constructor Details

    • DatasetNexusDetector

      public DatasetNexusDetector()
  • Method Details

    • 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
    • getDataset

      public abstract org.eclipse.january.dataset.IDataset getDataset() throws DeviceException
      The readout() function calls this method
      Returns:
      A dataset object. .
      Throws:
      DeviceException
    • getStatus

      public int getStatus() throws DeviceException
      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.
      Throws:
      DeviceException
    • 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
    • readout

      public NexusTreeProvider readout() throws DeviceException
      Produce the detector data, by putting the dataset returned by invalid input: '{@'#link #getDataset()} into a NexusTreeProvider object.
      Specified by:
      readout in interface Detector
      Specified by:
      readout in interface NexusDetector
      Returns:
      the data collected
      Throws:
      DeviceException
    • getPosition

      public Object getPosition() throws DeviceException
      Description copied from class: DetectorBase
      Returns the current position of the Scannable. Called by ConcurentScan at the end of the point. Reads an internal (hardware) position from rawGetPosition, converts this to an external (user) position and returns it. Also, if createsOwnFiles attempts to register the file with all FileRegistrars (primarily for data archiving). Note that this method will be called if the detector is triggered from a 'pos' command but not if the detector is triggered by the scan command (which ignores the detector's scannable interface).
      Specified by:
      getPosition in interface Scannable
      Overrides:
      getPosition in class DetectorBase
      Returns:
      Current position with an element for each input and extra field. null if their are no fields.
      Throws:
      DeviceException
      See Also:
    • createNexusData

      protected NXDetectorData createNexusData(org.eclipse.january.dataset.IDataset dataset)
      Create a Nexus tree containing a dataset
      Parameters:
      dataset -
      Returns:
      NexusTreeProvider object
    • getDataGroupName

      public String getDataGroupName()
    • setDataGroupName

      public void setDataGroupName(String dataGroupName)