Changeset 10127 in ntrip for trunk/BNC/src/bncsp3.cpp


Ignore:
Timestamp:
Jul 20, 2023, 12:13:41 PM (10 months ago)
Author:
stuerze
Message:
 
File:
1 edited

Legend:

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

    r10123 r10127  
    7878      if (_lastEpoTime.valid() && _sampl > 0) {
    7979        for (bncTime ep = _lastEpoTime +_sampl; ep < epoTime; ep = ep +_sampl) {
    80           _out << "*  " << ep.datestr(' ') << ' ' << ep.timestr(8, ' ') << endl;
     80          _out << "\n*  " << ep.datestr(' ') << ' ' << ep.timestr(8, ' ');
    8181        }
    8282      }
     
    8484      // Print the new epoch
    8585      // -------------------
    86       _out << "*  " << epoTime.datestr(' ') << ' ' << epoTime.timestr(8, ' ') << endl;
     86      _out << "\n*  " << epoTime.datestr(' ') << ' ' << epoTime.timestr(8, ' ');
    8787
    8888      _lastEpoTime = epoTime;
    8989    }
    9090
    91     _out << "P" << prn.toLatin1().data()
     91    _out << "\nP" << prn.toLatin1().data()
    9292         << setw(14) << setprecision(6) << xCoM(1) / 1000.0 // [km]
    9393         << setw(14) << setprecision(6) << xCoM(2) / 1000.0 // [km]
    9494         << setw(14) << setprecision(6) << xCoM(3) / 1000.0 // [km]
    95          << setw(14) << setprecision(6) << sp3Clk * 1e6     // microseconds
    96          << endl;
     95         << setw(14) << setprecision(6) << sp3Clk * 1e6;     // microseconds
    9796
    9897    if (sp3ClkRate) {
    99       _out << "V" << prn.toLatin1().data()
     98      _out << "\nV" << prn.toLatin1().data()
    10099           << setw(14) << setprecision(6) << v(1) * 10.0      // [dm/s]
    101100           << setw(14) << setprecision(6) << v(2) * 10.0      // [dm/s]
    102101           << setw(14) << setprecision(6) << v(3) * 10.0      // [dm/s]
    103            << setw(14) << setprecision(6) << sp3ClkRate * 1e2 // 10^⁻4 microseconds/sec
    104            << endl;
     102           << setw(14) << setprecision(6) << sp3ClkRate * 1e2; // 10^⁻4 microseconds/sec
    105103    }
    106104    return success;
     
    212210    istringstream in(_lastLine.substr(1).c_str());
    213211    in >> sp3Sat->_prn >> sp3Sat->_xyz(1) >> sp3Sat->_xyz(2) >> sp3Sat->_xyz(3) >> sp3Sat->_clk;
    214 
    215     if (sp3Sat->_xyz.NormFrobenius() == 0.0) {
     212    sp3Sat->_xyz *= 1.e3;
     213
     214    // Simple Check - check satellite radial distance
     215    double rr = sp3Sat->_xyz.NormFrobenius();
     216    const double MINDIST = 2.e7;
     217    const double MAXDIST = 6.e7;
     218    if (rr < MINDIST || rr > MAXDIST || std::isnan(rr)) {
    216219      delete sp3Sat;
    217220      continue;
    218221    }
    219222
    220     sp3Sat->_xyz *= 1.e3;
     223    // Simple Check - clock valid
    221224    if (sp3Sat->_clk == 999999.999999) {
    222225      sp3Sat->_clkValid = false;
Note: See TracChangeset for help on using the changeset viewer.