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