source: ntrip/trunk/BNS/bnssp3.cpp@ 859

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

* empty log message *

File size: 3.8 KB
Line 
1
2/* -------------------------------------------------------------------------
3 * BKG NTRIP Server
4 * -------------------------------------------------------------------------
5 *
6 * Class: bnsSP3
7 *
8 * Purpose: writes SP3 files
9 *
10 * Author: L. Mervart
11 *
12 * Created: 25-Apr-2008
13 *
14 * Changes:
15 *
16 * -----------------------------------------------------------------------*/
17
18#include <iomanip>
19#include <math.h>
20
21#include "bnssp3.h"
22#include "bnsutils.h"
23
24using namespace std;
25
26// Constructor
27////////////////////////////////////////////////////////////////////////////
28bnsSP3::bnsSP3(const QString& prep, const QString& ext, const QString& path,
29 const QString& intr, int sampl)
30 : bnsoutf(prep, ext, path, intr, sampl) {
31
32 _lastGPSweek = 0;
33 _lastGPSweeks = 0.0;
34}
35
36// Destructor
37////////////////////////////////////////////////////////////////////////////
38bnsSP3::~bnsSP3() {
39}
40
41// Write One Epoch
42////////////////////////////////////////////////////////////////////////////
43t_irc bnsSP3::write(int GPSweek, double GPSweeks, const QString& prn,
44 const ColumnVector& xx) {
45
46 if ( bnsoutf::write(GPSweek, GPSweeks, prn, xx) == success) {
47
48 if (_lastGPSweek != GPSweek || _lastGPSweeks != GPSweeks) {
49 _lastGPSweek = GPSweek;
50 _lastGPSweeks = GPSweeks;
51
52 QDateTime datTim = dateAndTimeFromGPSweek(GPSweek, GPSweeks);
53 double sec = fmod(GPSweeks, 60.0);
54
55 _out << datTim.toString("* yyyy MM dd hh mm").toAscii().data()
56 << setw(12) << setprecision(8) << sec << endl;
57 }
58 _out << "P" << prn.toAscii().data()
59 << setw(14) << setprecision(6) << xx(1) / 1000.0
60 << setw(14) << setprecision(6) << xx(2) / 1000.0
61 << setw(14) << setprecision(6) << xx(3) / 1000.0
62 << setw(14) << setprecision(6) << xx(4) * 1e6 << endl;
63
64 return success;
65 }
66 else {
67 return failure;
68 }
69}
70
71// Close File (write last line)
72////////////////////////////////////////////////////////////////////////////
73void bnsSP3::closeFile() {
74 _out << "EOF" << endl;
75 bnsoutf::closeFile();
76}
77
78// Write Header
79////////////////////////////////////////////////////////////////////////////
80void bnsSP3::writeHeader(const QDateTime& datTim) {
81 _out << "#cP2007 7 1 0 0 0.00000000 96 ORBIT IGS05 HLM IGS"
82 << "## 1434 0.00000000 900.00000000 54282 0.0000000000000"
83
84 _out << "+ 32 G01G02G03G04G05G06G07G08G09G10G11G12G13G14G15G16G17\n"
85 << "+ G18G19G20G21G22G23G24G25G26G27G28G29G30G31G32 0 0\n"
86 << "+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
87 << "+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
88 << "+ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
89 << "++ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
90 << "++ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
91 << "++ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
92 << "++ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
93 << "++ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"
94 << "%c cc cc ccc ccc cccc cccc cccc cccc ccccc ccccc ccccc ccccc\n"
95 << "%c cc cc ccc ccc cccc cccc cccc cccc ccccc ccccc ccccc ccccc\n"
96 << "%f 0.0000000 0.000000000 0.00000000000 0.000000000000000\n"
97 << "%f 0.0000000 0.000000000 0.00000000000 0.000000000000000\n"
98 << "%i 0 0 0 0 0 0 0 0 0\n"
99 << "%i 0 0 0 0 0 0 0 0 0\n"
100 << "/* \n"
101 << "/* \n"
102 << "/* \n"
103 << "/* \n";
104}
105
Note: See TracBrowser for help on using the repository browser.