source: ntrip/trunk/BNC/src/satObs.cpp@ 6498

Last change on this file since 6498 was 6498, checked in by mervart, 9 years ago
File size: 6.6 KB
Line 
1#include <iostream>
2#include <iomanip>
3#include <sstream>
4#include <newmatio.h>
5
6#include "satObs.h"
7
8using namespace std;
9
10// Constructor
11////////////////////////////////////////////////////////////////////////////
12t_clkCorr::t_clkCorr() {
13 _iod = 0;
14 _dClk = 0.0;
15 _dotDClk = 0.0;
16 _dotDotDClk = 0.0;
17}
18
19//
20////////////////////////////////////////////////////////////////////////////
21void t_clkCorr::writeEpoch(std::ostream* out, const QList<t_clkCorr>& corrList) {
22 if (!out || corrList.size() == 0) {
23 return;
24 }
25 out->setf(ios::fixed);
26 bncTime epoTime;
27 QListIterator<t_clkCorr> it(corrList);
28 while (it.hasNext()) {
29 const t_clkCorr& corr = it.next();
30 if (!epoTime.valid()) {
31 epoTime = corr._time;
32 *out << "> CLOCK " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
33 << corrList.size() << ' ' << corr._staID << endl;
34 }
35 *out << corr._prn.toString() << ' ' << setw(3) << corr._iod << ' '
36 << setw(10) << setprecision(4) << corr._dClk * t_CST::c << ' '
37 << setw(10) << setprecision(4) << corr._dotDClk * t_CST::c << ' '
38 << setw(10) << setprecision(4) << corr._dotDotDClk * t_CST::c << endl;
39 }
40 out->flush();
41}
42
43//
44////////////////////////////////////////////////////////////////////////////
45void t_clkCorr::readEpoch(const string epoLine, std::istream& in, QList<t_clkCorr>& corrList) {
46}
47
48// Constructor
49////////////////////////////////////////////////////////////////////////////
50t_orbCorr::t_orbCorr() {
51 _iod = 0;
52 _system = 'R';
53 _xr.ReSize(3); _xr = 0.0;
54 _dotXr.ReSize(3); _dotXr = 0.0;
55}
56
57//
58////////////////////////////////////////////////////////////////////////////
59void t_orbCorr::writeEpoch(std::ostream* out, const QList<t_orbCorr>& corrList) {
60 if (!out || corrList.size() == 0) {
61 return;
62 }
63 out->setf(ios::fixed);
64 bncTime epoTime;
65 QListIterator<t_orbCorr> it(corrList);
66 while (it.hasNext()) {
67 const t_orbCorr& corr = it.next();
68 if (!epoTime.valid()) {
69 epoTime = corr._time;
70 *out << "> ORBIT " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
71 << corrList.size() << ' ' << corr._staID << endl;
72 }
73 *out << corr._prn.toString() << ' ' << setw(3) << corr._iod << ' '
74 << setw(10) << setprecision(4) << corr._xr[0] << ' '
75 << setw(10) << setprecision(4) << corr._xr[1] << ' '
76 << setw(10) << setprecision(4) << corr._xr[2] << " "
77 << setw(10) << setprecision(4) << corr._dotXr[0] << ' '
78 << setw(10) << setprecision(4) << corr._dotXr[1] << ' '
79 << setw(10) << setprecision(4) << corr._dotXr[2] << endl;
80 }
81 out->flush();
82}
83
84//
85////////////////////////////////////////////////////////////////////////////
86void t_orbCorr::readEpoch(const string epoLine, std::istream& in, QList<t_orbCorr>& corrList) {
87}
88
89//
90////////////////////////////////////////////////////////////////////////////
91void t_satCodeBias::writeEpoch(std::ostream* out, const QList<t_satCodeBias>& biasList) {
92 if (!out || biasList.size() == 0) {
93 return;
94 }
95 out->setf(ios::fixed);
96 bncTime epoTime;
97 QListIterator<t_satCodeBias> it(biasList);
98 while (it.hasNext()) {
99 const t_satCodeBias& satCodeBias = it.next();
100 if (!epoTime.valid()) {
101 epoTime = satCodeBias._time;
102 *out << "> CODE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
103 << biasList.size() << ' ' << satCodeBias._staID << endl;
104 }
105 *out << satCodeBias._prn.toString();
106 for (unsigned ii = 0; ii < satCodeBias._bias.size(); ii++) {
107 const t_frqCodeBias& frqCodeBias = satCodeBias._bias[ii];
108 *out << " " << frqCodeBias._rnxType2ch << ' '
109 << setw(10) << setprecision(4) << frqCodeBias._value;
110 }
111 *out << endl;
112 }
113 out->flush();
114}
115
116//
117////////////////////////////////////////////////////////////////////////////
118void t_satCodeBias::readEpoch(const string epoLine, std::istream& in, QList<t_satCodeBias>& biasList) {
119}
120
121//
122////////////////////////////////////////////////////////////////////////////
123void t_satPhaseBias::writeEpoch(std::ostream* out, const QList<t_satPhaseBias>& biasList) {
124 if (!out || biasList.size() == 0) {
125 return;
126 }
127 out->setf(ios::fixed);
128 bncTime epoTime;
129 QListIterator<t_satPhaseBias> it(biasList);
130 while (it.hasNext()) {
131 const t_satPhaseBias& satPhaseBias = it.next();
132 if (!epoTime.valid()) {
133 epoTime = satPhaseBias._time;
134 *out << "> PHASE_BIAS " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
135 << biasList.size() << ' ' << satPhaseBias._staID << endl;
136 }
137 *out << satPhaseBias._prn.toString() << ' '
138 << setw(12) << setprecision(8) << satPhaseBias._yawDeg << ' '
139 << setw(12) << setprecision(8) << satPhaseBias._yawDegRate << " ";
140 for (unsigned ii = 0; ii < satPhaseBias._bias.size(); ii++) {
141 const t_frqPhaseBias& frqPhaseBias = satPhaseBias._bias[ii];
142 *out << " " << frqPhaseBias._rnxType2ch << ' '
143 << setw(10) << setprecision(4) << frqPhaseBias._value << ' '
144 << setw(3) << frqPhaseBias._fixIndicator << ' '
145 << setw(3) << frqPhaseBias._fixWideLaneIndicator << ' '
146 << setw(3) << frqPhaseBias._jumpCounter;
147 }
148 *out << endl;
149 }
150 out->flush();
151}
152
153//
154////////////////////////////////////////////////////////////////////////////
155void t_satPhaseBias::readEpoch(const string epoLine, std::istream& in, QList<t_satPhaseBias>& biasList) {
156}
157
158//
159////////////////////////////////////////////////////////////////////////////
160void t_vTec::write(std::ostream* out, const t_vTec& vTec) {
161 if (!out || vTec._layers.size() == 0) {
162 return;
163 }
164 out->setf(ios::fixed);
165 bncTime epoTime = vTec._time;
166 *out << "> VTEC " << epoTime.datestr(' ') << ' ' << epoTime.timestr(1,' ') << " "
167 << vTec._layers.size() << ' ' << vTec._staID << endl;
168 for (unsigned ii = 0; ii < vTec._layers.size(); ii++) {
169 const t_vTecLayer& layer = vTec._layers[ii];
170 *out << setw(2) << ii+1 << ' '
171 << setw(2) << layer._C.Nrows() << ' '
172 << setw(2) << layer._C.Ncols() << ' '
173 << setw(10) << setprecision(1) << layer._height << endl
174 << setw(10) << setprecision(4) << layer._C
175 << setw(10) << setprecision(4) << layer._S;
176 }
177 out->flush();
178}
179
180//
181////////////////////////////////////////////////////////////////////////////
182void t_vTec::read(const string epoLine, std::istream& in, t_vTec& vTec) {
183}
184
185//
186////////////////////////////////////////////////////////////////////////////
187t_corrSSR::e_type t_corrSSR::readEpoLine(const string line, bncTime& epoTime) {
188
189}
Note: See TracBrowser for help on using the repository browser.