-
Notifications
You must be signed in to change notification settings - Fork 0
/
experiment.cpp
37 lines (32 loc) · 1.04 KB
/
experiment.cpp
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
#include "experiment.h"
Experiment::Experiment() : series(), data()
{
startTime = QDateTime::currentDateTime();
}
std::vector<std::pair<QString, QString>> Experiment::getParameters() {
auto list = std::vector<std::pair<QString, QString>>();
list.push_back(std::make_pair("Title", name));
list.push_back(std::make_pair("Description", description));
list.push_back(std::make_pair("Start time", startTime.toString()));
return list;
}
void Experiment::setParameter(QString name, QString value) {
if (name == "Title") {
this->name = value;
}
else if (name == "Description") {
this->description = value;
}
}
void Experiment::setData(std::vector<std::vector<float>> data) {
this->data = std::vector<std::vector<float>>();
for (ulong i=0; i<data.size(); i++) {
this->data.push_back(std::vector<float>());
for (ulong j=0; j<data[i].size(); j++) {
this->data[i].push_back(data[i][j]);
}
}
}
std::vector<std::vector<float>> Experiment::getData() {
return data;
}