Changeset 1942 in ntrip
- Timestamp:
- Nov 12, 2009, 1:58:38 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncutils.cpp
r1836 r1942 89 89 void currentGPSWeeks(int& week, double& sec) { 90 90 91 QDateTime currDateTime; 92 int leapsecond = 0; 91 QDateTime currDateTimeGPS; 93 92 94 93 if ( ((bncApp*) qApp)->_currentDateAndTimeGPS ) { 95 currDateTime = *(((bncApp*) qApp)->_currentDateAndTimeGPS);94 currDateTimeGPS = *(((bncApp*) qApp)->_currentDateAndTimeGPS); 96 95 } 97 96 else { 98 currDateTime = QDateTime::currentDateTime().toUTC(); 99 QDate date = currDateTime.date(); 100 leapsecond = gnumleap(date.year(), date.month(), date.day()); 97 currDateTimeGPS = QDateTime::currentDateTime().toUTC(); 98 QDate hlp = currDateTimeGPS.date(); 99 currDateTimeGPS = currDateTimeGPS.addSecs(gnumleap(hlp.year(), 100 hlp.month(), hlp.day())); 101 101 } 102 102 103 QDate currDate = currDateTime.date();104 QTime currTime = currDateTime.time();103 QDate currDateGPS = currDateTimeGPS.date(); 104 QTime currTimeGPS = currDateTimeGPS.time(); 105 105 106 week = int( (double(currDate .toJulianDay()) - 2444244.5) / 7 );106 week = int( (double(currDateGPS.toJulianDay()) - 2444244.5) / 7 ); 107 107 108 sec = (currDate.dayOfWeek() % 7) * 24.0 * 3600.0 + 109 currTime.hour() * 3600.0 + 110 currTime.minute() * 60.0 + 111 currTime.second() + 112 currTime.msec() / 1000.0 + 113 leapsecond; 108 sec = (currDateGPS.dayOfWeek() % 7) * 24.0 * 3600.0 + 109 currTimeGPS.hour() * 3600.0 + 110 currTimeGPS.minute() * 60.0 + 111 currTimeGPS.second() + 112 currTimeGPS.msec() / 1000.0; 114 113 } 115 114
Note:
See TracChangeset
for help on using the changeset viewer.