Repository navigation
Expand file tree
/
Copy pathreaderworkthread.h
More file actions
89 lines (74 loc) · 1.43 KB
/
Copy pathreaderworkthread.h
File metadata and controls
89 lines (74 loc) · 1.43 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#ifndef READERWORKTHREAD_H
#define READERWORKTHREAD_H
#include <QThread>
#include <QString>
#include <stdlib.h>
#include <stdio.h>
#include "XlsReader.h"
#include <string>
#include <ctype.h>
#include <iostream>
#include <sstream>
#include "analyzeresult.h"
using namespace xls;
using namespace std;
struct CalTmp
{
float cur_a;
float power;
float vsp;
// float cur_b;
// float cur_c;
// float vol_a;
// float vol_b;
// float vol_c;
long time;
long status;//1--load //0--unload //2-standby
float cur_a_ave;
};
struct CalRes
{
long loadTime;
long unloadTime;
long loadCnt;
long unloadCnt;
float loadCharge;
float Charge;
float loadPower;
float unloadPower;
};
struct CalStatus
{
long status;//1--load //0--unload //2-standby
float last_cur_a;
};
class ReaderWorkThread : public QThread
{
Q_OBJECT
public:
ReaderWorkThread(QObject *parent = 0)
: QThread(parent)
{
}
signals:
void result();
protected:
template <class Type>
Type stringToNum(const string& str)
{
istringstream iss(str);
Type num;
iss >> num;
return num;
}
void run();
private:
void clear(CalTmp *temp,int len);
void computeEnergy(CalTmp *temp,int len,CalStatus *status,AnalyzeResult *res);
public:
QString path;
AnalyzeResult res;
std::string start_time;
std::string meassure_time;
};
#endif // READERWORKTHREAD_H