Index: trunk/BNC/src/PPP/pppRun.cpp
===================================================================
--- trunk/BNC/src/PPP/pppRun.cpp	(revision 5989)
+++ trunk/BNC/src/PPP/pppRun.cpp	(revision 5990)
@@ -297,6 +297,6 @@
 
     if (!output._error) {
-      QString rmcStr = nmeaRMC(output);
-      QString ggaStr = nmeaGGA(output);
+      QString rmcStr = nmeaString('R', output);
+      QString ggaStr = nmeaString('G', output);
       if (_nmeaFile) {
         _nmeaFile->write(output._epoTime.gpsw(), output._epoTime.gpssec(), rmcStr);
@@ -518,5 +518,5 @@
 //  
 ////////////////////////////////////////////////////////////////////////////
-QString t_pppRun::nmeaRMC(const t_output& output) const {
+QString t_pppRun::nmeaString(char strType, const t_output& output) {
 
   double ell[3]; 
@@ -536,20 +536,38 @@
   }   
 
-  string datestr = output._epoTime.datestr(0); // yyyymmdd
-
-  ostringstream strRMC;
-  strRMC.setf(ios::fixed);
-  strRMC << "GPRMC," 
-         << output._epoTime.timestr(0,0) << ",A,"
-         << setw(2) << setfill('0') << int(phiDeg) 
-         << setw(6) << setprecision(3) << setfill('0') 
-         << fmod(60*phiDeg,60) << ',' << phiCh << ','
-         << setw(3) << setfill('0') << int(lamDeg) 
-         << setw(6) << setprecision(3) << setfill('0') 
-         << fmod(60*lamDeg,60) << ',' << lamCh << ",,,"
-         << datestr[6] << datestr[7] << datestr[4] << datestr[5]
-         << datestr[2] << datestr[3] << ",,";
-
-  QString nmStr(strRMC.str().c_str());
+  ostringstream out;
+  out.setf(ios::fixed);
+
+  if      (strType == 'R') {
+    string datestr = output._epoTime.datestr(0); // yyyymmdd
+    out << "GPRMC," 
+        << output._epoTime.timestr(0,0) << ",A,"
+        << setw(2) << setfill('0') << int(phiDeg) 
+        << setw(6) << setprecision(3) << setfill('0') 
+        << fmod(60*phiDeg,60) << ',' << phiCh << ','
+        << setw(3) << setfill('0') << int(lamDeg) 
+        << setw(6) << setprecision(3) << setfill('0') 
+        << fmod(60*lamDeg,60) << ',' << lamCh << ",,,"
+        << datestr[6] << datestr[7] << datestr[4] << datestr[5]
+        << datestr[2] << datestr[3] << ",,";
+  }
+  else if (strType == 'G') {
+    out << "GPGGA," 
+        << output._epoTime.timestr(0,0) << ','
+        << setw(2) << setfill('0') << int(phiDeg) 
+        << setw(10) << setprecision(7) << setfill('0') 
+        << fmod(60*phiDeg,60) << ',' << phiCh << ','
+        << setw(3) << setfill('0') << int(lamDeg) 
+        << setw(10) << setprecision(7) << setfill('0') 
+        << fmod(60*lamDeg,60) << ',' << lamCh 
+        << ",1," << setw(2) << setfill('0') << output._numSat << ','
+        << setw(3) << setprecision(1) << output._pDop << ','
+        << setprecision(3) << ell[2] << ",M,0.0,M,,";
+  }
+  else {
+    return "";
+  }
+
+  QString nmStr(out.str().c_str());
   unsigned char XOR = 0;
   for (int ii = 0; ii < nmStr.length(); ii++) {
@@ -560,44 +578,2 @@
 }
 
-//  
-////////////////////////////////////////////////////////////////////////////
-QString t_pppRun::nmeaGGA(const t_output& output) const {
-
-  double ell[3]; 
-  xyz2ell(output._xyzRover, ell);
-  double phiDeg = ell[0] * 180 / M_PI;
-  double lamDeg = ell[1] * 180 / M_PI;
-
-  char phiCh = 'N';
-  if (phiDeg < 0) {
-    phiDeg = -phiDeg;
-    phiCh  =  'S';
-  }   
-  char lamCh = 'E';
-  if (lamDeg < 0) {
-    lamDeg = -lamDeg;
-    lamCh  =  'W';
-  }   
-
-  ostringstream strGGA;
-  strGGA.setf(ios::fixed);
-  strGGA << "GPGGA," 
-         << output._epoTime.timestr(0,0) << ','
-         << setw(2) << setfill('0') << int(phiDeg) 
-         << setw(10) << setprecision(7) << setfill('0') 
-         << fmod(60*phiDeg,60) << ',' << phiCh << ','
-         << setw(3) << setfill('0') << int(lamDeg) 
-         << setw(10) << setprecision(7) << setfill('0') 
-         << fmod(60*lamDeg,60) << ',' << lamCh 
-         << ",1," << setw(2) << setfill('0') << output._numSat << ','
-         << setw(3) << setprecision(1) << output._pDop << ','
-         << setprecision(3) << ell[2] << ",M,0.0,M,,";
-
-  QString nmStr(strGGA.str().c_str());
-  unsigned char XOR = 0;
-  for (int ii = 0; ii < nmStr.length(); ii++) {
-    XOR ^= (unsigned char) nmStr[ii].toAscii();
-  }
-
-  return '$' + nmStr + QString("*%1\n").arg(int(XOR), 0, 16).toUpper();
-}
Index: trunk/BNC/src/PPP/pppRun.h
===================================================================
--- trunk/BNC/src/PPP/pppRun.h	(revision 5989)
+++ trunk/BNC/src/PPP/pppRun.h	(revision 5990)
@@ -24,4 +24,6 @@
 
   void processFiles();
+
+  static QString nmeaString(char strType, const t_output& output);
 
  signals:
@@ -54,7 +56,4 @@
   };
 
-  QString nmeaRMC(const t_output& output) const;
-  QString nmeaGGA(const t_output& output) const;
-
   QMutex                 _mutex;
   const t_pppOptions*    _opt;
