Changeset 5415 in ntrip for trunk/GnssCenter


Ignore:
Timestamp:
Sep 10, 2013, 5:13:10 PM (11 years ago)
Author:
mervart
Message:
 
Location:
trunk/GnssCenter/map_stations
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GnssCenter/map_stations/map_stations.cpp

    r5414 r5415  
    2828
    2929#include "map_stations.h"
    30 #include "thriftclient.h"
    3130
    3231using namespace std;
     
    9897
    9998  // Thrift Client;
     99  // --------------
    100100  _thriftClient = new t_thriftClient;
     101  connect(_thriftClient, SIGNAL(newThriftResult(t_thriftResult)),
     102          this, SLOT(slotNewThriftResult(t_thriftResult)));
    101103  _thriftClient->start();
    102104}
     
    158160    }
    159161  }
     162}
     163
     164//
     165/////////////////////////////////////////////////////////////////////////////
     166void t_map_stations::slotNewThriftResult(t_thriftResult result) {
     167  cout << result._name << ' '
     168       << result._nGPS << ' ' << result._nGLO << ' '
     169       << result._x << ' ' << result._y << ' ' << result._z << endl;
    160170}
    161171
  • trunk/GnssCenter/map_stations/map_stations.h

    r5410 r5415  
    55#include <QWhatsThis>
    66#include "plugininterface.h"
     7#include "thriftclient.h"
    78
    89class QwtPlot;
     
    2021 public slots:
    2122  void slotNewPoint(const QString& name, double latDeg, double lonDeg);
     23  void slotNewThriftResult(t_thriftResult);
    2224
    2325 private slots:
  • trunk/GnssCenter/map_stations/thriftclient.cpp

    r5414 r5415  
    1818t_thriftClient::t_thriftClient() {
    1919  _stop = false;
     20  qRegisterMetaType<t_thriftResult>("t_thriftResult");
    2021}
    2122
     
    8687  for (unsigned ii = 0; ii < epoch.stationResultList.size(); ii++) {
    8788    const StationResults& staRes = epoch.stationResultList[ii];
    88     cout << staRes.stationName << ' '
    89          << (int) staRes.nsv_gps_used << ' ' << (int) staRes.nsv_glonass_used << ' ';
     89    t_thriftResult result;
     90   
     91    result._name = staRes.stationName;
     92    result._nGPS = staRes.nsv_gps_used;
     93    result._nGLO = staRes.nsv_glonass_used;
    9094    if (_stationCrd.find(staRes.stationName) != _stationCrd.end()) {
    91       cout << _stationCrd[staRes.stationName]._x << ' '
    92            << _stationCrd[staRes.stationName]._y << ' '
    93            << _stationCrd[staRes.stationName]._z;
     95      result._x = _stationCrd[staRes.stationName]._x;
     96      result._y = _stationCrd[staRes.stationName]._y;
     97      result._z = _stationCrd[staRes.stationName]._z;
    9498    }
    95     cout << endl;
     99
     100    emit newThriftResult(result);
     101
     102    cout << result._name << ' ' << result._nGPS << ' ' << result._nGLO << endl;
    96103  }
    97104}
  • trunk/GnssCenter/map_stations/thriftclient.h

    r5414 r5415  
    55#include <map>
    66#include <QThread>
     7#include <QMetaType>
    78
    89#include <transport/TSocket.h>
     
    1415using namespace com::gpssolutions::rtnet;
    1516
    16 // Handler Class Definition
    17 //////////////////////////////////////////////////////////////////////////////
    18 class t_thriftClient : public com::gpssolutions::rtnet::RtnetDataIf, public QThread {
     17class t_thriftResult {
     18 public:
     19  t_thriftResult() {
     20    _nGPS = 0;
     21    _nGLO = 0;
     22    _x    = 0.0;
     23    _y    = 0.0;
     24    _z    = 0.0;
     25  }
     26  ~t_thriftResult() {}
     27  std::string _name;
     28  int         _nGPS; 
     29  int         _nGLO;
     30  double      _x;
     31  double      _y;
     32  double      _z;
     33};
     34
     35class t_thriftClient : public QThread, public com::gpssolutions::rtnet::RtnetDataIf {
     36 Q_OBJECT
    1937 public:
    2038  t_thriftClient();
     
    3452  void handleEpochResults(const RtnetEpoch& epoch);
    3553
     54 signals:
     55  void newThriftResult(t_thriftResult);
     56
    3657 private:
    3758
Note: See TracChangeset for help on using the changeset viewer.