Index: trunk/BNC/RTCM3/RTCM3coDecoder.cpp
===================================================================
--- trunk/BNC/RTCM3/RTCM3coDecoder.cpp	(revision 917)
+++ trunk/BNC/RTCM3/RTCM3coDecoder.cpp	(revision 918)
@@ -42,4 +42,5 @@
 
 #include "RTCM3coDecoder.h"
+#include "bncutils.h"
 
 using namespace std;
@@ -82,9 +83,23 @@
               bytesused > 0) {
       reopen();
+
+      int    GPSweek;
+      double GPSweeks;
+      currentGPSWeeks(GPSweek, GPSweeks);
+      if      (GPSweeks > _co.GPSEpochTime + 86400.0) {
+        GPSweek += 1;
+      }
+      else if (GPSweeks < _co.GPSEpochTime - 86400.0) {
+        GPSweek -= 1;
+      }
+      GPSweeks = _co.GPSEpochTime;
+
       for(int ii = 0; ii < _co.NumberOfGPSSat; ++ii) {
         QString line;
-        line.sprintf("%d G%d %d %f %f %f %f\n", _co.GPSEpochTime,
-               _co.Sat[ii].ID, _co.Sat[ii].IOD, _co.Sat[ii].Clock.DeltaA0,
-               _co.Sat[ii].Orbit.DeltaRadial, _co.Sat[ii].Orbit.DeltaAlongTrack,
+        line.sprintf("%d %.1f R%d   %3d   %8.3f   %8.3f %8.3f %8.3f\n", 
+               GPSweek, GPSweeks, _co.Sat[ii].ID, _co.Sat[ii].IOD, 
+               _co.Sat[ii].Clock.DeltaA0,
+               _co.Sat[ii].Orbit.DeltaRadial, 
+               _co.Sat[ii].Orbit.DeltaAlongTrack,
                _co.Sat[ii].Orbit.DeltaCrossTrack);
         *_out << line.toAscii().data();
@@ -93,7 +108,9 @@
           ii < CLOCKORBIT_NUMGPS + _co.NumberOfGLONASSSat; ++ii) {
         QString line;
-        line.sprintf("%d R%d %d %f %f %f %f\n", _co.GLONASSEpochTime,
-               _co.Sat[ii].ID, _co.Sat[ii].IOD, _co.Sat[ii].Clock.DeltaA0,
-               _co.Sat[ii].Orbit.DeltaRadial, _co.Sat[ii].Orbit.DeltaAlongTrack,
+        line.sprintf("%d %.1f R%d   %3d   %8.3f   %8.3f %8.3f %8.3f\n", 
+               GPSweek, GPSweeks, _co.Sat[ii].ID, _co.Sat[ii].IOD, 
+               _co.Sat[ii].Clock.DeltaA0, 
+               _co.Sat[ii].Orbit.DeltaRadial, 
+               _co.Sat[ii].Orbit.DeltaAlongTrack,
                _co.Sat[ii].Orbit.DeltaCrossTrack);
         *_out << line.toAscii().data();
Index: trunk/BNS/bnseph.cpp
===================================================================
--- trunk/BNS/bnseph.cpp	(revision 917)
+++ trunk/BNS/bnseph.cpp	(revision 918)
@@ -16,5 +16,4 @@
 
 #include <iostream>
-#include <math.h>
 
 #include "bnseph.h" 
Index: trunk/BNS/bnseph.h
===================================================================
--- trunk/BNS/bnseph.h	(revision 917)
+++ trunk/BNS/bnseph.h	(revision 918)
@@ -2,4 +2,5 @@
 #define BNSEPH_H
 
+#include <math.h>
 #include <newmat.h>
 
