Index: trunk/BNC/bncapp.cpp
===================================================================
--- trunk/BNC/bncapp.cpp	(revision 516)
+++ trunk/BNC/bncapp.cpp	(revision 517)
@@ -140,7 +140,11 @@
   QMutexLocker locker(&_mutex);
 
+  if (!_ephStream) {
+    delete gpseph;
+    return;
+  }
+
   gpsephemeris** ee = &_gpsEph[gpseph->satellite-PRN_GPS_START];
   if ( *ee == 0 || (*ee)->IODE != gpseph->IODE ) { 
-    cout << "new GPS: " << gpseph->satellite << endl;
     delete *ee;
     *ee = gpseph;
@@ -148,5 +152,4 @@
   }
   else {
-    cout << "GPS: " << gpseph->satellite << endl;
     delete gpseph;
   }
@@ -159,5 +162,9 @@
   QMutexLocker locker(&_mutex);
 
-  cout << "GLONASS: " << glonasseph->almanac_number << endl;
+  if (!_ephStream) {
+    delete glonasseph;
+    return;
+  }
+
   delete glonasseph;
 }
@@ -166,5 +173,9 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncApp::printEphHeader() {
-
+  if (_ephStream) {
+    *_ephStream << QDate::currentDate().toString("yy-MM-dd ").toAscii().data();
+    *_ephStream << QTime::currentTime().toString("hh:mm:ss ").toAscii().data();
+    _ephFile->flush();
+  }
 }
 
@@ -172,5 +183,8 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncApp::printGPSEph(gpsephemeris* ep) {
-
+  if (_ephStream) {
+    *_ephStream << "GPS: "  << ep->satellite << endl;
+    _ephFile->flush();
+  }
 }
 
@@ -178,4 +192,7 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncApp::printGlonassEph(glonassephemeris* ep) {
-
+  if (_ephStream) {
+    *_ephStream << "GLONASS: "  << ep->almanac_number << endl;
+    _ephFile->flush();
+  }
 }
