Package org.eclipse.dawnsci.nexus
Interface IWritableNexusDevice<N extends NXobject>
- Type Parameters:
N- the type of nexus object to be created, a sub-interface ofNXobject, e.g.NXdetector
- All Superinterfaces:
INexusDevice<N>
- All Known Implementing Classes:
AbstractDetectorNexusDeviceAdapter,AbstractNexusDeviceAdapter,AbstractScannableNexusDevice,AbstractWriteRegionsImmediatelyNXDetector,ConfiguredScannableNexusDevice,CounterTimerNexusDevice,DefaultScannableNexusDevice,FileCreatorDetectorNexusDevice,GenericDetectorNexusDevice,LegacyNexusDetectorNexusDevice,NexusDetectorNexusDevice,SpecsPhoibosSolsticeAnalyser,VGScientaAnalyserNXDetector
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 -
Method Summary
Modifier and TypeMethodDescriptionvoidscanEnd()Called at the end of a scan.static voidwriteDataset(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 givenSliceNDscanSlice.voidwritePosition(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 writescanSlice- scan slice specifying where in the dataset to write to.- Throws:
NexusException- if the position could not be written for any reason
-
scanEnd
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 givenSliceNDscanSlice. Call this fromwritePosition(Object, SliceND)with theSliceNDpassed in.- Parameters:
toWrite- the dataset to write todata- the data to write, can be any object or already a datasetscanSlice- specifying where to write to in the scan- Throws:
org.eclipse.january.DatasetException- if an error occurs writing to the dataset
-