1 |
|
---|
2 | /* -------------------------------------------------------------------------
|
---|
3 | * RTNet GUI
|
---|
4 | * -------------------------------------------------------------------------
|
---|
5 | *
|
---|
6 | * Class: t_map_stations
|
---|
7 | *
|
---|
8 | * Purpose: Plot map of stations/satellites
|
---|
9 | *
|
---|
10 | * Author: L. Mervart
|
---|
11 | *
|
---|
12 | * Created: 05-Jan-2013
|
---|
13 | *
|
---|
14 | * Changes:
|
---|
15 | *
|
---|
16 | * -----------------------------------------------------------------------*/
|
---|
17 |
|
---|
18 | #include <iostream>
|
---|
19 | #include <QtSvg>
|
---|
20 |
|
---|
21 | #include <qwt_symbol.h>
|
---|
22 | #include <qwt_plot.h>
|
---|
23 | #include <qwt_plot_svgitem.h>
|
---|
24 | #include <qwt_plot_curve.h>
|
---|
25 | #include <qwt_plot_marker.h>
|
---|
26 | #include <qwt_plot_canvas.h>
|
---|
27 | #include <qwt_plot_zoomer.h>
|
---|
28 | #include <qwt_plot_renderer.h>
|
---|
29 |
|
---|
30 | #include "map_stations.h"
|
---|
31 | #include "worldplot.h"
|
---|
32 | #include "thriftclient.h"
|
---|
33 |
|
---|
34 | using namespace std;
|
---|
35 | using namespace GnssCenter;
|
---|
36 |
|
---|
37 | Q_EXPORT_PLUGIN2(gnsscenter_map_stations, GnssCenter::t_map_stationsFactory)
|
---|
38 |
|
---|
39 | // Constructor
|
---|
40 | /////////////////////////////////////////////////////////////////////////////
|
---|
41 | t_map_stations::t_map_stations() : QMainWindow() {
|
---|
42 |
|
---|
43 | // World Plot
|
---|
44 | // ----------
|
---|
45 | _plot = new t_worldPlot();
|
---|
46 | setCentralWidget(_plot);
|
---|
47 |
|
---|
48 | // Tool Bar
|
---|
49 | // --------
|
---|
50 | QToolBar* toolBar = new QToolBar("t_map_stations_ToolBar");
|
---|
51 | addToolBar(Qt::BottomToolBarArea, toolBar);
|
---|
52 | QAction* actStartThrift = new QAction("Start Thrift", 0);
|
---|
53 | toolBar->addAction(actStartThrift);
|
---|
54 | connect(actStartThrift, SIGNAL(triggered()), this, SLOT(slotStartThrift()));
|
---|
55 |
|
---|
56 | // Thrift Client;
|
---|
57 | // --------------
|
---|
58 | _thriftClient = 0;
|
---|
59 | }
|
---|
60 |
|
---|
61 | // Destructor
|
---|
62 | /////////////////////////////////////////////////////////////////////////////
|
---|
63 | t_map_stations::~t_map_stations() {
|
---|
64 | if (_thriftClient) {
|
---|
65 | _thriftClient->stop();
|
---|
66 | }
|
---|
67 | }
|
---|
68 |
|
---|
69 | //
|
---|
70 | /////////////////////////////////////////////////////////////////////////////
|
---|
71 | void t_map_stations::slotStartThrift() {
|
---|
72 | if (!_thriftClient) {
|
---|
73 | _thriftClient = new t_thriftClient(this);
|
---|
74 | _thriftClient->start();
|
---|
75 | }
|
---|
76 | //// beg test
|
---|
77 | else {
|
---|
78 | _plot->slotNewPoint("AAAA", 50.0, 15.0);
|
---|
79 | }
|
---|
80 | //// end test
|
---|
81 | }
|
---|
82 |
|
---|
83 | //
|
---|
84 | /////////////////////////////////////////////////////////////////////////////
|
---|
85 | void t_map_stations::slotNewThriftResult(t_thriftResult* result) {
|
---|
86 | cout << result->_name << ' '
|
---|
87 | << result->_nGPS << ' ' << result->_nGLO << ' '
|
---|
88 | << result->_x << ' ' << result->_y << ' ' << result->_z << endl;
|
---|
89 | }
|
---|