Changeset 1834 in ntrip


Ignore:
Timestamp:
May 7, 2009, 11:27:19 AM (15 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC/RTCM3
Files:
3 edited

Legend:

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

    r1833 r1834  
    4747#include "bncapp.h"
    4848#include "bncsettings.h"
     49#include "rtcm3torinex.h"
    4950
    5051using namespace std;
     
    163164        }
    164165        else {
    165           double GPSdaysec = fmod(_GPSweeks, 86400.0);
    166           int    weekDay   = int((_GPSweeks - GPSdaysec) / 86400.0);
    167           if      (GPSdaysec > _co.GLONASSEpochTime + 3600.0) {
     166
     167          // Guess GPS week and sec using system time
     168          // ----------------------------------------
     169          int week;
     170          double sec;
     171          currentGPSWeeks(week, sec);
     172          int weekDay      = int(sec/86400.0);
     173          int GPSDaySecHlp = int(sec) - weekDay * 86400;
     174
     175          // cout << "week, sec " << week << " " << sec << endl;
     176
     177          // Second of day (GPS time) from Glonass Epoch
     178          // -------------------------------------------
     179          QDate date = dateAndTimeFromGPSweek(week, sec).date();
     180          int leapSecond = gnumleap(date.year(), date.month(), date.day());
     181          int GPSDaySec  = _co.GLONASSEpochTime + 3 * 3600 + leapSecond;
     182
     183          // cout << "GlonassEpoch, leapSecond, GPSDaySec "
     184          //      << _co.GLONASSEpochTime << " " << leapSecond << " "
     185          //      << GPSDaySec << endl;
     186
     187          // Handle the difference between system clock and correction epoch
     188          // ---------------------------------------------------------------
     189          if      (GPSDaySec < GPSDaySecHlp - 3600) {
    168190            weekDay += 1;
    169             if (weekDay > 6) {
    170               weekDay = 0;
    171               GPSweek += 1;
    172             }
    173191          }
    174           else if (GPSdaysec < _co.GLONASSEpochTime - 3600.0) {
     192          else if (GPSDaySec > GPSDaySecHlp + 3600) {
    175193            weekDay -= 1;
    176             if (weekDay < 0) {
    177               weekDay = 6;
    178               GPSweek -= 1;
    179             }
    180           }
    181           _GPSweeks = weekDay * 86400.0 + _co.GLONASSEpochTime;
     194          }
     195
     196          _GPSweeks = weekDay * 86400.0 + GPSDaySec;
     197                     
     198          // cout << "weekDay, _GPSweeks " << weekDay << " "
     199          //      << _GPSweeks << endl;
    182200        }
    183201
  • trunk/BNC/RTCM3/rtcm3torinex.c

    r1825 r1834  
    11/*
    22  Converter for RTCM3 data to RINEX.
    3   $Id: rtcm3torinex.c,v 1.23 2009/04/30 11:40:45 mervart Exp $
     3  $Id: rtcm3torinex.c,v 1.24 2009/05/04 10:38:37 mervart Exp $
    44  Copyright (C) 2005-2008 by Dirk Stöcker <stoecker@alberding.eu>
    55
     
    5555
    5656/* CVS revision and version */
    57 static char revisionstr[] = "$Revision: 1.23 $";
     57static char revisionstr[] = "$Revision: 1.24 $";
    5858
    5959#ifndef COMPILEDATE
     
    238238}
    239239
    240 static int gnumleap(int year, int month, int day)
     240int gnumleap(int year, int month, int day)
    241241{
    242242  int ls = 0;
     
    16891689
    16901690#ifndef NO_RTCM3_MAIN
    1691 static char datestr[]     = "$Date: 2009/04/30 11:40:45 $";
     1691static char datestr[]     = "$Date: 2009/05/04 10:38:37 $";
    16921692
    16931693/* The string, which is send as agent in HTTP request */
  • trunk/BNC/RTCM3/rtcm3torinex.h

    r1286 r1834  
    44/*
    55  Converter for RTCM3 data to RINEX.
    6   $Id: rtcm3torinex.h,v 1.15 2008/11/26 12:17:13 weber Exp $
     6  $Id: rtcm3torinex.h,v 1.16 2008/12/08 10:50:42 mervart Exp $
    77  Copyright (C) 2005-2006 by Dirk Stöcker <stoecker@alberding.eu>
    88
     
    232232#endif /* PRINTFARG */
    233233
     234int gnumleap(int year, int month, int day);
    234235void HandleHeader(struct RTCM3ParserData *Parser);
    235236int RTCM3Parser(struct RTCM3ParserData *handle);
Note: See TracChangeset for help on using the changeset viewer.