Index: trunk/BNC/upload/bncrtnetdecoder.cpp
===================================================================
--- trunk/BNC/upload/bncrtnetdecoder.cpp	(revision 3208)
+++ trunk/BNC/upload/bncrtnetdecoder.cpp	(revision 3209)
@@ -41,5 +41,4 @@
 #include <iostream>
 #include "bncrtnetdecoder.h"
-#include "bncutils.h"
 #include "bncsettings.h"
 
@@ -79,8 +78,7 @@
 //////////////////////////////////////////////////////////////////////// 
 t_irc bncRtnetDecoder::Decode(char* buffer, int bufLen, vector<string>& errmsg) {
-  QMutexLocker locker(&_mutex);
   errmsg.clear();
   for (int ic = 0; ic < _casters.size(); ic++) {
-    _casters[ic]->decodeRtnetStream(buffer, bufLen, _eph);
+    _casters[ic]->decodeRtnetStream(buffer, bufLen);
   }
   return success;
Index: trunk/BNC/upload/bncrtnetdecoder.h
===================================================================
--- trunk/BNC/upload/bncrtnetdecoder.h	(revision 3208)
+++ trunk/BNC/upload/bncrtnetdecoder.h	(revision 3209)
@@ -28,10 +28,8 @@
 #include <fstream>
 #include <QtCore>
-#include "bncephuser.h"
-#include "bnctime.h"
 #include "bncuploadcaster.h"
 #include "RTCM/GPSDecoder.h"
 
-class bncRtnetDecoder: public GPSDecoder, public bncEphUser {
+class bncRtnetDecoder: public GPSDecoder {
  public:
   bncRtnetDecoder();
Index: trunk/BNC/upload/bncuploadcaster.cpp
===================================================================
--- trunk/BNC/upload/bncuploadcaster.cpp	(revision 3208)
+++ trunk/BNC/upload/bncuploadcaster.cpp	(revision 3209)
@@ -182,8 +182,8 @@
     _t0  = settings.value("trafo_t0").toDouble();
   }
- 
-  // Deep copy of ephemerides
-  // ------------------------
-  _ephMap = 0;
+
+  // Member that receives the ephemeris
+  // ----------------------------------
+  _ephUser = new bncEphUser();
 }
 
@@ -204,16 +204,8 @@
     wait();
   }
-  if (_ephMap) {
-    QMapIterator<QString, t_eph*> it(*_ephMap);
-    while (it.hasNext()) {
-      it.next();
-      t_eph* eph = it.value();
-      delete eph;
-    }
-    delete _ephMap;
-  }
   delete _outFile;
   delete _rnx;
   delete _sp3;
+  delete _ephUser;
 }
 
@@ -306,47 +298,7 @@
 // 
 ////////////////////////////////////////////////////////////////////////////
-void bncUploadCaster::decodeRtnetStream(char* buffer, int bufLen,
-                      const QMap<QString, bncEphUser::t_ephPair*>& ephPairMap) {
+void bncUploadCaster::decodeRtnetStream(char* buffer, int bufLen) {
                                         
   QMutexLocker locker(&_mutex);
-
-  // Delete old ephemeris
-  // --------------------
-  if (_ephMap) {
-    QMapIterator<QString, t_eph*> it(*_ephMap);
-    while (it.hasNext()) {
-      it.next();
-      t_eph* eph = it.value();
-      delete eph;
-    }
-    delete _ephMap;
-  }
-  _ephMap = new QMap<QString, t_eph*>;
-
-  // Make a deep copy of ephemeris
-  // -----------------------------
-  QMapIterator<QString, bncEphUser::t_ephPair*> it(ephPairMap);
-  while (it.hasNext()) {
-    it.next();
-    bncEphUser::t_ephPair* pair = it.value();
-    t_eph* ep = pair->last;
-    if (pair->prev && ep && 
-        ep->receptDateTime().secsTo(QDateTime::currentDateTime()) < 60) {
-      ep = pair->prev;
-    }
-    QString prn(ep->prn().c_str());
-    if      (prn[0] == 'G') {
-      t_ephGPS* epGPS = static_cast<t_ephGPS*>(ep);
-      (*_ephMap)[prn] = new t_ephGPS(*epGPS);
-    }
-    else if (prn[0] == 'R') {
-      t_ephGlo* epGlo = static_cast<t_ephGlo*>(ep);
-      (*_ephMap)[prn] = new t_ephGlo(*epGlo);
-    }
-    else if (prn[0] == 'E') {
-      t_ephGal* epGal = static_cast<t_ephGal*>(ep);
-      (*_ephMap)[prn] = new t_ephGal(*epGal);
-    }
-  }
 
   // Append to buffer
@@ -418,6 +370,11 @@
     }
 
-    if ( _ephMap->contains(prn) ) {
-      t_eph* ep = (*_ephMap)[prn];
+    const bncEphUser::t_ephPair* ephPair = _ephUser->ephPair(prn);
+    if (ephPair) {
+      t_eph* eph = ephPair->last;
+      if (ephPair->prev && 
+           eph->receptDateTime().secsTo(QDateTime::currentDateTime()) < 60) {
+        eph = ephPair->prev;
+      }
 
       in >> xx(1) >> xx(2) >> xx(3) >> xx(4) >> xx(5) 
@@ -448,5 +405,6 @@
       if (sd) {
         QString outLine;
-        processSatellite(ep, _epoTime.gpsw(), _epoTime.gpssec(), prn, xx, sd, outLine);
+        processSatellite(eph, _epoTime.gpsw(), _epoTime.gpssec(), prn, 
+                         xx, sd, outLine);
         if (_outFile) {
           _outFile->write(_epoTime.gpsw(), _epoTime.gpssec(), outLine);
Index: trunk/BNC/upload/bncuploadcaster.h
===================================================================
--- trunk/BNC/upload/bncuploadcaster.h	(revision 3208)
+++ trunk/BNC/upload/bncuploadcaster.h	(revision 3209)
@@ -25,6 +25,5 @@
   void deleteSafely();
   virtual void run();
-  void decodeRtnetStream(char* buffer, int bufLen,
-                         const QMap<QString, bncEphUser::t_ephPair*>& ephMap);
+  void decodeRtnetStream(char* buffer, int bufLen);
 
  signals:
@@ -42,9 +41,9 @@
   void crdTrafo(int GPSWeek, ColumnVector& xyz);
 
-  QMap<QString, t_eph*>* _ephMap;
-  bool                   _isToBeDeleted;
-  QMutex                 _mutex;  
-  QString                _rtnetStreamBuffer;
-  bncTime                _epoTime;
+  bncEphUser*    _ephUser;
+  bool           _isToBeDeleted;
+  QMutex         _mutex;  
+  QString        _rtnetStreamBuffer;
+  bncTime        _epoTime;
   QString        _mountpoint;
   QString        _outHost;
