Changeset 7889 in ntrip


Ignore:
Timestamp:
Apr 28, 2016, 1:04:18 PM (20 months ago)
Author:
stuerze
Message:

BNC's ephemeris upload is extended to allows an upload of more than one stream and to choose a single satellite system

Location:
trunk/BNC/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncmain.cpp

    r7884 r7889  
    275275      "\n"
    276276      "Upload Ephemeris Panel keys:\n"
    277       "   uploadEphHost       {Broadcaster host, name or IP address [character string]}\n"
    278       "   uploadEphPort       {Broadcaster port [integer number]}\n"
    279       "   uploadEphMountpoint {Mountpoint [character string]}\n"
    280       "   uploadEphPassword   {Stream upload password [character string]}\n"
    281       "   uploadEphSample     {Stream upload sampling rate [integer number of seconds: 5|10|15|20|25|30|35|40|45|50|55|60]}\n"
     277      "   uploadEphMountpointsOut {Upload corrections table [character string, semicolon separated list, each element in quotation marks, example:\n"
     278      "                           \"www.igs-ip.net,2101,RTCM3EPH_GPS,pass,GPS\"]}\n"
     279      "   uploadSamplRtcmEph      {Stream upload sampling rate [integer number of seconds: 0|5|10|15|20|25|30|35|40|45|50|55|60]}\n"
    282280      "\n"
    283281      "Add Stream keys:\n"
  • trunk/BNC/src/bncsettings.cpp

    r7513 r7889  
    199199    setValue_p("trafo_t0",            "");
    200200    // Upload (eph)
    201     setValue_p("uploadEphHost",       "");
    202     setValue_p("uploadEphPort",       "");
    203     setValue_p("uploadAntexFile",     "");
    204     setValue_p("uploadEphMountpoint", "");
    205     setValue_p("uploadEphPassword",   "");
    206     setValue_p("uploadEphSample",     "5");
     201    setValue_p("uploadEphMountpointsOut","");
     202    setValue_p("uploadSamplRtcmEph", "0");
    207203  }
    208204#ifdef GNSSCENTER_PLUGIN
  • trunk/BNC/src/bncwindow.cpp

    r7884 r7889  
    564564  // Upload RTCM3 Ephemeris
    565565  // ----------------------
    566   _uploadEphHostLineEdit       = new QLineEdit(settings.value("uploadEphHost").toString());
    567   _uploadEphPortLineEdit       = new QLineEdit(settings.value("uploadEphPort").toString());
    568   _uploadEphPasswordLineEdit   = new QLineEdit(settings.value("uploadEphPassword").toString());
    569   _uploadEphPasswordLineEdit->setEchoMode(QLineEdit::PasswordEchoOnEdit);
    570   _uploadEphMountpointLineEdit = new QLineEdit(settings.value("uploadEphMountpoint").toString());
    571   _uploadEphSampleSpinBox      = new QSpinBox;
    572   _uploadEphSampleSpinBox->setMinimum(5);
    573   _uploadEphSampleSpinBox->setMaximum(60);
    574   _uploadEphSampleSpinBox->setSingleStep(5);
    575   _uploadEphSampleSpinBox->setMaximumWidth(9*ww);
    576   _uploadEphSampleSpinBox->setValue(settings.value("uploadEphSample").toInt());
    577   _uploadEphSampleSpinBox->setSuffix(" sec");
    578   _uploadEphBytesCounter       = new bncBytesCounter;
     566  _uploadEphTable = new QTableWidget(0,6);
     567  _uploadEphTable->setColumnCount(6);
     568  _uploadEphTable->setRowCount(0);
     569  _uploadEphTable->setHorizontalHeaderLabels(QString("Host, Port, Mount, Password, System, bytes").split(","));
     570  _uploadEphTable->setSelectionMode(QAbstractItemView::ExtendedSelection);
     571  _uploadEphTable->setSelectionBehavior(QAbstractItemView::SelectRows);
     572  _uploadEphTable->horizontalHeader()->resizeSection( 0,13*ww);
     573  _uploadEphTable->horizontalHeader()->resizeSection( 1, 5*ww);
     574  _uploadEphTable->horizontalHeader()->resizeSection( 2, 8*ww);
     575  _uploadEphTable->horizontalHeader()->resizeSection( 3, 8*ww);
     576  _uploadEphTable->horizontalHeader()->resizeSection( 4,10*ww);
     577  _uploadEphTable->horizontalHeader()->resizeSection( 5,12*ww);
     578  _uploadEphTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
     579  _uploadEphTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);
     580
     581  connect(_uploadEphTable, SIGNAL(itemSelectionChanged()),
     582          SLOT(slotBncTextChanged()));
     583
     584  QPushButton* addUploadEphRowButton = new QPushButton("Add Row");
     585  addUploadEphRowButton->setMaximumWidth(9*ww);
     586  QPushButton* delUploadEphRowButton = new QPushButton("Del Row");
     587  delUploadEphRowButton->setMaximumWidth(9*ww);
     588
     589  _uploadSamplRtcmEphSpinBox = new QSpinBox;
     590  _uploadSamplRtcmEphSpinBox->setMinimum(0);
     591  _uploadSamplRtcmEphSpinBox->setMaximum(60);
     592  _uploadSamplRtcmEphSpinBox->setSingleStep(5);
     593  _uploadSamplRtcmEphSpinBox->setMaximumWidth(9*ww);
     594  _uploadSamplRtcmEphSpinBox->setValue(settings.value("uploadSamplRtcmEph").toInt());
     595  _uploadSamplRtcmEphSpinBox->setSuffix(" sec");
     596
     597  iRowT = _uploadEphTable->rowCount();
     598  if (iRowT > 0) {
     599    enableWidget(true, _uploadSamplRtcmEphSpinBox);
     600  }
     601  else {
     602    enableWidget(false, _uploadSamplRtcmEphSpinBox);
     603  }
    579604
    580605  // Canvas with Editable Fields
     
    11911216  // Upload Layout (Ephemeris)
    11921217  // -------------------------
    1193   QGridLayout* uploadLayoutEph = new QGridLayout;
    1194 
    1195   uploadLayoutEph->setColumnMinimumWidth(0, 9*ww);
    1196   _uploadEphPortLineEdit->setMaximumWidth(9*ww);
    1197   _uploadEphPasswordLineEdit->setMaximumWidth(9*ww);
    1198   _uploadEphMountpointLineEdit->setMaximumWidth(12*ww);
    1199 
    1200   uploadLayoutEph->addWidget(new QLabel("Upload concatenated RTCMv3 Broadcast Ephemeris to caster.<br>"), 0, 0, 1, 50);
    1201   uploadLayoutEph->addWidget(new QLabel("Host"),                  1, 0);
    1202   uploadLayoutEph->addWidget(_uploadEphHostLineEdit,              1, 1, 1, 3);
    1203   uploadLayoutEph->addWidget(new QLabel("  Port"),                1, 4, Qt::AlignRight);
    1204   uploadLayoutEph->addWidget(_uploadEphPortLineEdit,              1, 5, 1, 1);
    1205   uploadLayoutEph->addWidget(new QLabel("Mountpoint           "), 2, 0);
    1206   uploadLayoutEph->addWidget(_uploadEphMountpointLineEdit,        2, 1);
    1207   uploadLayoutEph->addWidget(new QLabel("          Password"),    2, 2, Qt::AlignRight);
    1208   uploadLayoutEph->addWidget(_uploadEphPasswordLineEdit,          2, 3);
    1209   uploadLayoutEph->addWidget(new QLabel("Sampling"),              3, 0);
    1210   uploadLayoutEph->addWidget(_uploadEphSampleSpinBox,             3, 1);
    1211   uploadLayoutEph->addWidget(new QLabel("Uploaded"),              4, 0);
    1212   uploadLayoutEph->addWidget(_uploadEphBytesCounter,              4, 1);
    1213   uploadLayoutEph->setRowStretch(5, 999);
     1218  QGridLayout* uploadHlpLayoutEph = new QGridLayout();
     1219
     1220  connect(addUploadEphRowButton, SIGNAL(clicked()), this, SLOT(slotAddUploadEphRow()));
     1221  connect(delUploadEphRowButton, SIGNAL(clicked()), this, SLOT(slotDelUploadEphRow()));
     1222
     1223  uploadHlpLayoutEph->addWidget(addUploadEphRowButton,               0, 0);
     1224  uploadHlpLayoutEph->addWidget(delUploadEphRowButton,               0, 1);
     1225  uploadHlpLayoutEph->addWidget(new QLabel("     Sampling"),         0, 2, Qt::AlignRight);
     1226  uploadHlpLayoutEph->addWidget(_uploadSamplRtcmEphSpinBox,          0, 3);
     1227
     1228  QBoxLayout* uploadLayoutEph = new QBoxLayout(QBoxLayout::TopToBottom);
     1229  populateUploadEphTable();
     1230
     1231  uploadLayoutEph->addWidget(new QLabel("Upload concatenated RTCMv3 Broadcast Ephemeris to caster.<br>"));
     1232  uploadLayoutEph->addWidget(_uploadEphTable);
     1233  uploadLayoutEph->addLayout(uploadHlpLayoutEph);
    12141234
    12151235  uploadEphgroup->setLayout(uploadLayoutEph);
    12161236
    1217   connect(_uploadEphHostLineEdit, SIGNAL(textChanged(const QString &)),
    1218           this, SLOT(slotBncTextChanged()));
    12191237
    12201238  // Main Layout
     
    13721390  _uploadTable->setWhatsThis(tr("<p>BNC can upload clock and orbit corrections to Broadcast Ephemeris (Broadcast Corrections) in RTCM Version 3 SSR format. You may have a situation where clocks and orbits come from an external Real-time Network Engine (1) or a situation where clock and orbit corrections are combined within BNC (2).</p><p>(1) BNC identifies a stream as coming from a Real-time Network Engine if its format is specified as 'RTNET' and hence its decoder string in the 'Streams' canvas is 'RTNET'. It encodes and uploads that stream to the specified Ntrip Broadcaster Host and Port</p><p>(2) BNC understands that it is expected to encode and upload combined Broadcast Ephemeris Corrections if you specify correction streams in the 'Combine Corrections' table.</p><p>To fill the 'Upload Corrections' table, hit the 'Add Row' button, double click on the 'Host' field to enter the IP or URL of an Ntrip Broadcaster and hit Enter. Then double click on the 'Port', 'Mount' and 'Password' fields to enter the Ntrip Broadcaster IP port (default is 80), the mountpoint and the stream upload password. An empty 'Host' option field means that you don't want to upload corrections.</p><p>Select a target coordinate reference System (e.g. IGS08) for outgoing clock and orbit corrections.</p><p>By default orbit and clock corrections refer to Antenna Phase Center (APC). Tick 'CoM' to refer uploaded corrections to Center of Mass instead of APC.</p><p>Specify a path for saving generated Broadcast Corrections plus Broadcast Ephemeris as SP3 orbit files. If the specified directory does not exist, BNC will not create such files. The following is a path example for a Linux system: /home/user/BNC${GPSWD}.sp3<br>Note that '${GPSWD}' produces the GPS Week and Day number in the filename.</p><p>Specify a path for saving generated Broadcast Correction clocks plus Broadcast Ephemeris clocks as Clock RINEX files. If the specified directory does not exist, BNC will not create Clock RINEX files. The following is a path example for a Linux system: /home/user/BNC${GPSWD}.clk<br>Note that '${GPSWD}' produces the GPS Week and Day number in the filename.</p><p>Finally, specify a SSR Provider ID (issued by RTCM), SSR Solution ID, and SSR Issue of Data number.</p><p>In case the 'Combine Corrections' table contains only one Broadcast Correction stream, BNC will add that stream content to the Broadcast Ephemeris to save results in files specified via SP3 and/or Clock RINEX file path. You should then define only the SP3 and Clock RINEX file path and no further option in the 'Upload Corrections' table.</p>"));
    13731391  addUploadRowButton->setWhatsThis(tr("<p>Hit 'Add Row' button to add another line to the 'Upload Corrections' table.</p>"));
    1374   delUploadRowButton->setWhatsThis(tr("<p>Hit 'Del Row' button to delete the highlighted line(s) from the Upload Corrections' table.</p>"));
     1392  delUploadRowButton->setWhatsThis(tr("<p>Hit 'Del Row' button to delete the highlighted line(s) from the 'Upload Corrections' table.</p>"));
    13751393  _uploadIntrComboBox->setWhatsThis(tr("<p>Select the length of the SP3 and Clock RINEX files.</p>"));
    13761394  _uploadSamplRtcmEphCorrSpinBox->setWhatsThis(tr("<p>Select a stream's orbit correction sampling interval in seconds.</p><p>A value of zero '0' tells BNC to upload all available orbit and clock correction samples together in combined messages.</p>"));
     
    13821400  // WhatsThis, Upload Ephemeris
    13831401  // ---------------------------
    1384   _uploadEphHostLineEdit->setWhatsThis(tr("<p>BNC can upload a Broadcast Ephemeris stream in RTCM Version 3 format. Specify the IP number or URL of an Ntrip Broadcaster to upload the stream.</p><p>An empty option field means that you don't want to upload Broadcast Ephemeris.</p>"));
    1385   _uploadEphPortLineEdit->setWhatsThis(tr("<p>Specify the IP port of the Ntrip Broadcaster to upload the Broadcast Ephemeris stream. Default is port 80.</p>"));
    1386   _uploadEphMountpointLineEdit->setWhatsThis(tr("<p>Specify a mountpoint for uploading the Broadcast Ephemeris stream.</p>"));
    1387   _uploadEphPasswordLineEdit->setWhatsThis(tr("<p>Specify the stream upload password protecting the mounpoint on the Ntrip Broadcaster.</p>"));
    1388   _uploadEphSampleSpinBox->setWhatsThis(tr("<p>Select the Broadcast Ephemeris sampling interval in seconds.</p><p>Default is '5', meaning that a complete set of Broadcast Ephemeris is uploaded every 5 seconds.</p>"));
    1389   _uploadEphBytesCounter->setWhatsThis(tr("<p>BNC shows the amount of data uploaded via this stream.</p>"));
    1390 // weber
     1402  _uploadEphTable->setWhatsThis(tr("<p>BNC can upload a Broadcast Ephemeris stream in RTCM Version 3 format. Specify the IP number or URL of an Ntrip Broadcaster to upload the respective stream.</p>"));
     1403  addUploadEphRowButton->setWhatsThis(tr("<p>Hit 'Add Row' button to add another line to the 'Upload Ephemeris' table.</p>"));
     1404  delUploadEphRowButton->setWhatsThis(tr("<p>Hit 'Del Row' button to delete the highlighted line(s) from the 'Upload Ephemeris' table.</p>"));
     1405  _uploadSamplRtcmEphSpinBox->setWhatsThis(tr("<p>Select the Broadcast Ephemeris sampling interval in seconds.</p><p>Default is '5', meaning that a complete set of Broadcast Ephemeris is uploaded every 5 seconds.</p>"));
    13911406
    13921407  // WhatsThis, Streams Canvas
     
    14941509  _mountPointsTable->deleteLater();
    14951510  delete _log;
     1511  delete _loggroup;
    14961512  _cmbTable->deleteLater();
    14971513  delete _cmbMaxresLineEdit;
    14981514  delete _cmbUseGlonass;
    14991515  delete _cmbSamplSpinBox;
    1500   delete _cmbMethodComboBox;
     1516  delete _cmbMethodComboBox;;
     1517  _uploadEphTable->deleteLater();
     1518  delete _uploadSamplRtcmEphCorrSpinBox;
    15011519  _uploadTable->deleteLater();
    15021520  delete _uploadIntrComboBox;
    15031521  delete _uploadAntexFile;
    1504   delete _uploadSamplRtcmEphCorrSpinBox;
     1522  delete _uploadSamplRtcmEphSpinBox;
    15051523  delete _uploadSamplSp3SpinBox;
    15061524  delete _uploadSamplClkRnxSpinBox;
    1507   delete _uploadEphHostLineEdit;
    1508   delete _uploadEphPortLineEdit;
    1509   delete _uploadEphPasswordLineEdit;
    1510   delete _uploadEphMountpointLineEdit;
    1511   delete _uploadEphSampleSpinBox;
    1512   delete _uploadEphBytesCounter;
    1513   delete _loggroup;
    15141525  delete _reqcActionComboBox;
    15151526  delete _reqcObsFileChooser;
     
    18471858    if (!hlp.isEmpty()) {
    18481859      uploadMountpointsOut << hlp;
     1860    }
     1861  }
     1862
     1863  QStringList uploadEphMountpointsOut;
     1864  for (int iRow = 0; iRow < _uploadEphTable->rowCount(); iRow++) {
     1865    QString hlp;
     1866    for (int iCol = 0; iCol < _uploadEphTable->columnCount(); iCol++) {
     1867      if (_uploadEphTable->cellWidget(iRow, iCol) &&
     1868          (iCol == 3 || iCol == 4 || iCol == 5)) {
     1869        if      (iCol == 3) {
     1870          QLineEdit* passwd = (QLineEdit*)(_uploadEphTable->cellWidget(iRow, iCol));
     1871          hlp += passwd->text() + ",";
     1872        }
     1873        else if (iCol == 4) {
     1874          QComboBox* system = (QComboBox*)(_uploadEphTable->cellWidget(iRow, iCol));
     1875          hlp += system->currentText() + ",";
     1876        }
     1877      }
     1878      else if (_uploadEphTable->item(iRow, iCol)) {
     1879        hlp += _uploadEphTable->item(iRow, iCol)->text() + ",";
     1880      }
     1881    }
     1882    if (!hlp.isEmpty()) {
     1883      uploadEphMountpointsOut << hlp;
    18491884    }
    18501885  }
     
    19561991  settings.setValue("uploadAntexFile",        _uploadAntexFile->fileName());
    19571992// Upload Ephemeris
    1958   settings.setValue("uploadEphHost",      _uploadEphHostLineEdit->text());
    1959   settings.setValue("uploadEphPort",      _uploadEphPortLineEdit->text());
    1960   settings.setValue("uploadEphMountpoint",_uploadEphMountpointLineEdit->text());
    1961   settings.setValue("uploadEphPassword",  _uploadEphPasswordLineEdit->text());
    1962   settings.setValue("uploadEphSample",    _uploadEphSampleSpinBox->value());
     1993  if (!uploadEphMountpointsOut.isEmpty()) {
     1994    settings.setValue("uploadEphMountpointsOut", uploadEphMountpointsOut);
     1995  }
     1996  else {
     1997    settings.setValue("uploadEphMountpointsOut", "");
     1998  }
     1999  settings.setValue("uploadSamplRtcmEph", _uploadSamplRtcmEphSpinBox->value());
    19632000
    19642001  if (_caster) {
     
    20682105  if (_uploadTable->rowCount() > 0)
    20692106      BNC_CORE->slotMessage("Panel 'Upload Corrections' active", true);
    2070   if (!_uploadEphHostLineEdit->text().isEmpty())
     2107  if (_uploadEphTable->rowCount() > 0)
    20712108      BNC_CORE->slotMessage("Panel 'UploadEphemeris' active", true);
    20722109
     
    20952132
    20962133  _casterEph = new bncEphUploadCaster();
    2097   connect(_casterEph, SIGNAL(newBytes(QByteArray,double)),
    2098           _uploadEphBytesCounter, SLOT(slotNewBytes(QByteArray,double)));
    20992134}
    21002135
     
    24512486  }
    24522487
    2453   // Enable/disable Broadcast Ephemerides
    2454   // ------------------------------------
    2455   if (sender() == 0 || sender() == _uploadEphHostLineEdit) {
    2456     enable = !_uploadEphHostLineEdit->text().isEmpty();
    2457     enableWidget(enable, _uploadEphPortLineEdit);
    2458     enableWidget(enable, _uploadEphMountpointLineEdit);
    2459     enableWidget(enable, _uploadEphPasswordLineEdit);
    2460     enableWidget(enable, _uploadEphSampleSpinBox);
    2461   }
    2462 
    24632488  // Combine Corrections
    24642489  // -------------------
     
    24952520    enableWidget(false, _uploadSamplSp3SpinBox);
    24962521    enableWidget(false, _uploadAntexFile);
     2522  }
     2523
     2524  // Upload(eph)
     2525  // -----------
     2526  iRow = _uploadEphTable->rowCount();
     2527  if (iRow > 0) {
     2528    enableWidget(true, _uploadSamplRtcmEphSpinBox);
     2529  }
     2530  else {
     2531    enableWidget(false, _uploadSamplRtcmEphSpinBox);
    24972532  }
    24982533
     
    27202755}
    27212756
     2757//
     2758////////////////////////////////////////////////////////////////////////////
     2759void bncWindow::slotAddUploadEphRow() {
     2760  int iRow = _uploadEphTable->rowCount();
     2761  _uploadEphTable->insertRow(iRow);
     2762  for (int iCol = 0; iCol < _uploadEphTable->columnCount(); iCol++) {
     2763    if      (iCol == 3) {
     2764      QLineEdit* passwd = new QLineEdit();
     2765      passwd->setFrame(false);
     2766      passwd->setEchoMode(QLineEdit::PasswordEchoOnEdit);
     2767      _uploadEphTable->setCellWidget(iRow, iCol, passwd);
     2768    }
     2769    else if (iCol == 4) {
     2770      QComboBox* system = new QComboBox();
     2771      system->setEditable(false);
     2772      system->addItems(QString("ALL,GPS,GLONASS,Galileo,BDS,QZSS,SBAS").split(","));
     2773      system->setFrame(false);
     2774      _uploadEphTable->setCellWidget(iRow, iCol, system);
     2775    }
     2776    else if (iCol == 5) {
     2777      bncTableItem* bncIt = new bncTableItem();
     2778      bncIt->setFlags(bncIt->flags() & ~Qt::ItemIsEditable);
     2779      _uploadEphTable->setItem(iRow, iCol, bncIt);
     2780      BNC_CORE->_uploadTableItems[iRow] = bncIt;
     2781    }
     2782    else {
     2783      _uploadEphTable->setItem(iRow, iCol, new QTableWidgetItem(""));
     2784    }
     2785  }
     2786}
     2787
     2788//
     2789////////////////////////////////////////////////////////////////////////////
     2790void bncWindow::slotDelUploadEphRow() {
     2791  BNC_CORE->_uploadTableItems.clear();
     2792  int nRows = _uploadEphTable->rowCount();
     2793  bool flg[nRows];
     2794  for (int iRow = 0; iRow < nRows; iRow++) {
     2795    if (_uploadEphTable->isItemSelected(_uploadEphTable->item(iRow,1))) {
     2796      flg[iRow] = true;
     2797    }
     2798    else {
     2799      flg[iRow] = false;
     2800    }
     2801  }
     2802  for (int iRow = nRows-1; iRow >= 0; iRow--) {
     2803    if (flg[iRow]) {
     2804      _uploadEphTable->removeRow(iRow);
     2805    }
     2806  }
     2807  for (int iRow = 0; iRow < _uploadTable->rowCount(); iRow++) {
     2808    BNC_CORE->_uploadTableItems[iRow] =
     2809                                (bncTableItem*) _uploadEphTable->item(iRow, 5);
     2810  }
     2811  nRows = _uploadEphTable->rowCount();
     2812  if (nRows < 1) {
     2813    enableWidget(false, _uploadSamplRtcmEphSpinBox);
     2814  }
     2815}
     2816
     2817//
     2818////////////////////////////////////////////////////////////////////////////
     2819void bncWindow::populateUploadEphTable() {
     2820  for (int iRow = _uploadEphTable->rowCount()-1; iRow >=0; iRow--) {
     2821    _uploadEphTable->removeRow(iRow);
     2822  }
     2823
     2824  bncSettings settings;
     2825
     2826  int iRow = -1;
     2827  QListIterator<QString> it(settings.value("uploadEphMountpointsOut").toStringList());
     2828  while (it.hasNext()) {
     2829    QStringList hlp = it.next().split(",");
     2830    if (hlp.size() > 4) {
     2831      ++iRow;
     2832      _uploadEphTable->insertRow(iRow);
     2833    }
     2834    for (int iCol = 0; iCol < hlp.size(); iCol++) {
     2835      if      (iCol == 3) {
     2836        QLineEdit* passwd = new QLineEdit();
     2837        passwd->setFrame(false);
     2838        passwd->setEchoMode(QLineEdit::PasswordEchoOnEdit);
     2839        passwd->setText(hlp[iCol]);
     2840        _uploadEphTable->setCellWidget(iRow, iCol, passwd);
     2841      }
     2842      else if (iCol == 4) {
     2843        QComboBox* system = new QComboBox();
     2844        system->setEditable(false);
     2845        system->addItems(QString("ALL,GPS,GLONASS,Galileo,BDS,QZSS,SBAS").split(","));
     2846        system->setFrame(false);
     2847        system->setCurrentIndex(system->findText(hlp[iCol]));
     2848        _uploadEphTable->setCellWidget(iRow, iCol, system);
     2849      }
     2850      else if (iCol == 5) {
     2851        bncTableItem* bncIt = new bncTableItem();
     2852        bncIt->setFlags(bncIt->flags() & ~Qt::ItemIsEditable);
     2853        _uploadEphTable->setItem(iRow, iCol, bncIt);
     2854        BNC_CORE->_uploadTableItems[iRow] = bncIt;
     2855      }
     2856      else {
     2857        _uploadEphTable->setItem(iRow, iCol, new QTableWidgetItem(hlp[iCol]));
     2858      }
     2859    }
     2860  }
     2861}
     2862
     2863
    27222864// Progress Bar Change
    27232865////////////////////////////////////////////////////////////////////////////
  • trunk/BNC/src/bncwindow.h

    r7513 r7889  
    6565    void AddToolbar();
    6666
    67   public slots: 
     67  public slots:
    6868    void slotMountPointsRead(QList<bncGetThread*>);
    6969    void slotBncTextChanged();
     
    9191    void slotAddUploadRow();
    9292    void slotDelUploadRow();
     93    void slotAddUploadEphRow();
     94    void slotDelUploadEphRow();
    9395    void slotSetUploadTrafo();
    9496    void slotReqcEditOption();
     
    104106    void populateCmbTable();
    105107    void populateUploadTable();
     108    void populateUploadEphTable();
    106109    void enableWidget(bool enable, QWidget* widget);
    107110    void startRealTime();
     
    116119    QAction*   _actFontSel;
    117120    QAction*   _actSaveOpt;
    118     QAction*   _actQuit; 
     121    QAction*   _actQuit;
    119122    QAction*   _actMapMountPoints;
    120123    QAction*   _actStart;
     
    221224    qtFileChooser* _uploadAntexFile;
    222225
    223     QLineEdit*       _uploadEphHostLineEdit;
    224     QLineEdit*       _uploadEphPortLineEdit;
    225     QLineEdit*       _uploadEphPasswordLineEdit;
    226     QLineEdit*       _uploadEphMountpointLineEdit;
    227     QSpinBox*        _uploadEphSampleSpinBox;
    228     bncBytesCounter* _uploadEphBytesCounter;
     226    QTableWidget*  _uploadEphTable;
     227    QSpinBox*      _uploadSamplRtcmEphSpinBox;
    229228
    230229    bncCaster*          _caster;
     
    237236    bool _runningSp3Comp;
    238237
    239     bool running() {return _runningRealTime || _runningPPP || _runningEdit || 
     238    bool running() {return _runningRealTime || _runningPPP || _runningEdit ||
    240239                    _runningQC || _runningSp3Comp;}
    241240
     
    253252 Q_INTERFACES(GnssCenter::t_pluginFactoryInterface)
    254253 public:
    255   virtual QWidget* create() {return new bncWindow();} 
     254  virtual QWidget* create() {return new bncWindow();}
    256255  virtual QString getName() const {return QString("BNC");}
    257256};
  • trunk/BNC/src/upload/bncephuploadcaster.cpp

    r7717 r7889  
    2727bncEphUploadCaster::bncEphUploadCaster() : bncEphUser(true) {
    2828  bncSettings settings;
     29  int     sampl    = settings.value("uploadSamplRtcmEph").toInt();
    2930
    30   QString mountpoint = settings.value("uploadEphMountpoint").toString();
    31   if (mountpoint.isEmpty()) {
    32     _ephUploadCaster = 0;
    33   }
    34   else {
    35     QString outHost  = settings.value("uploadEphHost").toString();
    36     int     outPort  = settings.value("uploadEphPort").toInt();
    37     QString password = settings.value("uploadEphPassword").toString();
    38     int     sampl    = settings.value("uploadEphSample").toInt();
     31  // List of upload casters
     32  // ----------------------
     33  int iRow = -1;
     34  QListIterator<QString> it(settings.value("uploadEphMountpointsOut").toStringList());
     35  while (it.hasNext()) {
     36    QStringList hlp = it.next().split(",");
     37    if (hlp.size() > 3) {
     38      ++iRow;
     39      int  outPort = hlp[1].toInt();
     40      bncUploadCaster* newCaster = new bncUploadCaster(hlp[2], hlp[0], outPort,
     41                                                       hlp[3], iRow, sampl);
    3942
    40     _ephUploadCaster = new bncUploadCaster(mountpoint, outHost, outPort,
    41                                            password, -1, sampl);
     43      connect(newCaster, SIGNAL(newBytes(QByteArray,double)),
     44              this, SIGNAL(newBytes(QByteArray,double)));
    4245
    43     connect(_ephUploadCaster, SIGNAL(newBytes(QByteArray,double)),
    44           this, SIGNAL(newBytes(QByteArray,double)));
    45 
    46     _ephUploadCaster->start();
     46      newCaster->start();
     47      _casters.push_back(newCaster);
     48    }
    4749  }
    4850}
     
    5153////////////////////////////////////////////////////////////////////////////
    5254bncEphUploadCaster::~bncEphUploadCaster() {
    53   if (_ephUploadCaster) {
    54     _ephUploadCaster->deleteSafely();
     55  for (int ic = 0; ic < _casters.size(); ic++) {
     56    _casters[ic]->deleteSafely();
    5557  }
    5658}
     
    5961////////////////////////////////////////////////////////////////////////////
    6062void bncEphUploadCaster::ephBufferChanged() {
    61   if (_ephUploadCaster) {
    62     QByteArray outBuffer;
     63  bncSettings settings;
     64  int iRow = -1;
     65  QListIterator<QString> it(settings.value("uploadEphMountpointsOut").toStringList());
     66  while (it.hasNext()) {
     67    QStringList hlp = it.next().split(",");
     68    if (hlp.size() > 3) {
     69      ++iRow;
     70      QString system = hlp[4];
     71      QByteArray outBuffer;
    6372
    64     QDateTime now = currentDateAndTimeGPS();
    65     bncTime currentTime(now.toString(Qt::ISODate).toStdString());
     73      QDateTime now = currentDateAndTimeGPS();
     74      bncTime currentTime(now.toString(Qt::ISODate).toStdString());
    6675
    67     QListIterator<QString> it(prnList());
    68     while (it.hasNext()) {
    69       const t_eph* eph = ephLast(it.next());
     76      QListIterator<QString> it(prnList());
     77      while (it.hasNext()) {
     78        const t_eph* eph = ephLast(it.next());
    7079
    71       bncTime toc = eph->TOC();
    72       double timeDiff = fabs(toc - currentTime);
     80        bncTime toc = eph->TOC();
     81        double timeDiff = fabs(toc - currentTime);
    7382
    74       const t_ephGPS*  ephGPS  = dynamic_cast<const t_ephGPS*>(eph);
    75       const t_ephGlo*  ephGlo  = dynamic_cast<const t_ephGlo*>(eph);
    76       const t_ephGal*  ephGal  = dynamic_cast<const t_ephGal*>(eph);
    77       const t_ephSBAS* ephSBAS = dynamic_cast<const t_ephSBAS*>(eph);
    78       const t_ephBDS*  ephBDS  = dynamic_cast<const t_ephBDS*>(eph);
     83        const t_ephGPS*  ephGPS  = dynamic_cast<const t_ephGPS*>(eph);
     84        const t_ephGlo*  ephGlo  = dynamic_cast<const t_ephGlo*>(eph);
     85        const t_ephGal*  ephGal  = dynamic_cast<const t_ephGal*>(eph);
     86        const t_ephSBAS* ephSBAS = dynamic_cast<const t_ephSBAS*>(eph);
     87        const t_ephBDS*  ephBDS  = dynamic_cast<const t_ephBDS*>(eph);
    7988
    80       unsigned char Array[80];
    81       int size = 0;
     89        unsigned char Array[80];
     90        int size = 0;
    8291
    83       if (ephGPS) {
    84         if (timeDiff <= 4*3600) {
    85           size = t_ephEncoder::RTCM3(*ephGPS, Array);
     92        if (ephGPS && ephGPS->type() == t_eph::GPS &&
     93            (system == "ALL" || system == "GPS")) {
     94          if (timeDiff <= 4*3600) {
     95            size = t_ephEncoder::RTCM3(*ephGPS, Array);
     96          }
     97        }
     98        else if (ephGPS && ephGPS->type() == t_eph::QZSS &&
     99            (system == "ALL" || system == "QZSS")) {
     100          if (timeDiff <= 4*3600) {
     101            size = t_ephEncoder::RTCM3(*ephGPS, Array);
     102          }
     103        }
     104        else if (ephGlo && (system == "ALL" || system == "GLONASS")) {
     105          if (timeDiff <= 1*3600) {
     106            size = t_ephEncoder::RTCM3(*ephGlo, Array);
     107          }
     108        }
     109        else if (ephGal && (system == "ALL" || system == "Galileo")) {
     110          if (timeDiff <= 4*3600) {
     111            size = t_ephEncoder::RTCM3(*ephGal, Array);
     112          }
     113        }
     114        else if (ephSBAS && (system == "ALL" || system == "SBAS")) {
     115          if (timeDiff <= 600) {
     116            size = t_ephEncoder::RTCM3(*ephSBAS, Array);
     117          }
     118        }
     119        else if (ephBDS && (system == "ALL" || system == "BDS")) {
     120          if (timeDiff <= 6*3600) {
     121            size = t_ephEncoder::RTCM3(*ephBDS, Array);
     122          }
     123        }
     124        if (size > 0) {
     125          outBuffer += QByteArray((char*) Array, size);
    86126        }
    87127      }
    88       else if (ephGlo) {
    89         if (timeDiff <= 1*3600) {
    90           size = t_ephEncoder::RTCM3(*ephGlo, Array);
    91         }
     128      if (outBuffer.size() > 0) {
     129        _casters.at(iRow)->setOutBuffer(outBuffer);
    92130      }
    93       else if (ephGal) {
    94         if (timeDiff <= 4*3600) {
    95           size = t_ephEncoder::RTCM3(*ephGal, Array);
    96         }
    97       }
    98       else if (ephSBAS) {
    99         if (timeDiff <= 600) {
    100           size = t_ephEncoder::RTCM3(*ephSBAS, Array);
    101         }
    102       }
    103       else if (ephBDS) {
    104         if (timeDiff <= 6*3600) {
    105           size = t_ephEncoder::RTCM3(*ephBDS, Array);
    106         }
    107       }
    108       if (size > 0) {
    109         outBuffer += QByteArray((char*) Array, size);
    110       }
    111     }
    112     if (outBuffer.size() > 0) {
    113       _ephUploadCaster->setOutBuffer(outBuffer);
    114131    }
    115132  }
  • trunk/BNC/src/upload/bncephuploadcaster.h

    r3254 r7889  
    1616  virtual void ephBufferChanged();
    1717 private:
    18   bncUploadCaster* _ephUploadCaster;
     18//  bncUploadCaster* _ephUploadCaster;
     19  QVector<bncUploadCaster*> _casters;
    1920};
    2021
Note: See TracChangeset for help on using the changeset viewer.