Index: trunk/BNC/src/PPP/options.h
===================================================================
--- trunk/BNC/src/PPP/options.h	(revision 5741)
+++ trunk/BNC/src/PPP/options.h	(revision 5742)
@@ -13,4 +13,8 @@
   t_options();
   ~t_options();
+  bool dualFreqRequired();
+  bool useGlonass();
+  bool xyzAprRoverSet();
+
   bool         _realTime;
   std::string  _roverName;     
@@ -37,5 +41,5 @@
   ColumnVector _neuEccRover;
   std::string  _antNameRover;  
-  int          _minobs;
+  int          _minObs;
   double       _minEle;
   double       _maxResC1;
Index: trunk/BNC/src/PPP/ppp.h
===================================================================
--- trunk/BNC/src/PPP/ppp.h	(revision 5741)
+++ trunk/BNC/src/PPP/ppp.h	(revision 5742)
@@ -3,5 +3,8 @@
 
 #include <string>
+
+#include "bncconst.h"
 #include "bnctime.h"
+#include "t_prn.h"
 
 namespace BNC {
@@ -14,18 +17,4 @@
 };
 
-class t_pppOpt {
- public:
-  e_pppMode   _mode;         
-  std::string _roverName;     
-  std::string _baseName;      
-  double      _xyzAprRover[3];     
-  double      _neuEccRover[3];     
-  std::string _antNameRover;  
-  std::string _antexFileName; 
-  int         _logLevel;             
-  int         _minobs;               
-  bool        _useGlonass;           
-};
-
 class t_pppOutput {
  public:
@@ -34,5 +23,4 @@
   double       _covMatrix[6]; 
   int          _numSat;       
-  double       _ambFixRate; 
   double       _pDop;         
   std::string  _log;          
@@ -40,5 +28,5 @@
 };
 
-class t_pppObs  {
+class t_obs  {
  public:
   std::string _rnxType2ch; 
@@ -53,22 +41,17 @@
   bool        _slip;          
   int         _slipCounter;   
-};
-
-class t_pppSat {
- public:
-  char _system;
-  int  _number;
+  int         _biasJumpCounter;
 };
 
 class t_pppSatObs {
  public:
-  t_pppSat              _satellite;
-  bncTime               _time;
-  std::vector<t_pppObs> _obs;
+  t_prn              _prn;
+  bncTime            _time;
+  std::vector<t_obs> _obs;
 };
 
-class t_pppOrbCorr {
+class t_orbCorr {
  public:
-  t_pppSat       _satellite;
+  t_prn          _prn;
   unsigned short _iod;
   bncTime        _time;
@@ -78,7 +61,7 @@
 };
 
-class t_pppClkCorr {
+class t_clkCorr {
  public:
-  t_pppSat       _satellite;
+  t_prn          _prn;
   unsigned short _iod;
   bncTime        _time;
@@ -90,5 +73,5 @@
 };
 
-class t_pppBias {
+class t_bias {
  public:
   std::string _rnxType3ch;
@@ -96,14 +79,12 @@
 };
 
-class t_pppSatBiases {
+class t_satBiases {
  public:
-  t_pppSat                    _satellite;
-  bncTime                     _time;
-  int                         _nx;
-  int                         _jumpCount;
-  std::vector<t_pppSatBiases> _biases;
+  t_prn               _prn;
+  bncTime             _time;
+  int                 _nx;
+  int                 _jumpCount;
+  std::vector<t_bias> _biases;
 };
-
-enum e_roverBase { e_rover, e_base };
 
 enum e_tropoModel{tropoModel_NO, tropoModel_SAAST, tropoModel_MARINI, 
@@ -113,9 +94,4 @@
                tropoMF_NIELL_WET, tropoMF_HOPF, tropoMF_GMF_DRY, 
                tropoMF_GMF_WET, tropoMF_GMF_COMB};
-
-class t_irc {
- public:
-  enum irc {success = 0, failure};
-};
 
 class t_frequency {
Index: trunk/BNC/src/PPP/pppThread.cpp
===================================================================
--- trunk/BNC/src/PPP/pppThread.cpp	(revision 5741)
+++ trunk/BNC/src/PPP/pppThread.cpp	(revision 5742)
@@ -70,7 +70,11 @@
   cout << _opt->_roverName << " run" << endl;
 
-  _pppRun = new t_pppRun(_opt);
-  QThread::exec();
-
+  try {
+    _pppRun = new t_pppRun(_opt);
+    QThread::exec();
+  }
+  catch (const char* msg) {
+    cout << msg << endl;
+  }
   cout << _opt->_roverName << " exit" << endl;
 }
@@ -80,6 +84,5 @@
 t_pppRun::t_pppRun(const t_options* opt) {
   _opt = opt;
-
-  if (BNC_CORE->caster()) {
+  if (_opt->_realTime) {
     connect(BNC_CORE->caster(), SIGNAL(newObs(QByteArray, QList<t_obs>)),
             this, SLOT(slotNewObs(QByteArray, QList<t_obs>)));
@@ -96,4 +99,9 @@
     connect(BNC_CORE, SIGNAL(newCorrections(QStringList)),
             this, SLOT(slotNewCorrections(QStringList)));
+
+    _pppClient = new t_pppClient();
+  }
+  else {
+    cout << "t_pppRun: post-processing not yet implemented" << endl;
   }
 }
@@ -102,4 +110,5 @@
 ////////////////////////////////////////////////////////////////////////////
 t_pppRun::~t_pppRun() {
+  delete _pppClient;
   cout << "~t_pppRun" << endl;
 }
@@ -110,4 +119,7 @@
   QMutexLocker locker(&_mutex);
   cout << _opt->_roverName << " slotNewEphGPS" << endl;
+  t_ephGPS eph;
+  eph.set(&gpseph);
+  _pppClient->putGPSEphemeris(&eph);
 }
 
Index: trunk/BNC/src/PPP/pppThread.h
===================================================================
--- trunk/BNC/src/PPP/pppThread.h	(revision 5741)
+++ trunk/BNC/src/PPP/pppThread.h	(revision 5742)
@@ -7,4 +7,5 @@
 #include "GPSDecoder.h"
 #include "options.h"
+#include "pppClient.h"
 
 namespace BNC {
@@ -26,4 +27,5 @@
   QMutex           _mutex;
   const t_options* _opt;
+  t_pppClient*     _pppClient;
 };
 
Index: trunk/BNC/src/bncantex.h
===================================================================
--- trunk/BNC/src/bncantex.h	(revision 5741)
+++ trunk/BNC/src/bncantex.h	(revision 5742)
@@ -33,4 +33,5 @@
 class bncAntex {
  public:
+  bncAntex(const char* fileName);
   bncAntex();
   ~bncAntex();
Index: trunk/BNC/src/bnctime.h
===================================================================
--- trunk/BNC/src/bnctime.h	(revision 5741)
+++ trunk/BNC/src/bnctime.h	(revision 5742)
@@ -28,4 +28,5 @@
                            double& sec) const;
   bool         valid() const {return _mjd != 0 || _sec != 0.0;}
+  bool         undef() const {return !valid();}
   bool         operator==(const bncTime &time1) const;
   bool         operator!=(const bncTime &time1) const;
@@ -37,7 +38,9 @@
   bncTime      operator-(double sec) const;
   bncTime      operator+(double sec) const;
+  bncTime&     operator+=(double sec);
 
   std::string timestr(unsigned numdec = 3, char sep = ':') const;  
   std::string datestr(char sep = '-') const;  
+  operator std::string() const;
 
  private:
Index: trunk/BNC/src/combination/bnccomb.cpp
===================================================================
--- trunk/BNC/src/combination/bnccomb.cpp	(revision 5741)
+++ trunk/BNC/src/combination/bnccomb.cpp	(revision 5742)
@@ -29,4 +29,5 @@
 #include "bncantex.h"
 #include "bnctides.h"
+#include "t_prn.h"
 
 const double sig0_offAC    = 1000.0;
@@ -36,6 +37,4 @@
 
 const double sigObs        =   0.05;
-
-const int MAXPRN_GLONASS = 24;
 
 using namespace std;
@@ -194,5 +193,5 @@
       cmbAC* AC = it.next();
       _params.push_back(new cmbParam(cmbParam::offACgps, ++nextPar, AC->name, ""));
-      for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
+      for (int iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
         QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
         _params.push_back(new cmbParam(cmbParam::offACSat, ++nextPar, 
@@ -201,5 +200,5 @@
       if (_useGlonass) {
         _params.push_back(new cmbParam(cmbParam::offACglo, ++nextPar, AC->name, ""));
-        for (int iGlo = 1; iGlo <= MAXPRN_GLONASS; iGlo++) {
+        for (int iGlo = 1; iGlo <= t_prn::MAXPRN_GLONASS; iGlo++) {
           QString prn = QString("R%1").arg(iGlo, 2, 10, QChar('0'));
           _params.push_back(new cmbParam(cmbParam::offACSat, ++nextPar, 
@@ -208,10 +207,10 @@
       }
     }
-    for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
+    for (int iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
       QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
       _params.push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
     }
     if (_useGlonass) {
-      for (int iGlo = 1; iGlo <= MAXPRN_GLONASS; iGlo++) {
+      for (int iGlo = 1; iGlo <= t_prn::MAXPRN_GLONASS; iGlo++) {
         QString prn = QString("R%1").arg(iGlo, 2, 10, QChar('0'));
         _params.push_back(new cmbParam(cmbParam::clkSat, ++nextPar, "", prn));
@@ -763,10 +762,10 @@
   }
 
-  int MAXPRN = MAXPRN_GPS;
+  int maxSat = t_prn::MAXPRN_GPS;
 //  if (_useGlonass) {
-//    MAXPRN = MAXPRN_GPS + MAXPRN_GLONASS;
+//    maxSat = t_prn::MAXPRN_GPS + t_prn::MAXPRN_GLONASS;
 //  }
 
-  const int nCon = (_method == filter) ? 1 + MAXPRN : 0;
+  const int nCon = (_method == filter) ? 1 + maxSat : 0;
 
   AA.ReSize(nObs+nCon, nPar);  AA = 0.0;
@@ -808,5 +807,5 @@
     }
     int iCond = 1;
-    for (int iGps = 1; iGps <= MAXPRN_GPS; iGps++) {
+    for (int iGps = 1; iGps <= t_prn::MAXPRN_GPS; iGps++) {
       QString prn = QString("G%1").arg(iGps, 2, 10, QChar('0'));
       ++iCond;
@@ -822,5 +821,5 @@
     }
 //    if (_useGlonass) {
-//      for (int iGlo = 1; iGlo <= MAXPRN_GLONASS; iGlo++) {
+//      for (int iGlo = 1; iGlo <= t_prn::MAXPRN_GLONASS; iGlo++) {
 //        QString prn = QString("R%1").arg(iGlo, 2, 10, QChar('0'));
 //        ++iCond;
Index: trunk/BNC/src/rinex/rnxobsfile.cpp
===================================================================
--- trunk/BNC/src/rinex/rnxobsfile.cpp	(revision 5741)
+++ trunk/BNC/src/rinex/rnxobsfile.cpp	(revision 5742)
@@ -59,5 +59,5 @@
   _version  = 0.0;
   _interval = 0.0;
-  for (unsigned iPrn = 1; iPrn <= MAXPRN_GPS; iPrn++) {
+  for (unsigned iPrn = 1; iPrn <= t_prn::MAXPRN_GPS; iPrn++) {
     _wlFactorsL1[iPrn] = 1;
     _wlFactorsL2[iPrn] = 1;
@@ -125,5 +125,5 @@
       in >> wlFactL1 >> wlFactL2 >> numSat;
       if (numSat == 0) {
-        for (unsigned iPrn = 1; iPrn <= MAXPRN_GPS; iPrn++) {
+        for (unsigned iPrn = 1; iPrn <= t_prn::MAXPRN_GPS; iPrn++) {
           _wlFactorsL1[iPrn] = wlFactL1;
           _wlFactorsL2[iPrn] = wlFactL2;
@@ -750,5 +750,5 @@
   _header._receiverVersion = header._receiverVersion;
 
-  for (unsigned iPrn = 1; iPrn <= MAXPRN_GPS; iPrn++) {
+  for (unsigned iPrn = 1; iPrn <= t_prn::MAXPRN_GPS; iPrn++) {
     _header._wlFactorsL1[iPrn] =  header._wlFactorsL1[iPrn]; 
     _header._wlFactorsL2[iPrn] =  header._wlFactorsL2[iPrn]; 
Index: trunk/BNC/src/rinex/rnxobsfile.h
===================================================================
--- trunk/BNC/src/rinex/rnxobsfile.h	(revision 5741)
+++ trunk/BNC/src/rinex/rnxobsfile.h	(revision 5742)
@@ -35,6 +35,5 @@
 #include "bncconst.h"
 #include "bnctime.h"
-
-#define MAXPRN_GPS 32
+#include "t_prn.h"
 
 class t_rnxObsHeader {
@@ -72,6 +71,6 @@
   QVector<QString>              _obsTypesV2;
   QMap<char, QVector<QString> > _obsTypesV3;
-  int                           _wlFactorsL1[MAXPRN_GPS+1];
-  int                           _wlFactorsL2[MAXPRN_GPS+1];
+  int                           _wlFactorsL1[t_prn::MAXPRN_GPS+1];
+  int                           _wlFactorsL2[t_prn::MAXPRN_GPS+1];
   bncTime                       _startTime;
 };
@@ -132,8 +131,8 @@
   t_rnxEpo* nextEpoch(); 
   int wlFactorL1(unsigned iPrn) {
-    return iPrn <= MAXPRN_GPS ? _header._wlFactorsL1[iPrn] : 1;
+    return iPrn <= t_prn::MAXPRN_GPS ? _header._wlFactorsL1[iPrn] : 1;
   }
   int wlFactorL2(unsigned iPrn) {
-    return iPrn <= MAXPRN_GPS ? _header._wlFactorsL2[iPrn] : 1;
+    return iPrn <= t_prn::MAXPRN_GPS ? _header._wlFactorsL2[iPrn] : 1;
   }
 
Index: trunk/BNC/src/src.pri
===================================================================
--- trunk/BNC/src/src.pri	(revision 5741)
+++ trunk/BNC/src/src.pri	(revision 5742)
@@ -59,5 +59,5 @@
           RTCM3/clock_and_orbit/clock_orbit_rtcm.h                    \
           PPP/pppwidgets.h PPP/options.h PPP/pppMain.h                \
-          PPP/pppThread.h
+          PPP/pppThread.h PPP/pppClient.h
 
 HEADERS       += serial/qextserialbase.h serial/qextserialport.h
@@ -88,5 +88,5 @@
           RTCM3/clock_and_orbit/clock_orbit_rtcm.c                    \
           PPP/pppwidgets.cpp PPP/options.cpp PPP/pppMain.cpp          \
-          PPP/pppThread.cpp
+          PPP/pppThread.cpp PPP/pppClient.cpp
 
 SOURCES       += serial/qextserialbase.cpp serial/qextserialport.cpp
