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