Changeset 1898 in ntrip for trunk/BNS/bnseph.cpp


Ignore:
Timestamp:
Oct 10, 2009, 9:19:20 AM (15 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNS/bnseph.cpp

    r1897 r1898  
    697697////////////////////////////////////////////////////////////////////////////
    698698int t_ephGlo::IOD() const {
    699   ////  return int(fmod(_GPSweeks,86400.0)) / 600;
    700 
    701   //// unsigned int tb  = int(fmod(_GPSweeks,86400.0)) * 1000; // msec of day
    702   unsigned int tb  = int(fmod(_GPSweeks,86400.0)); //sec of day
    703 
    704   // 5 LSBs of iod are equal to 5 LSBs of tb, remaining bits are zero
    705   // ----------------------------------------------------------------
    706   const int shift = sizeof(tb) * 8 - 5;
    707   unsigned int iod = tb << shift;
    708   return (iod >> shift);
    709 }
     699
     700  bool old = true;
     701
     702  if (old) { // 5 LSBs of iod are equal to 5 LSBs of tb
     703    unsigned int tb  = int(fmod(_GPSweeks,86400.0)); //sec of day
     704    const int shift = sizeof(tb) * 8 - 5;
     705    unsigned int iod = tb << shift;
     706    return (iod >> shift);
     707  }
     708  else     {  // 7 LSBs of iod are equal to 7 LSBs of tk
     709    unsigned tk = int(_tki);
     710    const int shift = sizeof(tk) * 8 - 7;
     711    unsigned int iod = tk << shift;
     712    return (iod >> shift);
     713  }
     714}
Note: See TracChangeset for help on using the changeset viewer.