Changeset 124 in ntrip for trunk/BNC


Ignore:
Timestamp:
Sep 7, 2006, 6:50:24 PM (18 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncutils.cpp

    r93 r124  
    1616 * -----------------------------------------------------------------------*/
    1717
     18#include <iostream>
     19
    1820#include <QRegExp>
    1921#include <QStringList>
    2022
    2123#include "bncutils.h"
     24
     25using namespace std;
    2226
    2327void expandEnvVar(QString& str) {
     
    3539
    3640}
     41
     42QDateTime dateAndTimeFromGPSweek(int GPSWeek, double GPSWeeks) {
     43
     44  static const QDate zeroEpoch(1980, 1, 6);
     45 
     46  QDate date(zeroEpoch);
     47  QTime time(0,0,0,0);
     48
     49  int weekDays = int(GPSWeeks) / 86400;
     50  date = date.addDays( GPSWeek * 7 + weekDays );
     51  time = time.addMSecs( int( (GPSWeeks - 86400 * weekDays) * 1e3 ) );
     52
     53  return QDateTime(date,time);
     54}
Note: See TracChangeset for help on using the changeset viewer.