source: ntrip/trunk/BNC/bncclockrinex.cpp@ 3854

Last change on this file since 3854 was 3184, checked in by mervart, 14 years ago
File size: 2.3 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 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////////////////////////////////////////////////////////////////////////////
64void 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
Note: See TracBrowser for help on using the repository browser.