Index: unk/BNC/src/PPP/ephpool.cpp
===================================================================
--- /trunk/BNC/src/PPP/ephpool.cpp	(revision 5808)
+++ 	(revision )
@@ -1,156 +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_pppMain
- *
- * Purpose:    Buffer with satellite ephemerides
- *
- * Author:     L. Mervart
- *
- * Created:    29-Jul-2014
- *
- * Changes:    
- *
- * -----------------------------------------------------------------------*/
-
-#include <iostream>
-#include "ephpool.h"
-#include "ppp.h"
-#include "pppClient.h"
-
-using namespace BNC;
-using namespace std;
-
-//
-/////////////////////////////////////////////////////////////////////////////
-void t_ephPool::putEphemeris(t_eph* eph) {
-  if (eph && eph->ok()) {
-    _satEphPool[eph->prn().toInt()].putEphemeris(_maxQueueSize, eph);
-  }
-  else {
-    delete eph;
-  }
-}
-
-//
-/////////////////////////////////////////////////////////////////////////////
-void t_ephPool::putOrbCorrection(t_orbCorr* corr) {
-  if (corr) {
-    _satEphPool[corr->prn().toInt()].putOrbCorrection(corr);
-  }
-}
-
-//
-/////////////////////////////////////////////////////////////////////////////
-void t_ephPool::putClkCorrection(t_clkCorr* corr) {
-  if (corr) {
-    _satEphPool[corr->prn().toInt()].putClkCorrection(corr);
-  }
-}
-
-//
-/////////////////////////////////////////////////////////////////////////////
-t_irc t_ephPool::getCrd(const t_prn& prn, const bncTime& tt, 
-                             ColumnVector& xc, ColumnVector& vv) const {
-  return _satEphPool[prn.toInt()].getCrd(tt, xc, vv);
-}
-
-//
-/////////////////////////////////////////////////////////////////////////////
-int t_ephPool::getChannel(const t_prn& prn) const {
-  return _satEphPool[prn.toInt()].getChannel();
-}
-
-//
-/////////////////////////////////////////////////////////////////////////////
-void t_ephPool::t_satEphPool::putEphemeris(unsigned maxQueueSize, t_eph* eph) {
-  if (_ephs.empty() || eph->isNewerThan(_ephs.front())) {
-    _ephs.push_front(eph);
-    if (maxQueueSize > 0 && _ephs.size() > maxQueueSize) {
-      delete _ephs.back();
-      _ephs.pop_back();
-    }
-  }
-  else {
-    delete eph;
-  }
-}
-
-//
-/////////////////////////////////////////////////////////////////////////////
-void t_ephPool::t_satEphPool::putOrbCorrection(t_orbCorr* corr) {
-  for (unsigned ii = 0; ii < _ephs.size(); ii++) {
-    t_eph* eph = _ephs[ii];
-    if (eph->IOD() == corr->IOD()) {
-      eph->setOrbCorr(corr); 
-      return;
-    }
-  }
-  delete corr;
-}
-
-//
-/////////////////////////////////////////////////////////////////////////////
-void t_ephPool::t_satEphPool::putClkCorrection(t_clkCorr* corr) {
-  for (unsigned ii = 0; ii < _ephs.size(); ii++) {
-    t_eph* eph = _ephs[ii];
-    if (eph->IOD() == corr->IOD()) {
-      eph->setClkCorr(corr); 
-    }
-  }
-  delete corr;
-}
-
-//
-/////////////////////////////////////////////////////////////////////////////
-t_irc t_ephPool::t_satEphPool::getCrd(const bncTime& tt, ColumnVector& xc,
-                                           ColumnVector& vv) const {
-  for (unsigned ii = 0; ii < _ephs.size(); ii++) {
-    t_eph* eph = _ephs[ii];
-    t_irc irc = eph->getCrd(tt, xc, vv, OPT->corrRequired());
-    if (irc == success) {
-      if (eph->prn().system() == 'R') {
-        double age = tt - eph->TOC();
-        if (fabs(age) > 3600.0) {
-          continue;
-        }
-      }
-      return irc;
-    }
-  }
-  return failure;
-}
-
-//
-/////////////////////////////////////////////////////////////////////////////
-int t_ephPool::t_satEphPool::getChannel() const {
-  if (_ephs.size() > 0) {
-    return _ephs[0]->slotNum();
-  }
-  return 0;
-}
Index: unk/BNC/src/PPP/ephpool.h
===================================================================
--- /trunk/BNC/src/PPP/ephpool.h	(revision 5808)
+++ 	(revision )
@@ -1,56 +1,0 @@
-#ifndef EPHPOOL_H
-#define EPHPOOL_H
-
-#include <deque>
-#include "ppp.h"
-#include "bnctime.h"
-#include "ephemeris.h"
-
-namespace BNC {
-
-class t_ephPool {
- public:
-  t_ephPool(unsigned maxQueueSize = 3) {
-    _maxQueueSize = maxQueueSize;
-  }
-  ~t_ephPool() {}; 
-
-  void putEphemeris(t_eph* eph);
-  void putOrbCorrection(t_orbCorr* corr);
-  void putClkCorrection(t_clkCorr* corr);
-
-  t_irc getCrd(const t_prn& prn, const bncTime& tt, 
-                    ColumnVector& xc, ColumnVector& vv) const;
-
-  int getChannel(const t_prn& prn) const;
-
-  std::deque<t_eph*>& ephs(t_prn prn) {
-    return _satEphPool[prn]._ephs;
-  }
-
- private:
-
-  class t_satEphPool {
-   public:
-    t_satEphPool() {};
-    ~t_satEphPool() {
-      for (unsigned ii = 0; ii < _ephs.size(); ii++) {
-        delete _ephs[ii];
-      }
-    }
-    void putEphemeris(unsigned maxQueueSize, t_eph* eph);
-    void putOrbCorrection(t_orbCorr* corr);
-    void putClkCorrection(t_clkCorr* corr);
-    t_irc getCrd(const bncTime& tt, 
-                      ColumnVector& xc, ColumnVector& vv) const;
-    int getChannel() const;
-    std::deque<t_eph*> _ephs;
-  };
-
-  t_satEphPool _satEphPool[t_prn::MAXPRN+1];
-  unsigned     _maxQueueSize;
-};
-
-}
-
-#endif
Index: unk/BNC/src/PPP/filter.cpp
===================================================================
--- /trunk/BNC/src/PPP/filter.cpp	(revision 5808)
+++ 	(revision )
@@ -1,423 +1,0 @@
-#include <iostream>
-#include <iomanip>
-#include <cmath>
-#include <newmat.h>
-#include <newmatio.h>
-#include <newmatap.h>
-
-#include "filter.h"
-#include "bncutils.h"
-#include "parlist.h"
-#include "obspool.h"
-#include "station.h"
-#include "pppClient.h"
-
-using namespace BNC;
-using namespace std;
-
-// Constructor
-////////////////////////////////////////////////////////////////////////////
-t_filter::t_filter() {
-  _parlist = 0;
-}
-
-// Destructor
-////////////////////////////////////////////////////////////////////////////
-t_filter::~t_filter() {
-  delete _parlist;
-}
-
-// Process Single Epoch
-////////////////////////////////////////////////////////////////////////////
-t_irc t_filter::processEpoch(t_obsPool* obsPool) {
-
-  _numSat     = 0;
-
-  if (!_parlist) {
-    _parlist = new t_parlist();
-  }
-
-  // Vector of all Observations
-  // --------------------------
-  t_obsPool::t_epoch* epoch = obsPool->lastEpoch();
-  if (!epoch) {
-    return failure;
-  }
-  vector<t_satObs*>& obsVector = epoch->obsVector();
-
-  // Time of the Epoch
-  // -----------------
-  _epoTime = epoch->epoTime();
-
-  // Auxiliary vectors of processed linear combinations
-  // --------------------------------------------------
-  vector<t_lc::type> LCsCode;
-  vector<t_lc::type> LCsPhase;
-  vector<t_lc::type> LCsAll = OPT->LCs();
-  for (unsigned ii = 0; ii < LCsAll.size(); ii++) {
-    const t_lc::type& tLC = LCsAll[ii];
-    if (t_lc::includesCode(tLC) && !t_lc::includesPhase(tLC)) {
-      LCsCode.push_back(tLC);
-    }
-    else {
-      LCsPhase.push_back(tLC);
-    }
-  }
-  vector<t_lc::type> ambLCs;
-  if      (LCsPhase.size() == 1) {
-    ambLCs.push_back(LCsPhase[0]);
-  }
-  else if (LCsPhase.size() > 1) {
-    ambLCs.push_back(t_lc::l1);
-    ambLCs.push_back(t_lc::l2);
-  }
-  
-  // Set Parameters
-  // --------------
-  _parlist->set(_epoTime, ambLCs, obsVector);
-  const vector<t_param*>& params = _parlist->params();
-
-  // Status Vector, Variance-Covariance Matrix
-  // -----------------------------------------
-  ColumnVector    xFltOld = _xFlt;
-  SymmetricMatrix QFltOld = _QFlt;
-
-  _QFlt.ReSize(_parlist->nPar()); _QFlt = 0.0;
-  _xFlt.ReSize(_parlist->nPar()); _xFlt = 0.0;
-  _x0.ReSize(_parlist->nPar());   _x0   = 0.0;
-  
-  for (unsigned ii = 0; ii < params.size(); ii++) {
-    const t_param* par1 = params[ii];
-
-    _x0[ii] = par1->x0();
-
-    int iOld = par1->indexOld();
-    if (iOld < 0) {
-      _QFlt[ii][ii] = par1->sigma0() * par1->sigma0(); // new parameter
-    }
-    else {
-      _QFlt[ii][ii] = QFltOld[iOld][iOld] + par1->noise() * par1->noise();
-      _xFlt[ii]     = xFltOld[iOld];
-      for (unsigned jj = 0; jj < ii; jj++) {
-        const t_param* par2 = params[jj];
-        int            jOld = par2->indexOld();
-        if (jOld >= 0) {
-          _QFlt[ii][jj] = QFltOld(iOld+1,jOld+1);
-        }
-      }
-    }
-  }
-
-  // Process LCs containing code separately
-  // --------------------------------------
-  for (unsigned ipc = 0; ipc <= 1; ipc++) { 
-    const vector<t_lc::type>& LCsHlp = (ipc == 0 ? LCsCode : LCsPhase);
-    if (LCsHlp.size() > 0) {
-      if ( processLC(LCsHlp, obsVector) != success ) {
-        return failure;
-      }
-    }
-  }
-
-  _parlist->printResult(_epoTime, _QFlt, _xFlt, 0);
-
-  return success;
-}
-
-// Process Selected LCs
-////////////////////////////////////////////////////////////////////////////
-t_irc t_filter::processLC(const vector<t_lc::type>& LCs, 
-                               vector<t_satObs*>& obsVector) {
-
-  LOG.setf(ios::fixed);
-
-  // Detect Cycle Slips
-  // ------------------
-  if (detectCycleSlips(LCs, obsVector) != success) {
-    return failure;
-  }
-
-  ColumnVector            xSav       = _xFlt;
-  SymmetricMatrix         QSav       = _QFlt;
-  string                  epoTimeStr = string(_epoTime);
-  const vector<t_param*>& params     = _parlist->params();
-  unsigned                maxObs     = obsVector.size() * LCs.size();
-    
-  // Outlier Detection Loop
-  // ----------------------
-  for (unsigned iOutlier = 0; iOutlier < maxObs; iOutlier++) {
-
-    if (iOutlier > 0) {
-      _xFlt = xSav;
-      _QFlt = QSav;
-    }
-
-    // First-Design Matrix, Terms Observed-Computed, Weight Matrix
-    // -----------------------------------------------------------
-    Matrix                AA(maxObs, _parlist->nPar());
-    ColumnVector          ll(maxObs);
-    UpperTriangularMatrix Sl(maxObs); Sl = 0.0;
-    
-    int iObs = -1;
-    vector<t_satObs*>  usedObs;
-    vector<t_lc::type> usedTypes;
-    for (unsigned ii = 0; ii < obsVector.size(); ii++) {
-      t_satObs* obs = obsVector[ii];
-      if (!obs->outlier()) {
-        Matrix CC(LCs.size(), 4);
-        for (unsigned jj = 0; jj < LCs.size(); jj++) {
-          const t_lc::type tLC = LCs[jj];
-          ++iObs;
-          usedObs.push_back(obs);
-          usedTypes.push_back(tLC);
-          for (unsigned iPar = 0; iPar < params.size(); iPar++) {
-            const t_param* par = params[iPar];
-            AA[iObs][iPar] = par->partial(_epoTime, obs, tLC);
-          }
-          ll[iObs]       = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA.Row(iObs+1));
-          if (LCs.size() > 1) {
-            ColumnVector coeff(4);
-            obs->lc(tLC, 0.0, 0.0, 0.0, 0.0, &coeff);
-            CC[jj][0] = coeff[0] * obs->sigma(t_lc::l1);
-            CC[jj][1] = coeff[1] * obs->sigma(t_lc::l2);
-            CC[jj][2] = coeff[2] * obs->sigma(t_lc::c1);
-            CC[jj][3] = coeff[3] * obs->sigma(t_lc::c2);
-          }
-          else {
-            Sl[iObs][iObs] = obs->sigma(tLC);
-          }
-        }
-        if (LCs.size() > 1) {
-          SymmetricMatrix QQ; QQ << CC * CC.t();
-          Sl.SymSubMatrix(iObs-LCs.size()+2, iObs+1) = Cholesky(QQ).t();
-        }
-      }
-    }
-
-    // Check number of observations, truncate matrices
-    // -----------------------------------------------
-    if (iObs+1 < OPT->_minObs) {
-      return failure;
-    }
-    AA = AA.Rows(1, iObs+1);
-    ll = ll.Rows(1, iObs+1);
-    Sl = Sl.SymSubMatrix(1, iObs+1);
-
-    // Kalman update step
-    // ------------------
-    //// beg test
-    DiagonalMatrix PP(iObs+1); PP = 0.0;
-    for (int ii = 1; ii <= iObs+1; ii++) {
-      PP(ii,ii) = 1.0 / (Sl(ii,ii) * Sl(ii,ii));
-    }
-    ColumnVector dx;
-    kalman(AA, ll, PP, _QFlt, dx);
-    _xFlt += dx;
-    //// end test
-
-    // Check Residuals
-    // ---------------
-    ColumnVector vv = AA * _xFlt - ll;
-    double     maxOutlier      = 0.0;
-    int        maxOutlierIndex = -1;
-    t_lc::type maxOutlierLC = t_lc::dummy;
-    for (unsigned ii = 0; ii < usedObs.size(); ii++) {
-      const t_lc::type tLC = usedTypes[ii];
-      double res = fabs(vv[ii]);
-      if (res > OPT->maxRes(tLC)) {
-        if (res > fabs(maxOutlier)) {
-          maxOutlier      = vv[ii];
-          maxOutlierIndex = ii;
-          maxOutlierLC    = tLC;
-        }
-      }
-    }
-
-    // Mark outlier or break outlier detection loop
-    // --------------------------------------------
-    if (maxOutlierIndex > -1) {
-      t_satObs* obs = usedObs[maxOutlierIndex];
-      t_param* par = 0;
-      LOG << epoTimeStr << " Outlier " << t_lc::toString(maxOutlierLC) << ' ' 
-          << obs->prn().toString()                        << ' ' 
-          << setw(8) << setprecision(4) << maxOutlier << endl;
-      for (unsigned iPar = 0; iPar < params.size(); iPar++) {
-        t_param* hlp = params[iPar];
-        if (hlp->type() == t_param::amb && hlp->prn()  == obs->prn() && 
-            hlp->tLC()  == usedTypes[maxOutlierIndex]) {
-          par = hlp;
-        }
-      }
-      if (par) {
-        if (par->ambResetCandidate()) {
-          resetAmb(par->prn(), obsVector, &QSav, &xSav);
-        }
-        else {
-          par->setAmbResetCandidate();
-          obs->setOutlier();
-        }
-      }
-      else {
-        obs->setOutlier();
-      }
-    }
-
-    // Print Residuals
-    // ---------------
-    else {
-      for (unsigned jj = 0; jj < LCs.size(); jj++) {
-        for (unsigned ii = 0; ii < usedObs.size(); ii++) {
-          const t_lc::type tLC = usedTypes[ii];
-          t_satObs*        obs = usedObs[ii];
-          if (tLC == LCs[jj]) {
-            obs->setRes(tLC, vv[ii]);
-            LOG << epoTimeStr << " RES " 
-                << left << setw(3) << t_lc::toString(tLC) << right << ' ' 
-                << obs->prn().toString() << ' ' 
-                << setw(8) << setprecision(4) << vv[ii] << endl;
-          }
-        }
-      }
-      cmpDOP(LCs, AA);
-      break;
-    }
-  }
-
-  return success;
-}
-
-// Cycle-Slip Detection
-////////////////////////////////////////////////////////////////////////////
-t_irc t_filter::detectCycleSlips(const vector<t_lc::type>& LCs, 
-                                      const vector<t_satObs*>& obsVector) {
-
-  const double            SLIP       = 20.0;  // slip threshold
-  string                  epoTimeStr = string(_epoTime);
-  const vector<t_param*>& params     = _parlist->params();
-
-  for (unsigned ii = 0; ii < LCs.size(); ii++) {
-    const t_lc::type& tLC = LCs[ii];
-    if (t_lc::includesPhase(tLC)) {
-      for (unsigned iObs = 0; iObs < obsVector.size(); iObs++) {
-        const t_satObs* obs = obsVector[iObs];
-
-        // Check set Slips and Jump Counters 
-        // ---------------------------------
-        bool slip = false;
-
-        if (obs->slip()) {
-          LOG << "cycle slip set (obs)" << endl;;
-          slip = true;
-        }
-
-        if (_slips[obs->prn()]._obsSlipCounter != -1 &&
-            _slips[obs->prn()]._obsSlipCounter != obs->slipCounter()) {
-          LOG << "cycle slip set (obsSlipCounter)" << endl;
-          slip = true;
-        }
-        _slips[obs->prn()]._obsSlipCounter = obs->slipCounter();
-
-        if (_slips[obs->prn()]._biasJumpCounter != -1 &&
-            _slips[obs->prn()]._biasJumpCounter != obs->biasJumpCounter()) {
-          LOG << "cycle slip set (biasJumpCounter)" << endl;
-          slip = true;
-        }
-        _slips[obs->prn()]._biasJumpCounter = obs->biasJumpCounter();
-
-        // Slip Set
-        // --------  
-        if (slip) {
-          resetAmb(obs->prn(), obsVector);
-        }
-  
-        // Check Pre-Fit Residuals
-        // -----------------------
-        else {
-          ColumnVector AA(params.size());
-          for (unsigned iPar = 0; iPar < params.size(); iPar++) {
-            const t_param* par = params[iPar];
-            AA[iPar] = par->partial(_epoTime, obs, tLC);
-          }
-          
-          double ll = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA);
-          double vv = DotProduct(AA, _xFlt) - ll;
-          
-          if (fabs(vv) > SLIP) {
-            LOG << epoTimeStr << " cycle slip detected " << t_lc::toString(tLC) << ' ' 
-                << obs->prn().toString() << ' ' << setw(8) << setprecision(4) << vv << endl;
-            resetAmb(obs->prn(), obsVector);
-          }
-        }
-      }
-    }
-  }
-
-  return success;
-}
-
-// Reset Ambiguity Parameter (cycle slip)
-////////////////////////////////////////////////////////////////////////////
-t_irc t_filter::resetAmb(t_prn prn, const vector<t_satObs*>& obsVector,
-                         SymmetricMatrix* QSav, ColumnVector* xSav) {
-  t_irc irc = failure;
-  vector<t_param*>& params = _parlist->params();
-  for (unsigned iPar = 0; iPar < params.size(); iPar++) {
-    t_param* par = params[iPar];
-    if (par->type() == t_param::amb && par->prn() == prn) {
-      int ind = par->indexNew();
-      t_lc::type tLC = par->tLC();
-      LOG << string(_epoTime) << " RESET " << par->toString() << endl;
-      delete par; par = new t_param(t_param::amb, prn, tLC, &obsVector);
-      par->setIndex(ind);
-      params[iPar] = par;
-      for (unsigned ii = 1; ii <= params.size(); ii++) {
-        _QFlt(ii, ind+1) = 0.0;
-        if (QSav) {
-          (*QSav)(ii, ind+1) = 0.0;
-        }
-      }
-      _QFlt(ind+1,ind+1) = par->sigma0() * par->sigma0();
-      if (QSav) {
-        (*QSav)(ind+1,ind+1) = _QFlt(ind+1,ind+1);
-      }
-      _xFlt[ind] = 0.0;
-      if (xSav) {
-        (*xSav)[ind] = _xFlt[ind];
-      }
-      _x0[ind] = par->x0();
-      irc = success;
-    }
-  }
-
-  return irc;
-}
-
-// Compute various DOP Values
-////////////////////////////////////////////////////////////////////////////
-void t_filter::cmpDOP(const std::vector<t_lc::type>& LCs, const Matrix& AA) {
-
-  _dop.reset();
-  _numSat = 0;
-  try {
-    _numSat = AA.Nrows() / LCs.size();
-    
-    if (_numSat < 4) {
-      return;
-    }
-    
-    Matrix BB(_numSat, 4);
-    
-    for (int ii = 1; ii <= _numSat; ii++) {
-      BB.Row(ii) = AA.Row(ii*LCs.size()).columns(1,4);
-    }
-    
-    SymmetricMatrix NN; NN << BB.t() * BB;  
-    SymmetricMatrix QQ = NN.i();
-    
-    _dop.P = sqrt(QQ(1,1) + QQ(2,2) + QQ(3,3));
-    _dop.T = sqrt(QQ(4,4));
-    _dop.G = sqrt(QQ(1,1) + QQ(2,2) + QQ(3,3) + QQ(4,4));
-  }
-  catch (...) {
-  }
-}
Index: unk/BNC/src/PPP/filter.h
===================================================================
--- /trunk/BNC/src/PPP/filter.h	(revision 5808)
+++ 	(revision )
@@ -1,74 +1,0 @@
-#ifndef FILTER_H
-#define FILTER_H
-
-#include <vector>
-#include <newmat.h>
-#include "ppp.h"
-#include "parlist.h"
-#include "bnctime.h"
-#include "t_prn.h"
-
-namespace BNC {
-
-class t_parlist;
-class t_obsPool;
-class t_satObs;
-
-class t_filter {
- public:
-  t_filter();
-  ~t_filter();
-
-  t_irc processEpoch(t_obsPool* obsPool);
-
-  const ColumnVector&    x() const {return _xFlt;}
-  const SymmetricMatrix& Q() const {return _QFlt;}
-
-  int    numSat() const {return _numSat;}
-  double PDOP() const {return _dop.P;}
-  double GDOP() const {return _dop.G;}
-
- private:
-  class t_slip {
-   public:
-    t_slip() {
-      _slip            = false;
-      _obsSlipCounter  = -1;
-      _biasJumpCounter = -1;
-    }
-    bool _slip;
-    int  _obsSlipCounter;
-    int  _biasJumpCounter;
-  };
-
-  class t_dop {
-   public:
-    t_dop() {reset();}
-    void reset() {P = T = G = 0.0;}
-    double P;
-    double T;
-    double G;
-  };
-  t_irc processLC(const std::vector<t_lc::type>& LCs, std::vector<t_satObs*>& obsVector);
-
-  t_irc detectCycleSlips(const std::vector<t_lc::type>& LCs, 
-                         const std::vector<t_satObs*>& obsVector);
-
-  t_irc resetAmb(t_prn prn, const std::vector<t_satObs*>& obsVector,
-                 SymmetricMatrix* QSav = 0, ColumnVector* xSav = 0);
-
-  void cmpDOP(const std::vector<t_lc::type>& LCs, const Matrix& AA);
-
-  bncTime         _epoTime;
-  t_parlist*      _parlist;
-  SymmetricMatrix _QFlt;
-  ColumnVector    _xFlt;
-  ColumnVector    _x0;
-  t_slip          _slips[t_prn::MAXPRN+1];
-  int             _numSat;
-  t_dop           _dop;
-};
-
-}
-
-#endif
Index: unk/BNC/src/PPP/obspool.cpp
===================================================================
--- /trunk/BNC/src/PPP/obspool.cpp	(revision 5808)
+++ 	(revision )
@@ -1,101 +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_pppMain
- *
- * Purpose:    Buffer with observations
- *
- * Author:     L. Mervart
- *
- * Created:    29-Jul-2014
- *
- * Changes:    
- *
- * -----------------------------------------------------------------------*/
-
-#include "obspool.h"
-
-using namespace BNC;
-using namespace std;
-
-// Constructor
-/////////////////////////////////////////////////////////////////////////////
-t_obsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_satObs*>& obsVector) {
-  _epoTime   = epoTime;
-  for (unsigned ii = 0; ii < obsVector.size(); ii++) {
-    _obsVector.push_back(obsVector[ii]);
-  }
-  obsVector.clear();
-}
-
-// Destructor
-/////////////////////////////////////////////////////////////////////////////
-t_obsPool::t_epoch::~t_epoch() {
-  for (unsigned ii = 0; ii < _obsVector.size(); ii++) {
-    delete _obsVector[ii];
-  }
-}
-
-// Constructor
-/////////////////////////////////////////////////////////////////////////////
-t_obsPool::t_obsPool() {
-  for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
-    _satBiases[ii] = 0;
-  }
-}
-
-// Destructor
-/////////////////////////////////////////////////////////////////////////////
-t_obsPool::~t_obsPool() {
-  for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
-    delete _satBiases[ii];
-  }
-  while (_epochs.size() > 0) {
-    delete _epochs.front();
-    _epochs.pop_front();
-  }
-}
-
-//
-/////////////////////////////////////////////////////////////////////////////
-void t_obsPool::putBiases(t_satBias* satBias) {
-  int iPrn = satBias->prn().toInt();
-  delete _satBiases[iPrn];
-  _satBiases[iPrn] = satBias;
-}
-
-//
-/////////////////////////////////////////////////////////////////////////////
-void t_obsPool::putEpoch(const bncTime& epoTime, vector<t_satObs*>& obsVector) {
-  const unsigned MAXSIZE = 2;
-  _epochs.push_back(new t_epoch(epoTime, obsVector));
-  if (_epochs.size() > MAXSIZE) {
-    delete _epochs.front();
-    _epochs.pop_front();
-  }
-}
Index: unk/BNC/src/PPP/obspool.h
===================================================================
--- /trunk/BNC/src/PPP/obspool.h	(revision 5808)
+++ 	(revision )
@@ -1,52 +1,0 @@
-#ifndef OBSPOOL_H
-#define OBSPOOL_H
-
-#include <vector>
-#include <deque>
-#include "satobs.h"
-#include "satbias.h"
-#include "bnctime.h"
-
-namespace BNC {
-
-class t_obsPool {
- public: 
-
-  class t_epoch {
-   public:
-    t_epoch(const bncTime& epoTime, std::vector<t_satObs*>& obsVector);
-    ~t_epoch();
-    std::vector<t_satObs*>& obsVector() {return _obsVector;}
-    const std::vector<t_satObs*>& obsVector() const {return _obsVector;}
-    const bncTime& epoTime() const {return _epoTime;}
-   private:
-    bncTime                _epoTime;
-    std::vector<t_satObs*> _obsVector;
-  };
-
-  t_obsPool();
-  ~t_obsPool();
-  void putBiases(t_satBias* satBias);
-
-  void putEpoch(const bncTime& epoTime, std::vector<t_satObs*>& obsVector);
-
-  const t_satBias* satBias(const t_prn& prn) const {  
-    return _satBiases[prn.toInt()];
-  }
-  t_epoch* lastEpoch() {
-    if (_epochs.size()) {
-      return _epochs.back();
-    }
-    else {
-      return 0;
-    }
-  }
-
- private:
-  t_satBias*           _satBiases[t_prn::MAXPRN+1];
-  std::deque<t_epoch*> _epochs;
-};
-
-}
-
-#endif
Index: unk/BNC/src/PPP/options.cpp
===================================================================
--- /trunk/BNC/src/PPP/options.cpp	(revision 5808)
+++ 	(revision )
@@ -1,135 +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_options
- *
- * Purpose:    Options for PPP client
- *
- * Author:     L. Mervart
- *
- * Created:    29-Jul-2014
- *
- * Changes:    
- *
- * -----------------------------------------------------------------------*/
-
-#include <newmatio.h>
-#include "options.h"
-
-using namespace BNC;
-using namespace std;
-
-// Constructor
-//////////////////////////////////////////////////////////////////////////////
-t_options::t_options() {
-  _xyzAprRover.ReSize(3); _xyzAprRover = 0.0;
-  _ellAprRover.ReSize(3); _ellAprRover = 0.0;
-  _neuEccRover.ReSize(3); _neuEccRover = 0.0;
-}
-
-// Destructor
-//////////////////////////////////////////////////////////////////////////////
-t_options::~t_options() {
-}
-
-// 
-//////////////////////////////////////////////////////////////////////////////
-bool t_options::dualFreqRequired() const {
-  return true;
-}
-
-// 
-//////////////////////////////////////////////////////////////////////////////
-bool t_options::biasRequired() const {
-  return false;
-}
-
-// 
-//////////////////////////////////////////////////////////////////////////////
-bool t_options::corrRequired() const {
-  return false;
-}
-
-// 
-//////////////////////////////////////////////////////////////////////////////
-bool t_options::useGlonass() const  {
-  return (_lcGLONASS.size() > 0);
-}
-
-// 
-//////////////////////////////////////////////////////////////////////////////
-bool t_options::xyzAprRoverSet() const {
-  return (_xyzAprRover[0] != 0.0 || _xyzAprRover[1] != 0.0 || _xyzAprRover[2] != 0.0);
-}
-
-// 
-//////////////////////////////////////////////////////////////////////////////
-bool t_options::estTropo() const  {
-  return (_sigTropo > 0.0 || _noiseTropo > 0.0);
-}
-
-// 
-//////////////////////////////////////////////////////////////////////////////
-vector<t_lc::type> t_options::LCs() const {
-
-  vector<t_lc::type> allLCs = _lcGPS;
-
-  for (unsigned ii = 0; ii < _lcGLONASS.size(); ii++) {
-    bool found = false;
-    for (unsigned iAll = 0; iAll < allLCs.size(); iAll++) {
-      if (allLCs[iAll] == _lcGLONASS[ii]) {
-        found = true;
-        break;
-      }
-    }
-    if (!found) {
-      allLCs.push_back(_lcGLONASS[ii]);
-    }
-  }
-
-  for (unsigned ii = 0; ii < _lcGalileo.size(); ii++) {
-    bool found = false;
-    for (unsigned iAll = 0; iAll < allLCs.size(); iAll++) {
-      if (allLCs[iAll] == _lcGalileo[ii]) {
-        found = true;
-        break;
-      }
-    }
-    if (!found) {
-      allLCs.push_back(_lcGalileo[ii]);
-    }
-  }
-
-  return allLCs;  
-}
-
-// 
-//////////////////////////////////////////////////////////////////////////////
-double t_options::maxRes(t_lc::type /* tLC */) const {
-  return _maxResC1;
-}
Index: unk/BNC/src/PPP/options.h
===================================================================
--- /trunk/BNC/src/PPP/options.h	(revision 5808)
+++ 	(revision )
@@ -1,66 +1,0 @@
-#ifndef OPTIONS_H
-#define OPTIONS_H
-
-#include <string>
-#include <vector>
-#include <newmat.h>
-#include "ppp.h"
-
-namespace BNC {
-
-class t_options {
- public:
-  class t_optBias {
-   public:
-    t_optBias(char system, t_lc::type tLC) : _system(system), _tLC(tLC) {}
-    char       _system;
-    t_lc::type _tLC;
-  };
-
-  t_options();
-  ~t_options();
-  bool dualFreqRequired() const;
-  bool biasRequired() const;
-  bool corrRequired() const;
-  bool useGlonass() const ;
-  bool xyzAprRoverSet() const;
-  bool estTropo() const ; 
-  std::vector<t_lc::type> LCs() const;
-  double maxRes(t_lc::type tLC) const;
-
-  bool         _realTime;
-  std::string  _roverName;     
-  std::string  _crdFile;
-  std::string  _antexFile;
-  std::string  _corrMount;
-  std::string  _rinexObs;
-  std::string  _rinexNav;
-  std::string  _corrFile;
-
-  double       _sigCrd[3];
-  double       _noiseCrd[3];
-  double       _sigTropo;
-  double       _noiseTropo;
-  double       _sigmaC1;
-  double       _sigmaL1;
-  double       _corrWaitTime;
-  std::vector<t_lc::type> _lcGPS;
-  std::vector<t_lc::type> _lcGLONASS;
-  std::vector<t_lc::type> _lcGalileo;
-  std::vector<t_optBias>  _estBias;
-
-  ColumnVector _xyzAprRover;
-  ColumnVector _ellAprRover;
-  ColumnVector _neuEccRover;
-  std::string  _antNameRover;  
-  int          _minObs;
-  double       _minEle;
-  double       _maxResC1;
-  double       _maxResL1;
-  bool         _eleWgtCode;
-  bool         _eleWgtPhase;
-};
-
-}
-
-#endif
Index: unk/BNC/src/PPP/parlist.cpp
===================================================================
--- /trunk/BNC/src/PPP/parlist.cpp	(revision 5808)
+++ 	(revision )
@@ -1,420 +1,0 @@
-#include <cmath>
-#include <iostream>
-#include <sstream>
-#include <iomanip>
-#include <algorithm>
-#include <newmatio.h>
-#include "parlist.h"
-#include "satobs.h"
-
-#include "station.h"
-#include "bncutils.h"
-#include "bncconst.h"
-#include "pppClient.h"
-
-using namespace BNC;
-using namespace std;
-
-// Constructor
-////////////////////////////////////////////////////////////////////////////
-t_param::t_param(e_type type, const t_prn& prn, t_lc::type tLC,
-                 const vector<t_satObs*>* obsVector) {
-
-  _type     = type;
-  _prn      = prn;
-  _tLC      = tLC;
-  _x0       = 0.0;
-  _indexOld = -1;
-  _indexNew = -1;
-  _noise    = 0.0;
-  _ambInfo  = 0;
-
-  switch (_type) {
-   case crdX:
-     _epoSpec = true;
-     _sigma0  = OPT->_sigCrd[0];
-     break;
-   case crdY:
-     _epoSpec = true;
-     _sigma0  = OPT->_sigCrd[1];
-     break;
-   case crdZ:
-     _epoSpec = true;
-     _sigma0  = OPT->_sigCrd[2];
-     break;
-   case clkR:
-     _epoSpec = true;
-     _sigma0  = 1000.0;
-     break;
-   case amb:
-     _ambInfo = new t_ambInfo();
-     if (obsVector) {
-       for (unsigned ii = 0; ii < obsVector->size(); ii++) {
-         const t_satObs* obs = obsVector->at(ii);
-         if (obs->prn() == _prn) {
-           double offGG = 0;
-           if (_prn.system() == 'R' && tLC != t_lc::MW) {
-             offGG = PPP_CLIENT->offGG();
-           }
-           _x0 = floor((obs->obsValue(tLC) - offGG - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5);
-           break;
-         }
-       }
-     }
-     _epoSpec = false;
-     _sigma0  = 100.0;
-     break;
-   case offGG:
-     _epoSpec = true;
-     _sigma0  = 1000.0;
-     _x0      = PPP_CLIENT->offGG();
-     break;
-   case trp:
-     _epoSpec = false;
-     _sigma0  = OPT->_sigTropo;
-     _noise   = OPT->_noiseTropo;
-     break;
-   case bias:
-     _epoSpec = true;
-     _sigma0  = 10.0;
-     break;
-  }
-}
-
-// Destructor
-////////////////////////////////////////////////////////////////////////////
-t_param::~t_param() {
-  delete _ambInfo;
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-double t_param::partial(const bncTime& /* epoTime */, const t_satObs* obs, 
-                        const t_lc::type& tLC) const {
-
-  // Special Case - Melbourne-Wuebbena
-  // ---------------------------------
-  if (tLC == t_lc::MW && _type != amb && _type != bias) {
-    return 0.0;
-  }
-
-  const t_station* sta  = PPP_CLIENT->staRover();
-  ColumnVector     rhoV = sta->xyzApr() - obs->xc().Rows(1,3);
-
-  switch (_type) {
-  case crdX:
-    return (sta->xyzApr()[0] - obs->xc()[0]) / rhoV.norm_Frobenius();
-  case crdY:
-    return (sta->xyzApr()[1] - obs->xc()[1]) / rhoV.norm_Frobenius();
-  case crdZ:
-    return (sta->xyzApr()[2] - obs->xc()[2]) / rhoV.norm_Frobenius();
-  case clkR:
-    return 1.0;
-  case offGG:
-    return (obs->prn().system() == 'R') ? 1.0 : 0.0;
-  case amb:
-    if (obs->prn() == _prn) {
-      if      (tLC == _tLC) {
-        return (obs->lambda(tLC));
-      }
-      else if (tLC == t_lc::lIF && _tLC == t_lc::MW) {
-        return obs->lambda(t_lc::lIF) * obs->lambda(t_lc::MW) / obs->lambda(t_lc::l2);
-      }
-      else {
-        ColumnVector coeff(4);
-        obs->lc(tLC, 0.0, 0.0, 0.0, 0.0, &coeff);
-        if      (_tLC == t_lc::l1) {
-          return obs->lambda(t_lc::l1) * coeff(1); 
-        }
-        else if (_tLC == t_lc::l2) {
-          return obs->lambda(t_lc::l2) * coeff(2); 
-        }
-      }
-    }
-    return 0.0;
-  case trp:
-    return 1.0 / sin(obs->eleSat()); 
-  case bias:
-    if (tLC == _tLC && obs->prn().system() == _prn.system()) {
-      return 1.0;
-    }
-    else {
-      return 0.0;
-    }
-  }
-
-  return 0.0;
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-string t_param::toString() const {
-  stringstream ss;
-  switch (_type) {
-  case crdX:
-    ss << "CRD_X";
-    break; 
-  case crdY:
-    ss << "CRD_Y";
-    break;
-  case crdZ:
-    ss << "CRD_Z";
-    break;
-  case clkR:
-    ss << "CLK        ";
-    break;
-  case amb:
-    ss << "AMB " << left << setw(3) << t_lc::toString(_tLC) << right << ' ' << _prn.toString();
-    break;
-  case offGG:
-    ss << "OGG        ";
-    break;
-  case trp:
-    ss << "TRP        ";
-    break;
-  case bias:
-    ss << "BIAS " << _prn.system() << ' ' << left << setw(3) << t_lc::toString(_tLC);
-    break;
-  }
-  return ss.str();
-}
-
-// Constructor
-////////////////////////////////////////////////////////////////////////////
-t_parlist::t_parlist() {
-}
-
-// Destructor
-////////////////////////////////////////////////////////////////////////////
-t_parlist::~t_parlist() {
-  for (unsigned ii = 0; ii < _params.size(); ii++) {
-    delete _params[ii];
-  }
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-t_irc t_parlist::set(const bncTime& epoTime, const vector<t_lc::type>& ambLCs, 
-                     const vector<t_satObs*>& obsVector) {
-
-  // Remove some Parameters
-  // ----------------------
-  vector<t_param*>::iterator it = _params.begin();
-  while (it != _params.end()) {
-    t_param* par = *it;
-
-    bool remove = false;
-
-    if      (par->epoSpec()) {  
-      remove = true;
-    }
-
-    else if (par->type() == t_param::amb) {
-      if (par->lastObsTime().valid() && (epoTime - par->lastObsTime() > 120.0)) {
-        remove = true;
-      }
-    }
-
-    else if (par->type() == t_param::amb) {
-      if (par->lastObsTime().valid() && (epoTime - par->lastObsTime() > 3600.0)) {
-        remove = true;
-      }
-    }
-
-    if (remove) {
-      delete par;
-      it = _params.erase(it);
-    }
-    else {
-      ++it;
-    }
-  }
-
-  // Check whether parameters have observations
-  // ------------------------------------------
-  for (unsigned ii = 0; ii < _params.size(); ii++) {
-    t_param* par = _params[ii];
-    if (par->prn() == 0) {
-      par->setLastObsTime(epoTime);
-      if (par->firstObsTime().undef()) {
-        par->setFirstObsTime(epoTime);
-      }
-    }
-    else {
-      for (unsigned jj = 0; jj < obsVector.size(); jj++) {
-        const t_satObs* satObs = obsVector[jj];
-        if (satObs->prn() == par->prn()) {
-          par->setLastObsTime(epoTime);
-          if (par->firstObsTime().undef()) {
-            par->setFirstObsTime(epoTime);
-          }
-          break;
-        }
-      }
-    }
-  } 
-
-  // Required Set of Parameters
-  // --------------------------
-  vector<t_param*> required;
-
-  // Coordinates
-  // -----------
-  required.push_back(new t_param(t_param::crdX, t_prn(), t_lc::dummy));
-  required.push_back(new t_param(t_param::crdY, t_prn(), t_lc::dummy));
-  required.push_back(new t_param(t_param::crdZ, t_prn(), t_lc::dummy));
-
-  // Receiver Clock
-  // --------------
-  required.push_back(new t_param(t_param::clkR, t_prn(), t_lc::dummy));
-
-  // GPS-Glonass Clock Offset
-  // ------------------------
-  if (OPT->useGlonass()) {
-    required.push_back(new t_param(t_param::offGG, t_prn(), t_lc::dummy));
-  }
-
-  // Receiver Biases
-  // ---------------
-  for (unsigned ii = 0; ii < OPT->_estBias.size(); ii++) {
-    const t_options::t_optBias& optBias = OPT->_estBias[ii];
-    required.push_back(new t_param(t_param::bias, t_prn(optBias._system, 1), optBias._tLC));
-  }
-
-  // Troposphere
-  // -----------
-  if (OPT->estTropo()) {
-    required.push_back(new t_param(t_param::trp, t_prn(), t_lc::dummy));
-  }
-
-  // Ambiguities
-  // -----------
-  for (unsigned ii = 0; ii < ambLCs.size(); ii++) {
-    const t_lc::type& tLC = ambLCs[ii];
-    for (unsigned jj = 0; jj < obsVector.size(); jj++) {
-      const t_satObs* satObs = obsVector[jj];
-      required.push_back(new t_param(t_param::amb, satObs->prn(), tLC, &obsVector));
-    }
-  }
-
-  // Check if all required parameters are present
-  // --------------------------------------------
-  for (unsigned ii = 0; ii < required.size(); ii++) {
-    t_param* parReq = required[ii];
-
-    bool found = false;
-    for (unsigned jj = 0; jj < _params.size(); jj++) {
-      t_param* parOld = _params[jj];
-      if (parOld->isEqual(parReq)) {
-        found = true;
-        break;
-      }
-    }
-    if (found) {
-      delete parReq;
-    }
-    else {
-      _params.push_back(parReq);
-    }
-  }
-
-  // Set Parameter Indices
-  // ---------------------
-  sort(_params.begin(), _params.end(), t_param::sortFunction);
-
-  for (unsigned ii = 0; ii < _params.size(); ii++) {
-    t_param* par = _params[ii];
-    par->setIndex(ii);
-    for (unsigned jj = 0; jj < obsVector.size(); jj++) {
-      const t_satObs* satObs = obsVector[jj];
-      if (satObs->prn() == par->prn()) {
-        par->setAmbEleSat(satObs->eleSat());
-        par->stepAmbNumEpo();
-      }
-    }
-  }
-
-  return success;
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void t_parlist::printResult(const bncTime& epoTime, const SymmetricMatrix& QQ,
-                            const ColumnVector& xx, double ambFixRate) const {
-
-  string epoTimeStr = string(epoTime);
-
-  LOG << endl;
-
-  t_param* parX = 0;
-  t_param* parY = 0;
-  t_param* parZ = 0;
-  for (unsigned ii = 0; ii < _params.size(); ii++) {
-    t_param* par = _params[ii];
-    if      (par->type() == t_param::crdX) {
-      parX = par;
-    }
-    else if (par->type() == t_param::crdY) {
-      parY = par;
-    }
-    else if (par->type() == t_param::crdZ) {
-      parZ = par;
-    }
-    else {
-      int ind = par->indexNew();
-      LOG << epoTimeStr << ' ' << par->toString() << ' '
-          << setw(10) << setprecision(4) << par->x0() << ' '
-          << showpos << setw(10) << setprecision(4) << xx[ind] << noshowpos << " +- "
-          << setw(8)  << setprecision(4) << sqrt(QQ[ind][ind]);
-      if (par->type() == t_param::amb) {
-        LOG << " el = " << setw(6) << setprecision(2) << par->ambEleSat() * 180.0 / M_PI
-            << " epo = " << setw(4) << par->ambNumEpo();
-      }
-      LOG << endl;
-    }
-  }
-  
-  if (parX && parY && parZ) {
-    const t_station* sta = PPP_CLIENT->staRover();
-
-    ColumnVector xyz(3);
-    xyz[0] = xx[parX->indexNew()];
-    xyz[1] = xx[parY->indexNew()];
-    xyz[2] = xx[parZ->indexNew()];
-
-    ColumnVector neu(3);
-    xyz2neu(sta->ellApr().data(), xyz.data(), neu.data());
-
-    SymmetricMatrix QQxyz = QQ.SymSubMatrix(1,3);
-
-    SymmetricMatrix QQneu(3);
-    covariXYZ_NEU(QQxyz, sta->ellApr().data(), QQneu);
-
-    LOG << epoTimeStr
-        << " X = " << setprecision(4) << sta->xyzApr()[0] + xyz[0] << " +- "
-        << setprecision(4) << sqrt(QQxyz[0][0])
-                                   
-        << " Y = " << setprecision(4) << sta->xyzApr()[1] + xyz[1] << " +- "
-        << setprecision(4) << sqrt(QQxyz[1][1])
-
-        << " Z = " << setprecision(4) << sta->xyzApr()[2] + xyz[2] << " +- "
-        << setprecision(4) << sqrt(QQxyz[2][2])
-
-        << " dN = " << setprecision(4) << neu[0] << " +- "
-        << setprecision(4) << sqrt(QQneu[0][0])
-
-        << " dE = " << setprecision(4) << neu[1] << " +- "
-        << setprecision(4) << sqrt(QQneu[1][1])
-
-        << " dU = " << setprecision(4) << neu[2] << " +- "
-        << setprecision(4) << sqrt(QQneu[2][2]);
-    if (ambFixRate > 0.0) {
-      LOG << " fix "; 
-    }
-    else {
-      LOG << " flt "; 
-    }
-    LOG << int(100*ambFixRate) << " %\n";
-  }
-}
-
Index: unk/BNC/src/PPP/parlist.h
===================================================================
--- /trunk/BNC/src/PPP/parlist.h	(revision 5808)
+++ 	(revision )
@@ -1,113 +1,0 @@
-#ifndef PARLIST_H
-#define PARLIST_H
-
-#include <vector>
-#include <string>
-#include "ppp.h"
-#include "t_prn.h"
-#include "bnctime.h"
-
-namespace BNC {
-
-class t_satObs;
-
-class t_param {
- public:
-  enum e_type {crdX, crdY, crdZ, clkR, amb, offGG, trp, bias};
-
-  t_param(e_type type, const t_prn& prn, t_lc::type tLC,
-          const std::vector<t_satObs*>* obsVector = 0);
-
-  ~t_param();
-  e_type type() const {return _type;}
-  double x0()  const {return _x0;}
-  double partial(const bncTime& epoTime, const t_satObs* obs, 
-                 const t_lc::type& tLC) const;
-  bool   epoSpec() const {return _epoSpec;}
-  bool   isEqual(const t_param* par2) const {
-    return (_type == par2->_type && _prn == par2->_prn && _tLC == par2->_tLC);
-  }
-  void   setIndex(int indexNew) {
-    _indexOld = _indexNew;
-    _indexNew = indexNew;
-  }
-  int indexOld() const {return _indexOld;}
-  int indexNew() const {return _indexNew;}
-  double sigma0() const {return _sigma0;}
-  double noise() const {return _noise;}
-  t_lc::type tLC() const {return _tLC;}
-  t_prn prn() const {return _prn;}
-  std::string toString() const;
-
-  const bncTime& lastObsTime() const {return _lastObsTime;}
-  void setLastObsTime(const bncTime& epoTime) {_lastObsTime = epoTime;}
-  const bncTime& firstObsTime() const {return _firstObsTime;}
-  void setFirstObsTime(const bncTime& epoTime) {_firstObsTime = epoTime;}
-
-  bool     ambResetCandidate() const   {return _ambInfo && _ambInfo->_resetCandidate;}
-  void     setAmbResetCandidate()      {if (_ambInfo) _ambInfo->_resetCandidate = true;}
-  double   ambEleSat() const           {return _ambInfo ? _ambInfo->_eleSat : 0.0;}
-  void     setAmbEleSat(double eleSat) {if (_ambInfo) _ambInfo->_eleSat = eleSat;}
-  unsigned ambNumEpo() const           {return _ambInfo ? _ambInfo->_numEpo : 0;}
-  void     stepAmbNumEpo()             {if (_ambInfo) _ambInfo->_numEpo += 1;}
-
-  static bool sortFunction(const t_param* p1, const t_param* p2) {
-    if      (p1->_type != p2->_type) {
-      return p1->_type < p2->_type;
-    }
-    else if (p1->_tLC != p2->_tLC) {
-      return p1->_tLC < p2->_tLC;
-    }
-    else if (p1->_prn != p2->_prn) {
-      return p1->_prn < p2->_prn;
-    }
-    return false;
-  }
-
- private:
-  class t_ambInfo {
-   public:
-    t_ambInfo() {
-      _resetCandidate = false;
-      _eleSat         = 0.0;
-      _numEpo         = 0;
-    }
-    ~t_ambInfo() {}
-    bool     _resetCandidate;
-    double   _eleSat;
-    unsigned _numEpo;
-  };
-  e_type     _type;
-  t_prn      _prn;
-  t_lc::type _tLC;
-  double     _x0;
-  bool       _epoSpec;
-  int        _indexOld;
-  int        _indexNew;
-  double     _sigma0;
-  double     _noise;
-  t_ambInfo* _ambInfo;
-  bncTime    _lastObsTime;
-  bncTime    _firstObsTime;
-};
-
-class t_parlist {
- public:
-  t_parlist();
-  ~t_parlist();
-
-  t_irc set(const bncTime& epoTime, const std::vector<t_lc::type>& ambLCs,
-            const std::vector<t_satObs*>& obsVector);
-
-  unsigned nPar() const {return _params.size();}
-  const std::vector<t_param*>& params() const {return _params;}
-  std::vector<t_param*>& params() {return _params;}
-  void printResult(const bncTime& epoTime, const SymmetricMatrix& QQ, 
-                   const ColumnVector& xx, double ambFixRate) const;
- private:
-  std::vector<t_param*> _params;
-};
-
-}
-
-#endif
Index: unk/BNC/src/PPP/ppp.h
===================================================================
--- /trunk/BNC/src/PPP/ppp.h	(revision 5808)
+++ 	(revision )
@@ -1,160 +1,0 @@
-#ifndef PPP_H
-#define PPP_H
-
-#include <string>
-#include <vector>
-
-#include "bncconst.h"
-#include "bnctime.h"
-#include "t_prn.h"
-
-namespace BNC {
-
-class pppExcept {
- public:
-  pppExcept(const char* msg) {
-    _msg = msg;
-  }
-  ~pppExcept() {}
-  std::string what() {return _msg;}
- private:
-  std::string _msg;
-};
-
-class t_output {
- public:
-  bncTime      _epoTime;           
-  double       _xyzRover[3];  
-  double       _covMatrix[6]; 
-  int          _numSat;       
-  double       _pDop;         
-  std::string  _log;          
-  bool         _error;        
-};
-
-class t_pppObs  {
- public:
-  t_pppObs() {
-    _code            = 0.0;          
-    _codeValid       = false;     
-    _phase           = 0.0;         
-    _phaseValid      = false;    
-    _doppler         = 0.0;       
-    _dopplerValid    = false;  
-    _snr             = 0.0;           
-    _snrValid        = false;      
-    _slip            = false;          
-    _slipCounter     = 0;   
-    _biasJumpCounter = 0;
-  }
-  std::string _rnxType2ch; 
-  double      _code;          
-  bool        _codeValid;     
-  double      _phase;         
-  bool        _phaseValid;    
-  double      _doppler;       
-  bool        _dopplerValid;  
-  double      _snr;           
-  bool        _snrValid;      
-  bool        _slip;          
-  int         _slipCounter;   
-  int         _biasJumpCounter;
-};
-
-class t_pppSatObs {
- public:
-  t_pppSatObs() {}
-  ~t_pppSatObs() {for (unsigned ii = 0; ii < _obs.size(); ii++) delete _obs[ii];}
-  t_prn                  _prn;
-  bncTime                _time;
-  std::vector<t_pppObs*> _obs;
-};
-
-class t_orbCorr {
- public:
-  t_prn          prn() const {return _prn;}
-  unsigned short IOD() const {return _iod;}
-  t_prn          _prn;
-  unsigned short _iod;
-  bncTime        _time;
-  char           _system;
-  double         _xr[3];
-  double         _dotXr[3];
-};
-
-class t_clkCorr {
- public:
-  t_prn          prn() const {return _prn;}
-  unsigned short IOD() const {return _iod;}
-  t_prn          _prn;
-  unsigned short _iod;
-  bncTime        _time;
-  double         _dClk;
-  double         _dotDClk;
-  double         _dotDotDClk;
-  double         _clkPartial;
-};
-
-class t_bias {
- public:
-  std::string _rnxType3ch;
-  double      _value;
-};
-
-class t_satBiases {
- public:
-  t_prn               _prn;
-  bncTime             _time;
-  int                 _nx;
-  int                 _jumpCount;
-  std::vector<t_bias> _biases;
-};
-
-class t_frequency {
- public:
-  enum type {dummy = 0, G1, G2, R1, R2, maxFr};
-
-  static std::string toString(type tt) {
-    if      (tt == G1) return "G1";
-    else if (tt == G2) return "G2";
-    else if (tt == R1) return "R1";
-    else if (tt == R2) return "R2";
-    return std::string();
-  }
-};
-
-class t_lc {
- public:
-  enum type {dummy = 0, l1, l2, c1, c2, lIF, cIF, MW, CL, maxLc};
-
-  static bool need2ndFreq(type tt) {
-    if (tt == l2 || tt == c2 || tt == lIF || tt == cIF || tt == MW) return true;
-    return false;
-  }  
-
-  static bool includesPhase(type tt) {
-    if (tt == l1 || tt == l2 || tt == lIF || tt == MW || tt == CL) return true;
-    return false;
-  }
-
-  static bool includesCode(type tt) {
-    if (tt == c1 || tt == c2 || tt == cIF || tt == MW || tt == CL) return true;
-    return false;
-  }
-
-  static std::string toString(type tt) {
-    if      (tt == l1)  return "l1";
-    else if (tt == l2)  return "l2";
-    else if (tt == c1)  return "c1";
-    else if (tt == c2)  return "c2";
-    else if (tt == lIF) return "lIF";
-    else if (tt == cIF) return "cIF";
-    else if (tt == MW)  return "MW";
-    else if (tt == CL)  return "CL";
-    return std::string();
-  }
-};
-
-} // namespace BNC
-
-#endif
Index: /trunk/BNC/src/PPP/pppEphPool.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppEphPool.cpp	(revision 5809)
+++ /trunk/BNC/src/PPP/pppEphPool.cpp	(revision 5809)
@@ -0,0 +1,156 @@
+// 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_pppMain
+ *
+ * Purpose:    Buffer with satellite ephemerides
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    29-Jul-2014
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include <iostream>
+#include "ephpool.h"
+#include "ppp.h"
+#include "pppClient.h"
+
+using namespace BNC;
+using namespace std;
+
+//
+/////////////////////////////////////////////////////////////////////////////
+void t_ephPool::putEphemeris(t_eph* eph) {
+  if (eph && eph->ok()) {
+    _satEphPool[eph->prn().toInt()].putEphemeris(_maxQueueSize, eph);
+  }
+  else {
+    delete eph;
+  }
+}
+
+//
+/////////////////////////////////////////////////////////////////////////////
+void t_ephPool::putOrbCorrection(t_orbCorr* corr) {
+  if (corr) {
+    _satEphPool[corr->prn().toInt()].putOrbCorrection(corr);
+  }
+}
+
+//
+/////////////////////////////////////////////////////////////////////////////
+void t_ephPool::putClkCorrection(t_clkCorr* corr) {
+  if (corr) {
+    _satEphPool[corr->prn().toInt()].putClkCorrection(corr);
+  }
+}
+
+//
+/////////////////////////////////////////////////////////////////////////////
+t_irc t_ephPool::getCrd(const t_prn& prn, const bncTime& tt, 
+                             ColumnVector& xc, ColumnVector& vv) const {
+  return _satEphPool[prn.toInt()].getCrd(tt, xc, vv);
+}
+
+//
+/////////////////////////////////////////////////////////////////////////////
+int t_ephPool::getChannel(const t_prn& prn) const {
+  return _satEphPool[prn.toInt()].getChannel();
+}
+
+//
+/////////////////////////////////////////////////////////////////////////////
+void t_ephPool::t_satEphPool::putEphemeris(unsigned maxQueueSize, t_eph* eph) {
+  if (_ephs.empty() || eph->isNewerThan(_ephs.front())) {
+    _ephs.push_front(eph);
+    if (maxQueueSize > 0 && _ephs.size() > maxQueueSize) {
+      delete _ephs.back();
+      _ephs.pop_back();
+    }
+  }
+  else {
+    delete eph;
+  }
+}
+
+//
+/////////////////////////////////////////////////////////////////////////////
+void t_ephPool::t_satEphPool::putOrbCorrection(t_orbCorr* corr) {
+  for (unsigned ii = 0; ii < _ephs.size(); ii++) {
+    t_eph* eph = _ephs[ii];
+    if (eph->IOD() == corr->IOD()) {
+      eph->setOrbCorr(corr); 
+      return;
+    }
+  }
+  delete corr;
+}
+
+//
+/////////////////////////////////////////////////////////////////////////////
+void t_ephPool::t_satEphPool::putClkCorrection(t_clkCorr* corr) {
+  for (unsigned ii = 0; ii < _ephs.size(); ii++) {
+    t_eph* eph = _ephs[ii];
+    if (eph->IOD() == corr->IOD()) {
+      eph->setClkCorr(corr); 
+    }
+  }
+  delete corr;
+}
+
+//
+/////////////////////////////////////////////////////////////////////////////
+t_irc t_ephPool::t_satEphPool::getCrd(const bncTime& tt, ColumnVector& xc,
+                                           ColumnVector& vv) const {
+  for (unsigned ii = 0; ii < _ephs.size(); ii++) {
+    t_eph* eph = _ephs[ii];
+    t_irc irc = eph->getCrd(tt, xc, vv, OPT->corrRequired());
+    if (irc == success) {
+      if (eph->prn().system() == 'R') {
+        double age = tt - eph->TOC();
+        if (fabs(age) > 3600.0) {
+          continue;
+        }
+      }
+      return irc;
+    }
+  }
+  return failure;
+}
+
+//
+/////////////////////////////////////////////////////////////////////////////
+int t_ephPool::t_satEphPool::getChannel() const {
+  if (_ephs.size() > 0) {
+    return _ephs[0]->slotNum();
+  }
+  return 0;
+}
Index: /trunk/BNC/src/PPP/pppEphPool.h
===================================================================
--- /trunk/BNC/src/PPP/pppEphPool.h	(revision 5809)
+++ /trunk/BNC/src/PPP/pppEphPool.h	(revision 5809)
@@ -0,0 +1,56 @@
+#ifndef EPHPOOL_H
+#define EPHPOOL_H
+
+#include <deque>
+#include "ppp.h"
+#include "bnctime.h"
+#include "ephemeris.h"
+
+namespace BNC {
+
+class t_ephPool {
+ public:
+  t_ephPool(unsigned maxQueueSize = 3) {
+    _maxQueueSize = maxQueueSize;
+  }
+  ~t_ephPool() {}; 
+
+  void putEphemeris(t_eph* eph);
+  void putOrbCorrection(t_orbCorr* corr);
+  void putClkCorrection(t_clkCorr* corr);
+
+  t_irc getCrd(const t_prn& prn, const bncTime& tt, 
+                    ColumnVector& xc, ColumnVector& vv) const;
+
+  int getChannel(const t_prn& prn) const;
+
+  std::deque<t_eph*>& ephs(t_prn prn) {
+    return _satEphPool[prn]._ephs;
+  }
+
+ private:
+
+  class t_satEphPool {
+   public:
+    t_satEphPool() {};
+    ~t_satEphPool() {
+      for (unsigned ii = 0; ii < _ephs.size(); ii++) {
+        delete _ephs[ii];
+      }
+    }
+    void putEphemeris(unsigned maxQueueSize, t_eph* eph);
+    void putOrbCorrection(t_orbCorr* corr);
+    void putClkCorrection(t_clkCorr* corr);
+    t_irc getCrd(const bncTime& tt, 
+                      ColumnVector& xc, ColumnVector& vv) const;
+    int getChannel() const;
+    std::deque<t_eph*> _ephs;
+  };
+
+  t_satEphPool _satEphPool[t_prn::MAXPRN+1];
+  unsigned     _maxQueueSize;
+};
+
+}
+
+#endif
Index: /trunk/BNC/src/PPP/pppFilter.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppFilter.cpp	(revision 5809)
+++ /trunk/BNC/src/PPP/pppFilter.cpp	(revision 5809)
@@ -0,0 +1,423 @@
+#include <iostream>
+#include <iomanip>
+#include <cmath>
+#include <newmat.h>
+#include <newmatio.h>
+#include <newmatap.h>
+
+#include "filter.h"
+#include "bncutils.h"
+#include "parlist.h"
+#include "obspool.h"
+#include "station.h"
+#include "pppClient.h"
+
+using namespace BNC;
+using namespace std;
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+t_filter::t_filter() {
+  _parlist = 0;
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+t_filter::~t_filter() {
+  delete _parlist;
+}
+
+// Process Single Epoch
+////////////////////////////////////////////////////////////////////////////
+t_irc t_filter::processEpoch(t_obsPool* obsPool) {
+
+  _numSat     = 0;
+
+  if (!_parlist) {
+    _parlist = new t_parlist();
+  }
+
+  // Vector of all Observations
+  // --------------------------
+  t_obsPool::t_epoch* epoch = obsPool->lastEpoch();
+  if (!epoch) {
+    return failure;
+  }
+  vector<t_satObs*>& obsVector = epoch->obsVector();
+
+  // Time of the Epoch
+  // -----------------
+  _epoTime = epoch->epoTime();
+
+  // Auxiliary vectors of processed linear combinations
+  // --------------------------------------------------
+  vector<t_lc::type> LCsCode;
+  vector<t_lc::type> LCsPhase;
+  vector<t_lc::type> LCsAll = OPT->LCs();
+  for (unsigned ii = 0; ii < LCsAll.size(); ii++) {
+    const t_lc::type& tLC = LCsAll[ii];
+    if (t_lc::includesCode(tLC) && !t_lc::includesPhase(tLC)) {
+      LCsCode.push_back(tLC);
+    }
+    else {
+      LCsPhase.push_back(tLC);
+    }
+  }
+  vector<t_lc::type> ambLCs;
+  if      (LCsPhase.size() == 1) {
+    ambLCs.push_back(LCsPhase[0]);
+  }
+  else if (LCsPhase.size() > 1) {
+    ambLCs.push_back(t_lc::l1);
+    ambLCs.push_back(t_lc::l2);
+  }
+  
+  // Set Parameters
+  // --------------
+  _parlist->set(_epoTime, ambLCs, obsVector);
+  const vector<t_param*>& params = _parlist->params();
+
+  // Status Vector, Variance-Covariance Matrix
+  // -----------------------------------------
+  ColumnVector    xFltOld = _xFlt;
+  SymmetricMatrix QFltOld = _QFlt;
+
+  _QFlt.ReSize(_parlist->nPar()); _QFlt = 0.0;
+  _xFlt.ReSize(_parlist->nPar()); _xFlt = 0.0;
+  _x0.ReSize(_parlist->nPar());   _x0   = 0.0;
+  
+  for (unsigned ii = 0; ii < params.size(); ii++) {
+    const t_param* par1 = params[ii];
+
+    _x0[ii] = par1->x0();
+
+    int iOld = par1->indexOld();
+    if (iOld < 0) {
+      _QFlt[ii][ii] = par1->sigma0() * par1->sigma0(); // new parameter
+    }
+    else {
+      _QFlt[ii][ii] = QFltOld[iOld][iOld] + par1->noise() * par1->noise();
+      _xFlt[ii]     = xFltOld[iOld];
+      for (unsigned jj = 0; jj < ii; jj++) {
+        const t_param* par2 = params[jj];
+        int            jOld = par2->indexOld();
+        if (jOld >= 0) {
+          _QFlt[ii][jj] = QFltOld(iOld+1,jOld+1);
+        }
+      }
+    }
+  }
+
+  // Process LCs containing code separately
+  // --------------------------------------
+  for (unsigned ipc = 0; ipc <= 1; ipc++) { 
+    const vector<t_lc::type>& LCsHlp = (ipc == 0 ? LCsCode : LCsPhase);
+    if (LCsHlp.size() > 0) {
+      if ( processLC(LCsHlp, obsVector) != success ) {
+        return failure;
+      }
+    }
+  }
+
+  _parlist->printResult(_epoTime, _QFlt, _xFlt, 0);
+
+  return success;
+}
+
+// Process Selected LCs
+////////////////////////////////////////////////////////////////////////////
+t_irc t_filter::processLC(const vector<t_lc::type>& LCs, 
+                               vector<t_satObs*>& obsVector) {
+
+  LOG.setf(ios::fixed);
+
+  // Detect Cycle Slips
+  // ------------------
+  if (detectCycleSlips(LCs, obsVector) != success) {
+    return failure;
+  }
+
+  ColumnVector            xSav       = _xFlt;
+  SymmetricMatrix         QSav       = _QFlt;
+  string                  epoTimeStr = string(_epoTime);
+  const vector<t_param*>& params     = _parlist->params();
+  unsigned                maxObs     = obsVector.size() * LCs.size();
+    
+  // Outlier Detection Loop
+  // ----------------------
+  for (unsigned iOutlier = 0; iOutlier < maxObs; iOutlier++) {
+
+    if (iOutlier > 0) {
+      _xFlt = xSav;
+      _QFlt = QSav;
+    }
+
+    // First-Design Matrix, Terms Observed-Computed, Weight Matrix
+    // -----------------------------------------------------------
+    Matrix                AA(maxObs, _parlist->nPar());
+    ColumnVector          ll(maxObs);
+    UpperTriangularMatrix Sl(maxObs); Sl = 0.0;
+    
+    int iObs = -1;
+    vector<t_satObs*>  usedObs;
+    vector<t_lc::type> usedTypes;
+    for (unsigned ii = 0; ii < obsVector.size(); ii++) {
+      t_satObs* obs = obsVector[ii];
+      if (!obs->outlier()) {
+        Matrix CC(LCs.size(), 4);
+        for (unsigned jj = 0; jj < LCs.size(); jj++) {
+          const t_lc::type tLC = LCs[jj];
+          ++iObs;
+          usedObs.push_back(obs);
+          usedTypes.push_back(tLC);
+          for (unsigned iPar = 0; iPar < params.size(); iPar++) {
+            const t_param* par = params[iPar];
+            AA[iObs][iPar] = par->partial(_epoTime, obs, tLC);
+          }
+          ll[iObs]       = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA.Row(iObs+1));
+          if (LCs.size() > 1) {
+            ColumnVector coeff(4);
+            obs->lc(tLC, 0.0, 0.0, 0.0, 0.0, &coeff);
+            CC[jj][0] = coeff[0] * obs->sigma(t_lc::l1);
+            CC[jj][1] = coeff[1] * obs->sigma(t_lc::l2);
+            CC[jj][2] = coeff[2] * obs->sigma(t_lc::c1);
+            CC[jj][3] = coeff[3] * obs->sigma(t_lc::c2);
+          }
+          else {
+            Sl[iObs][iObs] = obs->sigma(tLC);
+          }
+        }
+        if (LCs.size() > 1) {
+          SymmetricMatrix QQ; QQ << CC * CC.t();
+          Sl.SymSubMatrix(iObs-LCs.size()+2, iObs+1) = Cholesky(QQ).t();
+        }
+      }
+    }
+
+    // Check number of observations, truncate matrices
+    // -----------------------------------------------
+    if (iObs+1 < OPT->_minObs) {
+      return failure;
+    }
+    AA = AA.Rows(1, iObs+1);
+    ll = ll.Rows(1, iObs+1);
+    Sl = Sl.SymSubMatrix(1, iObs+1);
+
+    // Kalman update step
+    // ------------------
+    //// beg test
+    DiagonalMatrix PP(iObs+1); PP = 0.0;
+    for (int ii = 1; ii <= iObs+1; ii++) {
+      PP(ii,ii) = 1.0 / (Sl(ii,ii) * Sl(ii,ii));
+    }
+    ColumnVector dx;
+    kalman(AA, ll, PP, _QFlt, dx);
+    _xFlt += dx;
+    //// end test
+
+    // Check Residuals
+    // ---------------
+    ColumnVector vv = AA * _xFlt - ll;
+    double     maxOutlier      = 0.0;
+    int        maxOutlierIndex = -1;
+    t_lc::type maxOutlierLC = t_lc::dummy;
+    for (unsigned ii = 0; ii < usedObs.size(); ii++) {
+      const t_lc::type tLC = usedTypes[ii];
+      double res = fabs(vv[ii]);
+      if (res > OPT->maxRes(tLC)) {
+        if (res > fabs(maxOutlier)) {
+          maxOutlier      = vv[ii];
+          maxOutlierIndex = ii;
+          maxOutlierLC    = tLC;
+        }
+      }
+    }
+
+    // Mark outlier or break outlier detection loop
+    // --------------------------------------------
+    if (maxOutlierIndex > -1) {
+      t_satObs* obs = usedObs[maxOutlierIndex];
+      t_param* par = 0;
+      LOG << epoTimeStr << " Outlier " << t_lc::toString(maxOutlierLC) << ' ' 
+          << obs->prn().toString()                        << ' ' 
+          << setw(8) << setprecision(4) << maxOutlier << endl;
+      for (unsigned iPar = 0; iPar < params.size(); iPar++) {
+        t_param* hlp = params[iPar];
+        if (hlp->type() == t_param::amb && hlp->prn()  == obs->prn() && 
+            hlp->tLC()  == usedTypes[maxOutlierIndex]) {
+          par = hlp;
+        }
+      }
+      if (par) {
+        if (par->ambResetCandidate()) {
+          resetAmb(par->prn(), obsVector, &QSav, &xSav);
+        }
+        else {
+          par->setAmbResetCandidate();
+          obs->setOutlier();
+        }
+      }
+      else {
+        obs->setOutlier();
+      }
+    }
+
+    // Print Residuals
+    // ---------------
+    else {
+      for (unsigned jj = 0; jj < LCs.size(); jj++) {
+        for (unsigned ii = 0; ii < usedObs.size(); ii++) {
+          const t_lc::type tLC = usedTypes[ii];
+          t_satObs*        obs = usedObs[ii];
+          if (tLC == LCs[jj]) {
+            obs->setRes(tLC, vv[ii]);
+            LOG << epoTimeStr << " RES " 
+                << left << setw(3) << t_lc::toString(tLC) << right << ' ' 
+                << obs->prn().toString() << ' ' 
+                << setw(8) << setprecision(4) << vv[ii] << endl;
+          }
+        }
+      }
+      cmpDOP(LCs, AA);
+      break;
+    }
+  }
+
+  return success;
+}
+
+// Cycle-Slip Detection
+////////////////////////////////////////////////////////////////////////////
+t_irc t_filter::detectCycleSlips(const vector<t_lc::type>& LCs, 
+                                      const vector<t_satObs*>& obsVector) {
+
+  const double            SLIP       = 20.0;  // slip threshold
+  string                  epoTimeStr = string(_epoTime);
+  const vector<t_param*>& params     = _parlist->params();
+
+  for (unsigned ii = 0; ii < LCs.size(); ii++) {
+    const t_lc::type& tLC = LCs[ii];
+    if (t_lc::includesPhase(tLC)) {
+      for (unsigned iObs = 0; iObs < obsVector.size(); iObs++) {
+        const t_satObs* obs = obsVector[iObs];
+
+        // Check set Slips and Jump Counters 
+        // ---------------------------------
+        bool slip = false;
+
+        if (obs->slip()) {
+          LOG << "cycle slip set (obs)" << endl;;
+          slip = true;
+        }
+
+        if (_slips[obs->prn()]._obsSlipCounter != -1 &&
+            _slips[obs->prn()]._obsSlipCounter != obs->slipCounter()) {
+          LOG << "cycle slip set (obsSlipCounter)" << endl;
+          slip = true;
+        }
+        _slips[obs->prn()]._obsSlipCounter = obs->slipCounter();
+
+        if (_slips[obs->prn()]._biasJumpCounter != -1 &&
+            _slips[obs->prn()]._biasJumpCounter != obs->biasJumpCounter()) {
+          LOG << "cycle slip set (biasJumpCounter)" << endl;
+          slip = true;
+        }
+        _slips[obs->prn()]._biasJumpCounter = obs->biasJumpCounter();
+
+        // Slip Set
+        // --------  
+        if (slip) {
+          resetAmb(obs->prn(), obsVector);
+        }
+  
+        // Check Pre-Fit Residuals
+        // -----------------------
+        else {
+          ColumnVector AA(params.size());
+          for (unsigned iPar = 0; iPar < params.size(); iPar++) {
+            const t_param* par = params[iPar];
+            AA[iPar] = par->partial(_epoTime, obs, tLC);
+          }
+          
+          double ll = obs->obsValue(tLC) - obs->cmpValue(tLC) - DotProduct(_x0, AA);
+          double vv = DotProduct(AA, _xFlt) - ll;
+          
+          if (fabs(vv) > SLIP) {
+            LOG << epoTimeStr << " cycle slip detected " << t_lc::toString(tLC) << ' ' 
+                << obs->prn().toString() << ' ' << setw(8) << setprecision(4) << vv << endl;
+            resetAmb(obs->prn(), obsVector);
+          }
+        }
+      }
+    }
+  }
+
+  return success;
+}
+
+// Reset Ambiguity Parameter (cycle slip)
+////////////////////////////////////////////////////////////////////////////
+t_irc t_filter::resetAmb(t_prn prn, const vector<t_satObs*>& obsVector,
+                         SymmetricMatrix* QSav, ColumnVector* xSav) {
+  t_irc irc = failure;
+  vector<t_param*>& params = _parlist->params();
+  for (unsigned iPar = 0; iPar < params.size(); iPar++) {
+    t_param* par = params[iPar];
+    if (par->type() == t_param::amb && par->prn() == prn) {
+      int ind = par->indexNew();
+      t_lc::type tLC = par->tLC();
+      LOG << string(_epoTime) << " RESET " << par->toString() << endl;
+      delete par; par = new t_param(t_param::amb, prn, tLC, &obsVector);
+      par->setIndex(ind);
+      params[iPar] = par;
+      for (unsigned ii = 1; ii <= params.size(); ii++) {
+        _QFlt(ii, ind+1) = 0.0;
+        if (QSav) {
+          (*QSav)(ii, ind+1) = 0.0;
+        }
+      }
+      _QFlt(ind+1,ind+1) = par->sigma0() * par->sigma0();
+      if (QSav) {
+        (*QSav)(ind+1,ind+1) = _QFlt(ind+1,ind+1);
+      }
+      _xFlt[ind] = 0.0;
+      if (xSav) {
+        (*xSav)[ind] = _xFlt[ind];
+      }
+      _x0[ind] = par->x0();
+      irc = success;
+    }
+  }
+
+  return irc;
+}
+
+// Compute various DOP Values
+////////////////////////////////////////////////////////////////////////////
+void t_filter::cmpDOP(const std::vector<t_lc::type>& LCs, const Matrix& AA) {
+
+  _dop.reset();
+  _numSat = 0;
+  try {
+    _numSat = AA.Nrows() / LCs.size();
+    
+    if (_numSat < 4) {
+      return;
+    }
+    
+    Matrix BB(_numSat, 4);
+    
+    for (int ii = 1; ii <= _numSat; ii++) {
+      BB.Row(ii) = AA.Row(ii*LCs.size()).columns(1,4);
+    }
+    
+    SymmetricMatrix NN; NN << BB.t() * BB;  
+    SymmetricMatrix QQ = NN.i();
+    
+    _dop.P = sqrt(QQ(1,1) + QQ(2,2) + QQ(3,3));
+    _dop.T = sqrt(QQ(4,4));
+    _dop.G = sqrt(QQ(1,1) + QQ(2,2) + QQ(3,3) + QQ(4,4));
+  }
+  catch (...) {
+  }
+}
Index: /trunk/BNC/src/PPP/pppFilter.h
===================================================================
--- /trunk/BNC/src/PPP/pppFilter.h	(revision 5809)
+++ /trunk/BNC/src/PPP/pppFilter.h	(revision 5809)
@@ -0,0 +1,74 @@
+#ifndef FILTER_H
+#define FILTER_H
+
+#include <vector>
+#include <newmat.h>
+#include "ppp.h"
+#include "parlist.h"
+#include "bnctime.h"
+#include "t_prn.h"
+
+namespace BNC {
+
+class t_parlist;
+class t_obsPool;
+class t_satObs;
+
+class t_filter {
+ public:
+  t_filter();
+  ~t_filter();
+
+  t_irc processEpoch(t_obsPool* obsPool);
+
+  const ColumnVector&    x() const {return _xFlt;}
+  const SymmetricMatrix& Q() const {return _QFlt;}
+
+  int    numSat() const {return _numSat;}
+  double PDOP() const {return _dop.P;}
+  double GDOP() const {return _dop.G;}
+
+ private:
+  class t_slip {
+   public:
+    t_slip() {
+      _slip            = false;
+      _obsSlipCounter  = -1;
+      _biasJumpCounter = -1;
+    }
+    bool _slip;
+    int  _obsSlipCounter;
+    int  _biasJumpCounter;
+  };
+
+  class t_dop {
+   public:
+    t_dop() {reset();}
+    void reset() {P = T = G = 0.0;}
+    double P;
+    double T;
+    double G;
+  };
+  t_irc processLC(const std::vector<t_lc::type>& LCs, std::vector<t_satObs*>& obsVector);
+
+  t_irc detectCycleSlips(const std::vector<t_lc::type>& LCs, 
+                         const std::vector<t_satObs*>& obsVector);
+
+  t_irc resetAmb(t_prn prn, const std::vector<t_satObs*>& obsVector,
+                 SymmetricMatrix* QSav = 0, ColumnVector* xSav = 0);
+
+  void cmpDOP(const std::vector<t_lc::type>& LCs, const Matrix& AA);
+
+  bncTime         _epoTime;
+  t_parlist*      _parlist;
+  SymmetricMatrix _QFlt;
+  ColumnVector    _xFlt;
+  ColumnVector    _x0;
+  t_slip          _slips[t_prn::MAXPRN+1];
+  int             _numSat;
+  t_dop           _dop;
+};
+
+}
+
+#endif
Index: /trunk/BNC/src/PPP/pppInclude.h
===================================================================
--- /trunk/BNC/src/PPP/pppInclude.h	(revision 5809)
+++ /trunk/BNC/src/PPP/pppInclude.h	(revision 5809)
@@ -0,0 +1,160 @@
+#ifndef PPP_H
+#define PPP_H
+
+#include <string>
+#include <vector>
+
+#include "bncconst.h"
+#include "bnctime.h"
+#include "t_prn.h"
+
+namespace BNC {
+
+class pppExcept {
+ public:
+  pppExcept(const char* msg) {
+    _msg = msg;
+  }
+  ~pppExcept() {}
+  std::string what() {return _msg;}
+ private:
+  std::string _msg;
+};
+
+class t_output {
+ public:
+  bncTime      _epoTime;           
+  double       _xyzRover[3];  
+  double       _covMatrix[6]; 
+  int          _numSat;       
+  double       _pDop;         
+  std::string  _log;          
+  bool         _error;        
+};
+
+class t_pppObs  {
+ public:
+  t_pppObs() {
+    _code            = 0.0;          
+    _codeValid       = false;     
+    _phase           = 0.0;         
+    _phaseValid      = false;    
+    _doppler         = 0.0;       
+    _dopplerValid    = false;  
+    _snr             = 0.0;           
+    _snrValid        = false;      
+    _slip            = false;          
+    _slipCounter     = 0;   
+    _biasJumpCounter = 0;
+  }
+  std::string _rnxType2ch; 
+  double      _code;          
+  bool        _codeValid;     
+  double      _phase;         
+  bool        _phaseValid;    
+  double      _doppler;       
+  bool        _dopplerValid;  
+  double      _snr;           
+  bool        _snrValid;      
+  bool        _slip;          
+  int         _slipCounter;   
+  int         _biasJumpCounter;
+};
+
+class t_pppSatObs {
+ public:
+  t_pppSatObs() {}
+  ~t_pppSatObs() {for (unsigned ii = 0; ii < _obs.size(); ii++) delete _obs[ii];}
+  t_prn                  _prn;
+  bncTime                _time;
+  std::vector<t_pppObs*> _obs;
+};
+
+class t_orbCorr {
+ public:
+  t_prn          prn() const {return _prn;}
+  unsigned short IOD() const {return _iod;}
+  t_prn          _prn;
+  unsigned short _iod;
+  bncTime        _time;
+  char           _system;
+  double         _xr[3];
+  double         _dotXr[3];
+};
+
+class t_clkCorr {
+ public:
+  t_prn          prn() const {return _prn;}
+  unsigned short IOD() const {return _iod;}
+  t_prn          _prn;
+  unsigned short _iod;
+  bncTime        _time;
+  double         _dClk;
+  double         _dotDClk;
+  double         _dotDotDClk;
+  double         _clkPartial;
+};
+
+class t_bias {
+ public:
+  std::string _rnxType3ch;
+  double      _value;
+};
+
+class t_satBiases {
+ public:
+  t_prn               _prn;
+  bncTime             _time;
+  int                 _nx;
+  int                 _jumpCount;
+  std::vector<t_bias> _biases;
+};
+
+class t_frequency {
+ public:
+  enum type {dummy = 0, G1, G2, R1, R2, maxFr};
+
+  static std::string toString(type tt) {
+    if      (tt == G1) return "G1";
+    else if (tt == G2) return "G2";
+    else if (tt == R1) return "R1";
+    else if (tt == R2) return "R2";
+    return std::string();
+  }
+};
+
+class t_lc {
+ public:
+  enum type {dummy = 0, l1, l2, c1, c2, lIF, cIF, MW, CL, maxLc};
+
+  static bool need2ndFreq(type tt) {
+    if (tt == l2 || tt == c2 || tt == lIF || tt == cIF || tt == MW) return true;
+    return false;
+  }  
+
+  static bool includesPhase(type tt) {
+    if (tt == l1 || tt == l2 || tt == lIF || tt == MW || tt == CL) return true;
+    return false;
+  }
+
+  static bool includesCode(type tt) {
+    if (tt == c1 || tt == c2 || tt == cIF || tt == MW || tt == CL) return true;
+    return false;
+  }
+
+  static std::string toString(type tt) {
+    if      (tt == l1)  return "l1";
+    else if (tt == l2)  return "l2";
+    else if (tt == c1)  return "c1";
+    else if (tt == c2)  return "c2";
+    else if (tt == lIF) return "lIF";
+    else if (tt == cIF) return "cIF";
+    else if (tt == MW)  return "MW";
+    else if (tt == CL)  return "CL";
+    return std::string();
+  }
+};
+
+} // namespace BNC
+
+#endif
Index: /trunk/BNC/src/PPP/pppObsPool.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppObsPool.cpp	(revision 5809)
+++ /trunk/BNC/src/PPP/pppObsPool.cpp	(revision 5809)
@@ -0,0 +1,101 @@
+// 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_pppMain
+ *
+ * Purpose:    Buffer with observations
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    29-Jul-2014
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include "obspool.h"
+
+using namespace BNC;
+using namespace std;
+
+// Constructor
+/////////////////////////////////////////////////////////////////////////////
+t_obsPool::t_epoch::t_epoch(const bncTime& epoTime, vector<t_satObs*>& obsVector) {
+  _epoTime   = epoTime;
+  for (unsigned ii = 0; ii < obsVector.size(); ii++) {
+    _obsVector.push_back(obsVector[ii]);
+  }
+  obsVector.clear();
+}
+
+// Destructor
+/////////////////////////////////////////////////////////////////////////////
+t_obsPool::t_epoch::~t_epoch() {
+  for (unsigned ii = 0; ii < _obsVector.size(); ii++) {
+    delete _obsVector[ii];
+  }
+}
+
+// Constructor
+/////////////////////////////////////////////////////////////////////////////
+t_obsPool::t_obsPool() {
+  for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
+    _satBiases[ii] = 0;
+  }
+}
+
+// Destructor
+/////////////////////////////////////////////////////////////////////////////
+t_obsPool::~t_obsPool() {
+  for (unsigned ii = 0; ii <= t_prn::MAXPRN; ii++) {
+    delete _satBiases[ii];
+  }
+  while (_epochs.size() > 0) {
+    delete _epochs.front();
+    _epochs.pop_front();
+  }
+}
+
+//
+/////////////////////////////////////////////////////////////////////////////
+void t_obsPool::putBiases(t_satBias* satBias) {
+  int iPrn = satBias->prn().toInt();
+  delete _satBiases[iPrn];
+  _satBiases[iPrn] = satBias;
+}
+
+//
+/////////////////////////////////////////////////////////////////////////////
+void t_obsPool::putEpoch(const bncTime& epoTime, vector<t_satObs*>& obsVector) {
+  const unsigned MAXSIZE = 2;
+  _epochs.push_back(new t_epoch(epoTime, obsVector));
+  if (_epochs.size() > MAXSIZE) {
+    delete _epochs.front();
+    _epochs.pop_front();
+  }
+}
Index: /trunk/BNC/src/PPP/pppObsPool.h
===================================================================
--- /trunk/BNC/src/PPP/pppObsPool.h	(revision 5809)
+++ /trunk/BNC/src/PPP/pppObsPool.h	(revision 5809)
@@ -0,0 +1,52 @@
+#ifndef OBSPOOL_H
+#define OBSPOOL_H
+
+#include <vector>
+#include <deque>
+#include "satobs.h"
+#include "satbias.h"
+#include "bnctime.h"
+
+namespace BNC {
+
+class t_obsPool {
+ public: 
+
+  class t_epoch {
+   public:
+    t_epoch(const bncTime& epoTime, std::vector<t_satObs*>& obsVector);
+    ~t_epoch();
+    std::vector<t_satObs*>& obsVector() {return _obsVector;}
+    const std::vector<t_satObs*>& obsVector() const {return _obsVector;}
+    const bncTime& epoTime() const {return _epoTime;}
+   private:
+    bncTime                _epoTime;
+    std::vector<t_satObs*> _obsVector;
+  };
+
+  t_obsPool();
+  ~t_obsPool();
+  void putBiases(t_satBias* satBias);
+
+  void putEpoch(const bncTime& epoTime, std::vector<t_satObs*>& obsVector);
+
+  const t_satBias* satBias(const t_prn& prn) const {  
+    return _satBiases[prn.toInt()];
+  }
+  t_epoch* lastEpoch() {
+    if (_epochs.size()) {
+      return _epochs.back();
+    }
+    else {
+      return 0;
+    }
+  }
+
+ private:
+  t_satBias*           _satBiases[t_prn::MAXPRN+1];
+  std::deque<t_epoch*> _epochs;
+};
+
+}
+
+#endif
Index: /trunk/BNC/src/PPP/pppOptions.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppOptions.cpp	(revision 5809)
+++ /trunk/BNC/src/PPP/pppOptions.cpp	(revision 5809)
@@ -0,0 +1,135 @@
+// 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_options
+ *
+ * Purpose:    Options for PPP client
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    29-Jul-2014
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include <newmatio.h>
+#include "options.h"
+
+using namespace BNC;
+using namespace std;
+
+// Constructor
+//////////////////////////////////////////////////////////////////////////////
+t_options::t_options() {
+  _xyzAprRover.ReSize(3); _xyzAprRover = 0.0;
+  _ellAprRover.ReSize(3); _ellAprRover = 0.0;
+  _neuEccRover.ReSize(3); _neuEccRover = 0.0;
+}
+
+// Destructor
+//////////////////////////////////////////////////////////////////////////////
+t_options::~t_options() {
+}
+
+// 
+//////////////////////////////////////////////////////////////////////////////
+bool t_options::dualFreqRequired() const {
+  return true;
+}
+
+// 
+//////////////////////////////////////////////////////////////////////////////
+bool t_options::biasRequired() const {
+  return false;
+}
+
+// 
+//////////////////////////////////////////////////////////////////////////////
+bool t_options::corrRequired() const {
+  return false;
+}
+
+// 
+//////////////////////////////////////////////////////////////////////////////
+bool t_options::useGlonass() const  {
+  return (_lcGLONASS.size() > 0);
+}
+
+// 
+//////////////////////////////////////////////////////////////////////////////
+bool t_options::xyzAprRoverSet() const {
+  return (_xyzAprRover[0] != 0.0 || _xyzAprRover[1] != 0.0 || _xyzAprRover[2] != 0.0);
+}
+
+// 
+//////////////////////////////////////////////////////////////////////////////
+bool t_options::estTropo() const  {
+  return (_sigTropo > 0.0 || _noiseTropo > 0.0);
+}
+
+// 
+//////////////////////////////////////////////////////////////////////////////
+vector<t_lc::type> t_options::LCs() const {
+
+  vector<t_lc::type> allLCs = _lcGPS;
+
+  for (unsigned ii = 0; ii < _lcGLONASS.size(); ii++) {
+    bool found = false;
+    for (unsigned iAll = 0; iAll < allLCs.size(); iAll++) {
+      if (allLCs[iAll] == _lcGLONASS[ii]) {
+        found = true;
+        break;
+      }
+    }
+    if (!found) {
+      allLCs.push_back(_lcGLONASS[ii]);
+    }
+  }
+
+  for (unsigned ii = 0; ii < _lcGalileo.size(); ii++) {
+    bool found = false;
+    for (unsigned iAll = 0; iAll < allLCs.size(); iAll++) {
+      if (allLCs[iAll] == _lcGalileo[ii]) {
+        found = true;
+        break;
+      }
+    }
+    if (!found) {
+      allLCs.push_back(_lcGalileo[ii]);
+    }
+  }
+
+  return allLCs;  
+}
+
+// 
+//////////////////////////////////////////////////////////////////////////////
+double t_options::maxRes(t_lc::type /* tLC */) const {
+  return _maxResC1;
+}
Index: /trunk/BNC/src/PPP/pppOptions.h
===================================================================
--- /trunk/BNC/src/PPP/pppOptions.h	(revision 5809)
+++ /trunk/BNC/src/PPP/pppOptions.h	(revision 5809)
@@ -0,0 +1,66 @@
+#ifndef OPTIONS_H
+#define OPTIONS_H
+
+#include <string>
+#include <vector>
+#include <newmat.h>
+#include "ppp.h"
+
+namespace BNC {
+
+class t_options {
+ public:
+  class t_optBias {
+   public:
+    t_optBias(char system, t_lc::type tLC) : _system(system), _tLC(tLC) {}
+    char       _system;
+    t_lc::type _tLC;
+  };
+
+  t_options();
+  ~t_options();
+  bool dualFreqRequired() const;
+  bool biasRequired() const;
+  bool corrRequired() const;
+  bool useGlonass() const ;
+  bool xyzAprRoverSet() const;
+  bool estTropo() const ; 
+  std::vector<t_lc::type> LCs() const;
+  double maxRes(t_lc::type tLC) const;
+
+  bool         _realTime;
+  std::string  _roverName;     
+  std::string  _crdFile;
+  std::string  _antexFile;
+  std::string  _corrMount;
+  std::string  _rinexObs;
+  std::string  _rinexNav;
+  std::string  _corrFile;
+
+  double       _sigCrd[3];
+  double       _noiseCrd[3];
+  double       _sigTropo;
+  double       _noiseTropo;
+  double       _sigmaC1;
+  double       _sigmaL1;
+  double       _corrWaitTime;
+  std::vector<t_lc::type> _lcGPS;
+  std::vector<t_lc::type> _lcGLONASS;
+  std::vector<t_lc::type> _lcGalileo;
+  std::vector<t_optBias>  _estBias;
+
+  ColumnVector _xyzAprRover;
+  ColumnVector _ellAprRover;
+  ColumnVector _neuEccRover;
+  std::string  _antNameRover;  
+  int          _minObs;
+  double       _minEle;
+  double       _maxResC1;
+  double       _maxResL1;
+  bool         _eleWgtCode;
+  bool         _eleWgtPhase;
+};
+
+}
+
+#endif
Index: /trunk/BNC/src/PPP/pppParlist.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppParlist.cpp	(revision 5809)
+++ /trunk/BNC/src/PPP/pppParlist.cpp	(revision 5809)
@@ -0,0 +1,420 @@
+#include <cmath>
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+#include <algorithm>
+#include <newmatio.h>
+#include "parlist.h"
+#include "satobs.h"
+
+#include "station.h"
+#include "bncutils.h"
+#include "bncconst.h"
+#include "pppClient.h"
+
+using namespace BNC;
+using namespace std;
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+t_param::t_param(e_type type, const t_prn& prn, t_lc::type tLC,
+                 const vector<t_satObs*>* obsVector) {
+
+  _type     = type;
+  _prn      = prn;
+  _tLC      = tLC;
+  _x0       = 0.0;
+  _indexOld = -1;
+  _indexNew = -1;
+  _noise    = 0.0;
+  _ambInfo  = 0;
+
+  switch (_type) {
+   case crdX:
+     _epoSpec = true;
+     _sigma0  = OPT->_sigCrd[0];
+     break;
+   case crdY:
+     _epoSpec = true;
+     _sigma0  = OPT->_sigCrd[1];
+     break;
+   case crdZ:
+     _epoSpec = true;
+     _sigma0  = OPT->_sigCrd[2];
+     break;
+   case clkR:
+     _epoSpec = true;
+     _sigma0  = 1000.0;
+     break;
+   case amb:
+     _ambInfo = new t_ambInfo();
+     if (obsVector) {
+       for (unsigned ii = 0; ii < obsVector->size(); ii++) {
+         const t_satObs* obs = obsVector->at(ii);
+         if (obs->prn() == _prn) {
+           double offGG = 0;
+           if (_prn.system() == 'R' && tLC != t_lc::MW) {
+             offGG = PPP_CLIENT->offGG();
+           }
+           _x0 = floor((obs->obsValue(tLC) - offGG - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5);
+           break;
+         }
+       }
+     }
+     _epoSpec = false;
+     _sigma0  = 100.0;
+     break;
+   case offGG:
+     _epoSpec = true;
+     _sigma0  = 1000.0;
+     _x0      = PPP_CLIENT->offGG();
+     break;
+   case trp:
+     _epoSpec = false;
+     _sigma0  = OPT->_sigTropo;
+     _noise   = OPT->_noiseTropo;
+     break;
+   case bias:
+     _epoSpec = true;
+     _sigma0  = 10.0;
+     break;
+  }
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+t_param::~t_param() {
+  delete _ambInfo;
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+double t_param::partial(const bncTime& /* epoTime */, const t_satObs* obs, 
+                        const t_lc::type& tLC) const {
+
+  // Special Case - Melbourne-Wuebbena
+  // ---------------------------------
+  if (tLC == t_lc::MW && _type != amb && _type != bias) {
+    return 0.0;
+  }
+
+  const t_station* sta  = PPP_CLIENT->staRover();
+  ColumnVector     rhoV = sta->xyzApr() - obs->xc().Rows(1,3);
+
+  switch (_type) {
+  case crdX:
+    return (sta->xyzApr()[0] - obs->xc()[0]) / rhoV.norm_Frobenius();
+  case crdY:
+    return (sta->xyzApr()[1] - obs->xc()[1]) / rhoV.norm_Frobenius();
+  case crdZ:
+    return (sta->xyzApr()[2] - obs->xc()[2]) / rhoV.norm_Frobenius();
+  case clkR:
+    return 1.0;
+  case offGG:
+    return (obs->prn().system() == 'R') ? 1.0 : 0.0;
+  case amb:
+    if (obs->prn() == _prn) {
+      if      (tLC == _tLC) {
+        return (obs->lambda(tLC));
+      }
+      else if (tLC == t_lc::lIF && _tLC == t_lc::MW) {
+        return obs->lambda(t_lc::lIF) * obs->lambda(t_lc::MW) / obs->lambda(t_lc::l2);
+      }
+      else {
+        ColumnVector coeff(4);
+        obs->lc(tLC, 0.0, 0.0, 0.0, 0.0, &coeff);
+        if      (_tLC == t_lc::l1) {
+          return obs->lambda(t_lc::l1) * coeff(1); 
+        }
+        else if (_tLC == t_lc::l2) {
+          return obs->lambda(t_lc::l2) * coeff(2); 
+        }
+      }
+    }
+    return 0.0;
+  case trp:
+    return 1.0 / sin(obs->eleSat()); 
+  case bias:
+    if (tLC == _tLC && obs->prn().system() == _prn.system()) {
+      return 1.0;
+    }
+    else {
+      return 0.0;
+    }
+  }
+
+  return 0.0;
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+string t_param::toString() const {
+  stringstream ss;
+  switch (_type) {
+  case crdX:
+    ss << "CRD_X";
+    break; 
+  case crdY:
+    ss << "CRD_Y";
+    break;
+  case crdZ:
+    ss << "CRD_Z";
+    break;
+  case clkR:
+    ss << "CLK        ";
+    break;
+  case amb:
+    ss << "AMB " << left << setw(3) << t_lc::toString(_tLC) << right << ' ' << _prn.toString();
+    break;
+  case offGG:
+    ss << "OGG        ";
+    break;
+  case trp:
+    ss << "TRP        ";
+    break;
+  case bias:
+    ss << "BIAS " << _prn.system() << ' ' << left << setw(3) << t_lc::toString(_tLC);
+    break;
+  }
+  return ss.str();
+}
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+t_parlist::t_parlist() {
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+t_parlist::~t_parlist() {
+  for (unsigned ii = 0; ii < _params.size(); ii++) {
+    delete _params[ii];
+  }
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+t_irc t_parlist::set(const bncTime& epoTime, const vector<t_lc::type>& ambLCs, 
+                     const vector<t_satObs*>& obsVector) {
+
+  // Remove some Parameters
+  // ----------------------
+  vector<t_param*>::iterator it = _params.begin();
+  while (it != _params.end()) {
+    t_param* par = *it;
+
+    bool remove = false;
+
+    if      (par->epoSpec()) {  
+      remove = true;
+    }
+
+    else if (par->type() == t_param::amb) {
+      if (par->lastObsTime().valid() && (epoTime - par->lastObsTime() > 120.0)) {
+        remove = true;
+      }
+    }
+
+    else if (par->type() == t_param::amb) {
+      if (par->lastObsTime().valid() && (epoTime - par->lastObsTime() > 3600.0)) {
+        remove = true;
+      }
+    }
+
+    if (remove) {
+      delete par;
+      it = _params.erase(it);
+    }
+    else {
+      ++it;
+    }
+  }
+
+  // Check whether parameters have observations
+  // ------------------------------------------
+  for (unsigned ii = 0; ii < _params.size(); ii++) {
+    t_param* par = _params[ii];
+    if (par->prn() == 0) {
+      par->setLastObsTime(epoTime);
+      if (par->firstObsTime().undef()) {
+        par->setFirstObsTime(epoTime);
+      }
+    }
+    else {
+      for (unsigned jj = 0; jj < obsVector.size(); jj++) {
+        const t_satObs* satObs = obsVector[jj];
+        if (satObs->prn() == par->prn()) {
+          par->setLastObsTime(epoTime);
+          if (par->firstObsTime().undef()) {
+            par->setFirstObsTime(epoTime);
+          }
+          break;
+        }
+      }
+    }
+  } 
+
+  // Required Set of Parameters
+  // --------------------------
+  vector<t_param*> required;
+
+  // Coordinates
+  // -----------
+  required.push_back(new t_param(t_param::crdX, t_prn(), t_lc::dummy));
+  required.push_back(new t_param(t_param::crdY, t_prn(), t_lc::dummy));
+  required.push_back(new t_param(t_param::crdZ, t_prn(), t_lc::dummy));
+
+  // Receiver Clock
+  // --------------
+  required.push_back(new t_param(t_param::clkR, t_prn(), t_lc::dummy));
+
+  // GPS-Glonass Clock Offset
+  // ------------------------
+  if (OPT->useGlonass()) {
+    required.push_back(new t_param(t_param::offGG, t_prn(), t_lc::dummy));
+  }
+
+  // Receiver Biases
+  // ---------------
+  for (unsigned ii = 0; ii < OPT->_estBias.size(); ii++) {
+    const t_options::t_optBias& optBias = OPT->_estBias[ii];
+    required.push_back(new t_param(t_param::bias, t_prn(optBias._system, 1), optBias._tLC));
+  }
+
+  // Troposphere
+  // -----------
+  if (OPT->estTropo()) {
+    required.push_back(new t_param(t_param::trp, t_prn(), t_lc::dummy));
+  }
+
+  // Ambiguities
+  // -----------
+  for (unsigned ii = 0; ii < ambLCs.size(); ii++) {
+    const t_lc::type& tLC = ambLCs[ii];
+    for (unsigned jj = 0; jj < obsVector.size(); jj++) {
+      const t_satObs* satObs = obsVector[jj];
+      required.push_back(new t_param(t_param::amb, satObs->prn(), tLC, &obsVector));
+    }
+  }
+
+  // Check if all required parameters are present
+  // --------------------------------------------
+  for (unsigned ii = 0; ii < required.size(); ii++) {
+    t_param* parReq = required[ii];
+
+    bool found = false;
+    for (unsigned jj = 0; jj < _params.size(); jj++) {
+      t_param* parOld = _params[jj];
+      if (parOld->isEqual(parReq)) {
+        found = true;
+        break;
+      }
+    }
+    if (found) {
+      delete parReq;
+    }
+    else {
+      _params.push_back(parReq);
+    }
+  }
+
+  // Set Parameter Indices
+  // ---------------------
+  sort(_params.begin(), _params.end(), t_param::sortFunction);
+
+  for (unsigned ii = 0; ii < _params.size(); ii++) {
+    t_param* par = _params[ii];
+    par->setIndex(ii);
+    for (unsigned jj = 0; jj < obsVector.size(); jj++) {
+      const t_satObs* satObs = obsVector[jj];
+      if (satObs->prn() == par->prn()) {
+        par->setAmbEleSat(satObs->eleSat());
+        par->stepAmbNumEpo();
+      }
+    }
+  }
+
+  return success;
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_parlist::printResult(const bncTime& epoTime, const SymmetricMatrix& QQ,
+                            const ColumnVector& xx, double ambFixRate) const {
+
+  string epoTimeStr = string(epoTime);
+
+  LOG << endl;
+
+  t_param* parX = 0;
+  t_param* parY = 0;
+  t_param* parZ = 0;
+  for (unsigned ii = 0; ii < _params.size(); ii++) {
+    t_param* par = _params[ii];
+    if      (par->type() == t_param::crdX) {
+      parX = par;
+    }
+    else if (par->type() == t_param::crdY) {
+      parY = par;
+    }
+    else if (par->type() == t_param::crdZ) {
+      parZ = par;
+    }
+    else {
+      int ind = par->indexNew();
+      LOG << epoTimeStr << ' ' << par->toString() << ' '
+          << setw(10) << setprecision(4) << par->x0() << ' '
+          << showpos << setw(10) << setprecision(4) << xx[ind] << noshowpos << " +- "
+          << setw(8)  << setprecision(4) << sqrt(QQ[ind][ind]);
+      if (par->type() == t_param::amb) {
+        LOG << " el = " << setw(6) << setprecision(2) << par->ambEleSat() * 180.0 / M_PI
+            << " epo = " << setw(4) << par->ambNumEpo();
+      }
+      LOG << endl;
+    }
+  }
+  
+  if (parX && parY && parZ) {
+    const t_station* sta = PPP_CLIENT->staRover();
+
+    ColumnVector xyz(3);
+    xyz[0] = xx[parX->indexNew()];
+    xyz[1] = xx[parY->indexNew()];
+    xyz[2] = xx[parZ->indexNew()];
+
+    ColumnVector neu(3);
+    xyz2neu(sta->ellApr().data(), xyz.data(), neu.data());
+
+    SymmetricMatrix QQxyz = QQ.SymSubMatrix(1,3);
+
+    SymmetricMatrix QQneu(3);
+    covariXYZ_NEU(QQxyz, sta->ellApr().data(), QQneu);
+
+    LOG << epoTimeStr
+        << " X = " << setprecision(4) << sta->xyzApr()[0] + xyz[0] << " +- "
+        << setprecision(4) << sqrt(QQxyz[0][0])
+                                   
+        << " Y = " << setprecision(4) << sta->xyzApr()[1] + xyz[1] << " +- "
+        << setprecision(4) << sqrt(QQxyz[1][1])
+
+        << " Z = " << setprecision(4) << sta->xyzApr()[2] + xyz[2] << " +- "
+        << setprecision(4) << sqrt(QQxyz[2][2])
+
+        << " dN = " << setprecision(4) << neu[0] << " +- "
+        << setprecision(4) << sqrt(QQneu[0][0])
+
+        << " dE = " << setprecision(4) << neu[1] << " +- "
+        << setprecision(4) << sqrt(QQneu[1][1])
+
+        << " dU = " << setprecision(4) << neu[2] << " +- "
+        << setprecision(4) << sqrt(QQneu[2][2]);
+    if (ambFixRate > 0.0) {
+      LOG << " fix "; 
+    }
+    else {
+      LOG << " flt "; 
+    }
+    LOG << int(100*ambFixRate) << " %\n";
+  }
+}
+
Index: /trunk/BNC/src/PPP/pppParlist.h
===================================================================
--- /trunk/BNC/src/PPP/pppParlist.h	(revision 5809)
+++ /trunk/BNC/src/PPP/pppParlist.h	(revision 5809)
@@ -0,0 +1,113 @@
+#ifndef PARLIST_H
+#define PARLIST_H
+
+#include <vector>
+#include <string>
+#include "ppp.h"
+#include "t_prn.h"
+#include "bnctime.h"
+
+namespace BNC {
+
+class t_satObs;
+
+class t_param {
+ public:
+  enum e_type {crdX, crdY, crdZ, clkR, amb, offGG, trp, bias};
+
+  t_param(e_type type, const t_prn& prn, t_lc::type tLC,
+          const std::vector<t_satObs*>* obsVector = 0);
+
+  ~t_param();
+  e_type type() const {return _type;}
+  double x0()  const {return _x0;}
+  double partial(const bncTime& epoTime, const t_satObs* obs, 
+                 const t_lc::type& tLC) const;
+  bool   epoSpec() const {return _epoSpec;}
+  bool   isEqual(const t_param* par2) const {
+    return (_type == par2->_type && _prn == par2->_prn && _tLC == par2->_tLC);
+  }
+  void   setIndex(int indexNew) {
+    _indexOld = _indexNew;
+    _indexNew = indexNew;
+  }
+  int indexOld() const {return _indexOld;}
+  int indexNew() const {return _indexNew;}
+  double sigma0() const {return _sigma0;}
+  double noise() const {return _noise;}
+  t_lc::type tLC() const {return _tLC;}
+  t_prn prn() const {return _prn;}
+  std::string toString() const;
+
+  const bncTime& lastObsTime() const {return _lastObsTime;}
+  void setLastObsTime(const bncTime& epoTime) {_lastObsTime = epoTime;}
+  const bncTime& firstObsTime() const {return _firstObsTime;}
+  void setFirstObsTime(const bncTime& epoTime) {_firstObsTime = epoTime;}
+
+  bool     ambResetCandidate() const   {return _ambInfo && _ambInfo->_resetCandidate;}
+  void     setAmbResetCandidate()      {if (_ambInfo) _ambInfo->_resetCandidate = true;}
+  double   ambEleSat() const           {return _ambInfo ? _ambInfo->_eleSat : 0.0;}
+  void     setAmbEleSat(double eleSat) {if (_ambInfo) _ambInfo->_eleSat = eleSat;}
+  unsigned ambNumEpo() const           {return _ambInfo ? _ambInfo->_numEpo : 0;}
+  void     stepAmbNumEpo()             {if (_ambInfo) _ambInfo->_numEpo += 1;}
+
+  static bool sortFunction(const t_param* p1, const t_param* p2) {
+    if      (p1->_type != p2->_type) {
+      return p1->_type < p2->_type;
+    }
+    else if (p1->_tLC != p2->_tLC) {
+      return p1->_tLC < p2->_tLC;
+    }
+    else if (p1->_prn != p2->_prn) {
+      return p1->_prn < p2->_prn;
+    }
+    return false;
+  }
+
+ private:
+  class t_ambInfo {
+   public:
+    t_ambInfo() {
+      _resetCandidate = false;
+      _eleSat         = 0.0;
+      _numEpo         = 0;
+    }
+    ~t_ambInfo() {}
+    bool     _resetCandidate;
+    double   _eleSat;
+    unsigned _numEpo;
+  };
+  e_type     _type;
+  t_prn      _prn;
+  t_lc::type _tLC;
+  double     _x0;
+  bool       _epoSpec;
+  int        _indexOld;
+  int        _indexNew;
+  double     _sigma0;
+  double     _noise;
+  t_ambInfo* _ambInfo;
+  bncTime    _lastObsTime;
+  bncTime    _firstObsTime;
+};
+
+class t_parlist {
+ public:
+  t_parlist();
+  ~t_parlist();
+
+  t_irc set(const bncTime& epoTime, const std::vector<t_lc::type>& ambLCs,
+            const std::vector<t_satObs*>& obsVector);
+
+  unsigned nPar() const {return _params.size();}
+  const std::vector<t_param*>& params() const {return _params;}
+  std::vector<t_param*>& params() {return _params;}
+  void printResult(const bncTime& epoTime, const SymmetricMatrix& QQ, 
+                   const ColumnVector& xx, double ambFixRate) const;
+ private:
+  std::vector<t_param*> _params;
+};
+
+}
+
+#endif
Index: /trunk/BNC/src/PPP/pppSatBias.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppSatBias.cpp	(revision 5809)
+++ /trunk/BNC/src/PPP/pppSatBias.cpp	(revision 5809)
@@ -0,0 +1,58 @@
+// 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_pppMain
+ *
+ * Purpose:    Satellite-specific biases
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    29-Jul-2014
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include "satbias.h"
+
+using namespace BNC;
+using namespace std;
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+t_satBias::t_satBias(const t_satBiases& satBiases) {
+  _prn        = satBiases._prn;
+  _time       = satBiases._time;
+  _nx         = satBiases._nx;
+  _jumpCount  = satBiases._jumpCount;
+  for (unsigned ii = 0; ii < satBiases._biases.size(); ii++) { 
+    const t_bias& bias = satBiases._biases[ii];
+    t_biasType biasType   = string(bias._rnxType3ch).substr(0,3);
+    _biases[biasType]     = bias._value;
+  }
+}
Index: /trunk/BNC/src/PPP/pppSatBias.h
===================================================================
--- /trunk/BNC/src/PPP/pppSatBias.h	(revision 5809)
+++ /trunk/BNC/src/PPP/pppSatBias.h	(revision 5809)
@@ -0,0 +1,30 @@
+#ifndef SATBIAS_H
+#define SATBIAS_H
+
+#include <map>
+#include "ppp.h"
+#include "bnctime.h"
+
+namespace BNC {
+
+typedef std::string t_biasType;
+
+class t_satBias {
+ public:
+  t_satBias(const t_satBiases& satBiases);
+  ~t_satBias() {}
+  const t_prn& prn() const {return _prn;}
+  const std::map<t_biasType, double>& biases() const {return _biases;}
+  int nx() const {return _nx;}
+  int jumpCount() const {return _jumpCount;}
+ private:
+  t_prn                        _prn;
+  bncTime                      _time;
+  int                          _nx;
+  int                          _jumpCount;
+  std::map<t_biasType, double> _biases;
+};
+
+} 
+
+#endif
Index: /trunk/BNC/src/PPP/pppStation.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppStation.cpp	(revision 5809)
+++ /trunk/BNC/src/PPP/pppStation.cpp	(revision 5809)
@@ -0,0 +1,82 @@
+// 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_station
+ *
+ * Purpose:    Processed station
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    29-Jul-2014
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include "station.h"
+#include "bncutils.h"
+#include "pppModel.h"
+
+using namespace BNC;
+using namespace std;
+
+// Constructor
+//////////////////////////////////////////////////////////////////////////////
+t_station::t_station() {
+  _windUp    = new t_windUp();
+}
+
+// Destructor
+//////////////////////////////////////////////////////////////////////////////
+t_station::~t_station() {
+  delete _windUp;
+}
+
+// 
+//////////////////////////////////////////////////////////////////////////////
+void t_station::setXyzApr(const ColumnVector& xyzApr) {
+  _xyzApr = xyzApr;
+  _ellApr.ReSize(3);
+  xyz2ell(_xyzApr.data(), _ellApr.data());
+}
+
+// 
+//////////////////////////////////////////////////////////////////////////////
+void t_station::setNeuEcc(const ColumnVector& neuEcc) {
+  _neuEcc = neuEcc;
+  _xyzEcc.ReSize(3);
+  neu2xyz(_ellApr.data(), _neuEcc.data(), _xyzEcc.data());
+}
+
+// 
+//////////////////////////////////////////////////////////////////////////////
+double t_station::windUp(const bncTime& time, t_prn prn, 
+                         const ColumnVector& rSat) const {
+  return _windUp->value(time, _xyzApr, prn, rSat);
+}
+
Index: /trunk/BNC/src/PPP/pppStation.h
===================================================================
--- /trunk/BNC/src/PPP/pppStation.h	(revision 5809)
+++ /trunk/BNC/src/PPP/pppStation.h	(revision 5809)
@@ -0,0 +1,49 @@
+#ifndef STATION_H
+#define STATION_H
+
+#include <string>
+#include <newmat.h>
+#include "ppp.h"
+#include "bnctime.h"
+
+namespace BNC {
+
+class t_windUp;
+
+class t_station {
+ public:
+  t_station();
+  ~t_station();
+  void setName(std::string name) {_name = name;}
+  void setAntName(std::string antName) {_antName = antName;}
+  void setXyzApr(const ColumnVector& xyzApr);
+  void setNeuEcc(const ColumnVector& neuEcc);
+  void setDClk(double dClk) {_dClk = dClk;}
+  void setTideDspl(const ColumnVector& tideDspl) {_tideDspl = tideDspl;}
+  const std::string&  name()      const {return _name;}
+  const std::string&  antName()   const {return _antName;}
+  const ColumnVector& xyzApr()    const {return _xyzApr;}
+  const ColumnVector& ellApr()    const {return _ellApr;}
+  const ColumnVector& neuEcc()    const {return _neuEcc;}
+  const ColumnVector& xyzEcc()    const {return _xyzEcc;}
+  const ColumnVector& tideDspl()  const {return _tideDspl;}
+  double dClk() const {return _dClk;}
+  double windUp(const bncTime& time, t_prn prn, const ColumnVector& rSat) const;
+
+ private:
+  std::string       _name;
+  std::string       _antName;
+  ColumnVector      _xyzApr;
+  ColumnVector      _ellApr;
+  ColumnVector      _neuEcc;
+  ColumnVector      _xyzEcc;
+  ColumnVector      _tideDspl;
+  double            _dClk;
+  mutable t_windUp* _windUp;
+  bncTime           _timeCheck;
+  ColumnVector      _xyzCheck;
+};
+
+}
+
+#endif
Index: /trunk/BNC/src/PPP/pppWidgets.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppWidgets.cpp	(revision 5809)
+++ /trunk/BNC/src/PPP/pppWidgets.cpp	(revision 5809)
@@ -0,0 +1,278 @@
+// 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_pppWidgets
+ *
+ * Purpose:    This class stores widgets for PPP options
+ *
+ * Author:     L. Mervart
+ *
+ * Created:    29-Jul-2014
+ *
+ * Changes:    
+ *
+ * -----------------------------------------------------------------------*/
+
+#include <iostream>
+
+#include "PPP/pppwidgets.h"
+#include "qtfilechooser.h"
+#include "bncsettings.h"
+
+using namespace std;
+
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+t_pppWidgets::t_pppWidgets() {
+
+  _dataSource   = new QComboBox();     _dataSource  ->setObjectName("PPP/dataSource");   _widgets << _dataSource;  
+  _rinexObs     = new qtFileChooser(); _rinexObs    ->setObjectName("PPP/rinexObs");     _widgets << _rinexObs;    
+  _rinexNav     = new qtFileChooser(); _rinexNav    ->setObjectName("PPP/rinexNav");     _widgets << _rinexNav;    
+  _corrMount    = new QLineEdit();     _corrMount   ->setObjectName("PPP/corrMount");    _widgets << _corrMount;
+  _corrFile     = new qtFileChooser(); _corrFile    ->setObjectName("PPP/corrFile");     _widgets << _corrFile;    
+  _crdFile      = new qtFileChooser(); _crdFile     ->setObjectName("PPP/crdFile");      _widgets << _crdFile;     
+  _antexFile    = new qtFileChooser(); _antexFile   ->setObjectName("PPP/antexFile");    _widgets << _antexFile;   
+  _logFile      = new QLineEdit();     _logFile     ->setObjectName("PPP/logFile");      _widgets << _logFile;     
+  _nmeaFile     = new QLineEdit();     _nmeaFile    ->setObjectName("PPP/nmeaFile");     _widgets << _nmeaFile;    
+  _nmeaPort     = new QLineEdit();     _nmeaPort    ->setObjectName("PPP/nmeaPort");     _widgets << _nmeaPort;    
+  _staTable     = new QTableWidget();  _staTable    ->setObjectName("PPP/staTable");     _widgets << _staTable;    
+  _lcGPS        = new QComboBox();     _lcGPS       ->setObjectName("PPP/lcGPS");        _widgets << _lcGPS;       
+  _lcGLONASS    = new QComboBox();     _lcGLONASS   ->setObjectName("PPP/lcGLONASS");    _widgets << _lcGLONASS;   
+  _lcGalileo    = new QComboBox();     _lcGalileo   ->setObjectName("PPP/lcGalileo");    _widgets << _lcGalileo;   
+  _sigmaC1      = new QLineEdit();     _sigmaC1     ->setObjectName("PPP/sigmaC1");      _widgets << _sigmaC1;     
+  _sigmaL1      = new QLineEdit();     _sigmaL1     ->setObjectName("PPP/sigmaL1");      _widgets << _sigmaL1;     
+  _corrWaitTime = new QSpinBox();      _corrWaitTime->setObjectName("PPP/corrWaitTime"); _widgets << _corrWaitTime;
+  _addStaButton = new QPushButton("Add Station");                                        _widgets << _addStaButton;
+  _delStaButton = new QPushButton("Delete Station");                                     _widgets << _delStaButton;
+  
+  _dataSource->setEditable(false);
+  _dataSource->addItems(QString("no,Real-Time Streams,RINEX Files").split(","));
+  connect(_dataSource, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
+
+  _lcGPS->setEditable(false);
+  _lcGPS->addItems(QString("no,P3,L3,P3&L3").split(","));
+
+  _lcGLONASS->setEditable(false);
+  _lcGLONASS->addItems(QString("no,P3,L3,P3&L3").split(","));
+
+  _lcGalileo->setEditable(false);
+  _lcGalileo->addItems(QString("no,P3,L3,P3&L3").split(","));
+
+  _corrWaitTime->setMinimum(0);
+  _corrWaitTime->setMaximum(20);
+  _corrWaitTime->setSingleStep(1);
+  _corrWaitTime->setSuffix(" sec");
+  _corrWaitTime->setSpecialValueText("no");
+
+  _staTable->setColumnCount(9);
+  _staTable->setRowCount(0);
+  _staTable->setHorizontalHeaderLabels(
+     QString("Station,Sigma N,Sigma E,Sigma H,Noise N,Noise E,Noise H,Tropo Sigma,Tropo Noise").split(","));
+  _staTable->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  _staTable->setSelectionBehavior(QAbstractItemView::SelectRows);
+  _staTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
+  /// _staTable->horizontalHeader()->setStretchLastSection(true);
+  _staTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);
+  
+  connect(_addStaButton, SIGNAL(clicked()), this, SLOT(slotAddStation()));
+  connect(_delStaButton, SIGNAL(clicked()), this, SLOT(slotDelStation()));
+
+  readOptions();
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_pppWidgets::readOptions() {
+
+  bncSettings settings;
+
+  // ComboBoxes
+  // ----------
+  int ii = _dataSource->findText(settings.value(_dataSource->objectName()).toString());
+  if (ii != -1) {
+    _dataSource->setCurrentIndex(ii);
+  }
+  ii = _lcGPS->findText(settings.value(_lcGPS->objectName()).toString());
+  if (ii != -1) {
+    _lcGPS->setCurrentIndex(ii);
+  }
+  ii = _lcGLONASS->findText(settings.value(_lcGLONASS->objectName()).toString());
+  if (ii != -1) {
+    _lcGLONASS->setCurrentIndex(ii);
+  }
+  ii = _lcGalileo->findText(settings.value(_lcGalileo->objectName()).toString());
+  if (ii != -1) {
+    _lcGalileo->setCurrentIndex(ii);
+  }
+
+  // FileChoosers
+  // ------------
+  _rinexObs ->setFileName(settings.value(_rinexObs ->objectName()).toString());
+  _rinexNav ->setFileName(settings.value(_rinexNav ->objectName()).toString());
+  _corrFile ->setFileName(settings.value(_corrFile ->objectName()).toString());
+  _crdFile  ->setFileName(settings.value(_crdFile  ->objectName()).toString());
+  _antexFile->setFileName(settings.value(_antexFile->objectName()).toString());
+
+  // LineEdits
+  // ---------
+  _corrMount->setText(settings.value(_corrMount->objectName()).toString());
+  _logFile  ->setText(settings.value(_logFile  ->objectName()).toString());
+  _nmeaFile ->setText(settings.value(_nmeaFile ->objectName()).toString());
+  _nmeaPort ->setText(settings.value(_nmeaPort ->objectName()).toString());
+  _sigmaC1  ->setText(settings.value(_sigmaC1  ->objectName()).toString());
+  _sigmaL1  ->setText(settings.value(_sigmaL1  ->objectName()).toString());
+
+  // SpinBox
+  // -------
+  _corrWaitTime->setValue(settings.value(_corrWaitTime->objectName()).toInt());
+
+  // Table with stations
+  // -------------------
+  for (int iRow = _staTable->rowCount()-1; iRow >=0; iRow--) {
+    _staTable->removeRow(iRow);
+  }
+  int iRow = -1;
+  QListIterator<QString> it(settings.value(_staTable->objectName()).toStringList());
+  while (it.hasNext()) {
+    QStringList hlp = it.next().split(",");
+    ++iRow;
+    _staTable->insertRow(iRow);
+    for (int iCol = 0; iCol < hlp.size(); iCol++) {
+      _staTable->setItem(iRow, iCol, new QTableWidgetItem(hlp[iCol]));
+    }
+  }
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_pppWidgets::saveOptions() {
+
+  bncSettings settings;
+
+  settings.setValue(_dataSource  ->objectName(), _dataSource  ->currentText());
+  settings.setValue(_rinexObs    ->objectName(), _rinexObs    ->fileName());
+  settings.setValue(_rinexNav    ->objectName(), _rinexNav    ->fileName());
+  settings.setValue(_corrMount   ->objectName(), _corrMount   ->text());
+  settings.setValue(_corrFile    ->objectName(), _corrFile    ->fileName());
+  settings.setValue(_crdFile     ->objectName(), _crdFile     ->fileName());
+  settings.setValue(_antexFile   ->objectName(), _antexFile   ->fileName());
+  settings.setValue(_logFile     ->objectName(), _logFile     ->text());
+  settings.setValue(_nmeaFile    ->objectName(), _nmeaFile    ->text());
+  settings.setValue(_nmeaPort    ->objectName(), _nmeaPort    ->text());
+  settings.setValue(_lcGPS       ->objectName(), _lcGPS       ->currentText());
+  settings.setValue(_lcGLONASS   ->objectName(), _lcGLONASS   ->currentText());
+  settings.setValue(_lcGalileo   ->objectName(), _lcGalileo   ->currentText());
+  settings.setValue(_sigmaC1     ->objectName(), _sigmaC1     ->text());
+  settings.setValue(_sigmaL1     ->objectName(), _sigmaL1     ->text());
+  settings.setValue(_corrWaitTime->objectName(), _corrWaitTime->value());
+
+  QStringList staList;
+  for (int iRow = 0; iRow < _staTable->rowCount(); iRow++) {
+    QString hlp;
+    for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
+      if (_staTable->item(iRow, iCol)) {
+        hlp += _staTable->item(iRow, iCol)->text() + ",";
+      }
+    }
+    if (!hlp.isEmpty()) {
+      staList << hlp;
+    }
+  }
+  settings.setValue(_staTable->objectName(), staList);
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_pppWidgets::slotEnableWidgets() {
+
+  const static QPalette paletteWhite(QColor(255, 255, 255));
+  const static QPalette paletteGray(QColor(230, 230, 230));
+
+  bool allDisabled = _dataSource->currentText() == "no";
+  bool realTime    = _dataSource->currentText() == "Real-Time Streams";
+  bool rinexFiles  = _dataSource->currentText() == "RINEX Files";
+
+  QListIterator<QWidget*> it(_widgets);
+  while (it.hasNext()) {
+    QWidget* widget = it.next();
+    widget->setEnabled(!allDisabled);
+  }
+
+  if      (realTime) {
+    _rinexObs->setEnabled(false);    
+    _rinexNav->setEnabled(false);    
+    _corrFile->setEnabled(false);    
+  }
+  else if (rinexFiles) {
+    _corrMount->setEnabled(false);
+  }
+
+  _dataSource->setEnabled(true);
+
+  it.toFront();
+  while (it.hasNext()) {
+    QWidget* widget = it.next();
+    if (widget->isEnabled()) {
+      widget->setPalette(paletteWhite);
+    }
+    else {
+      widget->setPalette(paletteGray);
+    }
+  }
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_pppWidgets::slotAddStation() {
+  int iRow = _staTable->rowCount();
+  _staTable->insertRow(iRow);
+  for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
+    _staTable->setItem(iRow, iCol, new QTableWidgetItem(""));
+  }
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_pppWidgets::slotDelStation() {
+  int nRows = _staTable->rowCount();
+  bool flg[nRows];
+  for (int iRow = 0; iRow < nRows; iRow++) {
+    if (_staTable->isItemSelected(_staTable->item(iRow,1))) {
+      flg[iRow] = true;
+    }
+    else {
+      flg[iRow] = false;
+    }
+  }
+  for (int iRow = nRows-1; iRow >= 0; iRow--) {
+    if (flg[iRow]) {
+      _staTable->removeRow(iRow);
+    }
+  }
+}
+
Index: /trunk/BNC/src/PPP/pppWidgets.h
===================================================================
--- /trunk/BNC/src/PPP/pppWidgets.h	(revision 5809)
+++ /trunk/BNC/src/PPP/pppWidgets.h	(revision 5809)
@@ -0,0 +1,69 @@
+// 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 PPPWIDGETS_H
+#define PPPWIDGETS_H
+
+#include <QtGui>
+
+class qtFileChooser;
+
+class t_pppWidgets : public QObject {
+ Q_OBJECT
+
+ public:
+  t_pppWidgets();
+  void saveOptions();
+
+  QComboBox*     _dataSource;
+  qtFileChooser* _rinexObs;
+  qtFileChooser* _rinexNav;
+  QLineEdit*     _corrMount;  
+  qtFileChooser* _corrFile;  
+  qtFileChooser* _crdFile;
+  qtFileChooser* _antexFile;
+  QLineEdit*     _logFile;
+  QLineEdit*     _nmeaFile;
+  QLineEdit*     _nmeaPort;
+  QTableWidget*  _staTable;
+  QComboBox*     _lcGPS;
+  QComboBox*     _lcGLONASS;
+  QComboBox*     _lcGalileo;
+  QLineEdit*     _sigmaC1;
+  QLineEdit*     _sigmaL1;
+  QSpinBox*      _corrWaitTime;
+  QPushButton*   _addStaButton;
+  QPushButton*   _delStaButton;
+
+ private slots:
+  void slotEnableWidgets();  
+  void slotAddStation();
+  void slotDelStation();
+
+ private:
+  void readOptions();
+  QList <QWidget*> _widgets;
+};
+
+#endif
Index: unk/BNC/src/PPP/pppwidgets.cpp
===================================================================
--- /trunk/BNC/src/PPP/pppwidgets.cpp	(revision 5808)
+++ 	(revision )
@@ -1,278 +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_pppWidgets
- *
- * Purpose:    This class stores widgets for PPP options
- *
- * Author:     L. Mervart
- *
- * Created:    29-Jul-2014
- *
- * Changes:    
- *
- * -----------------------------------------------------------------------*/
-
-#include <iostream>
-
-#include "PPP/pppwidgets.h"
-#include "qtfilechooser.h"
-#include "bncsettings.h"
-
-using namespace std;
-
-// Constructor
-////////////////////////////////////////////////////////////////////////////
-t_pppWidgets::t_pppWidgets() {
-
-  _dataSource   = new QComboBox();     _dataSource  ->setObjectName("PPP/dataSource");   _widgets << _dataSource;  
-  _rinexObs     = new qtFileChooser(); _rinexObs    ->setObjectName("PPP/rinexObs");     _widgets << _rinexObs;    
-  _rinexNav     = new qtFileChooser(); _rinexNav    ->setObjectName("PPP/rinexNav");     _widgets << _rinexNav;    
-  _corrMount    = new QLineEdit();     _corrMount   ->setObjectName("PPP/corrMount");    _widgets << _corrMount;
-  _corrFile     = new qtFileChooser(); _corrFile    ->setObjectName("PPP/corrFile");     _widgets << _corrFile;    
-  _crdFile      = new qtFileChooser(); _crdFile     ->setObjectName("PPP/crdFile");      _widgets << _crdFile;     
-  _antexFile    = new qtFileChooser(); _antexFile   ->setObjectName("PPP/antexFile");    _widgets << _antexFile;   
-  _logFile      = new QLineEdit();     _logFile     ->setObjectName("PPP/logFile");      _widgets << _logFile;     
-  _nmeaFile     = new QLineEdit();     _nmeaFile    ->setObjectName("PPP/nmeaFile");     _widgets << _nmeaFile;    
-  _nmeaPort     = new QLineEdit();     _nmeaPort    ->setObjectName("PPP/nmeaPort");     _widgets << _nmeaPort;    
-  _staTable     = new QTableWidget();  _staTable    ->setObjectName("PPP/staTable");     _widgets << _staTable;    
-  _lcGPS        = new QComboBox();     _lcGPS       ->setObjectName("PPP/lcGPS");        _widgets << _lcGPS;       
-  _lcGLONASS    = new QComboBox();     _lcGLONASS   ->setObjectName("PPP/lcGLONASS");    _widgets << _lcGLONASS;   
-  _lcGalileo    = new QComboBox();     _lcGalileo   ->setObjectName("PPP/lcGalileo");    _widgets << _lcGalileo;   
-  _sigmaC1      = new QLineEdit();     _sigmaC1     ->setObjectName("PPP/sigmaC1");      _widgets << _sigmaC1;     
-  _sigmaL1      = new QLineEdit();     _sigmaL1     ->setObjectName("PPP/sigmaL1");      _widgets << _sigmaL1;     
-  _corrWaitTime = new QSpinBox();      _corrWaitTime->setObjectName("PPP/corrWaitTime"); _widgets << _corrWaitTime;
-  _addStaButton = new QPushButton("Add Station");                                        _widgets << _addStaButton;
-  _delStaButton = new QPushButton("Delete Station");                                     _widgets << _delStaButton;
-  
-  _dataSource->setEditable(false);
-  _dataSource->addItems(QString("no,Real-Time Streams,RINEX Files").split(","));
-  connect(_dataSource, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(slotEnableWidgets()));
-
-  _lcGPS->setEditable(false);
-  _lcGPS->addItems(QString("no,P3,L3,P3&L3").split(","));
-
-  _lcGLONASS->setEditable(false);
-  _lcGLONASS->addItems(QString("no,P3,L3,P3&L3").split(","));
-
-  _lcGalileo->setEditable(false);
-  _lcGalileo->addItems(QString("no,P3,L3,P3&L3").split(","));
-
-  _corrWaitTime->setMinimum(0);
-  _corrWaitTime->setMaximum(20);
-  _corrWaitTime->setSingleStep(1);
-  _corrWaitTime->setSuffix(" sec");
-  _corrWaitTime->setSpecialValueText("no");
-
-  _staTable->setColumnCount(9);
-  _staTable->setRowCount(0);
-  _staTable->setHorizontalHeaderLabels(
-     QString("Station,Sigma N,Sigma E,Sigma H,Noise N,Noise E,Noise H,Tropo Sigma,Tropo Noise").split(","));
-  _staTable->setSelectionMode(QAbstractItemView::ExtendedSelection);
-  _staTable->setSelectionBehavior(QAbstractItemView::SelectRows);
-  _staTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
-  /// _staTable->horizontalHeader()->setStretchLastSection(true);
-  _staTable->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft);
-  
-  connect(_addStaButton, SIGNAL(clicked()), this, SLOT(slotAddStation()));
-  connect(_delStaButton, SIGNAL(clicked()), this, SLOT(slotDelStation()));
-
-  readOptions();
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void t_pppWidgets::readOptions() {
-
-  bncSettings settings;
-
-  // ComboBoxes
-  // ----------
-  int ii = _dataSource->findText(settings.value(_dataSource->objectName()).toString());
-  if (ii != -1) {
-    _dataSource->setCurrentIndex(ii);
-  }
-  ii = _lcGPS->findText(settings.value(_lcGPS->objectName()).toString());
-  if (ii != -1) {
-    _lcGPS->setCurrentIndex(ii);
-  }
-  ii = _lcGLONASS->findText(settings.value(_lcGLONASS->objectName()).toString());
-  if (ii != -1) {
-    _lcGLONASS->setCurrentIndex(ii);
-  }
-  ii = _lcGalileo->findText(settings.value(_lcGalileo->objectName()).toString());
-  if (ii != -1) {
-    _lcGalileo->setCurrentIndex(ii);
-  }
-
-  // FileChoosers
-  // ------------
-  _rinexObs ->setFileName(settings.value(_rinexObs ->objectName()).toString());
-  _rinexNav ->setFileName(settings.value(_rinexNav ->objectName()).toString());
-  _corrFile ->setFileName(settings.value(_corrFile ->objectName()).toString());
-  _crdFile  ->setFileName(settings.value(_crdFile  ->objectName()).toString());
-  _antexFile->setFileName(settings.value(_antexFile->objectName()).toString());
-
-  // LineEdits
-  // ---------
-  _corrMount->setText(settings.value(_corrMount->objectName()).toString());
-  _logFile  ->setText(settings.value(_logFile  ->objectName()).toString());
-  _nmeaFile ->setText(settings.value(_nmeaFile ->objectName()).toString());
-  _nmeaPort ->setText(settings.value(_nmeaPort ->objectName()).toString());
-  _sigmaC1  ->setText(settings.value(_sigmaC1  ->objectName()).toString());
-  _sigmaL1  ->setText(settings.value(_sigmaL1  ->objectName()).toString());
-
-  // SpinBox
-  // -------
-  _corrWaitTime->setValue(settings.value(_corrWaitTime->objectName()).toInt());
-
-  // Table with stations
-  // -------------------
-  for (int iRow = _staTable->rowCount()-1; iRow >=0; iRow--) {
-    _staTable->removeRow(iRow);
-  }
-  int iRow = -1;
-  QListIterator<QString> it(settings.value(_staTable->objectName()).toStringList());
-  while (it.hasNext()) {
-    QStringList hlp = it.next().split(",");
-    ++iRow;
-    _staTable->insertRow(iRow);
-    for (int iCol = 0; iCol < hlp.size(); iCol++) {
-      _staTable->setItem(iRow, iCol, new QTableWidgetItem(hlp[iCol]));
-    }
-  }
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void t_pppWidgets::saveOptions() {
-
-  bncSettings settings;
-
-  settings.setValue(_dataSource  ->objectName(), _dataSource  ->currentText());
-  settings.setValue(_rinexObs    ->objectName(), _rinexObs    ->fileName());
-  settings.setValue(_rinexNav    ->objectName(), _rinexNav    ->fileName());
-  settings.setValue(_corrMount   ->objectName(), _corrMount   ->text());
-  settings.setValue(_corrFile    ->objectName(), _corrFile    ->fileName());
-  settings.setValue(_crdFile     ->objectName(), _crdFile     ->fileName());
-  settings.setValue(_antexFile   ->objectName(), _antexFile   ->fileName());
-  settings.setValue(_logFile     ->objectName(), _logFile     ->text());
-  settings.setValue(_nmeaFile    ->objectName(), _nmeaFile    ->text());
-  settings.setValue(_nmeaPort    ->objectName(), _nmeaPort    ->text());
-  settings.setValue(_lcGPS       ->objectName(), _lcGPS       ->currentText());
-  settings.setValue(_lcGLONASS   ->objectName(), _lcGLONASS   ->currentText());
-  settings.setValue(_lcGalileo   ->objectName(), _lcGalileo   ->currentText());
-  settings.setValue(_sigmaC1     ->objectName(), _sigmaC1     ->text());
-  settings.setValue(_sigmaL1     ->objectName(), _sigmaL1     ->text());
-  settings.setValue(_corrWaitTime->objectName(), _corrWaitTime->value());
-
-  QStringList staList;
-  for (int iRow = 0; iRow < _staTable->rowCount(); iRow++) {
-    QString hlp;
-    for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
-      if (_staTable->item(iRow, iCol)) {
-        hlp += _staTable->item(iRow, iCol)->text() + ",";
-      }
-    }
-    if (!hlp.isEmpty()) {
-      staList << hlp;
-    }
-  }
-  settings.setValue(_staTable->objectName(), staList);
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void t_pppWidgets::slotEnableWidgets() {
-
-  const static QPalette paletteWhite(QColor(255, 255, 255));
-  const static QPalette paletteGray(QColor(230, 230, 230));
-
-  bool allDisabled = _dataSource->currentText() == "no";
-  bool realTime    = _dataSource->currentText() == "Real-Time Streams";
-  bool rinexFiles  = _dataSource->currentText() == "RINEX Files";
-
-  QListIterator<QWidget*> it(_widgets);
-  while (it.hasNext()) {
-    QWidget* widget = it.next();
-    widget->setEnabled(!allDisabled);
-  }
-
-  if      (realTime) {
-    _rinexObs->setEnabled(false);    
-    _rinexNav->setEnabled(false);    
-    _corrFile->setEnabled(false);    
-  }
-  else if (rinexFiles) {
-    _corrMount->setEnabled(false);
-  }
-
-  _dataSource->setEnabled(true);
-
-  it.toFront();
-  while (it.hasNext()) {
-    QWidget* widget = it.next();
-    if (widget->isEnabled()) {
-      widget->setPalette(paletteWhite);
-    }
-    else {
-      widget->setPalette(paletteGray);
-    }
-  }
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void t_pppWidgets::slotAddStation() {
-  int iRow = _staTable->rowCount();
-  _staTable->insertRow(iRow);
-  for (int iCol = 0; iCol < _staTable->columnCount(); iCol++) {
-    _staTable->setItem(iRow, iCol, new QTableWidgetItem(""));
-  }
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void t_pppWidgets::slotDelStation() {
-  int nRows = _staTable->rowCount();
-  bool flg[nRows];
-  for (int iRow = 0; iRow < nRows; iRow++) {
-    if (_staTable->isItemSelected(_staTable->item(iRow,1))) {
-      flg[iRow] = true;
-    }
-    else {
-      flg[iRow] = false;
-    }
-  }
-  for (int iRow = nRows-1; iRow >= 0; iRow--) {
-    if (flg[iRow]) {
-      _staTable->removeRow(iRow);
-    }
-  }
-}
-
Index: unk/BNC/src/PPP/pppwidgets.h
===================================================================
--- /trunk/BNC/src/PPP/pppwidgets.h	(revision 5808)
+++ 	(revision )
@@ -1,69 +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 PPPWIDGETS_H
-#define PPPWIDGETS_H
-
-#include <QtGui>
-
-class qtFileChooser;
-
-class t_pppWidgets : public QObject {
- Q_OBJECT
-
- public:
-  t_pppWidgets();
-  void saveOptions();
-
-  QComboBox*     _dataSource;
-  qtFileChooser* _rinexObs;
-  qtFileChooser* _rinexNav;
-  QLineEdit*     _corrMount;  
-  qtFileChooser* _corrFile;  
-  qtFileChooser* _crdFile;
-  qtFileChooser* _antexFile;
-  QLineEdit*     _logFile;
-  QLineEdit*     _nmeaFile;
-  QLineEdit*     _nmeaPort;
-  QTableWidget*  _staTable;
-  QComboBox*     _lcGPS;
-  QComboBox*     _lcGLONASS;
-  QComboBox*     _lcGalileo;
-  QLineEdit*     _sigmaC1;
-  QLineEdit*     _sigmaL1;
-  QSpinBox*      _corrWaitTime;
-  QPushButton*   _addStaButton;
-  QPushButton*   _delStaButton;
-
- private slots:
-  void slotEnableWidgets();  
-  void slotAddStation();
-  void slotDelStation();
-
- private:
-  void readOptions();
-  QList <QWidget*> _widgets;
-};
-
-#endif
Index: unk/BNC/src/PPP/satbias.cpp
===================================================================
--- /trunk/BNC/src/PPP/satbias.cpp	(revision 5808)
+++ 	(revision )
@@ -1,58 +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_pppMain
- *
- * Purpose:    Satellite-specific biases
- *
- * Author:     L. Mervart
- *
- * Created:    29-Jul-2014
- *
- * Changes:    
- *
- * -----------------------------------------------------------------------*/
-
-#include "satbias.h"
-
-using namespace BNC;
-using namespace std;
-
-// Constructor
-////////////////////////////////////////////////////////////////////////////
-t_satBias::t_satBias(const t_satBiases& satBiases) {
-  _prn        = satBiases._prn;
-  _time       = satBiases._time;
-  _nx         = satBiases._nx;
-  _jumpCount  = satBiases._jumpCount;
-  for (unsigned ii = 0; ii < satBiases._biases.size(); ii++) { 
-    const t_bias& bias = satBiases._biases[ii];
-    t_biasType biasType   = string(bias._rnxType3ch).substr(0,3);
-    _biases[biasType]     = bias._value;
-  }
-}
Index: unk/BNC/src/PPP/satbias.h
===================================================================
--- /trunk/BNC/src/PPP/satbias.h	(revision 5808)
+++ 	(revision )
@@ -1,30 +1,0 @@
-#ifndef SATBIAS_H
-#define SATBIAS_H
-
-#include <map>
-#include "ppp.h"
-#include "bnctime.h"
-
-namespace BNC {
-
-typedef std::string t_biasType;
-
-class t_satBias {
- public:
-  t_satBias(const t_satBiases& satBiases);
-  ~t_satBias() {}
-  const t_prn& prn() const {return _prn;}
-  const std::map<t_biasType, double>& biases() const {return _biases;}
-  int nx() const {return _nx;}
-  int jumpCount() const {return _jumpCount;}
- private:
-  t_prn                        _prn;
-  bncTime                      _time;
-  int                          _nx;
-  int                          _jumpCount;
-  std::map<t_biasType, double> _biases;
-};
-
-} 
-
-#endif
Index: unk/BNC/src/PPP/station.cpp
===================================================================
--- /trunk/BNC/src/PPP/station.cpp	(revision 5808)
+++ 	(revision )
@@ -1,82 +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_station
- *
- * Purpose:    Processed station
- *
- * Author:     L. Mervart
- *
- * Created:    29-Jul-2014
- *
- * Changes:    
- *
- * -----------------------------------------------------------------------*/
-
-#include "station.h"
-#include "bncutils.h"
-#include "pppModel.h"
-
-using namespace BNC;
-using namespace std;
-
-// Constructor
-//////////////////////////////////////////////////////////////////////////////
-t_station::t_station() {
-  _windUp    = new t_windUp();
-}
-
-// Destructor
-//////////////////////////////////////////////////////////////////////////////
-t_station::~t_station() {
-  delete _windUp;
-}
-
-// 
-//////////////////////////////////////////////////////////////////////////////
-void t_station::setXyzApr(const ColumnVector& xyzApr) {
-  _xyzApr = xyzApr;
-  _ellApr.ReSize(3);
-  xyz2ell(_xyzApr.data(), _ellApr.data());
-}
-
-// 
-//////////////////////////////////////////////////////////////////////////////
-void t_station::setNeuEcc(const ColumnVector& neuEcc) {
-  _neuEcc = neuEcc;
-  _xyzEcc.ReSize(3);
-  neu2xyz(_ellApr.data(), _neuEcc.data(), _xyzEcc.data());
-}
-
-// 
-//////////////////////////////////////////////////////////////////////////////
-double t_station::windUp(const bncTime& time, t_prn prn, 
-                         const ColumnVector& rSat) const {
-  return _windUp->value(time, _xyzApr, prn, rSat);
-}
-
Index: unk/BNC/src/PPP/station.h
===================================================================
--- /trunk/BNC/src/PPP/station.h	(revision 5808)
+++ 	(revision )
@@ -1,49 +1,0 @@
-#ifndef STATION_H
-#define STATION_H
-
-#include <string>
-#include <newmat.h>
-#include "ppp.h"
-#include "bnctime.h"
-
-namespace BNC {
-
-class t_windUp;
-
-class t_station {
- public:
-  t_station();
-  ~t_station();
-  void setName(std::string name) {_name = name;}
-  void setAntName(std::string antName) {_antName = antName;}
-  void setXyzApr(const ColumnVector& xyzApr);
-  void setNeuEcc(const ColumnVector& neuEcc);
-  void setDClk(double dClk) {_dClk = dClk;}
-  void setTideDspl(const ColumnVector& tideDspl) {_tideDspl = tideDspl;}
-  const std::string&  name()      const {return _name;}
-  const std::string&  antName()   const {return _antName;}
-  const ColumnVector& xyzApr()    const {return _xyzApr;}
-  const ColumnVector& ellApr()    const {return _ellApr;}
-  const ColumnVector& neuEcc()    const {return _neuEcc;}
-  const ColumnVector& xyzEcc()    const {return _xyzEcc;}
-  const ColumnVector& tideDspl()  const {return _tideDspl;}
-  double dClk() const {return _dClk;}
-  double windUp(const bncTime& time, t_prn prn, const ColumnVector& rSat) const;
-
- private:
-  std::string       _name;
-  std::string       _antName;
-  ColumnVector      _xyzApr;
-  ColumnVector      _ellApr;
-  ColumnVector      _neuEcc;
-  ColumnVector      _xyzEcc;
-  ColumnVector      _tideDspl;
-  double            _dClk;
-  mutable t_windUp* _windUp;
-  bncTime           _timeCheck;
-  ColumnVector      _xyzCheck;
-};
-
-}
-
-#endif
