Index: trunk/BNC/src/PPP/pppClient.cpp
===================================================================
--- trunk/BNC/src/PPP/pppClient.cpp	(revision 10002)
+++ trunk/BNC/src/PPP/pppClient.cpp	(revision 10003)
@@ -73,5 +73,7 @@
   }
 
-  _offGG = 0.0;
+  _offGlo = 0.0;
+  _offGal = 0.0;
+  _offBds = 0.0;
   CLIENTS.setLocalData(this);  // CLIENTS takes ownership over "this"
 }
@@ -357,13 +359,13 @@
 // Compute A Priori GPS-Glonass Offset
 //////////////////////////////////////////////////////////////////////////////
-double t_pppClient::cmpOffGG(vector<t_pppSatObs*>& obsVector) {
+double t_pppClient::cmpOffGlo(vector<t_pppSatObs*>& obsVector) {
 
   t_lc::type tLC   = t_lc::dummy;
-  double     offGG = 0.0;
+  double     offGlo = 0.0;
 
   if (OPT->useSystem('R')) {
 
     while (obsVector.size() > 0) {
-      offGG = 0.0;
+      offGlo = 0.0;
       double   maxRes      = 0.0;
       int      maxResIndex = -1;
@@ -379,5 +381,5 @@
             double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);
             ++nObs;
-            offGG += ll;
+            offGlo += ll;
             if (fabs(ll) > fabs(maxRes)) {
               maxRes      = ll;
@@ -390,12 +392,12 @@
 
       if (nObs > 0) {
-        offGG = offGG / nObs;
+        offGlo = offGlo / nObs;
       }
       else {
-        offGG = 0.0;
+        offGlo = 0.0;
       }
 
       if (fabs(maxRes) > 1000.0) {
-        LOG << "t_pppClient::cmpOffGG outlier " << maxResPrn.toString() << " " << maxRes << endl;
+        LOG << "t_pppClient::cmpOffGlo outlier " << maxResPrn.toString() << " " << maxRes << endl;
         obsVector.erase(obsVector.begin() + maxResIndex);
       }
@@ -406,7 +408,114 @@
   }
 
-  return offGG;
-}
-
+  return offGlo;
+}
+
+// Compute A Priori GPS-Galileo Offset
+//////////////////////////////////////////////////////////////////////////////
+double t_pppClient::cmpOffGal(vector<t_pppSatObs*>& obsVector) {
+
+  t_lc::type tLC   = t_lc::dummy;
+  double     offGal = 0.0;
+
+  if (OPT->useSystem('E')) {
+
+    while (obsVector.size() > 0) {
+      offGal = 0.0;
+      double   maxRes      = 0.0;
+      int      maxResIndex = -1;
+      t_prn    maxResPrn;
+      unsigned nObs        = 0;
+      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
+        t_pppSatObs* satObs = obsVector.at(ii);
+        if (satObs->prn().system() == 'E') {
+          if (tLC == t_lc::dummy) {
+            tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;
+          }
+          if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= OPT->_minEle)) {
+            double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);
+            ++nObs;
+            offGal += ll;
+            if (fabs(ll) > fabs(maxRes)) {
+              maxRes      = ll;
+              maxResIndex = ii;
+              maxResPrn   = satObs->prn();
+            }
+          }
+        }
+      }
+
+      if (nObs > 0) {
+        offGal = offGal / nObs;
+      }
+      else {
+        offGal = 0.0;
+      }
+
+      if (fabs(maxRes) > 1000.0) {
+        LOG << "t_pppClient::cmpOffGal outlier " << maxResPrn.toString() << " " << maxRes << endl;
+        obsVector.erase(obsVector.begin() + maxResIndex);
+      }
+      else {
+        break;
+      }
+    }
+  }
+
+  return offGal;
+}
+
+
+// Compute A Priori GPS-BDS Offset
+//////////////////////////////////////////////////////////////////////////////
+double t_pppClient::cmpOffBds(vector<t_pppSatObs*>& obsVector) {
+
+  t_lc::type tLC   = t_lc::dummy;
+  double     offBds = 0.0;
+
+  if (_opt->useSystem('C')) {
+    while (obsVector.size() > 0) {
+      offBds = 0.0;
+      double   maxRes      = 0.0;
+      int      maxResIndex = -1;
+      t_prn    maxResPrn;
+      unsigned nObs        = 0;
+      for (unsigned ii = 0; ii < obsVector.size(); ii++) {
+        const t_pppSatObs* satObs = obsVector.at(ii);
+        if (satObs->prn().system() == 'C') {
+          if (tLC == t_lc::dummy) {
+            tLC = satObs->isValid(t_lc::cIF) ? t_lc::cIF : t_lc::c1;
+          }
+          if (satObs->isValid(tLC) && (!satObs->modelSet() || satObs->eleSat() >= _opt->_minEle)) {
+            double ll = satObs->obsValue(tLC) - satObs->cmpValue(tLC);
+            ++nObs;
+            offBds += ll;
+            if (fabs(ll) > fabs(maxRes)) {
+              maxRes      = ll;
+              maxResIndex = ii;
+              maxResPrn   = satObs->prn();
+            }
+          }
+        }
+      }
+
+      if (nObs > 0) {
+        offBds = offBds / nObs;
+      }
+      else {
+        offBds = 0.0;
+      }
+
+      if (fabs(maxRes) >  1000.0) {
+        LOG << "t_pppClient::cmpOffBds outlier " << maxResPrn.toString() << " " << maxRes << endl;
+        delete obsVector.at(maxResIndex);
+        obsVector.erase(obsVector.begin() + maxResIndex);
+      }
+      else {
+        break;
+      }
+    }
+  }
+  return offBds;
+}
 //
 //////////////////////////////////////////////////////////////////////////////
@@ -586,5 +695,7 @@
       }
 
-      _offGG = cmpOffGG(_obsRover);
+      _offGlo = cmpOffGlo(_obsRover);
+      _offGal = cmpOffGal(_obsRover);
+      _offBds = cmpOffBds(_obsRover);
 
       // Prepare Pseudo Observations of the Rover
Index: trunk/BNC/src/PPP/pppClient.h
===================================================================
--- trunk/BNC/src/PPP/pppClient.h	(revision 10002)
+++ trunk/BNC/src/PPP/pppClient.h	(revision 10003)
@@ -38,5 +38,7 @@
   const bncAntex*     antex() const {return _antex;}
   const t_pppStation* staRover() const {return _staRover;}
-  double              offGG() const {return _offGG;}
+  double              offGlo() const {return _offGlo;}
+  double              offGal() const {return _offGal;}
+  double              offBds() const {return _offBds;}
 
   std::ostringstream& log() {return *_log;}
@@ -61,5 +63,7 @@
   t_irc cmpBancroft(const bncTime& epoTime, std::vector<t_pppSatObs*>& obsVector,
                     ColumnVector& xyzc, bool print);
-  double cmpOffGG(std::vector<t_pppSatObs*>& obsVector);
+  double cmpOffGlo(std::vector<t_pppSatObs*>& obsVector);
+  double cmpOffGal(std::vector<t_pppSatObs*>& obsVector);
+  double cmpOffBds(std::vector<t_pppSatObs*>& obsVector);
   t_irc handleRefSatellites(std::vector<t_pppSatObs*>& obsVector);
   void setRefSatellites(std::vector<t_pppSatObs*>& obsVector);
@@ -73,5 +77,7 @@
   bncAntex*                 _antex;
   t_pppFilter*              _filter;
-  double                    _offGG;
+  double                    _offGlo;
+  double                    _offGal;
+  double                    _offBds;
   std::vector<t_pppSatObs*> _obsRover;
   QMap<char, t_pppRefSat*>  _refSatMap;
Index: trunk/BNC/src/PPP/pppFilter.cpp
===================================================================
--- trunk/BNC/src/PPP/pppFilter.cpp	(revision 10002)
+++ trunk/BNC/src/PPP/pppFilter.cpp	(revision 10003)
@@ -354,5 +354,5 @@
               << t_lc::toString(maxOutlierLC) << ' ' << obs->prn().toString()
               << ' ' << setw(8) << setprecision(4) << maxOutlier << endl;
-          //break;
+          break;
         } //else {obs->setOutlier(); }
       } else {    // fin-processing
Index: trunk/BNC/src/PPP/pppFilter.h
===================================================================
--- trunk/BNC/src/PPP/pppFilter.h	(revision 10002)
+++ trunk/BNC/src/PPP/pppFilter.h	(revision 10003)
@@ -128,10 +128,11 @@
       _D21.ReSize(_numPar, _numPar); _D21 = 0.0;
     }
-    t_irc prepareAA(const Matrix& AA, int ind) {//LOG << "prepare AA" << ind << "\n";
+    t_irc prepareAA(const Matrix& AA, int ind) {LOG << "prepare AA" << ind << "\n";
       Matrix* Prep = &_AA2;
       if (ind == 1) {
         Prep = &_AA1;
       }
-      //LOG << "_firstRow: " << _firstRow << " _lastRow: " << _lastRow << " _numPar " << _numPar << std::endl;
+      LOG << "_firstRow: " << _firstRow << " _lastRow: " << _lastRow << " _numPar " << _numPar << std::endl;
+      LOG << "t_pppFilter::prepareAA: AA.Ncols() > _numPar? " << AA.Ncols() << " / " << _numPar << std::endl;
       if (AA.Ncols() > _numPar) {
         LOG << "t_pppFilter::prepareAA: AA.Ncols() > _numPar: " << AA.Ncols() << " > " << _numPar << std::endl;
Index: trunk/BNC/src/PPP/pppParlist.cpp
===================================================================
--- trunk/BNC/src/PPP/pppParlist.cpp	(revision 10002)
+++ trunk/BNC/src/PPP/pppParlist.cpp	(revision 10003)
@@ -74,9 +74,17 @@
          const t_pppSatObs* obs = obsVector->at(ii);
          if (obs->prn() == _prn) {
-           double offGG = 0;
+           double offGlo = 0;
            if (_prn.system() == 'R' && tLC != t_lc::MW) {
-             offGG = PPP_CLIENT->offGG();
+             offGlo = PPP_CLIENT->offGlo();
            }
-           _x0 = floor((obs->obsValue(tLC) - offGG - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5);
+           double offGal = 0;
+           if (_prn.system() == 'E' && tLC != t_lc::MW) {
+             offGal = PPP_CLIENT->offGal();
+           }
+           double offBds = 0;
+           if (_prn.system() == 'C' && tLC != t_lc::MW) {
+             offBds = PPP_CLIENT->offBds();
+           }
+           _x0 = floor((obs->obsValue(tLC) - offGlo - offGal - offBds - obs->cmpValue(tLC)) / obs->lambda(tLC) + 0.5);
            break;
          }
@@ -84,9 +92,19 @@
      }
      break;
-   case offGG:
+   case offGlo:
      _epoSpec = true;
      _sigma0  = OPT->_aprSigClk;
-     _x0      = PPP_CLIENT->offGG();
-     break;     
+     _x0      = PPP_CLIENT->offGlo();
+     break;
+   case offGal:
+     _epoSpec = true;
+     _sigma0  = OPT->_aprSigClk;
+     _x0      = PPP_CLIENT->offGal();
+     break;
+   case offBds:
+     _epoSpec = true;
+     _sigma0  = OPT->_aprSigClk;
+     _x0      = PPP_CLIENT->offBds();
+     break;
    case trp:
      _epoSpec = false;
@@ -176,7 +194,13 @@
     if (tLC == t_lc::GIM) {return 0.0;}
     return 1.0;
-  case offGG:
+  case offGlo:
     if (tLC == t_lc::GIM) {return 0.0;}
     return (obs->prn().system() == 'R') ? 1.0 : 0.0;
+  case offGal:
+    if (tLC == t_lc::GIM) {return 0.0;}
+    return (obs->prn().system() == 'E') ? 1.0 : 0.0;
+  case offBds:
+    if (tLC == t_lc::GIM) {return 0.0;}
+    return (obs->prn().system() == 'C') ? 1.0 : 0.0;
   case amb:
     if      (tLC == t_lc::GIM) {return 0.0;}
@@ -304,6 +328,12 @@
     ss << "REC_CLK     ";
     break;
-  case offGG:
-    ss << "OFF_GLO      ";
+  case offGlo:
+    ss << "OFF_GLO     ";
+    break;
+  case offGal:
+    ss << "OFF GAL     ";
+    break;
+  case offBds:
+    ss << "OFF_BDS     ";
     break;
   case trp:
@@ -663,8 +693,20 @@
   required.push_back(new t_pppParam(t_pppParam::clkR, t_prn(), t_lc::dummy));
 
-  // GPS-Glonass Clock Offset
-  // ------------------------
-  if (OPT->useSystem('R')) {
-    required.push_back(new t_pppParam(t_pppParam::offGG, t_prn(), t_lc::dummy));
+  // Glonass Clock Offset
+  // --------------------
+  if (_usedSystems.contains('R')  && (_usedSystems.contains('G') || _usedSystems.contains('E'))) {
+    required.push_back(new t_pppParam(t_pppParam::offGlo, t_prn(), t_lc::dummy));
+  }
+
+  // Galileo Clock Offset
+  // --------------------
+  if (_usedSystems.contains('E') && _usedSystems.contains('G')) {
+    required.push_back(new t_pppParam(t_pppParam::offGal, t_prn(), t_lc::dummy));
+  }
+
+  // BDS Clock Offset
+  // ----------------
+  if (_usedSystems.contains('C')  && (_usedSystems.contains('G') || _usedSystems.contains('E'))) {
+    required.push_back(new t_pppParam(t_pppParam::offBds, t_prn(), t_lc::dummy));
   }
 
Index: trunk/BNC/src/PPP/pppParlist.h
===================================================================
--- trunk/BNC/src/PPP/pppParlist.h	(revision 10002)
+++ trunk/BNC/src/PPP/pppParlist.h	(revision 10003)
@@ -15,5 +15,5 @@
 class t_pppParam {
  public:
-  enum e_type {crdX, crdY, crdZ, clkR, offGG, trp, ion, amb,
+  enum e_type {crdX, crdY, crdZ, clkR, offGlo, offGal, offBds, trp, ion, amb,
                cBiasG1, cBiasR1, cBiasE1, cBiasC1, pBiasG1, pBiasR1, pBiasE1, pBiasC1,
                cBiasG2, cBiasR2, cBiasE2, cBiasC2, pBiasG2, pBiasR2, pBiasE2, pBiasC2};
