areaDetector  3-5-0
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
11 
12 #define NDFileModeWrite 0x02
13 
14 #define NDFileModeAppend 0x04
15 
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 
28 class epicsShareClass NDPluginFile : public NDPluginDriver {
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(int numCapture);
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  NDArray **pCapture;
84  int captureBufferSize;
85  epicsMutexId fileMutexId;
86  bool useAttrFilePrefix;
87  bool lazyOpen;
88  NDArrayInfo_t *ndArrayInfoInit;
90 };
91 
92 #endif
Class from which actual plugin drivers are derived; derived from asynNDArrayDriver.
Definition: NDPluginDriver.h:56
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value)
Called when asyn clients call pasynInt32->write().
Definition: NDPluginDriver.cpp:684
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
Structure returned by NDArray::getInfo.
Definition: NDArray.h:71
list value
Definition: makeDbAndEdl.py:234
NDAttributeList.h.
Definition: NDAttributeList.h:21
virtual void processCallbacks(NDArray *pArray)=0
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:92
int NDFileOpenMode_t
Definition: NDPluginFile.h:17
Base class for NDArray file writing plugins; actual file writing plugins inherit from this class.
Definition: NDPluginFile.h:28