Package gda.data.scan.datawriter
Interface DataWriter
- All Known Subinterfaces:
ConfigurableAsciiFormat,INexusDataWriter
- All Known Implementing Classes:
AsciiDataWriter,DatapointCompletingDataWriter,DataWriterBase,DummyDataWriter,EpicsCVscanDataWriter,IncrementalFile,MacDataWriter,NexusDataWriter,NexusExtraMetadataDataWriter,NexusScanDataWriter,SrsDataFile,XasAsciiDataWriter,XasAsciiNexusDatapointCompletingDataWriter,XasAsciiNexusDataWriter,XasNexusDataWriter
public interface DataWriter
Interface for objects which hold references to data.
The actions of these objects will be beamline dependent. Each DataWriter type is format specific.
The data handler could be used for more then writing data to an ascii file. It could be used to create new folders, determine file names etc. etc.
This class is normally client-side for use during scans. This should be taken into consideration whether to use this class to actually write files, or simply to hold file references.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddData(IScanDataPoint newData) for incremental addition of datavoidaddDataWriterExtender(IDataWriterExtender dataWriterExtender) Adds an additional IDataWriterExtender to handle DataWriter eventsvoidCalled when data collection has been completedvoidconfigureScanNumber(int scanNumber) method used to allow filewriter to configure the scanNumber based on the supplied value or internally if null It is called by the ScanBase.prepareScanForCollectionGet the absFilePath for this scanintGet the current scan identifier (ie scan number)header is a publicly accessible string which will be written to the file (or saved to a database) during the prepareForCollection method.voidremoveDataWriterExtender(IDataWriterExtender dataWriterExtender) Remove a IDataWriterExtender to handle DataWriter events.default voidCalled at the start of the scan with aScanInformationobject describing the scan (i.e.voidSets the header of the datahandlervoidSets the header of the datahandler
-
Method Details
-
addData
for incremental addition of data- Parameters:
newData- Object- Throws:
Exception
-
completeCollection
Called when data collection has been completed- Throws:
Exception
-
getCurrentFileName
String getCurrentFileName()Get the absFilePath for this scan- Returns:
- String
-
getCurrentScanIdentifier
int getCurrentScanIdentifier()Get the current scan identifier (ie scan number)- Returns:
- String
-
getHeader
header is a publicly accessible string which will be written to the file (or saved to a database) during the prepareForCollection method. Before this method is called, the header object may be added to using these accessor methods.- Returns:
- an ArrayList containing header information
-
setHeader
Sets the header of the datahandler- Parameters:
header- String
-
setHeader
Sets the header of the datahandler- Parameters:
header- ArrayList
-
removeDataWriterExtender
Remove a IDataWriterExtender to handle DataWriter events.- Parameters:
dataWriterExtender-
-
addDataWriterExtender
Adds an additional IDataWriterExtender to handle DataWriter events- Parameters:
dataWriterExtender-
-
configureScanNumber
method used to allow filewriter to configure the scanNumber based on the supplied value or internally if null It is called by the ScanBase.prepareScanForCollection- Parameters:
scanNumber-- Throws:
Exception
-
scanStart
default void scanStart(ScanInformation scanInfo, List<Scannable> scannables, List<Detector> detectors) throws Exception Called at the start of the scan with aScanInformationobject describing the scan (i.e. detector names, scannable names, scan dimensions) as well as the actual scannable and detector objects themselves- Parameters:
scanInfo- describes the scanscannables- the scannables in the scandetectors- the detectors in the scan- Throws:
Exception
-