Index: trunk/BNC/RTCM/RTCM2.cpp
===================================================================
--- trunk/BNC/RTCM/RTCM2.cpp	(revision 331)
+++ trunk/BNC/RTCM/RTCM2.cpp	(revision 332)
@@ -37,4 +37,6 @@
 //   2006/10/17  OMO  Removed obsolete check of multiple message indicator
 //   2006/10/17  OMO  Fixed parity handling 
+//   2006/10/18  OMO  Improved screening of bad data in RTCM2_Obs::extract
+//   2006/11/25  OMO  Revised check for presence of GLONASS data
 //
 // (c) DLR/GSOC
@@ -279,5 +281,5 @@
 #if (DEBUG>0) 
   if (!validParity()) {
-    cout << "Parity error " 
+    cerr << "Parity error " 
          << bitset<32>(all()) << endl;
   };
@@ -301,5 +303,5 @@
 #if (DEBUG>0) 
   if (!validParity()) {
-    cout << "Parity error " 
+    cerr << "Parity error " 
          << bitset<32>(all()) << endl;
   };
@@ -334,5 +336,5 @@
 #if (DEBUG>0) 
   if (!validParity()) {
-    cout << "Parity error " 
+    cerr << "Parity error " 
          << bitset<32>(all()) << endl;
   };
@@ -358,5 +360,5 @@
 #if (DEBUG>0) 
   if (!validParity()) {
-    cout << "Parity error " 
+    cerr << "Parity error " 
          << bitset<32>(all()) << endl;
   };
@@ -779,4 +781,5 @@
 
   clear();
+  GPSonly = true;
 
 };
@@ -841,5 +844,5 @@
 bool RTCM2_Obs::valid() const {
 
-  return ( allGPS() && (allGLONASS() || !anyGLONASS())  );
+  return ( allGPS() && ( GPSonly || allGLONASS() ) );
   
 };
@@ -859,5 +862,7 @@
   // Check validity and packet type
   
-  if (!P.valid()) return;
+  if ( ! ( P.valid() && 
+           (P.ID()==18 || P.ID()==19) && 
+           P.nDataWords()>1              ) ) return;
 
   // Clear previous data if block was already complete
@@ -883,5 +888,6 @@
     // Constellation (for first satellite in message)
     isGPS = ( P.getUnsignedBits(26,1)==0 );
-
+    GPSonly = GPSonly && isGPS;
+    
     // Multiple Message Indicator (only checked for first satellite)
     // pendingMsg = ( P.getUnsignedBits(24,1)==1 );
@@ -899,5 +905,5 @@
     };
 
-    // Discard GLONASS obseravtions if no prior GPS observations 
+    // Discard GLONASS observations if no prior GPS observations 
     // are available 
     if (!isGPS && !anyGPS() ) return;
@@ -971,4 +977,5 @@
     // Constellation (for first satellite in message)
     isGPS = ( P.getUnsignedBits(26,1)==0 );
+    GPSonly = GPSonly && isGPS;
 
     // Multiple Message Indicator (only checked for first satellite)
@@ -987,5 +994,5 @@
     };
 
-    // Discard GLONASS obseravtions if nor prior GPS observations 
+    // Discard GLONASS observations if no prior GPS observations 
     // are available 
     if (!isGPS && !anyGPS() ) return;
@@ -1101,14 +1108,5 @@
 
   epochWeek = refWeek;
-
-  epochSecs = secs;
-  while (epochSecs < refSecs - 1800) {
-    epochSecs += 3600;
-  }
-  while (epochSecs > refSecs + 1800) {
-    epochSecs -= 3600;
-  }
-
-  ////  epochSecs = secs + 3600.0*(floor((refSecs-secs)/3600.0+0.5));
+  epochSecs = secs + 3600.0*(floor((refSecs-secs)/3600.0+0.5));
   
   if (epochSecs<0          ) { epochWeek--; epochSecs+=secsPerWeek; };
Index: trunk/BNC/RTCM/RTCM2.h
===================================================================
--- trunk/BNC/RTCM/RTCM2.h	(revision 331)
+++ trunk/BNC/RTCM/RTCM2.h	(revision 332)
@@ -27,4 +27,5 @@
 //   2006/10/05  OMO  Specified const'ness of various member functions
 //   2006/10/17  OMO  Removed obsolete check of multiple message indicator
+//   2006/11/25  OMO  Revised check for presence of GLONASS data
 //
 // (c) DLR/GSOC
@@ -320,5 +321,6 @@
     
     msgflags             availability;      // Msg availability flags
-    
+    bool                 GPSonly;           // Flag for GPS-only station
+
 }; 
 
