[847] | 1 |
|
---|
| 2 | /* -------------------------------------------------------------------------
|
---|
| 3 | * BKG NTRIP Server
|
---|
| 4 | * -------------------------------------------------------------------------
|
---|
| 5 | *
|
---|
| 6 | * Class: bnsRinex
|
---|
| 7 | *
|
---|
| 8 | * Purpose: writes RINEX Clock files
|
---|
| 9 | *
|
---|
| 10 | * Author: L. Mervart
|
---|
| 11 | *
|
---|
| 12 | * Created: 25-Apr-2008
|
---|
| 13 | *
|
---|
| 14 | * Changes:
|
---|
| 15 | *
|
---|
| 16 | * -----------------------------------------------------------------------*/
|
---|
| 17 |
|
---|
[855] | 18 | #include <math.h>
|
---|
[847] | 19 | #include <iomanip>
|
---|
| 20 |
|
---|
| 21 | #include "bnsrinex.h"
|
---|
| 22 |
|
---|
| 23 | using namespace std;
|
---|
| 24 |
|
---|
| 25 | // Constructor
|
---|
| 26 | ////////////////////////////////////////////////////////////////////////////
|
---|
[850] | 27 | bnsRinex::bnsRinex(const QString& prep, const QString& ext, const QString& path,
|
---|
| 28 | const QString& intr, int sampl)
|
---|
| 29 | : bnsoutf(prep, ext, path, intr, sampl) {
|
---|
[847] | 30 | }
|
---|
| 31 |
|
---|
| 32 | // Destructor
|
---|
| 33 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 34 | bnsRinex::~bnsRinex() {
|
---|
| 35 | }
|
---|
| 36 |
|
---|
[850] | 37 | // Write One Epoch
|
---|
| 38 | ////////////////////////////////////////////////////////////////////////////
|
---|
[854] | 39 | t_irc bnsRinex::write(int GPSweek, double GPSweeks, const QString& prn,
|
---|
[850] | 40 | const ColumnVector& xx) {
|
---|
| 41 |
|
---|
[854] | 42 | if (bnsoutf::write(GPSweek, GPSweeks, prn, xx) == success) {
|
---|
[850] | 43 |
|
---|
[855] | 44 | QDateTime datTim = dateAndTimeFromGPSweek(GPSweek, GPSweeks);
|
---|
| 45 | double sec = fmod(GPSweeks, 60.0);
|
---|
| 46 |
|
---|
| 47 | _out << "AS " << prn.toAscii().data()
|
---|
| 48 | << datTim.toString(" yyyy MM dd hh mm").toAscii().data()
|
---|
[859] | 49 | << fixed << setw(10) << setprecision(6) << sec
|
---|
| 50 | << " 1 "
|
---|
| 51 | << scientific << setw(19) << setprecision(12) << xx(4) << endl;
|
---|
[855] | 52 |
|
---|
[854] | 53 | return success;
|
---|
| 54 | }
|
---|
| 55 | else {
|
---|
| 56 | return failure;
|
---|
| 57 | }
|
---|
[847] | 58 | }
|
---|
[858] | 59 |
|
---|
| 60 | // Write Header
|
---|
| 61 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 62 | void bnsRinex::writeHeader(const QDateTime& datTim) {
|
---|
| 63 |
|
---|
| 64 | _out << " 3.00 C "
|
---|
| 65 | << "RINEX VERSION / TYPE" << endl;
|
---|
| 66 |
|
---|
| 67 | _out << "BNS "
|
---|
| 68 | << datTim.toString("yyyyMMdd hhmmss").leftJustified(20, ' ', true).toAscii().data()
|
---|
| 69 | << "PGM / RUN BY / DATE" << endl;
|
---|
| 70 |
|
---|
| 71 | _out << " 1 AS "
|
---|
| 72 | << "# / TYPES OF DATA" << endl;
|
---|
| 73 |
|
---|
| 74 | _out << " "
|
---|
| 75 | << "END OF HEADER" << endl;
|
---|
| 76 | }
|
---|
| 77 |
|
---|