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 | ////////////////////////////////////////////////////////////////////////////
|
---|
28 | bncClockRinex::bncClockRinex(const QString& sklFileName, const QString& intr,
|
---|
29 | int sampl)
|
---|
30 | : bncoutf(sklFileName, intr, sampl) {
|
---|
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 |
|
---|
44 | if (reopen(GPSweek, GPSweeks) == success) {
|
---|
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 << "unknown "
|
---|
77 | << "ANALYSIS CENTER" << endl;
|
---|
78 |
|
---|
79 | _out << " 54 "
|
---|
80 | << "# OF SOLN SATS" << endl;
|
---|
81 |
|
---|
82 | _out << "G01 G02 G03 G04 G05 G06 G07 G08 G09 G10 G11 G12 G13 G14 G15 "
|
---|
83 | << "PRN LIST" << endl;
|
---|
84 |
|
---|
85 | _out << "G16 G17 G18 G19 G20 G21 G22 G23 G25 G26 G27 G28 G29 G30 G31 "
|
---|
86 | << "PRN LIST" << endl;
|
---|
87 |
|
---|
88 | _out << "G32 R01 R02 R03 R05 R06 R07 R08 R09 R10 R11 R12 R13 R14 R15 "
|
---|
89 | << "PRN LIST" << endl;
|
---|
90 |
|
---|
91 | _out << "R16 R17 R18 R19 R20 R21 R22 R23 R24 "
|
---|
92 | << "PRN LIST" << endl;
|
---|
93 |
|
---|
94 | _out << " 0 IGS08 "
|
---|
95 | << "# OF SOLN STA / TRF" << endl;
|
---|
96 |
|
---|
97 | _out << " "
|
---|
98 | << "END OF HEADER" << endl;
|
---|
99 | }
|
---|
100 |
|
---|