Changeset 10227 in ntrip for trunk/BNC


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

minor changes

Location:
trunk/BNC/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit_igs.cpp

    r9962 r10227  
    2323  std::vector< std::vector<unsigned int> > status(CLOCKORBIT_SATNUM, std::vector<unsigned int>(COBOFS_NUM));
    2424  unsigned int i, s;
    25 
    26   //memset(status, 0, sizeof(status));
    2725
    2826  STARTDATA
  • 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
  • trunk/BNC/src/upload/bncrtnetuploadcaster.cpp

    r10221 r10227  
    828828        || co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0
    829829        || co.NumberOfSat[CLOCKORBIT_SATBDS] > 0) {
    830       char obuffer[CLOCKORBIT_BUFFERSIZE] = {0};
     830      char obuffer[CLOCKORBIT_BUFFERSIZE] = {'\0'};
    831831      int len = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_AUTO, 0, obuffer, sizeof(obuffer));
    832832      if (len > 0) {
     
    840840  else {
    841841    if (co.NumberOfSat[CLOCKORBIT_SATGPS] > 0) {
    842       char obuffer[CLOCKORBIT_BUFFERSIZE] = {0};
     842      char obuffer[CLOCKORBIT_BUFFERSIZE] = {'\0'};
    843843      if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
    844844        co.UpdateInterval = ephUpdInd;
    845         int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GPSORBIT, 1, obuffer,
    846             sizeof(obuffer));
     845        int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GPSORBIT, 1, obuffer, sizeof(obuffer));
    847846        co.UpdateInterval = clkUpdInd;
    848847        if (len1 > 0) {
     
    855854                  co.NumberOfSat[CLOCKORBIT_SATSBAS]    > 0 ||
    856855                  co.NumberOfSat[CLOCKORBIT_SATBDS]     > 0   ) ? 1 : 0;
    857       int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GPSCLOCK, mmsg, obuffer,
    858           sizeof(obuffer));
     856      int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GPSCLOCK, mmsg, obuffer, sizeof(obuffer));
    859857      if (len2 > 0) {
    860858        hlpBufferCo += QByteArray(obuffer, len2);
     
    865863      if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
    866864        co.UpdateInterval = ephUpdInd;
    867         int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GLONASSORBIT, 1, obuffer,
    868             sizeof(obuffer));
     865        int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GLONASSORBIT, 1, obuffer, sizeof(obuffer));
    869866        co.UpdateInterval = clkUpdInd;
    870867        if (len1 > 0) {
     
    876873                  co.NumberOfSat[CLOCKORBIT_SATSBAS]    > 0 ||
    877874                  co.NumberOfSat[CLOCKORBIT_SATBDS]     > 0   ) ? 1 : 0;
    878       int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GLONASSCLOCK, mmsg, obuffer,
    879           sizeof(obuffer));
     875      int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GLONASSCLOCK, mmsg, obuffer, sizeof(obuffer));
    880876      if (len2 > 0) {
    881877        hlpBufferCo += QByteArray(obuffer, len2);
     
    886882      if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
    887883        co.UpdateInterval = ephUpdInd;
    888         int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GALILEOORBIT, 1, obuffer,
    889             sizeof(obuffer));
     884        int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GALILEOORBIT, 1, obuffer, sizeof(obuffer));
    890885        co.UpdateInterval = clkUpdInd;
    891886        if (len1 > 0) {
     
    896891                  co.NumberOfSat[CLOCKORBIT_SATSBAS]    > 0 ||
    897892                  co.NumberOfSat[CLOCKORBIT_SATBDS]     > 0   ) ? 1 : 0;
    898       int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GALILEOCLOCK, mmsg, obuffer,
    899           sizeof(obuffer));
     893      int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GALILEOCLOCK, mmsg, obuffer, sizeof(obuffer));
    900894      if (len2 > 0) {
    901895        hlpBufferCo += QByteArray(obuffer, len2);
     
    906900      if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
    907901        co.UpdateInterval = ephUpdInd;
    908         int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_QZSSORBIT, 1, obuffer,
    909             sizeof(obuffer));
     902        int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_QZSSORBIT, 1, obuffer, sizeof(obuffer));
    910903        co.UpdateInterval = clkUpdInd;
    911904        if (len1 > 0) {
     
    915908      int mmsg = (co.NumberOfSat[CLOCKORBIT_SATSBAS]    > 0 ||
    916909                  co.NumberOfSat[CLOCKORBIT_SATBDS]     > 0   ) ? 1 : 0;
    917       int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_QZSSCLOCK, mmsg, obuffer,
    918           sizeof(obuffer));
     910      int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_QZSSCLOCK, mmsg, obuffer, sizeof(obuffer));
    919911      if (len2 > 0) {
    920912        hlpBufferCo += QByteArray(obuffer, len2);
     
    925917      if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
    926918        co.UpdateInterval = ephUpdInd;
    927         int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_SBASORBIT, 1, obuffer,
    928             sizeof(obuffer));
     919        int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_SBASORBIT, 1, obuffer, sizeof(obuffer));
    929920        co.UpdateInterval = clkUpdInd;
    930921        if (len1 > 0) {
     
    943934      if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) {
    944935        co.UpdateInterval = ephUpdInd;
    945         int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_BDSORBIT, 1, obuffer,
    946             sizeof(obuffer));
     936        int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_BDSORBIT, 1, obuffer, sizeof(obuffer));
    947937        co.UpdateInterval = clkUpdInd;
    948938        if (len1 > 0) {
     
    951941      }
    952942      int mmsg = 0;
    953       int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_BDSCLOCK, mmsg, obuffer,
    954           sizeof(obuffer));
     943      int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_BDSCLOCK, mmsg, obuffer, sizeof(obuffer));
    955944      if (len2 > 0) {
    956945        hlpBufferCo += QByteArray(obuffer, len2);
  • trunk/BNC/src/upload/bncuploadcaster.cpp

    r10221 r10227  
    163163        if (_ntripVersion == "1") {
    164164          _outSocket->write(_outBuffer);
     165          _outSocket->flush();
    165166        } else {
    166167          QString chunkSize = QString("%1").arg(_outBuffer.size(), 0, 16,  QLatin1Char('0'));
    167168          QByteArray chunkedData = chunkSize.toLatin1() + "\r\n" + _outBuffer  + "\r\n";
    168169          _outSocket->write(chunkedData);
     170          _outSocket->flush();
    169171        }
    170         _outSocket->flush();
    171172        emit newBytes(_mountpoint.toLatin1(), _outBuffer.size());
    172173      }
Note: See TracChangeset for help on using the changeset viewer.