Changeset 854 in ntrip


Ignore:
Timestamp:
Apr 25, 2008, 3:53:10 PM (16 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNS
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bnsoutf.cpp

    r853 r854  
    1616 * -----------------------------------------------------------------------*/
    1717
     18#include <math.h>
    1819#include <iomanip>
    1920
     
    137138                     const ColumnVector&) {
    138139
     140  if (_sampl != 0 && fmod(GPSweeks, _sampl) != 0.0) {
     141    return failure;
     142  }
     143
    139144  QDateTime datTim = dateAndTimeFromGPSweek(GPSweek, GPSweeks);
    140145
  • trunk/BNS/bnsoutf.h

    r852 r854  
    66#include <QtCore>
    77
     8#include "bnsutils.h"
     9
    810class bnsoutf {
    911 public:
     
    1214  virtual ~bnsoutf();
    1315
    14   virtual void write(int GPSweek, double GPSweeks, const QString& prn,
    15                      const ColumnVector& xx);
     16  virtual t_irc write(int GPSweek, double GPSweeks, const QString& prn,
     17                      const ColumnVector& xx);
    1618
    1719 protected:
    1820  virtual void writeHeader(const QDateTime& datTim) = 0;
    1921  std::ofstream _out;
    20   int           _lastGPSweek;
    21   double        _lastGPSweeks;
    2222
    2323 private:
  • trunk/BNS/bnsrinex.cpp

    r850 r854  
    4242// Write One Epoch
    4343////////////////////////////////////////////////////////////////////////////
    44 void bnsRinex::write(int GPSweek, double GPSweeks, const QString& prn,
     44t_irc bnsRinex::write(int GPSweek, double GPSweeks, const QString& prn,
    4545                   const ColumnVector& xx) {
    4646
    47   bnsoutf::write(GPSweek, GPSweeks, prn, xx);
     47  if (bnsoutf::write(GPSweek, GPSweeks, prn, xx) == success) {
    4848
     49    return success;
     50  }
     51  else {
     52    return failure;
     53  }
    4954}
  • trunk/BNS/bnsrinex.h

    r850 r854  
    1313           const QString& intr, int sampl);
    1414  virtual ~bnsRinex();
    15   virtual void write(int GPSweek, double GPSweeks, const QString& prn,
    16                      const ColumnVector& xx);
     15  virtual t_irc write(int GPSweek, double GPSweeks, const QString& prn,
     16                      const ColumnVector& xx);
    1717
    1818 private:
  • trunk/BNS/bnssp3.cpp

    r852 r854  
    2929               const QString& intr, int sampl)
    3030  : bnsoutf(prep, ext, path, intr, sampl) {
     31
     32  _lastGPSweek  = 0;
     33  _lastGPSweeks = 0.0;
    3134}
    3235
     
    4447// Write One Epoch
    4548////////////////////////////////////////////////////////////////////////////
    46 void bnsSP3::write(int GPSweek, double GPSweeks, const QString& prn,
     49t_irc bnsSP3::write(int GPSweek, double GPSweeks, const QString& prn,
    4750                   const ColumnVector& xx) {
    4851
    49   bnsoutf::write(GPSweek, GPSweeks, prn, xx);
     52  if ( bnsoutf::write(GPSweek, GPSweeks, prn, xx) == success) {
    5053
    51   if (_lastGPSweek != GPSweek || _lastGPSweeks != GPSweeks) {
    52     _lastGPSweek  = GPSweek;
    53     _lastGPSweeks = GPSweeks;
    54 
    55     QDateTime datTim = dateAndTimeFromGPSweek(GPSweek, GPSweeks);
    56     double sec = fmod(GPSweeks, 60.0);
    57 
    58     _out << "*  "
    59          << datTim.toString("yyyy MM dd hh mm").toAscii().data()
    60          << setw(12) << setprecision(8) << sec << endl;
     54    if (_lastGPSweek != GPSweek || _lastGPSweeks != GPSweeks) {
     55      _lastGPSweek  = GPSweek;
     56      _lastGPSweeks = GPSweeks;
     57   
     58      QDateTime datTim = dateAndTimeFromGPSweek(GPSweek, GPSweeks);
     59      double sec = fmod(GPSweeks, 60.0);
     60   
     61      _out << "*  "
     62           << datTim.toString("yyyy MM dd hh mm").toAscii().data()
     63           << setw(12) << setprecision(8) << sec << endl;
     64    }
     65    _out << "P" << prn.toAscii().data()
     66         << setw(14) << setprecision(6) << xx(1) / 1000.0
     67         << setw(14) << setprecision(6) << xx(2) / 1000.0
     68         << setw(14) << setprecision(6) << xx(3) / 1000.0
     69         << setw(14) << setprecision(6) << xx(4) * 1e6 << endl;
     70   
     71    return success;
    6172  }
    62   _out << "P" << prn.toAscii().data()
    63        << setw(14) << setprecision(6) << xx(1) / 1000.0
    64        << setw(14) << setprecision(6) << xx(2) / 1000.0
    65        << setw(14) << setprecision(6) << xx(3) / 1000.0
    66        << setw(14) << setprecision(6) << xx(4) * 1e6 << endl;
     73  else {
     74    return failure;
     75  }
    6776}
  • trunk/BNS/bnssp3.h

    r850 r854  
    1313         const QString& intr, int sampl);
    1414  virtual ~bnsSP3();
    15   virtual void write(int GPSweek, double GPSweeks, const QString& prn,
    16                      const ColumnVector& xx);
     15  virtual t_irc write(int GPSweek, double GPSweeks, const QString& prn,
     16                      const ColumnVector& xx);
    1717
    1818 private:
    1919  virtual void writeHeader(const QDateTime& datTim);
     20  int    _lastGPSweek;
     21  double _lastGPSweeks;
    2022};
    2123
  • trunk/BNS/bnsutils.h

    r804 r854  
    99
    1010class gpsEph;
     11
     12enum t_irc {failure = -1, success}; // return code
    1113
    1214void expandEnvVar(QString& str);
Note: See TracChangeset for help on using the changeset viewer.