Changeset 1155 in ntrip for trunk/BNC/bncutils.cpp


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

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncutils.cpp

    r1154 r1155  
    4848
    4949#include "bncutils.h"
     50#include "bncapp.h"
    5051
    5152using namespace std;
     
    8283void currentGPSWeeks(int& week, double& sec) {
    8384
    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
    85101  QDate     currDate = currDateTime.date();
    86102  QTime     currTime = currDateTime.time();
    87 
    88   int leapsecond = 14;
    89   if (currDate.year() >= 2009) {leapsecond = 15;}
    90103
    91104  week = int( (double(currDate.toJulianDay()) - 2444244.5) / 7 );
Note: See TracChangeset for help on using the changeset viewer.