Index: /trunk/BNC/bncmodel.cpp
===================================================================
--- /trunk/BNC/bncmodel.cpp	(revision 2057)
+++ /trunk/BNC/bncmodel.cpp	(revision 2058)
@@ -42,4 +42,6 @@
 
 #include "bncmodel.h"
+#include "bncpppclient.h"
+#include "bancroft.h"
 
 using namespace std;
@@ -55,2 +57,42 @@
 }
 
+// Constructor
+////////////////////////////////////////////////////////////////////////////
+bncModel::bncModel() {
+  _xcBanc.ReSize(4);
+}
+
+// Destructor
+////////////////////////////////////////////////////////////////////////////
+bncModel::~bncModel() {
+}
+
+// Bancroft Solution
+////////////////////////////////////////////////////////////////////////////
+t_irc bncModel::cmpBancroft(t_epoData* epoData) {
+
+  const unsigned MINOBS = 4;
+
+  if (epoData->size() < MINOBS) {
+    return failure;
+  }
+
+  Matrix BB(epoData->size(), 4);
+
+  QMapIterator<QString, t_satData*> it(epoData->satData);
+  int iObs = 0;
+  while (it.hasNext()) {
+    it.next();
+    QString    prn     = it.key();
+    t_satData* satData = it.value();
+    ++iObs;
+    BB(iObs, 1) = satData->xx(1);
+    BB(iObs, 2) = satData->xx(2);
+    BB(iObs, 3) = satData->xx(3);
+    BB(iObs, 4) = satData->P3 + satData->clk;
+  }
+
+  bancroft(BB, _xcBanc);
+
+  return success;
+}
Index: /trunk/BNC/bncmodel.h
===================================================================
--- /trunk/BNC/bncmodel.h	(revision 2057)
+++ /trunk/BNC/bncmodel.h	(revision 2058)
@@ -27,13 +27,29 @@
 
 #include <QtCore>
+#include <newmat.h>
 
-#include <newmat.h>
+#include "bncconst.h"
+
+class t_epoData;
 
 class bncParam {
  public:
+  enum type {CRD_X, CRD_Y, CRD_Z, TROPO, AMB_L3};
   bncParam();
   ~bncParam();
+  double x0;
+};
 
+class bncModel {
+ public:
+  bncModel();
+  ~bncModel();
+  t_irc cmpBancroft(t_epoData* epoData);
+  const ColumnVector& xcBanc() const {return _xcBanc;}
+  
  private:
+  Matrix       _QQ;
+  ColumnVector _xx;
+  ColumnVector _xcBanc;
 };
 
Index: /trunk/BNC/bncpppclient.cpp
===================================================================
--- /trunk/BNC/bncpppclient.cpp	(revision 2057)
+++ /trunk/BNC/bncpppclient.cpp	(revision 2058)
@@ -46,5 +46,5 @@
 #include "bncutils.h"
 #include "bncconst.h"
-#include "bancroft.h"
+#include "bncmodel.h"
 
 extern "C" {
@@ -59,4 +59,5 @@
   _staID   = staID;
   _epoData = 0;
+  _model   = new bncModel();
 }
 
@@ -64,4 +65,5 @@
 ////////////////////////////////////////////////////////////////////////////
 bncPPPclient::~bncPPPclient() {
+  delete _model;
   delete _epoData;
   QMapIterator<QString, t_eph*> it(_eph);
@@ -288,6 +290,4 @@
 void bncPPPclient::processEpoch() {
 
-  const unsigned MINOBS = 4;
-
   // Data Pre-Processing
   // -------------------
@@ -305,35 +305,17 @@
   }
 
-  if (_epoData->size() < MINOBS) {
-    return;
-  }
-
   // Bancroft Solution
   // -----------------
-  Matrix BB(_epoData->size(), 4);
-
-  QMapIterator<QString, t_satData*> it(_epoData->satData);
-  int iObs = 0;
-  while (it.hasNext()) {
-    it.next();
-    QString    prn     = it.key();
-    t_satData* satData = it.value();
-    ++iObs;
-    BB(iObs, 1) = satData->xx(1);
-    BB(iObs, 2) = satData->xx(2);
-    BB(iObs, 3) = satData->xx(3);
-    BB(iObs, 4) = satData->P3 + satData->clk;
-  }
-
-  ColumnVector pos(4);
-  bancroft(BB, pos);
+  if (_model->cmpBancroft(_epoData) != success) {
+    return;
+  }
 
   ostringstream str;
   str.setf(ios::fixed);
-  str << "    PPP "
+  str << "    PPP " << _staID.data() << " " 
       << _epoData->tt.timestr(1) << " " << _epoData->size() << " " 
-      << setw(14) << setprecision(3) << pos(1)              << "  "
-      << setw(14) << setprecision(3) << pos(2)              << "  "
-      << setw(14) << setprecision(3) << pos(3);
+      << setw(14) << setprecision(3) << _model->xcBanc()(1) << "  "
+      << setw(14) << setprecision(3) << _model->xcBanc()(2) << "  "
+      << setw(14) << setprecision(3) << _model->xcBanc()(3);
 
   emit newMessage(QString(str.str().c_str()).toAscii(), true);
Index: /trunk/BNC/bncpppclient.h
===================================================================
--- /trunk/BNC/bncpppclient.h	(revision 2057)
+++ /trunk/BNC/bncpppclient.h	(revision 2058)
@@ -34,4 +34,6 @@
 #include "RTCM/GPSDecoder.h"
 #include "RTCM3/ephemeris.h"
+
+class bncModel;
 
 class t_satData {
@@ -102,4 +104,5 @@
   QMap<QString, t_corr*> _corr;
   t_epoData*             _epoData;
+  bncModel*              _model;
 };
 
