Class representing summary information of data.
More...
#include <datasummary.h>
|
| void | temperatureChanged (double temperature) |
| | Signal emitted when the temperature changes.
|
| |
| void | mvChanged (double mv) |
| | Signal emitted when the MV value changes.
|
| |
| void | svChanged (double sv) |
| | Signal emitted when the SV value changes.
|
| |
| void | logMsgWithColor (QString msg, QColor color) |
| | Signal emitted for send log to mainwindow.
|
| |
|
| | DataSummary (Communication *com) |
| | Constructor for DataSummary class.
|
| |
| double | getTemperature () const |
| | Gets the current temperature.
|
| |
| double | getMV () const |
| | Gets the current MV value.
|
| |
| double | getMVUpper () const |
| | Gets the current MV upper value.
|
| |
| double | getMVLower () const |
| | Gets the current MV lower value.
|
| |
| double | getSV () const |
| | Gets the current SV value.
|
| |
| QString | getFileName () const |
| | Gets the file name for saving data.
|
| |
| QString | getFilePath () const |
| | Gets the file path for saving data.
|
| |
| QTimer * | getLogTimer () const |
| | Gets the Qtimer for saving data.
|
| |
| bool | generateSaveFile () |
| | Generates and saves the data to file.
|
| |
| void | writeData () |
| | Writes data to file.
|
| |
|
void | logingStart () |
| | Starts logging.
|
| |
|
void | logingStop () |
| | Stops logging.
|
| |
| void | SetIntervalLog (int interval) |
| | Sets the interval for logging data.
|
| |
|
bool | isTimerLogRunning () const |
| | Check if the timer for logging data is currently running.
|
| |
Class representing summary information of data.
◆ DataSummary()
Constructor for DataSummary class.
- Parameters
-
Initializes the object and sets up the file path and name for saving data. Also connects the object to the Communication signals to update the stored temperature, setpoint value, and manipulated variable. Starts a timer for logging data.
- Parameters
-
◆ generateSaveFile()
| bool DataSummary::generateSaveFile |
( |
| ) |
|
Generates and saves the data to file.
Generate a new save file if it does not already exist.
- Returns
- true if the file was saved successfully, false otherwise.
-
true if the file is successfully generated, false otherwise.
◆ getFileName()
| QString DataSummary::getFileName |
( |
| ) |
const |
Gets the file name for saving data.
- Returns
- The file name.
◆ getFilePath()
| QString DataSummary::getFilePath |
( |
| ) |
const |
Gets the file path for saving data.
- Returns
- The file path.
◆ getLogTimer()
| QTimer * DataSummary::getLogTimer |
( |
| ) |
const |
Gets the Qtimer for saving data.
- Returns
- The Qtimer pointer.
◆ getMV()
| double DataSummary::getMV |
( |
| ) |
const |
Gets the current MV value.
- Returns
- The MV value.
◆ getMVLower()
| double DataSummary::getMVLower |
( |
| ) |
const |
Gets the current MV lower value.
- Returns
- The MV lower value.
◆ getMVUpper()
| double DataSummary::getMVUpper |
( |
| ) |
const |
Gets the current MV upper value.
- Returns
- The MV upper value.
◆ getSV()
| double DataSummary::getSV |
( |
| ) |
const |
Gets the current SV value.
- Returns
- The SV value.
◆ getTemperature()
| double DataSummary::getTemperature |
( |
| ) |
const |
Gets the current temperature.
- Returns
- The temperature value.
◆ logMsgWithColor
| void DataSummary::logMsgWithColor |
( |
QString |
msg, |
|
|
QColor |
color |
|
) |
| |
|
signal |
Signal emitted for send log to mainwindow.
- Parameters
-
| msg | The log. |
| color | text color |
◆ mvChanged
| void DataSummary::mvChanged |
( |
double |
mv | ) |
|
|
signal |
Signal emitted when the MV value changes.
- Parameters
-
◆ SetIntervalLog()
| void DataSummary::SetIntervalLog |
( |
int |
interval | ) |
|
|
inline |
Sets the interval for logging data.
- Parameters
-
| interval | The interval in milliseconds. |
◆ svChanged
| void DataSummary::svChanged |
( |
double |
sv | ) |
|
|
signal |
Signal emitted when the SV value changes.
- Parameters
-
◆ temperatureChanged
| void DataSummary::temperatureChanged |
( |
double |
temperature | ) |
|
|
signal |
Signal emitted when the temperature changes.
- Parameters
-
| temperature | The new temperature value. |
◆ writeData()
| void DataSummary::writeData |
( |
| ) |
|
Writes data to file.
Writes temperature, MV and SV values to the data file. The data is saved in the following format: <date and time>\t<seconds since epoch>\t<temperature>\t<MV>\t<SV>
The method checks whether the saving of data has been enabled. If not, the method exits. The data is written to a file specified by fileName_. If the file does not exist, a new file is created by calling generateSaveFile(). The temperature, MV and SV values are retrieved by calling getTemperature(), getMV() and getSV() respectively. The date and time of writing the data is obtained using QDateTime::currentDateTime() method. The data is written in the text format.
- Returns
- void
The documentation for this class was generated from the following files: