Index: /trunk/BNC/bnccaster.cpp
===================================================================
--- /trunk/BNC/bnccaster.cpp	(revision 1169)
+++ /trunk/BNC/bnccaster.cpp	(revision 1170)
@@ -44,4 +44,5 @@
 
 #include "bnccaster.h"
+#include "bncapp.h"
 #include "bncgetthread.h"
 #include "bncutils.h"
@@ -90,9 +91,5 @@
   _lastDumpSec   = 0; 
 
-  _samplingRate = settings.value("binSampl").toInt();
-  _waitTime     = settings.value("waitTime").toInt();
-  if (_waitTime < 1) {
-    _waitTime = 1;
-  }
+  _confTimer = 0;
 }
 
@@ -191,4 +188,6 @@
   _staIDs.push_back(getThread->staID());
   _threads.push_back(getThread);
+
+  getThread->start();
 }
 
@@ -308,2 +307,122 @@
   }
 }
+
+// Reread configuration 
+////////////////////////////////////////////////////////////////////////////
+void bncCaster::slotReadMountpoints() {
+
+  QSettings settings;
+
+  // Reread several options
+  // ----------------------
+  _samplingRate = settings.value("binSampl").toInt();
+  _waitTime     = settings.value("waitTime").toInt();
+  if (_waitTime < 1) {
+    _waitTime = 1;
+  }
+
+  // Add new mountpoints
+  // -------------------
+  int iMount = -1;
+  QListIterator<QString> it(settings.value("mountPoints").toStringList());
+  while (it.hasNext()) {
+    ++iMount;
+    QStringList hlp = it.next().split(" ");
+    if (hlp.size() <= 1) continue;
+    QUrl url(hlp[0]);
+
+    // Does it already exist?
+    // ----------------------
+    bool existFlg = false;
+    QListIterator<bncGetThread*> iTh(_threads);
+    while (iTh.hasNext()) {
+      bncGetThread* thread = iTh.next();
+      if (thread->mountPoint() == url) {
+        existFlg = true;
+        break;
+      }
+    }
+
+    // New bncGetThread
+    // ----------------
+    if (!existFlg) {
+      QByteArray format    = hlp[1].toAscii();
+      QByteArray latitude  = hlp[2].toAscii();
+      QByteArray longitude = hlp[3].toAscii();
+      QByteArray nmea      = hlp[4].toAscii();
+      
+      bncGetThread* getThread = new bncGetThread(url, format, latitude, 
+                                                 longitude, nmea, iMount);
+      
+      bncApp* app = (bncApp*) qApp;
+      app->connect(getThread, SIGNAL(newMessage(QByteArray)), 
+                   app, SLOT(slotMessage(const QByteArray)));
+
+      std::cout << "newThread "  << getThread->staID().data() << std::endl;
+      
+      addGetThread(getThread);
+    }
+  }
+
+  // Remove mountpoints
+  // ------------------
+  QListIterator<bncGetThread*> iTh(_threads);
+  while (iTh.hasNext()) {
+    bncGetThread* thread = iTh.next();
+
+    bool existFlg = false;
+    QListIterator<QString> it(settings.value("mountPoints").toStringList());
+    while (it.hasNext()) {
+      QStringList hlp = it.next().split(" ");
+      if (hlp.size() <= 1) continue;
+      QUrl url(hlp[0]);
+
+      if (thread->mountPoint() == url) {
+        existFlg = true;
+        break;
+      }
+    }
+
+    if (!existFlg) {
+      std::cout << "old Thread "  << thread->staID().data() << std::endl;
+      disconnect(thread, 0, 0, 0);
+      _staIDs.removeAll(thread->staID());
+      _threads.removeAll(thread);
+      thread->terminate();
+      thread->wait();
+      delete thread;
+    }
+  }
+
+  // (Re-) Start the configuration timer
+  // -----------------------------------
+  int ms = 0;
+
+  if (_confTimer) {
+    ms = 1000 * _confInterval;
+  }
+  else {
+    _confTimer = new QTimer();
+    connect(_confTimer, SIGNAL(timeout()), this, SLOT(slotReadMountpoints()));
+
+    QTime currTime = currentDateAndTimeGPS().time();
+    QTime nextShotTime;
+
+    if      (settings.value("onTheFlyInterval").toString() == "1 min") {
+      _confInterval = 60;
+      nextShotTime = QTime(currTime.hour(), currTime.minute()+1, 0);
+    }
+    else if (settings.value("onTheFlyInterval").toString() == "1 hour") {
+      _confInterval = 3600;
+      nextShotTime = QTime(currTime.hour()+1, 0, 0);
+    }
+    else {
+      _confInterval = 86400;
+      nextShotTime = QTime(23, 59, 59, 999);
+    }
+
+    ms = currTime.msecsTo(nextShotTime);
+  }
+
+  _confTimer->start(ms);
+}
Index: /trunk/BNC/bnccaster.h
===================================================================
--- /trunk/BNC/bnccaster.h	(revision 1169)
+++ /trunk/BNC/bnccaster.h	(revision 1170)
@@ -45,4 +45,5 @@
  public slots:
    void newObs(QByteArray staID, bool firstObs, p_obs obs);
+   void slotReadMountpoints();
 
  signals:
@@ -69,4 +70,6 @@
    long                    _waitTime;
    QMutex                  _mutex;
+   QTimer*                 _confTimer;
+   int                     _confInterval;
 };
 
Index: /trunk/BNC/bncmain.cpp
===================================================================
--- /trunk/BNC/bncmain.cpp	(revision 1169)
+++ /trunk/BNC/bncmain.cpp	(revision 1170)
@@ -169,5 +169,16 @@
     ((bncApp*)qApp)->slotMessage("============ Start BNC ============");
 
-    if (fileInput) {
+    // Normal case - data from Internet
+    // --------------------------------
+    if (!fileInput) {
+      caster->slotReadMountpoints();
+      if (caster->numStations() == 0) {
+        return 0;
+      }
+    }
+
+    // Special case - data from file
+    // -----------------------------
+    else {
       if ( fileName.isEmpty() || format.isEmpty() || 
            dateString.isEmpty() || timeString.isEmpty() ) {
@@ -187,32 +198,4 @@
       
       caster->addGetThread(getThread);
-      
-      getThread->start();
-    }
-    else {
-      int iMount = -1;
-      QListIterator<QString> it(settings.value("mountPoints").toStringList());
-      while (it.hasNext()) {
-        ++iMount;
-        QStringList hlp = it.next().split(" ");
-        if (hlp.size() <= 1) continue;
-        QUrl url(hlp[0]);
-        QByteArray format = hlp[1].toAscii();
-        QByteArray latitude = hlp[2].toAscii();
-        QByteArray longitude = hlp[3].toAscii();
-        QByteArray nmea = hlp[4].toAscii();
-      
-        bncGetThread* getThread = new bncGetThread(url, format, latitude, longitude, nmea, iMount);
-      
-        app.connect(getThread, SIGNAL(newMessage(QByteArray)), 
-                    &app, SLOT(slotMessage(const QByteArray)));
-      
-        caster->addGetThread(getThread);
-      
-        getThread->start();
-      }
-      if (caster->numStations() == 0) {
-        return 0;
-      }
     }
   }
Index: /trunk/BNC/bncwindow.cpp
===================================================================
--- /trunk/BNC/bncwindow.cpp	(revision 1169)
+++ /trunk/BNC/bncwindow.cpp	(revision 1170)
@@ -145,4 +145,12 @@
   if (ii != -1) {
     _rnxIntrComboBox->setCurrentIndex(ii);
+  }
+  _onTheFlyComboBox = new QComboBox();
+  _onTheFlyComboBox->setMaximumWidth(9*ww);
+  _onTheFlyComboBox->setEditable(false);
+  _onTheFlyComboBox->addItems(QString("1 min,1 hour,1 day").split(","));
+  ii = _onTheFlyComboBox->findText(settings.value("onTheFlyInterval").toString());
+  if (ii != -1) {
+    _onTheFlyComboBox->setCurrentIndex(ii);
   }
   _ephIntrComboBox    = new QComboBox();
@@ -372,8 +380,10 @@
   gLayout->addWidget(new QLabel("Append files")    ,1,0 );
   gLayout->addWidget(_rnxAppendCheckBox,     1,1  );
-  gLayout->addWidget(new QLabel("General settings for logfile and file handling."),2, 0, 1, 2, Qt::AlignLeft);
-  gLayout->addWidget(new QLabel("    "),3,0);
+  gLayout->addWidget(new QLabel("Reread Configuration every")    ,2,0 );
+  gLayout->addWidget(_onTheFlyComboBox,     2,1  );
+  gLayout->addWidget(new QLabel("General settings for logfile and file handling."),3, 0, 1, 2, Qt::AlignLeft);
   gLayout->addWidget(new QLabel("    "),4,0);
   gLayout->addWidget(new QLabel("    "),5,0);
+  gLayout->addWidget(new QLabel("    "),6,0);
   ggroup->setLayout(gLayout);
 
@@ -613,4 +623,5 @@
   settings.setValue("rnxScript",   _rnxScrpLineEdit->text());
   settings.setValue("rnxIntr",     _rnxIntrComboBox->currentText());
+  settings.setValue("onTheFlyInterval", _onTheFlyComboBox->currentText());
   settings.setValue("ephIntr",     _ephIntrComboBox->currentText());
   settings.setValue("corrIntr",    _corrIntrComboBox->currentText());
@@ -675,32 +686,8 @@
           this, SLOT(slotMessage(QByteArray)));
 
-  slotMessage("============ Start BNC ============");
+  _caster->slotReadMountpoints();
+
+  slotMessage                 ("============ Start BNC ============");
   ((bncApp*)qApp)->slotMessage("============ Start BNC ============");
-
-  for (int iRow = 0; iRow < _mountPointsTable->rowCount(); iRow++) {
-    QUrl url( "//" + _mountPointsTable->item(iRow, 0)->text() + 
-              "@"  + _mountPointsTable->item(iRow, 1)->text() );
-
-    QByteArray format = _mountPointsTable->item(iRow, 2)->text().toAscii();
-
-    QByteArray latitude = _mountPointsTable->item(iRow, 3)->text().toAscii();
-    QByteArray longitude = _mountPointsTable->item(iRow, 4)->text().toAscii();
-    QByteArray nmea = _mountPointsTable->item(iRow, 5)->text().toAscii();
-
-    bncGetThread* getThread = new bncGetThread(url, format, latitude, longitude, nmea, iRow);
-
-    connect(getThread, SIGNAL(newMessage(QByteArray)), 
-            this, SLOT(slotMessage(QByteArray)));
-    connect(getThread, SIGNAL(newMessage(QByteArray)), 
-            (bncApp*)qApp, SLOT(slotMessage(QByteArray)));
-
-    connect(getThread, SIGNAL(newBytes(QByteArray, double)),
-            (bncTableItem*) _mountPointsTable->item(iRow, 6), 
-            SLOT(slotNewBytes(QByteArray, double)));
-
-    _caster->addGetThread(getThread);
-
-    getThread->start();
-  }
 }
 
Index: /trunk/BNC/bncwindow.h
===================================================================
--- /trunk/BNC/bncwindow.h	(revision 1169)
+++ /trunk/BNC/bncwindow.h	(revision 1170)
@@ -129,4 +129,6 @@
     QLineEdit*   _LonLineEdit;
 
+    QComboBox*  _onTheFlyComboBox;
+
     QTextEdit*  _log;
 
