QTrk
Functions

Result API functions available to LabVIEW. More...

Functions

CDLL_EXPORT int qtrk_resultcount (QueuedTracker *qtrk, ErrorCluster *e)
 
CDLL_EXPORT void DLL_CALLCONV qtrk_clear_results (QueuedTracker *qtrk, ErrorCluster *e)
 
CDLL_EXPORT void DLL_CALLCONV qtrk_flush (QueuedTracker *qtrk, ErrorCluster *e)
 
CDLL_EXPORT int DLL_CALLCONV qtrk_get_results (QueuedTracker *qtrk, LocalizationResult *results, int maxResults, int sortByID, ErrorCluster *e)
 
CDLL_EXPORT int DLL_CALLCONV qtrk_idle (QueuedTracker *qtrk, ErrorCluster *e)
 

Detailed Description

Result API functions available to LabVIEW.

Function Documentation

§ qtrk_clear_results()

CDLL_EXPORT void DLL_CALLCONV qtrk_clear_results ( QueuedTracker qtrk,
ErrorCluster e 
)

Definition at line 347 of file lv_queuetrk_api.cpp.

348 {
349  if (ValidateTracker(qtrk, e, "clear results")) {
350  qtrk->ClearResults();
351  }
352 }
bool ValidateTracker(QueuedTracker *tracker, ErrorCluster *e, const char *funcname)
Verify the referenced tracker is a valid QueuedTracker instance.
virtual void ClearResults()=0
Clear results.

§ qtrk_flush()

CDLL_EXPORT void DLL_CALLCONV qtrk_flush ( QueuedTracker qtrk,
ErrorCluster e 
)

Definition at line 397 of file lv_queuetrk_api.cpp.

398 {
399  if (ValidateTracker(qtrk, e, "flush")) {
400  qtrk->Flush();
401  }
402 }
virtual void Flush()=0
Stop waiting for more jobs to do, and just process the current batch.
bool ValidateTracker(QueuedTracker *tracker, ErrorCluster *e, const char *funcname)
Verify the referenced tracker is a valid QueuedTracker instance.

§ qtrk_get_results()

CDLL_EXPORT int DLL_CALLCONV qtrk_get_results ( QueuedTracker qtrk,
LocalizationResult results,
int  maxResults,
int  sortByID,
ErrorCluster e 
)

Definition at line 404 of file lv_queuetrk_api.cpp.

405 {
406  if (ValidateTracker(qtrk, e, "get_results")) {
407  int resultCount = qtrk->FetchResults(results, maxResults);
408 
409  if (sortByID) {
410  std::sort(results, results+resultCount, [](decltype(*results) a, decltype(*results) b) { return a.job.frame<b.job.frame; } );
411  }
412 
413  return resultCount;
414  }
415  return 0;
416 }
bool ValidateTracker(QueuedTracker *tracker, ErrorCluster *e, const char *funcname)
Verify the referenced tracker is a valid QueuedTracker instance.
uint frame
Frame number this ROI belongs to.
Definition: qtrk_c_api.h:56
LocalizationJob job
Job metadata. See LocalizationJob.
Definition: qtrk_c_api.h:68
virtual int FetchResults(LocalizationResult *results, int maxResults)=0
Fetch available results.

§ qtrk_idle()

CDLL_EXPORT int DLL_CALLCONV qtrk_idle ( QueuedTracker qtrk,
ErrorCluster e 
)

Definition at line 444 of file lv_queuetrk_api.cpp.

445 {
446  if (ValidateTracker(qtrk, e, "is_idle"))
447  return qtrk->IsIdle() ? 1 : 0;
448  return 0;
449 }
bool ValidateTracker(QueuedTracker *tracker, ErrorCluster *e, const char *funcname)
Verify the referenced tracker is a valid QueuedTracker instance.
virtual bool IsIdle()=0
Test to see if the tracker is idle.

§ qtrk_resultcount()

CDLL_EXPORT int qtrk_resultcount ( QueuedTracker qtrk,
ErrorCluster e 
)

Definition at line 389 of file lv_queuetrk_api.cpp.

390 {
391  if (ValidateTracker(qtrk, e, "resultcount")) {
392  return qtrk->GetResultCount();
393  }
394  return 0;
395 }
virtual int GetResultCount()=0
Get the number of finished localization jobs (=results) available in memory.
bool ValidateTracker(QueuedTracker *tracker, ErrorCluster *e, const char *funcname)
Verify the referenced tracker is a valid QueuedTracker instance.