areaDetector 1-9
|
Writes NDArrays in the NeXus file format. More...
#include <NDFileNexus.h>
Public Member Functions | |
NDFileNexus (const char *portName, int queueSize, int blockingCallbacks, const char *NDArrayPort, int NDArrayAddr, int priority, int stackSize) | |
Constructor for NDFileNexus; all parameters are simply passed to NDPluginFile::NDPluginFile. | |
virtual asynStatus | openFile (const char *fileName, NDFileOpenMode_t openMode, NDArray *pArray) |
Opens NeXus file. | |
virtual asynStatus | readFile (NDArray **pArray) |
Read NDArray data from a NeXus file; NOT YET IMPLEMENTED. | |
virtual asynStatus | writeFile (NDArray *pArray) |
Writes a single NDArray to a NeXus file. | |
virtual asynStatus | closeFile () |
Closes the NeXus file opened with NDFileNexus::openFile. | |
asynStatus | writeOctet (asynUser *pasynUser, const char *value, size_t nChars, size_t *nActual) |
Called when asyn clients call pasynOctet->write(). | |
Protected Attributes | |
int | NDFileNexusTemplatePath |
int | NDFileNexusTemplateFile |
int | NDFileNexusTemplateValid |
Writes NDArrays in the NeXus file format.
Uses an XML template file to configure the contents of the NeXus file.
This version is currently limited to writing a single NDArray to each NeXus file. Future releases will be capable of storing multiple NDArrays in each NeXus file.
NDFileNexus::NDFileNexus | ( | const char * | portName, |
int | queueSize, | ||
int | blockingCallbacks, | ||
const char * | NDArrayPort, | ||
int | NDArrayAddr, | ||
int | priority, | ||
int | stackSize | ||
) |
Constructor for NDFileNexus; all parameters are simply passed to NDPluginFile::NDPluginFile.
[in] | portName | The name of the asyn port driver to be created. |
[in] | queueSize | The number of NDArrays that the input queue for this plugin can hold when NDPluginDriverBlockingCallbacks=0. Larger queues can decrease the number of dropped arrays, at the expense of more NDArray buffers being allocated from the underlying driver's NDArrayPool. |
[in] | blockingCallbacks | Initial setting for the NDPluginDriverBlockingCallbacks flag. 0=callbacks are queued and executed by the callback thread; 1 callbacks execute in the thread of the driver doing the callbacks. |
[in] | NDArrayPort | Name of asyn port driver for initial source of NDArray callbacks. |
[in] | NDArrayAddr | asyn port driver address for initial source of NDArray callbacks. |
[in] | priority | The thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags. |
[in] | stackSize | The stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags. |
asynStatus NDFileNexus::closeFile | ( | ) | [virtual] |
Closes the NeXus file opened with NDFileNexus::openFile.
Implements NDPluginFile.
asynStatus NDFileNexus::openFile | ( | const char * | fileName, |
NDFileOpenMode_t | openMode, | ||
NDArray * | pArray | ||
) | [virtual] |
Opens NeXus file.
[in] | fileName | Absolute path name of the file to open. |
[in] | openMode | Bit mask with one of the access mode bits NDFileModeRead, NDFileModeWrite. NDFileModeAppend. May also have the bit NDFileModeMultiple set if the file is to be opened to write or read multiple NDArrays into a single file. |
[in] | pArray | Pointer to an NDArray; this array does not contain data to be written or read. Rather it can be used to determine the header information and data structure for the file. It is guaranteed that NDArrays pass to NDPluginFile::writeFile or NDPluginFile::readFile will have the same data type, data dimensions and attributes as this array. |
Implements NDPluginFile.
asynStatus NDFileNexus::readFile | ( | NDArray ** | pArray | ) | [virtual] |
Read NDArray data from a NeXus file; NOT YET IMPLEMENTED.
[in] | pArray | Pointer to the address of an NDArray to read the data into. |
Implements NDPluginFile.
asynStatus NDFileNexus::writeFile | ( | NDArray * | pArray | ) | [virtual] |
Writes a single NDArray to a NeXus file.
[in] | pArray | Pointer to an NDArray to write to the file. This function can be called multiple times between the call to openFile and closeFile once this class supports MultipleArrays=1 and if NDFileModeMultiple was set in openMode in the call to NDPluginFile::openFile (e.g. capture or stream mode). |
Implements NDPluginFile.
asynStatus NDFileNexus::writeOctet | ( | asynUser * | pasynUser, |
const char * | value, | ||
size_t | nChars, | ||
size_t * | nActual | ||
) | [virtual] |
Called when asyn clients call pasynOctet->write().
Catch parameter changes. If the user changes the path or name of the template file load the new template file.
[in] | pasynUser | pasynUser structure that encodes the reason and address. |
[in] | value | Address of the string to write. |
[in] | nChars | Number of characters to write. |
[out] | nActual | Number of characters actually written. |
Reimplemented from NDPluginDriver.
int NDFileNexus::NDFileNexusTemplateFile [protected] |
int NDFileNexus::NDFileNexusTemplatePath [protected] |
int NDFileNexus::NDFileNexusTemplateValid [protected] |