OmronPID
Loading...
Searching...
No Matches
datasummary.h
Go to the documentation of this file.
1
5#ifndef DATASUMMARY_H
6#define DATASUMMARY_H
7
8#include "communication.h"
9#include <QObject>
10
11class Communication;
12
16class DataSummary : public QObject
17{
18 Q_OBJECT
19
20public:
25 explicit DataSummary(Communication* com);
26
31 double getTemperature() const;
32
37 double getMV() const;
38
43 double getMVUpper() const;
44
49 double getMVLower() const;
50
51
56 double getSV() const;
57
58
63 QString getFileName() const;
64
69 QString getFilePath() const;
70
75 QTimer* getLogTimer() const;
76
77
82 bool generateSaveFile();
83
87 void writeData();
88
92 void logingStart();
93
97 void logingStop();
98
103 void SetIntervalLog(int interval){setIntervalLog(interval);}
104
108 bool isTimerLogRunning() const;
109
110signals:
115 void temperatureChanged(double temperature);
116
121 void mvChanged(double mv);
122
127 void svChanged(double sv);
128
134 void logMsgWithColor(QString msg, QColor color);
135
136private slots:
141 void setTemperature(double temperature);
142
147 void setMV(double mv);
148
153 void setMVUpper(double mvUpper);
154
159 void setMVLower(double mvLower);
160
165 void setSV(double sv);
166
171 void setSave(bool save);
172
177 void setIntervalLog(int interval);
178
183 void setFilePath(QString path);
184
185private:
187 const QString desktopPath_{QStandardPaths::locate(QStandardPaths::DesktopLocation, QString(), QStandardPaths::LocateDirectory)};
188
190 const QString dataPath2_{desktopPath_ + "Temp_Record"};
191
193 const QString dataPath_{"Z:/triplet/Temp_Record"};
194
196 Communication *com_{nullptr};
197
199 double temperature_{};
200
202 double mv_{};
203
205 double mvUpper_{};
206
208 double mvLower_{};
209
211 double sv_{};
212
214 QString fileName_{};
215
217 QString filePath_{};
218
220 bool save_{true};
221
223 QTimer *logTimer_{nullptr};
224
226 int intervalLog_{10 * 1000};
227};
228
229#endif // DATASUMMARY_H
The Communication class provides an interface for communicating with he E5CC temperature controller v...
Definition: communication.h:19
Class representing summary information of data.
Definition: datasummary.h:17
void temperatureChanged(double temperature)
Signal emitted when the temperature changes.
QString getFilePath() const
Gets the file path for saving data.
Definition: datasummary.cpp:38
double getTemperature() const
Gets the current temperature.
Definition: datasummary.cpp:32
double getMVUpper() const
Gets the current MV upper value.
Definition: datasummary.cpp:34
void SetIntervalLog(int interval)
Sets the interval for logging data.
Definition: datasummary.h:103
QString getFileName() const
Gets the file name for saving data.
Definition: datasummary.cpp:37
void writeData()
Writes data to file.
Definition: datasummary.cpp:110
bool isTimerLogRunning() const
Check if the timer for logging data is currently running.
Definition: datasummary.cpp:48
bool generateSaveFile()
Generates and saves the data to file.
Definition: datasummary.cpp:78
void logingStop()
Stops logging.
Definition: datasummary.cpp:139
double getMV() const
Gets the current MV value.
Definition: datasummary.cpp:33
double getMVLower() const
Gets the current MV lower value.
Definition: datasummary.cpp:35
void svChanged(double sv)
Signal emitted when the SV value changes.
QTimer * getLogTimer() const
Gets the Qtimer for saving data.
Definition: datasummary.cpp:39
double getSV() const
Gets the current SV value.
Definition: datasummary.cpp:36
void logMsgWithColor(QString msg, QColor color)
Signal emitted for send log to mainwindow.
void mvChanged(double mv)
Signal emitted when the MV value changes.
void logingStart()
Starts logging.
Definition: datasummary.cpp:134