Changeset 898 in ntrip for trunk


Ignore:
Timestamp:
May 8, 2008, 11:02:49 PM (17 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bnseph.cpp

    r897 r898  
    351351  const static double secPerWeek = 7 * 86400.0;
    352352
    353   double dt = GPSweeks - _tt;
     353  double dtPos = GPSweeks - _tt;
    354354  if (GPSweek != _GPSweek) { 
    355     dt += (GPSweek - _GPSweek) * secPerWeek;
     355    dtPos += (GPSweek - _GPSweek) * secPerWeek;
    356356  }
    357357
     
    359359       << GPSweek  << " " << _GPSweek << "   "
    360360       << GPSweeks << " " <<  _GPSweeks << " " << _tt << "    "
    361        << dt << endl;
     361       << dtPos << endl;
    362362
    363363  const static double maxStep = 10.0;
    364364
    365365  double tt = 0.0;
    366   while (tt < dt) {
    367     double step = maxStep;
    368     if (tt + step > dt) {
    369       step = dt - tt;
     366  while (fabs(tt) < fabs(dtPos)) {
     367    double step = dtPos > 0.0 ?  maxStep : -maxStep;
     368    if (fabs(tt + step) > fabs(dtPos)) {
     369      step = dtPos - tt;
    370370    }
    371371    _xv = rungeKutta4(tt, _xv, step, glo_deriv);
     
    373373  }
    374374
    375   _tt = GPSweeks;
     375  // Next Time Start Integration from Current Epoch
     376  // ----------------------------------------------
     377  _tt += dtPos;
    376378
    377379  // Position and Velocity
Note: See TracChangeset for help on using the changeset viewer.