Changeset 10608 in ntrip for trunk/BNC


Ignore:
Timestamp:
Feb 13, 2025, 9:50:06 AM (3 days ago)
Author:
stuerze
Message:

inclusion of the 24:00 epoch in orbit and clock product files

Location:
trunk/BNC/src
Files:
6 edited

Legend:

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

    r9908 r10608  
    4747  if (reopen(GPSweek, GPSweeks) == success) {
    4848
    49       QDateTime datTim = dateAndTimeFromGPSweek(GPSweek, GPSweeks);
    50       double sec = fmod(GPSweeks, 60.0);
     49    bncTime epoTime(GPSweek, GPSweeks);
    5150
    52       int numValues = 1;
    53       if (clkRnxSig && clkRnxRate && clkRnxRateSig) {
    54         numValues += 3;
    55       }
    56       if (clkRnxAcc && clkRnxAccSig) {
    57         numValues += 2;
     51    if (epoTime != _lastEpoTime) {
     52
     53      // print out epoch before
     54      if (_lastEpoTime.valid()) {
     55        _out << _oStr.str();
     56        if (_lastEpoTime.daysec() != 0.0) {
     57          _oStr.str(std::string());
     58        }
    5859      }
    5960
    60       _out << "AS " << prn.toLatin1().data()
    61            << datTim.toString("  yyyy MM dd hh mm").toLatin1().data()
    62            << fixed      << setw(10) << setprecision(6)  << sec
    63            << "  " << numValues << "   "
    64            << fortranFormat(clkRnx, 19, 12).toLatin1().data();
     61      _lastEpoTime = epoTime;
     62    }
    6563
    66       if (numValues >=2) {
    67         _out << " " << fortranFormat(clkRnxSig, 19, 12).toLatin1().data() << endl;
    68       }
    69       if (numValues == 4) {
    70         _out << fortranFormat(clkRnxRate, 19, 12).toLatin1().data() << " ";
    71         _out << fortranFormat(clkRnxRateSig, 19, 12).toLatin1().data() << " ";
    72       }
    73       if (numValues == 6) {
    74         _out << fortranFormat(clkRnxAcc, 19, 12).toLatin1().data() << " ";
    75         _out << " " << fortranFormat(clkRnxAccSig, 19, 12).toLatin1().data();
    76       }
    77       _out << endl;
     64    int numValues = 1;
     65    if (clkRnxSig && clkRnxRate && clkRnxRateSig) {
     66      numValues += 3;
     67    }
     68    if (clkRnxAcc && clkRnxAccSig) {
     69      numValues += 2;
     70    }
     71
     72    _oStr << "AS " << prn.toLatin1().data()
     73         << "  " <<  epoTime.datestr(' ') << ' ' << epoTime.timestr(6, ' ')
     74         << "  " << numValues << "   "
     75         << fortranFormat(clkRnx, 19, 12).toLatin1().data();
     76
     77    if (numValues >=2) {
     78      _oStr << " " << fortranFormat(clkRnxSig, 19, 12).toLatin1().data() << endl;
     79    }
     80    if (numValues == 4) {
     81      _oStr << fortranFormat(clkRnxRate, 19, 12).toLatin1().data() << " ";
     82      _oStr << fortranFormat(clkRnxRateSig, 19, 12).toLatin1().data() << " ";
     83    }
     84    if (numValues == 6) {
     85      _oStr << fortranFormat(clkRnxAcc, 19, 12).toLatin1().data() << " ";
     86      _oStr << " " << fortranFormat(clkRnxAccSig, 19, 12).toLatin1().data();
     87    }
     88    _oStr << endl;
    7889
    7990    return success;
  • trunk/BNC/src/bncclockrinex.h

    r9651 r10608  
    1818 private:
    1919  virtual void writeHeader(const QDateTime& datTim);
     20  std::ostringstream _oStr;
     21  bncTime            _lastEpoTime;
    2022};
    2123
  • trunk/BNC/src/bncoutf.cpp

    r10375 r10608  
    187187  QString newFileName = resolveFileName(GPSweek, datTim);
    188188
     189  bool wait = false;
     190  if (isProductFile() &&
     191      datTim.time().hour()   == 0 &&
     192      datTim.time().minute() == 0 &&
     193      (datTim.time().second() == 0.0 ||  datTim.time().second() == _sampl)) {
     194    wait = true;
     195  }
     196
    189197  // Close the file
    190198  // --------------
    191   if (newFileName != _fName) {
     199  if (newFileName != _fName && !wait) {
    192200    closeFile();
    193201    _headerWritten = false;
     
    226234  return QString("%1").arg(_sklBaseName.left(3));
    227235}
     236
     237// Files with epoch 00:00:00 at begin and end
     238////////////////////////////////////////////////////////////////////////////
     239bool bncoutf::isProductFile() {
     240 bool isProduct = false;
     241
     242 if (_extension.contains("SP3")) {
     243   isProduct = true;
     244 }
     245 if (_extension.contains("CLK")) {
     246   isProduct = true;
     247 }
     248
     249  return isProduct;
     250}
     251
     252
  • trunk/BNC/src/bncoutf.h

    r9783 r10608  
    1515  t_irc write(int GPSweek, double GPSweeks, const QString& str);
    1616  QString agencyFromFileName();
     17  bool isProductFile();
    1718 protected:
    1819  virtual t_irc reopen(int GPSweek, double GPSweeks);
  • trunk/BNC/src/bncsp3.cpp

    r10578 r10608  
    7474    if (epoTime != _lastEpoTime) {
    7575
    76       // Check the sampling interval (print empty epochs)
    77       // ------------------------------------------------
    78       if (_lastEpoTime.valid() && _sampl > 0) {
    79         for (bncTime ep = _lastEpoTime +_sampl; ep < epoTime; ep = ep +_sampl) {
    80           _out << "\n*  " << ep.datestr(' ') << ' ' << ep.timestr(8, ' ');
     76      // print out epoch before
     77      if (_lastEpoTime.valid()) {
     78        _out << _oStr.str();
     79        if (_lastEpoTime.daysec() != 0.0) {
     80          _oStr.str(std::string());
     81        }
     82        // Check the sampling interval (print empty epochs)
     83        // ------------------------------------------------
     84        if (_sampl > 0) {
     85          for (bncTime ep = _lastEpoTime +_sampl; ep < epoTime; ep = ep +_sampl) {
     86            _oStr << "\n*  " << ep.datestr(' ') << ' ' << ep.timestr(8, ' ');
     87          }
    8188        }
    8289      }
     
    8491      // Print the new epoch
    8592      // -------------------
    86       _out << "\n*  " << epoTime.datestr(' ') << ' ' << epoTime.timestr(8, ' ');
     93      _oStr << "\n*  " << epoTime.datestr(' ') << ' ' << epoTime.timestr(8, ' ');
    8794
    8895      _lastEpoTime = epoTime;
    8996    }
    9097
    91     _out << "\nP" << prn.toLatin1().data()
     98    _oStr << "\nP" << prn.toLatin1().data()
    9299         << setw(14) << setprecision(6) << xCoM(1) / 1000.0 // [km]
    93100         << setw(14) << setprecision(6) << xCoM(2) / 1000.0 // [km]
     
    96103
    97104    if (sp3ClkRate) {
    98       _out << "\nV" << prn.toLatin1().data()
     105      _oStr << "\nV" << prn.toLatin1().data()
    99106           << setw(14) << setprecision(6) << v(1) * 10.0      // [dm/s]
    100107           << setw(14) << setprecision(6) << v(2) * 10.0      // [dm/s]
     
    177184       << "/*                                                          \n"
    178185       << "/*                                                          \n"
    179        << "/*                                                          \n";
     186       << "/*                                                          ";
    180187}
    181188
  • trunk/BNC/src/bncsp3.h

    r8483 r10608  
    5656  virtual void closeFile();
    5757
    58   e_inpOut      _inpOut;
    59   bncTime       _lastEpoTime;
    60   std::ifstream _stream;
    61   std::string   _lastLine;
    62   t_sp3Epoch*   _currEpoch;
    63   t_sp3Epoch*   _prevEpoch;
     58  e_inpOut           _inpOut;
     59  bncTime            _lastEpoTime;
     60  std::ifstream      _stream;
     61  std::string        _lastLine;
     62  t_sp3Epoch*        _currEpoch;
     63  t_sp3Epoch*        _prevEpoch;
     64  std::ostringstream _oStr;
    6465};
    6566
Note: See TracChangeset for help on using the changeset viewer.