Index: /trunk/BNC/src/ephemeris.cpp
===================================================================
--- /trunk/BNC/src/ephemeris.cpp	(revision 6842)
+++ /trunk/BNC/src/ephemeris.cpp	(revision 6843)
@@ -1309,5 +1309,5 @@
   // remark: actually should be computed from second_tot
   //         but it seems to be unreliable in RINEX files
-  _TOT = _TOC.bdssec();
+  //_TOT = _TOC.bdssec();
 }
 
@@ -1469,10 +1469,13 @@
     .arg(_sqrt_A, 19, 'e', 12);
 
-  double toes = _TOEsec;
-  if (!toes) { // RTCM stream input
+  double toes = 0.0;
+  if (_TOEweek > -1.0) {// RINEX input
+    toes = _TOEsec;
+  }
+  else {// RTCM stream input
     toes = _TOE.bdssec();
   }
   out << QString(fmt)
-    .arg(toes,   19, 'e', 12)
+    .arg(toes,    19, 'e', 12)
     .arg(_Cic,    19, 'e', 12)
     .arg(_OMEGA0, 19, 'e', 12)
@@ -1485,9 +1488,16 @@
     .arg(_OMEGADOT, 19, 'e', 12);
 
-  out << QString(fmt)
-    .arg(_IDOT,                             19, 'e', 12)
-    .arg(0.0,                               19, 'e', 12)
-    .arg(double(_TOE.bdsw()),               19, 'e', 12)
-    .arg(0.0,                               19, 'e', 12);
+  double toew = 0.0;
+  if (_TOEweek > -1.0) {// RINEX input
+    toew = _TOEweek;
+  }
+  else {// RTCM stream input
+    toew = double(_TOE.bdsw());
+  }
+  out << QString(fmt)
+    .arg(_IDOT, 19, 'e', 12)
+    .arg(0.0,   19, 'e', 12)
+    .arg(toew,  19, 'e', 12)
+    .arg(0.0,   19, 'e', 12);
 
   out << QString(fmt)
@@ -1497,6 +1507,9 @@
     .arg(_TGD2,          19, 'e', 12);
 
-  double tots = _TOT;
-  if (!tots) { // RTCM stream input
+  double tots = 0.0;
+  if (_TOEweek > -1.0) {// RINEX input
+    tots = _TOT;
+  }
+  else {// RTCM stream input
     tots = _TOE.bdssec();
   }
Index: /trunk/BNC/src/ephemeris.h
===================================================================
--- /trunk/BNC/src/ephemeris.h	(revision 6842)
+++ /trunk/BNC/src/ephemeris.h	(revision 6843)
@@ -248,5 +248,5 @@
  friend class RTCM3Decoder;
  public:
- t_ephBDS() {}
+ t_ephBDS() : _TOEweek(-1.0) {}
  t_ephBDS(float rnxVersion, const QStringList& lines);
   virtual ~t_ephBDS() {}
@@ -286,7 +286,7 @@
   double  _TGD2;             //  [s]    
   int     _SatH1;            // 
-  double  _TOW;              //  [s] of BDT week; RINEX file entry
-  double  _TOEsec;           //  [s] of BDT week; RINEX file entry
-  double  _TOEweek;
+  double  _TOW;              //  [s] of BDT week
+  double  _TOEsec;           //  [s] of BDT week
+  double  _TOEweek;          //  BDT week will be set only in case of RINEX file input
 };
 
