areaDetector  3-14
EPICS areaDetector framework
NDPluginFile.h
Go to the documentation of this file.
1 #ifndef NDPluginFile_H
2 #define NDPluginFile_H
3 
4 #include <epicsTypes.h>
5 #include <epicsMutex.h>
6 
7 #include "NDPluginDriver.h"
8 
10 #define NDFileModeRead 0x01
12 #define NDFileModeWrite 0x02
14 #define NDFileModeAppend 0x04
16 #define NDFileModeMultiple 0x08
17 typedef int NDFileOpenMode_t;
18 
19 #define FILEPLUGIN_NAME "FilePluginFileName"
20 #define FILEPLUGIN_NUMBER "FilePluginFileNumber"
21 #define FILEPLUGIN_DESTINATION "FilePluginDestination"
22 #define FILEPLUGIN_CLOSE "FilePluginClose"
23 
29 public:
30  NDPluginFile(const char *portName, int queueSize, int blockingCallbacks,
31  const char *NDArrayPort, int NDArrayAddr, int maxAddr,
32  int maxBuffers, size_t maxMemory, int interfaceMask, int interruptMask,
33  int asynFlags, int autoConnect, int priority, int stackSize, int maxThreads,
34  bool compressionAware = false);
35 
36  /* These methods override those in the base class */
37  virtual void processCallbacks(NDArray *pArray);
38  virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
39  virtual asynStatus writeNDArray(asynUser *pasynUser, void *genericPointer);
40 
50  virtual asynStatus openFile(const char *fileName, NDFileOpenMode_t openMode, NDArray *pArray) = 0;
51 
54  virtual asynStatus readFile(NDArray **pArray) = 0;
55 
60  virtual asynStatus writeFile(NDArray *pArray) = 0;
61 
64  virtual asynStatus closeFile() = 0;
65 
69 private:
70  asynStatus openFileBase(NDFileOpenMode_t openMode, NDArray *pArray);
71  asynStatus readFileBase();
72  asynStatus writeFileBase();
73  asynStatus closeFileBase();
74  asynStatus doCapture(int capture);
75  void freeCaptureBuffer();
76  asynStatus attrFileCloseCheck();
77  asynStatus attrFileNameCheck();
78  asynStatus attrFileNameSet();
79  bool attrIsProcessingRequired(NDAttributeList* pAttrList);
80  void registerInitFrameInfo(NDArray *pArray);
81  bool isFrameValid(NDArray *pArray);
83  std::vector<NDArray*> pCapture;
84  epicsMutexId fileMutexId;
85  bool useAttrFilePrefix;
86  bool lazyOpen;
87  NDArrayInfo_t *ndArrayInfoInit;
89 };
90 
91 #endif
#define NDPLUGIN_API
Definition: NDPluginAPI.h:41
int NDFileOpenMode_t
Definition: NDPluginFile.h:17
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:99
NDAttributeList.h.
Definition: NDAttributeList.h:21
Class from which actual plugin drivers are derived; derived from asynNDArrayDriver.
Definition: NDPluginDriver.h:57
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value)
Called when asyn clients call pasynInt32->write().
Definition: NDPluginDriver.cpp:678
virtual void processCallbacks(NDArray *pArray)=0
Base class for NDArray file writing plugins; actual file writing plugins inherit from this class.
Definition: NDPluginFile.h:28
int supportsMultipleArrays
Derived classes must set this flag to 0/1 if they cannot/can write multiple NDArrays to a single file...
Definition: NDPluginFile.h:66
virtual asynStatus readFile(NDArray **pArray)=0
Read NDArray data from a file; pure virtual function that must be implemented by derived classes.
virtual asynStatus closeFile()=0
Close the file opened with NDPluginFile::openFile; pure virtual function that must be implemented by ...
virtual asynStatus openFile(const char *fileName, NDFileOpenMode_t openMode, NDArray *pArray)=0
Open a file; pure virtual function that must be implemented by derived classes.
virtual asynStatus writeFile(NDArray *pArray)=0
Write NDArray data to a file; pure virtual function that must be implemented by derived classes.
list value
Definition: makeDbAndEdl.py:234
Structure returned by NDArray::getInfo.
Definition: NDArray.h:78