Index: /trunk/BNC/test_bnc_qt.cpp
===================================================================
--- /trunk/BNC/test_bnc_qt.cpp	(revision 733)
+++ /trunk/BNC/test_bnc_qt.cpp	(revision 734)
@@ -57,8 +57,6 @@
 
   QTcpSocket socketObs;
-  ////  QTcpSocket socketEph;
 
   QFile obsFile("obs.txt");
-  ////  QFile ephFile("eph.txt");
   
   socketObs.connectToHost("127.0.0.1", 1968);
@@ -68,18 +66,8 @@
   }
 
-  ////  socketEph.connectToHost("127.0.0.1", 1969);
-  ////  if (!socketEph.waitForConnected(10000)) {
-  ////    cout << "socketEph: not connected" << endl;
-  ////    exit(1);
-  ////  }
-
   obsFile.open(QIODevice::WriteOnly | QIODevice::Unbuffered);
-  ////  ephFile.open(QIODevice::WriteOnly | QIODevice::Unbuffered);
 
   QTextStream outObs(&obsFile); 
   outObs.setRealNumberNotation(QTextStream::FixedNotation);
-
-  ////  QTextStream outEph(&ephFile);
-  ////  outEph.setRealNumberNotation(QTextStream::FixedNotation);
 
   // Receive Data
@@ -94,29 +82,23 @@
       exit(0);
     }
-    ////  if (socketEph.state() != QAbstractSocket::ConnectedState) {
-    ////    cout << "socketEph: disconnected" << endl;
-    ////    exit(0);
-    ////  }
 
-    if ( socketObs.bytesAvailable() ) {
-      int bytesRecv = socketObs.read(&flag, 1);
+    if ( socketObs.bytesAvailable() > sizeof(obs) ) {
+      socketObs.read(&flag, 1);
       if (flag == begObs) {
-        if ( socketObs.bytesAvailable() >= sizeof(obs) ) {
-          bytesRecv = socketObs.read((char*) &obs, sizeof(obs));
-          outObs << obs.StatID                                 << " "
-                 << obs.satSys << obs.satNum                   << " "
-                 << obs.GPSWeek                                << " "
-                 << qSetRealNumberPrecision(2) << obs.GPSWeeks << " "
-                 << qSetRealNumberPrecision(4) << obs.C1       << " "
-                 << qSetRealNumberPrecision(4) << obs.C2       << " "
-                 << qSetRealNumberPrecision(4) << obs.P1       << " "
-                 << qSetRealNumberPrecision(4) << obs.P2       << " "
-                 << qSetRealNumberPrecision(4) << obs.L1       << " "
-                 << qSetRealNumberPrecision(4) << obs.L2       << " "
-                 << qSetRealNumberPrecision(4) << obs.S1       << " "
-                 << qSetRealNumberPrecision(4) << obs.S2       << " "
-                 <<                               obs.SNR1     << " "
-                 <<                               obs.SNR2     << endl;
-        }
+        socketObs.read((char*) &obs, sizeof(obs));
+        outObs << obs.StatID                                 << " "
+               << obs.satSys << obs.satNum                   << " "
+               << obs.GPSWeek                                << " "
+               << qSetRealNumberPrecision(2) << obs.GPSWeeks << " "
+               << qSetRealNumberPrecision(4) << obs.C1       << " "
+               << qSetRealNumberPrecision(4) << obs.C2       << " "
+               << qSetRealNumberPrecision(4) << obs.P1       << " "
+               << qSetRealNumberPrecision(4) << obs.P2       << " "
+               << qSetRealNumberPrecision(4) << obs.L1       << " "
+               << qSetRealNumberPrecision(4) << obs.L2       << " "
+               << qSetRealNumberPrecision(4) << obs.S1       << " "
+               << qSetRealNumberPrecision(4) << obs.S2       << " "
+               <<                               obs.SNR1     << " "
+               <<                               obs.SNR2     << endl;
       }
     }
@@ -124,12 +106,4 @@
       socketObs.waitForReadyRead(1);
     }
-
-    ////  if ( socketEph.bytesAvailable() ) {
-    ////    QByteArray eph = socketEph.readAll();
-    ////    outEph << eph.data() << endl;
-    ////  }
-    ////  else {
-    ////    socketEph.waitForReadyRead(1);
-    ////  }
   }
 
