Changeset 6751 in ntrip


Ignore:
Timestamp:
Mar 30, 2015, 5:00:52 PM (7 years ago)
Author:
stuerze
Message:

possibility added to send a manual generated NMEA string with a given sampling rate - so far untested

Location:
trunk/BNC/src
Files:
4 edited

Legend:

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

    r6695 r6751  
    260260    if (settings.value("serialAutoNMEA").toString() == "Manual") {
    261261      _serialNMEA = MANUAL_NMEA;
     262      bncSettings settings;
     263      _manualNMEASampl = settings.value("serialManualNMEASampling").toInt();
     264      QString hlp      = settings.value("serialHeightNMEA").toString();
     265      if (hlp.isEmpty()) {
     266        hlp = "0.0";
     267      }
     268      QByteArray _serialHeightNMEA = hlp.toAscii();
     269      _manualNMEAString = ggaString(_latitude, _longitude, _serialHeightNMEA);
     270
    262271    }
    263272  }
     
    610619    }
    611620    if (_nmea == "yes" && _serialNMEA == MANUAL_NMEA) {
    612       bncSettings settings;
    613       QString hlp = settings.value("serialHeightNMEA").toString();
    614       if (hlp.isEmpty()) {
    615         hlp = "0.0";
    616       }
    617       QByteArray _serialHeightNMEA = hlp.toAscii();
    618       QByteArray gga = ggaString(_latitude, _longitude, _serialHeightNMEA);
    619       _query->startRequest(_mountPoint, gga);
     621      _query->startRequest(_mountPoint, _manualNMEAString);
     622      _lastManualNMEA = QDateTime::currentDateTime();
    620623    }
    621624    else {
     
    812815        }
    813816        if (i1 != -1) {
    814           int i2 = data.indexOf("*", i1);
     817          int i2 = data.indexOf("*", i1);
    815818          if (i2 != -1 && data.size() > i2 + 1) {
    816             QByteArray gga = data.mid(i1,i2-i1+3);
     819            QByteArray gga = data.mid(i1, i2 - i1 + 3);
    817820            _query->sendNMEA(gga);
    818           }
    819         }
     821          }
     822        }
     823      }
     824
     825      if (_nmea == "yes" && _serialNMEA == MANUAL_NMEA) {
     826        if (_manualNMEASampl) {
     827          int dt = _lastManualNMEA.secsTo(QDateTime::currentDateTime());
     828          if (fmod(double(dt), double(_manualNMEASampl)) == 0.0) {
     829            _query->sendNMEA(_manualNMEAString);
     830            _lastManualNMEA = QDateTime::currentDateTime();
     831          }
     832        }
    820833      }
    821834
  • trunk/BNC/src/bncgetthread.h

    r6580 r6751  
    112112   QByteArray                 _nmea;
    113113   QByteArray                 _ntripVersion;
     114   QByteArray                 _manualNMEAString;
     115   QDateTime                  _lastManualNMEA;
     116   int                        _manualNMEASampl;
    114117   int                        _nextSleep;
    115118   int                        _iMount;
  • trunk/BNC/src/bncwindow.cpp

    r6746 r6751  
    212212  _rnxSkelLineEdit->setMaximumWidth(5*ww);
    213213  _rnxScrpLineEdit    = new QLineEdit(settings.value("rnxScript").toString());
    214   _rnxV3CheckBox = new QCheckBox();
     214  _rnxV3CheckBox      = new QCheckBox();
    215215  _rnxV3CheckBox->setCheckState(Qt::CheckState(settings.value("rnxV3").toInt()));
    216216  QString hlp = settings.value("rnxV2Priority").toString();
     
    330330  _serialFileNMEALineEdit    = new QLineEdit(settings.value("serialFileNMEA").toString());
    331331  _serialHeightNMEALineEdit  = new QLineEdit(settings.value("serialHeightNMEA").toString());
     332
     333  _serialManualNMEASamplingSpinBox = new QSpinBox();
     334  _serialManualNMEASamplingSpinBox->setMinimum(0);
     335  _serialManualNMEASamplingSpinBox->setMaximum(300);
     336  _serialManualNMEASamplingSpinBox->setSingleStep(10);
     337  _serialManualNMEASamplingSpinBox->setValue(settings.value("serialManualNMEASampling").toInt());
     338  _serialManualNMEASamplingSpinBox->setSuffix(" sec");
    332339
    333340  connect(_serialMountPointLineEdit, SIGNAL(textChanged(const QString &)),
     
    765772  _serialAutoNMEAComboBox->setMaximumWidth(9*ww);
    766773  _serialHeightNMEALineEdit->setMaximumWidth(8*ww);
     774  _serialManualNMEASamplingSpinBox->setMaximumWidth(8*ww);
    767775
    768776  serLayout->addWidget(new QLabel("Port settings to feed a serial connected receiver.<br>"),0,0,1,30);
     
    787795  serLayout->addWidget(new QLabel("Height"),                      5,14, Qt::AlignRight); // 20
    788796  serLayout->addWidget(_serialHeightNMEALineEdit,                 5,15, 1,11);
     797  serLayout->addWidget(new QLabel("Sampling"),                    5,25, Qt::AlignRight);
     798 serLayout->addWidget(_serialManualNMEASamplingSpinBox,           5,26, 1,12);
    789799  serLayout->addWidget(new QLabel(""),                            6, 1);
    790800  serLayout->setRowStretch(7, 999);
     
    13081318  _serialFileNMEALineEdit->setWhatsThis(tr("<p>Specify the full path to a file where NMEA messages coming from your serial connected receiver are saved.</p><p>Default is an empty option field, meaning that NMEA messages will not be saved on disk.</p>"));
    13091319  _serialHeightNMEALineEdit->setWhatsThis(tr("<p>Specify an approximate 'Height' above mean sea level in meters for the reference station introduced through 'Mountpoint'. Together with the latitude and longitude from the NTRIP broadcaster sourcetable the height information is used to build one initial GPGGA message to be sent to the NTRIP broadcaster.</p><p>This option is only relevant when option 'NMEA' is set to 'Manual'.</p>"));
     1320  _serialManualNMEASamplingSpinBox->setWhatsThis(tr("<p>Select the sampling interval in seconds for manual generated NMEA string. A sampling rate of '0' means, the NMEA string will be send only once. </p>"));
    13101321  _reqcActionComboBox->setWhatsThis(tr("<p>BNC allows to 'Edit or Concatenate' RINEX v2 or v3 files or to perform a quality check and 'Analyze' the data following UNAVCO's famous 'teqc' program.</p>"));
    13111322  _reqcEditOptionButton->setWhatsThis(tr("<p>Specify options for editing RINEX v2 or v3 files.</p>"));
     
    17191730  settings.setValue("serialStopBits",  _serialStopBitsComboBox->currentText());
    17201731  settings.setValue("serialAutoNMEA",  _serialAutoNMEAComboBox->currentText());
    1721   settings.setValue("serialFileNMEA",_serialFileNMEALineEdit->text());
    1722   settings.setValue("serialHeightNMEA",_serialHeightNMEALineEdit->text());
     1732  settings.setValue("serialFileNMEA",    _serialFileNMEALineEdit->text());
     1733  settings.setValue("serialHeightNMEA",  _serialHeightNMEALineEdit->text());
     1734  settings.setValue("serialMaualSampling", _serialManualNMEASamplingSpinBox->value());
    17231735// Outages
    17241736  settings.setValue("obsRate",     _obsRateComboBox->currentText());
     
    22082220    bool enable3 = enable && _serialAutoNMEAComboBox->currentText() == "Manual";
    22092221    enableWidget(enable3, _serialHeightNMEALineEdit);
     2222    enableWidget(enable3, _serialManualNMEASamplingSpinBox);
    22102223  }
    22112224
  • trunk/BNC/src/bncwindow.h

    r6666 r6751  
    188188    QLineEdit* _serialFileNMEALineEdit;
    189189    QComboBox* _serialAutoNMEAComboBox;
     190    QSpinBox*  _serialManualNMEASamplingSpinBox;
    190191
    191192    QLineEdit*   _LatLineEdit;
Note: See TracChangeset for help on using the changeset viewer.