-
Notifications
You must be signed in to change notification settings - Fork 2
/
tsusb3000reader.h
70 lines (64 loc) · 2.27 KB
/
tsusb3000reader.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef TSUSB3000READER_H
#define TSUSB3000READER_H
#include <QObject>
#include <QtCore/QThread>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include "QLibrary"
#include "Rtusbapi.h"
#include "QDebug"
#include "tscurvebuffer.h"
class TSUsb3000Reader : public QObject
{
Q_OBJECT
public:
explicit TSUsb3000Reader(QObject *parent = 0);
int calibtateVolume();
SHORT* readData();
bool initDevice(TSCurveBuffer *_bf);
QString getLastError();
void TerminateApplication(char *ErrorString, bool TerminationFlag = false);
bool closeReader();
~TSUsb3000Reader();
int getQuietLevels(int *qlevels, int qtime);
DWORD read();
void setLastError(QString);
void run();
private:
QString LastError;
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]; // áóôåð äàííûõ äëÿ êàäðà îòñ÷¸òîâ
// íîìåð îøèáêè ïðè âûïîëíåíèè ïîòîêà ñáîðà äàííûõ
WORD ThreadErrorNumber;
// ôëàæîê çàâåðøåíèÿ ïîòîêîâ ââîäà äàííûõ
bool IsThreadComplete;
//max âîçìîæíîå êîë-âî ïåðåäàâàåìûõ îòñ÷åòîâ (êðàòíîå 32) äëÿ ô. ReadData è WriteData()
DWORD DataStep;
// ñòîëüêî áëîêîâ ïî DataStep îòñ÷¸òîâ íóæíî ñîáðàòü â ôàéë
WORD NBlockRead;
// óêàçàòåëü íà áóôåð äëÿ ââîäèìûõ äàííûõ
SHORT *ReadBuffer;
DWORD Counter;
// õýíäë ìîäóëÿ
HANDLE ModuleHandle;
// íîìåð îøèáêè ïðè âûïîëíåíèè ïîòîêà ñáîðà äàííûõ
bool WaitingForRequestCompleted(OVERLAPPED *ReadOv);
signals:
void done();
void changeProgress(int val);
public slots:
};
#endif // TSUSB3000READER_H