Changeset 9089 in ntrip for branches/BNC_2.12/src/bnccaster.cpp


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.