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

Last change on this file since 6251 was 6184, checked in by mervart, 10 years ago
File size: 2.6 KB
Line 
1#include <iostream>
2#include <iomanip>
3#include <sstream>
4
5#include "satObs.h"
6
7using namespace std;
8
9//
10////////////////////////////////////////////////////////////////////////////
11t_clkCorr::t_clkCorr(const string& line) {
12 reset();
13 istringstream in(line);
14 char ch; in >> ch; if (ch != 'C') return;
15 int gpsw;
16 double gpssec;
17 in >> gpsw >> gpssec >> _prn >> _iod >> _dClk >> _dotDClk >> _dotDotDClk;
18 _time.set(gpsw, gpssec);
19 _dClk /= t_CST::c;
20 _dotDClk /= t_CST::c;
21 _dotDotDClk /= t_CST::c;
22}
23
24//
25////////////////////////////////////////////////////////////////////////////
26void t_clkCorr::reset() {
27 _prn.set(' ', 0);
28 _time.reset();
29 _iod = 0;
30 _dClk = 0.0;
31 _dotDClk = 0.0;
32 _dotDotDClk = 0.0;
33 _clkPartial = 0.0;
34}
35
36//
37////////////////////////////////////////////////////////////////////////////
38string t_clkCorr::toLine() const {
39 ostringstream str;
40 str.setf(ios::showpoint | ios::fixed);
41 str << "C " << _time.gpsw() << ' ' << setprecision(2) << _time.gpssec() << ' '
42 << _prn.toString() << ' ' << setw(3) << _iod << ' '
43 << setw(10) << setprecision(4) << _dClk * t_CST::c << ' '
44 << setw(10) << setprecision(4) << _dotDClk * t_CST::c << ' '
45 << setw(10) << setprecision(4) << _dotDotDClk * t_CST::c << endl;
46 return str.str();
47}
48
49//
50////////////////////////////////////////////////////////////////////////////
51t_orbCorr::t_orbCorr(const string& line) {
52 reset();
53 istringstream in(line);
54 char ch; in >> ch; if (ch != 'O') return;
55 int gpsw;
56 double gpssec;
57 in >> gpsw >> gpssec >> _prn >> _iod
58 >> _xr[0] >> _xr[1] >> _xr[2]
59 >> _dotXr[0] >> _dotXr[1] >> _dotXr[2];
60 _time.set(gpsw, gpssec);
61}
62
63//
64////////////////////////////////////////////////////////////////////////////
65void t_orbCorr::reset() {
66 _prn.set(' ', 0);
67 _time.reset();
68 _xr.ReSize(3); _xr = 0.0;
69 _dotXr.ReSize(3); _dotXr = 0.0;
70 _iod = 0;
71 _system = 'R';
72}
73
74//
75////////////////////////////////////////////////////////////////////////////
76string t_orbCorr::toLine() const {
77 ostringstream str;
78 str.setf(ios::showpoint | ios::fixed);
79 str << "O " << _time.gpsw() << ' ' << setprecision(2) << _time.gpssec() << ' '
80 << _prn.toString() << ' ' << setw(3) << _iod << ' '
81 << setw(10) << setprecision(4) << _xr[0] << ' '
82 << setw(10) << setprecision(4) << _xr[1] << ' '
83 << setw(10) << setprecision(4) << _xr[2] << " "
84 << setw(10) << setprecision(4) << _dotXr[0] << ' '
85 << setw(10) << setprecision(4) << _dotXr[1] << ' '
86 << setw(10) << setprecision(4) << _dotXr[2] << endl;
87 return str.str();
88}
89
Note: See TracBrowser for help on using the repository browser.