Line | |
---|
1 | #ifndef THRIFTCLIENT_H
|
---|
2 | #define THRIFTCLIENT_H
|
---|
3 |
|
---|
4 | #include <string>
|
---|
5 | #include <map>
|
---|
6 | #include <QThread>
|
---|
7 | #include <QMutex>
|
---|
8 |
|
---|
9 | #include <transport/TSocket.h>
|
---|
10 | #include <transport/TBufferTransports.h>
|
---|
11 | #include <protocol/TBinaryProtocol.h>
|
---|
12 |
|
---|
13 | #include "gen-cpp/RtnetData.h"
|
---|
14 |
|
---|
15 | using namespace com::gpssolutions::rtnet;
|
---|
16 |
|
---|
17 | namespace GnssCenter {
|
---|
18 | class t_monitor;
|
---|
19 | }
|
---|
20 |
|
---|
21 | namespace GnssCenter {
|
---|
22 |
|
---|
23 | class t_thriftResult {
|
---|
24 | public:
|
---|
25 | t_thriftResult() {
|
---|
26 | _nGPS = 0;
|
---|
27 | _nGLO = 0;
|
---|
28 | _x = 0.0;
|
---|
29 | _y = 0.0;
|
---|
30 | _z = 0.0;
|
---|
31 | }
|
---|
32 | ~t_thriftResult() {}
|
---|
33 | std::string _name;
|
---|
34 | int _nGPS;
|
---|
35 | int _nGLO;
|
---|
36 | double _x;
|
---|
37 | double _y;
|
---|
38 | double _z;
|
---|
39 | };
|
---|
40 |
|
---|
41 | class t_thriftHandler : public RtnetDataIf {
|
---|
42 | public:
|
---|
43 | t_thriftHandler(t_monitor* parent);
|
---|
44 | ~t_thriftHandler();
|
---|
45 | void startDataStream() {}
|
---|
46 | void registerRtnet(const RtnetInformation&) {}
|
---|
47 | void handleZDAmb(const std::vector<ZDAmb>&) {}
|
---|
48 | void handleDDAmbresBaselines(const std::vector<DDAmbresBaseline>&) {}
|
---|
49 | void handleSatelliteXYZ(const std::vector<SatelliteXYZ>& svXYZList);
|
---|
50 | void handleStationInfo(const std::vector<StationInfo>& stationList);
|
---|
51 | void handleStationAuxInfo(const std::vector<StationAuxInfo>&) {}
|
---|
52 | void handleDGPSCorr(const std::vector<DGPSCorr>&) {}
|
---|
53 | void handleSatelliteClock(const std::vector<SatelliteClock>&) {}
|
---|
54 | void handleEpochResults(const RtnetEpoch& epoch);
|
---|
55 | private:
|
---|
56 | class t_stationCrd {
|
---|
57 | public:
|
---|
58 | double _x;
|
---|
59 | double _y;
|
---|
60 | double _z;
|
---|
61 | };
|
---|
62 | t_monitor* _parent;
|
---|
63 | std::map<std::string, t_stationCrd> _stationCrd;
|
---|
64 | };
|
---|
65 |
|
---|
66 | class t_thriftClient : public QThread {
|
---|
67 | public:
|
---|
68 | t_thriftClient(t_monitor* parent);
|
---|
69 | ~t_thriftClient();
|
---|
70 | virtual void run();
|
---|
71 | void stop() {
|
---|
72 | QMutexLocker locker(&_mutex);
|
---|
73 | _stop = true;
|
---|
74 | }
|
---|
75 |
|
---|
76 | private:
|
---|
77 | QMutex _mutex;
|
---|
78 | t_monitor* _parent;
|
---|
79 | bool _stop;
|
---|
80 | };
|
---|
81 |
|
---|
82 | } // namespace GnssCenter
|
---|
83 |
|
---|
84 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.