Index: trunk/BNC/RTCM3/RTCM3coDecoder.cpp
===================================================================
--- trunk/BNC/RTCM3/RTCM3coDecoder.cpp	(revision 871)
+++ trunk/BNC/RTCM3/RTCM3coDecoder.cpp	(revision 875)
@@ -47,5 +47,6 @@
 // Constructor
 ////////////////////////////////////////////////////////////////////////////
-RTCM3coDecoder::RTCM3coDecoder() : GPSDecoder() {
+RTCM3coDecoder::RTCM3coDecoder(const QString& fileName) 
+  : bncZeroDecoder(fileName) {
 }
 
@@ -59,6 +60,7 @@
 t_irc RTCM3coDecoder::Decode(char* buffer, int bufLen) {
 
+  reopen();
+  
   _buffer.append(buffer, bufLen);
-  printf("BUFFER: %d %d\n", bufLen, _buffer.size());
 
   while (true) {
@@ -74,12 +76,14 @@
     else if (irc == 0) {
       for(int ii = 0; ii < _co.NumberOfGPSSat; ++ii) {
-        printf("%d G%d %d %f %f %f %f\n", _co.GPSEpochTime,
+        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,
                _co.Sat[ii].Orbit.DeltaCrossTrack);
+        _out->write(line.toAscii().data(), line.length());
+        _out->flush();
       }
       char obuffer[CLOCKORBIT_BUFFERSIZE];
       int len = MakeClockOrbit(&_co, COTYPE_AUTO, 0, obuffer, sizeof(obuffer));
-      printf("LEN: %d\n", len);
       if (len > 0) {
         _buffer = _buffer.substr(len);
Index: trunk/BNC/RTCM3/RTCM3coDecoder.h
===================================================================
--- trunk/BNC/RTCM3/RTCM3coDecoder.h	(revision 871)
+++ trunk/BNC/RTCM3/RTCM3coDecoder.h	(revision 875)
@@ -26,5 +26,5 @@
 #define RTCM3CODECODER_H
 
-#include "../RTCM/GPSDecoder.h"
+#include "bnczerodecoder.h"
 
 extern "C" {
@@ -32,7 +32,7 @@
 }
 
-class RTCM3coDecoder : public GPSDecoder {
+class RTCM3coDecoder : public bncZeroDecoder {
 public:
-  RTCM3coDecoder();
+  RTCM3coDecoder(const QString& fileName);
   virtual ~RTCM3coDecoder();
   virtual t_irc Decode(char* buffer = 0, int bufLen = 0);
Index: trunk/BNC/bncgetthread.cpp
===================================================================
--- trunk/BNC/bncgetthread.cpp	(revision 871)
+++ trunk/BNC/bncgetthread.cpp	(revision 875)
@@ -377,5 +377,5 @@
     else if (_format.indexOf("SP3") != -1) {
       emit(newMessage("Get Corrections: " + _staID + " in RTCM 3.x format"));
-      _decoder = new RTCM3coDecoder();
+      _decoder = new RTCM3coDecoder(_staID);
     }
     else if (_format.indexOf("ZERO") != -1) {
Index: trunk/BNC/bnczerodecoder.h
===================================================================
--- trunk/BNC/bnczerodecoder.h	(revision 871)
+++ trunk/BNC/bnczerodecoder.h	(revision 875)
@@ -31,13 +31,14 @@
 
 class bncZeroDecoder: public GPSDecoder {
-  public:
-    bncZeroDecoder(const QString& fileName);
-    ~bncZeroDecoder();
-    virtual t_irc Decode(char* buffer, int bufLen);
-  private:
-    void reopen();
-    QString        _fileName;
-    std::ofstream* _out;
-    QDate          _fileDate;
+ public:
+  bncZeroDecoder(const QString& fileName);
+  ~bncZeroDecoder();
+  virtual t_irc Decode(char* buffer, int bufLen);
+ protected:
+  void reopen();
+  QString        _fileName;
+  std::ofstream* _out;
+ private:
+  QDate          _fileDate;
 };
 
