Changeset 9089 in ntrip


Ignore:
Timestamp:
Sep 2, 2020, 10:49:54 PM (3 weeks ago)
Author:
stuerze
Message:

adjusted allocation of slip and LTI according to the respective RTCM version

Location:
branches/BNC_2.12/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/BNC_2.12/src/RTCM/RTCM2Decoder.cpp

    r7875 r9089  
    154154          frqObs1P->_phaseValid = true;
    155155          frqObs1P->_phase = _ObsBlock.resolvedPhase_L1(iSat);
    156           //frqObs1P->_slipCounter = _ObsBlock.slip_L1[iSat];
    157           frqObs1P->_slipCounter = -1; // because RTCM2 definition is vice versa to RTCM3
     156          frqObs1P->_slipCounter = _ObsBlock.slip_L1[iSat];
    158157          obs._obs.push_back(frqObs1P);
    159158
     
    164163          frqObs2P->_phaseValid = true;
    165164          frqObs2P->_phase = _ObsBlock.resolvedPhase_L2(iSat);
    166           //frqObs2P->_slipCounter = _ObsBlock.slip_L2[iSat];
    167           frqObs2P->_slipCounter = -1; // because RTCM2 definition is vice versa to RTCM3
     165          frqObs2P->_slipCounter = _ObsBlock.slip_L2[iSat];
    168166          obs._obs.push_back(frqObs2P);
    169167
  • branches/BNC_2.12/src/RTCM3/RTCM3Decoder.cpp

    r9049 r9089  
    148148      frqObs->_codeValid = frqObs->_phaseValid = true;
    149149    }
    150     GETBITS(i, 7);
    151     frqObs->_lockTime = lti2sec(type,i);
     150    GETBITS(frqObs->_lockTimeIndicator, 7);
     151    frqObs->_lockTime = lti2sec(type, frqObs->_lockTimeIndicator);
    152152    frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid);
    153     frqObs->_slipCounter = i;
    154153    if (type == 1002 || type == 1004) {
    155154      GETBITS(amb, 8);
     
    194193        frqObs->_phaseValid = true;
    195194      }
    196       GETBITS(i, 7);
    197       frqObs->_lockTime = lti2sec(type,i);
     195      GETBITS(frqObs->_lockTimeIndicator, 7);
     196      frqObs->_lockTime = lti2sec(type, frqObs->_lockTimeIndicator);
    198197      frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid);
    199       frqObs->_slipCounter = i;
    200198      if (type == 1004) {
    201199        GETBITS(i, 8);
     
    768766                  frqObs->_lockTime = lti2sec(type,ll[count]);
    769767                  frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
    770                   frqObs->_slipCounter = ll[count];
     768                  frqObs->_lockTimeIndicator = ll[count];
    771769                }
    772770                break;
     
    777775                  frqObs->_codeValid = true;
    778776                }
    779 
    780777                if (cp[count] > -1.0 / (1 << 8)) {
    781778                  frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl
     
    784781                  frqObs->_lockTime = lti2sec(type,ll[count]);
    785782                  frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
    786                   frqObs->_slipCounter = ll[count];
     783                  frqObs->_lockTimeIndicator = ll[count];
    787784                }
    788785                break;
     
    799796                  frqObs->_lockTime = lti2sec(type,ll[count]);
    800797                  frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
    801                   frqObs->_slipCounter = ll[count];
     798                  frqObs->_lockTimeIndicator = ll[count];
    802799                }
    803800                frqObs->_snr = cnr[count];
     
    816813                  frqObs->_lockTime = lti2sec(type,ll[count]);
    817814                  frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
    818                   frqObs->_slipCounter = ll[count];
     815                  frqObs->_lockTimeIndicator = ll[count];
    819816                }
    820817                frqObs->_snr = cnr[count];
     
    837834                  frqObs->_lockTime = lti2sec(type,ll[count]);
    838835                  frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
    839                   frqObs->_slipCounter = ll[count];
     836                  frqObs->_lockTimeIndicator = ll[count];
    840837                }
    841838
     
    855852                  frqObs->_lockTime = lti2sec(type,ll[count]);
    856853                  frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0);
    857                   frqObs->_slipCounter = ll[count];
     854                  frqObs->_lockTimeIndicator = ll[count];
    858855                }
    859856
     
    943940      frqObs->_codeValid = frqObs->_phaseValid = true;
    944941    }
    945     GETBITS(i, 7);
    946     frqObs->_lockTime = lti2sec(type,i);
     942    GETBITS(frqObs->_lockTimeIndicator, 7);
     943    frqObs->_lockTime = lti2sec(type, frqObs->_lockTimeIndicator);
    947944    frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid);
    948     frqObs->_slipCounter = i;
    949945    if (type == 1010 || type == 1012) {
    950946      GETBITS(amb, 7);
     
    989985        frqObs->_phaseValid = true;
    990986      }
    991       GETBITS(i, 7);
    992       frqObs->_lockTime = lti2sec(type,i);
     987      GETBITS(frqObs->_lockTimeIndicator, 7);
     988      frqObs->_lockTime = lti2sec(type, frqObs->_lockTimeIndicator);
    993989      frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid);
    994       frqObs->_slipCounter = i;
    995990      if (type == 1012) {
    996991        GETBITS(i, 8);
  • branches/BNC_2.12/src/bnccaster.cpp

    r9021 r9089  
    164164    obs._staID = staID.data();
    165165
     166    // Update/Set Slip Counters
     167    // ------------------------
     168    setSlipCounters(obs);
     169
    166170    // Output into the socket
    167171    // ----------------------
     
    560564                   .arg(_miscSockets->size()).toAscii(), true) );
    561565}
     566
     567
     568// Set/Update Slip Counters
     569////////////////////////////////////////////////////////////////////////////
     570void bncCaster::setSlipCounters(t_satObs& obs) {
     571
     572  double minLockTime = -1.0;
     573  for (unsigned ii = 0; ii < obs._obs.size(); ii++) {
     574    const t_frqObs* frqObs = obs._obs[ii];
     575    if (frqObs->_lockTimeValid) {
     576      if (minLockTime == -1.0 || minLockTime < frqObs->_lockTime) {
     577        minLockTime = frqObs->_lockTime;
     578      }
     579    }
     580  }
     581
     582  if (minLockTime == -1.0) {
     583    return;
     584  }
     585
     586  QMap<t_prn, double>& ltMap = _lockTimeMap[obs._staID];
     587  QMap<t_prn, int>&    jcMap = _jumpCounterMap[obs._staID];
     588
     589  QMap<t_prn, double>::const_iterator it = ltMap.find(obs._prn);
     590  if (it == ltMap.end()) {
     591    ltMap[obs._prn] = minLockTime;
     592    jcMap[obs._prn] = 0;
     593  }
     594  else {
     595    if (ltMap[obs._prn] < minLockTime) {
     596      ltMap[obs._prn] = minLockTime;
     597      jcMap[obs._prn] += 1;
     598      if (jcMap[obs._prn] > 9999) {
     599        jcMap[obs._prn] = 0;
     600      }
     601    }
     602  }
     603  for (unsigned ii = 0; ii < obs._obs.size(); ii++) {
     604    t_frqObs* frqObs = obs._obs[ii];
     605    frqObs->_slipCounter = jcMap[obs._prn];
     606  }
     607}
  • branches/BNC_2.12/src/bnccaster.h

    r9021 r9089  
    6464   static int myWrite(QTcpSocket* sock, const char* buf, int bufLen);
    6565   void reopenOutFile();
     66   void setSlipCounters(t_satObs& obs);
    6667
    6768   QFile*                          _outFile;
     
    8485   QTcpServer*                     _miscServer;
    8586   QList<QTcpSocket*>*             _miscSockets;
     87   QMap<std::string, QMap<t_prn, double> > _lockTimeMap;
     88   QMap<std::string, QMap<t_prn, int> >    _jumpCounterMap;
    8689};
    8790
  • branches/BNC_2.12/src/bncrinex.cpp

    r8791 r9089  
    640640          << left  << setw(3) << "L" + frqObs->_rnxType2ch << ' '
    641641          << right << setw(14) << setprecision(3) << frqObs->_phase << ' '
    642           << right << setw(4)                     << frqObs->_slipCounter;
     642          //<< right << setw(4)                     << frqObs->_slipCounter;
     643          << right << setw(4)                     << frqObs->_lockTimeIndicator;
    643644    }
    644645    if (frqObs->_dopplerValid) {
  • branches/BNC_2.12/src/bncutils.cpp

    r8855 r9089  
    10021002}
    10031003
    1004 // Convert RTCM3 lock-time indicator to lock time in seconds
     1004// Convert RTCM3 lock-time indicator to minimum lock time in seconds
    10051005////////////////////////////////////////////////////////////////////////////
    10061006double lti2sec(int type, int lti) {
     
    10161016    else if (lti< 127) return  32*lti-3096; // [744  32  905]
    10171017    else if (lti==127) return  937;
    1018     else               return  -1;
     1018    else               return  -1.0;
    10191019  }
    10201020  else if (type%10==2 || type%10==3 ||
     
    10371037      case(14) : return 262144e-3;
    10381038      case(15) : return 524288e-3;
    1039       default  : return     -1;
     1039      default  : return     -1.0;
    10401040    };
    10411041  }
     
    10641064    else if (lti< 704) return (1048576*lti-671088640 )*1e-3;
    10651065    else if (lti==704) return (2097152*lti-1409286144)*1e-3;
    1066     else               return (     -1               );
     1066    else               return (     -1.0               );
    10671067  }
    10681068  else {
    1069     return -1;
     1069    return -1.0;
    10701070  };
    10711071};
  • branches/BNC_2.12/src/satObs.h

    r8616 r9089  
    1515 public:
    1616  t_frqObs() {
    17     _code            = 0.0;
    18     _codeValid       = false;
    19     _phase           = 0.0;
    20     _phaseValid      = false;
    21     _doppler         = 0.0;
    22     _dopplerValid    = false;
    23     _snr             = 0.0;
    24     _snrValid        = false;
    25     _lockTime        = 0.0;
    26     _lockTimeValid   = false;
    27     _slip            = false;
    28     _slipCounter     = 0;
    29     _biasJumpCounter = 0;
     17    _code              = 0.0;
     18    _codeValid         = false;
     19    _phase             = 0.0;
     20    _phaseValid        = false;
     21    _doppler           = 0.0;
     22    _dopplerValid      = false;
     23    _snr               = 0.0;
     24    _snrValid          = false;
     25    _lockTime          = -1.0;
     26    _lockTimeValid     = false;
     27    _slip              = false;
     28    _slipCounter       =  0;
     29    _biasJumpCounter   =  0;
     30    _lockTimeIndicator = -1;
    3031  }
    3132  std::string       _rnxType2ch;
     
    3940  bool              _snrValid;
    4041  double            _lockTime;
    41   bool              _lockTimeValid; 
    42   bool              _slip;
    43   int               _slipCounter;
    44   int               _biasJumpCounter;
     42  bool              _lockTimeValid;
     43  bool              _slip;              // RINEX
     44  int               _slipCounter;       // RTCM2 or converted from RTCM3
     45  int               _lockTimeIndicator; // RTCM3
     46  int               _biasJumpCounter;   // ??
    4547};
    4648
Note: See TracChangeset for help on using the changeset viewer.