Changeset 2049 in ntrip for trunk/BNC/bncpppclient.cpp


Ignore:
Timestamp:
Nov 29, 2009, 10:21:42 AM (14 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncpppclient.cpp

    r2044 r2049  
    203203}
    204204
     205// Correct Time of Transmission
     206////////////////////////////////////////////////////////////////////////////
     207t_irc bncPPPclient::cmpToT(const QString& prn, t_satData* satData) {
     208
     209  double prange = satData->C1;
     210  if (prange == 0.0) {
     211    prange = satData->P1;
     212  }
     213  if (prange == 0.0) {
     214    return failure;
     215  }
     216
     217  double clkSat = 0.0;
     218  for (int ii = 1; ii <= 10; ii++) {
     219
     220    t_time ToT = _epoData->tt - prange / t_CST::c - clkSat;
     221
     222    ColumnVector xc(4);
     223    ColumnVector vv(3);
     224    bool corr = false;
     225    if (getSatPos(ToT, prn, xc, vv, corr) != success) {
     226      return failure;
     227    }
     228
     229    double clkSatOld = clkSat;
     230    clkSat = xc(4) * t_CST::c;
     231
     232    if ( fabs(clkSat-clkSatOld) * t_CST::c < 1.e-4 ) {
     233      satData->xx      = xc.Rows(1,3);
     234      satData->vv      = vv;
     235      satData->clk     = clkSat;
     236      satData->clkCorr = corr;
     237      return success;
     238    }
     239  }
     240
     241  return failure;
     242}
     243
    205244//
    206245////////////////////////////////////////////////////////////////////////////
     
    209248  cout.setf(ios::fixed);
    210249
    211   QMapIterator<QString, t_satData*> it(_epoData->satData);
     250  QMutableMapIterator<QString, t_satData*> it(_epoData->satData);
     251
    212252  while (it.hasNext()) {
    213253    it.next();
     
    215255    t_satData* satData = it.value();
    216256
    217     ColumnVector xc(4);
    218     ColumnVector vv(3);
    219 
    220     bool corr = false;
    221     if (getSatPos(_epoData->tt, prn, xc, vv, corr) == success) {
    222       cout << _epoData->tt.timestr(1) << " " << prn.toAscii().data() << "   "
    223            << setw(14) << setprecision(3) << xc(1)                << "  "
    224            << setw(14) << setprecision(3) << xc(2)                << "  "
    225            << setw(14) << setprecision(3) << xc(3)                << "  "
    226            << setw(12) << setprecision(6) << xc(4)*1.e6;
    227       if (corr) {
    228         cout << endl;
    229       }
    230       else {
    231         cout << " !\n";
    232       }
     257    if (cmpToT(prn, satData) != success) {
     258      delete satData;
     259      it.remove();
     260      continue;
     261    }
     262
     263    cout << _epoData->tt.timestr(1) << " " << prn.toAscii().data() << "   "
     264         << setw(14) << setprecision(3) << satData->xx(1)          << "  "
     265         << setw(14) << setprecision(3) << satData->xx(2)          << "  "
     266         << setw(14) << setprecision(3) << satData->xx(3)          << "  "
     267         << setw(12) << setprecision(3) << satData->clk;
     268
     269    if (satData->clkCorr) {
     270      cout << endl;
     271    }
     272    else {
     273      cout << " !\n";
    233274    }
    234275  }
     
    237278  cout.flush();
    238279}
     280
Note: See TracChangeset for help on using the changeset viewer.