Index: trunk/BNC/src/bncrinex.cpp
===================================================================
--- trunk/BNC/src/bncrinex.cpp	(revision 6146)
+++ trunk/BNC/src/bncrinex.cpp	(revision 6147)
@@ -597,34 +597,60 @@
 string bncRinex::rinexSatLine(const t_satObs& obs, char lli1, char lli2, char lli5) {
   ostringstream str;
-////  str.setf(ios::showpoint | ios::fixed);
-////
-////  if (_header._version >= 3.0) {
-////    str << obs._prn;
-////  }
-////
-////  const QVector<QString>& types = _header._obsTypes[obs._prn.system()];
-////  for (int ii = 0; ii < types.size(); ii++) {
-////    if (_header._version < 3.0 && ii > 0 && ii % 5 == 0) {
-////      str << endl;
-////    }
-////    for (unsigned iFrq = 0; iFrq < obs._obs.size(); iFrq++) {
-////      const t_frqObs*     frqObs   = obs._obs[iFrq];
-////
-////
-////    double value = obs.measdata(types[ii], _header._version);
-////    str << setw(14) << setprecision(3) << value;
-////    if      (value != 0.0 && types[ii].indexOf("L1") == 0) {
-////      str << lli1 << ' ';
-////    }
-////    else if (value != 0.0 && types[ii].indexOf("L2") == 0) {
-////      str << lli2 << ' ';
-////    }
-////    else if (value != 0.0 && types[ii].indexOf("L5") == 0) {
-////      str << lli5 << ' ';
-////    }
-////    else {
-////      str << "  ";
-////    }
-////  }
+  str.setf(ios::showpoint | ios::fixed);
+
+  if (_header._version >= 3.0) {
+    str << obs._prn;
+  }
+
+  const QString obsKinds = "LCDS";
+
+  char sys = obs._prn.system();
+  const QVector<QString>& types = _header._obsTypes[sys];
+  for (int ii = 0; ii < types.size(); ii++) {
+    if (_header._version < 3.0 && ii > 0 && ii % 5 == 0) {
+      str << endl;
+    }
+    double  obsValue = 0.0;
+    char    lli      = ' ';
+    QString rnxType = types[ii];
+    for (unsigned iFrq = 0; iFrq < obs._obs.size(); iFrq++) {
+      const t_frqObs* frqObs = obs._obs[iFrq];
+      for (int ik = 0; ik < obsKinds.length(); ik++) {
+        QChar ch = obsKinds[ik];
+        QString obsType  = (ch + QString(frqObs->_rnxType2ch.c_str())).left(rnxType.length());
+        if (rnxType == obsType) {
+          if      (ch == 'L' && frqObs->_phaseValid) {
+            obsValue = frqObs->_phase;
+            if      (obsType[1] == '1') {
+              lli = lli1;
+            }
+            else if (obsType[1] == '2') {
+              lli = lli2;
+            }
+            else if (obsType[1] == '5') {
+              lli = lli5;
+            }
+          }
+          else if (ch == 'C' && frqObs->_codeValid) {
+            obsValue = frqObs->_code;
+          }
+          else if (ch == 'D' && frqObs->_dopplerValid) {
+            obsValue = frqObs->_doppler;
+          }
+          else if (ch == 'S' && frqObs->_snrValid) {
+            obsValue = frqObs->_snr;
+          }
+        }
+      }
+    }
+    if (obsValue != 0.0) {
+      str << setw(14) << setprecision(3) << obsValue << lli << ' ';
+    }
+    else {
+      str << "                ";
+    }
+  }
+
+  cout << str.str() << endl;
 
   return str.str();
Index: trunk/BNC/src/rinex/rnxobsfile.cpp
===================================================================
--- trunk/BNC/src/rinex/rnxobsfile.cpp	(revision 6146)
+++ trunk/BNC/src/rinex/rnxobsfile.cpp	(revision 6147)
@@ -951,71 +951,12 @@
 // Translate Observation Type v2 --> v3
 ////////////////////////////////////////////////////////////////////////////
-QString t_rnxObsFile::type2to3(char sys, const QString& typeV2) {
-
-  if      (sys == 'G') {
-    if (typeV2 == "C1") return "C1C";
-    if (typeV2 == "C2") return "C2C";
-    if (typeV2 == "C5") return "C5C";
-    if (typeV2 == "P1") return "C1P";
-    if (typeV2 == "P2") return "C2P";
-    if (typeV2 == "L1") return "L1";
-    if (typeV2 == "L2") return "L2";
-    if (typeV2 == "L5") return "L5";
-    if (typeV2 == "D1") return "D1";
-    if (typeV2 == "D2") return "D2";
-    if (typeV2 == "D5") return "D5";
-    if (typeV2 == "S1") return "S1";
-    if (typeV2 == "S2") return "S2";
-    if (typeV2 == "S5") return "S5";
-  }
-
-  else if (sys == 'R') {
-    if (typeV2 == "C1") return "C1C";
-    if (typeV2 == "C2") return "C2C";
-    if (typeV2 == "P1") return "C1P";
-    if (typeV2 == "P2") return "C2P";
-    if (typeV2 == "L1") return "L1";
-    if (typeV2 == "L2") return "L2";
-    if (typeV2 == "D1") return "D1";
-    if (typeV2 == "D2") return "D2";
-    if (typeV2 == "S1") return "S1";
-    if (typeV2 == "S2") return "S2";
-  }
-
-  else if (sys == 'E') {
-    if (typeV2 == "C1") return "C1";
-    if (typeV2 == "C5") return "C5";
-    if (typeV2 == "C6") return "C6";
-    if (typeV2 == "C7") return "C7";
-    if (typeV2 == "C8") return "C8";
-    if (typeV2 == "L1") return "L1";
-    if (typeV2 == "L5") return "L5";
-    if (typeV2 == "L6") return "L6";
-    if (typeV2 == "L7") return "L7";
-    if (typeV2 == "L8") return "L8";
-    if (typeV2 == "D1") return "D1";
-    if (typeV2 == "D5") return "D5";
-    if (typeV2 == "D6") return "D6";
-    if (typeV2 == "D7") return "D7";
-    if (typeV2 == "D8") return "D8";
-    if (typeV2 == "S1") return "S1";
-    if (typeV2 == "S5") return "S5";
-    if (typeV2 == "S6") return "S6";
-    if (typeV2 == "S7") return "S7";
-    if (typeV2 == "S8") return "S8";
-  }
-
-  else if (sys == 'S') {
-    if (typeV2 == "C1") return "C1C";
-    if (typeV2 == "C5") return "C5C";
-    if (typeV2 == "L1") return "L1";
-    if (typeV2 == "L5") return "L5";
-    if (typeV2 == "D1") return "D1";
-    if (typeV2 == "D5") return "D5";
-    if (typeV2 == "S1") return "S1";
-    if (typeV2 == "S5") return "S5";
-  }
-
-  return "";
+QString t_rnxObsFile::type2to3(char /* sys */, const QString& typeV2) {
+  if      (typeV2 == "P1") {
+    return "C1P";
+  }
+  else if (typeV2 == "P2") {
+    return "C2P";
+  }
+  return typeV2;
 }
 
@@ -1029,9 +970,5 @@
     return "P2";
   }
-  else {
-    return typeV3.left(2);
-  }
-
-  return "";
+  return typeV3.left(2);
 }
 
