source: ntrip/trunk/BNS/bnsrinex.cpp@ 1357

Last change on this file since 1357 was 859, checked in by mervart, 17 years ago

* empty log message *

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