Index: trunk/BNC/src/upload/bncephuploadcaster.cpp
===================================================================
--- trunk/BNC/src/upload/bncephuploadcaster.cpp	(revision 7781)
+++ trunk/BNC/src/upload/bncephuploadcaster.cpp	(revision 7889)
@@ -27,22 +27,24 @@
 bncEphUploadCaster::bncEphUploadCaster() : bncEphUser(true) {
   bncSettings settings;
+  int     sampl    = settings.value("uploadSamplRtcmEph").toInt();
 
-  QString mountpoint = settings.value("uploadEphMountpoint").toString();
-  if (mountpoint.isEmpty()) {
-    _ephUploadCaster = 0;
-  }
-  else {
-    QString outHost  = settings.value("uploadEphHost").toString();
-    int     outPort  = settings.value("uploadEphPort").toInt();
-    QString password = settings.value("uploadEphPassword").toString();
-    int     sampl    = settings.value("uploadEphSample").toInt();
+  // List of upload casters
+  // ----------------------
+  int iRow = -1;
+  QListIterator<QString> it(settings.value("uploadEphMountpointsOut").toStringList());
+  while (it.hasNext()) {
+    QStringList hlp = it.next().split(",");
+    if (hlp.size() > 3) {
+      ++iRow;
+      int  outPort = hlp[1].toInt();
+      bncUploadCaster* newCaster = new bncUploadCaster(hlp[2], hlp[0], outPort,
+                                                       hlp[3], iRow, sampl);
 
-    _ephUploadCaster = new bncUploadCaster(mountpoint, outHost, outPort,
-                                           password, -1, sampl);
+      connect(newCaster, SIGNAL(newBytes(QByteArray,double)),
+              this, SIGNAL(newBytes(QByteArray,double)));
 
-    connect(_ephUploadCaster, SIGNAL(newBytes(QByteArray,double)),
-          this, SIGNAL(newBytes(QByteArray,double)));
-
-    _ephUploadCaster->start();
+      newCaster->start();
+      _casters.push_back(newCaster);
+    }
   }
 }
@@ -51,6 +53,6 @@
 ////////////////////////////////////////////////////////////////////////////
 bncEphUploadCaster::~bncEphUploadCaster() {
-  if (_ephUploadCaster) {
-    _ephUploadCaster->deleteSafely();
+  for (int ic = 0; ic < _casters.size(); ic++) {
+    _casters[ic]->deleteSafely();
   }
 }
@@ -59,57 +61,72 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncEphUploadCaster::ephBufferChanged() {
-  if (_ephUploadCaster) {
-    QByteArray outBuffer;
+  bncSettings settings;
+  int iRow = -1;
+  QListIterator<QString> it(settings.value("uploadEphMountpointsOut").toStringList());
+  while (it.hasNext()) {
+    QStringList hlp = it.next().split(",");
+    if (hlp.size() > 3) {
+      ++iRow;
+      QString system = hlp[4];
+      QByteArray outBuffer;
 
-    QDateTime now = currentDateAndTimeGPS();
-    bncTime currentTime(now.toString(Qt::ISODate).toStdString());
+      QDateTime now = currentDateAndTimeGPS();
+      bncTime currentTime(now.toString(Qt::ISODate).toStdString());
 
-    QListIterator<QString> it(prnList());
-    while (it.hasNext()) {
-      const t_eph* eph = ephLast(it.next());
+      QListIterator<QString> it(prnList());
+      while (it.hasNext()) {
+        const t_eph* eph = ephLast(it.next());
 
-      bncTime toc = eph->TOC();
-      double timeDiff = fabs(toc - currentTime);
+        bncTime toc = eph->TOC();
+        double timeDiff = fabs(toc - currentTime);
 
-      const t_ephGPS*  ephGPS  = dynamic_cast<const t_ephGPS*>(eph);
-      const t_ephGlo*  ephGlo  = dynamic_cast<const t_ephGlo*>(eph);
-      const t_ephGal*  ephGal  = dynamic_cast<const t_ephGal*>(eph);
-      const t_ephSBAS* ephSBAS = dynamic_cast<const t_ephSBAS*>(eph);
-      const t_ephBDS*  ephBDS  = dynamic_cast<const t_ephBDS*>(eph);
+        const t_ephGPS*  ephGPS  = dynamic_cast<const t_ephGPS*>(eph);
+        const t_ephGlo*  ephGlo  = dynamic_cast<const t_ephGlo*>(eph);
+        const t_ephGal*  ephGal  = dynamic_cast<const t_ephGal*>(eph);
+        const t_ephSBAS* ephSBAS = dynamic_cast<const t_ephSBAS*>(eph);
+        const t_ephBDS*  ephBDS  = dynamic_cast<const t_ephBDS*>(eph);
 
-      unsigned char Array[80];
-      int size = 0;
+        unsigned char Array[80];
+        int size = 0;
 
-      if (ephGPS) {
-        if (timeDiff <= 4*3600) {
-          size = t_ephEncoder::RTCM3(*ephGPS, Array);
+        if (ephGPS && ephGPS->type() == t_eph::GPS &&
+            (system == "ALL" || system == "GPS")) {
+          if (timeDiff <= 4*3600) {
+            size = t_ephEncoder::RTCM3(*ephGPS, Array);
+          }
+        }
+        else if (ephGPS && ephGPS->type() == t_eph::QZSS &&
+            (system == "ALL" || system == "QZSS")) {
+          if (timeDiff <= 4*3600) {
+            size = t_ephEncoder::RTCM3(*ephGPS, Array);
+          }
+        }
+        else if (ephGlo && (system == "ALL" || system == "GLONASS")) {
+          if (timeDiff <= 1*3600) {
+            size = t_ephEncoder::RTCM3(*ephGlo, Array);
+          }
+        }
+        else if (ephGal && (system == "ALL" || system == "Galileo")) {
+          if (timeDiff <= 4*3600) {
+            size = t_ephEncoder::RTCM3(*ephGal, Array);
+          }
+        }
+        else if (ephSBAS && (system == "ALL" || system == "SBAS")) {
+          if (timeDiff <= 600) {
+            size = t_ephEncoder::RTCM3(*ephSBAS, Array);
+          }
+        }
+        else if (ephBDS && (system == "ALL" || system == "BDS")) {
+          if (timeDiff <= 6*3600) {
+            size = t_ephEncoder::RTCM3(*ephBDS, Array);
+          }
+        }
+        if (size > 0) {
+          outBuffer += QByteArray((char*) Array, size);
         }
       }
-      else if (ephGlo) {
-        if (timeDiff <= 1*3600) {
-          size = t_ephEncoder::RTCM3(*ephGlo, Array);
-        }
+      if (outBuffer.size() > 0) {
+        _casters.at(iRow)->setOutBuffer(outBuffer);
       }
-      else if (ephGal) {
-        if (timeDiff <= 4*3600) {
-          size = t_ephEncoder::RTCM3(*ephGal, Array);
-        }
-      }
-      else if (ephSBAS) {
-        if (timeDiff <= 600) {
-          size = t_ephEncoder::RTCM3(*ephSBAS, Array);
-        }
-      }
-      else if (ephBDS) {
-        if (timeDiff <= 6*3600) {
-          size = t_ephEncoder::RTCM3(*ephBDS, Array);
-        }
-      }
-      if (size > 0) {
-        outBuffer += QByteArray((char*) Array, size);
-      }
-    }
-    if (outBuffer.size() > 0) {
-      _ephUploadCaster->setOutBuffer(outBuffer);
     }
   }
Index: trunk/BNC/src/upload/bncephuploadcaster.h
===================================================================
--- trunk/BNC/src/upload/bncephuploadcaster.h	(revision 7781)
+++ trunk/BNC/src/upload/bncephuploadcaster.h	(revision 7889)
@@ -16,5 +16,6 @@
   virtual void ephBufferChanged();
  private:
-  bncUploadCaster* _ephUploadCaster;
+//  bncUploadCaster* _ephUploadCaster;
+  QVector<bncUploadCaster*> _casters;
 };
 
