Index: trunk/BNC/src/ephemeris.cpp
===================================================================
--- trunk/BNC/src/ephemeris.cpp	(revision 9787)
+++ trunk/BNC/src/ephemeris.cpp	(revision 9788)
@@ -249,5 +249,5 @@
     nLines += 1;
   }
-  else if (navType() == t_eph::CNV2) {
+  if (navType() == t_eph::CNV2) {
     nLines += 2;
   }
@@ -400,7 +400,7 @@
       if (navType() == t_eph::CNAV ||
           navType() == t_eph::CNV2) {
-        if ( readDbl(line, pos[0], fieldLen, _IDOT   ) ||
-             readDbl(line, pos[1], fieldLen, _DN0DOT ) ||
-             readDbl(line, pos[2], fieldLen, _URAI_NED0 ) ||
+        if ( readDbl(line, pos[0], fieldLen, _IDOT       ) ||
+             readDbl(line, pos[1], fieldLen, _Delta_n_dot) ||
+             readDbl(line, pos[2], fieldLen, _URAI_NED0  ) ||
              readDbl(line, pos[3], fieldLen, _URAI_NED1) ) {
           _checkState = bad;
@@ -411,5 +411,5 @@
         if ( readDbl(line, pos[0], fieldLen, _IDOT   ) ||
              readDbl(line, pos[1], fieldLen, _L2Codes) ||
-             readDbl(line, pos[2], fieldLen, _TOEweek  ) ||
+             readDbl(line, pos[2], fieldLen, _TOEweek) ||
              readDbl(line, pos[3], fieldLen, _L2PFlag) ) {
           _checkState = bad;
@@ -498,5 +498,4 @@
           return;
         }
-
       }
 
@@ -709,8 +708,8 @@
         navType() == t_eph::CNV2) {
       out << QString(fmt)
-        .arg(_IDOT,      19, 'e', 12)
-        .arg(_DN0DOT,    19, 'e', 12)
-        .arg(_URAI_NED0, 19, 'e', 12)
-        .arg(_URAI_NED1, 19, 'e', 12);
+        .arg(_IDOT,        19, 'e', 12)
+        .arg(_Delta_n_dot, 19, 'e', 12)
+        .arg(_URAI_NED0,   19, 'e', 12)
+        .arg(_URAI_NED1,   19, 'e', 12);
 
     }
@@ -902,5 +901,7 @@
       _tau  = -_tau;
     }
-
+    // =====================
+    // BROADCAST ORBIT - 1
+    // =====================
     else if      ( iLine == 1 ) {
       if ( readDbl(line, pos[0], fieldLen, _x_pos         ) ||
@@ -912,5 +913,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 2
+    // =====================
     else if ( iLine == 2 ) {
       if ( readDbl(line, pos[0], fieldLen, _y_pos           ) ||
@@ -922,5 +925,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 3
+    // =====================
     else if ( iLine == 3 ) {
       if ( readDbl(line, pos[0], fieldLen, _z_pos         )  ||
@@ -932,5 +937,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 4
+    // =====================
     else if ( iLine == 4 ) {
       if ( readDbl(line, pos[0], fieldLen, statusflags    )  ||
@@ -1049,5 +1056,7 @@
 
   QString fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
-
+  // =====================
+  // BROADCAST ORBIT - 1
+  // =====================
   out << QString(fmt)
     .arg(_x_pos,          19, 'e', 12)
@@ -1055,5 +1064,7 @@
     .arg(_x_acceleration, 19, 'e', 12)
     .arg(_health,         19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 2
+  // =====================
   out << QString(fmt)
     .arg(_y_pos,            19, 'e', 12)
@@ -1061,5 +1072,7 @@
     .arg(_y_acceleration,   19, 'e', 12)
     .arg(_frequency_number, 19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 3
+  // =====================
   out << QString(fmt)
     .arg(_z_pos,          19, 'e', 12)
@@ -1067,5 +1080,7 @@
     .arg(_z_acceleration, 19, 'e', 12)
     .arg(_E,              19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 4
+  // =====================
   if (version >= 3.05) {
     // unknown (RINEX version < 3.05)
@@ -1260,5 +1275,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 1
+    // =====================
     else if      ( iLine == 1 ) {
       if ( readDbl(line, pos[0], fieldLen, _IODnav ) ||
@@ -1270,5 +1287,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 2
+    // =====================
     else if ( iLine == 2 ) {
       if ( readDbl(line, pos[0], fieldLen, _Cuc   ) ||
@@ -1280,5 +1299,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 3
+    // =====================
     else if ( iLine == 3 ) {
       if ( readDbl(line, pos[0], fieldLen, _TOEsec)  ||
@@ -1290,5 +1311,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 4
+    // =====================
     else if ( iLine == 4 ) {
       if ( readDbl(line, pos[0], fieldLen, _i0      ) ||
@@ -1300,5 +1323,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 5
+    // =====================
     else if ( iLine == 5 ) {
       if ( readDbl(line, pos[0], fieldLen, _IDOT      ) ||
@@ -1318,5 +1343,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 6
+    // =====================
     else if ( iLine == 6 ) {
       if ( readDbl(line, pos[0], fieldLen, _SISA    ) ||
@@ -1345,5 +1372,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 7
+    // =====================
     else if ( iLine == 7 ) {
       if ( readDbl(line, pos[0], fieldLen, _TOT) ) {
@@ -1469,5 +1498,7 @@
 
   QString fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
-
+  // =====================
+  // BROADCAST ORBIT - 1
+  // =====================
   out << QString(fmt)
     .arg(_IODnav,  19, 'e', 12)
@@ -1475,5 +1506,7 @@
     .arg(_Delta_n, 19, 'e', 12)
     .arg(_M0,      19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 2
+  // =====================
   out << QString(fmt)
     .arg(_Cuc,    19, 'e', 12)
@@ -1481,5 +1514,7 @@
     .arg(_Cus,    19, 'e', 12)
     .arg(_sqrt_A, 19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 3
+  // =====================
   out << QString(fmt)
     .arg(_TOEsec, 19, 'e', 12)
@@ -1487,5 +1522,7 @@
     .arg(_OMEGA0, 19, 'e', 12)
     .arg(_Cis,    19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 4
+  // =====================
   out << QString(fmt)
     .arg(_i0,       19, 'e', 12)
@@ -1493,5 +1530,7 @@
     .arg(_omega,    19, 'e', 12)
     .arg(_OMEGADOT, 19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 5
+  // =====================
   int    dataSource = 0;
   int    SVhealth   = 0;
@@ -1578,5 +1617,7 @@
     .arg(_TOEweek + 1024.0,  19, 'e', 12)
     .arg(0.0,                19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 6
+  // =====================
   out << QString(fmt)
     .arg(_SISA,            19, 'e', 12)
@@ -1584,5 +1625,7 @@
     .arg(BGD_1_5A,         19, 'e', 12)
     .arg(BGD_1_5B,         19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 7
+  // =====================
   double tot = _TOT;
   if (tot == 0.9999e9 && version < 3.0) {
@@ -1660,5 +1703,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 1
+    // =====================
     else if      ( iLine == 1 ) {
       if ( readDbl(line, pos[0], fieldLen, _x_pos         ) ||
@@ -1670,5 +1715,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 2
+    // =====================
     else if ( iLine == 2 ) {
       if ( readDbl(line, pos[0], fieldLen, _y_pos           ) ||
@@ -1680,5 +1727,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 3
+    // =====================
     else if ( iLine == 3 ) {
       double iodn;
@@ -1796,5 +1845,7 @@
 
   QString fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
-
+  // =====================
+  // BROADCAST ORBIT - 1
+  // =====================
   out << QString(fmt)
     .arg(1.e-3*_x_pos,          19, 'e', 12)
@@ -1802,5 +1853,7 @@
     .arg(1.e-3*_x_acceleration, 19, 'e', 12)
     .arg(_health,               19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 2
+  // =====================
   out << QString(fmt)
     .arg(1.e-3*_y_pos,          19, 'e', 12)
@@ -1808,5 +1861,7 @@
     .arg(1.e-3*_y_acceleration, 19, 'e', 12)
     .arg(_ura,                  19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 3
+  // =====================
   out << QString(fmt)
     .arg(1.e-3*_z_pos,          19, 'e', 12)
@@ -1822,5 +1877,13 @@
 t_ephBDS::t_ephBDS(double rnxVersion, const QStringList& lines) {
 
-  const int nLines = 8;
+  int nLines = 8;
+
+  if (navType() == t_eph::CNV1 ||
+      navType() == t_eph::CNV2) {
+    nLines += 2;
+  }
+  if (navType() == t_eph::CNV3) {
+    nLines += 1;
+  }
 
   if (lines.size() != nLines) {
@@ -1880,5 +1943,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 1
+    // =====================
     else if      ( iLine == 1 ) {
       double aode;
@@ -1892,5 +1957,7 @@
       _AODE = int(aode);
     }
-
+    // =====================
+    // BROADCAST ORBIT - 2
+    // =====================
     else if ( iLine == 2 ) {
       if ( readDbl(line, pos[0], fieldLen, _Cuc   ) ||
@@ -1902,5 +1969,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 3
+    // =====================
     else if ( iLine == 3 ) {
       if ( readDbl(line, pos[0], fieldLen, _TOEsec )  ||
@@ -1912,5 +1981,7 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 4
+    // =====================
     else if ( iLine == 4 ) {
       if ( readDbl(line, pos[0], fieldLen, _i0      ) ||
@@ -1922,41 +1993,146 @@
       }
     }
-
+    // =====================
+    // BROADCAST ORBIT - 5
+    // =====================
     else if ( iLine == 5 ) {
-      if ( readDbl(line, pos[0], fieldLen, _IDOT    ) ||
-           readDbl(line, pos[2], fieldLen, _BDTweek)) {
-        _checkState = bad;
-        return;
-      }
-    }
-
+
+      if (navType() == t_eph::CNV1 ||
+          navType() == t_eph::CNV2 ||
+          navType() == t_eph::CNV3 ) {
+        if ( readDbl(line, pos[0], fieldLen, _IDOT       ) ||
+             readDbl(line, pos[1], fieldLen, _Delta_n_dot) ||
+             readDbl(line, pos[2], fieldLen, _satType    ) ||
+             readDbl(line, pos[3], fieldLen, _top        ) ) {
+          _checkState = bad;
+          return;
+        }
+      }
+      else { // D1, D2, undefined
+        if ( readDbl(line, pos[0], fieldLen, _IDOT    ) ||
+             readDbl(line, pos[2], fieldLen, _BDTweek)) {
+          _checkState = bad;
+          return;
+        }
+      }
+    }
+    // =====================
+    // BROADCAST ORBIT - 6
+    // =====================
     else if ( iLine == 6 ) {
-      double SatH1;
-      if ( readDbl(line, pos[0], fieldLen, _URA ) ||
-           readDbl(line, pos[1], fieldLen, SatH1) ||
-           readDbl(line, pos[2], fieldLen, _TGD1) ||
-           readDbl(line, pos[3], fieldLen, _TGD2) ) {
-        _checkState = bad;
-        return;
-      }
-      _SatH1 = int(SatH1);
-    }
-
+      if (navType() == t_eph::CNV1 ||
+          navType() == t_eph::CNV2 ||
+          navType() == t_eph::CNV3 ) {
+        if ( readDbl(line, pos[0], fieldLen, _SISAI_oe  ) ||
+             readDbl(line, pos[1], fieldLen, _SISAI_ocb ) ||
+             readDbl(line, pos[2], fieldLen, _SISAI_oc1 ) ||
+             readDbl(line, pos[3], fieldLen, _SISAI_oc2  ) ) {
+          _checkState = bad;
+          return;
+        }
+      }
+      else { // D1, D2, undefined
+        double SatH1;
+        if ( readDbl(line, pos[0], fieldLen, _URA ) ||
+             readDbl(line, pos[1], fieldLen, SatH1) ||
+             readDbl(line, pos[2], fieldLen, _TGD1) ||
+             readDbl(line, pos[3], fieldLen, _TGD2) ) {
+          _checkState = bad;
+          return;
+        }
+        _SatH1 = int(SatH1);
+      }
+    }
+    // =====================
+    // BROADCAST ORBIT - 7
+    // =====================
     else if ( iLine == 7 ) {
-      double aodc;
-      if ( readDbl(line, pos[0], fieldLen, _TOT) ||
-           readDbl(line, pos[1], fieldLen, aodc) ) {
-        _checkState = bad;
-        return;
-      }
-      if (_TOT == 0.9999e9) {  // 0.9999e9 means not known (RINEX standard)
-        _TOT = _TOEsec;
-      }
-      _AODC = int(aodc);
-    }
-  }
-
-  _TOE.setBDS(int(_BDTweek), _TOEsec);
-
+      if (navType() == t_eph::CNV1) {
+        if ( readDbl(line, pos[0], fieldLen, _ISC_B1Cd) ||
+             readDbl(line, pos[2], fieldLen, _TGD_B1Cp) ||
+             readDbl(line, pos[3], fieldLen, _TGD_B2ap) ) {
+          _checkState = bad;
+          return;
+        }
+      }
+      else if (navType() == t_eph::CNV2) {
+        if ( readDbl(line, pos[1], fieldLen, _ISC_B2ad) ||
+             readDbl(line, pos[2], fieldLen, _TGD_B1Cp) ||
+             readDbl(line, pos[3], fieldLen, _TGD_B2ap) ) {
+          _checkState = bad;
+          return;
+        }
+      }
+      else if (navType() == t_eph::CNV3) {
+        if ( readDbl(line, pos[0], fieldLen, _SISMAI        ) ||
+             readDbl(line, pos[1], fieldLen, _health        ) ||
+             readDbl(line, pos[2], fieldLen, _INTEGRITYF_B2b) ||
+             readDbl(line, pos[3], fieldLen, _TGD_B2bI)     )  {
+          _checkState = bad;
+          return;
+        }
+      }
+      else { // D1, D2 or undefined
+        double aodc;
+        if ( readDbl(line, pos[0], fieldLen, _TOT) ||
+             readDbl(line, pos[1], fieldLen, aodc) ) {
+          _checkState = bad;
+          return;
+        }
+        if (_TOT == 0.9999e9) {  // 0.9999e9 means not known (RINEX standard)
+          _TOT = _TOEsec;
+        }
+        _AODC = int(aodc);
+      }
+    }
+    // =====================
+    // BROADCAST ORBIT - 8
+    // =====================
+    else if ( iLine == 8 ) {
+
+      if      (navType() == t_eph::CNV1) {
+        if ( readDbl(line, pos[0], fieldLen, _SISMAI        ) ||
+             readDbl(line, pos[1], fieldLen, _health        ) ||
+             readDbl(line, pos[2], fieldLen, _INTEGRITYF_B1C) ||
+             readDbl(line, pos[3], fieldLen, _IODC)     )  {
+          _checkState = bad;
+          return;
+        }
+      }
+      else if (navType() == t_eph::CNV2) {
+        if ( readDbl(line, pos[0], fieldLen, _SISMAI           ) ||
+             readDbl(line, pos[1], fieldLen, _health           ) ||
+             readDbl(line, pos[2], fieldLen, _INTEGRITYF_B2aB1C) ||
+             readDbl(line, pos[3], fieldLen, _IODC)            )  {
+          _checkState = bad;
+          return;
+        }
+      }
+      else if (navType() == t_eph::CNV3) {
+        if ( readDbl(line, pos[0], fieldLen, _TOT)) {
+          _checkState = bad;
+          return;
+        }
+      }
+
+    }
+    // =====================
+    // BROADCAST ORBIT - 9
+    // =====================
+    else if ( iLine == 9 ) {
+
+      if      (navType() == t_eph::CNV1 ||
+               navType() == t_eph::CNV2) {
+        if ( readDbl(line, pos[0], fieldLen, _TOT) ||
+             readDbl(line, pos[3], fieldLen, _IODE) ) {
+          _checkState = bad;
+          return;
+        }
+      }
+
+    }
+  }
+
+   _TOE.setBDS(int(_BDTweek), _TOEsec);
   // remark: actually should be computed from second_tot
   //         but it seems to be unreliable in RINEX files
@@ -2152,5 +2328,7 @@
 
   QString fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
-
+  // =====================
+  // BROADCAST ORBIT - 1
+  // =====================
   out << QString(fmt)
     .arg(double(_AODE), 19, 'e', 12)
@@ -2158,5 +2336,7 @@
     .arg(_Delta_n,      19, 'e', 12)
     .arg(_M0,           19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 2
+  // =====================
   out << QString(fmt)
     .arg(_Cuc,    19, 'e', 12)
@@ -2164,5 +2344,7 @@
     .arg(_Cus,    19, 'e', 12)
     .arg(_sqrt_A, 19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 3
+  // =====================
   out << QString(fmt)
     .arg(_TOEsec, 19, 'e', 12)
@@ -2170,5 +2352,7 @@
     .arg(_OMEGA0, 19, 'e', 12)
     .arg(_Cis,    19, 'e', 12);
-
+  // =====================
+  // BROADCAST ORBIT - 4
+  // =====================
   out << QString(fmt)
     .arg(_i0,       19, 'e', 12)
@@ -2176,29 +2360,119 @@
     .arg(_omega,    19, 'e', 12)
     .arg(_OMEGADOT, 19, 'e', 12);
-
-  out << QString(fmt)
-    .arg(_IDOT,    19, 'e', 12)
-    .arg(0.0,      19, 'e', 12)
-    .arg(_BDTweek, 19, 'e', 12)
-    .arg(0.0,      19, 'e', 12);
-
-  out << QString(fmt)
-    .arg(_URA,           19, 'e', 12)
-    .arg(double(_SatH1), 19, 'e', 12)
-    .arg(_TGD1,          19, 'e', 12)
-    .arg(_TGD2,          19, 'e', 12);
-
-  double tots = 0.0;
-  if (_receptDateTime.isValid()) {// RTCM stream input
-    tots = _TOE.bdssec();
-  }
-  else { // RINEX input
-    tots = _TOT;
-  }
-  out << QString(fmt)
-    .arg(tots,          19, 'e', 12)
-    .arg(double(_AODC), 19, 'e', 12)
-    .arg("",            19, QChar(' '))
-    .arg("",            19, QChar(' '));
+  // =====================
+  // BROADCAST ORBIT - 5
+  // =====================
+  if (navType() == t_eph::CNV1 ||
+      navType() == t_eph::CNV2 ||
+      navType() == t_eph::CNV3 ) {
+    out << QString(fmt)
+      .arg(_IDOT,        19, 'e', 12)
+      .arg(_Delta_n_dot, 19, 'e', 12)
+      .arg(_satType,     19, 'e', 12)
+      .arg(_top,         19, 'e', 12);
+  }
+  else { // D1, D2, undefined
+    out << QString(fmt)
+      .arg(_IDOT,    19, 'e', 12)
+      .arg("",            19, QChar(' '))
+      .arg(_BDTweek, 19, 'e', 12)
+      .arg("",            19, QChar(' '));
+  }
+  // =====================
+  // BROADCAST ORBIT - 6
+  // =====================
+  if (navType() == t_eph::CNV1 ||
+      navType() == t_eph::CNV2 ||
+      navType() == t_eph::CNV3 ) {
+    out << QString(fmt)
+      .arg(_SISAI_oe,  19, 'e', 12)
+      .arg(_SISAI_ocb, 19, 'e', 12)
+      .arg(_SISAI_oc1, 19, 'e', 12)
+      .arg(_SISAI_oc2, 19, 'e', 12);
+  }
+  else { // D1, D2, undefined
+    out << QString(fmt)
+      .arg(_URA,           19, 'e', 12)
+      .arg(double(_SatH1), 19, 'e', 12)
+      .arg(_TGD1,          19, 'e', 12)
+      .arg(_TGD2,          19, 'e', 12);
+  }
+  // =====================
+  // BROADCAST ORBIT - 7
+  // =====================
+  if      (navType() == t_eph::CNV1) {
+    out << QString(fmt)
+      .arg(_ISC_B1Cd, 19, 'e', 12)
+      .arg("",        19, QChar(' '))
+      .arg(_TGD_B1Cp, 19, 'e', 12)
+      .arg(_TGD_B2ap, 19, 'e', 12);
+  }
+  else if (navType() == t_eph::CNV2) {
+    out << QString(fmt)
+      .arg("",        19, QChar(' '))
+      .arg(_ISC_B2ad, 19, 'e', 12)
+      .arg(_TGD_B1Cp, 19, 'e', 12)
+      .arg(_TGD_B2ap, 19, 'e', 12);
+  }
+  else if (navType() == t_eph::CNV3) {
+    out << QString(fmt)
+      .arg(_SISMAI,         19, 'e', 12)
+      .arg(_health,         19, 'e', 12)
+      .arg(_INTEGRITYF_B2b, 19, 'e', 12)
+      .arg(_TGD_B2bI,       19, 'e', 12);
+  }
+  else { // D1, D2, undefined
+    double tots = 0.0;
+    if (_receptDateTime.isValid()) {// RTCM stream input
+      tots = _TOE.bdssec();
+    }
+    else { // RINEX input
+      tots = _TOT;
+    }
+    out << QString(fmt)
+      .arg(tots,          19, 'e', 12)
+      .arg(double(_AODC), 19, 'e', 12)
+      .arg("",            19, QChar(' '))
+      .arg("",            19, QChar(' '));
+  }
+
+  // =====================
+  // BROADCAST ORBIT - 8
+  // =====================
+  if      (navType() == t_eph::CNV1) {
+    out << QString(fmt)
+      .arg(_SISMAI,         19, 'e', 12)
+      .arg(_health,         19, 'e', 12)
+      .arg(_INTEGRITYF_B1C, 19, 'e', 12)
+      .arg(_IODC,           19, 'e', 12);
+  }
+  else if (navType() == t_eph::CNV2) {
+    out << QString(fmt)
+      .arg(_SISMAI,            19, 'e', 12)
+      .arg(_health,            19, 'e', 12)
+      .arg(_INTEGRITYF_B2aB1C, 19, 'e', 12)
+      .arg(_IODC,              19, 'e', 12);
+  }
+  else if (navType() == t_eph::CNV3) {
+    out << QString(fmt)
+      .arg(_TOT,          19, 'e', 12)
+      .arg("",            19, QChar(' '))
+      .arg("",            19, QChar(' '))
+      .arg("",            19, QChar(' '));
+  }
+
+  // =====================
+  // BROADCAST ORBIT - 9
+  // =====================
+  if      (navType() == t_eph::CNV1 ||
+           navType() == t_eph::CNV2) {
+    out << QString(fmt)
+      .arg(_TOT,          19, 'e', 12)
+      .arg("",            19, QChar(' '))
+      .arg("",            19, QChar(' '))
+      .arg(_IODE,         19, 'e', 12);
+  }
+
+
   return rnxStr;
 }
Index: trunk/BNC/src/ephemeris.h
===================================================================
--- trunk/BNC/src/ephemeris.h	(revision 9787)
+++ trunk/BNC/src/ephemeris.h	(revision 9788)
@@ -106,5 +106,5 @@
     _ADOT             = 0.0;
     _top              = 0.0;
-    _DN0DOT           = 0.0;
+    _Delta_n_dot      = 0.0;
     _URAI_NED0        = 0.0;
     _URAI_NED1        = 0.0;
@@ -178,5 +178,5 @@
   double  _ADOT;            // [m/s]
   double  _top;             // [s]
-  double  _DN0DOT;          // [rad/s^2]
+  double  _Delta_n_dot;     // [rad/s^2]
 
   double _URAI_NED0;        // []
@@ -491,33 +491,61 @@
   virtual t_irc position(int GPSweek, double GPSweeks, double* xc, double* vv) const;
 
-  double  _TOT;
+  double  _TOT;              // [s] of BDT week
   bncTime _TOE;
   int     _AODE;
   int     _AODC;
-  int     _URAI;             //  [0..15] index from RTCM stream
-  mutable double  _URA;      //  user range accuracy [m]
-  double  _clock_bias;       //  [s]
-  double  _clock_drift;      //  [s/s]
-  double  _clock_driftrate;  //  [s/s^2]
-  double  _Crs;              //  [m]
-  double  _Delta_n;          //  [rad/s]
-  double  _M0;               //  [rad]
-  double  _Cuc;              //  [rad]
+  int     _URAI;             // [0..15] index from RTCM stream
+  mutable double  _URA;      // user range accuracy [m]
+  double  _clock_bias;       // [s]
+  double  _clock_drift;      // [s/s]
+  double  _clock_driftrate;  // [s/s^2]
+  double  _Crs;              // [m]
+  double  _Delta_n;          // [rad/s]
+  double  _M0;               // [rad]
+  double  _Cuc;              // [rad]
   double  _e;                //
-  double  _Cus;              //  [rad]
-  double  _sqrt_A;           //  [m^0.5]
-  double  _Cic;              //  [rad]
-  double  _OMEGA0;           //  [rad]
-  double  _Cis;              //  [rad]
-  double  _i0;               //  [rad]
-  double  _Crc;              //  [m]
-  double  _omega;            //  [rad]
-  double  _OMEGADOT;         //  [rad/s]
-  double  _IDOT;             //  [rad/s]
-  double  _TGD1;             //  [s]
-  double  _TGD2;             //  [s]
+  double  _Cus;              // [rad]
+  double  _sqrt_A;           // [m^0.5]
+  double  _Cic;              // [rad]
+  double  _OMEGA0;           // [rad]
+  double  _Cis;              // [rad]
+  double  _i0;               // [rad]
+  double  _Crc;              // [m]
+  double  _omega;            // [rad]
+  double  _OMEGADOT;         // [rad/s]
+  double  _IDOT;             // [rad/s]
+  double  _TOEsec;           // [s] of BDT week
+  double  _BDTweek;          // BDT week
+
+  double  _Delta_n_dot;      // [rad/s^2]
+  double  _satType;          // 0..reserved, 1..GEO, 2..IGSO, 3..MEO
+  double  _top;              // [s]
+
+  double  _SISAI_oe;         // []
+  double  _SISAI_ocb;        // []
+  double  _SISAI_oc1;        // []
+  double  _SISAI_oc2;        // []
+
+  double  _ISC_B1Cd;         // [s]
+  double  _ISC_B2ad;         // [s]
+
+  double  _TGD1;             // [s]
+  double  _TGD2;             // [s]
+  double  _TGD_B1Cp;         // [s]
+  double  _TGD_B2ap;         // [s]
+  double  _TGD_B2bI;         // [s]
+
+  double  _SISMAI;           // []
+
   int     _SatH1;            //
-  double  _TOEsec;           //  [s] of BDT week
-  double  _BDTweek;          //  BDT week
+  double  _health;           //
+
+  double  _INTEGRITYF_B1C;   // 3 bits word from sf 3
+  double  _INTEGRITYF_B2aB1C;// 6 bits word with integrity bits in msg 10-11, 30.34 or 40
+  double  _INTEGRITYF_B2b;   // 3 bits word from msg 10
+
+  double  _IODC;             // []
+  double  _IODE;             // [] IODE are the same as the 8 LSBs of IODC
+
 };
 #endif
Index: trunk/BNC/src/rinex/rnxnavfile.cpp
===================================================================
--- trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 9787)
+++ trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 9788)
@@ -391,4 +391,12 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_rnxNavFile::writeEph(const t_eph* eph) {
+  if (version() < 4.0) {
+    if (eph->navType() == t_eph::CNAV ||
+        eph->navType() == t_eph::CNV1 ||
+        eph->navType() == t_eph::CNV2 ||
+        eph->navType() == t_eph::CNV3) {
+      return;
+    }
+  }
   *_stream << eph->toString(version());
 }
