Changeset 83 in ntrip
- Timestamp:
- Aug 30, 2006, 5:41:24 PM (19 years ago)
- Location:
- trunk/BNC
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC ¶
- Property svn:ignore
-
TabularUnified
old new 7 7 moc_bnctabledlg.cpp 8 8 moc_bncwindow.cpp 9 moc_bncapp.cpp
-
- Property svn:ignore
-
TabularUnified trunk/BNC/.cvsignore ¶
r65 r83 7 7 moc_bnctabledlg.cpp 8 8 moc_bncwindow.cpp 9 moc_bncapp.cpp -
TabularUnified trunk/BNC/bnctabledlg.cpp ¶
r82 r83 152 152 } 153 153 } 154 _table->sortItems(0); 154 155 } 155 156 } -
TabularUnified trunk/BNC/bncwindow.cpp ¶
r59 r83 26 26 bncWindow::bncWindow() { 27 27 28 setMinimumSize( 600,400);28 setMinimumSize(400,600); 29 29 30 30 // Create Actions … … 44 44 _actDeleteMountPoints = new QAction(tr("&Delete Mount Points"),this); 45 45 connect(_actDeleteMountPoints, SIGNAL(triggered()), SLOT(slotDeleteMountPoints())); 46 _actDeleteMountPoints->setEnabled(false); 46 47 47 48 _actGetData = new QAction(tr("&Get Data"),this); … … 75 76 _canvas->setLayout(layout); 76 77 78 _userLabel = new QLabel("user"); 79 _passwordLabel = new QLabel("password"); 77 80 _proxyHostLabel = new QLabel("proxy host"); 78 81 _proxyPortLabel = new QLabel("proxy port"); 79 _userLabel = new QLabel("user"); 80 _passwordLabel = new QLabel("password"); 81 _outFileLabel = new QLabel("output file"); 82 _outPortLabel = new QLabel("output port"); 82 _outFileLabel = new QLabel("ASCII output file (full path)"); 83 _outPortLabel = new QLabel("port for binary output"); 84 _rnxPathLabel = new QLabel("RINEX path"); 85 _rnxSkelLabel = new QLabel("RINEX skeleton extension"); 86 _rnxIntrLabel = new QLabel("RINEX file interval"); 83 87 _mountPointsLabel = new QLabel("mount points"); 88 _logLabel = new QLabel("log"); 84 89 85 90 QSettings settings; 86 91 87 92 _proxyHostLineEdit = new QLineEdit(settings.value("proxyHost").toString()); 93 int ww = QFontMetrics(_proxyHostLineEdit->font()).width('w'); 94 _proxyHostLineEdit->setMaximumWidth(12*ww); 88 95 _proxyPortLineEdit = new QLineEdit(settings.value("proxyPort").toString()); 96 _proxyPortLineEdit->setMaximumWidth(9*ww); 89 97 _userLineEdit = new QLineEdit(settings.value("user").toString()); 98 _userLineEdit->setMaximumWidth(9*ww); 90 99 _passwordLineEdit = new QLineEdit(settings.value("password").toString()); 100 _passwordLineEdit->setMaximumWidth(9*ww); 91 101 _passwordLineEdit->setEchoMode(QLineEdit::Password); 92 102 _outFileLineEdit = new QLineEdit(settings.value("outFile").toString()); 93 103 _outPortLineEdit = new QLineEdit(settings.value("outPort").toString()); 104 _outPortLineEdit->setMaximumWidth(9*ww); 105 _rnxPathLineEdit = new QLineEdit(settings.value("rnxPath").toString()); 106 _rnxSkelLineEdit = new QLineEdit(settings.value("rnxSkel").toString()); 107 _rnxSkelLineEdit->setMaximumWidth(5*ww); 108 _rnxIntrSpinBox = new QSpinBox(); 109 _rnxIntrSpinBox->setMaximumWidth(12*ww); 110 _rnxIntrSpinBox->setValue(settings.value("rnxIntr").toInt()); 111 _rnxIntrSpinBox->setSuffix(" hour"); 112 _rnxIntrSpinBox->setRange(1,24); 113 _rnxIntrSpinBox->setSingleStep(23); 94 114 _mountPointsTable = new QTableWidget(0,2); 95 _mountPointsTable->setMaximumHeight(100); 115 _mountPointsTable->setMaximumHeight(140); 116 _mountPointsTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch); 96 117 _mountPointsTable->horizontalHeader()->hide(); 97 _mountPointsTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch);98 118 _mountPointsTable->verticalHeader()->hide(); 99 119 _mountPointsTable->setGridStyle(Qt::NoPen); … … 107 127 while (it.hasNext()) { 108 128 QStringList hlp = it.next().split(" "); 129 if (hlp.size() <= 1) continue; 109 130 QString mPoint = hlp[0]; 110 131 QString format = hlp[1]; … … 114 135 iRow++; 115 136 } 116 117 layout->addWidget(_proxyHostLabel, 0, 0); 118 layout->addWidget(_proxyHostLineEdit, 0, 1); 119 layout->addWidget(_proxyPortLabel, 0, 2); 120 layout->addWidget(_proxyPortLineEdit, 0, 3); 121 layout->addWidget(_userLabel, 1, 0); 122 layout->addWidget(_userLineEdit, 1, 1); 123 layout->addWidget(_passwordLabel, 1, 2); 124 layout->addWidget(_passwordLineEdit, 1, 3); 125 layout->addWidget(_outFileLabel, 2, 0); 126 layout->addWidget(_outFileLineEdit, 2, 1); 127 layout->addWidget(_outPortLabel, 2, 2); 128 layout->addWidget(_outPortLineEdit, 2, 3); 129 130 layout->addWidget(_mountPointsLabel, 3, 0); 131 layout->addWidget(_mountPointsTable, 3, 1, 1, 3); 137 _mountPointsTable->sortItems(0); 138 139 connect(_mountPointsTable, SIGNAL(itemSelectionChanged()), 140 SLOT(slotSelectionChanged())); 141 142 _log = new QTextEdit(); 143 _log->setMaximumHeight(120); 144 _log->setReadOnly(true); 145 146 layout->addWidget(_userLabel, 0, 0); 147 layout->addWidget(_userLineEdit, 0, 1); 148 layout->addWidget(_passwordLabel, 0, 2); 149 layout->addWidget(_passwordLineEdit, 0, 3); 150 layout->addWidget(_proxyHostLabel, 1, 0); 151 layout->addWidget(_proxyHostLineEdit, 1, 1); 152 layout->addWidget(_proxyPortLabel, 1, 2); 153 layout->addWidget(_proxyPortLineEdit, 1, 3); 154 layout->addWidget(_outFileLabel, 2, 1); 155 layout->addWidget(_outFileLineEdit, 2, 2, 1, 2); 156 layout->addWidget(_outPortLabel, 3, 1); 157 layout->addWidget(_outPortLineEdit, 3, 2); 158 layout->addWidget(_rnxPathLabel, 4, 1); 159 layout->addWidget(_rnxPathLineEdit, 4, 2, 1, 2); 160 layout->addWidget(_rnxSkelLabel, 5, 1); 161 layout->addWidget(_rnxSkelLineEdit, 5, 2); 162 layout->addWidget(_rnxIntrLabel, 6, 1); 163 layout->addWidget(_rnxIntrSpinBox, 6, 2); 164 layout->addWidget(_mountPointsLabel, 7, 0); 165 layout->addWidget(_mountPointsTable, 7, 1, 1, 3); 166 layout->addWidget(_logLabel, 8, 0); 167 layout->addWidget(_log, 8, 1, 1, 3); 132 168 133 169 _bncCaster = 0; … … 144 180 bncTableDlg* dlg = new bncTableDlg(this, _proxyHostLineEdit->text(), 145 181 _proxyPortLineEdit->text().toInt()); 182 dlg->move(this->pos().x()+50, this->pos().y()+50); 146 183 connect(dlg, SIGNAL(newMountPoints(QStringList*)), 147 184 this, SLOT(slotNewMountPoints(QStringList*))); … … 154 191 //////////////////////////////////////////////////////////////////////////// 155 192 void bncWindow::slotDeleteMountPoints() { 156 _mountPointsTable->clear(); 157 _mountPointsTable->setRowCount(0); 193 while(1) { 194 bool itemRemoved = false; 195 for (int iRow = 0; iRow < _mountPointsTable->rowCount(); iRow++) { 196 if (_mountPointsTable->isItemSelected(_mountPointsTable->item(iRow,0))) { 197 _mountPointsTable->removeRow(iRow); 198 itemRemoved = true; 199 break; 200 } 201 } 202 if (!itemRemoved) { 203 break; 204 } 205 } 206 _actDeleteMountPoints->setEnabled(false); 158 207 } 159 208 … … 172 221 iRow++; 173 222 } 223 _mountPointsTable->sortItems(0); 174 224 if (mountPoints->count() > 0) { 175 225 _actGetData->setEnabled(true); … … 188 238 settings.setValue("outFile", _outFileLineEdit->text()); 189 239 settings.setValue("outPort", _outPortLineEdit->text()); 240 settings.setValue("rnxPath", _rnxPathLineEdit->text()); 241 settings.setValue("rnxIntr", _rnxIntrSpinBox->value()); 242 settings.setValue("rnxSkel", _rnxSkelLineEdit->text()); 190 243 QStringList mountPoints; 191 244 for (int iRow = 0; iRow < _mountPointsTable->rowCount(); iRow++) { … … 199 252 //////////////////////////////////////////////////////////////////////////// 200 253 void bncWindow::slotGetThreadErrors() { 201 QMessageBox::warning(0, "BNC","All Get Threads Terminated");254 slotMessage("All Get Threads Terminated"); 202 255 _actAddMountPoints->setEnabled(true); 203 _actDeleteMountPoints->setEnabled(true);204 256 _actGetData->setEnabled(true); 205 257 } … … 223 275 this, SLOT(slotGetThreadErrors())); 224 276 277 connect(_bncCaster, SIGNAL(newMessage(const QByteArray&)), 278 this, SLOT(slotMessage(const QByteArray&))); 279 225 280 _bncCaster->start(); 226 281 … … 234 289 mountPoint, user, password, 235 290 format); 291 292 connect(getThread, SIGNAL(newMessage(const QByteArray&)), 293 this, SLOT(slotMessage(const QByteArray&))); 294 236 295 _bncCaster->addGetThread(getThread); 237 296 … … 239 298 } 240 299 } 300 301 // Close Application gracefully 302 //////////////////////////////////////////////////////////////////////////// 303 void bncWindow::closeEvent(QCloseEvent* event) { 304 305 int iRet = QMessageBox::question(this, "Close", "Save Options?", 306 QMessageBox::Yes, QMessageBox::No, 307 QMessageBox::Cancel); 308 309 if (iRet == QMessageBox::Cancel) { 310 event->ignore(); 311 return; 312 } 313 else if (iRet == QMessageBox::Yes) { 314 slotSaveOptions(); 315 } 316 317 return QMainWindow::closeEvent(event); 318 } 319 320 // User changed the selection of mountPoints 321 //////////////////////////////////////////////////////////////////////////// 322 void bncWindow::slotSelectionChanged() { 323 if (_mountPointsTable->selectedItems().isEmpty()) { 324 _actDeleteMountPoints->setEnabled(false); 325 } 326 else { 327 _actDeleteMountPoints->setEnabled(true); 328 } 329 } 330 331 // Display Program Messages 332 //////////////////////////////////////////////////////////////////////////// 333 void bncWindow::slotMessage(const QByteArray& msg) { 334 335 const int maxBufferSize = 10000; 336 337 QString txt = _log->toPlainText() + "\n" + msg; 338 _log->clear(); 339 _log->append(txt.right(maxBufferSize)); 340 } 341 -
TabularUnified trunk/BNC/bncwindow.h ¶
r35 r83 13 13 public: 14 14 bncWindow(); 15 ~bncWindow(); 15 ~bncWindow(); 16 17 public slots: 18 void slotMessage(const QByteArray& msg); 16 19 17 20 private slots: … … 22 25 void slotDeleteMountPoints(); 23 26 void slotGetThreadErrors(); 27 void slotSelectionChanged(); 28 29 protected: 30 virtual void closeEvent(QCloseEvent *); 24 31 25 32 private: … … 38 45 QLabel* _userLabel; 39 46 QLabel* _passwordLabel; 47 QLabel* _rnxPathLabel; 48 QLabel* _rnxSkelLabel; 49 QLabel* _rnxIntrLabel; 40 50 QLabel* _mountPointsLabel; 41 51 QLabel* _outFileLabel; 42 52 QLabel* _outPortLabel; 53 QLabel* _logLabel; 43 54 44 55 QLineEdit* _proxyHostLineEdit; … … 48 59 QLineEdit* _outFileLineEdit; 49 60 QLineEdit* _outPortLineEdit; 61 QLineEdit* _rnxPathLineEdit; 62 QLineEdit* _rnxSkelLineEdit; 63 QSpinBox* _rnxIntrSpinBox; 64 QTableWidget* _mountPointsTable; 65 66 QTextEdit* _log; 50 67 51 68 QWidget* _canvas; 52 53 QTableWidget* _mountPointsTable;54 69 55 70 bncCaster* _bncCaster;
Note:
See TracChangeset
for help on using the changeset viewer.