- Timestamp:
- Mar 28, 2011, 1:11:31 PM (14 years ago)
- Location:
- trunk/BNC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncsettings.cpp
r3161 r3164 110 110 setValue("cmbOutPath", ""); 111 111 setValue("cmbSP3Path", ""); 112 setValue(" rtnetUploadMountpoints", "");113 setValue(" rtnetMountpointIn", "");112 setValue("uploadMountpointsOut", ""); 113 setValue("uploadMountpointIn", ""); 114 114 sync(); 115 115 } -
trunk/BNC/bncwindow.cpp
r3163 r3164 471 471 this, SLOT(slotBncTextChanged())); 472 472 473 // RTNetResults473 // Upload Results 474 474 // ------------- 475 _ rtnetTable = new QTableWidget(0,7);476 _ rtnetTable->setHorizontalHeaderLabels(QString("Host, Port, Mount, Password, System, CoM, File").split(","));477 _ rtnetTable->setSelectionMode(QAbstractItemView::ExtendedSelection);478 _ rtnetTable->setSelectionBehavior(QAbstractItemView::SelectRows);479 _ rtnetTable->setMaximumWidth(70*ww);480 _ rtnetTable->horizontalHeader()->resizeSection(0,13*ww);481 _ rtnetTable->horizontalHeader()->resizeSection(1,5*ww);482 _ rtnetTable->horizontalHeader()->resizeSection(2,6*ww);483 _ rtnetTable->horizontalHeader()->resizeSection(3,8*ww);484 _ rtnetTable->horizontalHeader()->resizeSection(4,11*ww);485 _ rtnetTable->horizontalHeader()->resizeSection(5,4*ww);486 _ rtnetTable->horizontalHeader()->resizeSection(6,20*ww);487 _ rtnetTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);488 /// _ rtnetTable->horizontalHeader()->setStretchLastSection(true);489 _ rtnetTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);490 491 QPushButton* add RtnetRowButton = new QPushButton("Add Row");492 QPushButton* del RtnetRowButton = new QPushButton("Delete");493 QPushButton* set RtnetTrafoButton = new QPushButton("Set");494 _ rtnetMountpointIn = new QLineEdit(settings.value("rtnetMountpointIn").toString());495 496 connect(_ rtnetTable, SIGNAL(itemSelectionChanged()),475 _uploadTable = new QTableWidget(0,7); 476 _uploadTable->setHorizontalHeaderLabels(QString("Host, Port, Mount, Password, System, CoM, File").split(",")); 477 _uploadTable->setSelectionMode(QAbstractItemView::ExtendedSelection); 478 _uploadTable->setSelectionBehavior(QAbstractItemView::SelectRows); 479 _uploadTable->setMaximumWidth(70*ww); 480 _uploadTable->horizontalHeader()->resizeSection(0,13*ww); 481 _uploadTable->horizontalHeader()->resizeSection(1,5*ww); 482 _uploadTable->horizontalHeader()->resizeSection(2,6*ww); 483 _uploadTable->horizontalHeader()->resizeSection(3,8*ww); 484 _uploadTable->horizontalHeader()->resizeSection(4,11*ww); 485 _uploadTable->horizontalHeader()->resizeSection(5,4*ww); 486 _uploadTable->horizontalHeader()->resizeSection(6,20*ww); 487 _uploadTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive); 488 /// _uploadTable->horizontalHeader()->setStretchLastSection(true); 489 _uploadTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft); 490 491 QPushButton* addUploadRowButton = new QPushButton("Add Row"); 492 QPushButton* delUploadRowButton = new QPushButton("Delete"); 493 QPushButton* setUploadTrafoButton = new QPushButton("Set"); 494 _uploadMountpointIn = new QLineEdit(settings.value("uploadMountpointIn").toString()); 495 496 connect(_uploadTable, SIGNAL(itemSelectionChanged()), 497 497 SLOT(slotBncTextChanged())); 498 498 … … 607 607 QWidget* ppp2group = new QWidget(); 608 608 QWidget* cmbgroup = new QWidget(); 609 QWidget* rtnetgroup = new QWidget();609 QWidget* uploadgroup = new QWidget(); 610 610 _aogroup->addTab(pgroup,tr("Proxy")); 611 611 _aogroup->addTab(ggroup,tr("General")); … … 622 622 _aogroup->addTab(cmbgroup,tr("Combination")); 623 623 #endif 624 _aogroup->addTab( rtnetgroup,tr("Upload"));624 _aogroup->addTab(uploadgroup,tr("Upload")); 625 625 626 626 // Log Tab … … 954 954 cmbgroup->setLayout(cmbLayout); 955 955 956 // RTNetLayout956 // Upload Layout 957 957 // ------------ 958 QGridLayout* rtnetLayout = new QGridLayout;959 960 populate RtnetTable();961 rtnetLayout->addWidget(_rtnetTable,0,0,6,7);962 rtnetLayout->setColumnStretch(0,1);963 rtnetLayout->setColumnStretch(1,1);964 rtnetLayout->setColumnStretch(2,1);965 rtnetLayout->setColumnStretch(3,1);966 rtnetLayout->setColumnStretch(4,1);967 rtnetLayout->setColumnStretch(5,1);968 rtnetLayout->setColumnStretch(7,1);969 970 rtnetLayout->addWidget(addRtnetRowButton,0,8);971 connect(add RtnetRowButton, SIGNAL(clicked()), this, SLOT(slotAddRtnetRow()));972 rtnetLayout->addWidget(delRtnetRowButton,1,8);973 connect(del RtnetRowButton, SIGNAL(clicked()), this, SLOT(slotDelRtnetRow()));974 975 rtnetLayout->addWidget(new QLabel("Mountpoint"),3,8);976 rtnetLayout->addWidget(_rtnetMountpointIn,3,9,1,2);977 978 rtnetLayout->addWidget(new QLabel("Custom Trafo"),4,8);979 rtnetLayout->addWidget(setRtnetTrafoButton,4,9);980 connect(set RtnetTrafoButton, SIGNAL(clicked()), this, SLOT(slotSetRtnetTrafo()));981 982 rtnetLayout->addWidget(new QLabel("Upload RTNet results to NTRIP caster"),5,8,1,5);983 984 rtnetgroup->setLayout(rtnetLayout);958 QGridLayout* uploadLayout = new QGridLayout; 959 960 populateUploadTable(); 961 uploadLayout->addWidget(_uploadTable,0,0,6,7); 962 uploadLayout->setColumnStretch(0,1); 963 uploadLayout->setColumnStretch(1,1); 964 uploadLayout->setColumnStretch(2,1); 965 uploadLayout->setColumnStretch(3,1); 966 uploadLayout->setColumnStretch(4,1); 967 uploadLayout->setColumnStretch(5,1); 968 uploadLayout->setColumnStretch(7,1); 969 970 uploadLayout->addWidget(addUploadRowButton,0,8); 971 connect(addUploadRowButton, SIGNAL(clicked()), this, SLOT(slotAddUploadRow())); 972 uploadLayout->addWidget(delUploadRowButton,1,8); 973 connect(delUploadRowButton, SIGNAL(clicked()), this, SLOT(slotDelUploadRow())); 974 975 uploadLayout->addWidget(new QLabel("Mountpoint"),3,8); 976 uploadLayout->addWidget(_uploadMountpointIn,3,9,1,2); 977 978 uploadLayout->addWidget(new QLabel("Custom Trafo"),4,8); 979 uploadLayout->addWidget(setUploadTrafoButton,4,9); 980 connect(setUploadTrafoButton, SIGNAL(clicked()), this, SLOT(slotSetUploadTrafo())); 981 982 uploadLayout->addWidget(new QLabel("Upload RTNet results to NTRIP caster"),5,8,1,5); 983 984 uploadgroup->setLayout(uploadLayout); 985 985 986 986 // Main Layout … … 1287 1287 } 1288 1288 1289 QStringList rtnetUploadMountpoints;1290 for (int iRow = 0; iRow < _ rtnetTable->rowCount(); iRow++) {1289 QStringList uploadMountpointsOut; 1290 for (int iRow = 0; iRow < _uploadTable->rowCount(); iRow++) { 1291 1291 QString hlp; 1292 for (int iCol = 0; iCol < _ rtnetTable->columnCount(); iCol++) {1293 if (_ rtnetTable->cellWidget(iRow, iCol) &&1292 for (int iCol = 0; iCol < _uploadTable->columnCount(); iCol++) { 1293 if (_uploadTable->cellWidget(iRow, iCol) && 1294 1294 (iCol == 3 || iCol == 4 || iCol == 5)) { 1295 1295 if (iCol == 3) { 1296 QLineEdit* passwd = (QLineEdit*)(_ rtnetTable->cellWidget(iRow, iCol));1296 QLineEdit* passwd = (QLineEdit*)(_uploadTable->cellWidget(iRow, iCol)); 1297 1297 hlp += passwd->text() + ","; 1298 1298 } 1299 1299 else if (iCol == 4) { 1300 QComboBox* system = (QComboBox*)(_ rtnetTable->cellWidget(iRow, iCol));1300 QComboBox* system = (QComboBox*)(_uploadTable->cellWidget(iRow, iCol)); 1301 1301 hlp += system->currentText() + ","; 1302 1302 } 1303 1303 else if (iCol == 5) { 1304 QCheckBox* com = (QCheckBox*)(_ rtnetTable->cellWidget(iRow, iCol));1304 QCheckBox* com = (QCheckBox*)(_uploadTable->cellWidget(iRow, iCol)); 1305 1305 QString state; state.setNum(com->checkState()); 1306 1306 hlp += state + ","; 1307 1307 } 1308 1308 } 1309 else if (_ rtnetTable->item(iRow, iCol)) {1310 hlp += _ rtnetTable->item(iRow, iCol)->text() + ",";1309 else if (_uploadTable->item(iRow, iCol)) { 1310 hlp += _uploadTable->item(iRow, iCol)->text() + ","; 1311 1311 } 1312 1312 } 1313 1313 if (!hlp.isEmpty()) { 1314 rtnetUploadMountpoints<< hlp;1314 uploadMountpointsOut << hlp; 1315 1315 } 1316 1316 } … … 1403 1403 settings.setValue("cmbSP3Path", _cmbSP3PathLineEdit->text()); 1404 1404 1405 if (! rtnetUploadMountpoints.isEmpty()) {1406 settings.setValue(" rtnetUploadMountpoints", rtnetUploadMountpoints);1405 if (!uploadMountpointsOut.isEmpty()) { 1406 settings.setValue("uploadMountpointsOut", uploadMountpointsOut); 1407 1407 } 1408 1408 else { 1409 settings.setValue(" rtnetUploadMountpoints", "");1410 } 1411 settings.setValue(" rtnetMountpointIn", _rtnetMountpointIn->text());1409 settings.setValue("uploadMountpointsOut", ""); 1410 } 1411 settings.setValue("uploadMountpointIn", _uploadMountpointIn->text()); 1412 1412 1413 1413 if (_caster) { … … 2211 2211 // 2212 2212 //////////////////////////////////////////////////////////////////////////// 2213 void bncWindow::slotAdd RtnetRow() {2214 int iRow = _ rtnetTable->rowCount();2215 _ rtnetTable->insertRow(iRow);2216 for (int iCol = 0; iCol < _ rtnetTable->columnCount(); iCol++) {2213 void bncWindow::slotAddUploadRow() { 2214 int iRow = _uploadTable->rowCount(); 2215 _uploadTable->insertRow(iRow); 2216 for (int iCol = 0; iCol < _uploadTable->columnCount(); iCol++) { 2217 2217 if (iCol == 3) { 2218 2218 QLineEdit* passwd = new QLineEdit(); 2219 2219 passwd->setFrame(false); 2220 2220 passwd->setEchoMode(QLineEdit::PasswordEchoOnEdit); 2221 _ rtnetTable->setCellWidget(iRow, iCol, passwd);2221 _uploadTable->setCellWidget(iRow, iCol, passwd); 2222 2222 } 2223 2223 else if (iCol == 4) { … … 2226 2226 system->addItems(QString("IGS05,ETRF2000,NAD83,GDA94,SIRGAS95,SIRGAS2000,Custom").split(",")); 2227 2227 system->setFrame(false); 2228 _ rtnetTable->setCellWidget(iRow, iCol, system);2228 _uploadTable->setCellWidget(iRow, iCol, system); 2229 2229 } 2230 2230 else if (iCol == 5) { 2231 2231 QCheckBox* com = new QCheckBox(); 2232 _ rtnetTable->setCellWidget(iRow, iCol, com);2232 _uploadTable->setCellWidget(iRow, iCol, com); 2233 2233 } 2234 2234 else { 2235 _ rtnetTable->setItem(iRow, iCol, new QTableWidgetItem(""));2235 _uploadTable->setItem(iRow, iCol, new QTableWidgetItem("")); 2236 2236 } 2237 2237 } … … 2240 2240 // 2241 2241 //////////////////////////////////////////////////////////////////////////// 2242 void bncWindow::slotDel RtnetRow() {2243 int nRows = _ rtnetTable->rowCount();2242 void bncWindow::slotDelUploadRow() { 2243 int nRows = _uploadTable->rowCount(); 2244 2244 bool flg[nRows]; 2245 2245 for (int iRow = 0; iRow < nRows; iRow++) { 2246 if (_ rtnetTable->isItemSelected(_rtnetTable->item(iRow,1))) {2246 if (_uploadTable->isItemSelected(_uploadTable->item(iRow,1))) { 2247 2247 flg[iRow] = true; 2248 2248 } … … 2253 2253 for (int iRow = nRows-1; iRow >= 0; iRow--) { 2254 2254 if (flg[iRow]) { 2255 _ rtnetTable->removeRow(iRow);2255 _uploadTable->removeRow(iRow); 2256 2256 } 2257 2257 } … … 2260 2260 // 2261 2261 //////////////////////////////////////////////////////////////////////////// 2262 void bncWindow::populate RtnetTable() {2263 for (int iRow = _ rtnetTable->rowCount()-1; iRow >=0; iRow--) {2264 _ rtnetTable->removeRow(iRow);2262 void bncWindow::populateUploadTable() { 2263 for (int iRow = _uploadTable->rowCount()-1; iRow >=0; iRow--) { 2264 _uploadTable->removeRow(iRow); 2265 2265 } 2266 2266 … … 2268 2268 2269 2269 int iRow = -1; 2270 QListIterator<QString> it(settings.value(" rtnetUploadMountpoints").toStringList());2270 QListIterator<QString> it(settings.value("uploadMountpointsOut").toStringList()); 2271 2271 while (it.hasNext()) { 2272 2272 QStringList hlp = it.next().split(","); 2273 2273 if (hlp.size() > 6) { 2274 2274 ++iRow; 2275 _ rtnetTable->insertRow(iRow);2275 _uploadTable->insertRow(iRow); 2276 2276 } 2277 2277 for (int iCol = 0; iCol < hlp.size(); iCol++) { … … 2281 2281 passwd->setEchoMode(QLineEdit::PasswordEchoOnEdit); 2282 2282 passwd->setText(hlp[iCol]); 2283 _ rtnetTable->setCellWidget(iRow, iCol, passwd);2283 _uploadTable->setCellWidget(iRow, iCol, passwd); 2284 2284 } 2285 2285 else if (iCol == 4) { … … 2289 2289 system->setFrame(false); 2290 2290 system->setCurrentIndex(system->findText(hlp[iCol])); 2291 _ rtnetTable->setCellWidget(iRow, iCol, system);2291 _uploadTable->setCellWidget(iRow, iCol, system); 2292 2292 } 2293 2293 else if (iCol == 5) { … … 2296 2296 com->setCheckState(Qt::Checked); 2297 2297 } 2298 _ rtnetTable->setCellWidget(iRow, iCol, com);2298 _uploadTable->setCellWidget(iRow, iCol, com); 2299 2299 } 2300 2300 else { 2301 _ rtnetTable->setItem(iRow, iCol, new QTableWidgetItem(hlp[iCol]));2301 _uploadTable->setItem(iRow, iCol, new QTableWidgetItem(hlp[iCol])); 2302 2302 } 2303 2303 } … … 2307 2307 // 2308 2308 //////////////////////////////////////////////////////////////////////////// 2309 void bncWindow::slotSet RtnetTrafo() {2310 } 2309 void bncWindow::slotSetUploadTrafo() { 2310 } -
trunk/BNC/bncwindow.h
r3157 r3164 81 81 void slotAddCmbRow(); 82 82 void slotDelCmbRow(); 83 void slotAdd RtnetRow();84 void slotDel RtnetRow();85 void slotSet RtnetTrafo();83 void slotAddUploadRow(); 84 void slotDelUploadRow(); 85 void slotSetUploadTrafo(); 86 86 87 87 protected: … … 91 91 void populateMountPointsTable(); 92 92 void populateCmbTable(); 93 void populate RtnetTable();93 void populateUploadTable(); 94 94 95 95 QMenu* _menuHlp; … … 203 203 QLineEdit* _cmbSP3PathLineEdit; 204 204 205 QTableWidget* _ rtnetTable;206 QLineEdit* _ rtnetMountpointIn;205 QTableWidget* _uploadTable; 206 QLineEdit* _uploadMountpointIn; 207 207 208 208 bncCaster* _caster;
Note:
See TracChangeset
for help on using the changeset viewer.