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

Last change on this file since 8260 was 8204, checked in by wiese, 6 years ago

CHANGE: #105 toAscii deprecated

File size: 3.0 KB
RevLine 
[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 *
[7570]14 * Changes:
[3175]15 *
16 * -----------------------------------------------------------------------*/
17
18#include <math.h>
19#include <iomanip>
20
21#include "bncclockrinex.h"
22#include "bncsettings.h"
[7570]23#include "bncversion.h"
[3175]24
25using namespace std;
26
27// Constructor
28////////////////////////////////////////////////////////////////////////////
[7570]29bncClockRinex::bncClockRinex(const QString& sklFileName, const QString& intr,
30 int sampl)
[3184]31 : bncoutf(sklFileName, intr, sampl) {
[3175]32 bncSettings settings;
33}
34
35// Destructor
36////////////////////////////////////////////////////////////////////////////
37bncClockRinex::~bncClockRinex() {
38}
39
40// Write One Epoch
41////////////////////////////////////////////////////////////////////////////
[7570]42t_irc bncClockRinex::write(int GPSweek, double GPSweeks, const QString& prn,
[4991]43 double sp3Clk) {
[3175]44
[3184]45 if (reopen(GPSweek, GPSweeks) == success) {
[3175]46
47 QDateTime datTim = dateAndTimeFromGPSweek(GPSweek, GPSweeks);
48 double sec = fmod(GPSweeks, 60.0);
[7570]49
[8204]50 _out << "AS " << prn.toLatin1().data()
51 << datTim.toString(" yyyy MM dd hh mm").toLatin1().data()
[7570]52 << fixed << setw(10) << setprecision(6) << sec
[8204]53 << " 1 " << fortranFormat(sp3Clk, 19, 12).toLatin1().data() << endl;
[3175]54
55 return success;
56 }
57 else {
58 return failure;
59 }
60}
61
62// Write Header
63////////////////////////////////////////////////////////////////////////////
64void bncClockRinex::writeHeader(const QDateTime& datTim) {
65
66 _out << " 3.00 C "
67 << "RINEX VERSION / TYPE" << endl;
68
[7570]69
70 _out << "BNC v" << BNCVERSION << " "
[8204]71 << datTim.toString("yyyyMMdd hhmmss").leftJustified(20, ' ', true).toLatin1().data()
[3175]72 << "PGM / RUN BY / DATE" << endl;
73
74 _out << " 1 AS "
75 << "# / TYPES OF DATA" << endl;
76
[4253]77 _out << "unknown "
78 << "ANALYSIS CENTER" << endl;
79
80 _out << " 54 "
81 << "# OF SOLN SATS" << endl;
82
83 _out << "G01 G02 G03 G04 G05 G06 G07 G08 G09 G10 G11 G12 G13 G14 G15 "
84 << "PRN LIST" << endl;
85
86 _out << "G16 G17 G18 G19 G20 G21 G22 G23 G25 G26 G27 G28 G29 G30 G31 "
87 << "PRN LIST" << endl;
88
89 _out << "G32 R01 R02 R03 R05 R06 R07 R08 R09 R10 R11 R12 R13 R14 R15 "
90 << "PRN LIST" << endl;
91
92 _out << "R16 R17 R18 R19 R20 R21 R22 R23 R24 "
93 << "PRN LIST" << endl;
94
[8084]95 _out << " 0 IGS14 "
[4253]96 << "# OF SOLN STA / TRF" << endl;
97
[3175]98 _out << " "
99 << "END OF HEADER" << endl;
100}
101
Note: See TracBrowser for help on using the repository browser.