Index: /trunk/BNS/bns.cpp
===================================================================
--- /trunk/BNS/bns.cpp	(revision 777)
+++ /trunk/BNS/bns.cpp	(revision 778)
@@ -28,4 +28,6 @@
  
   _bnseph = new t_bnseph(parent);
+
+  connect(_bnseph, SIGNAL(newEph(gpsEph*)), this, SLOT(slotNewEph(gpsEph*)));
 
   connect(_bnseph, SIGNAL(newMessage(QByteArray)),
@@ -142,2 +144,19 @@
 }
 
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_bns::slotNewEph(gpsEph* ep) {
+
+  QMutexLocker locker(&_mutex);
+
+  t_ephPair* pair;
+  if ( !_ephList.contains(ep->prn) ) {
+    pair = new t_ephPair();
+    _ephList.insert(ep->prn, pair);
+  }
+  else {
+    pair = _ephList[ep->prn];
+  }
+
+
+}
Index: /trunk/BNS/bns.h
===================================================================
--- /trunk/BNS/bns.h	(revision 777)
+++ /trunk/BNS/bns.h	(revision 778)
@@ -6,4 +6,20 @@
 
 #include "bnseph.h"
+
+class t_ephPair {
+ public:
+  t_ephPair() {
+    eph    = 0;
+    oldEph = 0;
+  }
+
+  ~t_ephPair() {
+    delete eph;
+    delete oldEph;
+  }
+
+  gpsEph* eph;
+  gpsEph* oldEph;
+};
 
 class t_bns : public QThread {
@@ -19,4 +35,5 @@
  
  private slots:
+  void slotNewEph(gpsEph* ep);
   void slotNewConnection();
   void slotMessage(const QByteArray msg);
@@ -26,9 +43,10 @@
   void deleteBnsEph();
   void openCaster();
-  QTcpServer* _clkServer;
-  QTcpSocket* _clkSocket;
-  QTcpSocket* _outSocket;
-  t_bnseph*   _bnseph;
-  QMutex      _mutex;
+  QTcpServer*               _clkServer;
+  QTcpSocket*               _clkSocket;
+  QTcpSocket*               _outSocket;
+  t_bnseph*                 _bnseph;
+  QMutex                    _mutex;
+  QMap<QString, t_ephPair*> _ephList;
 };
 #endif
Index: /trunk/BNS/bnseph.cpp
===================================================================
--- /trunk/BNS/bnseph.cpp	(revision 777)
+++ /trunk/BNS/bnseph.cpp	(revision 778)
@@ -70,14 +70,15 @@
 void t_bnseph::readEph() {
 
-  gpsephemeris* ep = new gpsephemeris;
+  gpsEph* ep = new gpsEph;
 
   QByteArray line = _socket->readLine();
   QTextStream in1(line);
 
-  QString prn;
   int     year, month, day, hour, minute, second;
 
-  in1 >> prn >> year >> month >> day >> hour >> minute >> second
+  in1 >> ep->prn >> year >> month >> day >> hour >> minute >> second
       >> ep->clock_bias >> ep->clock_drift >> ep->clock_driftrate;
+
+  if (year < 100) year += 2000;
 
   QDateTime dateTime(QDate(year,month,day), QTime(hour, minute, second), 
@@ -107,6 +108,7 @@
 
   double dd;
+  int    GPSweek;
   int    ii;
-  in6 >>  ep->IDOT >> dd >> ep->GPSweek >> ii;
+  in6 >>  ep->IDOT >> dd >> GPSweek >> ii;
 
   line = _socket->readLine();
@@ -114,8 +116,11 @@
 
   double hlp;
-  in7 >>  hlp >> ep->SVhealth >> ep->TGD >> ep->IODC;
+  double health;
+  in7 >>  hlp >> health >> ep->TGD >> ep->IODC;
 
   line = _socket->readLine();
   QTextStream in8(line);
   in8 >> ep->TOW;
+
+  emit(newEph(ep));
 }
Index: /trunk/BNS/bnseph.h
===================================================================
--- /trunk/BNS/bnseph.h	(revision 777)
+++ /trunk/BNS/bnseph.h	(revision 778)
@@ -5,34 +5,35 @@
 #include <QtNetwork>
 
-struct gpsephemeris {
-  int    flags;            /* GPSEPHF_xxx */
-  int    satellite;        /*  SV ID   ICD-GPS data position */
-  int    IODE;             /*          [s2w3b01-08]              */
-  int    URAindex;         /*  [1..15] [s1w3b13-16]              */
-  int    SVhealth;         /*          [s1w3b17-22]              */
-  int    GPSweek;          /*          [s1w3b01-10]              */
-  int    IODC;             /*          [s1w3b23-32,w8b01-08]     */
-  int    TOW;              /*  [s]     [s1w2b01-17]              */
-  int    TOC;              /*  [s]     [s1w8b09-24]              */
-  int    TOE;              /*  [s]     [s2w10b1-16]              */
-  double clock_bias;       /*  [s]     [s1w10b1-22, af0]         */
-  double clock_drift;      /*  [s/s]   [s1w9b09-24, af1]         */
-  double clock_driftrate;  /*  [s/s^2] [s1w9b01-08, af2]         */
-  double Crs;              /*  [m]     [s2w3b09-24]              */
-  double Delta_n;          /*  [rad/s] [s2w4b01-16 * Pi]         */
-  double M0;               /*  [rad]   [s2w4b17-24,w5b01-24 * Pi]*/
-  double Cuc;              /*  [rad]   [s2w6b01-16]              */
-  double e;                /*          [s2w6b17-24,w6b01-24]     */
-  double Cus;              /*  [rad]   [s2w8b01-16]              */
-  double sqrt_A;           /*  [m^0.5] [s2w8b16-24,w9b01-24]     */
-  double Cic;              /*  [rad]   [s3w3b01-16]              */
-  double OMEGA0;           /*  [rad]   [s3w3b17-24,w4b01-24 * Pi]*/
-  double Cis;              /*  [rad]   [s3w5b01-16]              */
-  double i0;               /*  [rad]   [s3w5b17-24,w6b01-24 * Pi]*/
-  double Crc;              /*  [m]     [s3w701-16]               */
-  double omega;            /*  [rad]   [s3w7b17-24,w8b01-24 * Pi]*/
-  double OMEGADOT;         /*  [rad/s] [s3w9b01-24 * Pi]         */
-  double IDOT;             /*  [rad/s] [s3w10b9-22 * Pi]         */
-  double TGD;              /*  [s]     [s1w7b17-24]              */
+class gpsEph {
+ public:
+  QString prn;
+  int    GPSweek;          
+  int    TOW;              //  [s]    
+  int    TOC;              //  [s]    
+  int    TOE;              //  [s]    
+  int    IODE;             
+  int    IODC;             
+
+  double clock_bias;       //  [s]    
+  double clock_drift;      //  [s/s]  
+  double clock_driftrate;  //  [s/s^2]
+
+  double Crs;              //  [m]    
+  double Delta_n;          //  [rad/s]
+  double M0;               //  [rad]  
+  double Cuc;              //  [rad]  
+  double e;                //         
+  double Cus;              //  [rad]  
+  double sqrt_A;           //  [m^0.5]
+  double Cic;              //  [rad]  
+  double OMEGA0;           //  [rad]  
+  double Cis;              //  [rad]  
+  double i0;               //  [rad]  
+  double Crc;              //  [m]    
+  double omega;            //  [rad]  
+  double OMEGADOT;         //  [rad/s]
+  double IDOT;             //  [rad/s]
+
+  double TGD;              //  [s]    
 };
 
@@ -45,4 +46,5 @@
 
  signals:
+  void newEph(gpsEph* eph);
   void newMessage(const QByteArray msg);
   void error(const QByteArray msg);
