-
Notifications
You must be signed in to change notification settings - Fork 2
/
tsusbdatareader.h
51 lines (45 loc) · 1.53 KB
/
tsusbdatareader.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef TSUSBDATAREADER_H
#define TSUSBDATAREADER_H
#include <QObject>
#include <stdlib.h>
#include <conio.h>
#include "QLibrary"
#include "Rtusbapi.h"
#include "QDebug"
#include "tscurvebuffer.h"
class TSUsbDataReader : public QObject
{
Q_OBJECT
public:
explicit TSUsbDataReader(QObject *parent = 0);
bool initDevice(TSCurveBuffer *_bf);
bool closeReader();
void stopRead();
void setReadingType(TSUsbReadingType type);
signals:
void done();
void changeProgress(int val);
public slots:
void read();
private:
void TerminateApplication(char *ErrorString, bool TerminationFlag = false);
void setLastError(QString);
SHORT* readData();
TSCurveBuffer *buffer;
DWORD DllVersion;
IRTUSB3000 *pModule; // óêàçàòåëü íà èíòåðôåéñ ìîäóëÿ
char ModuleName[10]; // íàçâàíèå ìîäóëÿ
BYTE UsbSpeed; // ñêîðîñòü ðàáîòû øèíû USB
char ModuleSerialNumber[9]; // ñåðèéíûé íîìåð ìîäóëÿ
char AvrVersion[5]; // âåðñèÿ äðàéâåðà AVR
RTUSB3000::DSP_INFO di; // ñòðóêòóðà, ñîäåðæàùàÿ èíôîðìàöèþ î âåðñèè äðàéâåðà DSP
RTUSB3000::FLASH fi; // ñòðóêòóðà èíôîðìàöèè â ÏÏÇÓ ìîäóëÿ
RTUSB3000::INPUT_PARS ip; // ñòðóêòóðà ïàðàìåòðîâ ðàáîòû ÀÖÏ
const static WORD CHANNELS_QUANTITY = 0x4; // êîë-âî îïðàøèâàåìûõ êàíàëîâ ìîäóëÿ
const static double ReadRate = 1.0; // ÷àñòîòà ââîäà äàííûõ
const static WORD MaxVirtualSoltsQuantity = 4;
SHORT AdcBuffer[CHANNELS_QUANTITY]; // áóôåð äàííûõ äëÿ êàäðà îòñ÷¸òîâ
TSUsbReadingType readingType;
bool ReadingStarted;
};
#endif // TSUSBDATAREADER_H