From bd8dfa07d0e7e85b382d73765f1f95e51504492d Mon Sep 17 00:00:00 2001 From: MPIBR-kretschmerf Date: Fri, 23 Sep 2016 15:20:56 +0200 Subject: [PATCH] moved interface to class --- AudioGameGUI.pro | 12 +- AudioGameGUI.pro.user | 2 +- NIDAQmxInterface.cpp | 318 +++++++ NIDAQmxInterface.h | 131 +-- StateMachineController.cpp | 4 +- StateMachineController.h | 5 +- TDTInterface.cpp | 118 +++ rpcoxlib.cpp | 428 ++++++++++ rpcoxlib.h | 1637 ++++++++++++++++++++++++++++++++++++ trialseq.cpp | 106 +++ trialseq.h | 25 + 11 files changed, 2708 insertions(+), 78 deletions(-) create mode 100644 NIDAQmxInterface.cpp create mode 100644 TDTInterface.cpp create mode 100644 rpcoxlib.cpp create mode 100644 rpcoxlib.h create mode 100644 trialseq.cpp create mode 100644 trialseq.h diff --git a/AudioGameGUI.pro b/AudioGameGUI.pro index 89f50cf..056b1c8 100644 --- a/AudioGameGUI.pro +++ b/AudioGameGUI.pro @@ -11,7 +11,6 @@ CONFIG += c++11 QT += axcontainer TYPELIBS = $$system(dumpcpp -getfile {D323A622-1D13-11D4-8858-444553540000}) - isEmpty(TYPELIBS) { message("TDT library not found!") } else { @@ -23,17 +22,13 @@ isEmpty(TYPELIBS) { TARGET = AudioGameGUI TEMPLATE = app -LIBS += -L"C:\\Program Files (x86)\\National Instruments\\NI-DAQ\\DAQmx ANSI C Dev\\lib\\msvc" \ - -lNIDAQmx - - SOURCES += main.cpp\ + NIDAQmxInterface.cpp \ StateMachineController.cpp \ Mainwindow.cpp \ TimerDialog.cpp \ TDTInterface.cpp \ - trialseq.cpp \ - NIDAQmxInterface.cpp + trialseq.cpp HEADERS += \ @@ -45,7 +40,8 @@ HEADERS += \ TDTInterface.h \ trialseq.h - +LIBS += -L"C:\\Program Files (x86)\\National Instruments\\NI-DAQ\\DAQmx ANSI C Dev\\lib\\msvc" \ + -lNIDAQmx #LIBS += -L"C:\\TDT\\lib64" \ # -lRPco diff --git a/AudioGameGUI.pro.user b/AudioGameGUI.pro.user index b64f336..4a014e4 100644 --- a/AudioGameGUI.pro.user +++ b/AudioGameGUI.pro.user @@ -1,6 +1,6 @@ - + ProjectExplorer.Project.ActiveTarget diff --git a/NIDAQmxInterface.cpp b/NIDAQmxInterface.cpp new file mode 100644 index 0000000..f6f50b2 --- /dev/null +++ b/NIDAQmxInterface.cpp @@ -0,0 +1,318 @@ +#include "NIDAQmxInterface.h" +#include "C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h" + +/* initialize tasks in DAQmx interface */ +NIDAQmxInterface::NIDAQmxInterface() +{ + +} + +void NIDAQmxInterface::DAQmxInitializeInterface() +{ + /* initialize daq pointer */ + DAQmxSetDefaultEngine(); + + /* configure digital read error task */ + DAQmxCreateTask("DigError", &daq->di_error); + //DAQmxErrChk(DAQmxCreateTask("DigError", &daq->di_error)); +// DAQmxErrChk(DAQmxCreateDIChan(daq->di_error, "Dev1/port2", "", DAQmx_Val_ChanForAllLines)); +// DAQmxReadErrorPort(); + +// /* configure digital read task */ +// DAQmxErrChk(DAQmxCreateTask("DigIn", &daq->di_port)); +// DAQmxErrChk(DAQmxCreateDIChan(daq->di_port, "Dev1/port0", "", DAQmx_Val_ChanForAllLines)); +// DAQmxErrChk(DAQmxCfgChangeDetectionTiming(daq->di_port, "Dev1/port0/line2,Dev1/port0/line6", "Dev1/port0/line2,Dev1/port0/line6", DAQmx_Val_ContSamps, 1)); +// //DAQmxErrChk(DAQmxRegisterSignalEvent(daq->di_port, DAQmx_Val_ChangeDetectionEvent, 0, FcnCbckDetectDI, daq)); + +// /* configure digital write task */ +// DAQmxErrChk(DAQmxCreateTask("DigOut", &daq->do_port)); +// DAQmxErrChk(DAQmxCreateDOChan(daq->do_port, "Dev1/port1", "", DAQmx_Val_ChanForAllLines)); + +// /* configure digital internal clock task */ +// DAQmxErrChk(DAQmxCreateTask("DigClk", &daq->do_clk)); +// DAQmxErrChk(DAQmxCreateCOPulseChanTime(daq->do_clk, "Dev1/ctr0", "", DAQmx_Val_Seconds, DAQmx_Val_Low, 0, 0.05, DO_PULSE_WIDTH)); +// DAQmxErrChk(DAQmxCfgImplicitTiming(daq->do_clk, DAQmx_Val_FiniteSamps, 1)); +// //DAQmxErrChk(DAQmxRegisterDoneEvent(daq->do_clk, 0, FcnCbckTriggerStopDO, daq)); + +// /* initialize query performance timer QPC */ +// //QPCInitialize(); + +// /* start custom task */ +// DAQmxStartCustomTask(daq->di_port); + + return; +} + +/* allocate engine pointer */ +void NIDAQmxInterface::DAQmxSetDefaultEngine() +{ + char file_out[256]; + char date_str[32]; + time_t now = time(NULL); + struct tm *t = localtime(&now); + strftime(date_str, sizeof(date_str), "%Y%m%d_%H%M", t); + sprintf(file_out, "..\\Logs\\%s_TriggerTasks_logFile.txt", date_str); + + + /* ports TaskHandle */ + daq->di_port = 0; + daq->di_error = 0; + daq->do_port = 0; + + /* ports states uInt8 */ + daq->di_bit_now = DAQ_PORT_NULL; + daq->di_bit_prev = DAQ_PORT_NULL; + daq->do_bit_wrt = DAQ_PORT_NULL; + daq->do_bit_qry = DAQ_PORT_NULL; + daq->flag_scanner = DAQ_PORT_NULL; + + /* event counters uInt32 */ + daq->di_cntr_lick = 0; + daq->di_cntr_frame = 0; + daq->di_cntr_imaq = 0; + + /* log file pointer */ +// daq->fp_log = fopen(file_out, "w"); +// if (daq->fp_log == NULL) +// { +// fprintf(stderr, "DAQmxError:NIDAQmxInterface/DAQmxSetDefaultEngine:\n\tfailed to open %s to write!\n", file_out); +// exit(EXIT_FAILURE); +// } +// fprintf(daq->fp_log, "#event\tbit_mask\tstate\ttick[usec]\n"); + + return; +} + +/* read error port */ +void NIDAQmxInterface::DAQmxReadErrorPort() +{ +// int32 read = 0; +// uInt8 port_bit = DAQ_PORT_NULL; + +// /* start task */ +// DAQmxStartCustomTask(daq->di_error); + +// /* read port */ +// if (daq->di_error != 0) +// DAQmxErrChk(DAQmxReadDigitalU8(daq->di_error, 1, 10.0, DAQmx_Val_GroupByChannel, &port_bit, 1, &read, NULL)); + +// /* stop task */ +// DAQmxStopCustomTask(daq->di_error); + +// /* check for active error signals */ +// if (read) +// { +// if ((port_bit & DAQ_PORT_DE_MONITOR) == DAQ_PORT_DE_MONITOR) +// { +// fprintf(stderr, "DAQmxError:NIDAQmxInterface/DAQmxReadErrorPort:\n\tMONITOR failed!\n"); +// exit(EXIT_FAILURE); +// } + +// if ((port_bit & DAQ_PORT_DE_AIR) == DAQ_PORT_DE_AIR) +// { +// fprintf(stderr, "DAQmxError:NIDAQmxInterface/DAQmxReadErrorPort:\n\tAIR pump failed!\n"); +// exit(EXIT_FAILURE); +// } + +// if ((port_bit & DAQ_PORT_DE_WATER) == DAQ_PORT_DE_WATER) +// { +// fprintf(stderr, "DAQmxError:NIDAQmxInterface/DAQmxReadErrorPort:\n\tWATER pump failed!\n"); +// exit(EXIT_FAILURE); +// } +// } + +// return; +} + + +/* destroy tasks in DAQmx interface */ +void NIDAQmxInterface::DAQmxDestroyInterface() +{ +// /* check if task is digital output task is done */ +// DAQmxErrChk(DAQmxWaitUntilTaskDone(daq->do_clk, -1)); + +// /* stop tasks */ +// DAQmxStopCustomTask(daq->di_port); +// DAQmxStopCustomTask(daq->do_port); +// DAQmxStopCustomTask(daq->do_clk); + +// /* clear tasks */ +// DAQmxErrChk(DAQmxClearTask(daq->di_port)); +// daq->di_port = 0; +// DAQmxErrChk(DAQmxClearTask(daq->do_port)); +// daq->do_port = 0; +// DAQmxErrChk(DAQmxClearTask(daq->do_clk)); +// daq->do_clk = 0; + +// /* close file */ +// if (daq->fp_log) +// fclose(daq->fp_log); + +// return; +} + + +/* Start custom tasks */ +void NIDAQmxInterface::DAQmxStartCustomTask(TaskHandle taskHandle) +{ +// bool32 done = false; + +// if (taskHandle != 0) +// { +// /* check if task is already active */ +// DAQmxErrChk(DAQmxIsTaskDone(taskHandle, &done)); +// if (!done) +// DAQmxErrChk(DAQmxStopTask(taskHandle)); + +// /* start / re-start task */ +// DAQmxErrChk(DAQmxStartTask(taskHandle)); +// } + + return; +} + +/* Stop custom tasks */ +void NIDAQmxInterface::DAQmxStopCustomTask(TaskHandle taskHandle) +{ +// bool32 done = false; + +// if (taskHandle != 0) +// { +// /* check if task is active */ +// DAQmxErrChk(DAQmxIsTaskDone(taskHandle, &done)); +// if (!done) +// DAQmxErrChk(DAQmxStopTask(taskHandle)); +// } + +// return; +} + +/* Trigger digital output */ +void NIDAQmxInterface::DAQmxTriggerDO(uInt8 qry_port_bit, bool arm_timer) +{ +// int32 written = 0; +// bool32 done = TRUE; + +// /* flip query bit to switch on qry bit */ +// if (daq->do_port != 0) +// { +// daq->do_bit_wrt ^= qry_port_bit; +// DAQmxErrChk(DAQmxWriteDigitalU8(daq->do_port, 1, 1, 10.0, DAQmx_Val_GroupByChannel, &daq->do_bit_wrt, &written, NULL)); +// } + +// /* check for error */ +// if (written == 0) +// { +// fprintf(stderr, "Error::NIDAQmxInterface/DAQmxTriggerDO:\n\tfailed to write to DO port!\n"); +// exit(EXIT_FAILURE); +// } + +// /* arm time out if required */ +// if ((daq->do_clk != 0) & (arm_timer == TRUE)) +// { +// DAQmxErrChk(DAQmxIsTaskDone(daq->do_clk, &done)); +// daq->do_bit_qry = (done) ? qry_port_bit : (daq->do_bit_qry | qry_port_bit); +// DAQmxErrChk(DAQmxStopTask(daq->do_clk)); +// DAQmxErrChk(DAQmxStartTask(daq->do_clk)); +// } + +// /* log trigger */ +// DAQmxLogToFile(daq->fp_log, "TRIGGER", qry_port_bit, (qry_port_bit & daq->do_bit_wrt) == qry_port_bit); + +// return; +} + +/* log NIDAQmx events to file */ +void NIDAQmxInterface::DAQmxLogToFile(FILE *fp, const char *msg, uInt32 id, uInt32 counter) +{ + if (fp) + //fprintf(fp, "%s\t%d\t%d\t%ld\n", msg, id, counter, QPCReadTick()); + return; +} + +/* Detect Input Callback */ +int32 CVICALLBACK NIDAQmxInterface::FcnCbckDetectDI(TaskHandle taskHandle, int32 signalID, void *callback_data) +{ +// DAQmxEngine *daq = (DAQmxEngine *)callback_data; +// int32 read = 0; + +// if (taskHandle != 0) +// DAQmxErrChk(DAQmxReadDigitalU8(taskHandle, 1, 10.0, DAQmx_Val_GroupByChannel, &daq->di_bit_now, 1, &read, NULL)); + +// if (read) +// { +// /* SHUTTER ON condition, SHUTTER line changes from 0 to 1 */ +// if (((daq->di_bit_prev & DAQ_PORT_DI_SHUTTER) == DAQ_PORT_NULL) & +// ((daq->di_bit_now & DAQ_PORT_DI_SHUTTER) == DAQ_PORT_DI_SHUTTER) & +// (daq->flag_scanner == DAQ_PORT_NULL)) +// { +// daq->flag_scanner = DAQ_PORT_TRUE; +// daq->di_cntr_imaq++; +// daq->di_cntr_frame = 0; + +// /* switch OFF box internal resonance generator */ +// DAQmxTriggerDO(DAQ_PORT_DO_FREQGEN, FALSE); +// } + +// /* SHUTTER OFF condition, SHUTTER line changes from 1 to 0 */ +// if (((daq->di_bit_prev & DAQ_PORT_DI_SHUTTER) == DAQ_PORT_DI_SHUTTER) & +// ((daq->di_bit_now & DAQ_PORT_DI_SHUTTER) == DAQ_PORT_NULL) & +// (daq->flag_scanner == DAQ_PORT_TRUE)) +// { +// daq->flag_scanner = DAQ_PORT_NULL; + +// /* switch ON box internal resonance generator */ +// DAQmxTriggerDO(DAQ_PORT_DO_FREQGEN, FALSE); +// } + +// /* FRAME condition, line 2 changes from 1 to 0 */ +// if (((daq->di_bit_prev & DAQ_PORT_DI_FRAME) == DAQ_PORT_DI_FRAME) & ((daq->di_bit_now & DAQ_PORT_DI_FRAME) == DAQ_PORT_NULL)) +// { +// daq->di_cntr_frame++; +// DAQmxLogToFile(daq->fp_log, "FRAME", daq->di_cntr_imaq, daq->di_cntr_frame); +// } + +// /* LICK condition, line 6 changes from 0 to 1 */ +// if (((daq->di_bit_prev & DAQ_PORT_DI_LICK) == DAQ_PORT_NULL) & ((daq->di_bit_now & DAQ_PORT_DI_LICK) == DAQ_PORT_DI_LICK)) +// { +// daq->di_cntr_lick++; +// DAQmxLogToFile(daq->fp_log, "LICK", DAQ_PORT_DI_LICK, daq->di_cntr_lick); + +// /* every N licks give a reward */ +// if ((daq->di_cntr_lick % 16) == 0) +// DAQmxTriggerDO(DAQ_PORT_DO_WATER, TRUE); + +// } + +// /* update bit history */ +// daq->di_bit_prev = daq->di_bit_now; +// } + + return 0; +} + +/* Timer Digital Out is Done */ +int32 CVICALLBACK NIDAQmxInterface::FcnCbckTriggerStopDO(TaskHandle taskHandle, int32 signalID, void *callback_data) +{ +// DAQmxEngine *daq = (DAQmxEngine *)callback_data; +// int32 written = 0; + +// /* flip query bit, to switch off pulse */ +// if (daq->do_port != 0) +// { +// daq->do_bit_wrt ^= daq->do_bit_qry; +// DAQmxErrChk(DAQmxWriteDigitalU8(daq->do_port, 1, 1, 10.0, DAQmx_Val_GroupByChannel, &daq->do_bit_wrt, &written, NULL)); +// } + +// /* check for error */ +// if (written == 0) +// { +// fprintf(stderr, "Error::NIDAQmxInterface/FcnCbckTriggerStopDO: failed to write to DO port!\n"); +// exit(EXIT_FAILURE); +// } + +// /* log trigger */ +// DAQmxLogToFile(daq->fp_log, "TRIGGER", daq->do_bit_qry, (daq->do_bit_qry & daq->do_bit_wrt) == daq->do_bit_qry); + + return 0; +} diff --git a/NIDAQmxInterface.h b/NIDAQmxInterface.h index 37466a2..d10a301 100644 --- a/NIDAQmxInterface.h +++ b/NIDAQmxInterface.h @@ -9,77 +9,82 @@ #include "C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h" //#include -/* define port bit states */ -#define DAQ_PORT_NULL 0x00 -#define DAQ_PORT_TRUE 0x01 - -#define DAQ_PORT_DI_SHUTTER 0x01 -#define DAQ_PORT_DI_BACKLIGHT 0x02 -#define DAQ_PORT_DI_FRAME 0x04 -#define DAQ_PORT_DI_AIR 0x08 -#define DAQ_PORT_DI_WATER 0x10 -#define DAQ_PORT_DI_SOUND 0x20 -#define DAQ_PORT_DI_LICK 0x40 -#define DAQ_PORT_DI_SCANNER 0x80 +class NIDAQmxInterface +{ -#define DAQ_PORT_DO_MONITOR 0x01 -#define DAQ_PORT_DO_AIR 0x02 -#define DAQ_PORT_DO_WATER 0x04 -#define DAQ_PORT_DO_SOUND 0x08 -#define DAQ_PORT_DO_IMGAQ 0x10 -#define DAQ_PORT_DO_FREQGEN 0x20 + /* define port bit states */ + #define DAQ_PORT_NULL 0x00 + #define DAQ_PORT_TRUE 0x01 -#define DAQ_PORT_DE_MONITOR 0x01 -#define DAQ_PORT_DE_AIR 0x02 -#define DAQ_PORT_DE_WATER 0x04 + #define DAQ_PORT_DI_SHUTTER 0x01 + #define DAQ_PORT_DI_BACKLIGHT 0x02 + #define DAQ_PORT_DI_FRAME 0x04 + #define DAQ_PORT_DI_AIR 0x08 + #define DAQ_PORT_DI_WATER 0x10 + #define DAQ_PORT_DI_SOUND 0x20 + #define DAQ_PORT_DI_LICK 0x40 + #define DAQ_PORT_DI_SCANNER 0x80 -#define DO_PULSE_WIDTH 0.08// in seconds + #define DAQ_PORT_DO_MONITOR 0x01 + #define DAQ_PORT_DO_AIR 0x02 + #define DAQ_PORT_DO_WATER 0x04 + #define DAQ_PORT_DO_SOUND 0x08 + #define DAQ_PORT_DO_IMGAQ 0x10 + #define DAQ_PORT_DO_FREQGEN 0x20 -/* define DAQmxErrChk macro */ -#define DAQmxErrChk(functionCall)\ - if((functionCall) < 0)\ - {\ - char errBuffer[2048];\ - DAQmxGetExtendedErrorInfo(errBuffer, 2048);\ - fprintf(stderr, "DAQmxError: %s\n Calling: %s\n", errBuffer, #functionCall);\ - exit(EXIT_FAILURE);\ - } + #define DAQ_PORT_DE_MONITOR 0x01 + #define DAQ_PORT_DE_AIR 0x02 + #define DAQ_PORT_DE_WATER 0x04 -/* define DAQmxData type */ -typedef struct _DAQmxEngine -{ - TaskHandle di_port; - TaskHandle do_port; - TaskHandle do_clk; - TaskHandle di_error; - uInt8 di_bit_now; - uInt8 di_bit_prev; - uInt8 do_bit_wrt; - uInt8 do_bit_qry; - uInt8 flag_scanner; - uInt32 di_cntr_lick; - uInt32 di_cntr_frame; - uInt32 di_cntr_imaq; - FILE *fp_log; -} DAQmxEngine; + #define DO_PULSE_WIDTH 0.08// in seconds -/* function prototypes */ -void DAQmxInitializeInterface(DAQmxEngine *); -void DAQmxDestroyInterface(DAQmxEngine *); -void DAQmxSetDefaultEngine(DAQmxEngine *); -void DAQmxReadErrorPort(DAQmxEngine *); -void DAQmxStartCustomTask(TaskHandle); -void DAQmxStopCustomTask(TaskHandle); -void DAQtest(); + /* define DAQmxErrChk macro */ + #define DAQmxErrChk(functionCall)\ + if((functionCall) < 0)\ + {\ + char errBuffer[2048];\ + DAQmxGetExtendedErrorInfo(errBuffer, 2048);\ + fprintf(stderr, "DAQmxError: %s\n Calling: %s\n", errBuffer, #functionCall);\ + exit(EXIT_FAILURE);\ + } -void DAQmxTriggerDO(DAQmxEngine *, uInt8, bool); -void DAQmxWriteDO(DAQmxEngine *, uInt8); + /* define DAQmxData type */ + typedef struct _DAQmxEngine + { + TaskHandle di_port; + TaskHandle do_port; + TaskHandle do_clk; + TaskHandle di_error; + uInt8 di_bit_now; + uInt8 di_bit_prev; + uInt8 do_bit_wrt; + uInt8 do_bit_qry; + uInt8 flag_scanner; + uInt32 di_cntr_lick; + uInt32 di_cntr_frame; + uInt32 di_cntr_imaq; + FILE *fp_log; + } DAQmxEngine; -void DAQmxLogToFile(FILE *, const char *, uInt32, uInt32); -/* events callback functions */ -int32 CVICALLBACK FcnCbckDetectDI(TaskHandle, int32, void *); -int32 CVICALLBACK FcnCbckTriggerStopDO(TaskHandle, int32, void *); +public: + explicit NIDAQmxInterface(); + /* function prototypes */ + void DAQmxInitializeInterface(); + void DAQmxDestroyInterface(); + void DAQmxSetDefaultEngine(); + void DAQmxReadErrorPort(); + void DAQmxStartCustomTask(TaskHandle); + void DAQmxStopCustomTask(TaskHandle); + void DAQmxTriggerDO(uInt8, bool); + void DAQmxWriteDO(uInt8); + void DAQmxLogToFile(FILE *, const char *, uInt32, uInt32); +private: + /* events callback functions */ + int32 CVICALLBACK FcnCbckDetectDI(TaskHandle, int32, void *); + int32 CVICALLBACK FcnCbckTriggerStopDO(TaskHandle, int32, void *); + DAQmxEngine* daq; -#endif /* define (NIDAQmxInterface_h) */ + #endif /* define (NIDAQmxInterface_h) */ +}; diff --git a/StateMachineController.cpp b/StateMachineController.cpp index a006b4b..ab3d3aa 100644 --- a/StateMachineController.cpp +++ b/StateMachineController.cpp @@ -65,8 +65,8 @@ StateMachineController::StateMachineController(QObject *parent) connect(pausedState, SIGNAL(entered()), this, SLOT(onStatePauseEntered())); rp = new RPCOXLib::RPcoX(); - daq = new DAQmxEngine(); - DAQmxSetDefaultEngine(daq); + //daq = new DAQmxEngine(); + //DAQmxSetDefaultEngine(daq); //DAQmxInitializeInterface(daq); //DAQmxLogToFile(daq->fp_log, "INIT", 0, 0); diff --git a/StateMachineController.h b/StateMachineController.h index 3182820..9ed0bac 100644 --- a/StateMachineController.h +++ b/StateMachineController.h @@ -19,9 +19,6 @@ //#include "TDTInterface.h" #include "rpcoxlib.h" -#include "C:\Program Files (x86)\National Instruments\NI-DAQ\DAQmx ANSI C Dev\include\NIDAQmx.h" - -void DAQmxSetDefaultEngine(DAQmxEngine *); class StateMachineController : public QObject { @@ -47,7 +44,7 @@ class StateMachineController : public QObject QTimer *mainTimer; TimerDialog *timerDialog; - DAQmxEngine* daq; + //DAQmxEngine* daq; RPCOXLib::RPcoX* rp; int trialsTotal = -1; diff --git a/TDTInterface.cpp b/TDTInterface.cpp new file mode 100644 index 0000000..e847464 --- /dev/null +++ b/TDTInterface.cpp @@ -0,0 +1,118 @@ +#include "TDTInterface.h" + +/* global variables */ +RPCOXLib::RPcoX* rp; +HRESULT hr; +long int tdt_status; + +/* initialize TDT Sound System */ +void TDTInitializeInterface(void) +{ + rp = new RPCOXLib::RPcoX(); + +// /* initialize ActiveX handle */ +// hr = CoInitialize(NULL); +// if (FAILED(hr)) +// { +// fprintf(stderr, "TDTError:TDTInterface/TDTInitializeInterface:\n\tfailed to initialize COM handle!\n"); +// exit(EXIT_FAILURE); +// } + +// /* initialize ActiveX object instance */ +// hr = rp.CreateInstance(TDT_APP_ID); +// if (FAILED(hr)) +// { +// fprintf(stderr, "TDTError:TDTInterface/TDTInitializeInterface:\n\t ActiveX COM instance for %s failed!\n", TDT_APP_ID); +// exit(EXIT_FAILURE); +// } +// //printf("TDT ActiveX instance is initialized\napp_id: %s\n", TDT_APP_ID); + +// /* check if ActiveX object pointer is set */ +// if (rp == 0) +// { +// fprintf(stderr, "TDTError:TDTInterface/TDTInitializeInterface:\n\t ActiveX COM object pointer is not set!\n"); +// exit(EXIT_FAILURE); +// } + + /* connect to RP2 system */ + if (!rp->ConnectRP2("USB", 1)) + { + fprintf(stderr, "TDTError:TDTInterface/TDTInitializeInterface:\n\tfailed to connect to RP2!\n"); + exit(EXIT_FAILURE); + } + + /* check status */ + tdt_status = rp->GetStatus(); + + /* check if device is connected */ + if ((tdt_status & TDT_STATUS_CONNECTED) == TDT_STATUS_CONNECTED) + { + printf("TDT RP2 connected\n"); + + /* check if device is running */ + if ((tdt_status & TDT_STATUS_CIRCUIT_RUNNING) == TDT_STATUS_CIRCUIT_RUNNING) + rp->Halt(); + + /* check if device memory is full */ + if ((tdt_status & TDT_STATUS_CIRCUIT_LOADED) == TDT_STATUS_CIRCUIT_LOADED) + rp->ClearCOF(); + } + + return; +} + +/* destroy TDT Engine */ +void TDTDestroyInterface(void) +{ + /* check status */ + tdt_status = rp->GetStatus(); + + /* check if device is connected */ + if ((tdt_status & TDT_STATUS_CONNECTED) == TDT_STATUS_CONNECTED) + { + /* check if device is running */ + if ((tdt_status & TDT_STATUS_CIRCUIT_RUNNING) == TDT_STATUS_CIRCUIT_RUNNING) + rp->Halt(); + + /* check if device memory is full */ + if ((tdt_status & TDT_STATUS_CIRCUIT_LOADED) == TDT_STATUS_CIRCUIT_LOADED) + rp->ClearCOF(); + } + rp->clear(); + delete rp; + + return; +} + +void TDTLoadRCXCircuit(const char *rcx_file) +{ + /* check status */ + tdt_status = rp->GetStatus(); + + /* check if device is connected */ + if ((tdt_status & TDT_STATUS_CONNECTED) == TDT_STATUS_CONNECTED) + { + /* check if device is running */ + if ((tdt_status & TDT_STATUS_CIRCUIT_RUNNING) == TDT_STATUS_CIRCUIT_RUNNING) + rp->Halt(); + + /* check if device memory is full */ + if ((tdt_status & TDT_STATUS_CIRCUIT_LOADED) == TDT_STATUS_CIRCUIT_LOADED) + rp->ClearCOF(); + + /* load circuit */ + rp->LoadCOF(rcx_file); + + /* update status */ + tdt_status = rp->GetStatus(); + if ((tdt_status & TDT_STATUS_CIRCUIT_LOADED) == TDT_STATUS_NULL) + { + fprintf(stderr, "TDTError:TDTInterface/TDTLoadRCXCircuit:\n\tfailed to load %s\n%s\n", rcx_file); + exit(EXIT_FAILURE); + } + + /* run circuit */ + rp->Run(); + } + return; +} diff --git a/rpcoxlib.cpp b/rpcoxlib.cpp new file mode 100644 index 0000000..b17936c --- /dev/null +++ b/rpcoxlib.cpp @@ -0,0 +1,428 @@ +/**************************************************************************** +** +** Metadata for RPCOXLib generated by dumpcpp v5.7.0 using +** dumpcpp {D323A622-1D13-11D4-8858-444553540000} +** from the type library C:\TDT\lib64\RPcoX.ocx +** +****************************************************************************/ + +#define QAX_DUMPCPP_RPCOXLIB_NOINLINES +#include "rpcoxlib.h" + +using namespace RPCOXLib; + +struct qt_meta_stringdata_all_t { + QByteArrayData data[93]; + char stringdata0[850]; +}; +#define QT_MOC_LITERAL(idx, ofs, len, table) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + offsetof(qt_meta_stringdata_all_t, stringdata##table) + ofs \ + - idx * sizeof(QByteArrayData) \ + ) +static const qt_meta_stringdata_all_t qt_meta_stringdata_all = { + { +QT_MOC_LITERAL(0, 0, 17, 0), +QT_MOC_LITERAL(1, 18, 9, 0), +QT_MOC_LITERAL(2, 28, 0, 0), +QT_MOC_LITERAL(3, 29, 4, 0), +QT_MOC_LITERAL(4, 34, 6, 0), +QT_MOC_LITERAL(5, 41, 4, 0), +QT_MOC_LITERAL(6, 46, 4, 0), +QT_MOC_LITERAL(7, 51, 15, 0), +QT_MOC_LITERAL(8, 67, 4, 0), +QT_MOC_LITERAL(9, 72, 6, 0), +QT_MOC_LITERAL(10, 79, 4, 0), +QT_MOC_LITERAL(11, 84, 4, 0), +QT_MOC_LITERAL(12, 89, 8, 0), +QT_MOC_LITERAL(13, 98, 8, 0), +QT_MOC_LITERAL(14, 107, 7, 0), +QT_MOC_LITERAL(15, 115, 9, 0), +QT_MOC_LITERAL(16, 125, 6, 0), +QT_MOC_LITERAL(17, 132, 11, 0), +QT_MOC_LITERAL(18, 144, 7, 0), +QT_MOC_LITERAL(19, 152, 10, 0), +QT_MOC_LITERAL(20, 163, 10, 0), +QT_MOC_LITERAL(21, 174, 10, 0), +QT_MOC_LITERAL(22, 185, 10, 0), +QT_MOC_LITERAL(23, 196, 10, 0), +QT_MOC_LITERAL(24, 207, 10, 0), +QT_MOC_LITERAL(25, 218, 10, 0), +QT_MOC_LITERAL(26, 229, 10, 0), +QT_MOC_LITERAL(27, 240, 10, 0), +QT_MOC_LITERAL(28, 251, 10, 0), +QT_MOC_LITERAL(29, 262, 10, 0), +QT_MOC_LITERAL(30, 273, 10, 0), +QT_MOC_LITERAL(31, 284, 10, 0), +QT_MOC_LITERAL(32, 295, 10, 0), +QT_MOC_LITERAL(33, 306, 10, 0), +QT_MOC_LITERAL(34, 317, 9, 0), +QT_MOC_LITERAL(35, 327, 5, 0), +QT_MOC_LITERAL(36, 333, 9, 0), +QT_MOC_LITERAL(37, 343, 10, 0), +QT_MOC_LITERAL(38, 354, 9, 0), +QT_MOC_LITERAL(39, 364, 4, 0), +QT_MOC_LITERAL(40, 369, 7, 0), +QT_MOC_LITERAL(41, 377, 8, 0), +QT_MOC_LITERAL(42, 386, 9, 0), +QT_MOC_LITERAL(43, 396, 11, 0), +QT_MOC_LITERAL(44, 408, 5, 0), +QT_MOC_LITERAL(45, 414, 8, 0), +QT_MOC_LITERAL(46, 423, 8, 0), +QT_MOC_LITERAL(47, 432, 8, 0), +QT_MOC_LITERAL(48, 441, 7, 0), +QT_MOC_LITERAL(49, 449, 8, 0), +QT_MOC_LITERAL(50, 458, 8, 0), +QT_MOC_LITERAL(51, 467, 9, 0), +QT_MOC_LITERAL(52, 477, 10, 0), +QT_MOC_LITERAL(53, 488, 4, 0), +QT_MOC_LITERAL(54, 493, 10, 0), +QT_MOC_LITERAL(55, 504, 9, 0), +QT_MOC_LITERAL(56, 514, 4, 0), +QT_MOC_LITERAL(57, 519, 7, 0), +QT_MOC_LITERAL(58, 527, 8, 0), +QT_MOC_LITERAL(59, 536, 9, 0), +QT_MOC_LITERAL(60, 546, 8, 0), +QT_MOC_LITERAL(61, 555, 7, 0), +QT_MOC_LITERAL(62, 563, 7, 0), +QT_MOC_LITERAL(63, 571, 7, 0), +QT_MOC_LITERAL(64, 579, 4, 0), +QT_MOC_LITERAL(65, 584, 3, 0), +QT_MOC_LITERAL(66, 588, 6, 0), +QT_MOC_LITERAL(67, 595, 8, 0), +QT_MOC_LITERAL(68, 604, 10, 0), +QT_MOC_LITERAL(69, 615, 7, 0), +QT_MOC_LITERAL(70, 623, 7, 0), +QT_MOC_LITERAL(71, 631, 6, 0), +QT_MOC_LITERAL(72, 638, 3, 0), +QT_MOC_LITERAL(73, 642, 12, 0), +QT_MOC_LITERAL(74, 655, 7, 0), +QT_MOC_LITERAL(75, 663, 11, 0), +QT_MOC_LITERAL(76, 675, 6, 0), +QT_MOC_LITERAL(77, 682, 9, 0), +QT_MOC_LITERAL(78, 692, 3, 0), +QT_MOC_LITERAL(79, 696, 14, 0), +QT_MOC_LITERAL(80, 711, 9, 0), +QT_MOC_LITERAL(81, 721, 7, 0), +QT_MOC_LITERAL(82, 729, 8, 0), +QT_MOC_LITERAL(83, 738, 8, 0), +QT_MOC_LITERAL(84, 747, 9, 0), +QT_MOC_LITERAL(85, 757, 3, 0), +QT_MOC_LITERAL(86, 761, 11, 0), +QT_MOC_LITERAL(87, 773, 7, 0), +QT_MOC_LITERAL(88, 781, 7, 0), +QT_MOC_LITERAL(89, 789, 15, 0), +QT_MOC_LITERAL(90, 805, 17, 0), +QT_MOC_LITERAL(91, 823, 13, 0), +QT_MOC_LITERAL(92, 837, 11, 0) + }, + "RPCOXLib::_DRPcoX\0exception\0\0code\0source\0disc\0help\0propertyChanged\0name\0" + "signal\0argc\0argv\0AboutBox\0ClearCOF\0Connect\0Interface\0DevNum\0ConnectRA16\0" + "IntName\0ConnectRL2\0ConnectRM1\0ConnectRM2\0ConnectRP2\0ConnectRV8\0ConnectRX5\0" + "ConnectRX6\0ConnectRX7\0ConnectRX8\0ConnectRX9\0ConnectRZ2\0ConnectRZ3\0ConnectRZ4\0" + "ConnectRZ5\0ConnectRZ6\0DefStatus\0DefID\0GetCycUse\0GetDefData\0GetDevCfg\0Addr\0" + "Width32\0GetError\0GetNameOf\0ObjTypeName\0Index\0GetNames\0NameList\0MaxNames\0" + "ObjType\0GetNumOf\0GetSFreq\0GetStatus\0GetTagSize\0Name\0GetTagType\0GetTagVal\0" + "Halt\0LoadCOF\0FileName\0LoadCOFsf\0SampFreq\0ReadCOF\0ReadTag\0double&\0pBuf\0nOS\0" + "nWords\0ReadTagV\0ReadTagVEX\0SrcType\0DstType\0nChans\0Run\0SendParTable\0IndexID\0" + "SendSrcFile\0SeekOS\0SetDevCfg\0Val\0SetSrcFileName\0SetTagVal\0SoftTrg\0Trg_Bitn\0" + "WriteTag\0WriteTagV\0Buf\0WriteTagVEX\0ZeroTag\0control\0RPCOXLib::RPcoX\0" + "Event Interface 1\0_DRPcoXEvents\0DefComplete\0" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_RPCOXLib___DRPcoX[] = { + + // content: + 7, // revision + 0, // classname + 0, 0, // classinfo + 53, 14, // methods + 1, 526, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 3, // signal count + +// signal: name, argc, parameters, tag, flags + 1, 4, 279, 2, 5, + 7, 1, 288, 2, 5, + 9, 3, 291, 2, 5, + +// slot: name, argc, parameters, tag, flags + 12, 0, 298, 2, 9, + 13, 0, 299, 2, 9, + 14, 2, 300, 2, 9, + 17, 2, 305, 2, 9, + 19, 2, 310, 2, 9, + 20, 2, 315, 2, 9, + 21, 2, 320, 2, 9, + 22, 2, 325, 2, 9, + 23, 2, 330, 2, 9, + 24, 2, 335, 2, 9, + 25, 2, 340, 2, 9, + 26, 2, 345, 2, 9, + 27, 2, 350, 2, 9, + 28, 2, 355, 2, 9, + 29, 2, 360, 2, 9, + 30, 2, 365, 2, 9, + 31, 2, 370, 2, 9, + 32, 2, 375, 2, 9, + 33, 2, 380, 2, 9, + 34, 1, 385, 2, 9, + 36, 0, 388, 2, 9, + 37, 1, 389, 2, 9, + 38, 2, 392, 2, 9, + 41, 0, 397, 2, 9, + 42, 2, 398, 2, 9, + 45, 3, 403, 2, 9, + 49, 1, 410, 2, 9, + 50, 0, 413, 2, 9, + 51, 0, 414, 2, 9, + 52, 1, 415, 2, 9, + 54, 1, 418, 2, 9, + 55, 1, 421, 2, 9, + 56, 0, 424, 2, 9, + 57, 1, 425, 2, 9, + 59, 2, 428, 2, 9, + 61, 1, 433, 2, 9, + 62, 4, 436, 2, 9, + 67, 3, 445, 2, 9, + 68, 6, 452, 2, 9, + 72, 0, 465, 2, 9, + 73, 2, 466, 2, 9, + 75, 3, 471, 2, 9, + 77, 3, 478, 2, 9, + 79, 2, 485, 2, 9, + 80, 2, 490, 2, 9, + 81, 1, 495, 2, 9, + 83, 4, 498, 2, 9, + 84, 3, 507, 2, 9, + 86, 4, 514, 2, 9, + 87, 1, 523, 2, 9, + +// signal: parameters + QMetaType::Void, QMetaType::Int, QMetaType::QString, QMetaType::QString, QMetaType::QString, 3, 4, 5, 6, + QMetaType::Void, QMetaType::QString, 8, + QMetaType::Void, QMetaType::QString, QMetaType::Int, QMetaType::VoidStar, 8, 10, 11, + +// slot: parameters + QMetaType::Void, + QMetaType::Int, + QMetaType::Int, QMetaType::Int, QMetaType::Int, 15, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::Int, 35, + QMetaType::Int, + QMetaType::QVariant, QMetaType::Int, 35, + QMetaType::Int, QMetaType::Int, QMetaType::Int, 39, 40, + QMetaType::QString, + QMetaType::QString, QMetaType::QString, QMetaType::Int, 43, 44, + QMetaType::Int, QMetaType::QString, QMetaType::Int, QMetaType::Int, 46, 47, 48, + QMetaType::Int, QMetaType::QString, 43, + QMetaType::Double, + QMetaType::Int, + QMetaType::Int, QMetaType::QString, 53, + QMetaType::Int, QMetaType::QString, 53, + QMetaType::Double, QMetaType::QString, 53, + QMetaType::Int, + QMetaType::Int, QMetaType::QString, 58, + QMetaType::Int, QMetaType::QString, QMetaType::Double, 58, 60, + QMetaType::Int, QMetaType::QString, 58, + QMetaType::Int, QMetaType::QString, 0x80000000 | 63, QMetaType::Int, QMetaType::Int, 53, 64, 65, 66, + QMetaType::QVariant, QMetaType::QString, QMetaType::Int, QMetaType::Int, 53, 65, 66, + QMetaType::QVariant, QMetaType::QString, QMetaType::Int, QMetaType::Int, QMetaType::QString, QMetaType::QString, QMetaType::Int, 53, 65, 66, 69, 70, 71, + QMetaType::Int, + QMetaType::Int, QMetaType::QString, QMetaType::Double, 53, 74, + QMetaType::Int, QMetaType::QString, QMetaType::Int, QMetaType::Int, 53, 76, 66, + QMetaType::Int, QMetaType::Int, QMetaType::Int, QMetaType::Int, 39, 78, 40, + QMetaType::Int, QMetaType::QString, QMetaType::QString, 53, 58, + QMetaType::Int, QMetaType::QString, QMetaType::Double, 53, 78, + QMetaType::Int, QMetaType::Int, 82, + QMetaType::Int, QMetaType::QString, 0x80000000 | 63, QMetaType::Int, QMetaType::Int, 53, 64, 65, 66, + QMetaType::Int, QMetaType::QString, QMetaType::Int, QMetaType::QVariant, 53, 65, 85, + QMetaType::Int, QMetaType::QString, QMetaType::Int, QMetaType::QString, QMetaType::QVariant, 53, 65, 70, 85, + QMetaType::Int, QMetaType::QString, 53, + + // properties: name, type, flags + 88, QMetaType::QString, 0x0a055003, // QString control + + 0 // eod +}; + +const QMetaObject _DRPcoX::staticMetaObject = { +{ &QObject::staticMetaObject, +qt_meta_stringdata_all.data, +qt_meta_data_RPCOXLib___DRPcoX, 0, 0, 0 } +}; + +void *_DRPcoX::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, "RPCOXLib::_DRPcoX")) + return static_cast(const_cast<_DRPcoX*>(this)); + return QAxObject::qt_metacast(_clname); +} +static const uint qt_meta_data_RPCOXLib__RPcoX[] = { + + // content: + 7, // revision + 89, // classname + 1, 14, // classinfo + 54, 16, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 4, // signal count + + // classinfo: key, value + 90, 91, + +// signal: name, argc, parameters, tag, flags + 92, 1, 286, 2, 5, + 1, 4, 289, 2, 5, + 7, 1, 298, 2, 5, + 9, 3, 301, 2, 5, + +// slot: name, argc, parameters, tag, flags + 12, 0, 308, 2, 9, + 13, 0, 309, 2, 9, + 14, 2, 310, 2, 9, + 17, 2, 315, 2, 9, + 19, 2, 320, 2, 9, + 20, 2, 325, 2, 9, + 21, 2, 330, 2, 9, + 22, 2, 335, 2, 9, + 23, 2, 340, 2, 9, + 24, 2, 345, 2, 9, + 25, 2, 350, 2, 9, + 26, 2, 355, 2, 9, + 27, 2, 360, 2, 9, + 28, 2, 365, 2, 9, + 29, 2, 370, 2, 9, + 30, 2, 375, 2, 9, + 31, 2, 380, 2, 9, + 32, 2, 385, 2, 9, + 33, 2, 390, 2, 9, + 34, 1, 395, 2, 9, + 36, 0, 398, 2, 9, + 37, 1, 399, 2, 9, + 38, 2, 402, 2, 9, + 41, 0, 407, 2, 9, + 42, 2, 408, 2, 9, + 45, 3, 413, 2, 9, + 49, 1, 420, 2, 9, + 50, 0, 423, 2, 9, + 51, 0, 424, 2, 9, + 52, 1, 425, 2, 9, + 54, 1, 428, 2, 9, + 55, 1, 431, 2, 9, + 56, 0, 434, 2, 9, + 57, 1, 435, 2, 9, + 59, 2, 438, 2, 9, + 61, 1, 443, 2, 9, + 62, 4, 446, 2, 9, + 67, 3, 455, 2, 9, + 68, 6, 462, 2, 9, + 72, 0, 475, 2, 9, + 73, 2, 476, 2, 9, + 75, 3, 481, 2, 9, + 77, 3, 488, 2, 9, + 79, 2, 495, 2, 9, + 80, 2, 500, 2, 9, + 81, 1, 505, 2, 9, + 83, 4, 508, 2, 9, + 84, 3, 517, 2, 9, + 86, 4, 524, 2, 9, + 87, 1, 533, 2, 9, + +// signal: parameters + QMetaType::Void, QMetaType::Int, 35, + QMetaType::Void, QMetaType::Int, QMetaType::QString, QMetaType::QString, QMetaType::QString, 3, 4, 5, 6, + QMetaType::Void, QMetaType::QString, 8, + QMetaType::Void, QMetaType::QString, QMetaType::Int, QMetaType::VoidStar, 8, 10, 11, + +// slot: parameters + QMetaType::Void, + QMetaType::Int, + QMetaType::Int, QMetaType::Int, QMetaType::Int, 15, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::QString, QMetaType::Int, 18, 16, + QMetaType::Int, QMetaType::Int, 35, + QMetaType::Int, + QMetaType::QVariant, QMetaType::Int, 35, + QMetaType::Int, QMetaType::Int, QMetaType::Int, 39, 40, + QMetaType::QString, + QMetaType::QString, QMetaType::QString, QMetaType::Int, 43, 44, + QMetaType::Int, QMetaType::QString, QMetaType::Int, QMetaType::Int, 46, 47, 48, + QMetaType::Int, QMetaType::QString, 43, + QMetaType::Double, + QMetaType::Int, + QMetaType::Int, QMetaType::QString, 53, + QMetaType::Int, QMetaType::QString, 53, + QMetaType::Double, QMetaType::QString, 53, + QMetaType::Int, + QMetaType::Int, QMetaType::QString, 58, + QMetaType::Int, QMetaType::QString, QMetaType::Double, 58, 60, + QMetaType::Int, QMetaType::QString, 58, + QMetaType::Int, QMetaType::QString, 0x80000000 | 63, QMetaType::Int, QMetaType::Int, 53, 64, 65, 66, + QMetaType::QVariant, QMetaType::QString, QMetaType::Int, QMetaType::Int, 53, 65, 66, + QMetaType::QVariant, QMetaType::QString, QMetaType::Int, QMetaType::Int, QMetaType::QString, QMetaType::QString, QMetaType::Int, 53, 65, 66, 69, 70, 71, + QMetaType::Int, + QMetaType::Int, QMetaType::QString, QMetaType::Double, 53, 74, + QMetaType::Int, QMetaType::QString, QMetaType::Int, QMetaType::Int, 53, 76, 66, + QMetaType::Int, QMetaType::Int, QMetaType::Int, QMetaType::Int, 39, 78, 40, + QMetaType::Int, QMetaType::QString, QMetaType::QString, 53, 58, + QMetaType::Int, QMetaType::QString, QMetaType::Double, 53, 78, + QMetaType::Int, QMetaType::Int, 82, + QMetaType::Int, QMetaType::QString, 0x80000000 | 63, QMetaType::Int, QMetaType::Int, 53, 64, 65, 66, + QMetaType::Int, QMetaType::QString, QMetaType::Int, QMetaType::QVariant, 53, 65, 85, + QMetaType::Int, QMetaType::QString, QMetaType::Int, QMetaType::QString, QMetaType::QVariant, 53, 65, 70, 85, + QMetaType::Int, QMetaType::QString, 53, + + 0 // eod +}; + +const QMetaObject RPcoX::staticMetaObject = { +{ &QWidget::staticMetaObject, +qt_meta_stringdata_all.data, +qt_meta_data_RPCOXLib__RPcoX, 0, 0, 0 } +}; + +void *RPcoX::qt_metacast(const char *_clname) +{ + if (!_clname) return 0; + if (!strcmp(_clname, "RPCOXLib::RPcoX")) + return static_cast(const_cast(this)); + return QAxWidget::qt_metacast(_clname); +} + diff --git a/rpcoxlib.h b/rpcoxlib.h new file mode 100644 index 0000000..b16e2d6 --- /dev/null +++ b/rpcoxlib.h @@ -0,0 +1,1637 @@ +/**************************************************************************** +** +** Namespace RPCOXLib generated by dumpcpp v5.7.0 using +** dumpcpp {D323A622-1D13-11D4-8858-444553540000} +** from the type library C:\TDT\lib64\RPcoX.ocx +** +****************************************************************************/ + +#ifndef QAX_DUMPCPP_RPCOXLIB_H +#define QAX_DUMPCPP_RPCOXLIB_H + +// Define this symbol to __declspec(dllexport) or __declspec(dllimport) +#ifndef RPCOXLIB_EXPORT +#define RPCOXLIB_EXPORT +#endif + +#include +#include +#include +#include + +struct IDispatch; + + +// Referenced namespace + +namespace RPCOXLib { + + +class RPCOXLIB_EXPORT _DRPcoX : public QAxObject +{ +public: + _DRPcoX(IDispatch *subobject = 0, QAxObject *parent = 0) + : QAxObject((IUnknown*)subobject, parent) + { + internalRelease(); + } + + /* + Method AboutBox + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline void AboutBox(); + + /* + Method ClearCOF + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ClearCOF(); + + /* + Method Connect + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int Connect(int Interface, int DevNum); + + /* + Method ConnectRA16 + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRA16(QString IntName, int DevNum); + + /* + Method ConnectRL2 + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRL2(QString IntName, int DevNum); + + /* + Method ConnectRM1 + + method ConnectRM1 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRM1(QString IntName, int DevNum); + + /* + Method ConnectRM2 + + method ConnectRM2 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRM2(QString IntName, int DevNum); + + /* + Method ConnectRP2 + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRP2(QString IntName, int DevNum); + + /* + Method ConnectRV8 + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRV8(QString IntName, int DevNum); + + /* + Method ConnectRX5 + + method ConnectRX5 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRX5(QString IntName, int DevNum); + + /* + Method ConnectRX6 + + method ConnectRX6 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRX6(QString IntName, int DevNum); + + /* + Method ConnectRX7 + + method ConnectRX7 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRX7(QString IntName, int DevNum); + + /* + Method ConnectRX8 + + method ConnectRX8 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRX8(QString IntName, int DevNum); + + /* + Method ConnectRX9 + + method ConnectRX9 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRX9(QString IntName, int DevNum); + + /* + Method ConnectRZ2 + + method ConnectRZ2 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRZ2(QString IntName, int DevNum); + + /* + Method ConnectRZ3 + + method ConnectRZ3 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRZ3(QString IntName, int DevNum); + + /* + Method ConnectRZ4 + + method ConnectRZ4 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRZ4(QString IntName, int DevNum); + + /* + Method ConnectRZ5 + + method ConnectRZ5 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRZ5(QString IntName, int DevNum); + + /* + Method ConnectRZ6 + + method ConnectRZ6 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRZ6(QString IntName, int DevNum); + + /* + Method DefStatus + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int DefStatus(int DefID); + + /* + Method GetCycUse + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetCycUse(); + + /* + Method GetDefData + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline QVariant GetDefData(int DefID); + + /* + Method GetDevCfg + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetDevCfg(int Addr, int Width32); + + /* + Method GetError + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline QString GetError(); + + /* + Method GetNameOf + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline QString GetNameOf(QString ObjTypeName, int Index); + + /* + Method GetNames + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetNames(QString NameList, int MaxNames, int ObjType); + + /* + Method GetNumOf + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetNumOf(QString ObjTypeName); + + /* + Method GetSFreq + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline double GetSFreq(); + + /* + Method GetStatus + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetStatus(); + + /* + Method GetTagSize + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetTagSize(QString Name); + + /* + Method GetTagType + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetTagType(QString Name); + + /* + Method GetTagVal + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline double GetTagVal(QString Name); + + /* + Method Halt + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int Halt(); + + /* + Method LoadCOF + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int LoadCOF(QString FileName); + + /* + Method LoadCOFsf + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int LoadCOFsf(QString FileName, double SampFreq); + + /* + Method ReadCOF + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ReadCOF(QString FileName); + + /* + Method ReadTag + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ReadTag(QString Name, double& pBuf, int nOS, int nWords); + + /* + Method ReadTagV + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline QVariant ReadTagV(QString Name, int nOS, int nWords); + + /* + Method ReadTagVEX + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline QVariant ReadTagVEX(QString Name, int nOS, int nWords, const QString& SrcType, const QString& DstType, int nChans); + + /* + Method Run + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int Run(); + + /* + Method SendParTable + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int SendParTable(QString Name, double IndexID); + + /* + Method SendSrcFile + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int SendSrcFile(QString Name, int SeekOS, int nWords); + + /* + Method SetDevCfg + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int SetDevCfg(int Addr, int Val, int Width32); + + /* + Method SetSrcFileName + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int SetSrcFileName(QString Name, const QString& FileName); + + /* + Method SetTagVal + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int SetTagVal(QString Name, double Val); + + /* + Method SoftTrg + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int SoftTrg(int Trg_Bitn); + + /* + Method WriteTag + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int WriteTag(QString Name, double& pBuf, int nOS, int nWords); + + /* + Method WriteTagV + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int WriteTagV(QString Name, int nOS, const QVariant& Buf); + + /* + Method WriteTagVEX + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int WriteTagVEX(QString Name, int nOS, const QString& DstType, const QVariant& Buf); + + /* + Method ZeroTag + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ZeroTag(QString Name); + +// meta object functions + static const QMetaObject staticMetaObject; + virtual const QMetaObject *metaObject() const { return &staticMetaObject; } + virtual void *qt_metacast(const char *); +}; + +// skipping event interface _DRPcoXEvents + +// Actual coclasses +class RPCOXLIB_EXPORT RPcoX : public QAxWidget +{ +public: + RPcoX(QWidget *parent = 0, Qt::WindowFlags f = 0) + : QAxWidget(parent, f) + { + setControl("{d323a625-1d13-11d4-8858-444553540000}"); + } + + /* + Method AboutBox + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline void AboutBox(); + + /* + Method ClearCOF + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ClearCOF(); + + /* + Method Connect + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int Connect(int Interface, int DevNum); + + /* + Method ConnectRA16 + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRA16(QString IntName, int DevNum); + + /* + Method ConnectRL2 + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRL2(QString IntName, int DevNum); + + /* + Method ConnectRM1 + + method ConnectRM1 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRM1(QString IntName, int DevNum); + + /* + Method ConnectRM2 + + method ConnectRM2 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRM2(QString IntName, int DevNum); + + /* + Method ConnectRP2 + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRP2(QString IntName, int DevNum); + + /* + Method ConnectRV8 + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRV8(QString IntName, int DevNum); + + /* + Method ConnectRX5 + + method ConnectRX5 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRX5(QString IntName, int DevNum); + + /* + Method ConnectRX6 + + method ConnectRX6 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRX6(QString IntName, int DevNum); + + /* + Method ConnectRX7 + + method ConnectRX7 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRX7(QString IntName, int DevNum); + + /* + Method ConnectRX8 + + method ConnectRX8 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRX8(QString IntName, int DevNum); + + /* + Method ConnectRX9 + + method ConnectRX9 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRX9(QString IntName, int DevNum); + + /* + Method ConnectRZ2 + + method ConnectRZ2 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRZ2(QString IntName, int DevNum); + + /* + Method ConnectRZ3 + + method ConnectRZ3 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRZ3(QString IntName, int DevNum); + + /* + Method ConnectRZ4 + + method ConnectRZ4 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRZ4(QString IntName, int DevNum); + + /* + Method ConnectRZ5 + + method ConnectRZ5 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRZ5(QString IntName, int DevNum); + + /* + Method ConnectRZ6 + + method ConnectRZ6 +For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ConnectRZ6(QString IntName, int DevNum); + + /* + Method DefStatus + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int DefStatus(int DefID); + + /* + Method GetCycUse + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetCycUse(); + + /* + Method GetDefData + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline QVariant GetDefData(int DefID); + + /* + Method GetDevCfg + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetDevCfg(int Addr, int Width32); + + /* + Method GetError + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline QString GetError(); + + /* + Method GetNameOf + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline QString GetNameOf(QString ObjTypeName, int Index); + + /* + Method GetNames + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetNames(QString NameList, int MaxNames, int ObjType); + + /* + Method GetNumOf + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetNumOf(QString ObjTypeName); + + /* + Method GetSFreq + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline double GetSFreq(); + + /* + Method GetStatus + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetStatus(); + + /* + Method GetTagSize + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetTagSize(QString Name); + + /* + Method GetTagType + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int GetTagType(QString Name); + + /* + Method GetTagVal + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline double GetTagVal(QString Name); + + /* + Method Halt + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int Halt(); + + /* + Method LoadCOF + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int LoadCOF(QString FileName); + + /* + Method LoadCOFsf + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int LoadCOFsf(QString FileName, double SampFreq); + + /* + Method ReadCOF + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ReadCOF(QString FileName); + + /* + Method ReadTag + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ReadTag(QString Name, double& pBuf, int nOS, int nWords); + + /* + Method ReadTagV + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline QVariant ReadTagV(QString Name, int nOS, int nWords); + + /* + Method ReadTagVEX + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline QVariant ReadTagVEX(QString Name, int nOS, int nWords, const QString& SrcType, const QString& DstType, int nChans); + + /* + Method Run + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int Run(); + + /* + Method SendParTable + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int SendParTable(QString Name, double IndexID); + + /* + Method SendSrcFile + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int SendSrcFile(QString Name, int SeekOS, int nWords); + + /* + Method SetDevCfg + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int SetDevCfg(int Addr, int Val, int Width32); + + /* + Method SetSrcFileName + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int SetSrcFileName(QString Name, const QString& FileName); + + /* + Method SetTagVal + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int SetTagVal(QString Name, double Val); + + /* + Method SoftTrg + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int SoftTrg(int Trg_Bitn); + + /* + Method WriteTag + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int WriteTag(QString Name, double& pBuf, int nOS, int nWords); + + /* + Method WriteTagV + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int WriteTagV(QString Name, int nOS, const QVariant& Buf); + + /* + Method WriteTagVEX + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int WriteTagVEX(QString Name, int nOS, const QString& DstType, const QVariant& Buf); + + /* + Method ZeroTag + + For more information, see help context 0 in C:\TDT\lib64\RPcoX.hlp. + */ + inline int ZeroTag(QString Name); + +// meta object functions + static const QMetaObject staticMetaObject; + virtual const QMetaObject *metaObject() const { return &staticMetaObject; } + virtual void *qt_metacast(const char *); +}; + +// member function implementation +#ifndef QAX_DUMPCPP_RPCOXLIB_NOINLINES +inline void _DRPcoX::AboutBox() +{ + void *_a[] = {0}; + qt_metacall(QMetaObject::InvokeMetaMethod, 8, _a); +} + +inline int _DRPcoX::ClearCOF() +{ + int qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 9, _a); + return qax_result; +} + +inline int _DRPcoX::Connect(int Interface, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Interface, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 10, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRA16(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 11, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRL2(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 12, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRM1(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 13, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRM2(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 14, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRP2(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 15, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRV8(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 16, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRX5(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 17, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRX6(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 18, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRX7(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 19, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRX8(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 20, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRX9(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 21, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRZ2(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 22, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRZ3(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 23, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRZ4(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 24, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRZ5(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 25, _a); + return qax_result; +} + +inline int _DRPcoX::ConnectRZ6(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 26, _a); + return qax_result; +} + +inline int _DRPcoX::DefStatus(int DefID) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&DefID}; + qt_metacall(QMetaObject::InvokeMetaMethod, 27, _a); + return qax_result; +} + +inline int _DRPcoX::GetCycUse() +{ + int qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 28, _a); + return qax_result; +} + +inline QVariant _DRPcoX::GetDefData(int DefID) +{ + QVariant qax_result; + void *_a[] = {(void*)&qax_result, (void*)&DefID}; + qt_metacall(QMetaObject::InvokeMetaMethod, 29, _a); + return qax_result; +} + +inline int _DRPcoX::GetDevCfg(int Addr, int Width32) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Addr, (void*)&Width32}; + qt_metacall(QMetaObject::InvokeMetaMethod, 30, _a); + return qax_result; +} + +inline QString _DRPcoX::GetError() +{ + QString qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 31, _a); + return qax_result; +} + +inline QString _DRPcoX::GetNameOf(QString ObjTypeName, int Index) +{ + QString qax_result; + void *_a[] = {(void*)&qax_result, (void*)&ObjTypeName, (void*)&Index}; + qt_metacall(QMetaObject::InvokeMetaMethod, 32, _a); + return qax_result; +} + +inline int _DRPcoX::GetNames(QString NameList, int MaxNames, int ObjType) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&NameList, (void*)&MaxNames, (void*)&ObjType}; + qt_metacall(QMetaObject::InvokeMetaMethod, 33, _a); + return qax_result; +} + +inline int _DRPcoX::GetNumOf(QString ObjTypeName) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&ObjTypeName}; + qt_metacall(QMetaObject::InvokeMetaMethod, 34, _a); + return qax_result; +} + +inline double _DRPcoX::GetSFreq() +{ + double qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 35, _a); + return qax_result; +} + +inline int _DRPcoX::GetStatus() +{ + int qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 36, _a); + return qax_result; +} + +inline int _DRPcoX::GetTagSize(QString Name) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name}; + qt_metacall(QMetaObject::InvokeMetaMethod, 37, _a); + return qax_result; +} + +inline int _DRPcoX::GetTagType(QString Name) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name}; + qt_metacall(QMetaObject::InvokeMetaMethod, 38, _a); + return qax_result; +} + +inline double _DRPcoX::GetTagVal(QString Name) +{ + double qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name}; + qt_metacall(QMetaObject::InvokeMetaMethod, 39, _a); + return qax_result; +} + +inline int _DRPcoX::Halt() +{ + int qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 40, _a); + return qax_result; +} + +inline int _DRPcoX::LoadCOF(QString FileName) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&FileName}; + qt_metacall(QMetaObject::InvokeMetaMethod, 41, _a); + return qax_result; +} + +inline int _DRPcoX::LoadCOFsf(QString FileName, double SampFreq) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&FileName, (void*)&SampFreq}; + qt_metacall(QMetaObject::InvokeMetaMethod, 42, _a); + return qax_result; +} + +inline int _DRPcoX::ReadCOF(QString FileName) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&FileName}; + qt_metacall(QMetaObject::InvokeMetaMethod, 43, _a); + return qax_result; +} + +inline int _DRPcoX::ReadTag(QString Name, double& pBuf, int nOS, int nWords) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&pBuf, (void*)&nOS, (void*)&nWords}; + qt_metacall(QMetaObject::InvokeMetaMethod, 44, _a); + return qax_result; +} + +inline QVariant _DRPcoX::ReadTagV(QString Name, int nOS, int nWords) +{ + QVariant qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&nOS, (void*)&nWords}; + qt_metacall(QMetaObject::InvokeMetaMethod, 45, _a); + return qax_result; +} + +inline QVariant _DRPcoX::ReadTagVEX(QString Name, int nOS, int nWords, const QString& SrcType, const QString& DstType, int nChans) +{ + QVariant qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&nOS, (void*)&nWords, (void*)&SrcType, (void*)&DstType, (void*)&nChans}; + qt_metacall(QMetaObject::InvokeMetaMethod, 46, _a); + return qax_result; +} + +inline int _DRPcoX::Run() +{ + int qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 47, _a); + return qax_result; +} + +inline int _DRPcoX::SendParTable(QString Name, double IndexID) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&IndexID}; + qt_metacall(QMetaObject::InvokeMetaMethod, 48, _a); + return qax_result; +} + +inline int _DRPcoX::SendSrcFile(QString Name, int SeekOS, int nWords) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&SeekOS, (void*)&nWords}; + qt_metacall(QMetaObject::InvokeMetaMethod, 49, _a); + return qax_result; +} + +inline int _DRPcoX::SetDevCfg(int Addr, int Val, int Width32) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Addr, (void*)&Val, (void*)&Width32}; + qt_metacall(QMetaObject::InvokeMetaMethod, 50, _a); + return qax_result; +} + +inline int _DRPcoX::SetSrcFileName(QString Name, const QString& FileName) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&FileName}; + qt_metacall(QMetaObject::InvokeMetaMethod, 51, _a); + return qax_result; +} + +inline int _DRPcoX::SetTagVal(QString Name, double Val) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&Val}; + qt_metacall(QMetaObject::InvokeMetaMethod, 52, _a); + return qax_result; +} + +inline int _DRPcoX::SoftTrg(int Trg_Bitn) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Trg_Bitn}; + qt_metacall(QMetaObject::InvokeMetaMethod, 53, _a); + return qax_result; +} + +inline int _DRPcoX::WriteTag(QString Name, double& pBuf, int nOS, int nWords) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&pBuf, (void*)&nOS, (void*)&nWords}; + qt_metacall(QMetaObject::InvokeMetaMethod, 54, _a); + return qax_result; +} + +inline int _DRPcoX::WriteTagV(QString Name, int nOS, const QVariant& Buf) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&nOS, (void*)&Buf}; + qt_metacall(QMetaObject::InvokeMetaMethod, 55, _a); + return qax_result; +} + +inline int _DRPcoX::WriteTagVEX(QString Name, int nOS, const QString& DstType, const QVariant& Buf) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&nOS, (void*)&DstType, (void*)&Buf}; + qt_metacall(QMetaObject::InvokeMetaMethod, 56, _a); + return qax_result; +} + +inline int _DRPcoX::ZeroTag(QString Name) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name}; + qt_metacall(QMetaObject::InvokeMetaMethod, 57, _a); + return qax_result; +} + + +inline void RPcoX::AboutBox() +{ + void *_a[] = {0}; + qt_metacall(QMetaObject::InvokeMetaMethod, 36, _a); +} + +inline int RPcoX::ClearCOF() +{ + int qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 37, _a); + return qax_result; +} + +inline int RPcoX::Connect(int Interface, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Interface, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 38, _a); + return qax_result; +} + +inline int RPcoX::ConnectRA16(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 39, _a); + return qax_result; +} + +inline int RPcoX::ConnectRL2(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 40, _a); + return qax_result; +} + +inline int RPcoX::ConnectRM1(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 41, _a); + return qax_result; +} + +inline int RPcoX::ConnectRM2(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 42, _a); + return qax_result; +} + +inline int RPcoX::ConnectRP2(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 43, _a); + return qax_result; +} + +inline int RPcoX::ConnectRV8(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 44, _a); + return qax_result; +} + +inline int RPcoX::ConnectRX5(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 45, _a); + return qax_result; +} + +inline int RPcoX::ConnectRX6(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 46, _a); + return qax_result; +} + +inline int RPcoX::ConnectRX7(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 47, _a); + return qax_result; +} + +inline int RPcoX::ConnectRX8(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 48, _a); + return qax_result; +} + +inline int RPcoX::ConnectRX9(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 49, _a); + return qax_result; +} + +inline int RPcoX::ConnectRZ2(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 50, _a); + return qax_result; +} + +inline int RPcoX::ConnectRZ3(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 51, _a); + return qax_result; +} + +inline int RPcoX::ConnectRZ4(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 52, _a); + return qax_result; +} + +inline int RPcoX::ConnectRZ5(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 53, _a); + return qax_result; +} + +inline int RPcoX::ConnectRZ6(QString IntName, int DevNum) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&IntName, (void*)&DevNum}; + qt_metacall(QMetaObject::InvokeMetaMethod, 54, _a); + return qax_result; +} + +inline int RPcoX::DefStatus(int DefID) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&DefID}; + qt_metacall(QMetaObject::InvokeMetaMethod, 55, _a); + return qax_result; +} + +inline int RPcoX::GetCycUse() +{ + int qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 56, _a); + return qax_result; +} + +inline QVariant RPcoX::GetDefData(int DefID) +{ + QVariant qax_result; + void *_a[] = {(void*)&qax_result, (void*)&DefID}; + qt_metacall(QMetaObject::InvokeMetaMethod, 57, _a); + return qax_result; +} + +inline int RPcoX::GetDevCfg(int Addr, int Width32) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Addr, (void*)&Width32}; + qt_metacall(QMetaObject::InvokeMetaMethod, 58, _a); + return qax_result; +} + +inline QString RPcoX::GetError() +{ + QString qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 59, _a); + return qax_result; +} + +inline QString RPcoX::GetNameOf(QString ObjTypeName, int Index) +{ + QString qax_result; + void *_a[] = {(void*)&qax_result, (void*)&ObjTypeName, (void*)&Index}; + qt_metacall(QMetaObject::InvokeMetaMethod, 60, _a); + return qax_result; +} + +inline int RPcoX::GetNames(QString NameList, int MaxNames, int ObjType) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&NameList, (void*)&MaxNames, (void*)&ObjType}; + qt_metacall(QMetaObject::InvokeMetaMethod, 61, _a); + return qax_result; +} + +inline int RPcoX::GetNumOf(QString ObjTypeName) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&ObjTypeName}; + qt_metacall(QMetaObject::InvokeMetaMethod, 62, _a); + return qax_result; +} + +inline double RPcoX::GetSFreq() +{ + double qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 63, _a); + return qax_result; +} + +inline int RPcoX::GetStatus() +{ + int qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 64, _a); + return qax_result; +} + +inline int RPcoX::GetTagSize(QString Name) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name}; + qt_metacall(QMetaObject::InvokeMetaMethod, 65, _a); + return qax_result; +} + +inline int RPcoX::GetTagType(QString Name) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name}; + qt_metacall(QMetaObject::InvokeMetaMethod, 66, _a); + return qax_result; +} + +inline double RPcoX::GetTagVal(QString Name) +{ + double qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name}; + qt_metacall(QMetaObject::InvokeMetaMethod, 67, _a); + return qax_result; +} + +inline int RPcoX::Halt() +{ + int qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 68, _a); + return qax_result; +} + +inline int RPcoX::LoadCOF(QString FileName) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&FileName}; + qt_metacall(QMetaObject::InvokeMetaMethod, 69, _a); + return qax_result; +} + +inline int RPcoX::LoadCOFsf(QString FileName, double SampFreq) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&FileName, (void*)&SampFreq}; + qt_metacall(QMetaObject::InvokeMetaMethod, 70, _a); + return qax_result; +} + +inline int RPcoX::ReadCOF(QString FileName) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&FileName}; + qt_metacall(QMetaObject::InvokeMetaMethod, 71, _a); + return qax_result; +} + +inline int RPcoX::ReadTag(QString Name, double& pBuf, int nOS, int nWords) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&pBuf, (void*)&nOS, (void*)&nWords}; + qt_metacall(QMetaObject::InvokeMetaMethod, 72, _a); + return qax_result; +} + +inline QVariant RPcoX::ReadTagV(QString Name, int nOS, int nWords) +{ + QVariant qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&nOS, (void*)&nWords}; + qt_metacall(QMetaObject::InvokeMetaMethod, 73, _a); + return qax_result; +} + +inline QVariant RPcoX::ReadTagVEX(QString Name, int nOS, int nWords, const QString& SrcType, const QString& DstType, int nChans) +{ + QVariant qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&nOS, (void*)&nWords, (void*)&SrcType, (void*)&DstType, (void*)&nChans}; + qt_metacall(QMetaObject::InvokeMetaMethod, 74, _a); + return qax_result; +} + +inline int RPcoX::Run() +{ + int qax_result; + void *_a[] = {(void*)&qax_result}; + qt_metacall(QMetaObject::InvokeMetaMethod, 75, _a); + return qax_result; +} + +inline int RPcoX::SendParTable(QString Name, double IndexID) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&IndexID}; + qt_metacall(QMetaObject::InvokeMetaMethod, 76, _a); + return qax_result; +} + +inline int RPcoX::SendSrcFile(QString Name, int SeekOS, int nWords) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&SeekOS, (void*)&nWords}; + qt_metacall(QMetaObject::InvokeMetaMethod, 77, _a); + return qax_result; +} + +inline int RPcoX::SetDevCfg(int Addr, int Val, int Width32) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Addr, (void*)&Val, (void*)&Width32}; + qt_metacall(QMetaObject::InvokeMetaMethod, 78, _a); + return qax_result; +} + +inline int RPcoX::SetSrcFileName(QString Name, const QString& FileName) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&FileName}; + qt_metacall(QMetaObject::InvokeMetaMethod, 79, _a); + return qax_result; +} + +inline int RPcoX::SetTagVal(QString Name, double Val) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&Val}; + qt_metacall(QMetaObject::InvokeMetaMethod, 80, _a); + return qax_result; +} + +inline int RPcoX::SoftTrg(int Trg_Bitn) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Trg_Bitn}; + qt_metacall(QMetaObject::InvokeMetaMethod, 81, _a); + return qax_result; +} + +inline int RPcoX::WriteTag(QString Name, double& pBuf, int nOS, int nWords) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&pBuf, (void*)&nOS, (void*)&nWords}; + qt_metacall(QMetaObject::InvokeMetaMethod, 82, _a); + return qax_result; +} + +inline int RPcoX::WriteTagV(QString Name, int nOS, const QVariant& Buf) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&nOS, (void*)&Buf}; + qt_metacall(QMetaObject::InvokeMetaMethod, 83, _a); + return qax_result; +} + +inline int RPcoX::WriteTagVEX(QString Name, int nOS, const QString& DstType, const QVariant& Buf) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name, (void*)&nOS, (void*)&DstType, (void*)&Buf}; + qt_metacall(QMetaObject::InvokeMetaMethod, 84, _a); + return qax_result; +} + +inline int RPcoX::ZeroTag(QString Name) +{ + int qax_result; + void *_a[] = {(void*)&qax_result, (void*)&Name}; + qt_metacall(QMetaObject::InvokeMetaMethod, 85, _a); + return qax_result; +} + + + +#endif + +} + +QT_BEGIN_NAMESPACE + +namespace QtMetaTypePrivate { +template<> +struct QMetaTypeFunctionHelper { + static void Destruct(void *t) + { + Q_UNUSED(t) + static_cast(t)->RPCOXLib::_DRPcoX::~_DRPcoX(); + } + static void *Construct(void *where, const void *t) + { + Q_ASSERT(!t); + Q_UNUSED(t) + return new (where) RPCOXLib::_DRPcoX; + } +#ifndef QT_NO_DATASTREAM + static void Save(QDataStream &stream, const void *t) { stream << *static_cast(t); } + static void Load(QDataStream &stream, void *t) { stream >> *static_cast(t); } +#endif // QT_NO_DATASTREAM +}; + +template<> +struct QMetaTypeFunctionHelper { + static void Destruct(void *t) + { + Q_UNUSED(t) + static_cast(t)->RPCOXLib::RPcoX::~RPcoX(); + } + static void *Construct(void *where, const void *t) + { + Q_ASSERT(!t); + Q_UNUSED(t) + return new (where) RPCOXLib::RPcoX; + } +#ifndef QT_NO_DATASTREAM + static void Save(QDataStream &stream, const void *t) { stream << *static_cast(t); } + static void Load(QDataStream &stream, void *t) { stream >> *static_cast(t); } +#endif // QT_NO_DATASTREAM +}; + +} // namespace QtMetaTypePrivate +QT_END_NAMESPACE + +#endif + diff --git a/trialseq.cpp b/trialseq.cpp new file mode 100644 index 0000000..cca40f5 --- /dev/null +++ b/trialseq.cpp @@ -0,0 +1,106 @@ +#include "trialseq.h" +namespace TrialSeq { + +int randomGenerator (int i) { return rand()%i; } + +double randomMinMax (double min, double max) { + std::mt19937 rng; + std::uniform_real_distribution dist(min, max); //(min, max) + rng.seed(std::random_device{}()); //non-deterministic seed + return dist(rng); +} + +QVector generateTrialSequence(int sorting, int repeatPositive, int repeatNegative) +{ + QVector trialSequence; + int currentRepeatPositive; + int currentRepeatNegative; + + switch(sorting){ + case TrialSeq::ORDERED: + currentRepeatPositive = 1; + currentRepeatNegative = 1; + while(currentRepeatPositive <= repeatPositive || currentRepeatNegative <= repeatNegative) { + if(currentRepeatPositive <= repeatPositive) { + trialSequence.append(1); + currentRepeatPositive++; + } + if(currentRepeatNegative <= repeatNegative) { + trialSequence.append(0); + currentRepeatNegative++; + } + } + break; + case TrialSeq::SORTED: + for (currentRepeatPositive = 1; currentRepeatPositive <= repeatPositive; ++currentRepeatPositive) { + trialSequence.append(1); + } + for (currentRepeatNegative = 1; currentRepeatNegative <= repeatNegative; ++currentRepeatNegative) { + trialSequence.append(0); + } + break; + case TrialSeq::SHUFFLED: + for (currentRepeatPositive = 1; currentRepeatPositive <= repeatPositive; ++currentRepeatPositive) { + trialSequence.append(1); + } + for (currentRepeatNegative = 1; currentRepeatNegative <= repeatNegative; ++currentRepeatNegative) { + trialSequence.append(0); + } + // shuffle trial sequence + std::random_shuffle(trialSequence.begin(), trialSequence.end(), TrialSeq::randomGenerator); + break; + default: + for (currentRepeatPositive = 1; currentRepeatPositive <= repeatPositive; ++currentRepeatPositive) { + trialSequence.append(1); + for (currentRepeatNegative = 1; currentRepeatNegative <= repeatNegative; ++currentRepeatNegative) { + trialSequence.append(0); + } + } + } + //qDebug() << trialSequence; + return trialSequence; + +} + +QVector generateItiSequence(double userReaction, QString itiList, double preImaq, int repeatPositive, int repeatNegative) +{ + QVector itiSequence; + int itiSequenceLength = repeatPositive + repeatNegative; + if(!itiList.isEmpty()) { + if(itiList.contains(',')) { + QStringList iti_range = itiList.split(','); + double itiValueMin = iti_range.first().toDouble() - userReaction - preImaq; + double itiValueMax = iti_range.last().toDouble() - userReaction - preImaq; + for (int itiSequenceElement = 0; itiSequenceElement < itiSequenceLength; ++itiSequenceElement) { + itiSequence.append(TrialSeq::randomMinMax(itiValueMin, itiValueMax)); + } + } else { + double itiValue = itiList.toDouble() - userReaction - preImaq; + for (int itiSequenceElement = 0; itiSequenceElement < itiSequenceLength; ++itiSequenceElement) { + itiSequence.append(itiValue); + } + } + } + + return itiSequence; +} + + +QVector loadExternalItiSequence(QString fileName, int repeatPositive, int repeatNegative) +{ + QVector itiSequence; + + // get iti duration value from external file + QFile file(fileName); + if (file.open(QIODevice::ReadOnly | QIODevice::Text)){ + QTextStream in(&file); + while (!in.atEnd()) { + QString line = in.readLine(); + itiSequence.append(10); /*Get proper value*/ + qDebug() << line; + } + } + return itiSequence; +} + +} diff --git a/trialseq.h b/trialseq.h new file mode 100644 index 0000000..ab01cf4 --- /dev/null +++ b/trialseq.h @@ -0,0 +1,25 @@ +#ifndef TRIALSEQ_H +#define TRIALSEQ_H + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace TrialSeq { + enum SORTING {ORDERED, SORTED, SHUFFLED}; + + // values for trial sequence sorting + int randomGenerator (int i); + double randomMinMax (double min, double max); + QVector generateTrialSequence(int sorting, int repeatPositive, int repeatNegative); + QVector generateItiSequence(double userReaction, QString itiList, double preImaq, int repeatPositive, int repeatNegative); + QVector loadExternalItiSequence(QString fileName, int repeatPositive, int repeatNegative); + +} + +#endif // TRIALSEQ_H