74 lines
1.4 KiB
C++
74 lines
1.4 KiB
C++
#ifndef XLRUEXPORTDATACLASS_H
|
|
#define XLRUEXPORTDATACLASS_H
|
|
|
|
#include <QString>
|
|
#include <QList>
|
|
#include <QDateTime>
|
|
#include <QFileInfo>
|
|
#include <QTextStream>
|
|
|
|
#define USE_TABLE
|
|
|
|
typedef struct
|
|
{
|
|
QString name;
|
|
double value;
|
|
bool present;
|
|
} sensor_report;
|
|
|
|
|
|
class XlruReportClass
|
|
{
|
|
public:
|
|
XlruReportClass();
|
|
~XlruReportClass();
|
|
|
|
//list of sensors present into report file
|
|
//QList<QString> list_sensors;
|
|
//QList<double> list_value;
|
|
|
|
QVector<sensor_report> list_sensors;
|
|
|
|
//create a new report file with a new header
|
|
QString generateNewFile(QString _header);
|
|
|
|
//save string into file
|
|
bool saveString(QString _value);
|
|
|
|
//save row with all value for the sensors present into list
|
|
bool saveValue();
|
|
|
|
//add new sensor column
|
|
bool addSensorCol(QString _col);
|
|
|
|
//add value for sensor
|
|
bool addValueCol(QString _col, double value);
|
|
|
|
//write column header into the first row of file
|
|
bool saveHeader();
|
|
|
|
//close file
|
|
bool closeFile();
|
|
|
|
//found sensor with _col
|
|
int findSensor(QString _col);
|
|
|
|
protected:
|
|
//complete file path for report file
|
|
QString file_path;
|
|
|
|
//file name for report file
|
|
QString file_name;
|
|
|
|
//generate new name file from DateTime
|
|
QString newNameFile(QString _header);
|
|
|
|
//file report
|
|
QFile file;
|
|
|
|
bool header_saved;
|
|
|
|
};
|
|
|
|
#endif // XLRUEXPORTDATACLASS_H
|