Index: trunk/BNC/upload/bncrtnetdecoder.cpp
===================================================================
--- trunk/BNC/upload/bncrtnetdecoder.cpp	(revision 3167)
+++ trunk/BNC/upload/bncrtnetdecoder.cpp	(revision 3171)
@@ -48,17 +48,7 @@
 // Constructor
 //////////////////////////////////////////////////////////////////////// 
-bncRtnetDecoder::bncRtnetDecoder(const QString& fileName) {
-
+bncRtnetDecoder::bncRtnetDecoder() {
   bncSettings settings;
-  QString path = settings.value("rnxPath").toString();
-  expandEnvVar(path);
-
-  if ( path.length() > 0 && path[path.length()-1] != QDir::separator() ) {
-    path += QDir::separator();
-  }
-
-  _fileName = path + fileName;
-
-  _out = 0;
+  _year = 0;
 }
 
@@ -66,24 +56,13 @@
 //////////////////////////////////////////////////////////////////////// 
 bncRtnetDecoder::~bncRtnetDecoder() {
-  delete _out;
 }
 
-// Reopen Output File
+// Decode Method
 //////////////////////////////////////////////////////////////////////// 
-void bncRtnetDecoder::reopen() {
-  QDate currDate = currentDateAndTimeGPS().date();
-  if (!_out || _fileDate != currDate) {
-    delete _out;
-    QByteArray fileName = 
-           (_fileName + "_" + currDate.toString("yyMMdd")).toAscii();
-    bncSettings settings;
-    if (Qt::CheckState(settings.value("rnxAppend").toInt()) == Qt::Checked) {
-      _out = new ofstream(fileName.data(), ios::out | ios::app);
-    }
-    else {
-      _out = new ofstream(fileName.data());
-    }
-    _fileDate = currDate;
-  }
+void bncRtnetDecoder::readEpochTime(const QString& line) {
+  QTextStream in(line.toAscii());
+  QString hlp;
+  in >> hlp >> _year >> _month >> _day >> _hour >> _min >> _sec;
+  GPSweekFromYMDhms(_year, _month, _day, _hour, _min, _sec, _GPSweek, _GPSweeks);
 }
 
@@ -91,8 +70,26 @@
 //////////////////////////////////////////////////////////////////////// 
 t_irc bncRtnetDecoder::Decode(char* buffer, int bufLen, vector<string>& errmsg) {
+
   errmsg.clear();
-  reopen();
-  _out->write(buffer, bufLen);
-  _out->flush();
+
+  _buffer.append(QByteArray(buffer, bufLen));
+
+  int iLast = _buffer.lastIndexOf('\n');
+
+  if (iLast != -1) {
+    QStringList lines = _buffer.split('\n', QString::SkipEmptyParts);
+    _buffer = _buffer.mid(iLast+1);
+    cout << "number of lines = " << lines.size() << endl;
+    for (int ii = 0; ii < lines.size(); ii++) {
+      if (lines[ii].indexOf('*') != -1) {
+        readEpochTime(lines[ii]);
+        cout << "epoch: " << lines[ii].toAscii().data() << endl;
+      }
+      else if (_year != 0) {
+        cout << "pos: " << lines[ii].toAscii().data() << endl;
+      }
+    }
+  }
+
   return success;
 }
Index: trunk/BNC/upload/bncrtnetdecoder.h
===================================================================
--- trunk/BNC/upload/bncrtnetdecoder.h	(revision 3167)
+++ trunk/BNC/upload/bncrtnetdecoder.h	(revision 3171)
@@ -23,6 +23,6 @@
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-#ifndef INC_BNCRTNETDECODER_H
-#define INC_BNCRTNETDECODER_H
+#ifndef BNCRTNETDECODER_H
+#define BNCRTNETDECODER_H
 
 #include <fstream>
@@ -33,12 +33,36 @@
 class bncRtnetDecoder: public GPSDecoder, public bncEphUser {
  public:
-  bncRtnetDecoder(const QString& fileName);
+  bncRtnetDecoder();
   ~bncRtnetDecoder();
   virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg);
  private:
-  void reopen();
-  QString        _fileName;
-  std::ofstream* _out;
-  QDate          _fileDate;
+  void readEpochTime(const QString& line);
+
+  QString _buffer;
+
+  int    _GPSweek;
+  double _GPSweeks;
+  int    _year;
+  int    _month;
+  int    _day;
+  int    _hour;
+  int    _min;
+  double _sec;
+
+  double _dx;
+  double _dy;
+  double _dz;
+  double _dxr;
+  double _dyr;
+  double _dzr;
+  double _ox;
+  double _oy;
+  double _oz;
+  double _oxr;
+  double _oyr;
+  double _ozr;
+  double _sc;
+  double _scr;
+  double _t0;
 };
 
