-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparameter.h
35 lines (28 loc) · 996 Bytes
/
parameter.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
#ifndef PARAMETER_H
#define PARAMETER_H
#include <QString>
#include <QVariant>
#include "sqlhandler/serialization.h"
class Parameter
{
public:
Parameter(const QString& name, const QString& unit, const QString& description, int ID, int parentID, const parameter_min_max_val_serial_entry &entry);
bool isValidValue(const QString &valueVar);
bool setValue(const QString &valueVar);
int isNotInRange(const parameter_value& newval);
bool isInRange() { return isNotInRange(value) == 0; }
static QString getValueDisplayString(parameter_value value, parameter_type type, int precision = 10);
static QDate valueAsQDate(parameter_value value);
static void clipTimeValue(parameter_value &value);
static parameter_type parseType(QString &string);
QString name;
QString unit;
QString description;
int ID;
int parentID;
parameter_type type;
parameter_value value;
parameter_value min;
parameter_value max;
};
#endif // PARAMETER_H