Changeset 5452 in ntrip


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

Legend:

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

    r5082 r5452  
    2727  app.setOrganizationName("BKG");
    2828  app.setOrganizationDomain("www.bkg.bund.de");
     29  app.setConfFileName("");
    2930
    3031  t_mainWin* mainWin = new t_mainWin();
  • trunk/GnssCenter/main/settings.cpp

    r5001 r5452  
    7373                            const QVariant& defaultValue) const {
    7474  QMutexLocker locker(&_mutex);
    75 
    76   if (_app->_settings.contains(key)) {
    77     return _app->_settings[key];
     75  QString fullKey = _groupName.isEmpty() ? key : _groupName + '/' + key;
     76  if (_app->_settings.contains(fullKey)) {
     77    return _app->_settings[fullKey];
    7878  }
    7979  else {
     
    8686void t_settings::setValue(const QString &key, const QVariant& value) {
    8787  QMutexLocker locker(&_mutex);
    88   setValue_p(key, value);
    89 }
    90 
    91 //
    92 ////////////////////////////////////////////////////////////////////////////
    93 void t_settings::setValue_p(const QString &key, const QVariant& value) {
    94   _app->_settings[key] = value;
     88  QString fullKey = _groupName.isEmpty() ? key : _groupName + '/' + key;
     89  _app->_settings[fullKey] = value;
    9590}
    9691
     
    9994void t_settings::remove(const QString& key ) {
    10095  QMutexLocker locker(&_mutex);
    101   _app->_settings.remove(key);
     96  QString fullKey = _groupName.isEmpty() ? key : _groupName + '/' + key;
     97  _app->_settings.remove(fullKey);
    10298}
    10399
     
    115111  settings.sync();
    116112}
     113
     114//
     115////////////////////////////////////////////////////////////////////////////
     116void t_settings::beginGroup(const QString& groupName) {
     117  QMutexLocker locker(&_mutex);
     118  _groupName = groupName;
     119}
     120
     121//
     122////////////////////////////////////////////////////////////////////////////
     123void t_settings::endGroup() {
     124  QMutexLocker locker(&_mutex);
     125  _groupName.clear();
     126}
  • trunk/GnssCenter/main/settings.h

    r5001 r5452  
    1616  void setValue(const QString &key, const QVariant& value);
    1717  void remove(const QString& key );
     18  void sync();
     19  void beginGroup(const QString& groupName);
     20  void endGroup();
     21 private:
    1822  void reRead();
    19   void sync();
    20  private:
    21   void          setValue_p(const QString &key, const QVariant& value);
    2223  t_app*        _app;
     24  QString       _groupName;
    2325  static QMutex _mutex;
    2426};
  • 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.