forked from hundlab/LongQt-model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeasuremanager.h
65 lines (55 loc) · 1.95 KB
/
measuremanager.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef MEASUREMANAGER_H
#define MEASUREMANAGER_H
#include "measure.h"
#include "measurewave.h"
#include "cell.h"
#include <map>
#include <set>
#include <functional>
#include <string>
#include <memory>
#include <QFile>
class MeasureManager {
public:
MeasureManager(shared_ptr<Cell> cell);
virtual ~MeasureManager();
virtual MeasureManager* clone();
virtual bool writeMVarsFile(QXmlStreamWriter& xml);
virtual bool readMvarsFile(QXmlStreamReader& xml);
shared_ptr<Cell> cell();
void cell(shared_ptr<Cell> cell);
map<string,set<string>> selection();
void selection(map<string,set<string>> sel);
double percrepol();
void percrepol(double percrepol);
shared_ptr<Measure> getMeasure(string varname, set<string> selection);
virtual void addMeasure(string var,set<string> selection = {});
virtual void removeMeasure(string var);
virtual void setupMeasures(string filename);
virtual void measure(double time);
virtual void write(QFile* file = 0);
virtual void writeLast(string filename);
virtual void clear();
virtual void close();
virtual void resetMeasures();
const map<string,string> varsMeas = {
{"vOld","MeasureWave"},
{"caI","MeasureWave"}
};
const map<string,function<Measure*(set<string> selection)>> varMeasCreator =
{{"MeasureWave", [this](set<string> selection)
{return (Measure*)new MeasureWave(selection,this->__percrepol);}}
};
protected:
MeasureManager(const MeasureManager&);
map<string,set<string>> variableSelection;
private:
void removeBad();
void copy(const MeasureManager& other);
shared_ptr<Cell> __cell = 0;
string last = "";
double __percrepol = 50;
unique_ptr<QFile> ofile;
map<string,shared_ptr<Measure>> measures;
};
#endif