areaDetector 1-8
Public Member Functions | Protected Attributes
NDFileNexus Class Reference

Writes NDArrays in the NeXus file format. More...

#include <NDFileNexus.h>

Inheritance diagram for NDFileNexus:
NDPluginFile NDPluginDriver asynNDArrayDriver asynPortDriver

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
[in]portNameThe name of the asyn port driver to be created.
[in]queueSizeThe 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]blockingCallbacksInitial 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]NDArrayPortName of asyn port driver for initial source of NDArray callbacks.
[in]NDArrayAddrasyn port driver address for initial source of NDArray callbacks.
[in]priorityThe thread priority for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.
[in]stackSizeThe stack size for the asyn port driver thread if ASYN_CANBLOCK is set in asynFlags.

Member Function Documentation

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.

Parameters:
[in]fileNameAbsolute path name of the file to open.
[in]openModeBit 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]pArrayPointer 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.

Parameters:
[in]pArrayPointer 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.

Parameters:
[in]pArrayPointer 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.

Parameters:
[in]pasynUserpasynUser structure that encodes the reason and address.
[in]valueAddress of the string to write.
[in]nCharsNumber of characters to write.
[out]nActualNumber of characters actually written.

Reimplemented from NDPluginDriver.


Member Data Documentation


The documentation for this class was generated from the following files: