Changeset 5452 in ntrip for trunk/GnssCenter/monitor


Ignore:
Timestamp:
Sep 14, 2013, 3:28:51 PM (11 years ago)
Author:
mervart
Message:
 
Location:
trunk/GnssCenter/monitor
Files:
5 edited

Legend:

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

    r5450 r5452  
    3232#include "worldplot.h"
    3333#include "thriftclient.h"
     34#include "settings.h"
    3435
    3536using namespace std;
     
    6364  connect(actStopThrift, SIGNAL(triggered()), this, SLOT(slotStopThrift()));
    6465
     66  // Host and Port
     67  // -------------
     68  t_settings settings;
     69  settings.beginGroup(pluginName);
     70  settings.setValue("host", "rtnet.rtcm-ntrip.org");
     71  settings.setValue("port", 7777);
     72  settings.endGroup();
     73  settings.sync();
     74
    6575  // Thrift Client;
    6676  // --------------
     
    8696void t_monitor::slotStartThrift() {
    8797  if (!_thriftClient) {
    88     _thriftClient = new t_thriftClient(this);
     98    t_settings settings;
     99    settings.beginGroup(pluginName);
     100    QString host = settings.value("host").toString();
     101    int     port = settings.value("port").toInt();
     102    settings.endGroup();
     103    _thriftClient = new t_thriftClient(this, host, port);
    89104    connect(_thriftClient, SIGNAL(finished()), this, SLOT(slotThriftFinished()));
    90105    _thriftClient->start();
  • trunk/GnssCenter/monitor/monitor.h

    r5449 r5452  
    1313
    1414namespace GnssCenter {
     15
     16const static QString pluginName = "RTNet Monitor";
    1517
    1618class t_monitor : public QMainWindow {
     
    4143 public:
    4244  virtual QWidget* create() {return new t_monitor();}
    43   virtual QString getName() const {return QString("RTNet Monitor");}
     45  virtual QString getName() const {return pluginName;}
    4446};
    4547
  • trunk/GnssCenter/monitor/monitor.pro

    r5444 r5452  
    3535            worldplot.cpp    \
    3636            thriftclient.cpp \
     37            ../main/settings.cpp \
    3738            gen-cpp/RtnetData.cpp \
    3839            gen-cpp/rtnet_constants.cpp gen-cpp/rtnet_types.cpp \
  • trunk/GnssCenter/monitor/thriftclient.cpp

    r5447 r5452  
    2020// Constructor
    2121//////////////////////////////////////////////////////////////////////////////
    22 t_thriftClient::t_thriftClient(t_monitor* parent) {
     22t_thriftClient::t_thriftClient(t_monitor* parent, const QString& host, int port) {
    2323  _stop   = false;
    2424  _parent = parent;
     25  _host   = host.toAscii().data();
     26  _port   = port;
    2527}
    2628
  • trunk/GnssCenter/monitor/thriftclient.h

    r5447 r5452  
    44#include <string>
    55#include <map>
     6#include <QString>
    67#include <QThread>
    78#include <QMutex>
     
    6667class t_thriftClient : public QThread {
    6768 public:
    68   t_thriftClient(t_monitor* parent);
     69  t_thriftClient(t_monitor* parent, const QString& host, int port);
    6970  ~t_thriftClient();
    7071  virtual void run();
     
    7576
    7677 private:
    77   QMutex     _mutex;
    78   t_monitor* _parent;
    79   bool       _stop;
     78  QMutex      _mutex;
     79  std::string _host;
     80  int         _port;
     81  t_monitor*  _parent;
     82  bool        _stop;
    8083};
    8184
Note: See TracChangeset for help on using the changeset viewer.