Definitions of datatypes and helper functions required for communication with LabVIEW.
More...
|
template<typename T > |
void | ResizeLVArray2D (LVArray2D< T > **&d, int rows, int cols) |
|
template<typename T > |
void | ResizeLVArray3D (LVArray3D< T > **&d, int depth, int rows, int cols) |
|
template<typename T , int N> |
void | ResizeLVArray (LVArrayND< T, N > **&d, int *dims) |
|
template<typename T > |
void | ResizeLVArray (LVArray< T > **&d, int elems) |
|
void | ArgumentErrorMsg (ErrorCluster *e, const std::string &msg) |
|
void | SetLVString (LStrHandle str, const char *text) |
|
MgErr | FillErrorCluster (MgErr err, const char *message, ErrorCluster *error) |
|
std::vector< std::string > | LVGetStringArray (int count, LStrHandle *str) |
|
bool | ValidateTracker (QueuedTracker *tracker, ErrorCluster *e, const char *funcname) |
| Verify the referenced tracker is a valid QueuedTracker instance. More...
|
|
static bool | CheckCUDAErrorLV (cudaError err, ErrorCluster *e) |
|
static bool | ValidRM (ResultManager *rm, ErrorCluster *err) |
| Verify the referenced resultmanager is a valid ResultManager instance. More...
|
|
Definitions of datatypes and helper functions required for communication with LabVIEW.
Wrappers around LabVIEW's cintools function calls and data types. lv_prolog.h and lv_epilog.h set up the correct alignment for LabVIEW data. See https://zone.ni.com/reference/en-XX/help/371361L-01/lvexcodeconcepts/configuring_the_clf_node/ for some more information.
§ QueueFrameFlags
§ ArgumentErrorMsg()
void ArgumentErrorMsg |
( |
ErrorCluster * |
e, |
|
|
const std::string & |
msg |
|
) |
| |
Definition at line 61 of file lv_queuetrk_api.cpp.
MgErr FillErrorCluster(MgErr err, const char *message, ErrorCluster *error)
§ CheckCUDAErrorLV()
static bool CheckCUDAErrorLV |
( |
cudaError |
err, |
|
|
ErrorCluster * |
e |
|
) |
| |
|
static |
Definition at line 26 of file lv_qtrk_api.h.
28 if (err != cudaSuccess) {
29 const char* errstr = cudaGetErrorString(err);
std::string SPrintf(const char *fmt,...)
MgErr FillErrorCluster(MgErr err, const char *message, ErrorCluster *error)
§ FillErrorCluster()
MgErr FillErrorCluster |
( |
MgErr |
err, |
|
|
const char * |
message, |
|
|
ErrorCluster * |
error |
|
) |
| |
Definition at line 50 of file lv_queuetrk_api.cpp.
54 error->
status = LVBooleanTrue;
void SetLVString(LStrHandle str, const char *text)
§ LVGetStringArray()
std::vector<std::string> LVGetStringArray |
( |
int |
count, |
|
|
LStrHandle * |
str |
|
) |
| |
Definition at line 38 of file lv_queuetrk_api.cpp.
40 std::vector<std::string> result(count);
42 for (
int x=0;x<count;x++) {
43 uChar *val = LHStrBuf(str[x]);
44 int len = LHStrLen (str[x]);
45 result[x]=std::string((
const char*)val, (
size_t)len );
§ ResizeLVArray() [1/2]
template<typename T , int N>
void ResizeLVArray |
( |
LVArrayND< T, N > **& |
d, |
|
|
int * |
dims |
|
) |
| |
Definition at line 118 of file labview.h.
120 for (
int i=0;i<N;i++)
121 (*d)->dimSizes[i]=dims[i];
122 NumericArrayResize(LVDataType<T>::code, N, (UHandle*)&d,
sizeof(T)*(*d)->
numElem());
§ ResizeLVArray() [2/2]
template<typename T >
void ResizeLVArray |
( |
LVArray< T > **& |
d, |
|
|
int |
elems |
|
) |
| |
Definition at line 126 of file labview.h.
128 if (NumericArrayResize(LVDataType<T>::code, 1, (UHandle*)&d,
sizeof(T)*elems) != mgNoErr)
129 throw std::runtime_error(
SPrintf(
"NumericArrayResize(1D array, %d) returned error.", elems));
130 (*d)->dimSize = elems;
std::string SPrintf(const char *fmt,...)
§ ResizeLVArray2D()
template<typename T >
void ResizeLVArray2D |
( |
LVArray2D< T > **& |
d, |
|
|
int |
rows, |
|
|
int |
cols |
|
) |
| |
Definition at line 98 of file labview.h.
100 if (NumericArrayResize(LVDataType<T>::code, 2, (UHandle*)&d,
sizeof(T)*rows*cols) != mgNoErr)
101 throw std::runtime_error(
SPrintf(
"NumericArrayResize(2D array, %d, %d) returned error.", rows,cols));
102 (*d)->dimSizes[0] = rows;
103 (*d)->dimSizes[1] = cols;
std::string SPrintf(const char *fmt,...)
§ ResizeLVArray3D()
template<typename T >
void ResizeLVArray3D |
( |
LVArray3D< T > **& |
d, |
|
|
int |
depth, |
|
|
int |
rows, |
|
|
int |
cols |
|
) |
| |
Definition at line 107 of file labview.h.
109 if (NumericArrayResize(LVDataType<T>::code, 3, (UHandle*)&d,
sizeof(T)*rows*cols*depth) != mgNoErr)
110 throw std::runtime_error(
SPrintf(
"NumericArrayResize(3D array, %d, %d, %d) returned error.", depth,rows,cols));
112 (*d)->dimSizes[0] = depth;
113 (*d)->dimSizes[1] = rows;
114 (*d)->dimSizes[2] = cols;
std::string SPrintf(const char *fmt,...)
§ SetLVString()
void SetLVString |
( |
LStrHandle |
str, |
|
|
const char * |
text |
|
) |
| |
Definition at line 27 of file lv_queuetrk_api.cpp.
29 int msglen = strlen(text);
30 MgErr err = NumericArrayResize(uB, 1, (UHandle*)&str, msglen);
33 MoveBlock(text, LStrBuf(*str), msglen);
34 LStrLen(*str) = msglen;
§ ValidateTracker()
Verify the referenced tracker is a valid QueuedTracker instance.
- Parameters
-
[in] | tracker | The instance to verify. |
[in] | e | The LabVIEW error cluster for this call. |
[in] | funcname | The name of the desired function. |
- Returns
- True if the supplied pointer can be used.
Definition at line 66 of file lv_queuetrk_api.cpp.
69 ArgumentErrorMsg(e,
SPrintf(
"QTrk C++ function %s called with invalid tracker pointer: %p", funcname, tracker));
void ArgumentErrorMsg(ErrorCluster *e, const std::string &msg)
static std::vector< QueuedTracker * > trackerList
std::string SPrintf(const char *fmt,...)
§ ValidRM()
Verify the referenced resultmanager is a valid ResultManager instance.
- Parameters
-
[in] | rm | The instance to verify. |
[in] | err | The LabVIEW error cluster for this call. |
- Returns
- True if the supplied pointer can be used.
Definition at line 22 of file lv_resultmanager_api.cpp.
void ArgumentErrorMsg(ErrorCluster *e, const std::string &msg)
static std::unordered_set< ResultManager * > rm_instances