[6176] | 1 | #include <iostream>
|
---|
[6177] | 2 | #include <iomanip>
|
---|
[6176] | 3 | #include <sstream>
|
---|
[6144] | 4 |
|
---|
| 5 | #include "satObs.h"
|
---|
[6178] | 6 |
|
---|
[6144] | 7 | using namespace std;
|
---|
| 8 |
|
---|
| 9 | //
|
---|
| 10 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6180] | 11 | t_clkCorr::t_clkCorr(const string& line) {
|
---|
| 12 | reset();
|
---|
| 13 | istringstream in(line);
|
---|
[6181] | 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;
|
---|
[6180] | 22 | }
|
---|
| 23 |
|
---|
| 24 | //
|
---|
| 25 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 26 | void t_clkCorr::reset() {
|
---|
[6160] | 27 | _iod = 0;
|
---|
| 28 | _dClk = 0.0;
|
---|
| 29 | _dotDClk = 0.0;
|
---|
| 30 | _dotDotDClk = 0.0;
|
---|
| 31 | _clkPartial = 0.0;
|
---|
[6144] | 32 | }
|
---|
| 33 |
|
---|
| 34 | //
|
---|
| 35 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6175] | 36 | string t_clkCorr::toLine() const {
|
---|
[6176] | 37 | ostringstream str;
|
---|
| 38 | str.setf(ios::showpoint | ios::fixed);
|
---|
[6178] | 39 | str << "C " << _time.gpsw() << ' ' << setprecision(2) << _time.gpssec() << ' '
|
---|
[6180] | 40 | << _prn.toString() << ' ' << setw(3) << _iod << ' '
|
---|
[6178] | 41 | << setw(10) << setprecision(4) << _dClk * t_CST::c << ' '
|
---|
| 42 | << setw(10) << setprecision(4) << _dotDClk * t_CST::c << ' '
|
---|
| 43 | << setw(10) << setprecision(4) << _dotDotDClk * t_CST::c << endl;
|
---|
[6176] | 44 | return str.str();
|
---|
[6144] | 45 | }
|
---|
| 46 |
|
---|
| 47 | //
|
---|
| 48 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6180] | 49 | t_orbCorr::t_orbCorr(const string& line) {
|
---|
| 50 | reset();
|
---|
| 51 | istringstream in(line);
|
---|
[6181] | 52 | char ch; in >> ch; if (ch != '0') return;
|
---|
| 53 | int gpsw;
|
---|
| 54 | double gpssec;
|
---|
| 55 | in >> gpsw >> gpssec >> _prn >> _iod
|
---|
| 56 | >> _xr[0] >> _xr[1] >> _xr[2]
|
---|
| 57 | >> _dotXr[0] >> _dotXr[1] >> _dotXr[2];
|
---|
| 58 | _time.set(gpsw, gpssec);
|
---|
[6180] | 59 | }
|
---|
| 60 |
|
---|
| 61 | //
|
---|
| 62 | ////////////////////////////////////////////////////////////////////////////
|
---|
| 63 | void t_orbCorr::reset() {
|
---|
[6160] | 64 | _xr.ReSize(3); _xr = 0.0;
|
---|
| 65 | _dotXr.ReSize(3); _dotXr = 0.0;
|
---|
| 66 | _iod = 0;
|
---|
| 67 | _system = 'R';
|
---|
[6144] | 68 | }
|
---|
| 69 |
|
---|
| 70 | //
|
---|
| 71 | ////////////////////////////////////////////////////////////////////////////
|
---|
[6175] | 72 | string t_orbCorr::toLine() const {
|
---|
[6176] | 73 | ostringstream str;
|
---|
| 74 | str.setf(ios::showpoint | ios::fixed);
|
---|
[6179] | 75 | str << "O " << _time.gpsw() << ' ' << setprecision(2) << _time.gpssec() << ' '
|
---|
[6180] | 76 | << _prn.toString() << ' ' << setw(3) << _iod << ' '
|
---|
[6179] | 77 | << setw(10) << setprecision(4) << _xr[0] << ' '
|
---|
| 78 | << setw(10) << setprecision(4) << _xr[1] << ' '
|
---|
| 79 | << setw(10) << setprecision(4) << _xr[2] << " "
|
---|
| 80 | << setw(10) << setprecision(4) << _dotXr[0] << ' '
|
---|
| 81 | << setw(10) << setprecision(4) << _dotXr[1] << ' '
|
---|
| 82 | << setw(10) << setprecision(4) << _dotXr[2] << endl;
|
---|
[6176] | 83 | return str.str();
|
---|
[6144] | 84 | }
|
---|
| 85 |
|
---|