Index: /trunk/BNS/bns.cpp
===================================================================
--- /trunk/BNS/bns.cpp	(revision 2460)
+++ /trunk/BNS/bns.cpp	(revision 2461)
@@ -46,4 +46,7 @@
   bnsSettings settings;
 
+  _GPSweek   = 0;
+  _GPSweeks  = 0;
+   
   // Set Proxy (application-wide)
   // ----------------------------
@@ -314,5 +317,5 @@
     if (_clkSocket && _clkSocket->state() == QAbstractSocket::ConnectedState) {
       if ( _clkSocket->canReadLine()) {
-        readEpoch();
+        readRecords();
       }
       else {
@@ -330,34 +333,38 @@
 void t_bns::readEpoch() {
 
+  QTextStream in(_clkLine);
+
+  QString hlp;
+  in >> hlp >> _year >> _month >> _day >> _hour >> _min >> _sec;
+
+  GPSweekFromYMDhms(_year, _month, _day, _hour, _min, _sec, _GPSweek, _GPSweeks);
+
+  if (_echoStream) {
+    *_echoStream << _clkLine;
+    _echoStream->flush();
+  }
+  emit(newClkBytes(_clkLine.length()));
+}
+
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_bns::readRecords() {
+
   bnsSettings settings;
 
   // Read the first line (if not already read)
   // -----------------------------------------
-  if (_clkLine.indexOf('*') == -1) {
+  if ( _GPSweek == 0 and _clkLine.indexOf('*') == -1 ) {
+       
     _clkLine = _clkSocket->readLine();
-    if (_echoStream) {
-      *_echoStream << _clkLine;
-      _echoStream->flush();
-    }
-    emit(newClkBytes(_clkLine.length()));
-  }
-
-  if (_clkLine.indexOf('*') == -1) {
-    return;
-  }
-
-  QTextStream in(_clkLine);
-
-  QString hlp;
-  int     year, month, day, hour, min;
-  double  sec;
-  in >> hlp >> year >> month >> day >> hour >> min >> sec;
-
-  int     GPSweek;
-  double  GPSweeks;
-
-  GPSweekFromYMDhms(year, month, day, hour, min, sec, GPSweek, GPSweeks);
-
-  QStringList prns;
+//  cout << "trying epoch:" << _clkLine.data() << endl;
+     
+    if (_clkLine.indexOf('*') == -1) {
+      return;
+    }else{
+      readEpoch();
+    }    
+  }
 
   // Loop over all satellites
@@ -368,18 +375,35 @@
       break;
     }
+
+    QByteArray tmp = _clkSocket->peek(80);
+
+    // found epoch, but not first record, break
+    if( tmp.indexOf('*') >= 0 and lines.size() > 0 ) {
+      // cout << "find epoch, not first, thus break" << endl;
+      break;
+    }
+     
     _clkLine = _clkSocket->readLine();
+
+    // found epoch, but still first record, continue
+    if (_clkLine[0] == '*') {
+      // cout << "epoch:" << _clkLine.data();
+      readEpoch();
+    }
+
+    if (_clkLine[0] == 'P') {
+      // cout << "data:" << _clkLine.data();
+      _clkLine.remove(0,1);
+      lines.push_back(_clkLine);
+    }
+     
     if (_echoStream) {
       *_echoStream << _clkLine;
       _echoStream->flush();
     }
-    if (_clkLine[0] == '*') {
-      return;
-    }
-    if (_clkLine[0] == 'P') {
-      _clkLine.remove(0,1);
-      lines.push_back(_clkLine);
-    } 
-  }
-
+     
+  }
+
+  // some data records to be processed ?
   if (lines.size() > 0) {
 
@@ -393,7 +417,7 @@
         struct ClockOrbit co;
         memset(&co, 0, sizeof(co));
-        co.GPSEpochTime      = (int)GPSweeks;
-        co.GLONASSEpochTime  = (int)fmod(GPSweeks, 86400.0) 
-                             + 3 * 3600 - gnumleap(year, month, day);
+        co.GPSEpochTime      = (int)_GPSweeks;
+        co.GLONASSEpochTime  = (int)fmod(_GPSweeks, 86400.0) 
+                             + 3 * 3600 - gnumleap(_year, _month, _day);
         co.ClockDataSupplied = 1;
         co.OrbitDataSupplied = 1;
@@ -402,7 +426,7 @@
         struct Bias bias;
         memset(&bias, 0, sizeof(bias));
-        bias.GPSEpochTime      = (int)GPSweeks;
-        bias.GLONASSEpochTime  = (int)fmod(GPSweeks, 86400.0) 
-                               + 3 * 3600 - gnumleap(year, month, day);
+        bias.GPSEpochTime      = (int)_GPSweeks;
+        bias.GLONASSEpochTime  = (int)fmod(_GPSweeks, 86400.0) 
+                               + 3 * 3600 - gnumleap(_year, _month, _day);
 
         for (int ii = 0; ii < lines.size(); ii++) {
@@ -452,5 +476,4 @@
             }
           }
-      
           if (ep != 0) {
             struct ClockOrbit::SatData* sd = 0;
@@ -467,5 +490,5 @@
               processSatellite(oldEph, ic, _caster.at(ic)->crdTrafo(), 
                                _caster.at(ic)->CoM(), ep, 
-                               GPSweek, GPSweeks, prn, xx, sd, outLine);
+                               _GPSweek, _GPSweeks, prn, xx, sd, outLine);
               _caster.at(ic)->printAscii(outLine);
             }
Index: /trunk/BNS/bns.h
===================================================================
--- /trunk/BNS/bns.h	(revision 2460)
+++ /trunk/BNS/bns.h	(revision 2461)
@@ -69,4 +69,5 @@
   void openCaster();
   void readEpoch();
+  void readRecords();
   void processSatellite(int oldEph, int iCaster, const QString trafo, bool CoM,
                         t_eph* ep, int GPSweek, double GPSweeks, 
@@ -89,4 +90,14 @@
   bnsSP3*                   _sp3;
   QByteArray                _clkLine;
+  
+  int    _GPSweek;
+  double _GPSweeks;
+  int    _year;
+  int    _month;
+  int    _day;
+  int    _hour;
+  int    _min;
+  double _sec;
+
   double _dx;
   double _dy;
Index: /trunk/BNS/bnsoutf.cpp
===================================================================
--- /trunk/BNS/bnsoutf.cpp	(revision 2460)
+++ /trunk/BNS/bnsoutf.cpp	(revision 2461)
@@ -110,5 +110,5 @@
 
   if (nextEpoch) {
-   *nextEpoch = QDateTime(nextDate, nextTime);
+    *nextEpoch = QDateTime(nextDate, nextTime, Qt::UTC);
   }
 
