Changeset 1153 in ntrip


Ignore:
Timestamp:
Oct 7, 2008, 12:28:51 PM (16 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM3/RTCM3Decoder.cpp

    r1130 r1153  
    6363////////////////////////////////////////////////////////////////////////////
    6464RTCM3Decoder::RTCM3Decoder(const QString& staID) : GPSDecoder() {
    65 
    66   const int LEAPSECONDS = 14; /* only needed for approx. time */
    6765
    6866  QSettings settings;
     
    9593  _Parser.rinex3 = 0;
    9694
    97   time_t tim;
    98   tim = time(0) - ((10*365+2+5)*24*60*60 + LEAPSECONDS);
    99 
    10095  memset(&_Parser, 0, sizeof(_Parser));
    101   _Parser.GPSWeek = tim/(7*24*60*60);
    102   _Parser.GPSTOW  = tim%(7*24*60*60);
     96
     97  double secGPS;
     98  currentGPSWeeks(_Parser.GPSWeek, secGPS);
     99  _Parser.GPSTOW = int(secGPS);
    103100
    104101  connect(this, SIGNAL(newGPSEph(gpsephemeris*)),
     
    142139            double sec;
    143140            _newSecGPS = _coDecoder->_epochList[ii];
    144             leapsecGPSWeeks(week, sec);
     141            currentGPSWeeks(week, sec);
    145142            double dt = fabs(sec - _newSecGPS);
    146143            const double secPerWeek = 7.0 * 24.0 * 3600.0;
  • trunk/BNC/bncgetthread.cpp

    r1147 r1153  
    646646            int week;
    647647            double sec;
    648             leapsecGPSWeeks(week, sec);
     648            currentGPSWeeks(week, sec);
    649649            const double secPerWeek = 7.0 * 24.0 * 3600.0;
    650650           
  • trunk/BNC/bncutils.cpp

    r1036 r1153  
    8686  QTime     currTime = currDateTime.time();
    8787
    88   week = int( (double(currDate.toJulianDay()) - 2444244.5) / 7 );
    89 
    90   sec = (currDate.dayOfWeek() % 7) * 24.0 * 3600.0 +
    91         currTime.hour()                   * 3600.0 +
    92         currTime.minute()                 *   60.0 +
    93         currTime.second()                          +
    94         currTime.msec()                   / 1000.0;
    95 }
    96 void leapsecGPSWeeks(int& week, double& sec) {
    97 
    98   QDateTime currDateTime = QDateTime::currentDateTime().toUTC();
    99   QDate     currDate = currDateTime.date();
    100   QTime     currTime = currDateTime.time();
    101 
    10288  int leapsecond = 14;
    10389  if (currDate.year() >= 2009) {leapsecond = 15;}
  • trunk/BNC/bncutils.h

    r1035 r1153  
    3434
    3535void currentGPSWeeks(int& week, double& sec);
    36 void leapsecGPSWeeks(int& week, double& sec);
    3736
    3837#endif
Note: See TracChangeset for help on using the changeset viewer.