Changeset 3164 in ntrip


Ignore:
Timestamp:
Mar 28, 2011, 1:11:31 PM (14 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncsettings.cpp

    r3161 r3164  
    110110    setValue("cmbOutPath",       "");
    111111    setValue("cmbSP3Path",       "");
    112     setValue("rtnetUploadMountpoints",   "");
    113     setValue("rtnetMountpointIn", "");
     112    setValue("uploadMountpointsOut",   "");
     113    setValue("uploadMountpointIn", "");
    114114    sync();
    115115  }
  • trunk/BNC/bncwindow.cpp

    r3163 r3164  
    471471          this, SLOT(slotBncTextChanged()));
    472472
    473   // RTNet Results
     473  // Upload Results
    474474  // -------------
    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* addRtnetRowButton = new QPushButton("Add Row");
    492   QPushButton* delRtnetRowButton = new QPushButton("Delete");
    493   QPushButton* setRtnetTrafoButton = 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()),
    497497          SLOT(slotBncTextChanged()));
    498498
     
    607607  QWidget* ppp2group = new QWidget();
    608608  QWidget* cmbgroup = new QWidget();
    609   QWidget* rtnetgroup = new QWidget();
     609  QWidget* uploadgroup = new QWidget();
    610610  _aogroup->addTab(pgroup,tr("Proxy"));
    611611  _aogroup->addTab(ggroup,tr("General"));
     
    622622  _aogroup->addTab(cmbgroup,tr("Combination"));
    623623#endif
    624   _aogroup->addTab(rtnetgroup,tr("Upload"));
     624  _aogroup->addTab(uploadgroup,tr("Upload"));
    625625
    626626  // Log Tab
     
    954954  cmbgroup->setLayout(cmbLayout);
    955955
    956   // RTNet Layout
     956  // Upload Layout
    957957  // ------------
    958   QGridLayout* rtnetLayout = new QGridLayout;
    959 
    960   populateRtnetTable();
    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(addRtnetRowButton, SIGNAL(clicked()), this, SLOT(slotAddRtnetRow()));
    972   rtnetLayout->addWidget(delRtnetRowButton,1,8);
    973   connect(delRtnetRowButton, 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(setRtnetTrafoButton, 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);
    985985
    986986  // Main Layout
     
    12871287  }
    12881288
    1289   QStringList rtnetUploadMountpoints;
    1290   for (int iRow = 0; iRow < _rtnetTable->rowCount(); iRow++) {
     1289  QStringList uploadMountpointsOut;
     1290  for (int iRow = 0; iRow < _uploadTable->rowCount(); iRow++) {
    12911291    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) &&
    12941294          (iCol == 3 || iCol == 4 || iCol == 5)) {
    12951295        if      (iCol == 3) {
    1296           QLineEdit* passwd = (QLineEdit*)(_rtnetTable->cellWidget(iRow, iCol));
     1296          QLineEdit* passwd = (QLineEdit*)(_uploadTable->cellWidget(iRow, iCol));
    12971297          hlp += passwd->text() + ",";
    12981298        }
    12991299        else if (iCol == 4) {
    1300           QComboBox* system = (QComboBox*)(_rtnetTable->cellWidget(iRow, iCol));
     1300          QComboBox* system = (QComboBox*)(_uploadTable->cellWidget(iRow, iCol));
    13011301          hlp += system->currentText() + ",";
    13021302        }
    13031303        else if (iCol == 5) {
    1304           QCheckBox* com    = (QCheckBox*)(_rtnetTable->cellWidget(iRow, iCol));
     1304          QCheckBox* com    = (QCheckBox*)(_uploadTable->cellWidget(iRow, iCol));
    13051305          QString state; state.setNum(com->checkState());
    13061306          hlp +=  state + ",";
    13071307        }
    13081308      }
    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() + ",";
    13111311      }
    13121312    }
    13131313    if (!hlp.isEmpty()) {
    1314       rtnetUploadMountpoints << hlp;
     1314      uploadMountpointsOut << hlp;
    13151315    }
    13161316  }
     
    14031403  settings.setValue("cmbSP3Path",    _cmbSP3PathLineEdit->text());
    14041404
    1405   if (!rtnetUploadMountpoints.isEmpty()) {
    1406     settings.setValue("rtnetUploadMountpoints", rtnetUploadMountpoints);
     1405  if (!uploadMountpointsOut.isEmpty()) {
     1406    settings.setValue("uploadMountpointsOut", uploadMountpointsOut);
    14071407  }
    14081408  else {
    1409     settings.setValue("rtnetUploadMountpoints", "");
    1410   }
    1411   settings.setValue("rtnetMountpointIn", _rtnetMountpointIn->text());
     1409    settings.setValue("uploadMountpointsOut", "");
     1410  }
     1411  settings.setValue("uploadMountpointIn", _uploadMountpointIn->text());
    14121412
    14131413  if (_caster) {
     
    22112211//
    22122212////////////////////////////////////////////////////////////////////////////
    2213 void bncWindow::slotAddRtnetRow() {
    2214   int iRow = _rtnetTable->rowCount();
    2215   _rtnetTable->insertRow(iRow);
    2216   for (int iCol = 0; iCol < _rtnetTable->columnCount(); iCol++) {
     2213void bncWindow::slotAddUploadRow() {
     2214  int iRow = _uploadTable->rowCount();
     2215  _uploadTable->insertRow(iRow);
     2216  for (int iCol = 0; iCol < _uploadTable->columnCount(); iCol++) {
    22172217    if      (iCol == 3) {
    22182218      QLineEdit* passwd = new QLineEdit();
    22192219      passwd->setFrame(false);
    22202220      passwd->setEchoMode(QLineEdit::PasswordEchoOnEdit);
    2221       _rtnetTable->setCellWidget(iRow, iCol, passwd);
     2221      _uploadTable->setCellWidget(iRow, iCol, passwd);
    22222222    }
    22232223    else if (iCol == 4) {
     
    22262226      system->addItems(QString("IGS05,ETRF2000,NAD83,GDA94,SIRGAS95,SIRGAS2000,Custom").split(","));
    22272227      system->setFrame(false);
    2228       _rtnetTable->setCellWidget(iRow, iCol, system);
     2228      _uploadTable->setCellWidget(iRow, iCol, system);
    22292229    }
    22302230    else if (iCol == 5) {
    22312231      QCheckBox* com = new QCheckBox();
    2232       _rtnetTable->setCellWidget(iRow, iCol, com);
     2232      _uploadTable->setCellWidget(iRow, iCol, com);
    22332233    }
    22342234    else {
    2235       _rtnetTable->setItem(iRow, iCol, new QTableWidgetItem(""));
     2235      _uploadTable->setItem(iRow, iCol, new QTableWidgetItem(""));
    22362236    }
    22372237  }
     
    22402240//
    22412241////////////////////////////////////////////////////////////////////////////
    2242 void bncWindow::slotDelRtnetRow() {
    2243   int nRows = _rtnetTable->rowCount();
     2242void bncWindow::slotDelUploadRow() {
     2243  int nRows = _uploadTable->rowCount();
    22442244  bool flg[nRows];
    22452245  for (int iRow = 0; iRow < nRows; iRow++) {
    2246     if (_rtnetTable->isItemSelected(_rtnetTable->item(iRow,1))) {
     2246    if (_uploadTable->isItemSelected(_uploadTable->item(iRow,1))) {
    22472247      flg[iRow] = true;
    22482248    }
     
    22532253  for (int iRow = nRows-1; iRow >= 0; iRow--) {
    22542254    if (flg[iRow]) {
    2255       _rtnetTable->removeRow(iRow);
     2255      _uploadTable->removeRow(iRow);
    22562256    }
    22572257  }
     
    22602260//
    22612261////////////////////////////////////////////////////////////////////////////
    2262 void bncWindow::populateRtnetTable() {
    2263   for (int iRow = _rtnetTable->rowCount()-1; iRow >=0; iRow--) {
    2264     _rtnetTable->removeRow(iRow);
     2262void bncWindow::populateUploadTable() {
     2263  for (int iRow = _uploadTable->rowCount()-1; iRow >=0; iRow--) {
     2264    _uploadTable->removeRow(iRow);
    22652265  }
    22662266
     
    22682268
    22692269  int iRow = -1;
    2270   QListIterator<QString> it(settings.value("rtnetUploadMountpoints").toStringList());
     2270  QListIterator<QString> it(settings.value("uploadMountpointsOut").toStringList());
    22712271  while (it.hasNext()) {
    22722272    QStringList hlp = it.next().split(",");
    22732273    if (hlp.size() > 6) {
    22742274      ++iRow;
    2275       _rtnetTable->insertRow(iRow);
     2275      _uploadTable->insertRow(iRow);
    22762276    }
    22772277    for (int iCol = 0; iCol < hlp.size(); iCol++) {
     
    22812281        passwd->setEchoMode(QLineEdit::PasswordEchoOnEdit);
    22822282        passwd->setText(hlp[iCol]);
    2283         _rtnetTable->setCellWidget(iRow, iCol, passwd);
     2283        _uploadTable->setCellWidget(iRow, iCol, passwd);
    22842284      }
    22852285      else if (iCol == 4) {
     
    22892289        system->setFrame(false);
    22902290        system->setCurrentIndex(system->findText(hlp[iCol]));
    2291         _rtnetTable->setCellWidget(iRow, iCol, system);
     2291        _uploadTable->setCellWidget(iRow, iCol, system);
    22922292      }
    22932293      else if (iCol == 5) {
     
    22962296          com->setCheckState(Qt::Checked);
    22972297        }
    2298         _rtnetTable->setCellWidget(iRow, iCol, com);
     2298        _uploadTable->setCellWidget(iRow, iCol, com);
    22992299      }
    23002300      else {
    2301         _rtnetTable->setItem(iRow, iCol, new QTableWidgetItem(hlp[iCol]));
     2301        _uploadTable->setItem(iRow, iCol, new QTableWidgetItem(hlp[iCol]));
    23022302      }
    23032303    }
     
    23072307//
    23082308////////////////////////////////////////////////////////////////////////////
    2309 void bncWindow::slotSetRtnetTrafo() {
    2310 }
     2309void bncWindow::slotSetUploadTrafo() {
     2310}
  • trunk/BNC/bncwindow.h

    r3157 r3164  
    8181    void slotAddCmbRow();
    8282    void slotDelCmbRow();
    83     void slotAddRtnetRow();
    84     void slotDelRtnetRow();
    85     void slotSetRtnetTrafo();
     83    void slotAddUploadRow();
     84    void slotDelUploadRow();
     85    void slotSetUploadTrafo();
    8686
    8787  protected:
     
    9191    void populateMountPointsTable();
    9292    void populateCmbTable();
    93     void populateRtnetTable();
     93    void populateUploadTable();
    9494
    9595    QMenu*     _menuHlp;
     
    203203    QLineEdit*    _cmbSP3PathLineEdit;
    204204
    205     QTableWidget* _rtnetTable;
    206     QLineEdit*    _rtnetMountpointIn;
     205    QTableWidget* _uploadTable;
     206    QLineEdit*    _uploadMountpointIn;
    207207
    208208    bncCaster* _caster;
Note: See TracChangeset for help on using the changeset viewer.