Index: /trunk/BNC/bnc.pro
===================================================================
--- /trunk/BNC/bnc.pro	(revision 3715)
+++ /trunk/BNC/bnc.pro	(revision 3716)
@@ -50,5 +50,5 @@
           upload/bncrtnetuploadcaster.h upload/bnccustomtrafo.h       \
           upload/bncephuploadcaster.h bnccomb.h qtfilechooser.h       \
-          rnxobsfile.h rnxnavfile.h corrfile.h                        \
+          rnxnavfile.h corrfile.h                                     \
           RTCM/GPSDecoder.h RTCM/RTCM2.h RTCM/RTCM2Decoder.h          \
           RTCM/RTCM2_2021.h RTCM/rtcm_utils.h                         \
@@ -83,5 +83,5 @@
           upload/bncrtnetuploadcaster.cpp upload/bnccustomtrafo.cpp   \
           upload/bncephuploadcaster.cpp qtfilechooser.cpp             \
-          rnxobsfile.cpp rnxnavfile.cpp corrfile.cpp                  \
+          rnxnavfile.cpp corrfile.cpp                                 \
           RTCM/GPSDecoder.cpp RTCM/RTCM2.cpp RTCM/RTCM2Decoder.cpp    \
           RTCM/RTCM2_2021.cpp RTCM/rtcm_utils.cpp                     \
@@ -115,2 +115,8 @@
 }
 
+exists(rinex/rnxobsfile.h) {
+  DEFINES += USE_POSTPROCESSING
+  HEADERS += rinex/rnxobsfile.h
+  SOURCES += rinex/rnxobsfile.cpp
+}
+
Index: /trunk/BNC/rinex/rnxobsfile.cpp
===================================================================
--- /trunk/BNC/rinex/rnxobsfile.cpp	(revision 3716)
+++ /trunk/BNC/rinex/rnxobsfile.cpp	(revision 3716)
@@ -0,0 +1,478 @@
+// Part of BNC, a utility for retrieving decoding and
+// converting GNSS data streams from NTRIP broadcasters.
+//
+// Copyright (C) 2007
+// German Federal Agency for Cartography and Geodesy (BKG)
+// http://www.bkg.bund.de
+// Czech Technical University Prague, Department of Geodesy
+// http://www.fsv.cvut.cz
+//
+// Email: euref-ip@bkg.bund.de
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation, version 2.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+/* -------------------------------------------------------------------------
+ * BKG NTRIP Client
+ * -------------------------------------------------------------------------
+ *
+ * Class:      t_rnxObsFile
+ *
+ * Purpose:    Reads RINEX Observation File
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    24-Jan-2012
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+#include "rinex/rnxobsfile.h"
+#include "bncutils.h"
+
+using namespace std;
+
+const string t_rnxObsFile::t_rnxObsHeader::_emptyStr;
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+t_rnxObsFile::t_rnxObsHeader::t_rnxObsHeader() {
+  _antNEU.ReSize(3); _antNEU = 0.0;
+  _antXYZ.ReSize(3); _antXYZ = 0.0;
+  _antBSG.ReSize(3); _antBSG = 0.0;
+  _xyz.ReSize(3);    _xyz    = 0.0;
+  _version  = 0.0;
+  _interval = 0.0;
+  for (unsigned iPrn = 1; iPrn <= MAXPRN_GPS; iPrn++) {
+    _wlFactorsL1[iPrn] = 1;
+    _wlFactorsL2[iPrn] = 1;
+  }
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+t_rnxObsFile::t_rnxObsHeader::~t_rnxObsHeader() {
+}
+
+// Read Header
+////////////////////////////////////////////////////////////////////////////
+t_irc t_rnxObsFile::t_rnxObsHeader::read(ifstream* stream, int maxLines) {
+  int numLines = 0;
+  while ( stream->good() ) {
+    string line;
+    getline(*stream, line); ++numLines;
+    if (line.empty()) {
+      continue;
+    }
+    if (line.find("END OF FILE") != string::npos) {
+      break;
+    }
+    string value = line.substr(0,60); stripWhiteSpace(value);
+    string key   = line.substr(60);   stripWhiteSpace(key);
+    if      (key == "END OF HEADER") {
+      break;
+    }
+    else if (key == "RINEX VERSION / TYPE") {
+      istringstream in(value);
+      in >> _version;
+    }
+    else if (key == "MARKER NAME") {
+      _markerName = value;
+    }
+    else if (key == "ANT # / TYPE") {
+      _antennaName = line.substr(20,20); stripWhiteSpace(_antennaName);
+    }
+    else if (key == "INTERVAL") {
+      istringstream in(value);
+      in >> _interval;
+    }
+    else if (key == "WAVELENGTH FACT L1/2") {
+      istringstream in(value);
+      int wlFactL1 = 0;
+      int wlFactL2 = 0;
+      int numSat   = 0;
+      in >> wlFactL1 >> wlFactL2 >> numSat;
+      if (numSat == 0) {
+        for (unsigned iPrn = 1; iPrn <= MAXPRN_GPS; iPrn++) {
+          _wlFactorsL1[iPrn] = wlFactL1;
+          _wlFactorsL2[iPrn] = wlFactL2;
+        }
+      }
+      else {
+        for (int ii = 0; ii < numSat; ii++) {
+          string prn; in >> prn;
+          if (prn[0] == 'G') {
+            int iPrn;
+            readInt(prn, 1, 2, iPrn);
+            _wlFactorsL1[iPrn] = wlFactL1;
+            _wlFactorsL2[iPrn] = wlFactL2;
+          }
+        }
+      }
+    }
+    else if (key == "APPROX POSITION XYZ") {
+      istringstream in(value);
+      in >> _xyz[0] >> _xyz[1] >> _xyz[2];
+    }
+    else if (key == "ANTENNA: DELTA H/E/N") {
+      istringstream in(value);
+      in >> _antNEU[2] >> _antNEU[1] >> _antNEU[0];
+    }
+    else if (key == "ANTENNA: DELTA X/Y/Z") {
+      istringstream in(value);
+      in >> _antXYZ[0] >> _antXYZ[1] >> _antXYZ[2];
+    }
+    else if (key == "ANTENNA: B.SIGHT XYZ") {
+      istringstream in(value);
+      in >> _antBSG[0] >> _antBSG[1] >> _antBSG[2];
+    }
+    else if (key == "# / TYPES OF OBSERV") {
+      istringstream in(value);
+      int nTypes;
+      in >> nTypes;
+      _obsTypesV2.clear();
+      for (int ii = 0; ii < nTypes; ii++) {
+        string hlp;
+        in >> hlp;
+        _obsTypesV2.push_back(hlp);
+      }
+    }
+    else if (key == "SYS / # / OBS TYPES") {
+      istringstream* in = new istringstream(value);
+      char sys;
+      int nTypes;
+      *in >> sys >> nTypes;
+      _obsTypesV3[sys].clear();
+      for (int ii = 0; ii < nTypes; ii++) {
+        if (ii > 0 && ii % 13 == 0) {
+          getline(*stream, line);  ++numLines;
+          delete in;
+          in = new istringstream(line);
+        }
+        string hlp;
+        *in >> hlp;
+        _obsTypesV3[sys].push_back(hlp);
+      }
+      delete in;
+    }
+    if (maxLines > 0 && numLines == maxLines) {
+      break;
+    }
+  }
+
+  return success;
+}
+
+// Number of Observation Types (satellite-system specific)
+////////////////////////////////////////////////////////////////////////////
+int t_rnxObsFile::t_rnxObsHeader::nTypes(char sys) const {
+  if (_version < 3.0) {
+    return _obsTypesV2.size();
+  }
+  else {
+    map<char, vector<string> >::const_iterator it = _obsTypesV3.find(sys);
+    if (it != _obsTypesV3.end()) {
+      return it->second.size();
+    }
+    else {
+      return 0;
+    }
+  }
+}
+
+// Observation Type (satellite-system specific)
+////////////////////////////////////////////////////////////////////////////
+const string& t_rnxObsFile::t_rnxObsHeader::obsType(char sys, int index) const {
+  if (_version < 3.0) {
+    return _obsTypesV2.at(index);
+  }
+  else {
+    map<char, vector<string> >::const_iterator it = _obsTypesV3.find(sys);
+    if (it != _obsTypesV3.end()) {
+      return it->second.at(index);
+    }
+    else {
+      return _emptyStr;
+    }
+  }
+}
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+t_rnxObsFile::t_rnxObsFile(const string& fileName) {
+  _stream       = 0;
+  _flgPowerFail = false;
+  open(fileName);
+}
+
+// Open
+////////////////////////////////////////////////////////////////////////////
+void t_rnxObsFile::open(const string& fileName) {
+  _stream = new ifstream(expandEnvVar(fileName).c_str());
+  _header.read(_stream);
+
+  // Guess Observation Interval
+  // --------------------------
+  if (_header._interval == 0.0) {
+    bncTime ttPrev;
+    for (int iEpo = 0; iEpo < 10; iEpo++) {
+      const t_rnxEpo* rnxEpo = nextEpoch();
+      if (!rnxEpo) {
+        throw string("t_rnxObsFile: not enough epochs");
+      }
+      if (iEpo > 0) {
+        double dt = rnxEpo->tt - ttPrev;
+        if (_header._interval == 0.0 || dt < _header._interval) {
+          _header._interval = dt;
+        }
+      }
+      ttPrev = rnxEpo->tt;
+    }
+    _stream->clear();
+    _stream->seekg(0, ios::beg);
+    _header.read(_stream);
+  }
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+t_rnxObsFile::~t_rnxObsFile() {
+  close();
+}
+
+// Close
+////////////////////////////////////////////////////////////////////////////
+void t_rnxObsFile::close() {
+  delete _stream; _stream = 0;
+}
+
+// Handle Special Epoch Flag
+////////////////////////////////////////////////////////////////////////////
+void t_rnxObsFile::handleEpochFlag(int flag, const string& line) {
+
+  // Power Failure
+  // -------------
+  if      (flag == 1) {
+    _flgPowerFail = true;
+  }
+
+  // Start moving antenna
+  // --------------------
+  else if (flag == 2) {
+    // no action
+  }
+
+  // Re-Read Header
+  // -------------- 
+  else if (flag == 3 || flag == 4) {
+    int numLines = 0;
+    if (version() < 3.0) {
+      readInt(line, 29, 3, numLines);
+    }
+    else {
+      readInt(line, 32, 3, numLines);
+    }
+    _header.read(_stream, numLines);
+  }
+
+  // Unhandled Flag
+  // --------------
+  else {
+    throw string("t_rnxObsFile: unhandled flag\n" + line);
+  }
+}
+
+// Retrieve single Epoch
+////////////////////////////////////////////////////////////////////////////
+const t_rnxObsFile::t_rnxEpo* t_rnxObsFile::nextEpoch() {
+
+  _currEpo.clear();
+
+  if (version() < 3.0) {
+    return nextEpochV2();
+  }
+  else {
+    return nextEpochV3();
+  }
+}
+
+// Retrieve single Epoch (RINEX Version 3)
+////////////////////////////////////////////////////////////////////////////
+const t_rnxObsFile::t_rnxEpo* t_rnxObsFile::nextEpochV3() {
+
+  while ( _stream->good() ) {
+
+    string line;
+
+    getline(*_stream, line);
+
+    if (line.empty()) {
+      continue;
+    }
+
+    int flag = 0;
+    readInt(line, 31, 1, flag);
+    if (flag > 0) {
+      handleEpochFlag(flag, line);
+      continue;
+    }
+
+    istringstream in(line.substr(1));
+
+    // Epoch Time
+    // ----------
+    int    year, month, day, hour, min;
+    double sec;
+    in >> year >> month >> day >> hour >> min >> sec;
+    _currEpo.tt.set(hour, min, sec, day, month, year);
+
+    // Number of Satellites
+    // --------------------
+    int numSat;
+    readInt(line, 32, 3, numSat);
+  
+    _currEpo.rnxSat.resize(numSat);
+
+    // Observations
+    // ------------
+    for (int iSat = 0; iSat < numSat; iSat++) {
+      getline(*_stream, line);
+      _currEpo.rnxSat[iSat].satSys = line[0];
+      readInt(line, 1, 2, _currEpo.rnxSat[iSat].satNum);
+      char sys = line[0];
+      for (int iType = 0; iType < _header.nTypes(sys); iType++) {
+        int pos = 3 + 16*iType;
+        double obsValue = 0.0;
+        int    lli      = 0; 
+        int    snr      = 0;
+        readDbl(line, pos,     14, obsValue);
+        readInt(line, pos + 14, 1, lli);
+        readInt(line, pos + 15, 1, snr);
+
+        if (_flgPowerFail) {
+          lli |= 1;
+        }
+
+        _currEpo.rnxSat[iSat].obs.push_back(obsValue);
+        _currEpo.rnxSat[iSat].lli.push_back(lli);
+        _currEpo.rnxSat[iSat].snr.push_back(snr);
+      }
+    }
+
+    _flgPowerFail = false;
+
+    return &_currEpo;
+  }
+
+  return 0;
+}
+
+// Retrieve single Epoch (RINEX Version 2)
+////////////////////////////////////////////////////////////////////////////
+const t_rnxObsFile::t_rnxEpo* t_rnxObsFile::nextEpochV2() {
+
+  while ( _stream->good() ) {
+
+    string line;
+
+    getline(*_stream, line);
+
+    if (line.empty()) {
+      continue;
+    }
+
+    int flag = 0;
+    readInt(line, 28, 1, flag);
+    if (flag > 0) {
+      handleEpochFlag(flag, line);
+      continue;
+    }
+
+    istringstream in(line);
+
+    // Epoch Time
+    // ----------
+    int    year, month, day, hour, min;
+    double sec;
+    in >> year >> month >> day >> hour >> min >> sec;
+    if      (year <  80) {
+      year += 2000;
+    }
+    else if (year < 100) {
+      year += 1900;
+    }
+    _currEpo.tt.set(hour, min, sec, day, month, year);
+
+    // Number of Satellites
+    // --------------------
+    int numSat;
+    readInt(line, 29, 3, numSat);
+  
+    _currEpo.rnxSat.resize(numSat);
+
+    // Read Satellite Numbers
+    // ----------------------
+    int pos = 32;
+    for (int iSat = 0; iSat < numSat; iSat++) {
+      if (iSat > 0 && iSat % 12 == 0) {
+        getline(*_stream, line);
+        pos = 32;
+      }
+
+      _currEpo.rnxSat[iSat].satSys = line[pos];
+      readInt(line, pos + 1, 2, _currEpo.rnxSat[iSat].satNum);
+
+      pos += 3;
+    }
+
+    // Read Observation Records
+    // ------------------------
+    for (int iSat = 0; iSat < numSat; iSat++) {
+      getline(*_stream, line);
+      pos  = 0;
+      for (int iType = 0; iType < _header.nTypes(_currEpo.rnxSat[iSat].satSys); iType++) {
+        if (iType > 0 && iType % 5 == 0) {
+          getline(*_stream, line);
+          pos  = 0;
+        }
+        double obsValue = 0.0;
+        int    lli      = 0;
+        int    snr      = 0;
+        readDbl(line, pos,     14, obsValue);
+        readInt(line, pos + 14, 1, lli);
+        readInt(line, pos + 15, 1, snr);
+
+        if (_flgPowerFail) {
+          lli |= 1;
+        }
+
+        _currEpo.rnxSat[iSat].obs.push_back(obsValue);
+        _currEpo.rnxSat[iSat].lli.push_back(lli);
+        _currEpo.rnxSat[iSat].snr.push_back(snr);
+
+        pos += 16;
+      }
+    }
+ 
+    _flgPowerFail = false;
+
+    return &_currEpo;
+  }
+ 
+  return 0;
+}
+
Index: /trunk/BNC/rinex/rnxobsfile.h
===================================================================
--- /trunk/BNC/rinex/rnxobsfile.h	(revision 3716)
+++ /trunk/BNC/rinex/rnxobsfile.h	(revision 3716)
@@ -0,0 +1,123 @@
+// Part of BNC, a utility for retrieving decoding and
+// converting GNSS data streams from NTRIP broadcasters.
+//
+// Copyright (C) 2007
+// German Federal Agency for Cartography and Geodesy (BKG)
+// http://www.bkg.bund.de
+// Czech Technical University Prague, Department of Geodesy
+// http://www.fsv.cvut.cz
+//
+// Email: euref-ip@bkg.bund.de
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation, version 2.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+#ifndef RNXOBSFILE_H
+#define RNXOBSFILE_H
+
+#include <fstream>
+#include <string>
+#include <vector>
+#include <map>
+
+#include "newmat.h"
+#include "bncconst.h"
+#include "bnctime.h"
+
+#define MAXPRN_GPS 32
+
+class t_rnxObsFile {
+ public:
+
+  class t_rnxSat {
+   public:
+    char                satSys;
+    int                 satNum;
+    std::vector<double> obs;
+    std::vector<int>    lli;
+    std::vector<int>    snr;
+  };
+
+  class t_rnxEpo {
+   public:
+    void clear() {
+      rnxSat.clear();
+    }
+    bncTime               tt;
+    std::vector<t_rnxSat> rnxSat;
+  };
+
+  t_rnxObsFile(const std::string& fileName);
+  ~t_rnxObsFile();
+  
+  float               version() const {return _header._version;}
+  double              interval() const {return _header._interval;}
+  int                 nTypes(char sys) const {return _header.nTypes(sys);}
+  const std::string&  fileName() const {return _fileName;}
+  const std::string&  obsType(char sys, int index) const {return _header.obsType(sys, index);}
+  const std::string&  antennaName() const {return _header._antennaName;}
+  const std::string&  markerName() const {return _header._markerName;}
+  const ColumnVector& xyz() const {return _header._xyz;}
+  const ColumnVector& antNEU() const {return _header._antNEU;}
+  const ColumnVector& antXYZ() const {return _header._antXYZ;}
+  const ColumnVector& antBSG() const {return _header._antBSG;}
+  const t_rnxEpo*     nextEpoch(); 
+  int wlFactorL1(unsigned iPrn) {
+    return iPrn <= MAXPRN_GPS ? _header._wlFactorsL1[iPrn] : 1;
+  }
+  int wlFactorL2(unsigned iPrn) {
+    return iPrn <= MAXPRN_GPS ? _header._wlFactorsL2[iPrn] : 1;
+  }
+
+ protected:
+  t_rnxObsFile() {};
+  void open(const std::string& fileName);
+  void close();
+
+ private: 
+  class t_rnxObsHeader {
+   public:
+    t_rnxObsHeader();
+    ~t_rnxObsHeader();
+
+    t_irc               read(std::ifstream* stream, int maxLines = 0);
+    int                 nTypes(char sys) const;
+    const std::string&  obsType(char sys, int index) const;
+ 
+    static const std::string                  _emptyStr;
+    float                                     _version;
+    double                                    _interval;
+    std::string                               _antennaName;
+    std::string                               _markerName;
+    ColumnVector                              _antNEU;
+    ColumnVector                              _antXYZ;
+    ColumnVector                              _antBSG;
+    ColumnVector                              _xyz;
+    std::vector<std::string>                  _obsTypesV2;
+    std::map<char, std::vector<std::string> > _obsTypesV3;
+    int                                       _wlFactorsL1[MAXPRN_GPS+1];
+    int                                       _wlFactorsL2[MAXPRN_GPS+1];
+  };
+
+  const t_rnxEpo* nextEpochV2();
+  const t_rnxEpo* nextEpochV3();
+  void handleEpochFlag(int flag, const std::string& line);
+
+  std::string    _fileName;
+  t_rnxObsHeader _header;
+  std::ifstream* _stream;
+  t_rnxEpo       _currEpo;
+  bool           _flgPowerFail;
+};
+
+#endif
Index: unk/BNC/rnxobsfile.cpp
===================================================================
--- /trunk/BNC/rnxobsfile.cpp	(revision 3715)
+++ 	(revision )
@@ -1,300 +1,0 @@
-// Part of BNC, a utility for retrieving decoding and
-// converting GNSS data streams from NTRIP broadcasters.
-//
-// Copyright (C) 2007
-// German Federal Agency for Cartography and Geodesy (BKG)
-// http://www.bkg.bund.de
-// Czech Technical University Prague, Department of Geodesy
-// http://www.fsv.cvut.cz
-//
-// Email: euref-ip@bkg.bund.de
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation, version 2.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-/* -------------------------------------------------------------------------
- * BKG NTRIP Client
- * -------------------------------------------------------------------------
- *
- * Class:      t_rnxObsFile
- *
- * Purpose:    Reads RINEX Observation File
- *
- * Author:     L. Mervart
- *
- * Created:    24-Jan-2012
- *
- * Changes:    
- *
- * -----------------------------------------------------------------------*/
-
-#include <iostream>
-#include <iomanip>
-#include "rnxobsfile.h"
-#include "bncutils.h"
-
-using namespace std;
-
-// Constructor
-////////////////////////////////////////////////////////////////////////////
-t_rnxObsFile::t_rnxObsHeader::t_rnxObsHeader() {
-  _antNEU.ReSize(3); 
-  _xyz.ReSize(3);    
-  _antNEU  = 0.0;
-  _xyz     = 0.0;
-  _version = 0.0;
-}
-
-// Destructor
-////////////////////////////////////////////////////////////////////////////
-t_rnxObsFile::t_rnxObsHeader::~t_rnxObsHeader() {
-}
-
-// Read Header
-////////////////////////////////////////////////////////////////////////////
-t_irc t_rnxObsFile::t_rnxObsHeader::read(QTextStream* stream) {
-  while (stream->status() == QTextStream::Ok && !stream->atEnd()) {
-    QString line = stream->readLine();
-    if (line.isEmpty()) {
-      continue;
-    }
-    QString value = line.left(60).trimmed();
-    QString key   = line.mid(60).trimmed();
-    if      (key == "END OF HEADER") {
-      break;
-    }
-    else if (key == "RINEX VERSION / TYPE") {
-      QTextStream in(value.toAscii(), QIODevice::ReadOnly);
-      in >> _version;
-    }
-    else if (key == "MARKER NAME") {
-      _markerName = value;
-    }
-    else if (key == "ANT # / TYPE") {
-      _antennaName = line.mid(20,20);
-    }
-    else if (key == "APPROX POSITION XYZ") {
-      QTextStream in(value.toAscii(), QIODevice::ReadOnly);
-      in >> _xyz[0] >> _xyz[1] >> _xyz[2];
-    }
-    else if (key == "ANTENNA: DELTA H/E/N") {
-      QTextStream in(value.toAscii(), QIODevice::ReadOnly);
-      in >> _antNEU[2] >> _antNEU[1] >> _antNEU[0];
-    }
-    else if (key == "# / TYPES OF OBSERV") {
-      QTextStream in(value.toAscii(), QIODevice::ReadOnly);
-      int nTypes;
-      in >> nTypes;
-      for (int ii = 0; ii < nTypes; ii++) {
-        QString hlp;
-        in >> hlp;
-        _obsTypesV2 << hlp;
-      }
-    }
-    else if (key == "SYS / # / OBS TYPES") {
-      QTextStream* in = new QTextStream(value.toAscii(), QIODevice::ReadOnly);
-      char sys;
-      int nTypes;
-      *in >> sys >> nTypes;
-      for (int ii = 0; ii < nTypes; ii++) {
-        if (ii > 0 && ii % 13 == 0) {
-          line = stream->readLine();
-          delete in;
-          in = new QTextStream(line.toAscii(), QIODevice::ReadOnly);
-        }
-        QString hlp;
-        *in >> hlp;
-        _obsTypesV3[sys] << hlp;
-      }
-      delete in;
-    }
-  }
-
-  return success;
-}
-
-// Constructor
-////////////////////////////////////////////////////////////////////////////
-t_rnxObsFile::t_rnxObsFile(QString fileName) {
-  expandEnvVar(fileName);
-  _file   = new QFile(fileName);
-  _file->open(QIODevice::ReadOnly | QIODevice::Text);
-  _stream = new QTextStream();
-  _stream->setDevice(_file);
-  _header.read(_stream);
-}
-
-// Destructor
-////////////////////////////////////////////////////////////////////////////
-t_rnxObsFile::~t_rnxObsFile() {
-  delete _stream;
-  delete _file;
-}
-
-// Retrieve single Epoch
-////////////////////////////////////////////////////////////////////////////
-const t_rnxObsFile::t_epo* t_rnxObsFile::nextEpoch() {
-
-  _currEpo.clear();
-
-  if (version() < 3.0) {
-    return nextEpochV2();
-  }
-  else {
-    return nextEpochV3();
-  }
-}
-
-// Retrieve single Epoch (RINEX Version 3)
-////////////////////////////////////////////////////////////////////////////
-const t_rnxObsFile::t_epo* t_rnxObsFile::nextEpochV3() {
-  while (_stream->status() == QTextStream::Ok && !_stream->atEnd()) {
-
-    QString line = _stream->readLine();
-
-    if (line.isEmpty()) {
-      continue;
-    }
-
-    if (line.indexOf("END OF FILE") != -1) {
-      break;
-    }
-
-    int flag;
-    readInt(line, 31, 1, flag);
-    if (flag > 1) {  // TODO
-      break; 
-    }
-
-    QTextStream in(line.mid(1).toAscii());
-
-    // Epoch Time
-    // ----------
-    int    year, month, day, hour, min;
-    double sec;
-    in >> year >> month >> day >> hour >> min >> sec;
-    _currEpo.tt.set(year, month, day, hour, min, sec);
-
-    // Number of Satellites
-    // --------------------
-    int numSat;
-    readInt(line, 32, 3, numSat);
-  
-    _currEpo.satObs.resize(numSat);
-
-    // Observations
-    // ------------
-    for (int iSat = 0; iSat < numSat; iSat++) {
-      line = _stream->readLine();
-      _currEpo.satObs[iSat].prn = line.mid(0,3);
-      char sys = _currEpo.satObs[iSat].prn[0].toAscii();
-      if (_currEpo.satObs[iSat].size() != _header.nTypes(sys)) {
-        _currEpo.satObs[iSat].ReSize(_header.nTypes(sys));
-      }
-      for (int iType = 0; iType < _header.nTypes(sys); iType++) {
-        int pos = 3 + 16*iType;
-        readDbl(line, pos,     14, _currEpo.satObs[iSat][iType]);
-        readInt(line, pos + 14, 1, _currEpo.satObs[iSat].lli);
-        readInt(line, pos + 15, 1, _currEpo.satObs[iSat].snr);
-      }
-    }
-
-    return &_currEpo;
-  }
-
-  return 0;
-}
-
-// Retrieve single Epoch (RINEX Version 2)
-////////////////////////////////////////////////////////////////////////////
-const t_rnxObsFile::t_epo* t_rnxObsFile::nextEpochV2() {
-  while (_stream->status() == QTextStream::Ok && !_stream->atEnd()) {
-
-    QString line = _stream->readLine();
-
-    if (line.isEmpty()) {
-      continue;
-    }
-
-    if (line.indexOf("END OF FILE") != -1) {
-      break;
-    }
-
-    int flag;
-    readInt(line, 28, 1, flag);
-    if (flag > 1) {  // TODO
-      break; 
-    }
-
-    QTextStream in(line.toAscii());
-
-    // Epoch Time
-    // ----------
-    int    year, month, day, hour, min;
-    double sec;
-    in >> year >> month >> day >> hour >> min >> sec;
-    if      (year <  80) {
-      year += 2000;
-    }
-    else if (year < 100) {
-      year += 1900;
-    }
-    _currEpo.tt.set(year, month, day, hour, min, sec);
-
-    // Number of Satellites
-    // --------------------
-    int numSat;
-    readInt(line, 29, 3, numSat);
-  
-    _currEpo.satObs.resize(numSat);
-
-    // Read Satellite Numbers
-    // ----------------------
-    int pos = 32;
-    for (int iSat = 0; iSat < numSat; iSat++) {
-      if (iSat > 0 && iSat % 12 == 0) {
-        line = _stream->readLine();
-        pos = 32;
-      }
-      QString prn = line.mid(pos, 3);
-      pos += 3;
-
-      _currEpo.satObs[iSat].prn = prn;
-      char sys = prn[0].toAscii();
-      _currEpo.satObs[iSat].ReSize(_header.nTypes(sys));
-    }
-
-    // Read Observation Records
-    // ------------------------
-    for (int iSat = 0; iSat < numSat; iSat++) {
-      line = _stream->readLine();
-      pos  = 0;
-      QString prn = _currEpo.satObs[iSat].prn;
-      char sys = prn[0].toAscii();
-      for (int iType = 0; iType < _header.nTypes(sys); iType++) {
-        if (iType > 0 && iType % 5 == 0) {
-          line = _stream->readLine();
-          pos  = 0;
-        }
-        readDbl(line, pos,     14, _currEpo.satObs[iSat][iType]);
-        readInt(line, pos + 14, 1, _currEpo.satObs[iSat].lli);
-        readInt(line, pos + 15, 1, _currEpo.satObs[iSat].snr);
-        pos += 16;
-      }
-    }
-
-    return &_currEpo;
-  }
-
-  return 0;
-}
Index: unk/BNC/rnxobsfile.h
===================================================================
--- /trunk/BNC/rnxobsfile.h	(revision 3715)
+++ 	(revision )
@@ -1,124 +1,0 @@
-// Part of BNC, a utility for retrieving decoding and
-// converting GNSS data streams from NTRIP broadcasters.
-//
-// Copyright (C) 2007
-// German Federal Agency for Cartography and Geodesy (BKG)
-// http://www.bkg.bund.de
-// Czech Technical University Prague, Department of Geodesy
-// http://www.fsv.cvut.cz
-//
-// Email: euref-ip@bkg.bund.de
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation, version 2.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-#ifndef RNXOBSFILE_H
-#define RNXOBSFILE_H
-
-#include <QtCore>
-#include "newmat.h"
-#include "bncconst.h"
-#include "bnctime.h"
-
-class t_pppOpt;
-class bncPPPclient;
-
-class t_rnxObsFile {
-
-  class t_rnxObsHeader {
-   public:
-    t_rnxObsHeader();
-    ~t_rnxObsHeader();
-    t_irc read(QTextStream* stream);
-    float version() const {return _version;}
-    int   nTypes(char sys) const {
-      if (_version < 3.0) {
-        return _obsTypesV2.size();
-      }
-      else {
-        if (_obsTypesV3.find(sys) != _obsTypesV3.end()) {
-          return _obsTypesV3[sys].size();
-        }
-        else {
-          return 0;
-        }
-      }
-    }
-    QString obsType(char sys, int index) const {
-      if (_version < 3.0) {
-        return _obsTypesV2.at(index);
-      }
-      else {
-        if (_obsTypesV3.find(sys) != _obsTypesV3.end()) {
-          return _obsTypesV3[sys].at(index);
-        }
-        else {
-          return QString();
-        }
-      }
-    }
-    const QString& antennaName() const {return _antennaName;}
-    const QString& markerName() const {return _markerName;}
-    const ColumnVector& xyz() const {return _xyz;}
-    const ColumnVector& antNEU() const {return _antNEU;}
-   private:
-    float                   _version;
-    QString                 _antennaName;
-    QString                 _markerName;
-    ColumnVector            _antNEU;
-    ColumnVector            _xyz;
-    QStringList             _obsTypesV2;
-    QMap<char, QStringList> _obsTypesV3;
-  };
- 
- public:
-  t_rnxObsFile(QString fileName);
-  ~t_rnxObsFile();
-
-  int   nTypes(char sys) const {return _header.nTypes(sys);}
-  QString obsType(char sys, int index) const {return _header.obsType(sys, index);}
-  const QString& antennaName() const {return _header.antennaName();}
-  const QString& markerName() const {return _header.markerName();}
-  const ColumnVector& xyz() const {return _header.xyz();}
-  const ColumnVector& antNEU() const {return _header.antNEU();}
-
-  class t_satObs : public ColumnVector {
-   public:
-    QString prn;
-    int     lli;
-    int     snr;
-  };
-
-  class t_epo {
-   public:
-    void clear() {
-      satObs.clear();
-    }
-    bncTime           tt;
-    QVector<t_satObs> satObs;
-  };
-
-  float version() const {return _header.version();}
-  const t_epo* nextEpoch(); 
-
- private:
-  const t_epo* nextEpochV2();
-  const t_epo* nextEpochV3();
-
-  t_rnxObsHeader _header;
-  QFile*         _file;
-  QTextStream*   _stream;
-  t_epo          _currEpo;
-};
-
-#endif
