source: ntrip/trunk/GnssCenter/monitor/thriftclient.h@ 5496

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