Changeset 5452 in ntrip for trunk/GnssCenter
- Timestamp:
- Sep 14, 2013, 3:28:51 PM (12 years ago)
- Location:
- trunk/GnssCenter
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GnssCenter/main/main.cpp
r5082 r5452 27 27 app.setOrganizationName("BKG"); 28 28 app.setOrganizationDomain("www.bkg.bund.de"); 29 app.setConfFileName(""); 29 30 30 31 t_mainWin* mainWin = new t_mainWin(); -
trunk/GnssCenter/main/settings.cpp
r5001 r5452 73 73 const QVariant& defaultValue) const { 74 74 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]; 78 78 } 79 79 else { … … 86 86 void t_settings::setValue(const QString &key, const QVariant& value) { 87 87 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; 95 90 } 96 91 … … 99 94 void t_settings::remove(const QString& key ) { 100 95 QMutexLocker locker(&_mutex); 101 _app->_settings.remove(key); 96 QString fullKey = _groupName.isEmpty() ? key : _groupName + '/' + key; 97 _app->_settings.remove(fullKey); 102 98 } 103 99 … … 115 111 settings.sync(); 116 112 } 113 114 // 115 //////////////////////////////////////////////////////////////////////////// 116 void t_settings::beginGroup(const QString& groupName) { 117 QMutexLocker locker(&_mutex); 118 _groupName = groupName; 119 } 120 121 // 122 //////////////////////////////////////////////////////////////////////////// 123 void t_settings::endGroup() { 124 QMutexLocker locker(&_mutex); 125 _groupName.clear(); 126 } -
trunk/GnssCenter/main/settings.h
r5001 r5452 16 16 void setValue(const QString &key, const QVariant& value); 17 17 void remove(const QString& key ); 18 void sync(); 19 void beginGroup(const QString& groupName); 20 void endGroup(); 21 private: 18 22 void reRead(); 19 void sync();20 private:21 void setValue_p(const QString &key, const QVariant& value);22 23 t_app* _app; 24 QString _groupName; 23 25 static QMutex _mutex; 24 26 }; -
trunk/GnssCenter/monitor/monitor.cpp
r5450 r5452 32 32 #include "worldplot.h" 33 33 #include "thriftclient.h" 34 #include "settings.h" 34 35 35 36 using namespace std; … … 63 64 connect(actStopThrift, SIGNAL(triggered()), this, SLOT(slotStopThrift())); 64 65 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 65 75 // Thrift Client; 66 76 // -------------- … … 86 96 void t_monitor::slotStartThrift() { 87 97 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); 89 104 connect(_thriftClient, SIGNAL(finished()), this, SLOT(slotThriftFinished())); 90 105 _thriftClient->start(); -
trunk/GnssCenter/monitor/monitor.h
r5449 r5452 13 13 14 14 namespace GnssCenter { 15 16 const static QString pluginName = "RTNet Monitor"; 15 17 16 18 class t_monitor : public QMainWindow { … … 41 43 public: 42 44 virtual QWidget* create() {return new t_monitor();} 43 virtual QString getName() const {return QString("RTNet Monitor");}45 virtual QString getName() const {return pluginName;} 44 46 }; 45 47 -
trunk/GnssCenter/monitor/monitor.pro
r5444 r5452 35 35 worldplot.cpp \ 36 36 thriftclient.cpp \ 37 ../main/settings.cpp \ 37 38 gen-cpp/RtnetData.cpp \ 38 39 gen-cpp/rtnet_constants.cpp gen-cpp/rtnet_types.cpp \ -
trunk/GnssCenter/monitor/thriftclient.cpp
r5447 r5452 20 20 // Constructor 21 21 ////////////////////////////////////////////////////////////////////////////// 22 t_thriftClient::t_thriftClient(t_monitor* parent) { 22 t_thriftClient::t_thriftClient(t_monitor* parent, const QString& host, int port) { 23 23 _stop = false; 24 24 _parent = parent; 25 _host = host.toAscii().data(); 26 _port = port; 25 27 } 26 28 -
trunk/GnssCenter/monitor/thriftclient.h
r5447 r5452 4 4 #include <string> 5 5 #include <map> 6 #include <QString> 6 7 #include <QThread> 7 8 #include <QMutex> … … 66 67 class t_thriftClient : public QThread { 67 68 public: 68 t_thriftClient(t_monitor* parent); 69 t_thriftClient(t_monitor* parent, const QString& host, int port); 69 70 ~t_thriftClient(); 70 71 virtual void run(); … … 75 76 76 77 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; 80 83 }; 81 84
Note:
See TracChangeset
for help on using the changeset viewer.