Changeset 5474 in ntrip
- Timestamp:
- Sep 18, 2013, 12:14:33 PM (11 years ago)
- Location:
- trunk/GnssCenter/monitor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GnssCenter/monitor/monitor.cpp
r5473 r5474 69 69 connect(_actStopThrift, SIGNAL(triggered()), this, SLOT(slotStopThrift())); 70 70 71 // Window title72 // ------------73 setTitle();74 75 71 // Thrift Client; 76 72 // -------------- 77 73 _thriftClient = 0; 78 74 _results = 0; 75 76 // Read Settings, Set Title, Enable/Disable Actions 77 // ------------------------------------------------ 78 readSettings(); 79 setTitle(); 80 enableActions(); 79 81 } 80 82 … … 92 94 } 93 95 96 // Read Settings 97 ///////////////////////////////////////////////////////////////////////////// 98 void t_monitor::readSettings() { 99 t_settings settings(pluginName); 100 _host = settings.value("host").toString(); 101 if (_host.isEmpty()) { 102 _host = "localhost"; 103 } 104 _port = settings.value("port").toString(); 105 } 106 94 107 // Set title 95 108 ///////////////////////////////////////////////////////////////////////////// 96 109 void t_monitor::setTitle() { 97 t_settings settings(pluginName); 98 QString host = settings.value("host").toString(); 99 if (host.isEmpty()) { 100 host = "localhost"; 101 } 102 QString port = settings.value("port").toString(); 103 if (port.isEmpty()) { 110 if (_port.isEmpty()) { 104 111 setWindowTitle(QString(pluginName)); 105 _actStartThrift->setEnabled(false);106 _actStopThrift->setEnabled(false);107 112 } 108 113 else { 109 _actStartThrift->setEnabled(true); 110 _actStopThrift->setEnabled(false); 111 setWindowTitle(QString(pluginName) + " " + host + ':' + port); 112 } 114 setWindowTitle(QString(pluginName) + " " + _host + ':' + _port); 115 } 116 } 117 118 // Enable/Disable Actions 119 ///////////////////////////////////////////////////////////////////////////// 120 void t_monitor::enableActions() { 121 _actConfig->setEnabled(true); 122 _actStartThrift->setEnabled(true); 123 _actStopThrift->setEnabled(true); 113 124 } 114 125 … … 118 129 t_dlgConf dlg(this); 119 130 dlg.exec(); 131 readSettings(); 120 132 setTitle(); 133 enableActions(); 121 134 } 122 135 … … 124 137 ///////////////////////////////////////////////////////////////////////////// 125 138 void t_monitor::slotStartThrift() { 126 _actConfig->setEnabled(false); 127 _actStartThrift->setEnabled(false); 128 _actStopThrift->setEnabled(true); 139 enableActions(); 129 140 if (!_thriftClient) { 130 t_settings settings(pluginName); 131 QString host = settings.value("host").toString(); 132 if (host.isEmpty()) { 133 host = "localhost"; 134 } 135 int port = settings.value("port").toInt(); 136 _thriftClient = new t_thriftClient(this, host, port); 141 _thriftClient = new t_thriftClient(this, _host, _port.toInt()); 137 142 connect(_thriftClient, SIGNAL(finished()), this, SLOT(slotThriftFinished())); 138 143 _thriftClient->start(); … … 144 149 ///////////////////////////////////////////////////////////////////////////// 145 150 void t_monitor::slotStopThrift() { 146 _actStopThrift->setEnabled(false);151 enableActions(); 147 152 if (_thriftClient) { 148 153 _thriftClient->stop(); … … 154 159 ///////////////////////////////////////////////////////////////////////////// 155 160 void t_monitor::slotThriftFinished() { 156 _actConfig->setEnabled(true); 157 _actStartThrift->setEnabled(true); 158 _actStopThrift->setEnabled(false); 161 enableActions(); 159 162 sender()->deleteLater(); 160 163 _thriftClient = 0; -
trunk/GnssCenter/monitor/monitor.h
r5457 r5474 31 31 32 32 private: 33 void readSettings(); 33 34 void setTitle(); 35 void enableActions(); 34 36 QMutex _mutex; 35 37 QTabWidget* _tabWidget; … … 38 40 QAction* _actStopThrift; 39 41 t_worldPlot* _plot; 42 QString _host; 43 QString _port; 40 44 t_thriftClient* _thriftClient; 41 45 std::vector<t_thriftResult*>* _results;
Note:
See TracChangeset
for help on using the changeset viewer.