77 lines
1.2 KiB
C++
77 lines
1.2 KiB
C++
#ifndef XLRUCHARTCONFIG_H
|
|
#define XLRUCHARTCONFIG_H
|
|
|
|
#include <QString>
|
|
#include <QVector>
|
|
#include <QSettings>
|
|
|
|
const QString fileCfg = "GrifoXLruMonitor.ini";
|
|
|
|
typedef enum
|
|
{
|
|
type_s_temperature,
|
|
type_s_current,
|
|
type_s_voltage
|
|
}type_series_t;
|
|
|
|
struct sensor_config_t
|
|
{
|
|
QString name;
|
|
QString label_sensor;
|
|
int limit;
|
|
type_series_t type;
|
|
int fpga_ch;
|
|
QString fpga_address;
|
|
};
|
|
|
|
struct graph_config_t
|
|
{
|
|
QString name;
|
|
int num_series;
|
|
|
|
QList<sensor_config_t*> list_sensors_config;
|
|
};
|
|
|
|
class XlruChartConfig
|
|
{
|
|
public:
|
|
static XlruChartConfig *instance();
|
|
|
|
bool loadSettings();
|
|
|
|
bool valid_config;
|
|
|
|
QList<graph_config_t*> list_graph_config;
|
|
|
|
bool getReportEnabled();
|
|
|
|
void setReportEnabled(bool _enabled);
|
|
|
|
int getTempDefaultLimit();
|
|
int getCurrDefaultLimit();
|
|
int getVoltDefaultLimit();
|
|
|
|
bool getRemoveLimit();
|
|
void setRemoveLimit(bool _enabled);
|
|
|
|
bool checkFpga(int idx, QStringList list_fpga);
|
|
|
|
private:
|
|
static XlruChartConfig* s_instance;
|
|
XlruChartConfig();
|
|
|
|
int num_graphs;
|
|
|
|
bool report_enabled;
|
|
|
|
int temp_default_limit;
|
|
|
|
int curr_default_limit;
|
|
|
|
int volt_default_limit;
|
|
|
|
bool remove_limit;
|
|
};
|
|
|
|
#endif // XLRUCHARTCONFIG_H
|