Changeset 9016 in ntrip for trunk/BNC


Ignore:
Timestamp:
Aug 16, 2020, 11:56:26 AM (4 years ago)
Author:
mervart
Message:

LM: setSlipCounters according to lockTime values

Location:
trunk/BNC/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bnccaster.cpp

    r8921 r9016  
    176176    obs._staID = staID.data();
    177177
     178    // Update/Set Slip Counters
     179    // ------------------------
     180    setSlipCounters(obs);
     181   
    178182    // Output into the socket
    179183    // ----------------------
     
    573577                   .arg(_miscSockets->size()).toLatin1(), true) );
    574578}
     579
     580// Set/Update Slip Counters
     581////////////////////////////////////////////////////////////////////////////
     582void bncCaster::setSlipCounters(t_satObs& obs) {
     583
     584  double minLockTime = -1.0;
     585  for (unsigned ii = 0; ii < obs._obs.size(); ii++) {
     586    const t_frqObs* frqObs = obs._obs[ii];
     587    if (frqObs->_lockTimeValid) {
     588      if (minLockTime == -1.0 || minLockTime < frqObs->_lockTime) {
     589        minLockTime = frqObs->_lockTime;
     590      }
     591    }
     592  }
     593
     594  if (minLockTime == -1.0) {
     595    return;
     596  }
     597
     598  QMap<t_prn, double>& hlpMap = _lockTimeMap[obs._staID];
     599  QMap<t_prn, double>::const_iterator it = hlpMap.find(obs._prn);
     600  if (it == hlpMap.end()) {
     601    hlpMap[obs._prn] = minLockTime;
     602    for (unsigned ii = 0; ii < obs._obs.size(); ii++) {
     603      t_frqObs* frqObs = obs._obs[ii];
     604      frqObs->_slipCounter = 0;
     605    }
     606  }
     607  else {
     608    if (hlpMap[obs._prn] < minLockTime) {
     609      hlpMap[obs._prn] = minLockTime;
     610      for (unsigned ii = 0; ii < obs._obs.size(); ii++) {
     611        t_frqObs* frqObs = obs._obs[ii];
     612        frqObs->_slipCounter += 1;
     613        if (frqObs->_slipCounter > 9999) {
     614          frqObs->_slipCounter = 0;
     615        }
     616      }
     617    }
     618  }
     619}
  • trunk/BNC/src/bnccaster.h

    r8921 r9016  
    6767   static int myWrite(QTcpSocket* sock, const char* buf, int bufLen);
    6868   void reopenOutFile();
     69   void setSlipCounters(t_satObs& obs);
    6970
    7071   QFile*                          _outFile;
     
    8788   QTcpServer*                     _miscServer;
    8889   QList<QTcpSocket*>*             _miscSockets;
     90   QMap<std::string, QMap<t_prn, double> > _lockTimeMap;
    8991};
    9092
Note: See TracChangeset for help on using the changeset viewer.