Changeset 658 in ntrip


Ignore:
Timestamp:
Jan 28, 2008, 3:50:05 PM (16 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM3/RTCM3Decoder.cpp

    r649 r658  
    9090t_irc RTCM3Decoder::Decode(char* buffer, int bufLen) {
    9191
     92  bool decoded = false;
     93
    9294  for (int ii = 0; ii < bufLen; ii++) {
    9395
     
    100102        // -----------------
    101103        if (rr == 1 || rr == 2) {
     104                decoded = true;
    102105
    103106          if (!_Parser.init) {
     
    185188        // -------------
    186189        else if (rr == 1019) {
     190          decoded = true;
    187191          gpsephemeris* ep = new gpsephemeris(_Parser.ephemerisGPS);
    188192          emit _ephSender.newGPSEph(ep);
     
    192196        // -----------------
    193197        else if (rr == 1020) {
     198          decoded = true;
    194199          glonassephemeris* ep = new glonassephemeris(_Parser.ephemerisGLONASS);
    195200          emit _ephSender.newGlonassEph(ep);
     
    198203    }
    199204  }
     205  if (!decoded) {
     206  return failure;
     207  }
     208  else {
    200209  return success;
    201 }
     210  }
     211}
  • trunk/BNC/bnc.pro

    r635 r658  
    22# Switch to debug configuration
    33# -----------------------------
    4 ### CONFIG -= release
    5 ### CONFIG += debug
     4CONFIG -= release
     5CONFIG += debug
    66
    77DEFINES += NO_RTCM3_MAIN
  • trunk/BNC/bncgetthread.cpp

    r657 r658  
    103103    _staID = _staID.left(_staID.length()-1) + QString("%1").arg(num).toAscii();
    104104  }   
     105
     106  // Notice threshold
     107  // ----------------
     108  _inspSegm = settings.value("inspSegm").toInt();
     109  _noticeFail = settings.value("noticeFail").toInt();
     110  _noticeReco = settings.value("noticeReco").toInt();
     111  _noticeScript = settings.value("noticeScript").toString();
     112  expandEnvVar(_noticeScript);
    105113
    106114  // RINEX writer
     
    374382  }
    375383
     384  bool decode = true;
     385  int numSucc = 0;
     386  int secSucc = 0;
     387  int secFail = 0;
     388  int initPause = 30;
     389  int currPause = 0;
     390  bool begCorrupt = false;
     391  bool endCorrupt = false;
     392  _decodeTime = QDateTime::currentDateTime();
     393 
     394  if (initPause < _inspSegm) {
     395    initPause = _inspSegm;
     396  }
     397  if ( _noticeFail < 1 && _noticeReco < 1 ) {
     398    initPause = 0;
     399  }
     400  currPause = initPause;
     401
    376402  // Read Incoming Data
    377403  // ------------------
     
    397423        _socket->read(data, nBytes);
    398424
    399         if ( !_decodeFailure.isValid() ||
    400              _decodeFailure.secsTo(QDateTime::currentDateTime()) > 60 ) {
    401           if ( _decoder->Decode(data, nBytes) == success ) {
    402             _decodeFailure.setDate(QDate());
    403             _decodeFailure.setTime(QTime());
    404           }
    405           else {
    406             _decodeFailure = QDateTime::currentDateTime();
     425      if (_inspSegm<1) {
     426        _decoder->Decode(data, nBytes);
     427      }
     428      else {
     429
     430        // Decode data
     431        // -----------
     432        if (!_decodePause.isValid() ||
     433          _decodePause.secsTo(QDateTime::currentDateTime()) >= currPause )  {
     434
     435          if (decode) {
     436            if ( _decoder->Decode(data, nBytes) == success ) {
     437              numSucc += 1;
     438            }
     439            if ( _decodeTime.secsTo(QDateTime::currentDateTime()) > _inspSegm ) {
     440              decode = false;
     441            }
     442          }
     443
     444          // Check - once per inspect segment
     445          // --------------------------------
     446          if (!decode) {
     447            _decodeTime = QDateTime::currentDateTime();
     448            if (numSucc>0) {
     449              secSucc += _inspSegm;
     450              if (secSucc > _noticeReco * 60) {
     451                secSucc = _noticeReco * 60 + 1;
     452              }
     453              numSucc = 0;
     454              currPause = initPause;
     455              _decodePause.setDate(QDate());
     456              _decodePause.setTime(QTime());
     457            }
     458            else {
     459              secFail += _inspSegm;
     460              secSucc = 0;
     461              if (secFail > _noticeFail * 60) {
     462                secFail = _noticeFail * 60 + 1;
     463              }
     464              if (!_decodePause.isValid()) {
     465                _decodePause = QDateTime::currentDateTime();
     466              }
     467              else {
     468                _decodePause.setDate(QDate());
     469                _decodePause.setTime(QTime());
     470                secFail = secFail + currPause - _inspSegm;
     471                currPause = currPause * 2;
     472                if (currPause > 960) {
     473                currPause = 960;
     474                }
     475              }
     476            }
     477
     478            // End corrupt threshold
     479            // ---------------------
     480            if ( begCorrupt && !endCorrupt && secSucc > _noticeReco * 60 ) {
     481              emit(newMessage(_staID + ": End_Corrupted threshold exceeded"));
     482              callScript("End_Corrupted");
     483              endCorrupt = true;
     484              begCorrupt = false;
     485              secFail = 0;
     486            }
     487            else {
     488
     489              // Begin corrupt threshold
     490              // -----------------------
     491              if ( !begCorrupt && secFail > _noticeFail * 60 ) {
     492                emit(newMessage(_staID + ": Begin_Corrupted threshold exceeded"));
     493                callScript("Begin_Corrupted");
     494                begCorrupt = true;
     495                endCorrupt = false;
     496                secSucc = 0;
     497                numSucc = 0;
     498              }
     499            }
     500            decode = true;
    407501          }
    408502        }
    409         else {
    410           if ( _decodeFailure.isValid() &&
    411                _decodeFailure.secsTo(QDateTime::currentDateTime()) < 5 &&
    412                _decoder->Decode(data, nBytes) == success ) {
    413                _decodeFailure.setDate(QDate());
    414                _decodeFailure.setTime(QTime());
    415           }
    416         }
     503      }
     504
     505      // End outage threshold
     506      // --------------------
     507      if ( _decodeStart.isValid() && _decodeStart.secsTo(QDateTime::currentDateTime()) > _noticeReco * 60 ) {
     508        _decodeStart.setDate(QDate());
     509        _decodeStart.setTime(QTime());
     510        emit(newMessage(_staID + ": End_Outage threshold exceeded"));
     511        callScript("End_Outage");
     512      }
    417513
    418514        delete [] data;
     
    425521          // -----------------------
    426522          int    week;
     523          bool   wrongEpoch = false;
    427524          double sec;
    428525          currentGPSWeeks(week, sec);
     
    441538          double dt = fabs(sec - obs->_o.GPSWeeks);
    442539          if (week != obs->_o.GPSWeek || dt > maxDt) {
    443             emit( newMessage("Wrong observation epoch") );
     540            if  (!wrongEpoch) {
     541              emit( newMessage(_staID + ": Wrong observation epoch") );
     542              wrongEpoch = true;
     543            }
    444544            delete obs;
    445545            continue;
     546          }
     547          else {
     548            wrongEpoch = false;
    446549          }
    447550
     
    491594    _rnx->setReconnectFlag(true);
    492595  }
     596  if ( !_decodeStart.isValid()) {
     597    _decodeStop = QDateTime::currentDateTime();
     598  }
    493599  while (1) {
    494600    delete _socket; _socket = 0;
    495601    sleep(_nextSleep);
    496602    if ( initRun() == success ) {
     603      if ( !_decodeStop.isValid()) {
     604        _decodeStart = QDateTime::currentDateTime();
     605      }
    497606      break;
    498607    }
    499608    else {
     609
     610      // Begin outage threshold
     611      // ----------------------
     612      if ( _decodeStop.isValid() && _decodeStop.secsTo(QDateTime::currentDateTime()) > _noticeFail * 60 ) {
     613        _decodeStop.setDate(QDate());
     614        _decodeStop.setTime(QTime());
     615        emit(newMessage(_staID + ": Begin_Outage threshold exceeded"));
     616        callScript("Begin_Outage");
     617      }
    500618      _nextSleep *= 2;
    501619      if (_nextSleep > 256) {
     
    507625  _nextSleep = 1;
    508626}
     627
     628// Call notice advisory script   
     629////////////////////////////////////////////////////////////////////////////
     630void bncGetThread::callScript(const char* _comment) {
     631  if (!_noticeScript.isEmpty()) {
     632#ifdef WIN32
     633    QProcess::startDetached(_noticeScript, QStringList() << _staID << _comment) ;
     634#else
     635    QProcess::startDetached("nohup", QStringList() << _noticeScript << _staID << _comment) ;
     636#endif
     637  }
     638}
  • trunk/BNC/bncgetthread.h

    r651 r658  
    6565   void  exit(int exitCode = 0);
    6666   void  tryReconnect();
     67   void  callScript(const char* _comment);
    6768   GPSDecoder* _decoder;
    6869   QTcpSocket* _socket;
     
    7475   QByteArray  _longitude;
    7576   QByteArray  _nmea;
     77   QString     _noticeScript;
     78   int         _inspSegm;
     79   int         _noticeFail;
     80   int         _noticeReco;
    7681   int         _timeOut;
    7782   int         _nextSleep;
     
    8085   bncRinex*   _rnx;
    8186   QDateTime   _decodeFailure;
     87   QDateTime   _decodeStart;
     88   QDateTime   _decodeStop;
     89   QDateTime   _decodePause;
     90   QDateTime   _decodeTime;
    8291};
    8392
  • trunk/BNC/bnchelp.html

    r644 r658  
    7777&nbsp; &nbsp; &nbsp; 3.6.2. <a href=#ephvers>RINEX Version</a><br>
    7878&nbsp; &nbsp; &nbsp; 3.6.3. <a href=#ephinterval>Ephemeris File Interval</a><br>
    79 3.7. <a href=#mountpoints>Mountpoints</a><br>
    80 &nbsp; &nbsp; &nbsp; 3.7.1. <a href=#AddMounts>Add Mountpoints</a><br>
    81 &nbsp; &nbsp; &nbsp; 3.7.2. <a href=#HostPort>Broadcaster Host and Port</a><br>
    82 &nbsp; &nbsp; &nbsp; 3.7.3. <a href=#account>Broadcaster User and Password</a><br>
    83 &nbsp; &nbsp; &nbsp; 3.7.4. <a href=#GetTable>Get Table</a><br>
    84 &nbsp; &nbsp; &nbsp; 3.7.5. <a href=#delete>Delete Mountpoints</a><br>
    85 &nbsp; &nbsp; &nbsp; 3.7.6. <a href=#edit>Edit Mountpoints</a><br>
    86 3.8. <a href=#log>Log</a><br>
    87 3.9. <a href=#start>Start</a><br>
    88 3.10. <a href=#stop>Stop</a><br>
    89 3.11. <a href=#nw>No Window</a>
     793.7. <a href=#thresholds>Notice Advisories</a><br>
     80&nbsp; &nbsp; &nbsp; 3.7.1. <a href=#threshFail>Failure Threshold</a><br>
     81&nbsp; &nbsp; &nbsp; 3.7.2. <a href=#threshReco>Recovery Threshold</a><br>
     82&nbsp; &nbsp; &nbsp; 3.7.3. <a href=#inspectSegm>Inspect Segment</a><br>
     83&nbsp; &nbsp; &nbsp; 3.7.4. <a href=#noteScript>Notice Script</a><br>
     843.8. <a href=#mountpoints>Mountpoints</a><br>
     85&nbsp; &nbsp; &nbsp; 3.8.1. <a href=#AddMounts>Add Mountpoints</a><br>
     86&nbsp; &nbsp; &nbsp; 3.8.2. <a href=#HostPort>Broadcaster Host and Port</a><br>
     87&nbsp; &nbsp; &nbsp; 3.8.3. <a href=#account>Broadcaster User and Password</a><br>
     88&nbsp; &nbsp; &nbsp; 3.8.4. <a href=#GetTable>Get Table</a><br>
     89&nbsp; &nbsp; &nbsp; 3.8.5. <a href=#delete>Delete Mountpoints</a><br>
     90&nbsp; &nbsp; &nbsp; 3.8.6. <a href=#edit>Edit Mountpoints</a><br>
     913.9. <a href=#log>Log</a><br>
     923.10. <a href=#start>Start</a><br>
     933.11. <a href=#stop>Stop</a><br>
     943.12. <a href=#nw>No Window</a>
    9095</p>
    9196
     
    354359</p>
    355360
    356 <p><a name="mountpoints"><h4>3.7. Mountpoints</h4></p>
     361<p><a name="thresholds"><h4>3.7. Notice Advisories</h4></p>
     362<p>
     363It may happen at any time that a stream becomes unavailable or corrupted. Understanding problem situations is of importance for BNC's operator as well as for the affected stream providers so that maintenance efforts can be initiated. Furthermore, continuously trying to decode a corrupted stream can generate an unnecessary workload for BNC.
     364</p>
     365<p>
     366<u>Stream outages:</u> Connection to an NTRIP broadcaster can sometimes be disrupted or a stream requested may temporarily be unavailable. Connection is defined by BNC as broken if no data is coming in for a period of 20 seconds. When this occurs, reconnects are attempted at decreasing rate. BNC first attempts to reconnect with ~1 second lag, if unsuccessful, again in ~2 seconds since the previous attempt. If it is still unsuccessful, it will attempt to reconnect within ~4 seconds since the previous attempt etc. Each attempt doubles the wait time from the previous attempt. The maximum delay between attempts is limited to ~256 seconds. This reconnection process is documented in the 'Log' file/section.
     367</p>
     368<p>
     369<u>Stream corruption:</u> Not each transfer of a chunk of bits (as received) to BNC's internal decoders necessarily results in the return of valid observations. It may need several chunks till the next observation can be derived. Hence BNC collects all returns (success or failure) coming from a decoder within a certain short 'Inspect segment' time span to then decide whether a stream content is okay or not. When a stream is corrupted, the decoding process can be stopped temporarily. Decodings are tried again at decreasing rate. BNC first attempts to decode again after a 30 second lag, if unsuccessful, again in 60 seconds since the previous attempt. If it is still unsuccessful, it will attempt to decode after 120 seconds since the previous attempt etc. Each decoding attempt doubles the wait time from the previous attempt. The maximum delay between attempts is limited to 960 seconds.
     370</p>
     371<p>
     372If a persistent stream failure or recovery caused by a stream outage or corruption exceeds the 'Failure' or 'Recovery' threshold, BNC can inform its users about this event. The information becomes available in the 'Log' file/section as a 'Begin_Outage', 'End_Outage', 'Begin_Corrupted', or 'End_Corrupted' message. It can also be passed on as a Notice advisory to a 'Notice script' or batch file to keep BNC's operator or affected stream providers up-to-date by email. This functionality lets you use BNC as a real-time performance monitor and alarm system for the network of GNSS reference stations in use.
     373</p>
     374
     375<p><a name="threshFail"><h4>3.7.1 Failure Threshold - optional</h4></p>
     376<p>A Notice advisory is generated if no or only corrupted observations are received throughout the 'Failure' threshold time span. Specifying a value of 15 min (default) is recommendable to not bother a BNC user with too much information.
     377</p>
     378<p>
     379Note that specifying a value of zero '0' for both, the 'Failure' and the 'Recovery' threshold means that BNC immediately informs about any failure/recovery and that decoding efforts shall never pause.
     380</p>
     381<p>
     382Note further that using this function for corrupted streams needs an 'Inspect segment' greater zero '0'.
     383</p>
     384
     385<p><a name="threshReco"><h4>3.7.2 Recovery Threshold - optional</h4></p>
     386<p>
     387Following a longer lasting stream outage or series of completely corrupted observations, a Notice advisory is generated as soon as a valid observation is received again at least once within the 'Recovery' threshold time span. Specifying a value of 5 min (default) is recommendable to not bother a BNC user with too much information.
     388</p>
     389<p>
     390Note that specifying a value of zero '0' for both, the 'Failure' and the 'Recovery' threshold means that BNC immediately informs about any failure/recovery and that decoding efforts shall never pause.
     391</p>
     392<p>
     393Note further that using this function for corrupted streams needs an 'Inspect segment' greater zero '0'.
     394</p>
     395
     396<p><a name="inspectSegm"><h4>3.7.3 Inspect Segment - mandatory for 'Failure' and 'Recovery' thresholds</h4></p>
     397<p>
     398BNC can collect all returns (failure or success) coming from a decoder within a short 'Inspect segment' time span to then decide whether a stream content is corrupted or not. If a continuous problem (or recovery) is detected, BNC informs about this event. A value of about 15 sec (default) as 'Inspect segment' is recommended when handling 1Hz data. If this value is specified too small, temporary communication bottlenecks my lead to an additional loss of some data of the affected stream.
     399</p>
     400<p>
     401Specifying a value of zero '0' means that you by-pass BNC's corruption check. However, this may result in an additional workload in case of long-lasting stream corruptions. Note that specifying an 'Inspect segment' greater zero '0' is mandatory to generate Notice advisories informing about corrupted streams.
     402</p>
     403
     404<p><a name="noteScript"><h4>3.7.4 Notice Script - optional </h4></p>
     405<p>
     406Specify the full path to a script or batch file to handle Notice advisories generated in case of outages or currupted streams. The affected mountpoint and of a comment 'Begin_Outage', 'End_Outage', 'Begin_Currupted', or 'End_Corrupted' are transfered to the script as command line parameters (%1 and %2 on Windows systems, $1 and $2 on Unix/Linux systems).
     407</p><p>The script may contain commands to archive outage/corrupt information or to send an email to BNC's operator and/or to the affected stream provider. An empty option field or invalid path means that you don't want to use this option.
     408</p>
     409
     410<p><a name="mountpoints"><h4>3.8. Mountpoints</h4></p>
    357411<p>
    358412Each stream on an NTRIP broadcaster is defined using a unique source ID called mountpoint. An NTRIP client like BNC access the desired data stream by referring to its mountpoint. Information about mountpoints is available through the source-table maintained by the NTRIP broadcaster. Note that mountpoints could show up in BNC more than once when retrieving streams from several NTRIP broadcasters.
     
    371425</table>
    372426
    373 <p><a name="AddMounts"><h4>3.7.1 Add Mountpoints</h4></p>
     427<p><a name="AddMounts"><h4>3.8.1 Add Mountpoints</h4></p>
    374428<p>
    375429Button 'Add Mountpoints' opens a window that allows user to select data streams from an NTRIP broadcaster according to their mountpoints.
    376430</p>
    377431
    378 <p><a name="HostPort"><h4>3.7.2 Broadcaster Host and Port - required</h4></p>
     432<p><a name="HostPort"><h4>3.8.2 Broadcaster Host and Port - required</h4></p>
    379433<p>
    380434Enter the NTRIP broadcaster host IP and port number. <u>http://www.rtcm-ntrip.org/home</u> provides information about known NTRIP broadcaster installations. Note that EUREF and IGS operate NTRIP broadcasters at <u>http://www.euref-ip.net/home</u> and <u>http://www.igs-ip.net/home</u>.
    381435</p>
    382436
    383 <p><a name="account"><h4>3.7.3 Broadcaster User and Password - required for protected streams</h4></p>
     437<p><a name="account"><h4>3.8.3 Broadcaster User and Password - required for protected streams</h4></p>
    384438<p>
    385439Some streams on NTRIP broadcasters may be restricted. Enter a valid 'User' ID and 'Password' for access to protected streams. Accounts are usually provided per NTRIP broadcaster through a registration procedure. Register through <u>http://igs.bkg.bund.de/index_ntrip_reg.htm</u> for access to protected streams on <u>www.euref-ip.net</u> and <u>www.igs-ip.net</u>.
    386440</p>
    387441
    388 <p><a name="GetTable"><h4>3.7.4 Get Table</h4></p>
     442<p><a name="GetTable"><h4>3.8.4 Get Table</h4></p>
    389443<p>
    390444Use the 'Get Table' button to download the source-table from the NTRIP broadcaster. Pay attention to data fields 'format' and 'format-details'. Keep in mind that BNC can only decode and convert streams that come in RTCM Version 2.x, RTCM Version 3.x, or RTIGS format. RTCM Version 2.x streams must contain message types 18 and 19 while RTCM Version 3.x streams must contain GPS or SBAS message types 1002 or 1004 and may contain GLONASS message types 1010 or 1012, see data field 'format-details' for available message types and their repetition rates in brackets. Note that in order to produce RINEX Navigation files RTCM Version 3.x streams containing message types 1019 (GPS) and 1020 (GLONASS) are required. Select your streams line by line, use +Shift and +Ctrl when necessary.
     
    397451</p>
    398452
    399 <p><a name="delete"><h4>3.7.5 Delete Mountpoints</h4></p>
     453<p><a name="delete"><h4>3.8.5 Delete Mountpoints</h4></p>
    400454<p>
    401455To remove a stream from the 'Mountpoints' list in the main window, highlight it by clicking on it and hit the 'Delete Mountpoints' button. You can also remove multiple mountpoints simultaneously by highlighting them using +Shift and +Ctrl.</p>
    402456
    403 <p><a name="edit"><h4>3.7.6 Edit Mountpoints</h4></p>
     457<p><a name="edit"><h4>3.8.6 Edit Mountpoints</h4></p>
    404458<ul>
    405459<li>
     
    416470</ul>
    417471
    418 <p><a name="log"><h4>3.8. Log - optional</h4></p>
     472<p><a name="log"><h4>3.9. Log - optional</h4></p>
    419473<p>
    420474Records of BNC's activities are shown in the 'Log' section of the main windows. These logs can be saved into a file when a valid path is specified in the 'Log (full path)' field. The message log covers the communication status between BNC and the NTRIP broadcaster as well as problems that may occur in the communication link, stream availability, stream delay, stream conversion etc. The default value for 'Log (full path)' is an empty option field, meaning that BNC logs will not saved into a file.
    421475</p>
    422476
    423 <p><a name="start"><h4>3.9. Start</h4></p>
     477<p><a name="start"><h4>3.10. Start</h4></p>
    424478<p>
    425479Hit 'Start' to start retrieving, decoding, and converting GNSS data streams in real-time. Note that 'Start' generally forces BNC to begin with fresh RINEX which might overwrite existing files when necessary unless the option 'Append files' is ticked.
    426480</p>
    427481
    428 <p><a name="stop"><h4>3.10. Stop</h4></p>
     482<p><a name="stop"><h4>3.11. Stop</h4></p>
    429483<p>
    430484Hit the 'Stop' button in order to stop BNC.
    431485</p>
    432486
    433 <p><a name="nw"><h4>3.11. No Window - optional</h4></p>
     487<p><a name="nw"><h4>3.12. No Window - optional</h4></p>
    434488<p>
    435489On all systems BNC can be started in batch mode with the command line option '-nw'. BNC will then run in 'no window' mode, using options from the configuration file ${HOME}/.config/BKG/BNC_NTRIP_Client.conf (Unix/Linux, see Config File example in the Annex) or from the register BKG_NTRIP_Client (Windows).
     
    440494<p><a name="limits"><h3>4. Limitations</h3></p>
    441495<ul>
    442 <li>
    443 Connection to an NTRIP broadcaster can sometimes be disrupted or a stream requested may temporarily be unavailable. Connection is defined by BNC as broken if no data is coming in for a period of 20 seconds. When this occurs, reconnects are attempted at decreasing rate. BNC first attempts to reconnect with ~1 second lag, if unsuccessful, again in ~2 seconds since the previous attempt. If it is still unsuccessful, it will attempt to reconnect within ~4 seconds since the previous attempt etc. Each attempt doubles the wait time from the previous attempt. The maximum delay between attempts is limited to ~256 seconds. This reconnection process is documented in the 'Log' file/section.
    444 </li>
    445496<li>
    446497Currently BNC only handles GPS, SBAS and GLONASS data. Galileo is not yet supported.
  • trunk/BNC/bncmain.cpp

    r628 r658  
    8181    settings.setValue("rnxSkel",    "SKL");
    8282    settings.setValue("waitTime",   5);
     83    settings.setValue("inspSegm",   "15");
     84    settings.setValue("noticeFail", "15");
     85    settings.setValue("noticeReco", "5");
    8386  }
    8487
  • trunk/BNC/bncwindow.cpp

    r647 r658  
    173173  _rnxAppendCheckBox->setWhatsThis(tr("<p>When BNC is started, new RINEX Observation files are created by default and any existing files with the same name will be overwritten. However, users might want to append observations and ephemeris to existing RINEX files following a restart of BNC, a system crash or when BNC crashed. Tick 'Append files' to continue with existing files and keep what has been recorded so far.</p>"));
    174174  _rnxIntrComboBox    = new QComboBox();
    175   _rnxIntrComboBox->setWhatsThis(tr("<p>Select the length of the RINEX Observation file generated.</p>"));
     175  _rnxIntrComboBox->setWhatsThis(tr("<p>Select the length of the RINEX Observation file.</p>"));
    176176  _rnxIntrComboBox->setMaximumWidth(9*ww);
    177177  _rnxIntrComboBox->setEditable(false);
     
    182182  }
    183183  _ephIntrComboBox    = new QComboBox();
    184   _ephIntrComboBox->setWhatsThis(tr("<p>Select the length of the RINEX Navigation file generated.</p>"));
     184  _ephIntrComboBox->setWhatsThis(tr("<p>Select the length of the RINEX Navigation file.</p>"));
    185185  _ephIntrComboBox->setMaximumWidth(9*ww);
    186186  _ephIntrComboBox->setEditable(false);
     
    198198  _rnxSamplSpinBox->setValue(settings.value("rnxSampl").toInt());
    199199  _rnxSamplSpinBox->setSuffix(" sec");
     200  _inspSegmSpinBox    = new QSpinBox();
     201  _inspSegmSpinBox->setWhatsThis(tr("<p>Select the RINEX Observation sampling interval in seconds. A value of zero '0' tells BNC to store all received epochs into RINEX.</p>"));
     202  _inspSegmSpinBox->setMinimum(0);
     203  _inspSegmSpinBox->setMaximum(60);
     204  _inspSegmSpinBox->setSingleStep(1);
     205  _inspSegmSpinBox->setMaximumWidth(9*ww);
     206  _inspSegmSpinBox->setValue(settings.value("inspSegm").toInt());
     207  _inspSegmSpinBox->setSuffix(" sec");
     208  _inspSegmSpinBox->setWhatsThis(tr("<p>BNC can collect all returns (success or failure) coming from a decoder within a certain short time span (Inspect segment) to then decide whether a stream content is corrupted or not. When a continuous problem is detected, BNC can inform its operator about this event through a Notice advisory. A value of about 15 sec (default) as 'Inspect segment' is recommended when handling 1Hz data.</p><p>A value of zero '0' means that you don't want BNC to inform you about incoming data that can not be decoded.</p>"));
     209  _noticeRecoSpinBox = new QSpinBox();
     210  _noticeRecoSpinBox->setMinimum(0);
     211  _noticeRecoSpinBox->setMaximum(60);
     212  _noticeRecoSpinBox->setSingleStep(1);
     213  _noticeRecoSpinBox->setSuffix(" min");
     214  _noticeRecoSpinBox->setMaximumWidth(9*ww);
     215  _noticeRecoSpinBox->setValue(settings.value("noticeReco").toInt());
     216  _noticeRecoSpinBox->setWhatsThis(tr("<p>Following a stream outage or a longer series of corrupted observations, a Notice advisory is generated when at least one valid observation is received again within the 'Recovery' threshold time span defined here. A value of about 5min (default) is recommendable. A valu of zero '0' means that BNC immediately informs about any stream recovery. </p><p>Note that using this function for corrupted streams needs an 'Inspect segment' greater zero '0'.</p>"));
     217  _noticeFailSpinBox = new QSpinBox();
     218  _noticeFailSpinBox->setMinimum(0);
     219  _noticeFailSpinBox->setMaximum(60);
     220  _noticeFailSpinBox->setSingleStep(1);
     221  _noticeFailSpinBox->setSuffix(" min");
     222  _noticeFailSpinBox->setMaximumWidth(9*ww);
     223  _noticeFailSpinBox->setValue(settings.value("noticeFail").toInt());
     224  _noticeFailSpinBox->setWhatsThis(tr("<p>A Notice advisory is generated when no (or corrupted) observations are received throughout the 'Failure' threshold time span defined here. A value of about 15 min (default) is recommendable. A value of zero '0' means that BNC immediately informs about any stream failure.</p><p>Note that using this function forcorrupted streams needs an 'Inspect segment' greater zero '0'.</p>"));
    200225  _logFileLineEdit    = new QLineEdit(settings.value("logFile").toString());
    201226  _logFileLineEdit->setWhatsThis(tr("<p>Records of BNC's activities are shown in the 'Log' section below. They can be saved into a file when a valid path is specified in the 'Log (full path)' field.</p>"));
     227  _noticeScriptLineEdit    = new QLineEdit(settings.value("noticeScript").toString());
     228  _noticeScriptLineEdit->setWhatsThis(tr("<p>Specify the full path to a script or batch file to handle Notice advisories generated in case of corrupted streams of stream outages. The affected mountpoint and one of the comments 'Begin_Outage', 'End_Outage', 'Begin_Currupted', or 'End_Corrupted' are passed on to the script as two command line parameters.</p><p>The script may be used to send an email to BNC's operator and/or to the affected streamprovider. An empty option field or invalid path means that you don't want to use this option.</p>"));
    202229  _mountPointsTable   = new QTableWidget(0,7);
    203230  _mountPointsTable->setWhatsThis(tr("<p>Streams selected for retrieval are listed in the 'Mountpoints' section. Button 'Add Mountpoints' opens a window that allows the user to select data streams from an NTRIP broadcaster according to their mountpoints. To remove a stream from the 'Mountpoints' list, highlight it by clicking on it and hit the 'Delete Mountpoints' button. You can also remove multiple mountpoints simultaneously by highlighting them using +Shift and +Ctrl.</p><p>BNC automatically allocates one of its internal decoders to a stream based on the stream's 'format' and 'format-details' as given in the source-table. However, there might be cases where you need to override the automatic selection due to incorrect source-table for example. BNC allows users to manually select the required decoder by editing the decoder string. Doubleclick on the 'decoder' field, enter your preferred decoder and then hit Enter. The accepted decoder strings are 'RTCM_2.x', 'RTCM_3.x', and 'RTIGS'.</p><p>In case you need to log the raw data as is, BNC allows users to by-pass its decoders and and directly save the input in daily log files. To do this specify the decoder string as 'ZERO'.</p><p>BNC can also retrieve streams from virtual reference stations (VRS). To initiate these streams, an approximate rover position needs to be sent in NMEA format to the NTRIP broadcaster. In return, a user-specific data stream is generated, typically by a Network-RTK software. This stream is customized to the exact latitude and longitude as shown in the 'lat' and 'long' columns under 'Mountpoints'. These VRS streams are indicated by a 'yes' in the 'nmea' column under 'Mountpoints' as well as in the source-table. The default 'lat' and 'long' values are taken from the source-table. However, in most cases you would probably want to change this according to your requirement. Double-click on 'lat' and 'long' fields, enter the values you wish to send and then hit Enter. The format is in positive north latitude degrees (e.g. for northern hemisphere: 52.436, for southern hemisphere: -24.567) and eastern longitude degrees (example: 358.872 or -1.128). Only mountpoints with a 'yes' in its 'nmea' column can be edited. The position must preferably be a point within the service area of the network.</p>"));
     
    289316  layout->addWidget(_outFileLineEdit,                            2, 2, 1, 3);
    290317
    291   layout->addWidget(new QLabel("Port for output"),               3, 0, 1, 2);
     318  layout->addWidget(new QLabel("Ports for output"),              3, 0, 1, 2);
    292319  QBoxLayout* bl1 = new QBoxLayout(QBoxLayout::LeftToRight);
    293320  bl1->addWidget(_outPortLineEdit);
     
    308335  layout->addWidget(_rnxScrpLineEdit,                            5, 2, 1, 3);
    309336
    310   layout->addWidget(new QLabel("File interval"),                 6, 0, 1, 2);
     337  layout->addWidget(new QLabel("File intervals"),                6, 0, 1, 2);
    311338
    312339  QBoxLayout* bl = new QBoxLayout(QBoxLayout::LeftToRight);
     
    333360  _ephV3CheckBox->setWhatsThis(tr("<p>Default format for RINEX Navigation files containing Broadcast Ephemeris is RINEX Version 2.11. Select 'RINEX v3' if you want to save the ephemeris in RINEX Version 3 format.</p>"));
    334361
    335   layout->addWidget(new QLabel("Mountpoints"),                   9, 0, 1, 2);
    336 
    337   layout->addWidget(_mountPointsTable,                          10, 0, 1, 5);
    338 
    339   layout->addWidget(new QLabel("Log (full path)"),              11, 0, 1, 2);
    340   layout->addWidget(_logFileLineEdit,                           11, 2, 1, 3);
    341   layout->addWidget(_log,                                       12, 0, 1, 5);
     362  layout->addWidget(new QLabel("Notice thresholds"),             9, 0, 1, 2);
     363  QBoxLayout* bl2 = new QBoxLayout(QBoxLayout::LeftToRight);
     364  bl2->addWidget(_noticeFailSpinBox);
     365  bl2->addWidget(new QLabel("Failure"));
     366  bl2->addWidget(_noticeRecoSpinBox);
     367  bl2->addWidget(new QLabel("Recovery"));
     368  bl2->addWidget(new QLabel("Inspect segment"));
     369  bl2->addWidget(_inspSegmSpinBox);
     370  layout->addLayout(bl2, 9, 2, 1, 3);
     371
     372  layout->addWidget(new QLabel("Notice script (full path)"),    10, 0, 1, 2);
     373  layout->addWidget(_noticeScriptLineEdit,                      10, 2, 1, 3);
     374
     375  layout->addWidget(new QLabel("Mountpoints"),                  11, 0, 1, 2);
     376
     377  layout->addWidget(_mountPointsTable,                          12, 0, 1, 5);
     378
     379  layout->addWidget(new QLabel("Log (full path)"),              13, 0, 1, 2);
     380  layout->addWidget(_logFileLineEdit,                           13, 2, 1, 3);
     381  layout->addWidget(_log,                                       14, 0, 1, 5);
    342382}
    343383
     
    466506  settings.setValue("proxyPort",   _proxyPortLineEdit->text());
    467507  settings.setValue("waitTime",    _waitTimeSpinBox->value());
     508  settings.setValue("inspSegm",    _inspSegmSpinBox->value());
     509  settings.setValue("noticeFail",  _noticeFailSpinBox->value());
     510  settings.setValue("noticeReco",  _noticeRecoSpinBox->value());
    468511  settings.setValue("outFile",     _outFileLineEdit->text());
    469512  settings.setValue("outPort",     _outPortLineEdit->text());
     
    480523  settings.setValue("ephV3",       _ephV3CheckBox->checkState());
    481524  settings.setValue("logFile",     _logFileLineEdit->text());
     525  settings.setValue("noticeScript",_noticeScriptLineEdit->text());
    482526 
    483527QStringList mountPoints;
  • trunk/BNC/bncwindow.h

    r588 r658  
    9292    QCheckBox* _rnxAppendCheckBox;
    9393    QSpinBox*  _waitTimeSpinBox;
     94    QSpinBox*  _inspSegmSpinBox;
     95    QSpinBox*  _noticeFailSpinBox;
     96    QSpinBox*  _noticeRecoSpinBox;
     97    QLineEdit* _noticeScriptLineEdit;
    9498    QTableWidget* _mountPointsTable;
    9599
Note: See TracChangeset for help on using the changeset viewer.