Changeset 10227 in ntrip for trunk/BNC/src/combination


Ignore:
Timestamp:
Oct 20, 2023, 9:45:38 PM (12 months ago)
Author:
stuerze
Message:

minor changes

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

Legend:

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

    r10221 r10227  
    7373    delete it.value();
    7474  }
     75  _snxSatCodeBiasMap.clear();
    7576}
    7677
     
    101102////////////////////////////////////////////////////////////////////////////
    102103t_irc bncBiasSnx::readFile(const QString& fileName) {
    103 
     104  clear();
    104105  QFile inFile(fileName);
    105106  inFile.open(QIODevice::ReadOnly | QIODevice::Text);
  • trunk/BNC/src/combination/bnccomb.cpp

    r10225 r10227  
    123123
    124124  bncSettings settings;
     125
     126  _running = true;
    125127
    126128  QStringList cmbStreams = settings.value("cmbStreams").toStringList();
     
    291293  }
    292294  if (_bsx) {
    293     _ms = 6.0 * 3600 * 1000.0;
     295    _ms = 3.0 * 3600 * 1000.0;
    294296    QTimer::singleShot(_ms, this, SLOT(slotReadBiasSnxFile()));
    295297  }
     
    301303    _MAXRES = 999.0;
    302304  }
    303 
     305  _newCorr = 0;
    304306}
    305307
     
    307309////////////////////////////////////////////////////////////////////////////
    308310bncComb::~bncComb() {
     311
     312  _running = false;
     313  sleep(2);
    309314
    310315  QListIterator<cmbAC*> icAC(_ACs);
     
    317322  if (_ssrCorr) {
    318323    delete _ssrCorr;
     324  }
     325
     326  if (_newCorr) {
     327    delete _newCorr;
    319328  }
    320329
     
    331340    _buffer.remove(sys);
    332341  }
     342  _cmbSysPrn.clear();
    333343
    334344  while (!_epoClkData.empty()) {
     
    645655    // Create new correction
    646656    // ---------------------
    647     cmbCorr* newCorr       = new cmbCorr();
    648     newCorr->_prn          = prn;
    649     newCorr->_time         = clkCorr._time;
    650     newCorr->_iod          = clkCorr._iod;
    651     newCorr->_acName       = acName;
    652     newCorr->_weightFactor = weigthFactor;
    653     newCorr->_clkCorr      = clkCorr;
     657    _newCorr       = new cmbCorr();
     658    _newCorr->_prn          = prn;
     659    _newCorr->_time         = clkCorr._time;
     660    _newCorr->_iod          = clkCorr._iod;
     661    _newCorr->_acName       = acName;
     662    _newCorr->_weightFactor = weigthFactor;
     663    _newCorr->_clkCorr      = clkCorr;
    654664
    655665    // Check orbit correction
    656666    // ----------------------
    657667    if (!_orbCorrections.contains(acName)) {
    658       delete newCorr;
     668      delete _newCorr; _newCorr = 0;
    659669      continue;
    660670    }
     
    662672      QMap<t_prn, t_orbCorr>& storage = _orbCorrections[acName];
    663673      if (!storage.contains(clkCorr._prn)  ||
    664            storage[clkCorr._prn]._iod != newCorr->_iod) {
    665         delete newCorr;
     674           storage[clkCorr._prn]._iod != _newCorr->_iod) {
     675        delete _newCorr; _newCorr = 0;
    666676        continue;
    667677      }
    668678      else {
    669         newCorr->_orbCorr = storage[clkCorr._prn];
     679        _newCorr->_orbCorr = storage[clkCorr._prn];
    670680      }
    671681    }
     
    679689      emit newMessage("bncComb: eph not found for "  + prn.mid(0,3).toLatin1(), true);
    680690#endif
    681       delete newCorr;
     691      delete _newCorr; _newCorr = 0;
    682692      continue;
    683693    }
     
    688698      emit newMessage("bncComb: ephLast not ok (checkState: " +  ephLast->checkStateToString().toLatin1() + ") for "  + prn.mid(0,3).toLatin1(), true);
    689699#endif
    690       delete newCorr;
     700      delete _newCorr; _newCorr = 0;
    691701      continue;
    692702    }
    693703    else {
    694       if      (ephLast->IOD() == newCorr->_iod) {
    695         newCorr->_eph = ephLast;
     704      if      (ephLast->IOD() == _newCorr->_iod) {
     705        _newCorr->_eph = ephLast;
    696706      }
    697707      else if (ephPrev && ephPrev->checkState() == t_eph::ok &&
    698                ephPrev->IOD() == newCorr->_iod) {
    699         newCorr->_eph = ephPrev;
    700         switchToLastEph(ephLast, newCorr);
     708               ephPrev->IOD() == _newCorr->_iod) {
     709        _newCorr->_eph = ephPrev;
     710        switchToLastEph(ephLast, _newCorr);
    701711      }
    702712      else {
    703713#ifdef BNC_DEBUG_CMB
    704714        emit newMessage("bncComb: eph not found for "  + prn.mid(0,3).toLatin1() +
    705                         QString(" with IOD %1").arg(newCorr->_iod).toLatin1(), true);
     715                        QString(" with IOD %1").arg(_newCorr->_iod).toLatin1(), true);
    706716#endif
    707         delete newCorr;
     717        delete _newCorr; _newCorr = 0;
    708718        continue;
    709719      }
     
    715725      QMap<t_prn, t_satCodeBias>& storage = _satCodeBiases[acName];
    716726      if (storage.contains(clkCorr._prn)) {
    717         newCorr->_satCodeBias = storage[clkCorr._prn];
     727        _newCorr->_satCodeBias = storage[clkCorr._prn];
    718728        QMap<t_frequency::type, double> codeBiasesRefSig;
    719729        for (unsigned ii = 1; ii < cmbRefSig::cIF; ii++) {
     
    722732          char attrib = cmbRefSig::toAttrib(sys, static_cast<cmbRefSig::type>(ii));
    723733          QString rnxType2ch = QString("%1%2").arg(frqNum).arg(attrib);
    724           for (unsigned ii = 0; ii < newCorr->_satCodeBias._bias.size(); ii++) {
    725             const t_frqCodeBias& bias = newCorr->_satCodeBias._bias[ii];
     734          for (unsigned ii = 0; ii < _newCorr->_satCodeBias._bias.size(); ii++) {
     735            const t_frqCodeBias& bias = _newCorr->_satCodeBias._bias[ii];
    726736            if (rnxType2ch.toStdString() == bias._rnxType2ch) {
    727737              codeBiasesRefSig[frqType] = bias._value;
     
    731741        if (codeBiasesRefSig.size() == 2) {
    732742          map<t_frequency::type, double> codeCoeff;
    733           double channel = double(newCorr->_eph->slotNum());
     743          double channel = double(_newCorr->_eph->slotNum());
    734744          cmbRefSig::coeff(sys, cmbRefSig::cIF, channel, codeCoeff);
    735745          map<t_frequency::type, double>::const_iterator it;
    736746          for (it = codeCoeff.begin(); it != codeCoeff.end(); it++) {
    737747            t_frequency::type frqType = it->first;
    738             newCorr->_satCodeBiasIF += it->second * codeBiasesRefSig[frqType];
     748            _newCorr->_satCodeBiasIF += it->second * codeBiasesRefSig[frqType];
    739749          }
    740750        }
    741         newCorr->_satCodeBias._bias.clear();
     751        _newCorr->_satCodeBias._bias.clear();
    742752      }
    743753    }
     
    753763      QString  prn  = corr->_prn;
    754764      QString  acName = corr->_acName;
    755       if (newCorr->_acName == acName && newCorr->_prn == prn) {
     765      if (_newCorr->_acName == acName && _newCorr->_prn == prn) {
    756766        available = true;
    757767      }
    758768    }
     769
    759770    if (!available) {
    760       corrs.push_back(newCorr);
     771      corrs.push_back(_newCorr); _newCorr = 0;
    761772    }
    762773    else {
    763       delete newCorr;
     774      delete _newCorr; _newCorr = 0;
    764775      continue;
    765776    }
     
    885896  }
    886897
    887   //_buffer.remove(sys);
    888898}
    889899
     
    921931  // ---------------------------------
    922932  SymmetricMatrix QQ_sav = _QQ[sys];
    923   while (true) {
     933  while (_running) {
    924934
    925935    Matrix         AA;
     
    12361246  // Outlier Detection Loop
    12371247  // ----------------------
    1238   while (true) {
     1248  while (_running) {
    12391249
    12401250    // Remove Satellites that are not in Master
     
    14221432  }
    14231433
    1424   while (true) {
     1434  while (_running) {
    14251435
    14261436    // Compute Mean Corrections for all Satellites
  • trunk/BNC/src/combination/bnccomb.h

    r10225 r10227  
    55#include <fstream>
    66#include <iostream>
     7#include <unistd.h>
    78#include <map>
    89#include <newmat.h>
     
    244245  bncTime                                    _lastClkCorrTime;
    245246  bncTime                                    _resTime;
     247  cmbCorr*                                   _newCorr;
    246248  QMap<char, cmbEpoch>                       _buffer;
    247249  bncRtnetDecoder*                           _rtnetDecoder;
     
    271273  bool                                       _useSbas;
    272274  bool                                       _useIrnss;
     275  bool                                       _running;
    273276};
    274277
Note: See TracChangeset for help on using the changeset viewer.