Index: trunk/BNC/src/PPP/pppSatObs.cpp
===================================================================
--- trunk/BNC/src/PPP/pppSatObs.cpp	(revision 7262)
+++ trunk/BNC/src/PPP/pppSatObs.cpp	(revision 7288)
@@ -11,5 +11,5 @@
  * Created:    29-Jul-2014
  *
- * Changes:    
+ * Changes:
  *
  * -----------------------------------------------------------------------*/
@@ -53,5 +53,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 void t_pppSatObs::prepareObs(const t_satObs& pppSatObs) {
@@ -122,9 +122,9 @@
       break;
     }
-    satPosOld = _xcSat; 
+    satPosOld = _xcSat;
   }
   if (totOK) {
     _signalPropagationTime = prange / t_CST::c - _xcSat[3];
-    _model._satClkM = _xcSat[3] * t_CST::c; 
+    _model._satClkM = _xcSat[3] * t_CST::c;
   }
   else {
@@ -133,7 +133,7 @@
 }
 
-// 
-////////////////////////////////////////////////////////////////////////////
-void t_pppSatObs::lcCoeff(t_lc::type tLC, 
+//
+////////////////////////////////////////////////////////////////////////////
+void t_pppSatObs::lcCoeff(t_lc::type tLC,
                           map<t_frequency::type, double>& codeCoeff,
                           map<t_frequency::type, double>& phaseCoeff) const {
@@ -147,14 +147,14 @@
   switch (tLC) {
   case t_lc::l1:
-    phaseCoeff[_fType1] = 1.0;  
-    return;
-  case t_lc::l2:  
-    phaseCoeff[_fType2] = 1.0;  
-    return;
-  case t_lc::lIF: 
+    phaseCoeff[_fType1] = 1.0;
+    return;
+  case t_lc::l2:
+    phaseCoeff[_fType2] = 1.0;
+    return;
+  case t_lc::lIF:
     phaseCoeff[_fType1] =  f1 * f1 / (f1 * f1 - f2 * f2);
     phaseCoeff[_fType2] = -f2 * f2 / (f1 * f1 - f2 * f2);
     return;
-  case t_lc::MW:  
+  case t_lc::MW:
     phaseCoeff[_fType1] =  f1 / (f1 - f2);
     phaseCoeff[_fType2] = -f2 / (f1 - f2);
@@ -162,25 +162,25 @@
     codeCoeff[_fType2]  = -f2 / (f1 + f2);
     return;
-  case t_lc::CL:  
+  case t_lc::CL:
     phaseCoeff[_fType1] =  0.5;
     codeCoeff[_fType1]  =  0.5;
     return;
-  case t_lc::c1:  
-    codeCoeff[_fType1] = 1.0;  
-    return;
-  case t_lc::c2:  
-    codeCoeff[_fType2] = 1.0;  
-    return;
-  case t_lc::cIF: 
+  case t_lc::c1:
+    codeCoeff[_fType1] = 1.0;
+    return;
+  case t_lc::c2:
+    codeCoeff[_fType2] = 1.0;
+    return;
+  case t_lc::cIF:
     codeCoeff[_fType1] =  f1 * f1 / (f1 * f1 - f2 * f2);
     codeCoeff[_fType2] = -f2 * f2 / (f1 * f1 - f2 * f2);
     return;
-  case t_lc::dummy: 
-  case t_lc::maxLc: 
-    return;
-  }
-}
-
-// 
+  case t_lc::dummy:
+  case t_lc::maxLc:
+    return;
+  }
+}
+
+//
 ////////////////////////////////////////////////////////////////////////////
 bool t_pppSatObs::isValid(t_lc::type tLC) const {
@@ -189,5 +189,5 @@
   return valid;
 }
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 double t_pppSatObs::obsValue(t_lc::type tLC, bool* valid) const {
@@ -225,5 +225,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 double t_pppSatObs::lambda(t_lc::type tLC) const {
@@ -251,5 +251,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 double t_pppSatObs::sigma(t_lc::type tLC) const {
@@ -268,6 +268,6 @@
     retVal += it->second * it->second * OPT->_sigmaL1 * OPT->_sigmaL1;
   }
-  
-  retVal = sqrt(retVal);    
+
+  retVal = sqrt(retVal);
 
   // De-Weight GLONASS
@@ -290,5 +290,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 double t_pppSatObs::maxRes(t_lc::type tLC) const {
@@ -312,5 +312,5 @@
 
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 t_irc t_pppSatObs::cmpModel(const t_pppStation* station) {
@@ -323,5 +323,5 @@
   // ------------------------------
   ColumnVector rSat = _xcSat.Rows(1,3);
-  ColumnVector rhoV = rSat - station->xyzApr(); 
+  ColumnVector rhoV = rSat - station->xyzApr();
   _model._rho = rhoV.norm_Frobenius();
 
@@ -361,5 +361,5 @@
       t_frequency::type frqType = static_cast<t_frequency::type>(ii);
       bool found;
-      _model._antPCO[ii] = PPP_CLIENT->antex()->rcvCorr(station->antName(), frqType, 
+      _model._antPCO[ii] = PPP_CLIENT->antex()->rcvCorr(station->antName(), frqType,
                                                         _model._eleSat, _model._azSat, found);
     }
@@ -377,5 +377,5 @@
   // -----------
   const t_satCodeBias* satCodeBias = PPP_CLIENT->obsPool()->satCodeBias(_prn);
-  if (satCodeBias) { 
+  if (satCodeBias) {
     for (unsigned ii = 0; ii < satCodeBias->_bias.size(); ii++) {
       const t_frqCodeBias& bias = satCodeBias->_bias[ii];
@@ -389,4 +389,20 @@
   }
 
+  // Phase Biases
+  // -----------
+  // TODO: consideration of fix indicators, yaw angle and jump counter
+  const t_satPhaseBias* satPhaseBias = PPP_CLIENT->obsPool()->satPhaseBias(_prn);
+  if (satPhaseBias) {
+    for (unsigned ii = 0; ii < satPhaseBias->_bias.size(); ii++) {
+      const t_frqPhaseBias& bias = satPhaseBias->_bias[ii];
+      for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) {
+        const t_frqObs* obs = _obs[iFreq];
+        if (obs && obs->_rnxType2ch == bias._rnxType2ch) {
+          _model._phaseBias[iFreq]  = bias._value;
+        }
+      }
+    }
+  }
+
   // Tidal Correction
   // ----------------
@@ -424,5 +440,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 void t_pppSatObs::printModel() const {
@@ -442,8 +458,11 @@
   for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) {
     if (_obs[iFreq]) {
-      LOG << "PCO           : " << t_frequency::toString(t_frequency::type(iFreq)) << setw(12) << setprecision(3) << _model._antPCO[iFreq]    << endl
-          << "BIAS CODE     : " << t_frequency::toString(t_frequency::type(iFreq)) << setw(12) << setprecision(3) << _model._codeBias[iFreq]  << endl
-          << "BIAS PHASE    : " << t_frequency::toString(t_frequency::type(iFreq)) << setw(12) << setprecision(3) << _model._phaseBias[iFreq]  << endl
-          << "IONO CODEDELAY: " << t_frequency::toString(t_frequency::type(iFreq)) << setw(12) << setprecision(3) << _model._ionoCodeDelay[iFreq] << endl;
+      string frqStr = t_frequency::toString(t_frequency::type(iFreq));
+      if (_prn.system() == frqStr[0]) {
+      LOG << "PCO           : " << frqStr << setw(12) << setprecision(3) << _model._antPCO[iFreq]    << endl
+          << "BIAS CODE     : " << frqStr << setw(12) << setprecision(3) << _model._codeBias[iFreq]  << endl
+          << "BIAS PHASE    : " << frqStr << setw(12) << setprecision(3) << _model._phaseBias[iFreq]  << endl
+          << "IONO CODEDELAY: " << frqStr << setw(12) << setprecision(3) << _model._ionoCodeDelay[iFreq] << endl;
+      }
     }
   }
@@ -456,5 +475,5 @@
 
   }
-  LOG << "OBS-CMP MW: " << _prn.toString() << " " 
+  LOG << "OBS-CMP MW: " << _prn.toString() << " "
       << setw(12) << setprecision(3) << obsValue(t_lc::MW) << " "
       << setw(12) << setprecision(3) << cmpValue(t_lc::MW) << " "
@@ -462,5 +481,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 double t_pppSatObs::cmpValueForBanc(t_lc::type tLC) const {
@@ -468,5 +487,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 double t_pppSatObs::cmpValue(t_lc::type tLC) const {
@@ -478,6 +497,6 @@
   // Non-Dispersive Part
   // -------------------
-  double nonDisp = _model._rho    + _model._recClkM - _model._satClkM 
-                 + _model._sagnac + _model._antEcc  + _model._tropo 
+  double nonDisp = _model._rho    + _model._recClkM - _model._satClkM
+                 + _model._sagnac + _model._antEcc  + _model._tropo
                  + _model._tide;
 
@@ -506,5 +525,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 void t_pppSatObs::setRes(t_lc::type tLC, double res) {
@@ -512,5 +531,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 double t_pppSatObs::getRes(t_lc::type tLC) const {
