Interface IWritableNexusDevice<N extends NXobject>

Type Parameters:
N - the type of nexus object to be created, a sub-interface of NXobject, e.g. NXdetector
All Superinterfaces:
INexusDevice<N>
All Known Implementing Classes:
AbstractDetectorNexusDeviceAdapter, AbstractNexusDeviceAdapter, AbstractScannableNexusDevice, AbstractWriteRegionsImmediatelyNXDetector, ConfiguredScannableNexusDevice, CounterTimerNexusDevice, DefaultScannableNexusDevice, FileCreatorDetectorNexusDevice, GenericDetectorNexusDevice, LegacyNexusDetectorNexusDevice, NexusDetectorNexusDevice, SpecsPhoibosSolsticeAnalyser, VGScientaAnalyserNXDetector

public interface IWritableNexusDevice<N extends NXobject> extends INexusDevice<N>
An INexusDevice that can be write data to its dataset at each point in the scan. This is required if the device does already not write its data at each point in the scan in the method that the scan algorithm calls when it is either moved to (scannables) or exposed (detectors). The method called would depend on the scanning API being used.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int[]
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called at the end of a scan.
    static void
    writeDataset(org.eclipse.january.dataset.ILazyWriteableDataset toWrite, Object data, org.eclipse.january.dataset.SliceND scanSlice)
    A convenience method useful for implementing classes to write a value to a dataset at the position in the scan represented by the given SliceND scanSlice.
    void
    writePosition(Object data, org.eclipse.january.dataset.SliceND scanSlice)
    Write the given data object at the given scan slice.

    Methods inherited from interface org.eclipse.dawnsci.nexus.INexusDevice

    getCustomNexusModification, getName, getNexusProvider, getNexusProviders, register
  • Field Details

    • SCALAR_DATASET_SHAPE

      static final int[] SCALAR_DATASET_SHAPE
  • Method Details

    • writePosition

      void writePosition(Object data, org.eclipse.january.dataset.SliceND scanSlice) throws NexusException
      Write the given data object at the given scan slice.
      Parameters:
      data - data object to write
      scanSlice - scan slice specifying where in the dataset to write to.
      Throws:
      NexusException - if the position could not be written for any reason
    • scanEnd

      void scanEnd() throws NexusException
      Called at the end of a scan. The implementation should use this to clear up any state, such as closing any files and releasing any cached datasets so that this device can be used in subsequent scans.
      Throws:
      NexusException - if an error occurred for any reason
    • writeDataset

      static void writeDataset(org.eclipse.january.dataset.ILazyWriteableDataset toWrite, Object data, org.eclipse.january.dataset.SliceND scanSlice) throws org.eclipse.january.DatasetException
      A convenience method useful for implementing classes to write a value to a dataset at the position in the scan represented by the given SliceND scanSlice. Call this from writePosition(Object, SliceND) with the SliceND passed in.
      Parameters:
      toWrite - the dataset to write to
      data - the data to write, can be any object or already a dataset
      scanSlice - specifying where to write to in the scan
      Throws:
      org.eclipse.january.DatasetException - if an error occurs writing to the dataset