1 #ifndef asynNDArrayDriver_H
2 #define asynNDArrayDriver_H
4 #include <epicsMutex.h>
5 #include <epicsEvent.h>
7 #include "asynPortDriver.h"
12 #define MAX_FILENAME_LEN 256
39 #define NDPortNameSelfString "PORT_NAME_SELF"
42 #define NDADCoreVersionString "ADCORE_VERSION"
43 #define NDDriverVersionString "DRIVER_VERSION"
49 #define ADManufacturerString "MANUFACTURER"
50 #define ADModelString "MODEL"
51 #define ADSerialNumberString "SERIAL_NUMBER"
52 #define ADSDKVersionString "SDK_VERSION"
53 #define ADFirmwareVersionString "FIRMWARE_VERSION"
54 #define ADAcquireString "ACQUIRE"
55 #define ADAcquireBusyString "ACQUIRE_BUSY"
56 #define ADWaitForPluginsString "WAIT_FOR_PLUGINS"
61 #define NDArraySizeXString "ARRAY_SIZE_X"
62 #define NDArraySizeYString "ARRAY_SIZE_Y"
63 #define NDArraySizeZString "ARRAY_SIZE_Z"
64 #define NDArraySizeString "ARRAY_SIZE"
65 #define NDNDimensionsString "ARRAY_NDIMENSIONS"
66 #define NDDimensionsString "ARRAY_DIMENSIONS"
67 #define NDDataTypeString "DATA_TYPE"
68 #define NDColorModeString "COLOR_MODE"
69 #define NDUniqueIdString "UNIQUE_ID"
70 #define NDTimeStampString "TIME_STAMP"
71 #define NDEpicsTSSecString "EPICS_TS_SEC"
72 #define NDEpicsTSNsecString "EPICS_TS_NSEC"
73 #define NDBayerPatternString "BAYER_PATTERN"
74 #define NDCodecString "CODEC"
75 #define NDCompressedSizeString "COMPRESSED_SIZE"
78 #define NDArrayCounterString "ARRAY_COUNTER"
86 #define NDFilePathString "FILE_PATH"
87 #define NDFilePathExistsString "FILE_PATH_EXISTS"
88 #define NDFileNameString "FILE_NAME"
89 #define NDFileNumberString "FILE_NUMBER"
90 #define NDFileTemplateString "FILE_TEMPLATE"
91 #define NDAutoIncrementString "AUTO_INCREMENT"
92 #define NDFullFileNameString "FULL_FILE_NAME"
93 #define NDFileFormatString "FILE_FORMAT"
94 #define NDAutoSaveString "AUTO_SAVE"
95 #define NDWriteFileString "WRITE_FILE"
96 #define NDReadFileString "READ_FILE"
97 #define NDFileWriteModeString "WRITE_MODE"
98 #define NDFileWriteStatusString "WRITE_STATUS"
99 #define NDFileWriteMessageString "WRITE_MESSAGE"
100 #define NDFileNumCaptureString "NUM_CAPTURE"
101 #define NDFileNumCapturedString "NUM_CAPTURED"
102 #define NDFileFreeCaptureString "FREE_CAPTURE"
103 #define NDFileCaptureString "CAPTURE"
104 #define NDFileDeleteDriverFileString "DELETE_DRIVER_FILE"
105 #define NDFileLazyOpenString "FILE_LAZY_OPEN"
106 #define NDFileCreateDirString "CREATE_DIR"
107 #define NDFileTempSuffixString "FILE_TEMP_SUFFIX"
109 #define NDAttributesFileString "ND_ATTRIBUTES_FILE"
110 #define NDAttributesStatusString "ND_ATTRIBUTES_STATUS"
111 #define NDAttributesMacrosString "ND_ATTRIBUTES_MACROS"
114 #define NDArrayDataString "ARRAY_DATA"
115 #define NDArrayCallbacksString "ARRAY_CALLBACKS"
118 #define NDPoolMaxBuffersString "POOL_MAX_BUFFERS"
119 #define NDPoolAllocBuffersString "POOL_ALLOC_BUFFERS"
120 #define NDPoolPreAllocBuffersString "POOL_PRE_ALLOC_BUFFERS"
121 #define NDPoolNumPreAllocBuffersString "POOL_NUM_PRE_ALLOC_BUFFERS"
122 #define NDPoolFreeBuffersString "POOL_FREE_BUFFERS"
123 #define NDPoolMaxMemoryString "POOL_MAX_MEMORY"
124 #define NDPoolUsedMemoryString "POOL_USED_MEMORY"
125 #define NDPoolEmptyFreeListString "POOL_EMPTY_FREELIST"
126 #define NDPoolPollStatsString "POOL_POLL_STATS"
129 #define NDNumQueuedArraysString "NUM_QUEUED_ARRAYS"
138 asynNDArrayDriver(
const char *portName,
int maxAddr,
int maxBuffers,
size_t maxMemory,
139 int interfaceMask,
int interruptMask,
140 int asynFlags,
int autoConnect,
int priority,
int stackSize);
143 virtual asynStatus writeOctet(asynUser *pasynUser,
const char *
value,
size_t maxChars,
145 virtual asynStatus readGenericPointer(asynUser *pasynUser,
void *genericPointer);
146 virtual asynStatus writeGenericPointer(asynUser *pasynUser,
void *genericPointer);
147 virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32
value);
148 virtual asynStatus setIntegerParam(
int index,
int value);
149 virtual asynStatus setIntegerParam(
int list,
int index,
int value);
150 virtual void report(FILE *fp,
int details);
153 virtual asynStatus createFilePath(
const char *path,
int pathDepth);
154 virtual asynStatus checkPath();
156 virtual asynStatus createFileName(
int maxChars,
char *fullFileName);
157 virtual asynStatus createFileName(
int maxChars,
char *filePath,
char *fileName);
158 virtual asynStatus readNDAttributesFile();
160 virtual void updateTimeStamps(
NDArray *pArray);
162 asynStatus incrementQueuedArrayCount();
163 asynStatus decrementQueuedArrayCount();
164 int getQueuedArrayCount();
165 void updateQueuedArrayCount();
172 #define FIRST_NDARRAY_PARAM NDPortNameSelf
243 asynStatus preAllocateBuffers();
245 epicsMutex *queuedArrayCountMutex_;
246 epicsEventId queuedArrayEvent_;
247 int queuedArrayCount_;
249 bool queuedArrayUpdateRun_;
250 epicsEventId queuedArrayUpdateDone_;
#define ADCORE_API
Definition: ADCoreAPI.h:41
NDAttributesStatus_t
Definition: asynNDArrayDriver.h:27
@ NDAttributesMacroError
Definition: asynNDArrayDriver.h:31
@ NDAttributesFileNotFound
Definition: asynNDArrayDriver.h:29
@ NDAttributesXMLSyntaxError
Definition: asynNDArrayDriver.h:30
@ NDAttributesOK
Definition: asynNDArrayDriver.h:28
NDFileMode_t
Enumeration of file saving modes.
Definition: asynNDArrayDriver.h:15
@ NDFileModeStream
Stream arrays continuously to a single file if the file format supports this.
Definition: asynNDArrayDriver.h:19
@ NDFileModeCapture
Capture NDNumCapture arrays into memory, write them out when capture is complete.
Definition: asynNDArrayDriver.h:17
@ NDFileModeSingle
Write 1 array per file.
Definition: asynNDArrayDriver.h:16
NDFileWriteStatus_t
Definition: asynNDArrayDriver.h:22
@ NDFileWriteOK
Definition: asynNDArrayDriver.h:23
@ NDFileWriteError
Definition: asynNDArrayDriver.h:24
N-dimensional array class; each array has a set of dimensions, a data type, pointer to data,...
Definition: NDArray.h:99
The NDArrayPool class manages a free list (pool) of NDArray objects.
Definition: NDArray.h:168
NDAttributeList.h.
Definition: NDAttributeList.h:21
This is the class from which NDArray drivers are derived; implements the asynGenericPointer functions...
Definition: asynNDArrayDriver.h:136
int NDAttributesStatus
Definition: asynNDArrayDriver.h:222
int NDFileDeleteDriverFile
Definition: asynNDArrayDriver.h:217
int NDDimensions
Definition: asynNDArrayDriver.h:188
int NDPoolUsedMemory
Definition: asynNDArrayDriver.h:232
int NDCompressedSize
Definition: asynNDArrayDriver.h:197
int NDArrayData
Definition: asynNDArrayDriver.h:224
int NDDriverVersion
Definition: asynNDArrayDriver.h:174
int NDFileTemplate
Definition: asynNDArrayDriver.h:203
int ADManufacturer
Definition: asynNDArrayDriver.h:175
int NDFileWriteMessage
Definition: asynNDArrayDriver.h:212
int NDFilePathExists
Definition: asynNDArrayDriver.h:200
int NDCodec
Definition: asynNDArrayDriver.h:196
int NDEpicsTSNsec
Definition: asynNDArrayDriver.h:194
int threadStackSize_
Definition: asynNDArrayDriver.h:239
int ADModel
Definition: asynNDArrayDriver.h:176
int ADFirmwareVersion
Definition: asynNDArrayDriver.h:179
int NDAttributesFile
Definition: asynNDArrayDriver.h:221
int NDFileName
Definition: asynNDArrayDriver.h:201
int NDFileTempSuffix
Definition: asynNDArrayDriver.h:220
int NDPoolMaxBuffers
Definition: asynNDArrayDriver.h:226
int NDWriteFile
Definition: asynNDArrayDriver.h:208
int NDFileNumber
Definition: asynNDArrayDriver.h:202
int NDBayerPattern
Definition: asynNDArrayDriver.h:195
class NDArray ** pArrays
An array of NDArray pointers used to store data in the driver.
Definition: asynNDArrayDriver.h:237
int NDPoolMaxMemory
Definition: asynNDArrayDriver.h:231
int NDFileCreateDir
Definition: asynNDArrayDriver.h:219
int NDArraySizeZ
Definition: asynNDArrayDriver.h:185
int NDAutoSave
Definition: asynNDArrayDriver.h:207
int NDArraySizeY
Definition: asynNDArrayDriver.h:184
int NDArraySizeX
Definition: asynNDArrayDriver.h:183
class NDAttributeList * pAttributeList
An NDAttributeList object used to obtain the current values of a set of attributes.
Definition: asynNDArrayDriver.h:238
int NDFileFormat
Definition: asynNDArrayDriver.h:206
int ADSDKVersion
Definition: asynNDArrayDriver.h:178
int NDUniqueId
Definition: asynNDArrayDriver.h:191
int NDFileLazyOpen
Definition: asynNDArrayDriver.h:218
int NDPoolFreeBuffers
Definition: asynNDArrayDriver.h:230
int NDPoolNumPreAllocBuffers
Definition: asynNDArrayDriver.h:229
int NDAutoIncrement
Definition: asynNDArrayDriver.h:204
int NDTimeStamp
Definition: asynNDArrayDriver.h:192
int ADAcquire
Definition: asynNDArrayDriver.h:180
int NDNDimensions
Definition: asynNDArrayDriver.h:187
int NDFileNumCaptured
Definition: asynNDArrayDriver.h:214
int ADSerialNumber
Definition: asynNDArrayDriver.h:177
int threadPriority_
Definition: asynNDArrayDriver.h:240
int ADAcquireBusy
Definition: asynNDArrayDriver.h:181
int NDFileWriteStatus
Definition: asynNDArrayDriver.h:211
int NDAttributesMacros
Definition: asynNDArrayDriver.h:223
int NDFileNumCapture
Definition: asynNDArrayDriver.h:213
int NDArrayCounter
Definition: asynNDArrayDriver.h:198
int NDArraySize
Definition: asynNDArrayDriver.h:186
int NDColorMode
Definition: asynNDArrayDriver.h:190
int NDFilePath
Definition: asynNDArrayDriver.h:199
int NDReadFile
Definition: asynNDArrayDriver.h:209
int NDPortNameSelf
Definition: asynNDArrayDriver.h:171
int NDFullFileName
Definition: asynNDArrayDriver.h:205
class NDArrayPool * pNDArrayPool
An NDArrayPool pointer that is initialized to pNDArrayPoolPvt_ in the constructor.
Definition: asynNDArrayDriver.h:167
int NDADCoreVersion
Definition: asynNDArrayDriver.h:173
int NDPoolPreAllocBuffers
Definition: asynNDArrayDriver.h:228
int ADWaitForPlugins
Definition: asynNDArrayDriver.h:182
int NDFileCapture
Definition: asynNDArrayDriver.h:216
int NDPoolAllocBuffers
Definition: asynNDArrayDriver.h:227
int NDFileWriteMode
Definition: asynNDArrayDriver.h:210
int NDFileFreeCapture
Definition: asynNDArrayDriver.h:215
int NDArrayCallbacks
Definition: asynNDArrayDriver.h:225
int NDPoolEmptyFreeList
Definition: asynNDArrayDriver.h:233
int NDDataType
Definition: asynNDArrayDriver.h:189
int NDEpicsTSSec
Definition: asynNDArrayDriver.h:193
int NDPoolPollStats
Definition: asynNDArrayDriver.h:234
int NDNumQueuedArrays
Definition: asynNDArrayDriver.h:235
@ string
Definition: NDFileHDF5Layout.h:44
list value
Definition: makeDbAndEdl.py:234