Rev | Line | |
---|
[5407] | 1 | #ifndef THRIFTCLIENT_H
|
---|
| 2 | #define THRIFTCLIENT_H
|
---|
| 3 |
|
---|
| 4 | #include <string>
|
---|
| 5 | #include <map>
|
---|
[5452] | 6 | #include <QString>
|
---|
[5409] | 7 | #include <QThread>
|
---|
[5425] | 8 | #include <QMutex>
|
---|
[5407] | 9 |
|
---|
| 10 | #include <transport/TSocket.h>
|
---|
| 11 | #include <transport/TBufferTransports.h>
|
---|
| 12 | #include <protocol/TBinaryProtocol.h>
|
---|
| 13 |
|
---|
| 14 | #include "gen-cpp/RtnetData.h"
|
---|
| 15 |
|
---|
| 16 | using namespace com::gpssolutions::rtnet;
|
---|
| 17 |
|
---|
[5416] | 18 | namespace GnssCenter {
|
---|
[5446] | 19 | class t_monitor;
|
---|
[5416] | 20 | }
|
---|
| 21 |
|
---|
[5447] | 22 | namespace GnssCenter {
|
---|
| 23 |
|
---|
[5415] | 24 | class t_thriftResult {
|
---|
[5407] | 25 | public:
|
---|
[5415] | 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 | };
|
---|
| 41 |
|
---|
[5424] | 42 | class t_thriftHandler : public RtnetDataIf {
|
---|
[5415] | 43 | public:
|
---|
[5447] | 44 | t_thriftHandler(t_monitor* parent);
|
---|
[5424] | 45 | ~t_thriftHandler();
|
---|
[5407] | 46 | void startDataStream() {}
|
---|
[5416] | 47 | void registerRtnet(const RtnetInformation&) {}
|
---|
| 48 | void handleZDAmb(const std::vector<ZDAmb>&) {}
|
---|
| 49 | void handleDDAmbresBaselines(const std::vector<DDAmbresBaseline>&) {}
|
---|
[5407] | 50 | void handleSatelliteXYZ(const std::vector<SatelliteXYZ>& svXYZList);
|
---|
| 51 | void handleStationInfo(const std::vector<StationInfo>& stationList);
|
---|
[5416] | 52 | void handleStationAuxInfo(const std::vector<StationAuxInfo>&) {}
|
---|
| 53 | void handleDGPSCorr(const std::vector<DGPSCorr>&) {}
|
---|
| 54 | void handleSatelliteClock(const std::vector<SatelliteClock>&) {}
|
---|
[5407] | 55 | void handleEpochResults(const RtnetEpoch& epoch);
|
---|
| 56 | private:
|
---|
| 57 | class t_stationCrd {
|
---|
| 58 | public:
|
---|
| 59 | double _x;
|
---|
| 60 | double _y;
|
---|
| 61 | double _z;
|
---|
| 62 | };
|
---|
[5447] | 63 | t_monitor* _parent;
|
---|
[5407] | 64 | std::map<std::string, t_stationCrd> _stationCrd;
|
---|
| 65 | };
|
---|
| 66 |
|
---|
[5424] | 67 | class t_thriftClient : public QThread {
|
---|
| 68 | public:
|
---|
[5452] | 69 | t_thriftClient(t_monitor* parent, const QString& host, int port);
|
---|
[5424] | 70 | ~t_thriftClient();
|
---|
| 71 | virtual void run();
|
---|
[5431] | 72 | void stop() {
|
---|
[5425] | 73 | QMutexLocker locker(&_mutex);
|
---|
| 74 | _stop = true;
|
---|
| 75 | }
|
---|
[5424] | 76 |
|
---|
| 77 | private:
|
---|
[5452] | 78 | QMutex _mutex;
|
---|
| 79 | std::string _host;
|
---|
| 80 | int _port;
|
---|
| 81 | t_monitor* _parent;
|
---|
| 82 | bool _stop;
|
---|
[5424] | 83 | };
|
---|
| 84 |
|
---|
[5447] | 85 | } // namespace GnssCenter
|
---|
| 86 |
|
---|
[5407] | 87 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.