Changeset 1155 in ntrip for trunk/BNC/bncutils.cpp
- Timestamp:
- Oct 7, 2008, 12:52:45 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/bncutils.cpp
r1154 r1155 48 48 49 49 #include "bncutils.h" 50 #include "bncapp.h" 50 51 51 52 using namespace std; … … 82 83 void currentGPSWeeks(int& week, double& sec) { 83 84 84 QDateTime currDateTime = QDateTime::currentDateTime().toUTC(); 85 QDateTime currDateTime; 86 int leapsecond = 0; 87 88 if ( ((bncApp*) qApp)->_currentDateAndTimeGPS ) { 89 currDateTime = *(((bncApp*) qApp)->_currentDateAndTimeGPS); 90 } 91 else { 92 currDateTime = QDateTime::currentDateTime().toUTC(); 93 if (currDateTime.date().year() >= 2009) { 94 leapsecond = 15; 95 } 96 else { 97 leapsecond = 14; 98 } 99 } 100 85 101 QDate currDate = currDateTime.date(); 86 102 QTime currTime = currDateTime.time(); 87 88 int leapsecond = 14;89 if (currDate.year() >= 2009) {leapsecond = 15;}90 103 91 104 week = int( (double(currDate.toJulianDay()) - 2444244.5) / 7 );
Note:
See TracChangeset
for help on using the changeset viewer.