Index: trunk/BNC/src/bncgetthread.cpp
===================================================================
--- trunk/BNC/src/bncgetthread.cpp	(revision 7485)
+++ trunk/BNC/src/bncgetthread.cpp	(revision 7486)
@@ -35,5 +35,5 @@
  * Created:    24-Dec-2005
  *
- * Changes:    
+ * Changes:
  *
  * -----------------------------------------------------------------------*/
@@ -85,9 +85,9 @@
 // Constructor 2
 ////////////////////////////////////////////////////////////////////////////
-bncGetThread::bncGetThread(const QUrl& mountPoint, 
+bncGetThread::bncGetThread(const QUrl& mountPoint,
                            const QByteArray& format,
                            const QByteArray& latitude,
                            const QByteArray& longitude,
-                           const QByteArray& nmea, 
+                           const QByteArray& nmea,
                            const QByteArray& ntripVersion) {
   _rawFile      = 0;
@@ -119,5 +119,5 @@
   setTerminationEnabled(true);
 
-  connect(this, SIGNAL(newMessage(QByteArray,bool)), 
+  connect(this, SIGNAL(newMessage(QByteArray,bool)),
           BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
 
@@ -172,35 +172,35 @@
     QString hlp = settings.value("serialBaudRate").toString();
     if      (hlp == "110") {
-      _serialPort->setBaudRate(BAUD110);   
+      _serialPort->setBaudRate(BAUD110);
     }
     else if (hlp == "300") {
-      _serialPort->setBaudRate(BAUD300);   
+      _serialPort->setBaudRate(BAUD300);
     }
     else if (hlp == "600") {
-      _serialPort->setBaudRate(BAUD600);   
+      _serialPort->setBaudRate(BAUD600);
     }
     else if (hlp == "1200") {
-      _serialPort->setBaudRate(BAUD1200);   
+      _serialPort->setBaudRate(BAUD1200);
     }
     else if (hlp == "2400") {
-      _serialPort->setBaudRate(BAUD2400);   
+      _serialPort->setBaudRate(BAUD2400);
     }
     else if (hlp == "4800") {
-      _serialPort->setBaudRate(BAUD4800);   
+      _serialPort->setBaudRate(BAUD4800);
     }
     else if (hlp == "9600") {
-      _serialPort->setBaudRate(BAUD9600);   
+      _serialPort->setBaudRate(BAUD9600);
     }
     else if (hlp == "19200") {
-      _serialPort->setBaudRate(BAUD19200);   
+      _serialPort->setBaudRate(BAUD19200);
     }
     else if (hlp == "38400") {
-      _serialPort->setBaudRate(BAUD38400);   
+      _serialPort->setBaudRate(BAUD38400);
     }
     else if (hlp == "57600") {
-      _serialPort->setBaudRate(BAUD57600);   
+      _serialPort->setBaudRate(BAUD57600);
     }
     else if (hlp == "115200") {
-      _serialPort->setBaudRate(BAUD115200);   
+      _serialPort->setBaudRate(BAUD115200);
     }
 
@@ -209,14 +209,14 @@
     hlp = settings.value("serialParity").toString();
     if      (hlp == "NONE") {
-      _serialPort->setParity(PAR_NONE);    
+      _serialPort->setParity(PAR_NONE);
     }
     else if (hlp == "ODD") {
-      _serialPort->setParity(PAR_ODD);    
+      _serialPort->setParity(PAR_ODD);
     }
     else if (hlp == "EVEN") {
-      _serialPort->setParity(PAR_EVEN);    
+      _serialPort->setParity(PAR_EVEN);
     }
     else if (hlp == "SPACE") {
-      _serialPort->setParity(PAR_SPACE);    
+      _serialPort->setParity(PAR_SPACE);
     }
 
@@ -225,21 +225,21 @@
     hlp = settings.value("serialDataBits").toString();
     if      (hlp == "5") {
-      _serialPort->setDataBits(DATA_5);   
+      _serialPort->setDataBits(DATA_5);
     }
     else if (hlp == "6") {
-      _serialPort->setDataBits(DATA_6);   
+      _serialPort->setDataBits(DATA_6);
     }
     else if (hlp == "7") {
-      _serialPort->setDataBits(DATA_7);   
+      _serialPort->setDataBits(DATA_7);
     }
     else if (hlp == "8") {
-      _serialPort->setDataBits(DATA_8);   
+      _serialPort->setDataBits(DATA_8);
     }
     hlp = settings.value("serialStopBits").toString();
     if      (hlp == "1") {
-      _serialPort->setStopBits(STOP_1);    
+      _serialPort->setStopBits(STOP_1);
     }
     else if (hlp == "2") {
-      _serialPort->setStopBits(STOP_2);    
+      _serialPort->setStopBits(STOP_2);
     }
 
@@ -248,11 +248,11 @@
     hlp = settings.value("serialFlowControl").toString();
     if (hlp == "XONXOFF") {
-      _serialPort->setFlowControl(FLOW_XONXOFF);    
+      _serialPort->setFlowControl(FLOW_XONXOFF);
     }
     else if (hlp == "HARDWARE") {
-      _serialPort->setFlowControl(FLOW_HARDWARE);    
+      _serialPort->setFlowControl(FLOW_HARDWARE);
     }
     else {
-      _serialPort->setFlowControl(FLOW_OFF);    
+      _serialPort->setFlowControl(FLOW_OFF);
     }
 
@@ -265,5 +265,5 @@
       emit(newMessage((_staID + ": Cannot open serial port\n"), true));
     }
-    connect(_serialPort, SIGNAL(readyRead()), 
+    connect(_serialPort, SIGNAL(readyRead()),
             this, SLOT(slotSerialReadyRead()));
 
@@ -323,5 +323,5 @@
     RTCM3Decoder* newDecoder = new RTCM3Decoder(_staID, _rawFile);
     _decoder = newDecoder;
-    connect((RTCM3Decoder*) newDecoder, SIGNAL(newMessage(QByteArray,bool)), 
+    connect((RTCM3Decoder*) newDecoder, SIGNAL(newMessage(QByteArray,bool)),
             this, SIGNAL(newMessage(QByteArray,bool)));
   }
@@ -341,6 +341,6 @@
 
   msleep(100); //sleep 0.1 sec
-  
-  _decoder->initRinex(_staID, _mountPoint, _latitude, _longitude, 
+
+  _decoder->initRinex(_staID, _mountPoint, _latitude, _longitude,
                                _nmea, _ntripVersion);
 
@@ -393,5 +393,5 @@
 }
 
-// 
+//
 ////////////////////////////////////////////////////////////////////////////
 void bncGetThread::terminate() {
@@ -478,5 +478,5 @@
       // -----------
       if (_rawOutput) {
-        BNC_CORE->writeRawData(data, _staID, _format); 
+        BNC_CORE->writeRawData(data, _staID, _format);
       }
 
@@ -485,5 +485,5 @@
         _serialPort->write(data);
       }
-      
+
       // Decode Data
       // -----------
@@ -496,4 +496,8 @@
       t_irc irc = decoder()->Decode(data.data(), data.size(), errmsg);
 
+      if (irc == failure) {
+        continue;
+      }
+
       // Perform various scans and checks
       // --------------------------------
@@ -502,9 +506,9 @@
         _latencyChecker->checkObsLatency(decoder()->_obsList);
         _latencyChecker->checkCorrLatency(decoder()->corrGPSEpochTime());
-        
+
         emit newLatency(_staID, _latencyChecker->currentLatency());
       }
 
-      miscScanRTCM();            
+      miscScanRTCM();
 
       // Loop over all observations (observations output)
@@ -542,10 +546,10 @@
             long oldTime = it.value();
             if      (obsTime <  oldTime) {
-              emit( newMessage(_staID + 
+              emit( newMessage(_staID +
                  ": old observation " + prn.toAscii(), false));
               continue;
             }
             else if (obsTime == oldTime) {
-              emit( newMessage(_staID + 
+              emit( newMessage(_staID +
                  ": observation coming more than once " + prn.toAscii(), false));
               continue;
@@ -581,5 +585,5 @@
 }
 
-// Try Re-Connect 
+// Try Re-Connect
 ////////////////////////////////////////////////////////////////////////////
 t_irc bncGetThread::tryReconnect() {
@@ -715,5 +719,5 @@
         emit(newMessage(_staID + ": Received message type " + type.toAscii(), true));
       }
-  
+
       // Check Observation Types
       // -----------------------
@@ -777,5 +781,5 @@
         }
         if (!allFound) {
-          QString msg; 
+          QString msg;
           QTextStream str(&msg);
           QString s;
@@ -818,6 +822,6 @@
           emit(newMessage(_staID + ": Antenna height above marker "  + ant4 + "m", true));
         }
-        emit(newAntCrd(_staID, decoder()->_antList[ii].xx, 
-                       decoder()->_antList[ii].yy, decoder()->_antList[ii].zz, 
+        emit(newAntCrd(_staID, decoder()->_antList[ii].xx,
+                       decoder()->_antList[ii].yy, decoder()->_antList[ii].zz,
                        hh, antT));
       }
@@ -854,6 +858,6 @@
           hh = decoder()->_antList[ii].height;
         }
-        emit(newAntCrd(_staID, decoder()->_antList[ii].xx, 
-                       decoder()->_antList[ii].yy, decoder()->_antList[ii].zz, 
+        emit(newAntCrd(_staID, decoder()->_antList[ii].xx,
+                       decoder()->_antList[ii].yy, decoder()->_antList[ii].zz,
                        hh, antT));
   }
