##// END OF EJS Templates
Multi-graph test is ready, just need to implement synchronization...
jeandet -
r1371:ae26ed165253
parent child
Show More
@@ -1,1 +1,1
1 Subproject commit 54e194b00c35fb5f769eda61234c1b4dd6de3a43
1 Subproject commit 79fb0ced05d752f6e9260afddb38cc0d50e80c6d
@@ -19,7 +19,8
19 19 template <int GraphCount=2>
20 20 std::tuple< std::unique_ptr<VisualizationZoneWidget>,
21 21 std::vector<std::shared_ptr<Variable>>,
22 std::vector<VisualizationGraphWidget*> >
22 std::vector<VisualizationGraphWidget*>,
23 DateTimeRange>
23 24 build_multi_graph_test()
24 25 {
25 26 auto w = std::make_unique<VisualizationZoneWidget>();
@@ -39,8 +40,7 build_multi_graph_test()
39 40 graphs.push_back(graph);
40 41 w->addGraph(graph);
41 42 }
42 auto cent = center(w.get());
43 return {std::move(w), variables, graphs};
43 return {std::move(w), variables, graphs, range};
44 44 }
45 45
46 46
@@ -52,34 +52,42 public:
52 52 private slots:
53 53 void scrolls_left_with_mouse()
54 54 {
55 auto [w, variables, graphs] = build_multi_graph_test<3>();
55 auto [w, variables, graphs, range] = build_multi_graph_test<3>();
56 auto var = variables.front();
57 auto graph = graphs.front();
56 58 QVERIFY(prepare_gui_test(w.get()));
59 for (auto i = 0; i < 100; i++) {
60 scroll_graph(graph, -200);
61 waitForVar(var);
62 }
63 auto r = variables.back()->range();
57 64
58 65 /*
59 66 * Scrolling to the left implies going back in time
60 67 * Scroll only implies keeping the same delta T -> shit only transformation
61 68 */
62 //QVERIFY(r.m_TEnd < range.m_TEnd);
63 //QVERIFY(SciQLop::numeric::almost_equal<double>(r.delta(),range.delta(),1));
69 QVERIFY(r.m_TEnd < range.m_TEnd);
70 QVERIFY(SciQLop::numeric::almost_equal<double>(r.delta(),range.delta(),1));
64 71 }
65 72
66 73 void scrolls_right_with_mouse()
67 74 {
68 auto [w, variables, graphs] = build_multi_graph_test<3>();
75 auto [w, variables, graphs, range] = build_multi_graph_test<3>();
76 auto var = variables.front();
77 auto graph = graphs.front();
69 78 QVERIFY(prepare_gui_test(w.get()));
70 // w->show();
71 // for(int i=0;i<10000;i++)
72 // {
73 // QThread::usleep(1000);
74 // qApp->processEvents();
75 // }
79 for (auto i = 0; i < 100; i++) {
80 scroll_graph(graph, 200);
81 waitForVar(var);
82 }
83 auto r = variables.back()->range();
76 84
77 85 /*
78 86 * Scrolling to the right implies going forward in time
79 87 * Scroll only implies keeping the same delta T -> shit only transformation
80 88 */
81 //QVERIFY(r.m_TEnd > range.m_TEnd);
82 //QVERIFY(SciQLop::numeric::almost_equal<double>(r.delta(),range.delta(),1));
89 QVERIFY(r.m_TEnd > range.m_TEnd);
90 QVERIFY(SciQLop::numeric::almost_equal<double>(r.delta(),range.delta(),1));
83 91 }
84 92 };
85 93
@@ -28,7 +28,6 build_simple_graph_test()
28 28 while (!isReady(var)) QCoreApplication::processEvents();
29 29 w->addVariable(var, range);
30 30 while (!isReady(var)) QCoreApplication::processEvents();
31 auto cent = center(w.get());
32 31 return {std::move(w), var, range};
33 32 }
34 33
General Comments 0
You need to be logged in to leave comments. Login now