Changeset 852 in ntrip for trunk/BNS/bnssp3.cpp


Ignore:
Timestamp:
Apr 25, 2008, 1:31:46 PM (14 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bnssp3.cpp

    r850 r852  
    1717
    1818#include <iomanip>
     19#include <math.h>
    1920
    2021#include "bnssp3.h"
     
    3839////////////////////////////////////////////////////////////////////////////
    3940void bnsSP3::writeHeader(const QDateTime& datTim) {
    40   _out << "THIS IS A DUMMY HEADER" << endl;
     41  _out << "THIS IS A DUMMY SP3 HEADER" << endl;
    4142}
    4243
     
    4849  bnsoutf::write(GPSweek, GPSweeks, prn, xx);
    4950
    50   int year, month, day, hour, min;
    51   double sec;
     51  if (_lastGPSweek != GPSweek || _lastGPSweeks != GPSweeks) {
     52    _lastGPSweek  = GPSweek;
     53    _lastGPSweeks = GPSweeks;
    5254
    53   _out << "*  " << setw(4) << year
    54        << setw(3) << month
    55        << setw(3) << day
    56        << setw(3) << hour
    57        << setw(3) << min
    58        << setw(12) << setprecision(8) << sec << endl;
     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;
     61  }
    5962  _out << "P" << prn.toAscii().data()
    6063       << setw(14) << setprecision(6) << xx(1) / 1000.0
    6164       << setw(14) << setprecision(6) << xx(2) / 1000.0
    6265       << setw(14) << setprecision(6) << xx(3) / 1000.0
    63        << " 999999.999999" << endl;
     66       << setw(14) << setprecision(6) << xx(4) * 1e6 << endl;
    6467}
Note: See TracChangeset for help on using the changeset viewer.