Index: /trunk/BNC/bncconst.cpp
===================================================================
--- /trunk/BNC/bncconst.cpp	(revision 2777)
+++ /trunk/BNC/bncconst.cpp	(revision 2778)
@@ -26,8 +26,10 @@
 
 const double t_CST::c       = 299792458.0;
-const double t_CST::freq1   = 1575420000.0;
-const double t_CST::freq2   = 1227600000.0;
+const double t_CST::freq1   = 1575420000.0; // GPS and Galileo E1
+const double t_CST::freq2   = 1227600000.0; // GPS only
+const double t_CST::freq5   = 1176450000.0; // GPS and Galileo E5a
 const double t_CST::lambda1 = c / freq1;
 const double t_CST::lambda2 = c / freq2;
+const double t_CST::lambda5 = c / freq5;
 const double t_CST::omega   = 7292115.1467e-11;
 const double t_CST::aell    = 6378137.000;
Index: /trunk/BNC/bncconst.h
===================================================================
--- /trunk/BNC/bncconst.h	(revision 2777)
+++ /trunk/BNC/bncconst.h	(revision 2778)
@@ -30,9 +30,11 @@
 class t_CST {
   public:
-    static const double c      ;
-    static const double freq1  ;
-    static const double freq2  ;
+    static const double c;
+    static const double freq1; // GPS and Galileo E1 
+    static const double freq2; // GPS only           
+    static const double freq5; // GPS and Galileo E5a
     static const double lambda1;
     static const double lambda2;
+    static const double lambda5;
     static const double omega;
     static const double aell;
Index: /trunk/BNC/bncpppclient.cpp
===================================================================
--- /trunk/BNC/bncpppclient.cpp	(revision 2777)
+++ /trunk/BNC/bncpppclient.cpp	(revision 2778)
@@ -147,5 +147,6 @@
   slipInfo& sInfo  = _slips[satData->prn];
   if ( sInfo.slipCntL1 == obs.slip_cnt_L1  &&
-       sInfo.slipCntL2 == obs.slip_cnt_L2 ) {
+       sInfo.slipCntL2 == obs.slip_cnt_L2  &&
+       sInfo.slipCntL5 == obs.slip_cnt_L5 ) {
     satData->slipFlag = false;
   }
@@ -163,62 +164,48 @@
   }
 
-  // Set Code Observations
-  // ---------------------  
+  // Set Code Observations - P1 or C1
+  // --------------------------------
+  bool haveP1 = false;
   if      (obs.P1) {
     satData->P1         = obs.P1 + (bb ? bb->p1 : 0.0);
     satData->codeTypeF1 = t_satData::P_CODE;
+    haveP1 = true;
   }
   else if (obs.C1) {
     satData->P1         = obs.C1 + (bb ? bb->c1 : 0.0);
     satData->codeTypeF1 = t_satData::C_CODE;
-  }
-  else {
+    haveP1 = true;
+  }
+
+  if (!haveP1) {
     delete satData;
     return;
   }
-    
+
+  // P2 or C2, and C5
+  // ----------------   
+  bool haveP2 = false;
   if      (obs.P2) {
     satData->P2         = obs.P2 + (bb ? bb->p2 : 0.0);
     satData->codeTypeF2 = t_satData::P_CODE;
+    haveP2 = true;
   }
   else if (obs.C2) {
     satData->P2         = obs.C2;
     satData->codeTypeF2 = t_satData::C_CODE;
-  }
-  else {
+    haveP2 = true;
+  }
+
+  bool haveP5 = false;
+  if      (obs.C5) {
+    satData->P5         = obs.C5;
+    satData->codeTypeF2 = t_satData::P_CODE;
+    haveP5 = true;
+  }
+
+  if (!haveP2 && !haveP5) {
     delete satData;
     return;
   }
-
-  double f1 = t_CST::freq1;
-  double f2 = t_CST::freq2;
-
-  if (obs.satSys == 'R') {
-    f1 = 1602000000.0 + 562500.0 * obs.slotNum; 
-    f2 = 1246000000.0 + 437500.0 * obs.slotNum;
-  }
-
-  // Ionosphere-Free Combination
-  // ---------------------------
-  double c1 =   f1 * f1 / (f1 * f1 - f2 * f2);
-  double c2 = - f2 * f2 / (f1 * f1 - f2 * f2);
-  
-  satData->P3 =  c1 * satData->P1 + c2 * satData->P2;
-
-  // Set Phase Observations
-  // ----------------------  
-  if (obs.L1() && obs.L2()) {
-    satData->L1 = obs.L1() * t_CST::c / f1;
-    satData->L2 = obs.L2() * t_CST::c / f2;
-  }
-  else {
-    delete satData;
-    return;
-  }
-  satData->L3 =  c1 * satData->L1 + c2 * satData->L2;
-
-  // Set Ionosphere-Free Wavelength
-  // ------------------------------
-  satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2;
 
   // Add new Satellite to the epoch
@@ -237,9 +224,68 @@
   }
 
+  // Set Ionosphere-Free Combinations
+  // --------------------------------
   if      (obs.satSys == 'G') {
+    double f1 = t_CST::freq1;
+    double f2 = t_CST::freq2;
+    double c1 =   f1 * f1 / (f1 * f1 - f2 * f2);
+    double c2 = - f2 * f2 / (f1 * f1 - f2 * f2);
+
+    if (obs.L1() && obs.L2()) {
+      satData->L1 = obs.L1() * t_CST::c / f1;
+      satData->L2 = obs.L2() * t_CST::c / f2;
+    }
+    else {
+      delete satData;
+      return;
+    }
+
+    satData->P3      = c1 * satData->P1 + c2 * satData->P2;
+    satData->L3      = c1 * satData->L1 + c2 * satData->L2;
+    satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2;
+
     _epoData->satDataGPS[satData->prn] = satData;
   }
   else if (obs.satSys == 'R') {
+    double f1 = 1602000000.0 + 562500.0 * obs.slotNum; 
+    double f2 = 1246000000.0 + 437500.0 * obs.slotNum;
+    double c1 =   f1 * f1 / (f1 * f1 - f2 * f2);
+    double c2 = - f2 * f2 / (f1 * f1 - f2 * f2);
+
+    if (obs.L1() && obs.L2()) {
+      satData->L1 = obs.L1() * t_CST::c / f1;
+      satData->L2 = obs.L2() * t_CST::c / f2;
+    }
+    else {
+      delete satData;
+      return;
+    }
+
+    satData->P3      = c1 * satData->P1 + c2 * satData->P2;
+    satData->L3      = c1 * satData->L1 + c2 * satData->L2;
+    satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2;
+
     _epoData->satDataGlo[satData->prn] = satData;
+  }
+  else if (obs.satSys == 'E') {
+    double f1 = t_CST::freq1;
+    double f5 = t_CST::freq5;
+    double c1 =   f1 * f1 / (f1 * f1 - f5 * f5);
+    double c5 = - f5 * f5 / (f1 * f1 - f5 * f5);
+
+    if (obs.L1() && obs.L5) {
+      satData->L1 = obs.L1() * t_CST::c / f1;
+      satData->L5 = obs.L5   * t_CST::c / f5;
+    }
+    else {
+      delete satData;
+      return;
+    }
+
+    satData->P3      = c1 * satData->P1 + c5 * satData->P5;
+    satData->L3      = c1 * satData->L1 + c5 * satData->L5;
+    satData->lambda3 = c1 * t_CST::c / f1 + c5 * t_CST::c / f5;
+
+    _epoData->satDataGal[satData->prn] = satData;
   }
 }
@@ -294,4 +340,30 @@
     t_ephGlo* eLast = new t_ephGlo();
     eLast->set(&gloeph);
+    _eph.insert(prn, new t_ephPair());
+    _eph[prn]->last = eLast;
+  }
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void bncPPPclient::slotNewEphGalileo(galileoephemeris galeph) {
+  QMutexLocker locker(&_mutex);
+
+  QString prn = QString("E%1").arg(galeph.satellite, 2, 10, QChar('0'));
+
+  if (_eph.contains(prn)) {
+    t_ephGal* eLast = static_cast<t_ephGal*>(_eph.value(prn)->last);
+    if ( (eLast->GPSweek() <  galeph.Week) || 
+         (eLast->GPSweek() == galeph.Week &&  
+          eLast->TOC()     <  galeph.TOC) ) {
+      delete static_cast<t_ephGal*>(_eph.value(prn)->prev);
+      _eph.value(prn)->prev = _eph.value(prn)->last;
+      _eph.value(prn)->last = new t_ephGal();
+      static_cast<t_ephGal*>(_eph.value(prn)->last)->set(&galeph);
+    }
+  }
+  else {
+    t_ephGal* eLast = new t_ephGal();
+    eLast->set(&galeph);
     _eph.insert(prn, new t_ephPair());
     _eph[prn]->last = eLast;
@@ -557,28 +629,2 @@
   }
 }
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void bncPPPclient::slotNewEphGalileo(galileoephemeris galeph) {
-  QMutexLocker locker(&_mutex);
-
-  QString prn = QString("E%1").arg(galeph.satellite, 2, 10, QChar('0'));
-
-  if (_eph.contains(prn)) {
-    t_ephGal* eLast = static_cast<t_ephGal*>(_eph.value(prn)->last);
-    if ( (eLast->GPSweek() <  galeph.Week) || 
-         (eLast->GPSweek() == galeph.Week &&  
-          eLast->TOC()     <  galeph.TOC) ) {
-      delete static_cast<t_ephGal*>(_eph.value(prn)->prev);
-      _eph.value(prn)->prev = _eph.value(prn)->last;
-      _eph.value(prn)->last = new t_ephGal();
-      static_cast<t_ephGal*>(_eph.value(prn)->last)->set(&galeph);
-    }
-  }
-  else {
-    t_ephGal* eLast = new t_ephGal();
-    eLast->set(&galeph);
-    _eph.insert(prn, new t_ephPair());
-    _eph[prn]->last = eLast;
-  }
-}
Index: /trunk/BNC/bncpppclient.h
===================================================================
--- /trunk/BNC/bncpppclient.h	(revision 2777)
+++ /trunk/BNC/bncpppclient.h	(revision 2778)
@@ -43,10 +43,13 @@
   double       P1;
   double       P2;
+  double       P5;
   double       P3;
   double       L1;
   double       L2;
+  double       L5;
   double       L3;
   codeType     codeTypeF1;
   codeType     codeTypeF2;
+  codeType     codeTypeF5;
   ColumnVector xx;
   ColumnVector vv;
@@ -73,11 +76,19 @@
       delete itGlo.value();
     }
+    QMapIterator<QString, t_satData*> itGal(satDataGal);
+    while (itGal.hasNext()) {
+      itGal.next();
+      delete itGal.value();
+    }
   }
   unsigned sizeGPS() const {return satDataGPS.size();}
   unsigned sizeGlo() const {return satDataGlo.size();}
-  unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size();}
+  unsigned sizeGal() const {return satDataGal.size();}
+  unsigned sizeAll() const {return satDataGPS.size() + satDataGlo.size() +
+                                   satDataGal.size();}
   bncTime                    tt;
   QMap<QString, t_satData*> satDataGPS;
   QMap<QString, t_satData*> satDataGlo;
+  QMap<QString, t_satData*> satDataGal;
 };
 
@@ -139,8 +150,10 @@
       slipCntL1 = -1;
       slipCntL2 = -1;
+      slipCntL5 = -1;
     }
     ~slipInfo(){}
     int slipCntL1;
     int slipCntL2;
+    int slipCntL5;
   };
 
