Changeset 10225 in ntrip


Ignore:
Timestamp:
Oct 17, 2023, 2:01:48 PM (13 months ago)
Author:
stuerze
Message:

bug fixed

Location:
trunk/BNC/src/combination
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/combination/bnccomb.cpp

    r10224 r10225  
    448448  // -----------------------------------------------------
    449449  for (int ii = 0; ii < clkCorrections.size(); ii++) {
    450     t_clkCorr* newClk = new t_clkCorr(clkCorrections[ii]);
    451 
    452     char sys = newClk->_prn.system();
     450    t_clkCorr& newClk = clkCorrections[ii];
     451    char sys = newClk._prn.system();
    453452    if (!_cmbSysPrn.contains(sys)){
    454       delete newClk;
    455453      continue;
    456454    }
     
    458456    // Check Modulo Time
    459457    // -----------------
    460     int sec = int(nint(newClk->_time.gpssec()*10));
     458    int sec = int(nint(newClk._time.gpssec()*10));
    461459    if (sec % (_cmbSampl*10) != 0.0) {
    462       delete newClk;
    463460      continue;
    464461    }
     
    468465    QString acName;
    469466    bool isAPC;
    470     QString staID(newClk->_staID.c_str());
     467    QString staID(newClk._staID.c_str());
    471468    QListIterator<cmbAC*> icAC(_ACs);
    472469    while (icAC.hasNext()) {
     
    479476    }
    480477    if (acName.isEmpty() || isAPC != _masterIsAPC[sys]) {
    481       delete newClk;
    482478      continue;
    483479    }
     
    486482    // ----------------------------
    487483    if (BNC_CORE->mode() != t_bncCore::batchPostProcessing) {
    488       if ((newClk->_time >= currentTime) ||       // future time stamp
    489           (currentTime - newClk->_time) > 60.0) { // very old data sets
     484      if ((newClk._time >= currentTime) ||       // future time stamp
     485          (currentTime - newClk._time) > 60.0) { // very old data sets
    490486  #ifdef BNC_DEBUG_CMB
    491         emit newMessage("bncComb: future or very old data sets: " + acName.toLatin1() + " " + newClk->_prn.toString().c_str() +
    492             QString(" %1 ").arg(newClk->_time.timestr().c_str()).toLatin1() + "vs. current time" +
     487        emit newMessage("bncComb: future or very old data sets: " + acName.toLatin1() + " " + newClk._prn.toString().c_str() +
     488            QString(" %1 ").arg(newClk._time.timestr().c_str()).toLatin1() + "vs. current time" +
    493489            QString(" %1 ").arg(currentTime.timestr().c_str()).toLatin1(), true);
    494490  #endif
    495         delete newClk;
    496491        continue;
    497492      }
     
    500495    // Check Correction Age
    501496    // --------------------
    502     if (_resTime.valid() && newClk->_time <= _resTime) {
     497    if (_resTime.valid() && newClk._time <= _resTime) {
    503498#ifdef BNC_DEBUG_CMB
    504       emit newMessage("bncComb: old correction: " + acName.toLatin1() + " " + newClk->_prn.toString().c_str() +
    505           QString(" %1 ").arg(newClk->_time.timestr().c_str()).toLatin1() + "vs. last processing Epoch" +
     499      emit newMessage("bncComb: old correction: " + acName.toLatin1() + " " + newClk._prn.toString().c_str() +
     500          QString(" %1 ").arg(newClk._time.timestr().c_str()).toLatin1() + "vs. last processing Epoch" +
    506501          QString(" %1 ").arg(_resTime.timestr().c_str()).toLatin1(), true);
    507502#endif
    508       delete newClk;
    509503      continue;
    510504    }
     
    512506    // Set the last time
    513507    // -----------------
    514     if (_lastClkCorrTime.undef() || newClk->_time > _lastClkCorrTime) {
    515       _lastClkCorrTime = newClk->_time;
     508    if (_lastClkCorrTime.undef() || newClk._time > _lastClkCorrTime) {
     509      _lastClkCorrTime = newClk._time;
    516510    }
    517511
     
    521515    deque<epoClkData*>::const_iterator it;
    522516    for (it = _epoClkData.begin(); it != _epoClkData.end(); it++) {
    523       if (newClk->_time == (*it)->_time) {
     517      if (newClk._time == (*it)->_time) {
    524518      epoch = *it;
    525519        break;
     
    527521    }
    528522    if (epoch == 0) {
    529       if (_epoClkData.empty() || newClk->_time > _epoClkData.back()->_time) {
     523      if (_epoClkData.empty() || newClk._time > _epoClkData.back()->_time) {
    530524        epoch = new epoClkData;
    531         epoch->_time = newClk->_time;
     525        epoch->_time = newClk._time;
    532526        _epoClkData.push_back(epoch);
    533527      }
     
    538532    if (epoch != 0) {
    539533      epoch->_clkCorr.push_back(newClk);
    540     }
    541     else {
    542       delete newClk;
    543534    }
    544535  }
     
    560551    }
    561552
    562     const vector<t_clkCorr*>& clkCorrVec = _epoClkData.front()->_clkCorr;
     553    const vector<t_clkCorr>& clkCorrVec = _epoClkData.front()->_clkCorr;
    563554
    564555    bncTime epoTime = _epoClkData.front()->_time;
     
    625616  corr->_orbCorr._xr    += dRAO;
    626617  corr->_orbCorr._dotXr += dDotRAO;
    627   corr->_clkCorr->_dClk  -= dC;
     618  corr->_clkCorr._dClk  -= dC;
    628619}
    629620
    630621// Process Epoch
    631622////////////////////////////////////////////////////////////////////////////
    632 void bncComb::processEpoch(bncTime epoTime, const vector<t_clkCorr*>& clkCorrVec) {
     623void bncComb::processEpoch(bncTime epoTime, const vector<t_clkCorr>& clkCorrVec) {
    633624
    634625  for (unsigned ii = 0; ii < clkCorrVec.size(); ii++) {
    635     t_clkCorr* clkCorr = clkCorrVec.at(ii);
    636     QString    staID(clkCorr->_staID.c_str());
    637     QString    prn(clkCorr->_prn.toInternalString().c_str());
    638     char       sys = clkCorr->_prn.system();
     626    const t_clkCorr& clkCorr = clkCorrVec[ii];
     627    QString    staID(clkCorr._staID.c_str());
     628    QString    prn(clkCorr._prn.toInternalString().c_str());
     629    char       sys = clkCorr._prn.system();
    639630
    640631    // Find/Check the AC Name
     
    656647    cmbCorr* newCorr       = new cmbCorr();
    657648    newCorr->_prn          = prn;
    658     newCorr->_time         = clkCorr->_time;
    659     newCorr->_iod          = clkCorr->_iod;
     649    newCorr->_time         = clkCorr._time;
     650    newCorr->_iod          = clkCorr._iod;
    660651    newCorr->_acName       = acName;
    661652    newCorr->_weightFactor = weigthFactor;
     
    670661    else {
    671662      QMap<t_prn, t_orbCorr>& storage = _orbCorrections[acName];
    672       if (!storage.contains(clkCorr->_prn)  ||
    673            storage[clkCorr->_prn]._iod != newCorr->_iod) {
     663      if (!storage.contains(clkCorr._prn)  ||
     664           storage[clkCorr._prn]._iod != newCorr->_iod) {
    674665        delete newCorr;
    675666        continue;
    676667      }
    677668      else {
    678         newCorr->_orbCorr = storage[clkCorr->_prn];
     669        newCorr->_orbCorr = storage[clkCorr._prn];
    679670      }
    680671    }
     
    686677    if (ephLast == 0) {
    687678#ifdef BNC_DEBUG_CMB
    688       //emit newMessage("bncComb: eph not found for "  + prn.mid(0,3).toLatin1(), true);
     679      emit newMessage("bncComb: eph not found for "  + prn.mid(0,3).toLatin1(), true);
    689680#endif
    690681      delete newCorr;
     
    695686             ephLast->checkState() == t_eph::unhealthy) {
    696687#ifdef BNC_DEBUG_CMB
    697 //      emit newMessage("bncComb: ephLast not ok (checkState: " +  ephLast->checkStateToString().toLatin1() + ") for "  + prn.mid(0,3).toLatin1(), true);
     688      emit newMessage("bncComb: ephLast not ok (checkState: " +  ephLast->checkStateToString().toLatin1() + ") for "  + prn.mid(0,3).toLatin1(), true);
    698689#endif
    699690      delete newCorr;
     
    711702      else {
    712703#ifdef BNC_DEBUG_CMB
    713 //        emit newMessage("bncComb: eph not found for "  + prn.mid(0,3).toLatin1() +
    714 //                        QString(" with IOD %1").arg(newCorr->_iod).toLatin1(), true);
     704        emit newMessage("bncComb: eph not found for "  + prn.mid(0,3).toLatin1() +
     705                        QString(" with IOD %1").arg(newCorr->_iod).toLatin1(), true);
    715706#endif
    716707        delete newCorr;
     
    723714    if (_satCodeBiases.contains(acName)) {
    724715      QMap<t_prn, t_satCodeBias>& storage = _satCodeBiases[acName];
    725       if (storage.contains(clkCorr->_prn)) {
    726         newCorr->_satCodeBias = storage[clkCorr->_prn];
     716      if (storage.contains(clkCorr._prn)) {
     717        newCorr->_satCodeBias = storage[clkCorr._prn];
    727718        QMap<t_frequency::type, double> codeBiasesRefSig;
    728719        for (unsigned ii = 1; ii < cmbRefSig::cIF; ii++) {
     
    10461037
    10471038    // CLOCK
    1048     t_clkCorr clkCorr(static_cast<t_clkCorr>(*corr->_clkCorr));
     1039    t_clkCorr clkCorr(corr->_clkCorr);
    10491040    clkCorr._staID      = "INTERNAL";
    10501041    clkCorr._dClk       = corr->_dClkResult;
     
    11861177    }
    11871178
    1188     ll(iObs) = (corr->_clkCorr->_dClk * t_CST::c - corr->_satCodeBiasIF) - DotProduct(AA.Row(iObs), x0);
     1179    ll(iObs) = (corr->_clkCorr._dClk * t_CST::c - corr->_satCodeBiasIF) - DotProduct(AA.Row(iObs), x0);
    11891180
    11901181    PP(iObs, iObs) *= 1.0 / (corr->_weightFactor * corr->_weightFactor);
  • trunk/BNC/src/combination/bnccomb.h

    r10224 r10225  
    9999    cmbCorr() {
    100100      _eph                        = 0;
    101       _clkCorr                    = 0;
    102101      _iod                        = 0;
    103102      _dClkResult                 = 0.0;
     
    106105    }
    107106    ~cmbCorr() {
    108 
    109107    }
    110108    QString        _prn;
     
    113111    t_eph*         _eph;
    114112    t_orbCorr      _orbCorr;
    115     t_clkCorr*     _clkCorr;
     113    t_clkCorr      _clkCorr;
    116114    t_satCodeBias  _satCodeBias;
    117115    QString        _acName;
     
    142140    epoClkData() {}
    143141    ~epoClkData() {
    144       for (unsigned ii = 0; ii < _clkCorr.size(); ii++) {
    145         delete _clkCorr[ii];
    146       }
     142      _clkCorr.erase(_clkCorr.begin(), _clkCorr.end());
    147143    }
    148144    bncTime                 _time;
    149     std::vector<t_clkCorr*> _clkCorr;
     145    std::vector<t_clkCorr> _clkCorr;
    150146  };
    151147
     
    231227  };
    232228
    233   void  processEpoch(bncTime epoTime, const std::vector<t_clkCorr*>& clkCorrVec);
     229  void  processEpoch(bncTime epoTime, const std::vector<t_clkCorr>& clkCorrVec);
    234230  void  processSystem(bncTime epoTime, char sys, QTextStream& out);
    235231  t_irc processEpoch_filter(bncTime epoTime, char sys, QTextStream& out, QMap<QString, cmbCorr*>& resCorr, ColumnVector& dx);
Note: See TracChangeset for help on using the changeset viewer.