Class FileWriterBase
java.lang.Object
gda.device.detector.addetector.filewriter.FileWriterBase
- All Implemented Interfaces:
NXFileWriterPlugin,NXFileWriterWithTemplate,NXPlugin,NXPluginBase,PositionInputStream<NXDetectorDataAppender>,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
MultipleImagesPerHDF5FileWriter,MultipleImagesPerParallelHDF5FileWriter,SingleImagePerFileWriter
public abstract class FileWriterBase
extends Object
implements NXFileWriterPlugin, NXFileWriterWithTemplate, org.springframework.beans.factory.InitializingBean
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidprotected voidprotected voidUse this method to clear writeStatus ready for next scan.voidvoidprotected abstract voidvoidenableCallback(boolean enable) protected StringgetAbsoluteFilePath(String filePathRelativeToDataDir) protected StringOnly if the path template starts with the datadir, return a path relative to it, otherwise return an absolute path.protected Stringlongprotected Stringprotected Stringprotected longbooleanbooleanbooleanbooleanvoidprepareForCollection(int numberImagesPerCollection, ScanInformation scanInfo) voidvoidsetEnabled(boolean enableDuringScan) voidsetFileNameTemplate(String fileNameTemplate) The file name to pass to AreadDetector, with $scan$ resolving to the currently running scan number, and $datadir$ to the current scan file's directory.voidsetFileNumberAtScanStart(long fileNumberAtScanStart) If non-negative, the file number to preset in AreaDetector before staring the exposurevoidsetFilePathTemplate(String filePathTemplate) The file path to pass to AreadDetector, with $scan$ resolving to the currently running scan number, and $datadir$ to the current scan file's directory.voidsetFileTemplate(String fileTemplate) File template to pass directly to AreaDetector.protected voidvoidsetNdArrayPortVal(String ndArrayPortVal) voidvoidsetPathErrorSuppressed(boolean pathErrorSuppressed) voidsetSetFileNameAndNumber(boolean setFileNameAndNumber) voidsetWriteErrorStatusSupported(boolean writeErrorStatusSupported) voidstop()booleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface gda.device.detector.nxdetector.NXFileWriterPlugin
appendsFilepathStringsMethods inherited from interface gda.device.detector.nxdetector.NXPluginBase
getInputStreamFormats, getInputStreamNames, getNameMethods inherited from interface gda.device.scannable.PositionInputStream
read
-
Field Details
-
fileTemplate
-
-
Constructor Details
-
FileWriterBase
public FileWriterBase()
-
-
Method Details
-
disableFileWriting
- Throws:
Exception
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
isWriteErrorStatusSupported
public boolean isWriteErrorStatusSupported() -
setWriteErrorStatusSupported
public void setWriteErrorStatusSupported(boolean writeErrorStatusSupported) -
isWriteStatusErr
- Throws:
Exception
-
checkErrorStatus
- Throws:
DeviceException
-
clearWriteStatusErr
Use this method to clear writeStatus ready for next scan.- Throws:
DeviceException
-
setNdFile
-
setFileTemplate
File template to pass directly to AreaDetector. AreaDetector's NDFilePlugin (http://cars.uchicago.edu/software/epics/NDPluginFile.html) will always apply arguments to the template in the order filepath, filename, filenumber- Specified by:
setFileTemplatein interfaceNXFileWriterWithTemplate- Parameters:
fileTemplate-
-
setFilePathTemplate
The file path to pass to AreadDetector, with $scan$ resolving to the currently running scan number, and $datadir$ to the current scan file's directory.- Specified by:
setFilePathTemplatein interfaceNXFileWriterWithTemplate- Parameters:
filePathTemplate-
-
setFileNameTemplate
The file name to pass to AreadDetector, with $scan$ resolving to the currently running scan number, and $datadir$ to the current scan file's directory.- Specified by:
setFileNameTemplatein interfaceNXFileWriterWithTemplate- Parameters:
fileNameTemplate-
-
setFileNumberAtScanStart
public void setFileNumberAtScanStart(long fileNumberAtScanStart) If non-negative, the file number to preset in AreaDetector before staring the exposure- Parameters:
fileNumberAtScanStart-
-
setSetFileNameAndNumber
public void setSetFileNameAndNumber(boolean setFileNameAndNumber) -
getNdFile
-
getFileTemplate
- Returns:
- the file template to configure in AreaDetector
-
getFilePathTemplate
-
getFileNameTemplate
-
getFileNumberAtScanStart
public long getFileNumberAtScanStart() -
isSetFileNameAndNumber
public boolean isSetFileNameAndNumber() -
isPathErrorSuppressed
public boolean isPathErrorSuppressed() -
setPathErrorSuppressed
public void setPathErrorSuppressed(boolean pathErrorSuppressed) -
getFilePath
- Returns:
- the file path to configure in AreaDetector
-
getFileDirRelativeToDataDirIfPossible
Only if the path template starts with the datadir, return a path relative to it, otherwise return an absolute path. -
getRelativeFilePath
- Returns:
- the file path relative to the data directory if it starts with the datadir, otherwise returns absolute path.
- Throws:
Exception
-
getAbsoluteFilePath
-
getFileName
- Returns:
- the file name to configure in AreaDetector
-
getNdArrayPortVal
-
setNdArrayPortVal
-
stop
- Specified by:
stopin interfaceNXPluginBase- Throws:
Exception
-
atCommandFailure
- Specified by:
atCommandFailurein interfaceNXPluginBase- Throws:
Exception
-
setEnabled
public void setEnabled(boolean enableDuringScan) -
isEnabled
public boolean isEnabled() -
enableCallback
- Throws:
Exception
-
getScanNumber
- Returns:
- The unique scanNubmer from the current scan.
- Throws:
Exception
-
getFullFileName
- Specified by:
getFullFileNamein interfaceNXFileWriterPlugin- Throws:
Exception
-
setNDArrayPortAndAddress
- Throws:
Exception
-
willRequireCallbacks
public boolean willRequireCallbacks()- Specified by:
willRequireCallbacksin interfaceNXPluginBase
-
prepareForLine
- Specified by:
prepareForLinein interfaceNXPluginBase- Throws:
Exception
-
completeLine
- Specified by:
completeLinein interfaceNXPluginBase- Throws:
Exception
-
completeCollection
- Specified by:
completeCollectionin interfaceNXPluginBase- Throws:
Exception
-
prepareForCollection
public void prepareForCollection(int numberImagesPerCollection, ScanInformation scanInfo) throws Exception - Specified by:
prepareForCollectionin interfaceNXPluginBase- Throws:
Exception
-