-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathreflowcontroller.h
161 lines (128 loc) · 3.79 KB
/
reflowcontroller.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
#ifndef REFLOWCONTROLLER_H
#define REFLOWCONTROLLER_H
#include <string>
#include <iostream>
#include <sstream>
#include <string>
#include <QRegExp>
#include <QObject>
#include <QStringList>
#include <QVector>
#include <fstream>
#include "uart.h"
using namespace std;
class ReflowController : public QObject
{
Q_OBJECT
public:
/**
* @brief MAX_SIZE_TEMP_LIST maximum number of temps to memorized. i.e the maximum item inside QVector<double> _temps/_times.
*/
static int MAX_SIZE_TEMP_LIST;
ReflowController( QObject *parent = 0);
/**
* @brief openDevice open the given device, using SR232 and a specified baudrate.
* @param path device path to open (such as /dev/ttyUSB0 for linux or COM4 for Win)
* @return
*/
bool openDevice( string path );
/**
* @brief closeDevice close the opened deviced (Uart)
*/
void closeDevice();
/**
* @brief getUartDevice
* @return Pointer to the current Uart object.
*/
Uart* getUartDevice();
/**
* @brief exportCVS save datas (_temps an _times) to the specified file, with CVS format.
* @param path path to the file to save
* @param separator the separator for CVS format
*/
void exportCVS(string path, char separator);
/**
* @brief startLearning Ask the Reflowkit to start the learning process by sending the good command.
*/
void startLearning();
/**
* @brief checkUartDataReady Check if some Uart data are ready. If yes, then datas are stored inside _datas buffer, and the Uart is cleared.
*/
void checkUartDataReady();
/**
* @brief parseUart Parse the given data. Search for Config command and Temp command.
* @param data data to parse (list of commands)
*/
void parseUart(string data);
void setPhtTemp( int v );
void setPhtTime( int v );
void setPhtPwr( int v );
void setSoakTemp( int v );
void setSoakTime( int v );
void setSoakPwr( int v );
void setReflowTemp( int v );
void setReflowTime( int v );
void setReflowPwr( int v );
void setDwellTemp( int v );
void setDwellTime( int v );
void setDwellPwr( int v );
void setTempoffset( int v );
void setTempShow( int v );
int getPhtTemp( ) const;
int getPhtTime( ) const;
int getPhtPwr( ) const;
int getSoakTemp( ) const;
int getSoakTime( ) const;
int getSoakPwr( ) const;
int getReflowTemp( ) const;
int getReflowTime( ) const;
int getReflowPwr( ) const;
int getDwellTemp( ) const;
int getDwellTime( ) const;
int getDwellPwr( ) const;
int getTempoffset( ) const;
int getTempShow( ) const;
int getCurrentTemp();
QVector<double>* getTemps();
QVector<double>* getTimes();
void resetTimeTemps();
/**
* @brief addTemp add the given temp and time inside _temps and _times QVector.
* @param temp temperature to add.
* @param time time of the given temperature to add.
*/
void addTemp(double temp , double time);
/**
* @brief getDatas return a QStringList representing the few last uart command received
* @return
*/
QStringList* getDatas();
string state;
public slots:
/**
* @brief updateInformation send the "showall" command, so the reflowController can parse the configuration received
*/
void updateInformation();
private:
int _phttemp;
int _phttime;
int _phtpwr;
int _soaktemp;
int _soaktime;
int _soakpwr;
int _reflowtemp;
int _reflowtime;
int _reflowpwr;
int _dwelltemp;
int _dwelltime;
int _dwellpwr;
int _tempoffset;
int _tempshow;
int _currentTemp;
Uart* _uart;
static int MAX_DATAS_STORED;
QStringList* _datas;
QVector<double> _temps;
QVector<double> _times;
};
#endif // REFLOWCONTROLLER_H