Package gda.data.scan.datawriter
Class XasAsciiNexusDataWriter
java.lang.Object
gda.data.scan.datawriter.DataWriterBase
gda.data.scan.datawriter.XasAsciiNexusDataWriter
- All Implemented Interfaces:
ConfigurableAsciiFormat,DataWriter,IDataWriterExtender,INexusDataWriter
public class XasAsciiNexusDataWriter
extends DataWriterBase
implements ConfigurableAsciiFormat, INexusDataWriter
Write to an Xas and a Nexus file simultaneously
-
Field Summary
Fields inherited from class gda.data.scan.datawriter.DataWriterBase
delimiter, header, terminalPrinter -
Constructor Summary
Constructors -
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 i) If filenumber not set then read from scandatapoint or from num trackerGet the absFilePath for this scanintGet the current scan identifier (ie scan number)Returns the full path of the folder which data files are written to.header is a publicly accessible string which will be written to the file (or saved to a database) during the prepareForCollection method.The file name of the nexus file being written by this writer.Returns aSwmrStatusobject specifying the state of SWMR mode (single-write multiple-read) for the nexus file written by this writer.voidremoveDataWriterExtender(IDataWriterExtender dataWriterExtender) Remove a IDataWriterExtender to handle DataWriter events.voidsetAsciiFileNameTemplate(String asciiFileNameTemplate) voidsetBeforeScanMetaData(INexusTree beforeScanMetadata) Add anINexusTreeto be written as before scan metadata.voidsetConfiguration(AsciiDataWriterConfiguration configuration) Must be called before the first time addData is called (obviously?)voidsetDescriptions(List<String> descriptions) voidsetDetectorParametersName(String detectorParametersName) voidsetFolderName(String folderName) voidSets the header of the datahandlervoidsetNexusFileNameTemplate(String nexusFileNameTemplate) Sets the template to use for the filename.voidsetOutputParametersName(String outputParametersName) voidsetRunFromExperimentDefinition(Boolean runFromExperimentDefinition) voidsetSampleName(String sampleName) voidsetSampleParametersName(String sampleParametersName) voidsetScanParametersName(String scanParametersName) Methods inherited from class gda.data.scan.datawriter.DataWriterBase
addData, completeCollection, getDetectorData, getDetectorData, setHeaderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gda.data.scan.datawriter.DataWriter
scanStart, setHeader
-
Constructor Details
-
XasAsciiNexusDataWriter
public XasAsciiNexusDataWriter()
-
-
Method Details
-
configureScanNumber
public void configureScanNumber(int i) Description copied from class:DataWriterBaseIf filenumber not set then read from scandatapoint or from num tracker- Specified by:
configureScanNumberin interfaceDataWriter- Overrides:
configureScanNumberin classDataWriterBase- Parameters:
i-
-
getCurrentFileName
Description copied from interface:DataWriterGet the absFilePath for this scan- Specified by:
getCurrentFileNamein interfaceDataWriter- Returns:
- String
-
getAsciiFileName
-
getCurrentScanIdentifier
public int getCurrentScanIdentifier()Description copied from interface:DataWriterGet the current scan identifier (ie scan number)- Specified by:
getCurrentScanIdentifierin interfaceDataWriter- Returns:
- String
-
setHeader
Description copied from interface:DataWriterSets the header of the datahandler- Specified by:
setHeaderin interfaceDataWriter- Parameters:
header- String
-
addData
Description copied from interface:DataWriterfor incremental addition of data- Specified by:
addDatain interfaceDataWriter- Overrides:
addDatain classDataWriterBase- Parameters:
newData- Object- Throws:
Exception
-
completeCollection
Description copied from interface:DataWriterCalled when data collection has been completed- Specified by:
completeCollectionin interfaceDataWriter- Overrides:
completeCollectionin classDataWriterBase- Throws:
Exception
-
getHeader
Description copied from interface:DataWriterheader 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.- Specified by:
getHeaderin interfaceDataWriter- Overrides:
getHeaderin classDataWriterBase- Returns:
- an ArrayList containing header information
-
addDataWriterExtender
Description copied from interface:DataWriterAdds an additional IDataWriterExtender to handle DataWriter events- Specified by:
addDataWriterExtenderin interfaceDataWriter- Specified by:
addDataWriterExtenderin interfaceIDataWriterExtender- Overrides:
addDataWriterExtenderin classDataWriterBase- Parameters:
dataWriterExtender-
-
removeDataWriterExtender
Description copied from interface:DataWriterRemove a IDataWriterExtender to handle DataWriter events.- Specified by:
removeDataWriterExtenderin interfaceDataWriter- Specified by:
removeDataWriterExtenderin interfaceIDataWriterExtender- Overrides:
removeDataWriterExtenderin classDataWriterBase- Parameters:
dataWriterExtender-
-
getConfiguration
- Specified by:
getConfigurationin interfaceConfigurableAsciiFormat
-
setConfiguration
Description copied from interface:ConfigurableAsciiFormatMust be called before the first time addData is called (obviously?)- Specified by:
setConfigurationin interfaceConfigurableAsciiFormat- Parameters:
configuration-
-
getNexusFileNameTemplate
-
setNexusFileNameTemplate
Description copied from interface:INexusDataWriterSets the template to use for the filename. This should use the stringString.format(String, Object...)pattern, with a single format specifier%s, e.g.ixx-%d.nxs.- Specified by:
setNexusFileNameTemplatein interfaceINexusDataWriter- Parameters:
nexusFileNameTemplate-
-
getAsciiFileNameTemplate
-
setAsciiFileNameTemplate
-
getDescriptions
-
setDescriptions
-
setSampleName
-
setScanParametersName
-
setSampleParametersName
-
setDetectorParametersName
-
setOutputParametersName
-
setFolderName
-
getRunFromExperimentDefinition
-
setRunFromExperimentDefinition
-
getNexusFileName
Description copied from interface:INexusDataWriterThe file name of the nexus file being written by this writer.- Specified by:
getNexusFileNamein interfaceINexusDataWriter- Returns:
- file name of nexus file
-
getDataDir
Description copied from interface:INexusDataWriterReturns the full path of the folder which data files are written to.- Specified by:
getDataDirin interfaceINexusDataWriter- Returns:
- the full path of the folder which data files are written
-
getSwmrStatus
Description copied from interface:INexusDataWriterReturns aSwmrStatusobject specifying the state of SWMR mode (single-write multiple-read) for the nexus file written by this writer. See the javadoc forSwmrStatusfor details.- Specified by:
getSwmrStatusin interfaceINexusDataWriter- Returns:
- the
SwmrStatus
-
setBeforeScanMetaData
Description copied from interface:INexusDataWriterAdd anINexusTreeto be written as before scan metadata. TODO: do we need this method. It doesn't seem to be used, but may potentially be useful?- Specified by:
setBeforeScanMetaDatain interfaceINexusDataWriter- Parameters:
beforeScanMetadata-
-