Changeset 8616 in ntrip


Ignore:
Timestamp:
Feb 28, 2019, 2:45:02 PM (5 years ago)
Author:
stuerze
Message:

a computed lock time is added for RTCM3 phase observations as an optional feed engine output

Location:
branches/BNC_2.12
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/BNC_2.12/ChangeLog.txt

    r8502 r8616  
    22 BNC VERSION 2.12.7 (??.??.2018)
    33--------------------------------------------------------------------------------
     4    ADDED   (28.02.2019): lock time in seconds as an optional feed engine output
    45    ADDED   (27.09.2018): possibility to request a user and password
    56                          detected sourcetable
  • branches/BNC_2.12/src/RTCM3/RTCM3Decoder.cpp

    r8475 r8616  
    149149    }
    150150    GETBITS(i, 7);
     151    frqObs->_lockTime = lti2sec(type,i);
     152    frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid);
    151153    frqObs->_slipCounter = i;
    152154    if (type == 1002 || type == 1004) {
     
    193195      }
    194196      GETBITS(i, 7);
     197      frqObs->_lockTime = lti2sec(type,i);
     198      frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid);
    195199      frqObs->_slipCounter = i;
    196200      if (type == 1004) {
     
    714718                      + (rrmod[numsat]) * LIGHTSPEED / 1000.0 / cd.wl;
    715719                  frqObs->_phaseValid = true;
     720                  frqObs->_lockTime = lti2sec(type,ll[count]);
     721                  frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
    716722                  frqObs->_slipCounter = ll[count];
    717723                }
     
    728734                      + rrmod[numsat] * LIGHTSPEED / 1000.0 / cd.wl;
    729735                  frqObs->_phaseValid = true;
     736                  frqObs->_lockTime = lti2sec(type,ll[count]);
     737                  frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
    730738                  frqObs->_slipCounter = ll[count];
    731739                }
     
    743751                          / cd.wl;
    744752                  frqObs->_phaseValid = true;
     753                  frqObs->_lockTime = lti2sec(type,ll[count]);
     754                  frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
    745755                  frqObs->_slipCounter = ll[count];
    746756                }
     
    761771                          / cd.wl;
    762772                  frqObs->_phaseValid = true;
     773                  frqObs->_lockTime = lti2sec(type,ll[count]);
     774                  frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
    763775                  frqObs->_slipCounter = ll[count];
    764776                }
     
    784796                          / cd.wl;
    785797                  frqObs->_phaseValid = true;
     798                  frqObs->_lockTime = lti2sec(type,ll[count]);
     799                  frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
    786800                  frqObs->_slipCounter = ll[count];
    787801                }
     
    802816                          / cd.wl;
    803817                  frqObs->_phaseValid = true;
     818                  frqObs->_lockTime = lti2sec(type,ll[count]);
     819                  frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
    804820                  frqObs->_slipCounter = ll[count];
    805821                }
     
    890906    }
    891907    GETBITS(i, 7);
     908    frqObs->_lockTime = lti2sec(type,i);
     909    frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid);
    892910    frqObs->_slipCounter = i;
    893911    if (type == 1010 || type == 1012) {
     
    934952      }
    935953      GETBITS(i, 7);
     954      frqObs->_lockTime = lti2sec(type,i);
     955      frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid);
    936956      frqObs->_slipCounter = i;
    937957      if (type == 1012) {
  • branches/BNC_2.12/src/bnccaster.cpp

    r8398 r8616  
    9595    _uSockets = 0;
    9696  }
    97 
     97 
     98  _printLockTime = settings.value("printLockTime",false).toBool();
    9899  _samplingRateMult10 = int(settings.value("outSampl").toString().split("sec").first().toDouble() * 10.0);
    99100  _outWait      = settings.value("outWait").toDouble();
     
    172173           << setw(4)  << obs._time.gpsw()                      << " "
    173174           << setw(14) << setprecision(7) << obs._time.gpssec() << " "
    174            << bncRinex::asciiSatLine(obs) << endl;
     175           << bncRinex::asciiSatLine(obs,_printLockTime) << endl;
    175176
    176177      string hlpStr = oStr.str();
     
    317318                 << setprecision(7) << obs._time.gpssec() << endl;
    318319          }
    319           oStr << obs._staID << ' ' << bncRinex::asciiSatLine(obs) << endl;
     320          oStr << obs._staID << ' '
     321               << bncRinex::asciiSatLine(obs,_printLockTime) << endl;
    320322          if (!it.hasNext()) {
    321323            oStr << endl;
  • branches/BNC_2.12/src/bnccaster.h

    r8398 r8616  
    7575   QList<QByteArray>               _staIDs;
    7676   QList<bncGetThread*>            _threads;
     77   bool                            _printLockTime;   
    7778   int                             _samplingRateMult10;
    7879   double                          _outWait;
  • branches/BNC_2.12/src/bnchelp.html

    r8484 r8616  
    26122612</p>
    26132613
     2614<p>A valid 'Lock Time Indicator'
     2615An optional valid 'Lock Time' is only presented for observations from RTCM Version 3 streams. The parameter provides a measure of the amount of time that has elapsed during which the receiver has maintained continuous lock on that satellite signal. If a cycle slip occurs during the previous measurement cycle, the lock time will be reset to Zero. The 'Lock Time' could be of interest becuase the Lock Time Inficator is different for different RTCM3 measurement types. Hence, the 'Lock Time' in seconds is computed with the respective calculation rule.
     2616</p>
     2617
    26142618<p>
    26152619The following table describes the format of BNC's synchronized output of GNSS observations which consists of 'Epoch Records' and 'Observation Records'. Each Epoch Record is followed by one or more Observation Records. The Observation Record is repeated for each satellite having been observed in the current epoch. The length of an Observation Record is given by the number of observation types for this satellite.
     
    26552659<tr><td>Observation Code</td><td><b>S</b>2W</td><td>1X,A3</td></tr>
    26562660<tr><td>Observed Signal Strength &nbsp; &nbsp;</td><td>34.750</td><td>1X,F8.3</td></tr>
     2661
     2662<tr><td><u>Lock Time (optional)</u></td><td></td><td></td></tr>
     2663<tr><td>Observation Code</td><td><b>T</b>2W</td><td>1X,A3</td></tr>
     2664<tr><td>Computed Lock Time &nbsp; &nbsp;</td><td>937.000</td><td>1X,F8.3</td></tr>
    26572665
    26582666</table>
  • branches/BNC_2.12/src/bncrinex.cpp

    r8501 r8616  
    601601// One Line in ASCII (Internal) Format
    602602////////////////////////////////////////////////////////////////////////////
    603 string bncRinex::asciiSatLine(const t_satObs& obs) {
     603string bncRinex::asciiSatLine(const t_satObs& obs, bool printLockTime) {
    604604
    605605  ostringstream str;
     
    631631          << right << setw(8) << setprecision(3) << frqObs->_snr;
    632632    }
     633    if (frqObs->_lockTimeValid && printLockTime) {
     634      str << ' '
     635          << left  << setw(3) << "T" + frqObs->_rnxType2ch << ' '
     636          << right << setw(9) << setprecision(3) << frqObs->_lockTime;
     637    }   
    633638  }
    634639
  • branches/BNC_2.12/src/bncrinex.h

    r8398 r8616  
    4949                               bool rnxV3,
    5050                               QDateTime* nextEpoch = 0);
    51    static std::string asciiSatLine(const t_satObs& obs);
     51   static std::string asciiSatLine(const t_satObs& obs, bool printLockTime);
    5252
    5353 private:
  • branches/BNC_2.12/src/bncsettings.cpp

    r8398 r8616  
    104104    setValue_p("reqcOutNavFile",      "");
    105105    setValue_p("reqcOutLogFile",      "");
    106     setValue_p("reqcSkyPlotSignals",  "C:2&7 E:1&5 G:1&2 J:1&2 R:1&2 S:1&5 I:5&9");
     106    setValue_p("reqcSkyPlotSignals",  "C:2&7 E:1&5 G:1&2&5 J:1&2 R:1&2&3 S:1&5 I:5&9");
    107107    setValue_p("reqcPlotDir",         "");
    108108    setValue_p("reqcRnxVersion",      "");
     
    146146    setValue_p("outFile",             "");
    147147    setValue_p("outUPort",            "");
     148    setValue_p("printLockTime",       "0");
    148149    // Serial Output
    149150    setValue_p("serialMountPoint",    "");
  • branches/BNC_2.12/src/bncutils.cpp

    r8418 r8616  
    949949}
    950950
     951// Convert RTCM3 lock-time indicator to lock time in seconds
     952////////////////////////////////////////////////////////////////////////////
     953double lti2sec(int type, int lti) {
     954
     955  if ( (type>=1001 && type<=1004) ||
     956       (type>=1009 && type<=1012)    ) { // RTCM3 msg 100[1...4] and 10[09...12]
     957         if (lti<   0) return  -1;
     958    else if (lti<  24) return   1*lti;      // [  0   1   23]
     959    else if (lti<  48) return   2*lti-24;   // [ 24   2   70]
     960    else if (lti<  72) return   4*lti-120;  // [ 72   4  164]
     961    else if (lti<  96) return   8*lti-408;  // [168   8  352]
     962    else if (lti< 120) return  16*lti-1176; // [360  16  728]
     963    else if (lti< 127) return  32*lti-3096; // [744  32  905]
     964    else if (lti==127) return  937;
     965    else               return  -1;
     966  }
     967  else if (type%10==2 || type%10==3 ||
     968           type%10==4 || type%10==5) {  // RTCM3 MSM-2/-3/-4/-5
     969    switch(lti) {
     970      case( 0) : return      0;
     971      case( 1) : return     32e-3;
     972      case( 2) : return     64e-3;
     973      case( 3) : return    128e-3;
     974      case( 4) : return    256e-3;
     975      case( 5) : return    512e-3;
     976      case( 6) : return   1024e-3;
     977      case( 7) : return   2048e-3;
     978      case( 8) : return   4096e-3;
     979      case( 9) : return   8192e-3;
     980      case(10) : return  16384e-3;
     981      case(11) : return  32768e-3;
     982      case(12) : return  65536e-3;
     983      case(13) : return 131072e-3;
     984      case(14) : return 262144e-3;
     985      case(15) : return 524288e-3;
     986      default  : return     -1;
     987    };
     988  }
     989  else if (type%10==6 || type%10==7) {  // RTCM3 MSM-6 and MSM-7
     990         if (lti<   0) return (     -1               );
     991    else if (lti<  64) return (      1*lti           )*1e-3;
     992    else if (lti<  96) return (      2*lti-64        )*1e-3;
     993    else if (lti< 128) return (      4*lti-256       )*1e-3;
     994    else if (lti< 160) return (      8*lti-768       )*1e-3;
     995    else if (lti< 192) return (     16*lti-2048      )*1e-3;
     996    else if (lti< 224) return (     32*lti-5120      )*1e-3;
     997    else if (lti< 256) return (     64*lti-12288     )*1e-3;
     998    else if (lti< 288) return (    128*lti-28672     )*1e-3;
     999    else if (lti< 320) return (    256*lti-65536     )*1e-3;
     1000    else if (lti< 352) return (    512*lti-147456    )*1e-3;
     1001    else if (lti< 384) return (   1024*lti-327680    )*1e-3;
     1002    else if (lti< 416) return (   2048*lti-720896    )*1e-3;
     1003    else if (lti< 448) return (   4096*lti-1572864   )*1e-3;
     1004    else if (lti< 480) return (   8192*lti-3407872   )*1e-3;
     1005    else if (lti< 512) return (  16384*lti-7340032   )*1e-3;
     1006    else if (lti< 544) return (  32768*lti-15728640  )*1e-3;
     1007    else if (lti< 576) return (  65536*lti-33554432  )*1e-3;
     1008    else if (lti< 608) return ( 131072*lti-71303168  )*1e-3;
     1009    else if (lti< 640) return ( 262144*lti-150994944 )*1e-3;
     1010    else if (lti< 672) return ( 524288*lti-318767104 )*1e-3;
     1011    else if (lti< 704) return (1048576*lti-671088640 )*1e-3;
     1012    else if (lti==704) return (2097152*lti-1409286144)*1e-3;
     1013    else               return (     -1               );
     1014  }
     1015  else {
     1016    return -1;
     1017  };
     1018};
  • branches/BNC_2.12/src/bncutils.h

    r8012 r8616  
    5050 * and must be handled separately.
    5151 * @param week GPS week number (must be prefilled, contains fixed value afterwards)
    52  * @param secOfWeek seconds in GPS week (must be prefilled, contains fixed value afterwards) 
     52 * @param secOfWeek seconds in GPS week (must be prefilled, contains fixed value afterwards)
    5353 * @param mSecOfWeek milli seconds in GLONASS time
    5454 * @param fixnumleap when <code>true</code> then result is UTC time, otherwise it is GPS
     
    8686void         jacobiEll_XYZ(const double* Ell, Matrix& jacobi);
    8787
    88 void         covariXYZ_NEU(const SymmetricMatrix& Qxyz, const double* Ell, 
     88void         covariXYZ_NEU(const SymmetricMatrix& Qxyz, const double* Ell,
    8989                           SymmetricMatrix& Qneu);
    9090
    91 void         covariNEU_XYZ(const SymmetricMatrix& Qneu, const double* Ell, 
     91void         covariNEU_XYZ(const SymmetricMatrix& Qneu, const double* Ell,
    9292                           SymmetricMatrix& Qxyz);
    9393
     
    9898double       nint(double val);
    9999
    100 ColumnVector rungeKutta4(double xi, const ColumnVector& yi, double dx, double* acc, 
     100ColumnVector rungeKutta4(double xi, const ColumnVector& yi, double dx, double* acc,
    101101                         ColumnVector (*der)(double x, const ColumnVector& y, double* acc));
    102102
    103103void         GPSweekFromDateAndTime(const QDateTime& dateTime, int& GPSWeek, double& GPSWeeks);
    104104
    105 void         GPSweekFromYMDhms(int year, int month, int day, int hour, int min, double sec, 
     105void         GPSweekFromYMDhms(int year, int month, int day, int hour, int min, double sec,
    106106                               int& GPSWeek, double& GPSWeeks);
    107107
     
    114114int          readDbl(const QString& str, int pos, int len, double& value);
    115115
    116 void         topos(double xRec, double yRec, double zRec, double xSat, double ySat, double zSat, 
     116void         topos(double xRec, double yRec, double zRec, double xSat, double ySat, double zSat,
    117117                   double& rho, double& eleSat, double& azSat);
    118118
     
    121121QString      fortranFormat(double value, int width, int prec);
    122122
    123 void         kalman(const Matrix& AA, const ColumnVector& ll, const DiagonalMatrix& PP, 
     123void         kalman(const Matrix& AA, const ColumnVector& ll, const DiagonalMatrix& PP,
    124124                    SymmetricMatrix& QQ, ColumnVector& xx);
    125125
     
    141141
    142142int          factorial(int n);
     143
     144/** Convert RTCM3 lock-time indicator to lock time in seconds
     145* depending on input message format. Returns -1 if format is
     146* unknown or indicator is invalid
     147*/
     148double       lti2sec(int type, int lti);
    143149
    144150
  • branches/BNC_2.12/src/bncwindow.cpp

    r8492 r8616  
    286286  _outFileLineEdit    = new QLineEdit(settings.value("outFile").toString());
    287287  _outUPortLineEdit   = new QLineEdit(settings.value("outUPort").toString());
     288  _printLockTimeCheckBox = new QCheckBox();
     289  _printLockTimeCheckBox->setCheckState(Qt::CheckState(settings.value("printLockTime").toInt())); 
    288290
    289291  connect(_outPortLineEdit, SIGNAL(textChanged(const QString &)),
     
    291293
    292294  connect(_outFileLineEdit, SIGNAL(textChanged(const QString &)),
     295          this, SLOT(slotBncTextChanged()));
     296
     297  connect(_printLockTimeCheckBox, SIGNAL(stateChanged(int)),
    293298          this, SLOT(slotBncTextChanged()));
    294299
     
    758763  sLayout->addWidget(new QLabel("Port (unsynchronized)"),           4, 0);
    759764  sLayout->addWidget(_outUPortLineEdit,                             4, 1);
    760   sLayout->addWidget(new QLabel(""),                                5, 1);
    761   sLayout->setRowStretch(6, 999);
     765  sLayout->addWidget(new QLabel("Print lock time"),                 5, 0);
     766  sLayout->addWidget(_printLockTimeCheckBox,                        5, 1);
     767  sLayout->addWidget(new QLabel(""),                                6, 1);
     768  sLayout->setRowStretch(7, 999);
    762769
    763770  sgroup->setLayout(sLayout);
     
    12831290  _outFileLineEdit->setWhatsThis(tr("<p>Specify the full path to a file where synchronized observations are saved in plain ASCII format.</p><p>Beware that the size of this file can rapidly increase depending on the number of incoming streams.</p>"));
    12841291  _outUPortLineEdit->setWhatsThis(tr("<p>BNC can produce unsynchronized observations in a plain ASCII format on your local host via IP port.</p><p>Specify a port number to activate this function.</p>"));
     1292  _printLockTimeCheckBox->setWhatsThis(tr("<p>Print the lock time in seconds in the feed engine output.</p>"));
    12851293
    12861294  // WhatsThis, Serial Output
     
    14581466  delete _outFileLineEdit;
    14591467  delete _outUPortLineEdit;
     1468  delete _printLockTimeCheckBox;
    14601469  delete _serialMountPointLineEdit;
    14611470  delete _serialPortNameLineEdit;
     
    18751884  settings.setValue("outFile",     _outFileLineEdit->text());
    18761885  settings.setValue("outUPort",    _outUPortLineEdit->text());
     1886  settings.setValue("printLockTime",_printLockTimeCheckBox->checkState()); 
    18771887// Serial Output
    18781888  settings.setValue("serialMountPoint",_serialMountPointLineEdit->text());
  • branches/BNC_2.12/src/bncwindow.h

    r8398 r8616  
    132132    QLineEdit* _outPortLineEdit;
    133133    QLineEdit* _outUPortLineEdit;
     134    QCheckBox* _printLockTimeCheckBox;   
    134135    QLineEdit* _ephOutPortLineEdit;
    135136    QLineEdit* _corrPortLineEdit;
  • branches/BNC_2.12/src/satObs.h

    r8484 r8616  
    2323    _snr             = 0.0;
    2424    _snrValid        = false;
     25    _lockTime        = 0.0;
     26    _lockTimeValid   = false;
    2527    _slip            = false;
    2628    _slipCounter     = 0;
     
    3638  double            _snr;
    3739  bool              _snrValid;
     40  double            _lockTime;
     41  bool              _lockTimeValid; 
    3842  bool              _slip;
    3943  int               _slipCounter;
Note: See TracChangeset for help on using the changeset viewer.