Changeset 11047 in ntrip for trunk/BNC/src/PPP/pppEphPool.cpp


Ignore:
Timestamp:
Sep 28, 2026, 11:17:34 AM (7 hours ago)
Author:
stuerze
Message:

updates regarding RTCM-SSR and some ovarall improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/pppEphPool.cpp

    r10953 r11047  
    2020#include "pppInclude.h"
    2121#include "pppClient.h"
     22#include "bncephuser.h"
    2223
    2324using namespace BNC_PPP;
    … …  
    2627//
    2728/////////////////////////////////////////////////////////////////////////////
     29// Bad, outdated and unhealthy ephemerides are never used. Ephemerides from
     30// RINEX navigation files (post-processing) never pass bncEphUser's checks and
     31// stay "unchecked", so the health flag and the plausibility of the satellite
     32// distance are checked here directly as well.
     33/////////////////////////////////////////////////////////////////////////////
    2834void t_pppEphPool::putEphemeris(t_eph* eph) {
    29   if (eph && (eph->checkState() != t_eph::bad ||
    30               eph->checkState() != t_eph::unhealthy ||
    31               eph->checkState() != t_eph::outdated))  {
    32     _satEphPool[eph->prn().toInt()].putEphemeris(_maxQueueSize, eph);
     35  if (!eph) {
     36    return;
     37  }
     38  int iPrn = eph->prn().toInt();
     39  if (iPrn == 0) { // satellite number out of range
     40    delete eph;
     41  }
     42  else if (eph->checkState() == t_eph::unhealthy || eph->isUnhealthy()) {
     43    _satEphPool[iPrn].setUnhealthy(eph);
     44  }
     45  else if (eph->checkState() == t_eph::unchecked && !bncEphUser::radialDistanceOk(eph)) {
     46    LOG << "bad ephemeris " << eph->prn().toString() << ' ' << string(eph->TOC())
     47        << " - implausible satellite distance, ignored" << endl;
     48    delete eph;
     49  }
     50  else if (eph->checkState() != t_eph::bad &&
     51           eph->checkState() != t_eph::outdated) {
     52    _satEphPool[iPrn].putEphemeris(_maxQueueSize, eph);
    3353  }
    3454  else {
    … …  
    87107    delete eph;
    88108  }
     109}
     110
     111// A newer ephemeris declaring the satellite unhealthy: rejecting it alone
     112// would leave the older, healthy ephemerides in the pool, and the satellite
     113// would still be used with them - so they are all discarded, and the
     114// satellite stays unused until a newer healthy ephemeris arrives.
     115/////////////////////////////////////////////////////////////////////////////
     116void t_pppEphPool::t_satEphPool::setUnhealthy(t_eph* eph) {
     117  if (_ephs.empty() || eph->isNewerThan(_ephs.front())) {
     118    if (!_ephs.empty()) {
     119      LOG << "unhealthy ephemeris " << eph->prn().toString() << ' ' << string(eph->TOC())
     120          << " - older ephemerides of this satellite discarded" << endl;
     121    }
     122    for (unsigned ii = 0; ii < _ephs.size(); ii++) {
     123      delete _ephs[ii];
     124    }
     125    _ephs.clear();
     126  }
     127  delete eph;
    89128}
    90129
Note: See TracChangeset for help on using the changeset viewer.