-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFunctionEvaluator.hh
54 lines (40 loc) · 1.02 KB
/
FunctionEvaluator.hh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef FUNCTIONEVALUATOR_H
#define FUNCTIONEVALUATOR_H
#include <QObject>
#include <QThread>
#include <QString>
#include <QVector>
#include <QtScript>
class FunctionEvaluator : public QThread
{
Q_OBJECT
public:
FunctionEvaluator(QString input);
void run();
inline double getSum() { return sum; }
inline double getAvg() { return avg; }
inline double getMin() { return min; }
inline double getMax() { return max; }
inline double getCnt() { return cnt; }
inline double getMinAtDN() { return min_at; }
inline double getMaxAtDN() { return max_at; }
public slots:
void setData(QVector<unsigned long long> *data);
void setProperty(const QString name, const double value);
signals:
void runCompleted();
private:
void reset();
void error();
QString function;
long double cnt;
long double sum;
double avg;
double min;
double max;
int min_at;
int max_at;
QScriptEngine engine;
QVector<unsigned long long> *data;
};
#endif // FUNCTIONEVALUATOR_H