[848] | 1 |
|
---|
| 2 | /* -------------------------------------------------------------------------
|
---|
| 3 | * BKG NTRIP Server
|
---|
| 4 | * -------------------------------------------------------------------------
|
---|
| 5 | *
|
---|
| 6 | * Class: bnsSP3
|
---|
| 7 | *
|
---|
| 8 | * Purpose: writes SP3 files
|
---|
| 9 | *
|
---|
| 10 | * Author: L. Mervart
|
---|
| 11 | *
|
---|
| 12 | * Created: 25-Apr-2008
|
---|
| 13 | *
|
---|
| 14 | * Changes:
|
---|
| 15 | *
|
---|
| 16 | * -----------------------------------------------------------------------*/
|
---|
| 17 |
|
---|
| 18 | #include <iomanip>
|
---|
[852] | 19 | #include <math.h>
|
---|
[848] | 20 |
|
---|
| 21 | #include "bnssp3.h"
|
---|
[849] | 22 | #include "bnsutils.h"
|
---|
[848] | 23 |
|
---|
| 24 | using namespace std;
|
---|
| 25 |
|
---|
| 26 | // Constructor
|
---|
| 27 | ////////////////////////////////////////////////////////////////////////////
|
---|
[850] | 28 | bnsSP3::bnsSP3(const QString& prep, const QString& ext, const QString& path,
|
---|
| 29 | const QString& intr, int sampl)
|
---|
| 30 | : bnsoutf(prep, ext, path, intr, sampl) {
|
---|
[854] | 31 |
|
---|
| 32 | _lastGPSweek = 0;
|
---|
| 33 | _lastGPSweeks = 0.0;
|
---|
[848] | 34 | }
|
---|
| 35 |
|
---|
| 36 | // Destructor
|
---|
| 37 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 38 | bnsSP3::~bnsSP3() {
|
---|
| 39 | }
|
---|
| 40 |
|
---|
[849] | 41 | // Write Header
|
---|
| 42 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 43 | void bnsSP3::writeHeader(const QDateTime& datTim) {
|
---|
[852] | 44 | _out << "THIS IS A DUMMY SP3 HEADER" << endl;
|
---|
[849] | 45 | }
|
---|
| 46 |
|
---|
| 47 | // Write One Epoch
|
---|
| 48 | ////////////////////////////////////////////////////////////////////////////
|
---|
[854] | 49 | t_irc bnsSP3::write(int GPSweek, double GPSweeks, const QString& prn,
|
---|
[848] | 50 | const ColumnVector& xx) {
|
---|
[849] | 51 |
|
---|
[854] | 52 | if ( bnsoutf::write(GPSweek, GPSweeks, prn, xx) == success) {
|
---|
[849] | 53 |
|
---|
[854] | 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 |
|
---|
[855] | 61 | _out << datTim.toString("* yyyy MM dd hh mm").toAscii().data()
|
---|
[854] | 62 | << setw(12) << setprecision(8) << sec << endl;
|
---|
| 63 | }
|
---|
| 64 | _out << "P" << prn.toAscii().data()
|
---|
| 65 | << setw(14) << setprecision(6) << xx(1) / 1000.0
|
---|
| 66 | << setw(14) << setprecision(6) << xx(2) / 1000.0
|
---|
| 67 | << setw(14) << setprecision(6) << xx(3) / 1000.0
|
---|
| 68 | << setw(14) << setprecision(6) << xx(4) * 1e6 << endl;
|
---|
| 69 |
|
---|
| 70 | return success;
|
---|
[852] | 71 | }
|
---|
[854] | 72 | else {
|
---|
| 73 | return failure;
|
---|
| 74 | }
|
---|
[848] | 75 | }
|
---|