source: ntrip/trunk/BNC/src/bncclockrinex.cpp@ 7491

Last change on this file since 7491 was 5451, checked in by mervart, 11 years ago
File size: 3.0 KB
Line 
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
24using namespace std;
25
26// Constructor
27////////////////////////////////////////////////////////////////////////////
28bncClockRinex::bncClockRinex(const QString& sklFileName, const QString& intr,
29 int sampl)
30 : bncoutf(sklFileName, intr, sampl) {
31 bncSettings settings;
32}
33
34// Destructor
35////////////////////////////////////////////////////////////////////////////
36bncClockRinex::~bncClockRinex() {
37}
38
39// Write One Epoch
40////////////////////////////////////////////////////////////////////////////
41t_irc bncClockRinex::write(int GPSweek, double GPSweeks, const QString& prn,
42 double sp3Clk) {
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 " << fortranFormat(sp3Clk, 19, 12).toAscii().data() << endl;
53
54 return success;
55 }
56 else {
57 return failure;
58 }
59}
60
61// Write Header
62////////////////////////////////////////////////////////////////////////////
63void bncClockRinex::writeHeader(const QDateTime& datTim) {
64
65 _out << " 3.00 C "
66 << "RINEX VERSION / TYPE" << endl;
67
68 _out << "BNC "
69 << datTim.toString("yyyyMMdd hhmmss").leftJustified(20, ' ', true).toAscii().data()
70 << "PGM / RUN BY / DATE" << endl;
71
72 _out << " 1 AS "
73 << "# / TYPES OF DATA" << endl;
74
75 _out << "unknown "
76 << "ANALYSIS CENTER" << endl;
77
78 _out << " 54 "
79 << "# OF SOLN SATS" << endl;
80
81 _out << "G01 G02 G03 G04 G05 G06 G07 G08 G09 G10 G11 G12 G13 G14 G15 "
82 << "PRN LIST" << endl;
83
84 _out << "G16 G17 G18 G19 G20 G21 G22 G23 G25 G26 G27 G28 G29 G30 G31 "
85 << "PRN LIST" << endl;
86
87 _out << "G32 R01 R02 R03 R05 R06 R07 R08 R09 R10 R11 R12 R13 R14 R15 "
88 << "PRN LIST" << endl;
89
90 _out << "R16 R17 R18 R19 R20 R21 R22 R23 R24 "
91 << "PRN LIST" << endl;
92
93 _out << " 0 IGS08 "
94 << "# OF SOLN STA / TRF" << endl;
95
96 _out << " "
97 << "END OF HEADER" << endl;
98}
99
Note: See TracBrowser for help on using the repository browser.