Changeset 10791 in ntrip for trunk/BNC/src/pppRun.cpp


Ignore:
Timestamp:
Dec 3, 2025, 5:37:16 PM (3 weeks ago)
Author:
mervart
Message:

BNC Multifrequency and PPPAR Client (initial version)

File:
1 edited

Legend:

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

    r10763 r10791  
    133133    _rnxNavFile = 0;
    134134    _corrFile   = 0;
     135    _biasFile   = 0;
    135136    _ionoFile   = 0;
    136137    _speed      = settings.value("PPP/mapSpeedSlider").toInt();
     
    274275  QMutexLocker locker(&_mutex);
    275276
     277  //// beg test
     278  // if (obsList.size() > 0) {
     279  //   const double sampling = 5.0;
     280  //   const bncTime& tt = obsList[0]._time;
     281  //   double mod = remainder(tt.gpssec(), sampling);
     282  //   if (fabs(mod) > 0.05) {
     283  //     return;
     284  //   }
     285  // }
     286  //// end test
     287
    276288  if (string(staID.data()) != _opt->_roverName) {
    277289    return;
     
    432444      return;
    433445    }
    434     if ( _opt->_ionoMount.empty() &&
    435         !_opt->_corrMount.empty() && _opt->_corrMount != vTec._staID) {
    436       return;
    437     }
    438     if (!_opt->_ionoMount.empty() && _opt->_ionoMount != vTec._staID) {
    439       return;
     446    if      (!_opt->_ionoMount.empty()) {
     447      if (_opt->_ionoMount != vTec._staID) {
     448        return;
     449      }
     450    }
     451    else if (!_opt->_corrMount.empty()) {
     452      if (_opt->_corrMount != vTec._staID) {
     453        return;
     454      }
    440455    }
    441456  }
     
    499514
    500515  if (_opt->_realTime) {
    501     if (_opt->_corrMount.empty() || _opt->_corrMount != codeBiases[0]._staID) {
     516    if (_opt->_corrMount.empty() && _opt->_biasMount.empty()) {
    502517      return;
     518    }
     519    if      (!_opt->_biasMount.empty()) {
     520      if (_opt->_biasMount != codeBiases[0]._staID) {
     521        return;
     522      }
     523    }
     524    else if (!_opt->_corrMount.empty()) {
     525      if (_opt->_corrMount != codeBiases[0]._staID) {
     526        return;
     527      }
    503528    }
    504529  }
     
    523548
    524549  if (_opt->_realTime) {
    525     if (_opt->_corrMount.empty() || _opt->_corrMount != phaseBiases[0]._staID) {
     550    if (_opt->_corrMount.empty() && _opt->_biasMount.empty()) {
    526551      return;
     552    }
     553    if      (!_opt->_biasMount.empty()) {
     554      if (_opt->_biasMount != phaseBiases[0]._staID) {
     555        return;
     556      }
     557    }
     558    else if (!_opt->_corrMount.empty()) {
     559      if (_opt->_corrMount != phaseBiases[0]._staID) {
     560        return;
     561      }
    527562    }
    528563  }
     
    563598  if (!_opt->_corrFile.empty()) {
    564599    _corrFile = new t_corrFile(QString(_opt->_corrFile.c_str()));
     600    connect(_corrFile, SIGNAL(newOrbCorrections(QList<t_orbCorr>)), this, SLOT(slotNewOrbCorrections(QList<t_orbCorr>)));
     601    connect(_corrFile, SIGNAL(newClkCorrections(QList<t_clkCorr>)), this, SLOT(slotNewClkCorrections(QList<t_clkCorr>)));
     602    if (_opt->_biasFile.empty()) {
     603      connect(_corrFile, SIGNAL(newCodeBiases(QList<t_satCodeBias>)), this, SLOT(slotNewCodeBiases(QList<t_satCodeBias>)));
     604      connect(_corrFile, SIGNAL(newPhaseBiases(QList<t_satPhaseBias>)), this, SLOT(slotNewPhaseBiases(QList<t_satPhaseBias>)));
     605    }
    565606    if (_opt->_ionoFile.empty()) {
    566607      connect(_corrFile, SIGNAL(newTec(t_vTec)), this, SLOT(slotNewTec(t_vTec)));
    567608    }
    568     connect(_corrFile, SIGNAL(newOrbCorrections(QList<t_orbCorr>)), this, SLOT(slotNewOrbCorrections(QList<t_orbCorr>)));
    569     connect(_corrFile, SIGNAL(newClkCorrections(QList<t_clkCorr>)), this, SLOT(slotNewClkCorrections(QList<t_clkCorr>)));
    570     connect(_corrFile, SIGNAL(newCodeBiases(QList<t_satCodeBias>)), this, SLOT(slotNewCodeBiases(QList<t_satCodeBias>)));
    571     connect(_corrFile, SIGNAL(newPhaseBiases(QList<t_satPhaseBias>)), this, SLOT(slotNewPhaseBiases(QList<t_satPhaseBias>)));
     609  }
     610
     611  if (!_opt->_biasFile.empty()) {
     612    _biasFile = new t_corrFile(QString(_opt->_biasFile.c_str()));
     613    connect(_biasFile, SIGNAL(newCodeBiases(QList<t_satCodeBias>)), this, SLOT(slotNewCodeBiases(QList<t_satCodeBias>)));
     614    connect(_biasFile, SIGNAL(newPhaseBiases(QList<t_satPhaseBias>)), this, SLOT(slotNewPhaseBiases(QList<t_satPhaseBias>)));
    572615  }
    573616
     
    591634    // Get Corrections
    592635    // ---------------
    593     if (_corrFile) {
    594       try {
    595         _corrFile->syncRead(epo->tt);
    596       }
    597       catch (const char* msg) {
    598         emit newMessage(QByteArray(msg), true);
    599         break;
    600       }
    601       catch (const string& msg) {
    602         emit newMessage(QByteArray(msg.c_str()), true);
    603         break;
    604       }
    605       catch (...) {
    606         emit newMessage("unknown exceptions in corrFile", true);
    607         break;
    608       }
    609     }
    610 
    611     // Get Additional VTEC Informations
    612     // --------------------------------
    613     if (_ionoFile) {
    614       try {
    615         _ionoFile->syncRead(epo->tt);
    616       }
    617       catch (const char* msg) {
    618         emit newMessage(QByteArray(msg), true);
    619         break;
    620       }
    621       catch (const string& msg) {
    622         emit newMessage(QByteArray(msg.c_str()), true);
    623         break;
    624       }
    625       catch (...) {
    626         emit newMessage("unknown exceptions in ionoFile", true);
    627         break;
     636    for (t_corrFile* file : {_corrFile, _biasFile, _ionoFile}) {
     637      if (file) {
     638        try {
     639          file->syncRead(epo->tt);
     640        }
     641        catch (const char* msg) {
     642          emit newMessage(QByteArray(msg), true);
     643          break;
     644        }
     645        catch (const string& msg) {
     646          emit newMessage(QByteArray(msg.c_str()), true);
     647          break;
     648        }
     649        catch (...) {
     650          emit newMessage("unknown exceptions in file " + file->name().toLatin1(), true);
     651          break;
     652        }
    628653      }
    629654    }
Note: See TracChangeset for help on using the changeset viewer.