JASPL  0.2
Just Another Signal Processing Library
jchart.cpp
1 #include "../JASPL/jChart/jchart.h"
2 
3 static unsigned long x=123456789, y=362436069, z=521288629;
4 
5 unsigned long xorshf96(void) { //period 2^96-1
6 unsigned long t;
7  x ^= x << 16;
8  x ^= x >> 5;
9  x ^= x << 1;
10 
11  t = x;
12  x = y;
13  y = z;
14  z = t ^ x ^ y;
15 
16  return z;
17 }
18 
19 void JChart::UnitTest() {
20 
21  std::vector<int> time_series2;
22 
23  for (int i =0; i < 500; i++) {
24  int b = xorshf96();
25  b = b % 20 + 1;
26  time_series2.push_back(b);
27  }
28 
29  Plot( time_series2 );
30 }
31 
32 JChart::JChart(QWidget *parent) : QMainWindow( parent ) {
33 
34  time_series = new QLineSeries();
35  x_axis = new QValueAxis;
36  y_axis = new QValueAxis;
37  chart = new QChart();
38 
39  chart->addSeries(time_series);
40  chart->legend()->hide();
41 
42  chart->createDefaultAxes();
43  chart->setAxisX(x_axis, time_series);
44  chart->setAxisY(y_axis, time_series);
45 
46  chartView = new QChartView(chart);
47  chartView->setRenderHint(QPainter::Antialiasing);
48 
49  setCentralWidget(chartView);
50  resize(1280, 720);
51  show();
52 
53 }
54 
55 void JChart::UpdateSignal() {
56  UnitTest();
57 }
58 
59 JChart::~JChart() {
60 
61 }