- Timestamp:
- Jan 12, 2010, 8:53:07 AM (15 years ago)
- Location:
- trunk/BNC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM3/ephemeris.cpp
r2221 r2222 10 10 using namespace std; 11 11 12 // 13 //////////////////////////////////////////////////////////////////////////// 12 14 bool t_eph::isNewerThan(const t_eph* eph) const { 13 15 if (_GPSweek > eph->_GPSweek || … … 20 22 } 21 23 24 // Set GPS Satellite Position 25 //////////////////////////////////////////////////////////////////////////// 22 26 void t_ephGPS::set(const gpsephemeris* ee) { 23 27 ostringstream prn; … … 59 63 } 60 64 61 void t_ephGPS::set(int prn, 62 int GPSWeek, 63 double toc, double toe, double tot, 64 double IODE, double IODC, 65 double clock_bias, double clock_drift, double clock_driftrate, 66 double OMEGA0, double OMEGADOT, 67 double i0, double IDOT, 68 double omega, 69 double M0, double Delta_n, 70 double sqrt_A, 71 double e, 72 double Crc, double Crs, 73 double Cic, double Cis, 74 double Cuc, double Cus, 75 double TGD, 76 int /*health*/) { 77 ostringstream prnstr; 78 prnstr << 'G' << setfill('0') << setw(2) << prn; 79 80 _prn = prnstr.str(); 81 82 _GPSweek = GPSWeek; 83 _GPSweeks = toe; 84 85 _TOC = toc; 86 _TOE = toe; 87 _TOW = tot; 88 _IODE = IODE; 89 _IODC = IODC; 90 _clock_bias = clock_bias; 91 _clock_drift = clock_drift; 92 _clock_driftrate = clock_driftrate; 93 _Crs = Crs; 94 _Delta_n = Delta_n; 95 _M0 = M0; 96 _Cuc = Cuc; 97 _e = e; 98 _Cus = Cus; 99 _sqrt_A = sqrt_A; 100 _Cic = Cic; 101 _OMEGA0 = OMEGA0; 102 _Cis = Cis; 103 _i0 = i0; 104 _Crc = Crc; 105 _omega = omega; 106 _OMEGADOT = OMEGADOT; 107 _IDOT = IDOT; 108 _TGD = TGD; 109 //_health = health; 110 } 111 112 // Compute GPS Satellite Position 65 // Compute GPS Satellite Position (virtual) 113 66 //////////////////////////////////////////////////////////////////////////// 114 67 void t_ephGPS::position(int GPSweek, double GPSweeks, … … 194 147 195 148 196 void t_ephGPS::print(std::ostream& out) const {197 double toc_mjd = gpjd(_TOC, _GPSweek);198 long toc_y, toc_m;199 int toc_d;200 double toc_dd;201 jmt(toc_mjd, toc_y, toc_m, toc_dd);202 toc_d = static_cast<int>(toc_dd);203 204 int toc_hour = static_cast<int>( _TOC/3600 );205 int toc_min = static_cast<int>( (_TOC/3600 - toc_hour)*60 );206 double toc_sec = _TOC - toc_hour*3600 - toc_min*60;207 toc_hour = toc_hour % 24;208 209 char tmps[20];210 int year;211 212 year = toc_y;213 if (year>2000)214 year-=2000;215 else216 year-=1900;217 218 219 out << _prn.substr(1,2);220 sprintf(tmps,"%02d", year); out << setw(3) << tmps;221 out << setw(3) << toc_m;222 out << setw(3) << toc_d;223 out << setw(3) << toc_hour;224 out << setw(3) << toc_min;225 sprintf(tmps,"%.1f", toc_sec); out << setw(5) << tmps;226 sprintf(tmps,"%.12E", _clock_bias); out << setw(19) << tmps;227 sprintf(tmps,"%.12E", _clock_drift); out << setw(19) << tmps;228 sprintf(tmps,"%.12E", _clock_driftrate); out << setw(19) << tmps;229 out << endl;230 out << " ";231 sprintf(tmps,"%.12E", (double)_IODE); out << setw(19) << tmps;232 sprintf(tmps,"%.12E", _Crs); out << setw(19) << tmps;233 sprintf(tmps,"%.12E", _Delta_n); out << setw(19) << tmps;234 sprintf(tmps,"%.12E", _M0); out << setw(19) << tmps;235 out << endl;236 out << " ";237 sprintf(tmps,"%.12E", _Cuc); out << setw(19) << tmps;238 sprintf(tmps,"%.12E", _e); out << setw(19) << tmps;239 sprintf(tmps,"%.12E", _Cus); out << setw(19) << tmps;240 sprintf(tmps,"%.12E", _sqrt_A); out << setw(19) << tmps;241 out << endl;242 out << " ";243 sprintf(tmps,"%.12E", _TOE); out << setw(19) << tmps;244 sprintf(tmps,"%.12E", _Cic); out << setw(19) << tmps;245 sprintf(tmps,"%.12E", _OMEGA0); out << setw(19) << tmps;246 sprintf(tmps,"%.12E", _Cis); out << setw(19) << tmps;247 out << endl;248 out << " ";249 sprintf(tmps,"%.12E", _i0); out << setw(19) << tmps;250 sprintf(tmps,"%.12E", _Crc); out << setw(19) << tmps;251 sprintf(tmps,"%.12E", _omega); out << setw(19) << tmps;252 sprintf(tmps,"%.12E", _OMEGADOT); out << setw(19) << tmps;253 out << endl;254 out << " ";255 sprintf(tmps,"%.12E", _IDOT); out << setw(19) << tmps;256 sprintf(tmps,"%.12E", 0.0); out << setw(19) << tmps;257 sprintf(tmps,"%.12E", (double)_GPSweek); out << setw(19) << tmps;258 sprintf(tmps,"%.12E", 0.0); out << setw(19) << tmps;259 out << endl;260 out << " ";261 sprintf(tmps,"%.12E", 0.0); out << setw(19) << tmps;262 sprintf(tmps,"%.12E", 0.0); out << setw(19) << tmps;263 sprintf(tmps,"%.12E", _TGD); out << setw(19) << tmps;264 sprintf(tmps,"%.12E", (double)_IODC); out << setw(19) << tmps;265 out << endl;266 out << " ";267 sprintf(tmps,"%.12E", _TOE); out << setw(19) << tmps;268 sprintf(tmps,"%.12E", 0.0); out << setw(19) << tmps;269 sprintf(tmps,"%.12E", 0.0); out << setw(19) << tmps;270 sprintf(tmps,"%.12E", 0.0); out << setw(19) << tmps;271 out << endl;272 }273 274 149 // Derivative of the state vector using a simple force model (static) 275 150 //////////////////////////////////////////////////////////////////////////// … … 368 243 } 369 244 370 // Print Glonass Ephemeris (virtual)371 ////////////////////////////////////////////////////////////////////////////372 void t_ephGlo::print(std::ostream& out) const {373 374 }375 376 245 // Set Glonass Ephemeris 377 246 //////////////////////////////////////////////////////////////////////////// -
trunk/BNC/RTCM3/ephemeris.h
r2221 r2222 21 21 22 22 virtual void position(int GPSweek, double GPSweeks, 23 double* xc, 24 double* vv) const = 0; 23 double* xc, double* vv) const = 0; 25 24 26 25 void position(int GPSweek, double GPSweeks, … … 39 38 virtual int IOD() const = 0; 40 39 41 virtual void print(std::ostream& out) const = 0;42 43 40 protected: 44 41 std::string _prn; … … 56 53 void set(const gpsephemeris* ee); 57 54 58 void set(int prn,59 int GPSWeek,60 double toc, double toe, double tot,61 double IODE, double IODC,62 double clock_bias, double clock_drift, double clock_driftrate,63 double OMEGA0, double OMEGADOT,64 double i0, double IDOT,65 double omega,66 double M0, double Delta_n,67 double sqrt_A,68 double e,69 double Crc, double Crs,70 double Cic, double Cis,71 double Cuc, double Cus,72 double TGD,73 int health);74 75 55 virtual void position(int GPSweek, double GPSweeks, 76 56 double* xc, … … 78 58 79 59 virtual int IOD() const { return static_cast<int>(_IODC); } 80 81 virtual void print(std::ostream& out) const;82 60 83 61 private: … … 123 101 virtual int IOD() const; 124 102 125 virtual void print(std::ostream& out) const;126 127 103 void set(const glonassephemeris* ee); 128 104 -
trunk/BNC/bncpppclient.cpp
r2221 r2222 158 158 QString prn = 159 159 QString("%1%2").arg(obs->satSys).arg(obs->satNum, 2, 10, QChar('0')); 160 161 cout << prn.toAscii().data() << " " << obs->slot << endl;162 160 163 161 _epoData->satData[prn] = satData;
Note:
See TracChangeset
for help on using the changeset viewer.