-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTSPlot.cpp
More file actions
98 lines (89 loc) · 2.54 KB
/
TSPlot.cpp
File metadata and controls
98 lines (89 loc) · 2.54 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* File: TSPlot.cpp
* Author: heshan
*
* Created on April 1, 2018, 9:33 PM
*/
#include <fstream>
#include <sstream>
#include <iomanip>
#include "TSPlot.h"
#include "TimeSeries.h"
bool TSPlot::OnInit() {
TSPlotFrame *frame = new TSPlotFrame();
// wxVector<wxString> labels;
// float val = 0;
//
// std::stringstream stringStream;
// for(int i = 0; i < 800; i+=100){
// stringStream.str(std::string());
// stringStream << std::fixed << std::setprecision(2) << val;
// labels.push_back(stringStream.str());
// for (int j = 0; j < 99; j++) {
// labels.push_back("");
// val+=0.5;
// }
// }
//
//
//
// wxVector<wxDouble> points1;
// std::string fileName = "datasets/hr.txt";
// std::string line;
// std::ifstream file (fileName);
// if (file.is_open()) {
// int i = 0;
// while ( getline (file,line) ) {
// i++;
// points1.push_back(std::stod(line));
// if (i == 800) break;
// }
// file.close();
// }
// else std::cout << "Unable to open file '"<<fileName<<"'";
//
// wxVector<wxDouble> points2;
// fileName = "datasets/hr2.txt";
// std::string line2;
// std::ifstream file2 (fileName);
// if (file2.is_open()) {
// int i = 0;
// while ( getline (file2,line2) ) {
// i++;
// points2.push_back(std::stod(line2));
// if (i == 800) break;
// }
// file2.close();
// }
// else std::cout << "Unable to open file '"<<fileName<<"'";
// wxVector<wxDouble> points1;
// for(int i = 0; i < 70; i += 7) {
// points1.push_back(3);
// points1.push_back(-2.5);
// points1.push_back(-1.2);
// points1.push_back(3);
// points1.push_back(6);
// points1.push_back(5);
// points1.push_back(1);
// }
//
// wxVector<wxDouble> points2;
// for(int i = 0; i < 70; i += 7) {
// points2.push_back(1);
// points2.push_back(-1.33);
// points2.push_back(2.5);
// points2.push_back(7);
// points2.push_back(3);
// points2.push_back(-1.8);
// points2.push_back(0.4);
// }
wxVector<wxString> labels;
wxVector<wxDouble> points1;
wxVector<wxDouble> points2;
frame->loadTimeSeriesData(labels, "", points1, "", points2);
frame->loadTimeSeriesData1(labels, "", points1);
frame->loadTimeSeriesData2(labels,"", points2);
frame->loadWidgets();
frame->Show(true);
return true;
}