Index: trunk/BNC/bncpppclient.cpp
===================================================================
--- trunk/BNC/bncpppclient.cpp	(revision 2807)
+++ trunk/BNC/bncpppclient.cpp	(revision 2808)
@@ -99,5 +99,4 @@
 
   _staID   = staID;
-  _epoData = 0;
   _model   = new bncModel(staID);
   connect(_model, SIGNAL(newNMEAstr(QByteArray)), 
@@ -109,5 +108,8 @@
 bncPPPclient::~bncPPPclient() {
   delete _model;
-  delete _epoData;
+  while (!_epoData.empty()) {
+    delete _epoData.front();
+    _epoData.pop();
+  }
   QMapIterator<QString, t_ephPair*> it(_eph);
   while (it.hasNext()) {
@@ -143,4 +145,5 @@
 
   t_satData* satData = new t_satData();
+  satData->tt = bncTime(obs.GPSWeek, obs.GPSWeeks);
 
   // Satellite Number
@@ -169,17 +172,14 @@
   }
 
-  // Add new Satellite to the epoch
-  // ------------------------------
-  bncTime tt(obs.GPSWeek, obs.GPSWeeks);
-  
-  if      (!_epoData) {
-    _epoData = new t_epoData();
-    _epoData->tt = tt;
-  }
-  else if (tt != _epoData->tt) {
-    processEpoch();
-    delete _epoData;
-    _epoData = new t_epoData();
-    _epoData->tt = tt;
+  // Add new epoch, process the older ones
+  // -------------------------------------
+  if      (_epoData.size() == 0) {
+    _epoData.push(new t_epoData());
+    _epoData.back()->tt = satData->tt;
+  }
+  else if (satData->tt != _epoData.back()->tt) {
+    processEpochs();
+    _epoData.push(new t_epoData());
+    _epoData.back()->tt = satData->tt;
   }
 
@@ -210,5 +210,5 @@
       satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2;
 
-      _epoData->satDataGPS[satData->prn] = satData;
+      _epoData.back()->satDataGPS[satData->prn] = satData;
     }
     else {
@@ -243,5 +243,5 @@
       satData->lambda3 = c1 * t_CST::c / f1 + c2 * t_CST::c / f2;
 
-      _epoData->satDataGlo[satData->prn] = satData;
+      _epoData.back()->satDataGlo[satData->prn] = satData;
     }
     else {
@@ -266,5 +266,5 @@
       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;
+      _epoData.back()->satDataGal[satData->prn] = satData;
     }
     else {
@@ -552,5 +552,5 @@
   for (int ii = 1; ii <= 10; ii++) {
 
-    bncTime ToT = _epoData->tt - prange / t_CST::c - clkSat;
+    bncTime ToT = satData->tt - prange / t_CST::c - clkSat;
 
     ColumnVector xc(4);
@@ -576,9 +576,9 @@
 // 
 ////////////////////////////////////////////////////////////////////////////
-void bncPPPclient::processEpoch() {
+void bncPPPclient::processFrontEpoch() {
 
   // Data Pre-Processing
   // -------------------
-  QMutableMapIterator<QString, t_satData*> iGPS(_epoData->satDataGPS);
+  QMutableMapIterator<QString, t_satData*> iGPS(_epoData.front()->satDataGPS);
   while (iGPS.hasNext()) {
     iGPS.next();
@@ -593,5 +593,5 @@
   }
 
-  QMutableMapIterator<QString, t_satData*> iGlo(_epoData->satDataGlo);
+  QMutableMapIterator<QString, t_satData*> iGlo(_epoData.front()->satDataGlo);
   while (iGlo.hasNext()) {
     iGlo.next();
@@ -606,5 +606,5 @@
   }
 
-  QMutableMapIterator<QString, t_satData*> iGal(_epoData->satDataGal);
+  QMutableMapIterator<QString, t_satData*> iGal(_epoData.front()->satDataGal);
   while (iGal.hasNext()) {
     iGal.next();
@@ -621,6 +621,14 @@
   // Filter Solution
   // ---------------
-  if (_model->update(_epoData) == success) {
+  if (_model->update(_epoData.front()) == success) {
     emit newPosition(_model->time(), _model->x(), _model->y(), _model->z());
   }
 }
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void bncPPPclient::processEpochs() {
+  processFrontEpoch();
+  delete _epoData.front();
+  _epoData.pop();
+}
Index: trunk/BNC/bncpppclient.h
===================================================================
--- trunk/BNC/bncpppclient.h	(revision 2807)
+++ trunk/BNC/bncpppclient.h	(revision 2808)
@@ -26,4 +26,5 @@
 #define BNCPPPCLIENT_H
 
+#include <queue>
 #include <QtNetwork>
 
@@ -44,4 +45,5 @@
   }
   ~t_satData() {}
+  bncTime      tt;
   QString      prn;
   double       P1;
@@ -178,5 +180,6 @@
   t_irc getSatPos(const bncTime& tt, const QString& prn, 
                   ColumnVector& xc, ColumnVector& vv);
-  void processEpoch();
+  void processEpochs();
+  void processFrontEpoch();
   void applyCorr(const bncTime& tt, const t_corr* cc, ColumnVector& xc, 
                  ColumnVector& vv);
@@ -188,5 +191,5 @@
   QMap<QString, t_corr*>  _corr;
   QMap<QString, t_bias*>  _bias;
-  t_epoData*              _epoData;
+  std::queue<t_epoData*>  _epoData;
   bncModel*               _model;
   bool                    _useGlonass;
