Changeset 9018 in ntrip


Ignore:
Timestamp:
Aug 17, 2020, 10:19:28 AM (5 weeks ago)
Author:
stuerze
Message:

harmonization of MSM feed engine output

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

Legend:

Unmodified
Added
Removed
  • branches/BNC_2.12/src/bnccaster.cpp

    r8667 r9018  
    164164    obs._staID = staID.data();
    165165
     166    // Update/Set Slip Counters
     167    // ------------------------
     168    setSlipCounters(obs);
     169   
    166170    // Output into the socket
    167171    // ----------------------
     
    199203      _lastDumpTime = obs._time - 1.0;
    200204    }
     205   
    201206    // An old observation - throw it away
    202207    // ----------------------------------
     
    461466
    462467  int ms = 0;
    463 
    464468  if (_confInterval != -1) {
    465469    ms = 1000 * _confInterval;
     
    468472    QTime currTime = currentDateAndTimeGPS().time();
    469473    QTime nextShotTime;
    470 
    471474    if      (settings.value("onTheFlyInterval").toString() == "1 min") {
    472475      _confInterval = 60;
     
    561564                   .arg(_miscSockets->size()).toAscii(), true) );
    562565}
     566
     567// Set/Update Slip Counters
     568////////////////////////////////////////////////////////////////////////////
     569void bncCaster::setSlipCounters(t_satObs& obs) {
     570
     571  double minLockTime = -1.0;
     572  for (unsigned ii = 0; ii < obs._obs.size(); ii++) {
     573    const t_frqObs* frqObs = obs._obs[ii];
     574    if (frqObs->_lockTimeValid) {
     575      if (minLockTime == -1.0 || minLockTime < frqObs->_lockTime) {
     576        minLockTime = frqObs->_lockTime;
     577      }
     578    }
     579  }
     580
     581  if (minLockTime == -1.0) {
     582    return;
     583  }
     584
     585  QMap<t_prn, double>& hlpMap = _lockTimeMap[obs._staID];
     586  QMap<t_prn, double>::const_iterator it = hlpMap.find(obs._prn);
     587  if (it == hlpMap.end()) {
     588    hlpMap[obs._prn] = minLockTime;
     589    for (unsigned ii = 0; ii < obs._obs.size(); ii++) {
     590      t_frqObs* frqObs = obs._obs[ii];
     591      frqObs->_slipCounter = 0;
     592    }
     593  }
     594  else {
     595    if (hlpMap[obs._prn] < minLockTime) {
     596      hlpMap[obs._prn] = minLockTime;
     597      for (unsigned ii = 0; ii < obs._obs.size(); ii++) {
     598        t_frqObs* frqObs = obs._obs[ii];
     599        frqObs->_slipCounter += 1;
     600        if (frqObs->_slipCounter > 9999) {
     601          frqObs->_slipCounter = 0;
     602        }
     603      }
     604    }
     605  }
     606}
  • branches/BNC_2.12/src/bnccaster.h

    r8620 r9018  
    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;
    8688};
    8789
Note: See TracChangeset for help on using the changeset viewer.