forked from AmurSU/TSProject
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsreaderthread.cpp
More file actions
47 lines (43 loc) · 1.23 KB
/
tsreaderthread.cpp
File metadata and controls
47 lines (43 loc) · 1.23 KB
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
#include "tsreaderthread.h"
#include "conio.h"
TSReaderThread::TSReaderThread(TSCurveBuffer *b, QObject *parent) :QThread(parent){
buffer = b;
moveToThread(this);
}
void TSReaderThread::f1 (){
qDebug()<<"-----Thread is open for command----";
}
void TSReaderThread::startRead (){
ReadingStarted = true;
this->start();
}
void TSReaderThread::stopRead (){
ReadingStarted=false;
this->terminate();
}
void TSReaderThread::run(){
TSUsb3000Reader *reader = new TSUsb3000Reader(this);
reader->initDevice(buffer);
/*int* volume= buffer->volume();
int* tempIn = buffer->tempIn();
int* tempOut = buffer->tempOut();
int end = buffer->end();*/
while(this->ReadingStarted){
/*Debug()<<"It works";*/
if (reader->readData()){
/*qDebug()<<"It works";*/
/*volume= buffer->volume();
tempIn = buffer->tempIn();
tempOut = buffer->tempOut();
end = buffer->end();*/
//qDebug()<<volume[end]<<tempIn[end]<<tempOut[end];
sleep(0.01);
}
else{
qDebug()<<"Get crashe";
sleep(0.01);
}
}
/*emit done(reader);*/
exec();
}