##// 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 template <int GraphCount=2>
19 template <int GraphCount=2>
20 std::tuple< std::unique_ptr<VisualizationZoneWidget>,
20 std::tuple< std::unique_ptr<VisualizationZoneWidget>,
21 std::vector<std::shared_ptr<Variable>>,
21 std::vector<std::shared_ptr<Variable>>,
22 std::vector<VisualizationGraphWidget*> >
22 std::vector<VisualizationGraphWidget*>,
23 DateTimeRange>
23 build_multi_graph_test()
24 build_multi_graph_test()
24 {
25 {
25 auto w = std::make_unique<VisualizationZoneWidget>();
26 auto w = std::make_unique<VisualizationZoneWidget>();
@@ -39,8 +40,7 build_multi_graph_test()
39 graphs.push_back(graph);
40 graphs.push_back(graph);
40 w->addGraph(graph);
41 w->addGraph(graph);
41 }
42 }
42 auto cent = center(w.get());
43 return {std::move(w), variables, graphs, range};
43 return {std::move(w), variables, graphs};
44 }
44 }
45
45
46
46
@@ -52,34 +52,42 public:
52 private slots:
52 private slots:
53 void scrolls_left_with_mouse()
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 QVERIFY(prepare_gui_test(w.get()));
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 * Scrolling to the left implies going back in time
66 * Scrolling to the left implies going back in time
60 * Scroll only implies keeping the same delta T -> shit only transformation
67 * Scroll only implies keeping the same delta T -> shit only transformation
61 */
68 */
62 //QVERIFY(r.m_TEnd < range.m_TEnd);
69 QVERIFY(r.m_TEnd < range.m_TEnd);
63 //QVERIFY(SciQLop::numeric::almost_equal<double>(r.delta(),range.delta(),1));
70 QVERIFY(SciQLop::numeric::almost_equal<double>(r.delta(),range.delta(),1));
64 }
71 }
65
72
66 void scrolls_right_with_mouse()
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 QVERIFY(prepare_gui_test(w.get()));
78 QVERIFY(prepare_gui_test(w.get()));
70 // w->show();
79 for (auto i = 0; i < 100; i++) {
71 // for(int i=0;i<10000;i++)
80 scroll_graph(graph, 200);
72 // {
81 waitForVar(var);
73 // QThread::usleep(1000);
82 }
74 // qApp->processEvents();
83 auto r = variables.back()->range();
75 // }
76
84
77 /*
85 /*
78 * Scrolling to the right implies going forward in time
86 * Scrolling to the right implies going forward in time
79 * Scroll only implies keeping the same delta T -> shit only transformation
87 * Scroll only implies keeping the same delta T -> shit only transformation
80 */
88 */
81 //QVERIFY(r.m_TEnd > range.m_TEnd);
89 QVERIFY(r.m_TEnd > range.m_TEnd);
82 //QVERIFY(SciQLop::numeric::almost_equal<double>(r.delta(),range.delta(),1));
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 while (!isReady(var)) QCoreApplication::processEvents();
28 while (!isReady(var)) QCoreApplication::processEvents();
29 w->addVariable(var, range);
29 w->addVariable(var, range);
30 while (!isReady(var)) QCoreApplication::processEvents();
30 while (!isReady(var)) QCoreApplication::processEvents();
31 auto cent = center(w.get());
32 return {std::move(w), var, range};
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