Index: /trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
===================================================================
--- /trunk/BNC/src/RTCM3/RTCM3Decoder.cpp	(revision 10586)
+++ /trunk/BNC/src/RTCM3/RTCM3Decoder.cpp	(revision 10587)
@@ -1064,5 +1064,5 @@
     }
     GETBITS(i, 4)
-    eph._ura = accuracyFromIndex(i, eph.type());
+    eph._ura = accuracyFromIndex(i, eph.system());
     GETBITS(eph._L2Codes, 2)
     GETFLOATSIGN(eph._IDOT, 14, R2R_PI/(double)(1<<30)/(double)(1<<13))
@@ -1132,7 +1132,7 @@
     GETBITS(eph._L2PFlag, 1)
     GETBITS(fitIntervalFalg, 1)
-    eph._fitInterval = fitIntervalFromFlag(fitIntervalFalg, eph._IODC, eph.type());
+    eph._fitInterval = fitIntervalFromFlag(fitIntervalFalg, eph._IODC, eph.system());
     eph._TOT = 0.9999e9;
-    eph._ephType = t_eph::LNAV;
+    eph._type = t_eph::LNAV;
 
     emit newGPSEph(eph);
@@ -1159,6 +1159,4 @@
     eph._receptStaID = _staID;
 
-    eph._flags_unknown = true;
-
     GETBITS(sv, 6)
     if (sv < 1 || sv > 63) {
@@ -1184,5 +1182,5 @@
       return false;
     }
-    eph._frequency_number = i - 7;
+    eph._frq_num = i - 7;
     GETBITS(eph._almanac_health, 1) /* almanac healthy */
     GETBITS(eph._almanac_health_availablility_indicator, 1) /* almanac health ok */
@@ -1245,13 +1243,13 @@
     eph._TOC.setTk(i * 60 * 1000); /* tb */
 
-    GETFLOATSIGNM(eph._x_velocity,    24, 1.0 / (double )(1 << 20))
-    GETFLOATSIGNM(eph._x_pos,         27, 1.0 / (double )(1 << 11))
-    GETFLOATSIGNM(eph._x_acceleration, 5, 1.0 / (double )(1 << 30))
-    GETFLOATSIGNM(eph._y_velocity,    24, 1.0 / (double )(1 << 20))
-    GETFLOATSIGNM(eph._y_pos,         27, 1.0 / (double )(1 << 11))
-    GETFLOATSIGNM(eph._y_acceleration, 5, 1.0 / (double )(1 << 30))
-    GETFLOATSIGNM(eph._z_velocity,    24, 1.0 / (double )(1 << 20))
-    GETFLOATSIGNM(eph._z_pos,         27, 1.0 / (double )(1 << 11))
-    GETFLOATSIGNM(eph._z_acceleration, 5, 1.0 / (double )(1 << 30))
+    GETFLOATSIGNM(eph._x_vel, 24, 1.0 / (double )(1 << 20))
+    GETFLOATSIGNM(eph._x_pos, 27, 1.0 / (double )(1 << 11))
+    GETFLOATSIGNM(eph._x_acc,  5, 1.0 / (double )(1 << 30))
+    GETFLOATSIGNM(eph._y_vel, 24, 1.0 / (double )(1 << 20))
+    GETFLOATSIGNM(eph._y_pos, 27, 1.0 / (double )(1 << 11))
+    GETFLOATSIGNM(eph._y_acc,  5, 1.0 / (double )(1 << 30))
+    GETFLOATSIGNM(eph._z_vel, 24, 1.0 / (double )(1 << 20))
+    GETFLOATSIGNM(eph._z_pos, 27, 1.0 / (double )(1 << 11))
+    GETFLOATSIGNM(eph._z_acc,  5, 1.0 / (double )(1 << 30))
     GETBITS(eph._P3, 1)    /* P3 */
     GETFLOATSIGNM(eph._gamma,      11, 1.0 / (double )(1 << 30) / (double )(1 << 10))
@@ -1281,5 +1279,5 @@
       return false;
     }
-    GETBITS(eph._NA,  11) /* GLONASS-M Na */
+    GETBITS(eph._M_NA,  11) /* GLONASS-M Na */
     GETFLOATSIGNM(eph._tauC,       32, 1.0/(double)(1<<30)/(double)(1<<1)) /* GLONASS tau c */
     GETBITS(eph._M_N4, 5) /* GLONASS-M N4 */
@@ -1302,7 +1300,7 @@
       return false;
     }
-    eph._xv(4) = eph._x_velocity * 1.e3;
-    eph._xv(5) = eph._y_velocity * 1.e3;
-    eph._xv(6) = eph._z_velocity * 1.e3;
+    eph._xv(4) = eph._x_vel * 1.e3;
+    eph._xv(5) = eph._y_vel * 1.e3;
+    eph._xv(6) = eph._z_vel * 1.e3;
     if (eph._xv.Rows(4,6).NormFrobenius() < 1.0) {
 #ifdef BNC_DEBUG_BCE
@@ -1312,8 +1310,10 @@
       return false;
     }
-    GLOFreq[sv - 1] = 100 + eph._frequency_number ; /* store frequency for other users (MSM) */
-    _gloFrq = QString("%1 %2").arg(eph._prn.toString().c_str()).arg(eph._frequency_number, 2, 'f', 0);
-
-    eph._ephType = t_eph::FDMA;
+    GLOFreq[sv - 1] = 100 + eph._frq_num ; /* store frequency for other users (MSM) */
+    _gloFrq = QString("%1 %2").arg(eph._prn.toString().c_str()).arg(eph._frq_num, 2, 'f', 0);
+
+    eph._type = t_eph::FDMA;
+    eph._healthflags_unknown = false;
+    eph._statusflags_unknown = false;
 
     emit newGlonassEph(eph);
@@ -1429,12 +1429,12 @@
 
     GETBITS(i, 4)
-    eph._ura = accuracyFromIndex(i, eph.type());
+    eph._ura = accuracyFromIndex(i, eph.system());
     GETBITS(eph._health, 6)
     GETFLOATSIGN(eph._TGD,       8, 1.0 / (double )(1 << 30) / (double )(1 << 1))
     GETBITS(eph._IODC, 10)
     GETBITS(fitIntervalFalg, 1)
-    eph._fitInterval = fitIntervalFromFlag(fitIntervalFalg, eph._IODC, eph.type());
+    eph._fitInterval = fitIntervalFromFlag(fitIntervalFalg, eph._IODC, eph.system());
     eph._TOT = 0.9999e9;
-    eph._ephType = t_eph::LNAV;
+    eph._type = t_eph::LNAV;
 
     emit newGPSEph(eph);
@@ -1487,5 +1487,5 @@
     GETFLOATSIGN(eph._clock_driftrate, 8, 1.0 / (double )(1 << 30) / (double )(1 << 25))
     GETBITS(i, 4)
-    eph._ura = accuracyFromIndex(i, eph.type());
+    eph._ura = accuracyFromIndex(i, eph.system());
     GETBITS(i, 16)
     i <<= 4;
@@ -1567,5 +1567,5 @@
     SKIPBITS(2)
     eph._TOT = 0.9999e9;
-    eph._ephType = t_eph::LNAV;
+    eph._type = t_eph::LNAV;
 
     emit newGPSEph(eph);
@@ -1618,5 +1618,5 @@
     eph._TOC.setTOD(i * 1000);
     GETBITS(i, 4)
-    eph._ura = accuracyFromIndex(i, eph.type());
+    eph._ura = accuracyFromIndex(i, eph.system());
     GETFLOATSIGN(eph._x_pos, 30, 0.08)
     GETFLOATSIGN(eph._y_pos, 30, 0.08)
@@ -1631,10 +1631,10 @@
       return false;
     }
-    GETFLOATSIGN(eph._x_velocity, 17, 0.000625)
-    GETFLOATSIGN(eph._y_velocity, 17, 0.000625)
-    GETFLOATSIGN(eph._z_velocity, 18, 0.004)
-    GETFLOATSIGN(eph._x_acceleration, 10, 0.0000125)
-    GETFLOATSIGN(eph._y_acceleration, 10, 0.0000125)
-    GETFLOATSIGN(eph._z_acceleration, 10, 0.0000625)
+    GETFLOATSIGN(eph._x_vel, 17, 0.000625)
+    GETFLOATSIGN(eph._y_vel, 17, 0.000625)
+    GETFLOATSIGN(eph._z_vel, 18, 0.004)
+    GETFLOATSIGN(eph._x_acc, 10, 0.0000125)
+    GETFLOATSIGN(eph._y_acc, 10, 0.0000125)
+    GETFLOATSIGN(eph._z_acc, 10, 0.0000625)
     GETFLOATSIGN(eph._agf0, 12, 1.0 / (1 << 30) / (1 << 1))
     GETFLOATSIGN(eph._agf1, 8, 1.0 / (1 << 30) / (1 << 10))
@@ -1642,5 +1642,5 @@
     eph._TOT = 0.9999E9;
     eph._health = 0;
-    eph._ephType = t_eph::SBASL1;
+    eph._type = t_eph::SBASL1;
 
     emit newSBASEph(eph);
@@ -1695,5 +1695,5 @@
     GETBITS(eph._IODnav, 10)
     GETBITS(i, 8)
-    eph._SISA = accuracyFromIndex(i, eph.type());
+    eph._SISA = accuracyFromIndex(i, eph.system());
     GETFLOATSIGN(eph._IDOT, 14, R2R_PI/(double)(1<<30)/(double)(1<<13))
     GETBITSFACTOR(i, 14, 60)
@@ -1731,5 +1731,5 @@
     }
     /* FIXME: overwrite value, copied from old code */
-    eph._TOEsec = eph._TOC.gpssec();
+    //eph._TOEsec = eph._TOC.gpssec();
     GETFLOATSIGN(eph._Cic,      16, 1.0 / (double )(1 << 29))
     GETFLOATSIGN(eph._OMEGA0,   32, R2R_PI/(double)(1<<30)/(double)(1<<1))
@@ -1742,17 +1742,17 @@
     if (eph._inav) {
       /* set unused F/NAV values */
-      eph._E5aHS = 0.0;
-      eph._e5aDataInvalid = false;
+      eph._E5a_HS = 0.0;
+      eph._E5a_DataInvalid = false;
 
       GETFLOATSIGN(eph._BGD_1_5B, 10, 1.0 / (double )(1 << 30) / (double )(1 << 2))
-      GETBITS(eph._E5bHS, 2)
-      GETBITS(eph._e5bDataInvalid, 1)
-      GETBITS(eph._E1_bHS, 2)
-      GETBITS(eph._e1DataInvalid, 1)
-      if (eph._E5bHS != eph._E1_bHS) {
+      GETBITS(eph._E5b_HS, 2)
+      GETBITS(eph._E5b_DataInvalid, 1)
+      GETBITS(eph._E1B_HS, 2)
+      GETBITS(eph._E1B_DataInvalid, 1)
+      if (eph._E5b_HS != eph._E1B_HS) {
 #ifdef BNC_DEBUG_BCE
         emit(newMessage(QString("%1: Block %2 (%3) SHS E5b %4 E1B %5: inconsistent health!")
              .arg(_staID).arg(1046,4).arg(eph._prn.toString().c_str())
-             .arg(eph._E5bHS).arg(eph._E1_bHS).toLatin1(), true));
+             .arg(eph._E5b_HS).arg(eph._E1B_HS).toLatin1(), true));
 #endif
         return false;
@@ -1761,5 +1761,5 @@
           (eph._BGD_1_5B == 0.0 && fabs(eph._BGD_1_5A) > 1e-9)) {
 #ifdef BNC_DEBUG_BCE
-        emit(newMessage(QString("%1: Block %2 (%3) BGD_15a = %4 BGD_15b = %5: inconsistent BGD!")
+        emit(newMessage(QString("%1: Block %2 (%3) BGD_1_5a = %4 BGD_1_5b = %5: inconsistent BGD!")
              .arg(_staID).arg(1046,4).arg(eph._prn.toString().c_str())
              .arg(eph._BGD_1_5A,10,'E',3).arg(eph._BGD_1_5B,10,'E',3).toLatin1(), true));
@@ -1767,17 +1767,17 @@
         return false;
       }
-      eph._ephType = t_eph::INAF;
+      eph._type = t_eph::INAV;
     }
     else {
       /* set unused I/NAV values */
       eph._BGD_1_5B = 0.0;
-      eph._E5bHS = 0.0;
-      eph._E1_bHS = 0.0;
-      eph._e1DataInvalid = false;
-      eph._e5bDataInvalid = false;
-
-      GETBITS(eph._E5aHS, 2)
-      GETBITS(eph._e5aDataInvalid, 1)
-      eph._ephType = t_eph::FNAV;
+      eph._E5b_HS = 0.0;
+      eph._E1B_HS = 0.0;
+      eph._E1B_DataInvalid = false;
+      eph._E5b_DataInvalid = false;
+
+      GETBITS(eph._E5a_HS, 2)
+      GETBITS(eph._E5a_DataInvalid, 1)
+      eph._type = t_eph::FNAV;
     }
     eph._TOT = 0.9999e9;
@@ -1841,5 +1841,5 @@
     eph._BDTweek = week;
     GETBITS(i, 4)
-    eph._URA = accuracyFromIndex(i, eph.type());
+    eph._ura = accuracyFromIndex(i, eph.system());
     GETFLOATSIGN(eph._IDOT, 14, R2R_PI/(double)(1<<30)/(double)(1<<13))
     GETBITS(eph._AODE, 5)
@@ -1903,8 +1903,8 @@
     eph._TOT = 0.9999E9;
     if (eph._i0 > iMaxGEO) {
-      eph._ephType = t_eph::D1;
+      eph._type = t_eph::D1;
     }
     else {
-      eph._ephType = t_eph::D2;
+      eph._type = t_eph::D2;
     }
 
Index: /trunk/BNC/src/RTCM3/ephEncoder.cpp
===================================================================
--- /trunk/BNC/src/RTCM3/ephEncoder.cpp	(revision 10586)
+++ /trunk/BNC/src/RTCM3/ephEncoder.cpp	(revision 10587)
@@ -14,10 +14,10 @@
   int numbits = 0;
   unsigned long long bitbuffer = 0;
-  int ura = indexFromAccuracy(eph._ura, eph.type());
+  int ura = indexFromAccuracy(eph._ura, eph.system());
   int L5Flag = 0;
   int SFlag = 0;
   int fitIntervalFlag = 0;
 
-  if (eph.type() == t_eph::QZSS) {
+  if (eph.system() == t_eph::QZSS) {
     GPSADDBITS(12, 1044)
     GPSADDBITS(4, eph._prn.number())
@@ -52,5 +52,5 @@
     GPSADDBITS(1, fitIntervalFlag)
     GPSADDBITS(3, 0) /* padding */
-  } else if (eph.type() == t_eph::IRNSS) {
+  } else if (eph.system() == t_eph::IRNSS) {
     GPSADDBITS(12, 1041)
     GPSADDBITS(6, eph._prn.number())
@@ -156,5 +156,5 @@
   GLONASSADDBITS(12, 1020)
   GLONASSADDBITS(6, eph._prn.number())
-  GLONASSADDBITS(5, 7+eph._frequency_number)
+  GLONASSADDBITS(5, 7+eph._frq_num)
   GLONASSADDBITS(1, eph._almanac_health)
   GLONASSADDBITS(1, eph._almanac_health_availablility_indicator)
@@ -169,13 +169,13 @@
   unsigned long long timeofday = (static_cast<int>(eph._tt.gpssec()+3*60*60-eph._gps_utc)%86400);
   GLONASSADDBITS(7, timeofday/60/15)
-  GLONASSADDBITSFLOATM(24, eph._x_velocity*1000, 1000.0/static_cast<double>(1<<20))
+  GLONASSADDBITSFLOATM(24, eph._x_vel*1000, 1000.0/static_cast<double>(1<<20))
   GLONASSADDBITSFLOATM(27, eph._x_pos*1000, 1000.0/static_cast<double>(1<<11))
-  GLONASSADDBITSFLOATM(5, eph._x_acceleration*1000, 1000.0/static_cast<double>(1<<30))
-  GLONASSADDBITSFLOATM(24, eph._y_velocity*1000, 1000.0/static_cast<double>(1<<20))
+  GLONASSADDBITSFLOATM(5, eph._x_acc*1000, 1000.0/static_cast<double>(1<<30))
+  GLONASSADDBITSFLOATM(24, eph._y_vel*1000, 1000.0/static_cast<double>(1<<20))
   GLONASSADDBITSFLOATM(27, eph._y_pos*1000, 1000.0/static_cast<double>(1<<11))
-  GLONASSADDBITSFLOATM(5, eph._y_acceleration*1000, 1000.0/static_cast<double>(1<<30))
-  GLONASSADDBITSFLOATM(24, eph._z_velocity*1000, 1000.0/static_cast<double>(1<<20))
+  GLONASSADDBITSFLOATM(5, eph._y_acc*1000, 1000.0/static_cast<double>(1<<30))
+  GLONASSADDBITSFLOATM(24, eph._z_vel*1000, 1000.0/static_cast<double>(1<<20))
   GLONASSADDBITSFLOATM(27,eph._z_pos*1000, 1000.0/static_cast<double>(1<<11))
-  GLONASSADDBITSFLOATM(5, eph._z_acceleration*1000, 1000.0/static_cast<double>(1<<30))
+  GLONASSADDBITSFLOATM(5, eph._z_acc*1000, 1000.0/static_cast<double>(1<<30))
   GLONASSADDBITS(1, eph._P3)
   GLONASSADDBITSFLOATM(11, eph._gamma, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<10))
@@ -190,5 +190,5 @@
   GLONASSADDBITS(2, eph._M_M) /* GLONASS-M active? */
   GLONASSADDBITS(1, eph._additional_data_availability) /* GLONASS additional data */
-  GLONASSADDBITS(11, eph._NA) /* GLONASS NA */
+  GLONASSADDBITS(11, eph._M_NA) /* GLONASS NA */
   GLONASSADDBITSFLOATM(32, eph._tauC, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1)) /* GLONASS tau C */
   GLONASSADDBITS(5, eph._M_N4) /* GLONASS-M N4 */
@@ -217,5 +217,5 @@
   buffer= buffer+3;
 
-  int SISA = indexFromAccuracy(eph._SISA, eph.type());
+  int SISA = indexFromAccuracy(eph._SISA, eph.system());
 
   GALILEOADDBITS(12, eph._inav ? 1046 : 1045)
@@ -247,11 +247,11 @@
   if(eph._inav) {
     GALILEOADDBITSFLOAT(10, eph._BGD_1_5B, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<2))
-    GALILEOADDBITS(2, static_cast<int>(eph._E5bHS))
-    GALILEOADDBITS(1, eph._e5bDataInvalid ? 1 : 0)
-    GALILEOADDBITS(2, static_cast<int>(eph._E1_bHS))
-    GALILEOADDBITS(1, eph._e1DataInvalid ? 1 : 0)
+    GALILEOADDBITS(2, static_cast<int>(eph._E5b_HS))
+    GALILEOADDBITS(1, eph._E5b_DataInvalid ? 1 : 0)
+    GALILEOADDBITS(2, static_cast<int>(eph._E1B_HS))
+    GALILEOADDBITS(1, eph._E1B_DataInvalid ? 1 : 0)
   } else {
-    GALILEOADDBITS(2, static_cast<int>(eph._E5aHS))
-    GALILEOADDBITS(1,  eph._e5aDataInvalid ? 1 : 0)
+    GALILEOADDBITS(2, static_cast<int>(eph._E5a_HS))
+    GALILEOADDBITS(1,  eph._E5a_DataInvalid ? 1 : 0)
   }
 
@@ -278,5 +278,5 @@
   buffer= buffer+3;
 
-  int ura = indexFromAccuracy(eph._ura, eph.type());
+  int ura = indexFromAccuracy(eph._ura, eph.system());
   SBASADDBITS(12, 1043)
   SBASADDBITS(6, eph._prn.number()-20)
@@ -287,10 +287,10 @@
   SBASADDBITSFLOAT(30, eph._y_pos, 0.08)
   SBASADDBITSFLOAT(25, eph._z_pos, 0.4)
-  SBASADDBITSFLOAT(17, eph._x_velocity, 0.000625)
-  SBASADDBITSFLOAT(17, eph._y_velocity, 0.000625)
-  SBASADDBITSFLOAT(18, eph._z_velocity, 0.004)
-  SBASADDBITSFLOAT(10, eph._x_acceleration, 0.0000125)
-  SBASADDBITSFLOAT(10, eph._y_acceleration, 0.0000125)
-  SBASADDBITSFLOAT(10, eph._z_acceleration, 0.0000625)
+  SBASADDBITSFLOAT(17, eph._x_vel, 0.000625)
+  SBASADDBITSFLOAT(17, eph._y_vel, 0.000625)
+  SBASADDBITSFLOAT(18, eph._z_vel, 0.004)
+  SBASADDBITSFLOAT(10, eph._x_acc, 0.0000125)
+  SBASADDBITSFLOAT(10, eph._y_acc, 0.0000125)
+  SBASADDBITSFLOAT(10, eph._z_acc, 0.0000625)
   SBASADDBITSFLOAT(12, eph._agf0, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1))
   SBASADDBITSFLOAT(8, eph._agf1, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<10))
@@ -317,9 +317,9 @@
   buffer= buffer+3;
 
-  int URA = indexFromAccuracy(eph._URA, eph.type());
+  int URAI = indexFromAccuracy(eph._ura, eph.system());
   BDSADDBITS(12, 1042)
   BDSADDBITS(6, eph._prn.number())
   BDSADDBITS(13, eph._TOC.bdsw())
-  BDSADDBITS(4, URA);
+  BDSADDBITS(4, URAI);
   BDSADDBITSFLOAT(14, eph._IDOT, M_PI/static_cast<double>(1<<30)/static_cast<double>(1<<13))
   BDSADDBITS(5, eph._AODE)
Index: /trunk/BNC/src/bnccore.cpp
===================================================================
--- /trunk/BNC/src/bnccore.cpp	(revision 10586)
+++ /trunk/BNC/src/bnccore.cpp	(revision 10587)
@@ -209,5 +209,5 @@
     messagePrivate(QString("%1: UNHEALTHY %2:%3")
                    .arg(eph->receptStaID())
-                   .arg(eph->ephTypeStr(eph->ephType(), eph->prn(), 99.0))
+                   .arg(eph->typeStr(eph->type(), eph->prn(), 99.0))
                    .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1());
   }
@@ -215,5 +215,5 @@
     messagePrivate(QString("%1: WRONG %2:%3")
                    .arg(eph->receptStaID())
-                   .arg(eph->ephTypeStr(eph->ephType(), eph->prn(), 99.0))
+                   .arg(eph->typeStr(eph->type(), eph->prn(), 99.0))
                    .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1());
   }
@@ -221,5 +221,5 @@
     messagePrivate(QString("%1: OUTDATED %2:%3")
                    .arg(eph->receptStaID())
-                   .arg(eph->ephTypeStr(eph->ephType(), eph->prn(), 99.0))
+                   .arg(eph->typeStr(eph->type(), eph->prn(), 99.0))
                    .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1());
   }
@@ -491,8 +491,8 @@
   QString strV4 = eph.toString(defaultRnxNavVersion4);
 
-  if     (_rinexVers == 2 && eph.type() == t_eph::GLONASS) {
+  if      (_rinexVers == 2 && eph.system() == t_eph::GLONASS) {
     printOutputEph(printFile, _ephStreamGlonass, strV2, strV3, strV4);
   }
-  else if(_rinexVers == 2 && eph.type() == t_eph::GPS)  {
+  else if (_rinexVers == 2 && eph.system() == t_eph::GPS) {
     printOutputEph(printFile, _ephStreamGPS, strV2, strV3, strV4);
   }
Index: /trunk/BNC/src/bncephuser.cpp
===================================================================
--- /trunk/BNC/src/bncephuser.cpp	(revision 10586)
+++ /trunk/BNC/src/bncephuser.cpp	(revision 10587)
@@ -276,39 +276,39 @@
 
     // update interval: 2h
-    if      (eph->type() == t_eph::GPS     && dt >  7200.0) {
+    if      (eph->system() == t_eph::GPS     && dt >  7200.0) {
       ephL->setCheckState(t_eph::outdated);
       return;
     }
     // update interval: 3h
-    else if (eph->type() == t_eph::Galileo && dt > 10800.0) {
+    else if (eph->system() == t_eph::Galileo && dt > 10800.0) {
       ephL->setCheckState(t_eph::outdated);
       return;
     }
     // updated every 30 minutes + 5 min
-    else if (eph->type() == t_eph::GLONASS && dt >  2100.0) {
+    else if (eph->system() == t_eph::GLONASS && dt >  2100.0) {
       ephL->setCheckState(t_eph::outdated);
       return;
     }
     // updated every ?
-    else if (eph->type() == t_eph::QZSS    && dt >  3600.0) {
+    else if (eph->system() == t_eph::QZSS    && dt >  3600.0) {
       ephL->setCheckState(t_eph::outdated);
       return;
     }
     // maximum update interval: 300 sec
-    else if  (eph->type() == t_eph::SBAS   && dt >   600.0) {
+    else if  (eph->system() == t_eph::SBAS   && dt >   600.0) {
       ephL->setCheckState(t_eph::outdated);
       return;
     }
     // updates 1h + 5 min
-    else if  (eph->type() == t_eph::BDS    && dt >  3900.0) {
+    else if  (eph->system() == t_eph::BDS    && dt >  3900.0) {
       ephL->setCheckState(t_eph::outdated);
       return;
     }
     // update interval: up to 24 hours
-    else if  (eph->type() == t_eph::IRNSS  && dt > 86400.0) {
-      ephL->setCheckState(t_eph::outdated);
-      return;
-    }
-  }
-}
-
+    else if  (eph->system() == t_eph::IRNSS  && dt > 86400.0) {
+      ephL->setCheckState(t_eph::outdated);
+      return;
+    }
+  }
+}
+
Index: /trunk/BNC/src/bncutils.cpp
===================================================================
--- /trunk/BNC/src/bncutils.cpp	(revision 10586)
+++ /trunk/BNC/src/bncutils.cpp	(revision 10587)
@@ -266,29 +266,29 @@
 
   // update interval: 2h, data sets are valid for 4 hours
-  if      (eph->type() == t_eph::GPS     && (dt > 14400.0 || dt < -7200.0)) {
+  if      (eph->system() == t_eph::GPS     && (dt > 14400.0 || dt < -7200.0)) {
     return true;
   }
   // update interval: 3h, data sets are valid for 4 hours
-  else if (eph->type() == t_eph::Galileo && (dt > 14400.0 || dt <     0.0)) {
+  else if (eph->system() == t_eph::Galileo && (dt > 14400.0 || dt <     0.0)) {
     return true;
   }
   // updated every 30 minutes + 5 min
-  else if (eph->type() == t_eph::GLONASS && (dt >  2100.0 || dt < -2100.0)) {
+  else if (eph->system() == t_eph::GLONASS && (dt >  2100.0 || dt < -2100.0)) {
     return true;
   }
   // orbit parameters are valid for 7200 seconds (minimum)
-  else if (eph->type() == t_eph::QZSS    && (dt >  7200.0 || dt < -3600.0)) {
+  else if (eph->system() == t_eph::QZSS    && (dt >  7200.0 || dt < -3600.0)) {
     return true;
   }
   // maximum update interval: 300 sec
-  else if (eph->type() == t_eph::SBAS    && (dt >   600.0 || dt <  -600.0)) {
+  else if (eph->system() == t_eph::SBAS    && (dt >   600.0 || dt <  -600.0)) {
     return true;
   }
   // updates 1h + 5 min
-  else if (eph->type() == t_eph::BDS     && (dt >  3900.0 || dt <     0.0) ) {
+  else if (eph->system() == t_eph::BDS     && (dt >  3900.0 || dt <     0.0) ) {
     return true;
   }
   // update interval: up to 24 hours
-  else if (eph->type() == t_eph::IRNSS   && (fabs(dt > 86400.0))) {
+  else if (eph->system() == t_eph::IRNSS   && (fabs(dt > 86400.0))) {
     return true;
   }
@@ -845,12 +845,12 @@
 //
 ////////////////////////////////////////////////////////////////////////////
-double accuracyFromIndex(int index, t_eph::e_type type) {
+double accuracyFromIndex(int index, t_eph::e_system system) {
 double accuracy = -1.0;
 
-  if (type == t_eph::GPS ||
-      type == t_eph::BDS ||
-      type == t_eph::SBAS||
-      type == t_eph::QZSS||
-      type == t_eph::IRNSS) {
+  if (system == t_eph::GPS ||
+      system == t_eph::BDS ||
+      system == t_eph::SBAS||
+      system == t_eph::QZSS||
+      system == t_eph::IRNSS) {
     if ((index >= 0) && (index <= 6)) {
       if (index == 3) {
@@ -869,5 +869,5 @@
     }
   }
-  else if (type == t_eph::Galileo) {
+  else if (system == t_eph::Galileo) {
     if ((index >= 0) && (index <= 49)) {
       accuracy = (double(index) / 100.0);
@@ -891,11 +891,11 @@
 //
 ////////////////////////////////////////////////////////////////////////////
-int indexFromAccuracy(double accuracy, t_eph::e_type type) {
-
-  if (type == t_eph::GPS ||
-      type == t_eph::BDS ||
-      type == t_eph::SBAS ||
-      type == t_eph::QZSS ||
-      type == t_eph::IRNSS) {
+int indexFromAccuracy(double accuracy, t_eph::e_system system) {
+
+  if (system == t_eph::GPS ||
+      system == t_eph::BDS ||
+      system == t_eph::SBAS ||
+      system == t_eph::QZSS ||
+      system == t_eph::IRNSS) {
 
     if      (accuracy <= 2.40) {
@@ -949,5 +949,5 @@
   }
 
-  if (type == t_eph::Galileo) {
+  if (system == t_eph::Galileo) {
     if      (accuracy <= 0.49) {
       return int(ceil(accuracy * 100.0));
@@ -967,23 +967,23 @@
   }
 
-  return (type == t_eph::Galileo) ? 255 : 15;
+  return (system == t_eph::Galileo) ? 255 : 15;
 }
 
 // Returns fit interval in hours from flag
 ////////////////////////////////////////////////////////////////////////////
-double fitIntervalFromFlag(int flag, double iodc, t_eph::e_type type) {
+double fitIntervalFromFlag(int flag, double iodc, t_eph::e_system system) {
   double fitInterval = 0.0;
 
   switch (flag) {
     case 0:
-      if      (type == t_eph::GPS) {
+      if      (system == t_eph::GPS) {
         fitInterval = 4.0;
       }
-      else if (type == t_eph::QZSS) {
+      else if (system == t_eph::QZSS) {
         fitInterval = 2.0;
       }
       break;
     case 1:
-      if (type == t_eph::GPS) {
+      if (system == t_eph::GPS) {
         if      (iodc >= 240 && iodc <= 247) {
           fitInterval =  8.0;
Index: /trunk/BNC/src/bncutils.h
===================================================================
--- /trunk/BNC/src/bncutils.h	(revision 10586)
+++ /trunk/BNC/src/bncutils.h	(revision 10587)
@@ -147,9 +147,9 @@
 void         stripWhiteSpace(std::string& str);
 
-double       accuracyFromIndex(int index, t_eph::e_type type);
+double       accuracyFromIndex(int index, t_eph::e_system system);
 
-int          indexFromAccuracy(double accuracy, t_eph::e_type type);
+int          indexFromAccuracy(double accuracy, t_eph::e_system system);
 
-double       fitIntervalFromFlag(int flag, double iodc, t_eph::e_type type);
+double       fitIntervalFromFlag(int flag, double iodc, t_eph::e_system system);
 
 double       associatedLegendreFunction(int n, int m, double t);
Index: /trunk/BNC/src/ephemeris.cpp
===================================================================
--- /trunk/BNC/src/ephemeris.cpp	(revision 10586)
+++ /trunk/BNC/src/ephemeris.cpp	(revision 10587)
@@ -22,5 +22,5 @@
 t_eph::t_eph() {
   _checkState = unchecked;
-  _ephType = undefined;
+  _type = undefined;
   _orbCorr = 0;
   _clkCorr = 0;
@@ -109,54 +109,52 @@
 //
 //////////////////////////////////////////////////////////////////////////////
-t_irc t_eph::setEphType(QString ephTypeStr) {
-
-  if (ephTypeStr == "LNAV") {
-    _ephType = t_eph::LNAV;
-  } else if (ephTypeStr == "FDMA") {
-    _ephType = t_eph::FDMA;
-  } else if (ephTypeStr == "FNAV") {
-    _ephType = t_eph::FNAV;
-  } else if (ephTypeStr == "INAV") {
-    _ephType = t_eph::INAF;
-  } else if (ephTypeStr == "D1") {
-    _ephType = t_eph::D1;
-  } else if (ephTypeStr == "D2") {
-    _ephType = t_eph::D2;
-  } else if (ephTypeStr == "SBAS") {
-    _ephType = t_eph::SBASL1;
-  } else if (ephTypeStr == "CNAV") {
-    _ephType = t_eph::CNAV;
-  } else if (ephTypeStr == "CNV1") {
-    _ephType = t_eph::CNV1;
-  } else if (ephTypeStr == "CNV2") {
-    _ephType = t_eph::CNV2;
-  } else if (ephTypeStr == "CNV3") {
-    _ephType = t_eph::CNV3;
-  } else if (ephTypeStr == "L1NV") {
-    _ephType = t_eph::L1NV;
-  } else if (ephTypeStr == "L1OC") {
-    _ephType = t_eph::L1OC;
-  } else if (ephTypeStr == "L3OC") {
-    _ephType = t_eph::L3OC;
+void t_eph::setType(QString typeStr) {
+
+  if (typeStr == "LNAV") {
+    _type = t_eph::LNAV;
+  } else if (typeStr == "FDMA") {
+    _type = t_eph::FDMA;
+  } else if (typeStr == "FNAV") {
+    _type = t_eph::FNAV;
+  } else if (typeStr == "INAV") {
+    _type = t_eph::INAV;
+  } else if (typeStr == "D1") {
+    _type = t_eph::D1;
+  } else if (typeStr == "D2") {
+    _type = t_eph::D2;
+  } else if (typeStr == "SBAS") {
+    _type = t_eph::SBASL1;
+  } else if (typeStr == "CNAV") {
+    _type = t_eph::CNAV;
+  } else if (typeStr == "CNV1") {
+    _type = t_eph::CNV1;
+  } else if (typeStr == "CNV2") {
+    _type = t_eph::CNV2;
+  } else if (typeStr == "CNV3") {
+    _type = t_eph::CNV3;
+  } else if (typeStr == "L1NV") {
+    _type = t_eph::L1NV;
+  } else if (typeStr == "L1OC") {
+    _type = t_eph::L1OC;
+  } else if (typeStr == "L3OC") {
+    _type = t_eph::L3OC;
   } else {
-    _ephType = t_eph::undefined;
-    return failure;
-  }
-
-  return success;
+    _type = t_eph::undefined;
+  }
+
 }
 
 //
 //////////////////////////////////////////////////////////////////////////////
-QString t_eph::ephTypeStr(e_ephType ephType, const t_prn &prn, double version) {
-  QString ephTypeStr = "";
+QString t_eph::typeStr(e_type type, const t_prn &prn, double version) {
+  QString typeStr = "";
   QString epochStart;
   QString eolStr;
 
   if (version < 4.0) {
-    return ephTypeStr;
-  }
-
-  if (version == 99.0) {
+    return typeStr;
+  }
+
+  if (version == 99.0) { // log output for OUTDATED, WRONG or UNHEALTHY satellites
     epochStart = "";
     eolStr = "";
@@ -167,52 +165,52 @@
 
   QString ephStr = QString("EPH %1 ").arg(prn.toString().c_str());
-  switch (ephType) {
+  switch (type) {
     case undefined:
-      ephTypeStr = epochStart + ephStr + "unknown" + eolStr;
+      typeStr = epochStart + ephStr + "unknown" + eolStr;
       break;
     case LNAV:
-      ephTypeStr = epochStart + ephStr + "LNAV" + eolStr;
+      typeStr = epochStart + ephStr + "LNAV" + eolStr;
       break;
     case FDMA:
-      ephTypeStr = epochStart + ephStr + "FDMA" + eolStr;
+      typeStr = epochStart + ephStr + "FDMA" + eolStr;
       break;
     case FNAV:
-      ephTypeStr = epochStart + ephStr + "FNAV" + eolStr;
+      typeStr = epochStart + ephStr + "FNAV" + eolStr;
       break;
-    case INAF:
-      ephTypeStr = epochStart + ephStr + "INAV" + eolStr;
+    case INAV:
+      typeStr = epochStart + ephStr + "INAV" + eolStr;
       break;
     case D1:
-      ephTypeStr = epochStart + ephStr + "D1  " + eolStr;
+      typeStr = epochStart + ephStr + "D1  " + eolStr;
       break;
     case D2:
-      ephTypeStr = epochStart + ephStr + "D2  " + eolStr;
+      typeStr = epochStart + ephStr + "D2  " + eolStr;
       break;
     case SBASL1:
-      ephTypeStr = epochStart + ephStr + "SBAS" + eolStr;
+      typeStr = epochStart + ephStr + "SBAS" + eolStr;
       break;
     case CNAV:
-      ephTypeStr = epochStart + ephStr + "CNAV" + eolStr;
+      typeStr = epochStart + ephStr + "CNAV" + eolStr;
       break;
     case CNV1:
-      ephTypeStr = epochStart + ephStr + "CNV1" + eolStr;
+      typeStr = epochStart + ephStr + "CNV1" + eolStr;
       break;
     case CNV2:
-      ephTypeStr = epochStart + ephStr + "CNV2" + eolStr;
+      typeStr = epochStart + ephStr + "CNV2" + eolStr;
       break;
     case CNV3:
-      ephTypeStr = epochStart + ephStr + "CNV3" + eolStr;
+      typeStr = epochStart + ephStr + "CNV3" + eolStr;
       break;
     case L1NV:
-      ephTypeStr = epochStart + ephStr + "L1NV" + eolStr;
+      typeStr = epochStart + ephStr + "L1NV" + eolStr;
       break;
     case L1OC:
-      ephTypeStr = epochStart + ephStr + "L1OC" + eolStr;
+      typeStr = epochStart + ephStr + "L1OC" + eolStr;
       break;
     case L3OC:
-      ephTypeStr = epochStart + ephStr + "L3OC" + eolStr;
+      typeStr = epochStart + ephStr + "L3OC" + eolStr;
       break;
   }
-  return ephTypeStr;
+  return typeStr;
 }
 
@@ -246,10 +244,12 @@
         << QString(" %1 %2 %3 %4 %5%6").arg(year % 100, 2, 10, QChar('0')).arg(
             month, 2).arg(day, 2).arg(hour, 2).arg(min, 2).arg(sec, 5, 'f', 1);
-  } else if (version == 99) {
+  }
+  else if (version == 99) {
     out
         << QString(" %1 %2 %3 %4 %5 %6").arg(year, 4).arg(month, 2, 10,
             QChar('0')).arg(day, 2, 10, QChar('0')).arg(hour, 2, 10, QChar('0')).arg(
             min, 2, 10, QChar('0')).arg(int(sec), 2, 10, QChar('0'));
-  } else {
+  }
+  else {
     out << prnStr
         << QString(" %1 %2 %3 %4 %5 %6").arg(year, 4).arg(month, 2, 10,
@@ -265,11 +265,16 @@
 t_ephGPS::t_ephGPS(double rnxVersion, const QStringList &lines) {
 
-  int nLines = 8; // LNAV,
-
-  if (ephType() == t_eph::CNAV ||
-      ephType() == t_eph::L1NV) {
+  int nLines = 8; // LNAV
+
+  // Source RINEX version < 4
+  if (type() == t_eph::undefined) {
+    _type = t_eph::LNAV;
+  }
+
+  if (type() == t_eph::CNAV ||
+      type() == t_eph::L1NV) {
     nLines += 1;
   }
-  if (ephType() == t_eph::CNV2) {
+  if (type() == t_eph::CNV2) {
     nLines += 2;
   }
@@ -283,4 +288,5 @@
   // ------------
   int fieldLen = 19;
+  double statusflags = 0.0;
 
   int pos[4];
@@ -290,6 +296,6 @@
   pos[3] = pos[2] + fieldLen;
 
-  // Read eight lines
-  // ----------------
+  // Read nLines lines
+  // ------------------
   for (int iLine = 0; iLine < nLines; iLine++) {
     QString line = lines[iLine];
@@ -303,6 +309,8 @@
       in >> prnStr;
 
-      if (prnStr.size() == 1
-          && (prnStr[0] == 'G' || prnStr[0] == 'J' || prnStr[0] == 'I')) {
+      if (prnStr.size() == 1 &&
+          (prnStr[0] == 'G' ||
+           prnStr[0] == 'J' ||
+           prnStr[0] == 'I')) {
         in >> n;
         prnStr.append(n);
@@ -310,5 +318,5 @@
 
       in >> year >> month >> day >> hour >> min >> sec;
-      if (prnStr.at(0) == 'G') {
+      if (       prnStr.at(0) == 'G') {
         _prn.set('G', prnStr.mid(1).toInt());
       } else if (prnStr.at(0) == 'J') {
@@ -339,7 +347,7 @@
     // =====================
     else if (iLine == 1) {
-      if (ephType() == t_eph::CNAV ||
-          ephType() == t_eph::CNV2 ||
-          ephType() == t_eph::L1NV) {
+      if (type() == t_eph::CNAV ||
+          type() == t_eph::CNV2 ||
+          type() == t_eph::L1NV) {
         if (   readDbl(line, pos[0], fieldLen, _ADOT)
             || readDbl(line, pos[1], fieldLen, _Crs)
@@ -349,5 +357,5 @@
           return;
         }
-      } else { // LNAV, undefined
+      } else { // LNAV
         if (   readDbl(line, pos[0], fieldLen, _IODE)
             || readDbl(line, pos[1], fieldLen, _Crs)
@@ -375,6 +383,6 @@
     // =====================
     else if (iLine == 3) {
-      if (ephType() == t_eph::CNAV ||
-          ephType() == t_eph::CNV2) {
+      if (type() == t_eph::CNAV ||
+          type() == t_eph::CNV2) {
         if (   readDbl(line, pos[0], fieldLen, _top)
             || readDbl(line, pos[1], fieldLen, _Cic)
@@ -384,5 +392,5 @@
           return;
         }
-      } else if (ephType() == t_eph::L1NV) {
+      } else if (type() == t_eph::L1NV) {
         if (   readDbl(line, pos[0], fieldLen, _IODE)
             || readDbl(line, pos[1], fieldLen, _Cic)
@@ -392,5 +400,5 @@
           return;
         }
-      } else { // LNAV, undefined
+      } else { // LNAV
         if (   readDbl(line, pos[0], fieldLen, _TOEsec)
             || readDbl(line, pos[1], fieldLen, _Cic)
@@ -417,7 +425,7 @@
     // BROADCAST ORBIT - 5
     // =====================
-    else if (iLine == 5 && type() != t_eph::IRNSS) {
-      if (ephType() == t_eph::CNAV ||
-          ephType() == t_eph::CNV2) {
+    else if (iLine == 5 && system() != t_eph::IRNSS) {
+      if (type() == t_eph::CNAV ||
+          type() == t_eph::CNV2) {
         if (   readDbl(line, pos[0], fieldLen, _IDOT)
             || readDbl(line, pos[1], fieldLen, _Delta_n_dot)
@@ -428,5 +436,5 @@
         }
       }
-      else { // LNAV, undefined
+      else { // LNAV
         if (   readDbl(line, pos[0], fieldLen, _IDOT)
             || readDbl(line, pos[1], fieldLen, _L2Codes)
@@ -437,7 +445,6 @@
         }
       }
-    } else if (iLine == 5 && type() == t_eph::IRNSS) {
-      if (ephType() == t_eph::LNAV ||
-          ephType() == t_eph::undefined) {
+    } else if (iLine == 5 && system() == t_eph::IRNSS) {
+      if (type() == t_eph::LNAV) {
         if (   readDbl(line, pos[0], fieldLen, _IDOT)
             || readDbl(line, pos[2], fieldLen, _TOEweek)) {
@@ -446,5 +453,5 @@
         }
       }
-      else if (ephType() == t_eph::L1NV) {
+      else if (type() == t_eph::L1NV) {
         if (   readDbl(line, pos[0], fieldLen, _IDOT)
             || readDbl(line, pos[1], fieldLen, _Delta_n_dot)
@@ -458,7 +465,7 @@
     // BROADCAST ORBIT - 6
     // =====================
-    else if (iLine == 6 && type() != t_eph::IRNSS) {
-      if (ephType() == t_eph::CNAV ||
-          ephType() == t_eph::CNV2) {
+    else if (iLine == 6 && system() != t_eph::IRNSS) {
+      if (type() == t_eph::CNAV ||
+          type() == t_eph::CNV2) {
         if (   readDbl(line, pos[0], fieldLen, _URAI_ED)
             || readDbl(line, pos[1], fieldLen, _health)
@@ -468,5 +475,5 @@
           return;
         }
-      } else { // LNAV, undefined
+      } else { // LNAV
         if (   readDbl(line, pos[0], fieldLen, _ura)
             || readDbl(line, pos[1], fieldLen, _health)
@@ -478,7 +485,6 @@
       }
     }
-    else if (iLine == 6 && type() == t_eph::IRNSS) {
-      if (ephType() == t_eph::LNAV ||
-          ephType() == t_eph::undefined) {
+    else if (iLine == 6 && system() == t_eph::IRNSS) {
+      if (type() == t_eph::LNAV) {
         if (   readDbl(line, pos[0], fieldLen, _ura)
             || readDbl(line, pos[1], fieldLen, _health)
@@ -488,5 +494,5 @@
         }
       }
-      else if (ephType() == t_eph::L1NV) {
+      else if (type() == t_eph::L1NV) {
         int i = 0;
         (!_RSF) ? i = 2 : i = 3;
@@ -497,5 +503,5 @@
           return;
         }
-        _ura = accuracyFromIndex(int(_URAI), type());
+        _ura = accuracyFromIndex(int(_URAI), system());
       }
     }
@@ -504,19 +510,20 @@
     // =====================
     else if (iLine == 7) {
-      if (ephType() == t_eph::LNAV ||
-          ephType() == t_eph::undefined) {
+      if (type() == t_eph::LNAV) {
         if (readDbl(line, pos[0], fieldLen, _TOT)) {
           _checkState = bad;
           return;
-          if (type() != t_eph::IRNSS) {
-            double fitIntervalRnx;
-            if (readDbl(line, pos[1], fieldLen, fitIntervalRnx)) {
-              _checkState = bad;
-              return;
-            }
-            if      (type() == t_eph::GPS) { // in RINEX specified always as time period for GPS
+        }
+        if (system() != t_eph::IRNSS) {
+          double fitIntervalRnx;
+          if (readDbl(line, pos[1], fieldLen, fitIntervalRnx)) {
+            //fit interval BLK, do nothing
+            _flags_unknown = true;
+          } else {
+            _flags_unknown = false;
+            if      (system() == t_eph::GPS) { // in RINEX specified always as time period for GPS
               _fitInterval = fitIntervalRnx;
             }
-            else if (type() == t_eph::QZSS) { // specified as flag for QZSS
+            else if (system() == t_eph::QZSS) { // specified as flag for QZSS
               if (rnxVersion == 3.02) {
                 _fitInterval = fitIntervalRnx; // specified as time period
@@ -528,6 +535,6 @@
         }
       }
-      else if (ephType() == t_eph::CNAV ||
-               ephType() == t_eph::CNV2) {
+      else if (type() == t_eph::CNAV ||
+               type() == t_eph::CNV2) {
         if (   readDbl(line, pos[0], fieldLen, _ISC_L1CA)
             || readDbl(line, pos[1], fieldLen, _ISC_L2C)
@@ -538,5 +545,5 @@
         }
       }
-      else if (ephType() == t_eph::L1NV) {
+      else if (type() == t_eph::L1NV) {
         if (!_RSF) {
           if (   readDbl(line, pos[0], fieldLen, _ISC_S)
@@ -558,22 +565,24 @@
     // =====================
     else if (iLine == 8) {
-      if (ephType() == t_eph::CNAV) {
-        double intFlags = -1.0; // optional; blank if not provided
+      if (type() == t_eph::CNAV) {
         if (   readDbl(line, pos[0], fieldLen, _TOT)
-            || readDbl(line, pos[1], fieldLen, _wnop)
-            || readDbl(line, pos[2], fieldLen, intFlags)) {
-          _checkState = bad;
-          return;
-        }
-        if (intFlags > -1.0) {
+            || readDbl(line, pos[1], fieldLen, _wnop)) {
+          _checkState = bad;
+          return;
+        }
+        if (readDbl(line, pos[2], fieldLen, statusflags)) {
+          _flags_unknown = true;
+        }
+        else {
+          _flags_unknown = false;
           // Bit 0:
-          _intSF      = (int(intFlags) & (1 << 0));
+          _intSF      = double(bitExtracted(int(statusflags), 1, 0));
           // Bit 1:
-          _L2Cphasing = (int(intFlags) & (1 << 1));
+          _L2Cphasing = double(bitExtracted(int(statusflags), 1, 1));
           // Bit 2:
-          _alert      = (int(intFlags) & (1 << 2));
-        }
-      }
-      else if (ephType() == t_eph::CNV2) {
+          _alert      = double(bitExtracted(int(statusflags), 1, 2));
+        }
+      }
+      else if (type() == t_eph::CNV2) {
         if (   readDbl(line, pos[0], fieldLen, _ISC_L1Cd)
             || readDbl(line, pos[1], fieldLen, _ISC_L1Cp)) {
@@ -582,5 +591,5 @@
         }
       }
-      else if (ephType() == t_eph::L1NV) {
+      else if (type() == t_eph::L1NV) {
         if (   readDbl(line, pos[0], fieldLen, _TOT)) {
           _checkState = bad;
@@ -593,18 +602,20 @@
     // =====================
     else if (iLine == 9) {
-      if (ephType() == t_eph::CNV2) {
-        double intFlags = -1.0;
+      if (type() == t_eph::CNV2) {
         if (   readDbl(line, pos[0], fieldLen, _TOT)
-            || readDbl(line, pos[1], fieldLen, _wnop)
-            || readDbl(line, pos[2], fieldLen, intFlags)) {
-          _checkState = bad;
-          return;
-        }
-        if (intFlags > -1.0) {
+            || readDbl(line, pos[1], fieldLen, _wnop)) {
+          _checkState = bad;
+          return;
+        }
+        if (readDbl(line, pos[2], fieldLen, statusflags)) {
+          _flags_unknown = true;
+        }
+        else {
+          _flags_unknown = false;
           // Bit 0:
-          _intSF = (int(intFlags) & (1 << 0));
-          if (type() == t_eph::QZSS) {
+          _intSF = double(bitExtracted(int(statusflags), 1, 0));
+          if (system() == t_eph::QZSS) {
             // Bit 1:
-            _ephSF = (int(intFlags) & (1 << 1));
+            _ephSF = double(bitExtracted(int(statusflags), 1, 1));
           }
         }
@@ -707,5 +718,12 @@
 QString t_ephGPS::toString(double version) const {
 
-  QString ephStr = ephTypeStr(_ephType, _prn, version);
+  if (version < 4.0 &&
+      (type() == t_eph::CNAV ||
+       type() == t_eph::CNV2 ||
+       type() == t_eph::L1NV )) {
+    return "";
+  }
+
+  QString ephStr = typeStr(_type, _prn, version);
   QString rnxStr = ephStr + rinexDateStr(_TOC, _prn, version);
 
@@ -723,7 +741,7 @@
   // BROADCAST ORBIT - 1
   // =====================
-  if (ephType() == t_eph::CNAV ||
-      ephType() == t_eph::CNV2 ||
-      ephType() == t_eph::L1NV) {
+  if (type() == t_eph::CNAV ||
+      type() == t_eph::CNV2 ||
+      type() == t_eph::L1NV) {
     out
         << QString(fmt)
@@ -752,6 +770,6 @@
   // BROADCAST ORBIT - 3
   // =====================
-  if (ephType() == t_eph::CNAV ||
-      ephType() == t_eph::CNV2) {
+  if (type() == t_eph::CNAV ||
+      type() == t_eph::CNV2) {
     out
         << QString(fmt)
@@ -761,5 +779,5 @@
         .arg(_Cis,    19, 'e', 12);
   }
-  else if (ephType() == t_eph::L1NV) {
+  else if (type() == t_eph::L1NV) {
     out
         << QString(fmt)
@@ -789,7 +807,7 @@
   // BROADCAST ORBIT - 5
   // =====================
-  if (type() != t_eph::IRNSS) {
-    if (ephType() == t_eph::CNAV ||
-        ephType() == t_eph::CNV2) {
+  if (system() != t_eph::IRNSS) {
+    if (type() == t_eph::CNAV ||
+        type() == t_eph::CNV2) {
       out
           << QString(fmt)
@@ -809,6 +827,6 @@
   }
   else {
-    if (ephType() == t_eph::LNAV ||
-        ephType() == t_eph::undefined) {
+    if (type() == t_eph::LNAV ||
+        type() == t_eph::undefined) {
       out
       << QString(fmt)
@@ -818,5 +836,5 @@
       .arg("",       19, QChar(' '));
     }
-    else if (ephType() == t_eph::L1NV) {
+    else if (type() == t_eph::L1NV) {
       out
       << QString(fmt)
@@ -830,7 +848,7 @@
   // BROADCAST ORBIT - 6
   // =====================
-  if (type() != t_eph::IRNSS) {
-    if (ephType() == t_eph::CNAV ||
-        ephType() == t_eph::CNV2) {
+  if (system() != t_eph::IRNSS) {
+    if (type() == t_eph::CNAV ||
+        type() == t_eph::CNV2) {
       out
           << QString(fmt)
@@ -850,6 +868,6 @@
   }
   else {
-    if (ephType() == t_eph::LNAV ||
-        ephType() == t_eph::undefined) {
+    if (type() == t_eph::LNAV ||
+        type() == t_eph::undefined) {
       out
           << QString(fmt)
@@ -858,5 +876,5 @@
           .arg(_TGD,    19, 'e', 12);
     }
-    else if (ephType() == t_eph::L1NV) {
+    else if (type() == t_eph::L1NV) {
       int i = 0; (!_RSF) ? i = 2 : i = 3;
       if (i == 2) {
@@ -881,16 +899,6 @@
   // BROADCAST ORBIT - 7
   // =====================
-  /*
-      out
-          << QString(fmt)
-          .arg(, 19, 'e', 12)
-          .arg(, 19, 'e', 12)
-          .arg(, 19, 'e', 12)
-          .arg(, 19, 'e', 12);
-
-   */
-
-  if (ephType() == t_eph::LNAV ||
-      ephType() == t_eph::undefined) {
+  if (type() == t_eph::LNAV ||
+      type() == t_eph::undefined) {
 
     double tot = _TOT;
@@ -899,5 +907,5 @@
     }
     // fitInterval
-    if (type() == t_eph::IRNSS) {
+    if (system() == t_eph::IRNSS) {
       out
           << QString(fmt)
@@ -908,20 +916,30 @@
     }
     else {
-      // for GPS and QZSS in version 3.02 specified in hours
-      double fitIntervalRnx = _fitInterval;
-      // otherwise specified as flag
-      if (type() == t_eph::QZSS && version != 3.02) {
-        (_fitInterval == 2.0) ? fitIntervalRnx = 0.0 : fitIntervalRnx = 1.0;
-      }
-      out
-          << QString(fmt)
-          .arg(tot,            19, 'e', 12)
-          .arg(fitIntervalRnx, 19, 'e', 12)
-          .arg("",             19, QChar(' '))
-          .arg("",             19, QChar(' '));
-    }
-  }
-  else if (ephType() == t_eph::CNAV ||
-           ephType() == t_eph::CNV2) {
+      if (_flags_unknown) {
+        out
+            << QString(fmt)
+            .arg(tot,            19, 'e', 12)
+            .arg("",             19, QChar(' '))
+            .arg("",             19, QChar(' '))
+            .arg("",             19, QChar(' '));
+      }
+      else {
+        // for GPS and QZSS in version 3.02 specified in hours
+        double fitIntervalRnx = _fitInterval;
+        // otherwise specified as flag
+        if (system() == t_eph::QZSS && version != 3.02) {
+          (_fitInterval == 2.0) ? fitIntervalRnx = 0.0 : fitIntervalRnx = 1.0;
+        }
+        out
+            << QString(fmt)
+            .arg(tot,            19, 'e', 12)
+            .arg(fitIntervalRnx, 19, 'e', 12)
+            .arg("",             19, QChar(' '))
+            .arg("",             19, QChar(' '));
+      }
+    }
+  }
+  else if (type() == t_eph::CNAV ||
+           type() == t_eph::CNV2) {
     out
         << QString(fmt)
@@ -931,5 +949,5 @@
         .arg(_ISC_L5Q5, 19, 'e', 12);
   }
-  else if (ephType() == t_eph::L1NV) {
+  else if (type() == t_eph::L1NV) {
     if (_RSF) {
       out
@@ -952,16 +970,19 @@
   // BROADCAST ORBIT - 8
   // =====================
-  if (ephType() == t_eph::CNAV) {
-    int intFlags;
-    if (_intSF !=-1 ) {
-      intFlags |= (1 << 0);
-      intFlags |= (1 << 1);
-      intFlags |= (1 << 2);
+  if (type() == t_eph::CNAV) {
+    int intFlags = 0;
+    if (!_flags_unknown) {
+      // Bit 0:
+      if (_intSF)      {intFlags |= (1 << 0);}
+      // Bit 1:
+      if (_L2Cphasing) {intFlags |= (1 << 1);}
+      // Bit 2:
+      if (_alert)      {intFlags |= (1 << 2);}
       out
           << QString(fmt)
-          .arg(_TOT,  19, 'e', 12)
-          .arg(_wnop, 19, 'e', 12)
-          .arg(intFlags, 19, 'e', 12)
-          .arg("",    19, QChar(' '));
+          .arg(_TOT,             19, 'e', 12)
+          .arg(_wnop,            19, 'e', 12)
+          .arg(double(intFlags), 19, 'e', 12)
+          .arg("",               19, QChar(' '));
     }
     else {
@@ -974,5 +995,5 @@
     }
   }
-  else if (ephType() == t_eph::CNV2) {
+  else if (type() == t_eph::CNV2) {
     out
         << QString(fmt)
@@ -982,5 +1003,5 @@
         .arg("", 19, QChar(' '));
   }
-  else if (ephType() == t_eph::L1NV) {
+  else if (type() == t_eph::L1NV) {
     out
         << QString(fmt)
@@ -993,14 +1014,19 @@
   // BROADCAST ORBIT - 9
   // =====================
-  if (ephType() == t_eph::CNV2) {
-    int intFlags;
-    if (_intSF != -1 ) {
-      intFlags |= (1 << 0);
+  if (type() == t_eph::CNV2) {
+    int intFlags = 0;
+    if (!_flags_unknown) {
+      // Bit 0:
+      if (_intSF)   {intFlags |= (1 << 0);}
+      if (system() == t_eph::QZSS) {
+        // Bit 1:
+        if (_ephSF) {intFlags |= (1 << 1);}
+      }
       out
           << QString(fmt)
-          .arg(_TOT,     19, 'e', 12)
-          .arg(_wnop,    19, 'e', 12)
-          .arg(intFlags, 19, 'e', 12)
-          .arg("",       19, QChar(' '));
+          .arg(_TOT,             19, 'e', 12)
+          .arg(_wnop,            19, 'e', 12)
+          .arg(double(intFlags), 19, 'e', 12)
+          .arg("",               19, QChar(' '));
     }
     else {
@@ -1013,5 +1039,4 @@
     }
   }
-
   return rnxStr;
 }
@@ -1022,9 +1047,15 @@
 
   int nLines = 4;
+
+  // Source RINEX version < 4
+  if (type() == t_eph::undefined) {
+    _type = t_eph::FDMA;
+  }
+
   if (rnxVersion >= 3.05) {
     nLines += 1;
   } else {
     _M_delta_tau = 0.9999e9; // unknown
-    _M_FT = 1.5e1;           // unknown
+    _M_FT        = 1.5e1;    // unknown
   }
 
@@ -1039,4 +1070,9 @@
   double statusflags = 0.0;
   double healthflags = 0.0;
+  double sourceflags = 0.0;
+  _tauC = 0.0;
+  _tau1 = 0.0;
+  _tau2 = 0.0;
+  _additional_data_availability = 0.0;
 
   int pos[4];
@@ -1081,5 +1117,5 @@
       _TOC = _TOC + _gps_utc;
       int nd = int((_TOC.gpssec())) / (24.0 * 60.0 * 60.0);
-      if (readDbl(line, pos[1], fieldLen, _tau)
+      if (   readDbl(line, pos[1], fieldLen, _tau)
           || readDbl(line, pos[2], fieldLen, _gamma)
           || readDbl(line, pos[3], fieldLen, _tki)) {
@@ -1094,7 +1130,7 @@
     // =====================
     else if (iLine == 1) {
-      if (readDbl(line, pos[0], fieldLen, _x_pos)
-          || readDbl(line, pos[1], fieldLen, _x_velocity)
-          || readDbl(line, pos[2], fieldLen, _x_acceleration)
+      if (   readDbl(line, pos[0], fieldLen, _x_pos)
+          || readDbl(line, pos[1], fieldLen, _x_vel)
+          || readDbl(line, pos[2], fieldLen, _x_acc)
           || readDbl(line, pos[3], fieldLen, _health)) {
         _checkState = bad;
@@ -1106,10 +1142,23 @@
     // =====================
     else if (iLine == 2) {
-      if (readDbl(line, pos[0], fieldLen, _y_pos)
-          || readDbl(line, pos[1], fieldLen, _y_velocity)
-          || readDbl(line, pos[2], fieldLen, _y_acceleration)
-          || readDbl(line, pos[3], fieldLen, _frequency_number)) {
-        _checkState = bad;
-        return;
+      if (type() == t_eph::FDMA ||
+          type() == t_eph::undefined) {
+        if (   readDbl(line, pos[0], fieldLen, _y_pos)
+            || readDbl(line, pos[1], fieldLen, _y_vel)
+            || readDbl(line, pos[2], fieldLen, _y_acc)
+            || readDbl(line, pos[3], fieldLen, _frq_num)) {
+          _checkState = bad;
+          return;
+        }
+      }
+      else { //L1OC, L3OC
+        if (   readDbl(line, pos[0], fieldLen, _y_pos)
+            || readDbl(line, pos[1], fieldLen, _y_vel)
+            || readDbl(line, pos[2], fieldLen, _y_acc)
+            || readDbl(line, pos[3], fieldLen, statusflags)) {
+          _checkState = bad;
+          return;
+        }
+         _data_validity = int(statusflags);
       }
     }
@@ -1118,10 +1167,31 @@
     // =====================
     else if (iLine == 3) {
-      if (readDbl(line, pos[0], fieldLen, _z_pos)
-          || readDbl(line, pos[1], fieldLen, _z_velocity)
-          || readDbl(line, pos[2], fieldLen, _z_acceleration)
-          || readDbl(line, pos[3], fieldLen, _E)) {
-        _checkState = bad;
-        return;
+      if (type() == t_eph::FDMA ||
+          type() == t_eph::undefined) {
+        if (   readDbl(line, pos[0], fieldLen, _z_pos)
+            || readDbl(line, pos[1], fieldLen, _z_vel)
+            || readDbl(line, pos[2], fieldLen, _z_acc)
+            || readDbl(line, pos[3], fieldLen, _E)) {
+          _checkState = bad;
+          return;
+        }
+      }
+      else if (type() == t_eph::L1OC) {
+        if (   readDbl(line, pos[0], fieldLen, _z_pos)
+            || readDbl(line, pos[1], fieldLen, _z_vel)
+            || readDbl(line, pos[2], fieldLen, _z_acc)
+            || readDbl(line, pos[3], fieldLen, _TGD_L2OCp)) {
+          _checkState = bad;
+          return;
+        }
+      }
+      else if (type() == t_eph::L3OC) {
+        if (   readDbl(line, pos[0], fieldLen, _z_pos)
+            || readDbl(line, pos[1], fieldLen, _z_vel)
+            || readDbl(line, pos[2], fieldLen, _z_acc)
+            || readDbl(line, pos[3], fieldLen, _TGD_L3OCp)) {
+          _checkState = bad;
+          return;
+        }
       }
     }
@@ -1130,48 +1200,135 @@
     // =====================
     else if (iLine == 4) {
-      if (readDbl(line, pos[0], fieldLen, statusflags)) {
-        //statusflags BLK, do nothing
-        _flags_unknown = true;
-      } else {
-        _flags_unknown = false;
-        // status flags
+      if (type() == t_eph::FDMA ||
+          type() == t_eph::undefined){
+        if (readDbl(line, pos[0], fieldLen, statusflags)) {
+          //status flags BLK, do nothing
+          _statusflags_unknown = true;
+        } else {
+          _statusflags_unknown = false;
+          // status flags
+          // ============
+          // bit 0-1
+          _M_P =  double(bitExtracted(int(statusflags), 2, 0));
+          // bit 2-3
+          _P1 =   double(bitExtracted(int(statusflags), 2, 2));
+          // bit 4
+          _P2 =   double(bitExtracted(int(statusflags), 1, 4));
+          // bit 5
+          _P3 =   double(bitExtracted(int(statusflags), 1, 5));
+          // bit 6
+          _M_P4 = double(bitExtracted(int(statusflags), 1, 6));
+          // bit 7-8
+          _M_M =  double(bitExtracted(int(statusflags), 2, 7));
+          /// GLO M/K exclusive flags/values only valid if flag M is set to '01'
+          if (!_M_M) {
+            _M_P  = 0.0;
+            _M_l3 = 0.0;
+            _M_P4 = 0.0;
+            _M_FE = 0.0;
+            _M_FT = 0.0;
+            _M_NA = 0.0;
+            _M_NT = 0.0;
+            _M_N4 = 0.0;
+            _M_l5 = 0.0;
+            _M_tau_GPS   = 0.0;
+            _M_delta_tau = 0.0;
+          }
+        }
+        if (   readDbl(line, pos[1], fieldLen, _M_delta_tau)
+            || readDbl(line, pos[2], fieldLen, _M_FT)) {
+          _checkState = bad;
+          return;
+        }
+        if (readDbl(line, pos[3], fieldLen, healthflags)) {
+          // health flags BLK
+          _healthflags_unknown = true;
+        } else {
+          _healthflags_unknown = false;
+          // health flags
+          // ============
+          // bit 0 (is to be ignored, if bit 1 is zero)
+          _almanac_health = double(bitExtracted(int(healthflags), 1, 0));
+          // bit 1
+          _almanac_health_availablility_indicator =
+                            double(bitExtracted(int(healthflags), 1, 1));
+          //  bit 2; GLO-M/K only, health bit of string 3
+          _M_l3 =           double(bitExtracted(int(healthflags), 1, 2));
+        }
+      }
+      else if (type() == t_eph::L1OC ||
+               type() == t_eph::L3OC) {
+        if (   readDbl(line, pos[0], fieldLen, _sat_type)
+            || readDbl(line, pos[1], fieldLen, sourceflags)
+            || readDbl(line, pos[2], fieldLen, _EE)
+            || readDbl(line, pos[3], fieldLen, _ET)) {
+          _checkState = bad;
+          return;
+        }
+        // sourceflags:
         // ============
         // bit 0-1
-        _M_P = double(bitExtracted(statusflags, 2, 0));
-        // bit 2-3
-        _P1 = double(bitExtracted(statusflags, 2, 2));
-        // bit 4
-        _P2 = double(bitExtracted(statusflags, 1, 4));
-        // bit 5
-        _P3 = double(bitExtracted(statusflags, 1, 5));
-        // bit 6
-        _M_P4 = double(bitExtracted(statusflags, 1, 6));
-        // bit 7-8
-        _M_M = double(bitExtracted(statusflags, 2, 7));
-        /// GLO M/K exclusive flags/values only valid if flag M is set to '01'
-        if (!_M_M) {
-          _M_P4 = 0.0;
-          _M_P = 0.0;
-        }
-      }
-      if (readDbl(line, pos[1], fieldLen, _M_delta_tau)
-          || readDbl(line, pos[2], fieldLen, _M_FT)) {
-        _checkState = bad;
-        return;
-      }
-      if (readDbl(line, pos[3], fieldLen, healthflags)) {
-        // healthflags BLK
-        _flags_unknown = true;
-      } else {
-        _flags_unknown = false;
-        // health flags
-        // ============
-        // bit 0 (is to be ignored, if bit 1 is zero)
-        _almanac_health = double(bitExtracted(healthflags, 1, 0));
-        // bit 1
-        _almanac_health_availablility_indicator = double(
-            bitExtracted(healthflags, 1, 1));
-        //  bit 2
-        _M_l3 = double(bitExtracted(healthflags, 1, 2));
+        _RT = double(bitExtracted(int(sourceflags), 2, 0));
+        // bit 2-3:
+        _RE = double(bitExtracted(int(sourceflags), 2, 2));
+      }
+    }
+    // =====================
+    // BROADCAST ORBIT - 5
+    // =====================
+    else if (iLine == 5) {
+      if (type() == t_eph::L1OC ||
+          type() == t_eph::L3OC) {
+        if (   readDbl(line, pos[0], fieldLen, _attitude_P2)
+            || readDbl(line, pos[1], fieldLen, _Tin)
+            || readDbl(line, pos[2], fieldLen, _tau1)
+            || readDbl(line, pos[3], fieldLen, _tau2)) {
+          _checkState = bad;
+          return;
+        }
+      }
+    }
+    // =====================
+    // BROADCAST ORBIT - 6
+    // =====================
+    else if (iLine == 6) {
+      if (type() == t_eph::L1OC ||
+          type() == t_eph::L3OC) {
+        if (   readDbl(line, pos[0], fieldLen, _yaw)
+            || readDbl(line, pos[1], fieldLen, _sn)
+            || readDbl(line, pos[2], fieldLen, _angular_rate)
+            || readDbl(line, pos[3], fieldLen, _angular_acc)) {
+          _checkState = bad;
+          return;
+        }
+      }
+    }
+    // =====================
+    // BROADCAST ORBIT - 7
+    // =====================
+    else if (iLine == 7) {
+      if (type() == t_eph::L1OC ||
+          type() == t_eph::L3OC) {
+        if (   readDbl(line, pos[0], fieldLen, _angular_rate_max)
+            || readDbl(line, pos[1], fieldLen, _X_PC)
+            || readDbl(line, pos[2], fieldLen, _Y_PC)
+            || readDbl(line, pos[3], fieldLen, _Z_PC)) {
+          _checkState = bad;
+          return;
+        }
+      }
+    }
+    // =====================
+    // BROADCAST ORBIT - 8
+    // =====================
+    else if (iLine == 8) {
+      if (type() == t_eph::L1OC ||
+          type() == t_eph::L3OC) {
+        if (   readDbl(line, pos[0], fieldLen, _M_FE)
+            || readDbl(line, pos[1], fieldLen, _M_FT)
+            || readDbl(line, pos[3], fieldLen, _TOT)) {
+          _checkState = bad;
+          return;
+        }
       }
     }
@@ -1186,7 +1343,7 @@
   _xv(2) = _y_pos * 1.e3;
   _xv(3) = _z_pos * 1.e3;
-  _xv(4) = _x_velocity * 1.e3;
-  _xv(5) = _y_velocity * 1.e3;
-  _xv(6) = _z_velocity * 1.e3;
+  _xv(4) = _x_vel * 1.e3;
+  _xv(5) = _y_vel * 1.e3;
+  _xv(6) = _z_vel * 1.e3;
 }
 
@@ -1211,7 +1368,7 @@
 
   double acc[3];
-  acc[0] = _x_acceleration * 1.e3;
-  acc[1] = _y_acceleration * 1.e3;
-  acc[2] = _z_acceleration * 1.e3;
+  acc[0] = _x_acc * 1.e3;
+  acc[1] = _y_acc * 1.e3;
+  acc[2] = _z_acc * 1.e3;
 
   for (int ii = 1; ii <= nSteps; ii++) {
@@ -1245,5 +1402,11 @@
 QString t_ephGlo::toString(double version) const {
 
-  QString ephStr = ephTypeStr(_ephType, _prn, version);
+  if (version < 4.0 &&
+      (type() == t_eph::L1OC ||
+       type() == t_eph::L3OC )) {
+    return "";
+  }
+
+  QString ephStr = typeStr(_type, _prn, version);
   QString rnxStr = ephStr + rinexDateStr(_TOC - _gps_utc, _prn, version);
   int nd = int((_TOC - _gps_utc).gpssec()) / (24.0 * 60.0 * 60.0);
@@ -1251,6 +1414,8 @@
 
   out
-      << QString("%1%2%3\n").arg(-_tau, 19, 'e', 12).arg(_gamma, 19, 'e', 12).arg(
-          _tki + nd * 86400.0, 19, 'e', 12);
+      << QString("%1%2%3\n")
+      .arg(-_tau,               19, 'e', 12)
+      .arg(_gamma,              19, 'e', 12)
+      .arg(_tki + nd * 86400.0, 19, 'e', 12);
 
   QString fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
@@ -1259,86 +1424,190 @@
   // =====================
   out
-      << QString(fmt).arg(_x_pos, 19, 'e', 12).arg(_x_velocity, 19, 'e', 12).arg(
-          _x_acceleration, 19, 'e', 12).arg(_health, 19, 'e', 12);
+      << QString(fmt)
+      .arg(_x_pos,  19, 'e', 12)
+      .arg(_x_vel,  19, 'e', 12)
+      .arg(_x_acc,  19, 'e', 12)
+      .arg(_health, 19, 'e', 12);
+
   // =====================
   // BROADCAST ORBIT - 2
   // =====================
-  out
-      << QString(fmt).arg(_y_pos, 19, 'e', 12).arg(_y_velocity, 19, 'e', 12).arg(
-          _y_acceleration, 19, 'e', 12).arg(_frequency_number, 19, 'e', 12);
+  if (type() == t_eph::FDMA) {
+    out
+        << QString(fmt)
+        .arg(_y_pos,   19, 'e', 12)
+        .arg(_y_vel,   19, 'e', 12)
+        .arg(_y_acc,   19, 'e', 12)
+        .arg(_frq_num, 19, 'e', 12);
+  }
+  else { //L1OC, L3OC
+    out
+        << QString(fmt)
+        .arg(_y_pos,                 19, 'e', 12)
+        .arg(_y_vel,                 19, 'e', 12)
+        .arg(_y_acc,                 19, 'e', 12)
+        .arg(double(_data_validity), 19, 'e', 12);
+  }
   // =====================
   // BROADCAST ORBIT - 3
   // =====================
-  out
-      << QString(fmt).arg(_z_pos, 19, 'e', 12).arg(_z_velocity, 19, 'e', 12).arg(
-          _z_acceleration, 19, 'e', 12).arg(_E, 19, 'e', 12);
-  // =====================
-  // BROADCAST ORBIT - 4
-  // =====================
+  if (type() == t_eph::FDMA) {
+    out
+        << QString(fmt)
+        .arg(_z_pos,  19, 'e', 12)
+        .arg(_z_vel,  19, 'e', 12)
+        .arg(_z_acc,  19, 'e', 12)
+        .arg(_E,      19, 'e', 12);
+  }
+  else if (type() == t_eph::L1OC) {
+    out
+        << QString(fmt)
+        .arg(_z_pos,     19, 'e', 12)
+        .arg(_z_vel,     19, 'e', 12)
+        .arg(_z_acc,     19, 'e', 12)
+        .arg(_TGD_L2OCp, 19, 'e', 12);
+  }
+  else if (type() == t_eph::L3OC) {
+    out
+        << QString(fmt)
+        .arg(_z_pos,     19, 'e', 12)
+        .arg(_z_vel,     19, 'e', 12)
+        .arg(_z_acc,     19, 'e', 12)
+        .arg(_TGD_L3OCp, 19, 'e', 12);
+  }
   if (version >= 3.05) {
-    // unknown (RINEX version < 3.05)
-    if (_flags_unknown) {
+    // =====================
+    // BROADCAST ORBIT - 4
+    // =====================
+    if (type() == t_eph::FDMA){
+      int statusflags = 0;
+      int healthflags = 0;
+      if (!_statusflags_unknown ) {
+        // bit 0-1
+        if      (_M_P == 1.0) {statusflags |= (1 << 0);}
+        else if (_M_P == 2.0) {statusflags |= (1 << 1);}
+        else if (_M_P == 3.0) {statusflags |= (1 << 0); statusflags |= (1 << 1);}
+        // bit 2-3
+        if      (_P1 == 1.0)  {statusflags |= (1 << 2);}
+        else if (_P1 == 2.0)  {statusflags |= (1 << 3);}
+        else if (_P1 == 3.0)  {statusflags |= (1 << 2); statusflags |= (1 << 3);}
+        // bit 4
+        if (_P2)              {statusflags |= (1 << 4);}
+        // bit 5
+        if (_P3)              {statusflags |= (1 << 5);}
+        // bit 6
+        if (_M_P4)            {statusflags |= (1 << 6);}
+        // bit 7-8
+        if (_M_M == 1.0)      {statusflags |= (1 << 7);}
+      }
+      if (!_healthflags_unknown) {
+        // bit 0 (is to be ignored, if bit 1 is zero)
+        if (_almanac_health) {healthflags |= (1 << 0);}
+        // bit 1
+        if (_almanac_health_availablility_indicator) {healthflags |= (1 << 1);}
+        //  bit 2
+        if (_M_l3) {healthflags |= (1 << 2);}
+      }
+
+      if (_statusflags_unknown && _healthflags_unknown) {
+        out
+            << QString(fmt)
+            .arg("",           19, QChar(' ')) // status-flags BNK (unknown)
+            .arg(_M_delta_tau, 19, 'e', 12)
+            .arg(_M_FT,        19, 'e', 12)
+            .arg("",           19, QChar(' '));// health-flags BNK (unknown)
+      }
+      else if (!_statusflags_unknown && _healthflags_unknown) {
+        out
+            << QString(fmt)
+            .arg(double(statusflags),  19, 'e', 12)
+            .arg(_M_delta_tau,         19, 'e', 12)
+            .arg(_M_FT,                19, 'e', 12)
+            .arg("",                   19, QChar(' '));// health-flags BNK (unknown)
+      }
+      else if (_statusflags_unknown && !_healthflags_unknown) {
+        out
+            << QString(fmt)
+            .arg("",                  19, QChar(' ')) // status-flags BNK (unknown)
+            .arg(_M_delta_tau,        19, 'e', 12)
+            .arg(_M_FT,               19, 'e', 12)
+            .arg(double(healthflags), 19, 'e', 12);
+      }
+      else if (!_statusflags_unknown && !_healthflags_unknown) {
+        out
+            << QString(fmt)
+            .arg(double(statusflags),  19, 'e', 12)
+            .arg(_M_delta_tau,         19, 'e', 12)
+            .arg(_M_FT,                19, 'e', 12)
+            .arg(double(healthflags),  19, 'e', 12);
+      }
+    }
+    else if (type() == t_eph::L1OC ||
+             type() == t_eph::L3OC) {
+      int sourceflags = 0;
+      // bit 0-1
+      if      (_RT == 1.0) {sourceflags |= (1 << 0);}
+      else if (_RT == 2.0) {sourceflags |= (1 << 1);}
+      else if (_RT == 3.0) {sourceflags |= (1 << 0); sourceflags |= (1 << 1);}
+      // bit 2-3
+      if      (_RE == 1.0)  {sourceflags |= (1 << 2);}
+      else if (_RE == 2.0)  {sourceflags |= (1 << 3);}
+      else if (_RE == 3.0)  {sourceflags |= (1 << 2); sourceflags |= (1 << 3);}
       out
-          << QString(fmt).arg("", 19, QChar(' ')) // statusflags blank if unknown
-          .arg(_M_delta_tau, 19, 'e', 12).arg(_M_FT, 19, 'e', 12).arg("", 19,
-              QChar(' ')); // healthflags blank if unknown
-    } else {
-      int statusflags = 0;
-      // bit 7-8
-      if (_M_M == 2.0) {
-        statusflags |= (1 << 7);
-      }
-      // bit 6
-      if (_M_P4) {
-        statusflags |= (1 << 6);
-      }
-      // bit 5
-      if (_P3) {
-        statusflags |= (1 << 5);
-      }
-      // bit 4
-      if (_P2) {
-        statusflags |= (1 << 4);
-      }
-      // bit 2-3
-      if (_P1 == 2.0) {
-        statusflags |= (1 << 2);
-      } else if (_P1 == 1.0) {
-        statusflags |= (1 << 3);
-      } else if (_P1 == 3.0) {
-        statusflags |= (1 << 2);
-        statusflags |= (1 << 3);
-      }
-      // bit 0-1
-      if (_M_P == 2.0) {
-        statusflags |= (1 << 0);
-      } else if (_M_P == 1.0) {
-        statusflags |= (1 << 1);
-      } else if (_M_P == 3.0) {
-        statusflags |= (1 << 0);
-        statusflags |= (1 << 1);
-      }
-      // health flags
-      // ============
-      int healthflags = 0;
-      // bit 0 (is to be ignored, if bit 1 is zero)
-      if (_almanac_health) {
-        healthflags |= (1 << 0);
-      }
-      // bit 1
-      if (_almanac_health_availablility_indicator) {
-        healthflags |= (1 << 1);
-      }
-      //  bit 2
-      if (_M_l3) {
-        healthflags |= (1 << 2);
-      }
+          << QString(fmt)
+          .arg(_sat_type  ,         19, 'e', 12)
+          .arg(double(sourceflags), 19, 'e', 12)
+          .arg(_ET,                 19, 'e', 12)
+          .arg(_EE,                 19, 'e', 12);
+    }
+    // =====================
+    // BROADCAST ORBIT - 5
+    // =====================
+    if (type() == t_eph::L1OC ||
+        type() == t_eph::L3OC) {
       out
-          << QString(fmt).arg(double(statusflags), 19, 'e', 12).arg(
-              _M_delta_tau, 19, 'e', 12).arg(_M_FT, 19, 'e', 12).arg(
-              double(healthflags), 19, 'e', 12);
-    }
-  }
-
+          << QString(fmt)
+          .arg(_attitude_P2, 19, 'e', 12)
+          .arg(_Tin,         19, 'e', 12)
+          .arg(_tau1,        19, 'e', 12)
+          .arg(_tau2,        19, 'e', 12);
+    }
+    // =====================
+    // BROADCAST ORBIT - 6
+    // =====================
+    if (type() == t_eph::L1OC ||
+        type() == t_eph::L3OC) {
+      out
+          << QString(fmt)
+          .arg(_yaw,          19, 'e', 12)
+          .arg(_sn,           19, 'e', 12)
+          .arg(_angular_rate, 19, 'e', 12)
+          .arg(_angular_acc,  19, 'e', 12);
+    }
+    // =====================
+    // BROADCAST ORBIT - 7
+    // =====================
+    if (type() == t_eph::L1OC ||
+        type() == t_eph::L3OC) {
+      out
+          << QString(fmt)
+          .arg(_angular_rate_max, 19, 'e', 12)
+          .arg(_X_PC,             19, 'e', 12)
+          .arg(_Y_PC,             19, 'e', 12)
+          .arg(_Z_PC,             19, 'e', 12);
+    }
+    // =====================
+    // BROADCAST ORBIT - 8
+    // =====================
+    if (type() == t_eph::L1OC ||
+        type() == t_eph::L3OC) {
+      out
+          << QString(fmt)
+          .arg(_M_FE, 19, 'e', 12)
+          .arg(_M_FT, 19, 'e', 12)
+          .arg("",    19, QChar(' '))
+          .arg(_TOT,  19, 'e', 12);
+    }
+  }
   return rnxStr;
 }
@@ -1455,5 +1724,5 @@
       _TOC.set(year, month, day, hour, min, sec);
 
-      if (readDbl(line, pos[1], fieldLen, _clock_bias)
+      if (   readDbl(line, pos[1], fieldLen, _clock_bias)
           || readDbl(line, pos[2], fieldLen, _clock_drift)
           || readDbl(line, pos[3], fieldLen, _clock_driftrate)) {
@@ -1466,5 +1735,5 @@
     // =====================
     else if (iLine == 1) {
-      if (readDbl(line, pos[0], fieldLen, _IODnav)
+      if (   readDbl(line, pos[0], fieldLen, _IODnav)
           || readDbl(line, pos[1], fieldLen, _Crs)
           || readDbl(line, pos[2], fieldLen, _Delta_n)
@@ -1478,5 +1747,5 @@
     // =====================
     else if (iLine == 2) {
-      if (readDbl(line, pos[0], fieldLen, _Cuc)
+      if (   readDbl(line, pos[0], fieldLen, _Cuc)
           || readDbl(line, pos[1], fieldLen, _e)
           || readDbl(line, pos[2], fieldLen, _Cus)
@@ -1490,5 +1759,5 @@
     // =====================
     else if (iLine == 3) {
-      if (readDbl(line, pos[0], fieldLen, _TOEsec)
+      if (   readDbl(line, pos[0], fieldLen, _TOEsec)
           || readDbl(line, pos[1], fieldLen, _Cic)
           || readDbl(line, pos[2], fieldLen, _OMEGA0)
@@ -1502,5 +1771,5 @@
     // =====================
     else if (iLine == 4) {
-      if (readDbl(line, pos[0], fieldLen, _i0)
+      if (   readDbl(line, pos[0], fieldLen, _i0)
           || readDbl(line, pos[1], fieldLen, _Crc)
           || readDbl(line, pos[2], fieldLen, _omega)
@@ -1514,17 +1783,37 @@
     // =====================
     else if (iLine == 5) {
-      if (readDbl(line, pos[0], fieldLen, _IDOT)
+      if (   readDbl(line, pos[0], fieldLen, _IDOT)
           || readDbl(line, pos[1], fieldLen, datasource)
           || readDbl(line, pos[2], fieldLen, _TOEweek)) {
         _checkState = bad;
         return;
-      } else {
-        if (int(datasource) & (1 << 8)) {
+      }
+      else {
+        if (bitExtracted(int(datasource), 1, 8)) {
           _fnav = true;
           _inav = false;
-        } else if (int(datasource) & (1 << 9)) {
+          /* set unused I/NAV values */
+          _E5b_HS = 0.0;
+          _E1B_HS = 0.0;
+          _E1B_DataInvalid = false;
+          _E5b_DataInvalid = false;
+          // Source RINEX version < 4
+          if (type() == t_eph::undefined) {
+            _type = t_eph::FNAV;
+          }
+        }
+        if (bitExtracted(int(datasource), 1, 9)) {
           _fnav = false;
           _inav = true;
-        }
+          /* set unused F/NAV values */
+          _E5a_HS = 0.0;
+          _E5a_DataInvalid = false;
+          // Source RINEX version < 4
+          if (type() == t_eph::undefined) {
+            _type = t_eph::INAV;
+          }
+        }
+        // GAL week # in RINEX is aligned/identical to continuous GPS week # used in RINEX
+        // but GST week # started at the first GPS roll-over (continuous GPS week 1024)
         _TOEweek -= 1024.0;
       }
@@ -1534,5 +1823,5 @@
     // =====================
     else if (iLine == 6) {
-      if (readDbl(line, pos[0], fieldLen, _SISA)
+      if (   readDbl(line, pos[0], fieldLen, _SISA)
           || readDbl(line, pos[1], fieldLen, SVhealth)
           || readDbl(line, pos[2], fieldLen, _BGD_1_5A)
@@ -1542,16 +1831,18 @@
       } else {
         // Bit 0
-        _e1DataInvalid = (int(SVhealth) & (1 << 0));
+        _E1B_DataInvalid = bitExtracted(int(SVhealth), 1, 0);
         // Bit 1-2
-        _E1_bHS = double((int(SVhealth) >> 1) & 0x3);
+        _E1B_HS =   double(bitExtracted(int(SVhealth), 2, 1));
         // Bit 3
-        _e5aDataInvalid = (int(SVhealth) & (1 << 3));
+        _E5a_DataInvalid = bitExtracted(int(SVhealth), 1, 3);
         // Bit 4-5
-        _E5aHS = double((int(SVhealth) >> 4) & 0x3);
+        _E5a_HS =   double(bitExtracted(int(SVhealth), 2, 4));
         // Bit 6
-        _e5bDataInvalid = (int(SVhealth) & (1 << 6));
+        _E5b_DataInvalid = bitExtracted(int(SVhealth), 1, 6);
         // Bit 7-8
-        _E5bHS = double((int(SVhealth) >> 7) & 0x3);
-
+        _E5b_HS =   double(bitExtracted(int(SVhealth), 2, 7));
+        if (_fnav) {
+          _BGD_1_5B = 0.0;
+        }
         if (prnStr.at(0) == 'E') {
           _prn.set('E', prnStr.mid(1).toInt(), _inav ? 1 : 0);
@@ -1663,12 +1954,16 @@
 ////////////////////////////////////////////////////////////////////////////
 unsigned int t_ephGal::isUnhealthy() const {
-  if (_E5aHS == 1 || _E5aHS == 3 || _E5bHS == 1 || _E5bHS == 3 || _E1_bHS == 1
-      || _E1_bHS == 3) {
+  // SHS; 1 = Out of Service, 3 = In Test, 0 = Signal Ok, 2 = Extended Operations Mode
+  if (_E5a_HS == 1 || _E5a_HS == 3 ||
+      _E5b_HS == 1 || _E5b_HS == 3 ||
+      _E1B_HS == 1 || _E1B_HS == 3) {
     return 1;
   }
-  if (_e5aDataInvalid || _e5bDataInvalid || _e1DataInvalid) {
+  if (_E5a_DataInvalid ||
+      _E5b_DataInvalid ||
+      _E1B_DataInvalid) {
     return 1;
   }
-  if (_SISA == 255.0) {
+  if (_SISA == 255.0) { // NAPA: No Accuracy Prediction Available
     return 1;
   }
@@ -1677,10 +1972,11 @@
    * It also means that the satellite signal may be used for PNT.
    if (_E5aHS  == 2 ||
-   _E5bHS  == 2 ||
-   _E1_bHS == 2 ) {
-   return 1;
+       _E5bHS  == 2 ||
+       _E1_bHS == 2 ) {
+     return 1;
    }
    */
   return 0;
+
 }
 
@@ -1689,5 +1985,5 @@
 QString t_ephGal::toString(double version) const {
 
-  QString ephStr = ephTypeStr(_ephType, _prn, version);
+  QString ephStr = typeStr(_type, _prn, version);
   QString rnxStr = ephStr + rinexDateStr(_TOC, _prn, version);
 
@@ -1703,26 +1999,38 @@
   // =====================
   out
-      << QString(fmt).arg(_IODnav, 19, 'e', 12).arg(_Crs, 19, 'e', 12).arg(
-          _Delta_n, 19, 'e', 12).arg(_M0, 19, 'e', 12);
+      << QString(fmt)
+      .arg(_IODnav,  19, 'e', 12)
+      .arg(_Crs,     19, 'e', 12)
+      .arg(_Delta_n, 19, 'e', 12)
+      .arg(_M0, 19, 'e', 12);
   // =====================
   // BROADCAST ORBIT - 2
   // =====================
   out
-      << QString(fmt).arg(_Cuc, 19, 'e', 12).arg(_e, 19, 'e', 12).arg(_Cus, 19,
-          'e', 12).arg(_sqrt_A, 19, 'e', 12);
+      << QString(fmt)
+      .arg(_Cuc,    19, 'e', 12).
+      arg(_e,       19, 'e', 12)
+      .arg(_Cus,    19, 'e', 12)
+      .arg(_sqrt_A, 19, 'e', 12);
   // =====================
   // BROADCAST ORBIT - 3
   // =====================
   out
-      << QString(fmt).arg(_TOEsec, 19, 'e', 12).arg(_Cic, 19, 'e', 12).arg(
-          _OMEGA0, 19, 'e', 12).arg(_Cis, 19, 'e', 12);
+      << QString(fmt).
+      arg(_TOEsec,  19, 'e', 12)
+      .arg(_Cic,    19, 'e', 12)
+      .arg(_OMEGA0, 19, 'e', 12)
+      .arg(_Cis,    19, 'e', 12);
   // =====================
   // BROADCAST ORBIT - 4
   // =====================
   out
-      << QString(fmt).arg(_i0, 19, 'e', 12).arg(_Crc, 19, 'e', 12).arg(_omega,
-          19, 'e', 12).arg(_OMEGADOT, 19, 'e', 12);
-  // =====================
-  // BROADCAST ORBIT - 5
+      << QString(fmt)
+      .arg(_i0,       19, 'e', 12)
+      .arg(_Crc,      19, 'e', 12)
+      .arg(_omega,    19, 'e', 12)
+      .arg(_OMEGADOT, 19, 'e', 12);
+  // =====================
+  // BROADCAST ORBIT - 5/6
   // =====================
   int dataSource = 0;
@@ -1736,13 +2044,15 @@
     // SVhealth
     //   Bit 3  : E5a DVS
-    if (_e5aDataInvalid) {
+    if (_E5a_DataInvalid) {
       SVhealth |= (1 << 3);
     }
     //   Bit 4-5: E5a HS
-    if (_E5aHS == 1.0) {
+    if      (_E5a_HS == 1.0) {
       SVhealth |= (1 << 4);
-    } else if (_E5aHS == 2.0) {
+    }
+    else if (_E5a_HS == 2.0) {
       SVhealth |= (1 << 5);
-    } else if (_E5aHS == 3.0) {
+    }
+    else if (_E5a_HS == 3.0) {
       SVhealth |= (1 << 4);
       SVhealth |= (1 << 5);
@@ -1756,53 +2066,52 @@
     // SVhealth
     //   Bit 0  : E1-B DVS
-    if (_e1DataInvalid) {
+    if (_E1B_DataInvalid) {
       SVhealth |= (1 << 0);
     }
     //   Bit 1-2: E1-B HS
-    if (_E1_bHS == 1.0) {
+    if      (_E1B_HS == 1.0) {
       SVhealth |= (1 << 1);
-    } else if (_E1_bHS == 2.0) {
+    }
+    else if (_E1B_HS == 2.0) {
       SVhealth |= (1 << 2);
-    } else if (_E1_bHS == 3.0) {
+    }
+    else if (_E1B_HS == 3.0) {
       SVhealth |= (1 << 1);
       SVhealth |= (1 << 2);
     }
-    //   Bit 3  : E5a DVS
-    if (_e5aDataInvalid) {
-      SVhealth |= (1 << 3);
-    }
-    //   Bit 4-5: E5a HS
-    if (_E5aHS == 1.0) {
-      SVhealth |= (1 << 4);
-    } else if (_E5aHS == 2.0) {
-      SVhealth |= (1 << 5);
-    } else if (_E5aHS == 3.0) {
-      SVhealth |= (1 << 4);
-      SVhealth |= (1 << 5);
-    }
     //   Bit 6  : E5b DVS
-    if (_e5bDataInvalid) {
+    if (_E5b_DataInvalid) {
       SVhealth |= (1 << 6);
     }
     //   Bit 7-8: E5b HS
-    if (_E5bHS == 1.0) {
+    if (_E5b_HS == 1.0) {
       SVhealth |= (1 << 7);
-    } else if (_E5bHS == 2.0) {
+    }
+    else if (_E5b_HS == 2.0) {
       SVhealth |= (1 << 8);
-    } else if (_E5bHS == 3.0) {
+    }
+    else if (_E5b_HS == 3.0) {
       SVhealth |= (1 << 7);
       SVhealth |= (1 << 8);
     }
   }
-
+  // =====================
+  // BROADCAST ORBIT - 5
+  // =====================
   out
-      << QString(fmt).arg(_IDOT, 19, 'e', 12).arg(double(dataSource), 19, 'e',
-          12).arg(_TOEweek + 1024.0, 19, 'e', 12).arg(0.0, 19, 'e', 12);
+      << QString(fmt)
+      .arg(_IDOT,              19, 'e', 12)
+      .arg(double(dataSource), 19, 'e', 12)
+      .arg(_TOEweek + 1024.0,  19, 'e', 12)
+      .arg(0.0, 19, 'e', 12);
   // =====================
   // BROADCAST ORBIT - 6
   // =====================
   out
-      << QString(fmt).arg(_SISA, 19, 'e', 12).arg(double(SVhealth), 19, 'e', 12).arg(
-          BGD_1_5A, 19, 'e', 12).arg(BGD_1_5B, 19, 'e', 12);
+      << QString(fmt)
+      .arg(_SISA,            19, 'e', 12)
+      .arg(double(SVhealth), 19, 'e', 12)
+      .arg(BGD_1_5A,         19, 'e', 12)
+      .arg(BGD_1_5B,         19, 'e', 12);
   // =====================
   // BROADCAST ORBIT - 7
@@ -1813,6 +2122,9 @@
   }
   out
-      << QString(fmt).arg(tot, 19, 'e', 12).arg("", 19, QChar(' ')).arg("", 19,
-          QChar(' ')).arg("", 19, QChar(' '));
+      << QString(fmt)
+      .arg(tot, 19, 'e', 12)
+      .arg("",  19, QChar(' '))
+      .arg("",  19, QChar(' '))
+      .arg("",  19, QChar(' '));
 
   return rnxStr;
@@ -1824,4 +2136,9 @@
 
   const int nLines = 4;
+
+  // Source RINEX version < 4
+  if (type() == t_eph::undefined) {
+    _type = t_eph::SBASL1;
+  }
 
   if (lines.size() != nLines) {
@@ -1872,5 +2189,5 @@
       _TOC.set(year, month, day, hour, min, sec);
 
-      if (readDbl(line, pos[1], fieldLen, _agf0)
+      if (   readDbl(line, pos[1], fieldLen, _agf0)
           || readDbl(line, pos[2], fieldLen, _agf1)
           || readDbl(line, pos[3], fieldLen, _TOT)) {
@@ -1883,7 +2200,7 @@
     // =====================
     else if (iLine == 1) {
-      if (readDbl(line, pos[0], fieldLen, _x_pos)
-          || readDbl(line, pos[1], fieldLen, _x_velocity)
-          || readDbl(line, pos[2], fieldLen, _x_acceleration)
+      if (   readDbl(line, pos[0], fieldLen, _x_pos)
+          || readDbl(line, pos[1], fieldLen, _x_vel)
+          || readDbl(line, pos[2], fieldLen, _x_acc)
           || readDbl(line, pos[3], fieldLen, _health)) {
         _checkState = bad;
@@ -1895,7 +2212,7 @@
     // =====================
     else if (iLine == 2) {
-      if (readDbl(line, pos[0], fieldLen, _y_pos)
-          || readDbl(line, pos[1], fieldLen, _y_velocity)
-          || readDbl(line, pos[2], fieldLen, _y_acceleration)
+      if (   readDbl(line, pos[0], fieldLen, _y_pos)
+          || readDbl(line, pos[1], fieldLen, _y_vel)
+          || readDbl(line, pos[2], fieldLen, _y_acc)
           || readDbl(line, pos[3], fieldLen, _ura)) {
         _checkState = bad;
@@ -1908,7 +2225,7 @@
     else if (iLine == 3) {
       double iodn;
-      if (readDbl(line, pos[0], fieldLen, _z_pos)
-          || readDbl(line, pos[1], fieldLen, _z_velocity)
-          || readDbl(line, pos[2], fieldLen, _z_acceleration)
+      if (   readDbl(line, pos[0], fieldLen, _z_pos)
+          || readDbl(line, pos[1], fieldLen, _z_vel)
+          || readDbl(line, pos[2], fieldLen, _z_acc)
           || readDbl(line, pos[3], fieldLen, iodn)) {
         _checkState = bad;
@@ -1919,14 +2236,13 @@
     }
   }
-
   _x_pos *= 1.e3;
   _y_pos *= 1.e3;
   _z_pos *= 1.e3;
-  _x_velocity *= 1.e3;
-  _y_velocity *= 1.e3;
-  _z_velocity *= 1.e3;
-  _x_acceleration *= 1.e3;
-  _y_acceleration *= 1.e3;
-  _z_acceleration *= 1.e3;
+  _x_vel *= 1.e3;
+  _y_vel *= 1.e3;
+  _z_vel *= 1.e3;
+  _x_acc *= 1.e3;
+  _y_acc *= 1.e3;
+  _z_acc *= 1.e3;
 }
 
@@ -1944,10 +2260,10 @@
   SBASADDBITSFLOAT(30, this->_y_pos, 0.08)
   SBASADDBITSFLOAT(25, this->_z_pos, 0.4)
-  SBASADDBITSFLOAT(17, this->_x_velocity, 0.000625)
-  SBASADDBITSFLOAT(17, this->_y_velocity, 0.000625)
-  SBASADDBITSFLOAT(18, this->_z_velocity, 0.004)
-  SBASADDBITSFLOAT(10, this->_x_acceleration, 0.0000125)
-  SBASADDBITSFLOAT(10, this->_y_acceleration, 0.0000125)
-  SBASADDBITSFLOAT(10, this->_z_acceleration, 0.0000625)
+  SBASADDBITSFLOAT(17, this->_x_vel, 0.000625)
+  SBASADDBITSFLOAT(17, this->_y_vel, 0.000625)
+  SBASADDBITSFLOAT(18, this->_z_vel, 0.004)
+  SBASADDBITSFLOAT(10, this->_x_acc, 0.0000125)
+  SBASADDBITSFLOAT(10, this->_y_acc, 0.0000125)
+  SBASADDBITSFLOAT(10, this->_z_acc, 0.0000625)
   SBASADDBITSFLOAT(12, this->_agf0,
       1.0 / static_cast<double>(1 << 30) / static_cast<double>(1 << 1))
@@ -1967,11 +2283,11 @@
   double dt = tt - _TOC;
 
-  xc[0] = _x_pos + _x_velocity * dt + _x_acceleration * dt * dt / 2.0;
-  xc[1] = _y_pos + _y_velocity * dt + _y_acceleration * dt * dt / 2.0;
-  xc[2] = _z_pos + _z_velocity * dt + _z_acceleration * dt * dt / 2.0;
-
-  vv[0] = _x_velocity + _x_acceleration * dt;
-  vv[1] = _y_velocity + _y_acceleration * dt;
-  vv[2] = _z_velocity + _z_acceleration * dt;
+  xc[0] = _x_pos + _x_vel * dt + _x_acc * dt * dt / 2.0;
+  xc[1] = _y_pos + _y_vel * dt + _y_acc * dt * dt / 2.0;
+  xc[2] = _z_pos + _z_vel * dt + _z_acc * dt * dt / 2.0;
+
+  vv[0] = _x_vel + _x_acc * dt;
+  vv[1] = _y_vel + _y_acc * dt;
+  vv[2] = _z_vel + _z_acc * dt;
 
   xc[3] = _agf0 + _agf1 * dt;
@@ -2012,5 +2328,5 @@
 QString t_ephSBAS::toString(double version) const {
 
-  QString ephStr = ephTypeStr(_ephType, _prn, version);
+  QString ephStr = typeStr(_type, _prn, version);
   QString rnxStr = ephStr + rinexDateStr(_TOC, _prn, version);
 
@@ -2018,6 +2334,8 @@
 
   out
-      << QString("%1%2%3\n").arg(_agf0, 19, 'e', 12).arg(_agf1, 19, 'e', 12).arg(
-          _TOT, 19, 'e', 12);
+      << QString("%1%2%3\n")
+      .arg(_agf0, 19, 'e', 12)
+      .arg(_agf1, 19, 'e', 12)
+      .arg(_TOT,  19, 'e', 12);
 
   QString fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
@@ -2026,21 +2344,27 @@
   // =====================
   out
-      << QString(fmt).arg(1.e-3 * _x_pos, 19, 'e', 12).arg(1.e-3 * _x_velocity,
-          19, 'e', 12).arg(1.e-3 * _x_acceleration, 19, 'e', 12).arg(_health,
-          19, 'e', 12);
+      << QString(fmt)
+      .arg(1.e-3 * _x_pos, 19, 'e', 12)
+      .arg(1.e-3 * _x_vel, 19, 'e', 12)
+      .arg(1.e-3 * _x_acc, 19, 'e', 12)
+      .arg(_health,        19, 'e', 12);
   // =====================
   // BROADCAST ORBIT - 2
   // =====================
   out
-      << QString(fmt).arg(1.e-3 * _y_pos, 19, 'e', 12).arg(1.e-3 * _y_velocity,
-          19, 'e', 12).arg(1.e-3 * _y_acceleration, 19, 'e', 12).arg(_ura, 19,
-          'e', 12);
+      << QString(fmt)
+      .arg(1.e-3 * _y_pos, 19, 'e', 12)
+      .arg(1.e-3 * _y_vel, 19, 'e', 12)
+      .arg(1.e-3 * _y_acc, 19, 'e', 12)
+      .arg(_ura,           19, 'e', 12);
   // =====================
   // BROADCAST ORBIT - 3
   // =====================
   out
-      << QString(fmt).arg(1.e-3 * _z_pos, 19, 'e', 12).arg(1.e-3 * _z_velocity,
-          19, 'e', 12).arg(1.e-3 * _z_acceleration, 19, 'e', 12).arg(
-          double(_IODN), 19, 'e', 12);
+      << QString(fmt)
+      .arg(1.e-3 * _z_pos, 19, 'e', 12)
+      .arg(1.e-3 * _z_vel, 19, 'e', 12)
+      .arg(1.e-3 * _z_acc, 19, 'e', 12)
+      .arg(double(_IODN),  19, 'e', 12);
 
   return rnxStr;
@@ -2053,8 +2377,9 @@
   int nLines = 8;
 
-  if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2) {
+  if (type() == t_eph::CNV1 ||
+      type() == t_eph::CNV2) {
     nLines += 2;
   }
-  if (ephType() == t_eph::CNV3) {
+  if (type() == t_eph::CNV3) {
     nLines += 1;
   }
@@ -2107,5 +2432,5 @@
       _TOC.setBDS(year, month, day, hour, min, sec);
 
-      if (readDbl(line, pos[1], fieldLen, _clock_bias)
+      if (   readDbl(line, pos[1], fieldLen, _clock_bias)
           || readDbl(line, pos[2], fieldLen, _clock_drift)
           || readDbl(line, pos[3], fieldLen, _clock_driftrate)) {
@@ -2118,13 +2443,26 @@
     // =====================
     else if (iLine == 1) {
-      double aode;
-      if (readDbl(line, pos[0], fieldLen, aode)
-          || readDbl(line, pos[1], fieldLen, _Crs)
-          || readDbl(line, pos[2], fieldLen, _Delta_n)
-          || readDbl(line, pos[3], fieldLen, _M0)) {
-        _checkState = bad;
-        return;
-      }
-      _AODE = int(aode);
+      if (type() == t_eph::D1 ||
+          type() == t_eph::D2 ||
+          type() == t_eph::undefined) {
+        double aode;
+        if (   readDbl(line, pos[0], fieldLen, aode)
+            || readDbl(line, pos[1], fieldLen, _Crs)
+            || readDbl(line, pos[2], fieldLen, _Delta_n)
+            || readDbl(line, pos[3], fieldLen, _M0)) {
+          _checkState = bad;
+          return;
+        }
+        _AODE = int(aode);
+      }
+      else { //CNV1, CNV2, CNV3
+        if (   readDbl(line, pos[0], fieldLen, _ADOT)
+            || readDbl(line, pos[1], fieldLen, _Crs)
+            || readDbl(line, pos[2], fieldLen, _Delta_n)
+            || readDbl(line, pos[3], fieldLen, _M0)) {
+          _checkState = bad;
+          return;
+        }
+      }
     }
     // =====================
@@ -2132,5 +2470,5 @@
     // =====================
     else if (iLine == 2) {
-      if (readDbl(line, pos[0], fieldLen, _Cuc)
+      if (   readDbl(line, pos[0], fieldLen, _Cuc)
           || readDbl(line, pos[1], fieldLen, _e)
           || readDbl(line, pos[2], fieldLen, _Cus)
@@ -2144,5 +2482,5 @@
     // =====================
     else if (iLine == 3) {
-      if (readDbl(line, pos[0], fieldLen, _TOEsec)
+      if (   readDbl(line, pos[0], fieldLen, _TOEsec)
           || readDbl(line, pos[1], fieldLen, _Cic)
           || readDbl(line, pos[2], fieldLen, _OMEGA0)
@@ -2156,5 +2494,5 @@
     // =====================
     else if (iLine == 4) {
-      if (readDbl(line, pos[0], fieldLen, _i0)
+      if (   readDbl(line, pos[0], fieldLen, _i0)
           || readDbl(line, pos[1], fieldLen, _Crc)
           || readDbl(line, pos[2], fieldLen, _omega)
@@ -2163,4 +2501,16 @@
         return;
       }
+      else {
+        // Source RINEX version < 4
+        if (type() == t_eph::undefined) {
+          const double iMaxGEO = 10.0 / 180.0 * M_PI;
+          if (_i0 > iMaxGEO) {
+            _type = t_eph::D1;
+          }
+          else {
+            _type = t_eph::D2;
+          }
+        }
+      }
     }
     // =====================
@@ -2168,8 +2518,8 @@
     // =====================
     else if (iLine == 5) {
-
-      if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2
-          || ephType() == t_eph::CNV3) {
-        if (readDbl(line, pos[0], fieldLen, _IDOT)
+      if (type() == t_eph::CNV1 ||
+          type() == t_eph::CNV2 ||
+          type() == t_eph::CNV3) {
+        if (   readDbl(line, pos[0], fieldLen, _IDOT)
             || readDbl(line, pos[1], fieldLen, _Delta_n_dot)
             || readDbl(line, pos[2], fieldLen, _satType)
@@ -2178,6 +2528,7 @@
           return;
         }
-      } else { // D1, D2, undefined
-        if (readDbl(line, pos[0], fieldLen, _IDOT)
+      }
+      else { // D1, D2
+        if (   readDbl(line, pos[0], fieldLen, _IDOT)
             || readDbl(line, pos[2], fieldLen, _BDTweek)) {
           _checkState = bad;
@@ -2190,7 +2541,8 @@
     // =====================
     else if (iLine == 6) {
-      if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2
-          || ephType() == t_eph::CNV3) {
-        if (readDbl(line, pos[0], fieldLen, _SISAI_oe)
+      if (type() == t_eph::CNV1 ||
+          type() == t_eph::CNV2 ||
+          type() == 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)
@@ -2199,7 +2551,8 @@
           return;
         }
-      } else { // D1, D2, undefined
+      }
+      else { // D1, D2
         double SatH1;
-        if (readDbl(line, pos[0], fieldLen, _URA)
+        if (   readDbl(line, pos[0], fieldLen, _ura)
             || readDbl(line, pos[1], fieldLen, SatH1)
             || readDbl(line, pos[2], fieldLen, _TGD1)
@@ -2215,6 +2568,6 @@
     // =====================
     else if (iLine == 7) {
-      if (ephType() == t_eph::CNV1) {
-        if (readDbl(line, pos[0], fieldLen, _ISC_B1Cd)
+      if (type() == 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)) {
@@ -2222,6 +2575,7 @@
           return;
         }
-      } else if (ephType() == t_eph::CNV2) {
-        if (readDbl(line, pos[1], fieldLen, _ISC_B2ad)
+      }
+      else if (type() == 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)) {
@@ -2229,7 +2583,8 @@
           return;
         }
-      } else if (ephType() == t_eph::CNV3) {
+      }
+      else if (type() == t_eph::CNV3) {
         double health;
-        if (readDbl(line, pos[0], fieldLen, _SISMAI)
+        if (   readDbl(line, pos[0], fieldLen, _SISMAI)
             || readDbl(line, pos[1], fieldLen, health)
             || readDbl(line, pos[2], fieldLen, _INTEGRITYF_B2b)
@@ -2239,7 +2594,8 @@
         }
         _health = int(health);
-      } else { // D1, D2 or undefined
+      }
+      else { // D1, D2
         double aodc;
-        if (readDbl(line, pos[0], fieldLen, _TOT)
+        if (   readDbl(line, pos[0], fieldLen, _TOT)
             || readDbl(line, pos[1], fieldLen, aodc)) {
           _checkState = bad;
@@ -2257,6 +2613,6 @@
     else if (iLine == 8) {
       double health;
-      if (ephType() == t_eph::CNV1) {
-        if (readDbl(line, pos[0], fieldLen, _SISMAI)
+      if (type() == t_eph::CNV1) {
+        if (   readDbl(line, pos[0], fieldLen, _SISMAI)
             || readDbl(line, pos[1], fieldLen, health)
             || readDbl(line, pos[2], fieldLen, _INTEGRITYF_B1C)
@@ -2266,6 +2622,7 @@
         }
         _health = int(health);
-      } else if (ephType() == t_eph::CNV2) {
-        if (readDbl(line, pos[0], fieldLen, _SISMAI)
+      }
+      else if (type() == t_eph::CNV2) {
+        if (   readDbl(line, pos[0], fieldLen, _SISMAI)
             || readDbl(line, pos[1], fieldLen, health)
             || readDbl(line, pos[2], fieldLen, _INTEGRITYF_B2aB1C)
@@ -2275,5 +2632,6 @@
         }
         _health = int(health);
-      } else if (ephType() == t_eph::CNV3) {
+      }
+      else if (type() == t_eph::CNV3) {
         if (readDbl(line, pos[0], fieldLen, _TOT)) {
           _checkState = bad;
@@ -2281,5 +2639,4 @@
         }
       }
-
     }
     // =====================
@@ -2287,7 +2644,7 @@
     // =====================
     else if (iLine == 9) {
-
-      if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2) {
-        if (readDbl(line, pos[0], fieldLen, _TOT)
+      if (type() == t_eph::CNV1 ||
+          type() == t_eph::CNV2) {
+        if (   readDbl(line, pos[0], fieldLen, _TOT)
             || readDbl(line, pos[3], fieldLen, _IODE)) {
           _checkState = bad;
@@ -2295,5 +2652,4 @@
         }
       }
-
     }
   }
@@ -2488,6 +2844,6 @@
 unsigned int t_ephBDS::isUnhealthy() const {
 
-  if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2
-      || ephType() == t_eph::CNV3) {
+  if (type() == t_eph::CNV1 || type() == t_eph::CNV2
+      || type() == t_eph::CNV3) {
     return static_cast<unsigned int>(_health);
   }
@@ -2501,5 +2857,12 @@
 QString t_ephBDS::toString(double version) const {
 
-  QString ephStr = ephTypeStr(_ephType, _prn, version);
+  if (version < 4.0 &&
+      (type() == t_eph::CNV1 ||
+       type() == t_eph::CNV2 ||
+       type() == t_eph::CNV3 )) {
+    return "";
+  }
+
+  QString ephStr = typeStr(_type, _prn, version);
   QString rnxStr = ephStr + rinexDateStr(_TOC - 14.0, _prn, version);
 
@@ -2507,6 +2870,8 @@
 
   out
-      << QString("%1%2%3\n").arg(_clock_bias, 19, 'e', 12).arg(_clock_drift, 19,
-          'e', 12).arg(_clock_driftrate, 19, 'e', 12);
+      << QString("%1%2%3\n")
+      .arg(_clock_bias,      19, 'e', 12)
+      .arg(_clock_drift, 19, 'e', 12)
+      .arg(_clock_driftrate, 19, 'e', 12);
 
   QString fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
@@ -2514,67 +2879,121 @@
   // BROADCAST ORBIT - 1
   // =====================
+  if (type() == t_eph::D1 ||
+      type() == t_eph::D2 ||
+      type() == t_eph::undefined) {
+    out
+        << QString(fmt)
+        .arg(double(_AODE), 19, 'e', 12)
+        .arg(_Crs,          19, 'e', 12)
+        .arg(_Delta_n,      19, 'e', 12)
+        .arg(_M0,           19, 'e', 12);
+  }
+  else { //CNV1, CNV2, CNV3
+    out
+        << QString(fmt)
+        .arg(_ADOT,    19, 'e', 12)
+        .arg(_Crs,     19, 'e', 12)
+        .arg(_Delta_n, 19, 'e', 12)
+        .arg(_M0,      19, 'e', 12);
+  }
+
+  // =====================
+  // BROADCAST ORBIT - 2
+  // =====================
   out
-      << QString(fmt).arg(double(_AODE), 19, 'e', 12).arg(_Crs, 19, 'e', 12).arg(
-          _Delta_n, 19, 'e', 12).arg(_M0, 19, 'e', 12);
-  // =====================
-  // BROADCAST ORBIT - 2
+      << QString(fmt)
+      .arg(_Cuc,    19, 'e', 12)
+      .arg(_e,      19, 'e', 12)
+      .arg(_Cus,    19, 'e', 12)
+      .arg(_sqrt_A, 19, 'e', 12);
+
+  // =====================
+  // BROADCAST ORBIT - 3
   // =====================
   out
-      << QString(fmt).arg(_Cuc, 19, 'e', 12).arg(_e, 19, 'e', 12).arg(_Cus, 19,
-          'e', 12).arg(_sqrt_A, 19, 'e', 12);
-  // =====================
-  // BROADCAST ORBIT - 3
+      << QString(fmt)
+      .arg(_TOEsec, 19, 'e', 12)
+      .arg(_Cic,    19, 'e', 12)
+      .arg(_OMEGA0, 19, 'e', 12)
+      .arg(_Cis,    19, 'e', 12);
+  // =====================
+  // BROADCAST ORBIT - 4
   // =====================
   out
-      << QString(fmt).arg(_TOEsec, 19, 'e', 12).arg(_Cic, 19, 'e', 12).arg(
-          _OMEGA0, 19, 'e', 12).arg(_Cis, 19, 'e', 12);
-  // =====================
-  // BROADCAST ORBIT - 4
-  // =====================
-  out
-      << QString(fmt).arg(_i0, 19, 'e', 12).arg(_Crc, 19, 'e', 12).arg(_omega,
-          19, 'e', 12).arg(_OMEGADOT, 19, 'e', 12);
+      << QString(fmt)
+      .arg(_i0,       19, 'e', 12)
+      .arg(_Crc,      19, 'e', 12)
+      .arg(_omega,    19, 'e', 12)
+      .arg(_OMEGADOT, 19, 'e', 12);
   // =====================
   // BROADCAST ORBIT - 5
   // =====================
-  if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2
-      || ephType() == t_eph::CNV3) {
+  if (type() == t_eph::CNV1 ||
+      type() == t_eph::CNV2 ||
+      type() == 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
+        << 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,
     out
-        << QString(fmt).arg(_IDOT, 19, 'e', 12).arg("", 19, QChar(' ')).arg(
-            _BDTweek, 19, 'e', 12).arg("", 19, QChar(' '));
+        << QString(fmt)
+        .arg(_IDOT,    19, 'e', 12)
+        .arg("",       19, QChar(' '))
+        .arg(_BDTweek, 19, 'e', 12)
+        .arg("",       19, QChar(' '));
   }
   // =====================
   // BROADCAST ORBIT - 6
   // =====================
-  if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2
-      || ephType() == t_eph::CNV3) {
+  if (type() == t_eph::CNV1 ||
+      type() == t_eph::CNV2 ||
+      type() == 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
+        << 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);
+        << 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 (ephType() == t_eph::CNV1) {
+  if (type() == 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 (ephType() == t_eph::CNV2) {
+        << 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 (type() == 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 (ephType() == t_eph::CNV3) {
+        << 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 (type() == t_eph::CNV3) {
     out
-        << QString(fmt).arg(_SISMAI, 19, 'e', 12).arg(double(_health), 19, 'e',
-            12).arg(_INTEGRITYF_B2b, 19, 'e', 12).arg(_TGD_B2bI, 19, 'e', 12);
-  } else { // D1, D2, undefined
+        << QString(fmt)
+        .arg(_SISMAI,         19, 'e', 12)
+        .arg(double(_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
@@ -2584,6 +3003,9 @@
     }
     out
-        << QString(fmt).arg(tots, 19, 'e', 12).arg(double(_AODC), 19, 'e', 12).arg(
-            "", 19, QChar(' ')).arg("", 19, QChar(' '));
+        << QString(fmt)
+        .arg(tots,          19, 'e', 12)
+        .arg(double(_AODC), 19, 'e', 12)
+        .arg("",            19, QChar(' '))
+        .arg("",            19, QChar(' '));
   }
 
@@ -2591,16 +3013,27 @@
   // BROADCAST ORBIT - 8
   // =====================
-  if (ephType() == t_eph::CNV1) {
+  if (type() == t_eph::CNV1) {
     out
-        << QString(fmt).arg(_SISMAI, 19, 'e', 12).arg(double(_health), 19, 'e',
-            12).arg(_INTEGRITYF_B1C, 19, 'e', 12).arg(_IODC, 19, 'e', 12);
-  } else if (ephType() == t_eph::CNV2) {
+        << QString(fmt)
+        .arg(_SISMAI,         19, 'e', 12)
+        .arg(double(_health), 19, 'e', 12)
+        .arg(_INTEGRITYF_B1C, 19, 'e', 12)
+        .arg(_IODC,           19, 'e', 12);
+  }
+  else if (type() == t_eph::CNV2) {
     out
-        << QString(fmt).arg(_SISMAI, 19, 'e', 12).arg(double(_health), 19, 'e',
-            12).arg(_INTEGRITYF_B2aB1C, 19, 'e', 12).arg(_IODC, 19, 'e', 12);
-  } else if (ephType() == t_eph::CNV3) {
+        << QString(fmt)
+        .arg(_SISMAI,            19, 'e', 12)
+        .arg(double(_health),    19, 'e', 12)
+        .arg(_INTEGRITYF_B2aB1C, 19, 'e', 12)
+        .arg(_IODC,              19, 'e', 12);
+  }
+  else if (type() == t_eph::CNV3) {
     out
-        << QString(fmt).arg(_TOT, 19, 'e', 12).arg("", 19, QChar(' ')).arg("",
-            19, QChar(' ')).arg("", 19, QChar(' '));
+        << QString(fmt)
+        .arg(_TOT, 19, 'e', 12)
+        .arg("",   19, QChar(' '))
+        .arg("",   19, QChar(' '))
+        .arg("",   19, QChar(' '));
   }
 
@@ -2608,8 +3041,12 @@
   // BROADCAST ORBIT - 9
   // =====================
-  if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2) {
+  if (type() == t_eph::CNV1 ||
+      type() == t_eph::CNV2) {
     out
-        << QString(fmt).arg(_TOT, 19, 'e', 12).arg("", 19, QChar(' ')).arg("",
-            19, QChar(' ')).arg(_IODE, 19, 'e', 12);
+        << QString(fmt)
+        .arg(_TOT,  19, 'e', 12)
+        .arg("",    19, QChar(' '))
+        .arg("",    19, QChar(' '))
+        .arg(_IODE, 19, 'e', 12);
   }
 
Index: /trunk/BNC/src/ephemeris.h
===================================================================
--- /trunk/BNC/src/ephemeris.h	(revision 10586)
+++ /trunk/BNC/src/ephemeris.h	(revision 10587)
@@ -13,16 +13,15 @@
 class t_orbCorr;
 class t_clkCorr;
-enum e_navType {EPH, STO, EOP, ION};
 
 class t_eph {
  public:
-  enum e_type {unknown, GPS, QZSS, GLONASS, Galileo, SBAS, BDS, IRNSS};
+  enum e_system {unknown, GPS, QZSS, GLONASS, Galileo, SBAS, BDS, IRNSS};
   enum e_checkState {unchecked, ok, bad, outdated, unhealthy};
-  enum e_ephType {undefined, LNAV, FDMA, FNAV, INAF, D1, D2, SBASL1, CNAV, CNV1, CNV2, CNV3, L1NV, L1OC, L3OC};
+  enum e_type {undefined, LNAV, FDMA, FNAV, INAV, D1, D2, SBASL1, CNAV, CNV1, CNV2, CNV3, L1NV, L1OC, L3OC};
 
   t_eph();
   virtual ~t_eph();
 
-  virtual e_type  type() const = 0;
+  virtual e_system  system() const = 0;
   virtual QString toString(double version) const = 0;
   virtual unsigned int IOD() const = 0;
@@ -43,6 +42,6 @@
     }
   }
-  e_ephType ephType() const {return _ephType;}
-  t_irc setEphType(QString ephTypeStr);
+  e_type type() const {return _type;}
+  void setType(QString typeStr);
 
   t_prn prn() const {return _prn;}
@@ -54,5 +53,5 @@
   static QString rinexDateStr(const bncTime& tt, const t_prn& prn, double version);
   static QString rinexDateStr(const bncTime& tt, const QString& prnStr, double version);
-  static QString ephTypeStr(e_ephType ephType, const t_prn& prn, double version);
+  static QString typeStr(e_type type, const t_prn& prn, double version);
   static bool earlierTime(const t_eph* eph1, const t_eph* eph2) {return eph1->_TOC < eph2->_TOC;}
   static bool prnSort(const t_eph* eph1, const t_eph* eph2) {return eph1->prn() < eph2->prn();}
@@ -65,5 +64,5 @@
   QString          _receptStaID;
   e_checkState     _checkState;
-  e_ephType        _ephType; // defined in RINEX 4
+  e_type           _type; // defined in RINEX 4
   t_orbCorr*       _orbCorr;
   t_clkCorr*       _clkCorr;
@@ -123,8 +122,9 @@
     _ISC_L1P         = 0.0;
     _wnop            = 0.0;
-    _intSF           = -1;
-    _ephSF           = -1;
-    _L2Cphasing      = -1;
-    _alert           = -1;
+    _flags_unknown   = true;
+    _intSF           = 0.0;
+    _ephSF           = 0.0;
+    _L2Cphasing      = 0.0;
+    _alert           = 0.0;
     _receptStaID     = "";
   }
@@ -132,5 +132,5 @@
   virtual ~t_ephGPS() {}
 
-  virtual e_type type() const {
+  virtual e_system system() const {
     switch (_prn.system()) {
       case 'J':
@@ -208,8 +208,9 @@
   double _ISC_L1P;          // [s]
 
-  int    _intSF;            // [-] integrity status flag
-  int    _ephSF;            // [-] ephemeris status flag (QZSS)
-  int    _L2Cphasing;       // [-] L2C phasing flag
-  int    _alert;            // [-] alert flag
+  bool   _flags_unknown;    // [-] status flags are unknown => BNK; fitInterval LNAV from QZSS or GPS
+  double _intSF;            // [-] integrity status flag
+  double _ephSF;            // [-] ephemeris status flag (QZSS)
+  double _L2Cphasing;       // [-] L2C phasing flag
+  double _alert;            // [-] alert flag
 
   double _wnop;             // GPS continuous week number with the ambiguity resolved (same as _TOEweek?)
@@ -221,50 +222,74 @@
  public:
   t_ephGlo() {
-    _xv.ReSize(6); _xv = 0.0;
-    _gps_utc          = 0.0;
-    _tau              = 0.0;
-    _gamma            = 0.0;
-    _tki              = 0.0;
-    _x_pos            = 0.0;
-    _x_velocity       = 0.0;
-    _x_acceleration   = 0.0;
-    _health           = 0.0;
-    _y_pos            = 0.0;
-    _y_velocity       = 0.0;
-    _y_acceleration   = 0.0;
-    _frequency_number = 0.0;
-    _z_pos            = 0.0;
-    _z_velocity       = 0.0;
-    _z_acceleration   = 0.0;
-    _E                = 0.0;
-    _almanac_health   = 0.0;
+    _xv.ReSize(6);
+    _xv      = 0.0;
+    _gps_utc = 0.0;
+    _tau     = 0.0;
+    _tau1    = 0.0;
+    _tau2    = 0.0;
+    _tauC    = 0.0;
+    _Tin     = 0.0;
+    _gamma   = 0.0;
+    _tki     = 0.0;
+    _x_pos   = 0.0;
+    _x_vel   = 0.0;
+    _x_acc   = 0.0;
+    _health  = 0.0;
+    _y_pos   = 0.0;
+    _y_vel   = 0.0;
+    _y_acc   = 0.0;
+    _frq_num = 0.0;
+    _z_pos   = 0.0;
+    _z_vel   = 0.0;
+    _z_acc   = 0.0;
+    _E       = 0.0;
+    _EE      = 0.0;
+    _ET      = 0.0;
+    _RE      = 0.0;
+    _RT      = 0.0;
+    _P1      = 0.0;
+    _P2      = 0.0;
+    _P3      = 0.0;
+    _M_M     = 0.0;
+    _M_FE    = 0.0;
+    _M_FT    = 0.0;
+    _M_l3    = 0.0;
+    _M_l5    = 0.0;
+    _M_NA    = 0.0;
+    _M_NT    = 0.0;
+    _M_N4    = 0.0;
+    _M_P     = 0.0;
+    _M_P4    = 0.0;
+    _X_PC    = 0.0;
+    _Y_PC    = 0.0;
+    _Z_PC    = 0.0;
+    _TOT     = 0.0;
+    _yaw     = 0.0;
+    _sn      = 0.0;
+    _sat_type  = 0.0;
+    _TGD_L2OCp = 0.0;
+    _TGD_L3OCp = 0.0;
+    _M_tau_GPS = 0.0;
+    _M_delta_tau  = 0.0;
+    _attitude_P2  = 0.0;
+    _angular_rate = 0.0;
+    _angular_acc  = 0.0;
+    _angular_rate_max = 0.0;
+    _data_validity = 0;
+    _healthflags_unknown = false;
+    _statusflags_unknown = false;
+    _almanac_health = 0.0;
     _almanac_health_availablility_indicator = 0.0;
     _additional_data_availability = 0.0;
-    _tauC             = 0.0;
-    _P1               = 0.0;
-    _P2               = 0.0;
-    _P3               = 0.0;
-    _NA               = 0.0;
-    _M_P              = 0.0;
-    _M_l3             = 0.0;
-    _M_delta_tau      = 0.0;
-    _M_P4             = 0.0;
-    _M_FT             = 0.0;
-    _M_NT             = 0.0;
-    _M_M              = 0.0;
-    _M_N4             = 0.0;
-    _M_tau_GPS        = 0.0;
-    _M_l5             = 0.0;
-    _receptStaID      = "";
-    _flags_unknown    = true;
+
   }
   t_ephGlo(double rnxVersion, const QStringList& lines);
   virtual ~t_ephGlo() {}
 
-  virtual e_type type() const {return t_eph::GLONASS;}
+  virtual e_system system() const {return t_eph::GLONASS;}
   virtual QString toString(double version) const;
   virtual unsigned int  IOD() const;
   virtual unsigned int isUnhealthy() const;
-  virtual int slotNum() const {return int(_frequency_number);}
+  virtual int slotNum() const {return int(_frq_num);}
 
  private:
@@ -272,48 +297,78 @@
   static ColumnVector glo_deriv(double /* tt */, const ColumnVector& xv, double* acc);
 
-  mutable bncTime      _tt;  // time
-  mutable ColumnVector _xv;  // status vector (position, velocity) at time _tt
-
-  double  _gps_utc;
-  double  _tau;              // [s]
-  double  _gamma;            // [-]
-  mutable double  _tki;      // message frame time
-
-  double  _x_pos;            // [km]
-  double  _x_velocity;       // [km/s]
-  double  _x_acceleration;   // [km/s^2]
-  double  _health;           // 0 = O.K. MSB of Bn word
-
-  double  _y_pos;            // [km]
-  double  _y_velocity;       // [km/s]
-  double  _y_acceleration;   // [km/s^2]
-  double  _frequency_number; // ICD-GLONASS data position
-
-  double  _z_pos;            // [km]
-  double  _z_velocity;       // [km/s]
-  double  _z_acceleration;   // [km/s^2]
-  double  _E;                // Age of Information [days]
-
-  double _almanac_health;     // Cn word
-  double _almanac_health_availablility_indicator;
-
-  double _additional_data_availability;  //
-  double _tauC;               // GLONASS time scale correction to UTC(SU) time [sec]
-  double _P1;                 // flag of the immediate data updating [-]
-  double _P2;                 // flag of oddness or evenness of the value of tb for intervals 30 or 60 minutes [-]
-  double _P3;                 // flag indicating a number of satellites for which almanac is transmitted within given frame [-]
-  double _NA;                 // calendar day number within the 4-year period [days]
-
-  double _M_P;                // control segment parameter that indicates the satellite operation mode with respect of time parameters
-  double _M_l3;               // health flag
-  double _M_delta_tau;        // [sec]
-  double _M_P4;               // flag to show that ephemeris parameters are present [-]
-  double _M_FT;               // Indicator for predicted satellite User Range Accuracy (URAI) [-]
-  double _M_NT;               // current date, calendar number of day within 4-year interval [days]
-  double _M_M;                // type of satellite transmitting navigation signal: 0 = GLONASS, 1 = GLONASS-M satellite [-]
-  double _M_N4;               // 4-year interval number starting from 1996
-  double _M_tau_GPS;          // correction to GPS time relative to GLONASS time [days]
-  double _M_l5;               // health flag
-  bool   _flags_unknown;      // status and health flags are unknown (rnx version < 3.05) or known (rnx version >= 3.05)
+  mutable bncTime      _tt;   // time
+  mutable ColumnVector _xv;   // status vector (position, velocity) at time _tt
+
+  double  _gps_utc;            // [s]
+  double  _tau;                // [s]
+  double  _tau1;               // [s]
+  double  _tau2;               // [s]
+  double  _tauC;               // GLONASS time scale correction to UTC(SU) [sec]
+  double  _Tin;                // sec of day UTC(SU) [s]
+
+  double  _gamma;              // [-]
+  mutable double  _tki;        // message frame time
+
+  double  _x_pos;              // [km]
+  double  _x_vel;              // [km/s]
+  double  _x_acc;              // [km/s^2]
+  double  _health;             // 0 = OK. MSB of Bn word
+
+  double  _y_pos;              // [km]
+  double  _y_vel;              // [km/s]
+  double  _y_acc;              // [km/s^2]
+  double  _frq_num;            // ICD-GLONASS data position
+
+  double  _z_pos;              // [km]
+  double  _z_vel;              // [km/s]
+  double  _z_acc;              // [km/s^2]
+
+  double  _E;                  // Age of current Information [days]
+  double  _EE;                 // Age Of Data eph [days]
+  double  _ET;                 // Age Of Data clk [days]
+
+  double  _TGD_L2OCp;          // [sec]
+  double  _TGD_L3OCp;          // [sec]
+
+  double  _almanac_health ;    // almanac health bit; 1 = healthy, 1 = not healthy
+  double  _almanac_health_availablility_indicator; // 1 = reported in eph record, 0 = not reported
+  double  _additional_data_availability;
+
+  double  _sat_type;           // 0 = GLO_SAT, 1 = GLO_SAT_M (M type), 2 = GLO_SAT_K (K type)
+  double  _RE;                 // source flags; 01 = relay; 10 = prediction (propagation), 11 = use of inter-satellite measurements
+  double  _RT;                 // source flags; 01 = relay, 10 = prediction (propagation), 11 = use of inter-satellite measurements
+
+  double  _P1;                 // update and validity interval [-]; 00 = 0 min, 01 = 30 min, 10 ) 45 min, 11 = 60 min
+  double  _P2;                 // flag of oddness or evenness of the value of tb for intervals 30 or 60 minutes [-]
+  double  _P3;                 // flag indicating a number of satellites for which almanac is transmitted within given frame [-]
+
+  double  _M_M;                // type of satellite transmitting navigation signal: 0 = GLONASS, 1 = GLONASS-M/K satellite [-]
+  double  _M_FE;               // Indicator for predicted satellite User Range Accuracy (URAI_orb) [-]
+  double  _M_FT;               // Indicator for predicted satellite User Range Accuracy (URAI_clk) [-]
+  double  _M_l3;               // health bit on string 3 GLO-M/K only
+  double  _M_l5;               // health flag
+  double  _M_NA;               // calendar day number within the 4-year period [days]
+  double  _M_NT;               // current date, calendar number of day within 4-year interval [days]
+  double  _M_N4;               // 4-year interval number starting from 1996
+  double  _M_P;                // control segment parameter that indicates the satellite operation mode with respect of time parameters
+  double  _M_P4;               // flag to show that ephemeris parameters are present [-] GLO-M/K only
+  double  _M_tau_GPS;          // correction to GPS time relative to GLONASS time [days]
+  double  _M_delta_tau;        // [s]
+
+  bool    _statusflags_unknown;// status flags are unknown => BNK in RNX NAV file if message type is FDMA
+  bool    _healthflags_unknown;// health flags are unknown => BNK in RNX NAV file if message type is FDMA
+  int     _data_validity;      // data validity; 0 = valid, 1 = invalid
+
+  double  _attitude_P2;        // 0 = nominal yaw steering, 1 = rate-limited yaw maneuver
+  double  _yaw;                // [rad]
+  double  _sn;                 // sign flag
+  double  _angular_rate;       // [rad/sec]
+  double  _angular_rate_max;   // [rad/sec]
+  double  _angular_acc;        // [rad/sec^2]
+
+  double  _X_PC;               // X PC coord [m] GLO manufacturer coordinate system
+  double  _Y_PC;               // Y PC coord [m] GLO manufacturer coordinate system
+  double  _Z_PC;               // Y PC coord [m] GLO manufacturer coordinate system
+  double  _TOT;                // Time of transmission
 };
 
@@ -345,7 +400,7 @@
     _TOEweek         = 0.0;
     _SISA            = 0.0;
-    _E5aHS           = 0.0;
-    _E5bHS           = 0.0;
-    _E1_bHS          = 0.0;
+    _E5a_HS          = 0.0;
+    _E5b_HS          = 0.0;
+    _E1B_HS          = 0.0;
     _BGD_1_5A        = 0.0;
     _BGD_1_5B        = 0.0;
@@ -353,7 +408,7 @@
     _inav            = false;
     _fnav            = false;
-    _e1DataInvalid   = false;
-    _e5aDataInvalid  = false;
-    _e5bDataInvalid  = false;
+    _E1B_DataInvalid = false;
+    _E5a_DataInvalid = false;
+    _E5b_DataInvalid = false;
     _receptStaID     = "";
   };
@@ -362,5 +417,5 @@
 
   virtual QString toString(double version) const;
-  virtual e_type type() const {return t_eph::Galileo;}
+  virtual e_system system() const {return t_eph::Galileo;}
   virtual unsigned int  IOD() const { return static_cast<unsigned long>(_IODnav); }
   virtual unsigned int  isUnhealthy() const;
@@ -394,11 +449,11 @@
 
   double  _IDOT;             //  [rad/s]
-  double  _TOEweek;
+  double  _TOEweek;          //  [-]
   // spare
 
   mutable double  _SISA;     // Signal In Space Accuracy
-  double  _E5aHS;            //  [0..3] E5a Health Status
-  double  _E5bHS;            //  [0..3] E5b Health Status
-  double  _E1_bHS;           //  [0..3] E1-b Health Status
+  double  _E5a_HS;           //  [0..3] E5a Health Status
+  double  _E5b_HS;           //  [0..3] E5b Health Status
+  double  _E1B_HS;           //  [0..3] E1B Health Status
   double  _BGD_1_5A;         //  group delay [s]
   double  _BGD_1_5B;         //  group delay [s]
@@ -407,7 +462,7 @@
   bool    _inav;             // Data comes from I/NAV when <code>true</code>
   bool    _fnav;             // Data comes from F/NAV when <code>true</code>
-  bool    _e1DataInvalid;    // E1 Data is not valid
-  bool    _e5aDataInvalid;   // E5A Data is not valid
-  bool    _e5bDataInvalid;   // E5B Data is not valid
+  bool    _E1B_DataInvalid;  // E1B Data is not valid
+  bool    _E5a_DataInvalid;  // E5a Data is not valid
+  bool    _E5b_DataInvalid;  // E5b Data is not valid
 };
 
@@ -417,25 +472,25 @@
  public:
   t_ephSBAS() {
-    _IODN           = 0;
-    _TOT            = 0.0;
-    _agf0           = 0.0;
-    _agf1           = 0.0;
-    _x_pos          = 0.0;
-    _x_velocity     = 0.0;
-    _x_acceleration = 0.0;
-    _y_pos          = 0.0;
-    _y_velocity     = 0.0;
-    _y_acceleration = 0.0;
-    _z_pos          = 0.0;
-    _z_velocity     = 0.0;
-    _z_acceleration = 0.0;
-    _ura            = 0.0;
-    _health         = 0.0;
-    _receptStaID    = "";
+    _IODN   = 0;
+    _TOT    = 0.0;
+    _agf0   = 0.0;
+    _agf1   = 0.0;
+    _x_pos  = 0.0;
+    _x_vel  = 0.0;
+    _x_acc  = 0.0;
+    _y_pos  = 0.0;
+    _y_vel  = 0.0;
+    _y_acc  = 0.0;
+    _z_pos  = 0.0;
+    _z_vel  = 0.0;
+    _z_acc  = 0.0;
+    _ura    = 0.0;
+    _health = 0.0;
+    _receptStaID = "";
   }
   t_ephSBAS(double rnxVersion, const QStringList& lines);
   virtual ~t_ephSBAS() {}
 
-  virtual e_type  type() const {return t_eph::SBAS;}
+  virtual e_system  system() const {return t_eph::SBAS;}
   virtual unsigned int IOD() const;
   virtual unsigned int  isUnhealthy() const;
@@ -446,19 +501,19 @@
 
   int    _IODN;
-  double _TOT;            // not used (set to  0.9999e9)
-  double _agf0;           // [s]    clock correction
-  double _agf1;           // [s/s]  clock correction drift
-
-  double _x_pos;          // [m]
-  double _x_velocity;     // [m/s]
-  double _x_acceleration; // [m/s^2]
-
-  double _y_pos;          // [m]
-  double _y_velocity;     // [m/s]
-  double _y_acceleration; // [m/s^2]
-
-  double _z_pos;          // [m]
-  double _z_velocity;     // [m/s]
-  double _z_acceleration; // [m/s^2]
+  double _TOT;   // not used (set to  0.9999e9)
+  double _agf0;  // [s]    clock correction
+  double _agf1;  // [s/s]  clock correction drift
+
+  double _x_pos; // [m]
+  double _x_vel; // [m/s]
+  double _x_acc; // [m/s^2]
+
+  double _y_pos; // [m]
+  double _y_vel; // [m/s]
+  double _y_acc; // [m/s^2]
+
+  double _z_pos; // [m]
+  double _z_vel; // [m/s]
+  double _z_acc; // [m/s^2]
 
   mutable double _ura;
@@ -474,9 +529,9 @@
    _AODE              = 0;
    _AODC              = 0;
-   _URAI              = 0;
-   _URA               = 0.0;
+   _ura               = 0.0;
    _clock_bias        = 0.0;
    _clock_drift       = 0.0;
    _clock_driftrate   = 0.0;
+   _ADOT              = 0.0;
    _Crs               = 0.0;
    _Delta_n           = 0.0;
@@ -523,5 +578,5 @@
   virtual ~t_ephBDS() {}
 
-  virtual e_type  type() const {return t_eph::BDS;}
+  virtual e_system  system() const {return t_eph::BDS;}
   virtual unsigned int IOD() const;
   virtual unsigned int isUnhealthy() const;
@@ -535,14 +590,14 @@
   int     _AODE;
   int     _AODC;
-  int     _URAI;             // [0..15] index from RTCM stream
-  mutable double  _URA;      // user range accuracy [m]
+  mutable double  _ura;      // user range accuracy [m]
   double  _clock_bias;       // [s]
   double  _clock_drift;      // [s/s]
   double  _clock_driftrate;  // [s/s^2]
+  double  _ADOT;            // [m/s]
   double  _Crs;              // [m]
   double  _Delta_n;          // [rad/s]
   double  _M0;               // [rad]
   double  _Cuc;              // [rad]
-  double  _e;                //
+  double  _e;                // [-]
   double  _Cus;              // [rad]
   double  _sqrt_A;           // [m^0.5]
@@ -562,8 +617,8 @@
   double  _top;              // [s]
 
-  double  _SISAI_oe;         // []
-  double  _SISAI_ocb;        // []
-  double  _SISAI_oc1;        // []
-  double  _SISAI_oc2;        // []
+  double  _SISAI_oe;         // [-]
+  double  _SISAI_ocb;        // [-]
+  double  _SISAI_oc1;        // [-]
+  double  _SISAI_oc2;        // [-]
 
   double  _ISC_B1Cd;         // [s]
@@ -576,8 +631,8 @@
   double  _TGD_B2bI;         // [s]
 
-  double  _SISMAI;           // []
-
-  int     _SatH1;            //
-  int     _health;           //
+  double  _SISMAI;           // [-]
+
+  int     _SatH1;            // [-]
+  int     _health;           // [-]
 
   double  _INTEGRITYF_B1C;   // 3 bits word from sf 3
@@ -585,6 +640,6 @@
   double  _INTEGRITYF_B2b;   // 3 bits word from msg 10
 
-  double  _IODC;             // []
-  double  _IODE;             // [] IODE are the same as the 8 LSBs of IODC
+  double  _IODC;             // [-]
+  double  _IODE;             // [-] IODE are the same as the 8 LSBs of IODC
 
 };
Index: /trunk/BNC/src/rinex/reqcanalyze.cpp
===================================================================
--- /trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 10586)
+++ /trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 10587)
@@ -1019,5 +1019,5 @@
             *_log  << "                     "
                 << navFi.fileName() << ' ' << QString(": WRONG %2:%3\n")
-                           .arg(eph->ephTypeStr(eph->ephType(), eph->prn(), 99.0))
+                           .arg(eph->typeStr(eph->type(), eph->prn(), 99.0))
                            .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1();
           }
Index: /trunk/BNC/src/rinex/reqcedit.cpp
===================================================================
--- /trunk/BNC/src/rinex/reqcedit.cpp	(revision 10586)
+++ /trunk/BNC/src/rinex/reqcedit.cpp	(revision 10587)
@@ -586,8 +586,8 @@
   bool haveGPS     = false;
   bool haveGlonass = false;
-  QMap<t_eph::e_type, bool> haveGnss;
+  QMap<t_eph::e_system, bool> haveGnss;
   for (int ii = 0; ii < _ephs.size(); ii++) {
     const t_eph* eph = _ephs[ii];
-    switch (eph->type()) {
+    switch (eph->system()) {
       case t_eph::GPS:
         haveGPS = true;
@@ -680,5 +680,5 @@
     bncTime begTime = _begTime;
     bncTime endTime = _endTime;
-    if (eph->type() == t_eph::BDS) {
+    if (eph->system() == t_eph::BDS) {
       begTime += 14;
       endTime += 14;
@@ -695,26 +695,11 @@
 
     if (outNavFile.version() < 3.0) {
-  	  if (outNavFile.glonass() && eph->type() != t_eph::GLONASS) {
+  	  if (outNavFile.glonass() && eph->system() != t_eph::GLONASS) {
   	    continue;
   	  }
-  	  if (!outNavFile.glonass() && eph->type() != t_eph::GPS) {
+  	  if (!outNavFile.glonass() && eph->system() != t_eph::GPS) {
   	    continue;
       }
     }
-
-    if (outNavFile.version() < 4.0) {
-      if (eph->ephType() == t_eph::CNAV ||
-          eph->ephType() == t_eph::CNV1 ||
-          eph->ephType() == t_eph::CNV2 ||
-          eph->ephType() == t_eph::CNV3) {
-        continue;
-      }
-    }
-
-    if (outNavFile.version() >= 4.0 &&
-        eph->ephType() == t_eph::undefined) { // input files < version 4.0
-      continue;
-    }
-
     outNavFile.writeEph(eph);
   }
@@ -739,23 +724,23 @@
 
     if (isNew) {
-      if      (eph->type() == t_eph::GPS) {
+      if      (eph->system() == t_eph::GPS) {
         ephs.append(new t_ephGPS(*dynamic_cast<t_ephGPS*>(eph)));
       }
-      else if (eph->type() == t_eph::GLONASS) {
+      else if (eph->system() == t_eph::GLONASS) {
         ephs.append(new t_ephGlo(*dynamic_cast<t_ephGlo*>(eph)));
       }
-      else if (eph->type() == t_eph::Galileo) {
+      else if (eph->system() == t_eph::Galileo) {
         ephs.append(new t_ephGal(*dynamic_cast<t_ephGal*>(eph)));
       }
-      else if (eph->type() == t_eph::QZSS) {
+      else if (eph->system() == t_eph::QZSS) {
         ephs.append(new t_ephGPS(*dynamic_cast<t_ephGPS*>(eph)));
       }
-      else if (eph->type() == t_eph::SBAS) {
+      else if (eph->system() == t_eph::SBAS) {
         ephs.append(new t_ephSBAS(*dynamic_cast<t_ephSBAS*>(eph)));
       }
-      else if (eph->type() == t_eph::BDS) {
+      else if (eph->system() == t_eph::BDS) {
         ephs.append(new t_ephBDS(*dynamic_cast<t_ephBDS*>(eph)));
       }
-      else if (eph->type() == t_eph::IRNSS) {
+      else if (eph->system() == t_eph::IRNSS) {
         ephs.append(new t_ephGPS(*dynamic_cast<t_ephGPS*>(eph)));
       }
Index: /trunk/BNC/src/rinex/rnxnavfile.cpp
===================================================================
--- /trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 10586)
+++ /trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 10587)
@@ -149,5 +149,4 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_rnxNavFile::read(QTextStream* stream) {
-  QString ephType;
 
   while (stream->status() == QTextStream::Ok && !stream->atEnd()) {
@@ -157,19 +156,23 @@
       continue;
     }
-
+    QString navType;
     QStringList hlp = line.split(QRegExp("\\s+"), Qt::SkipEmptyParts);
-    QString key, prn, navSubType;
+    QString prn;
     char sys;
-
     QString firstStr = hlp.at(0);
-    if      (version() >= 3.0 &&  firstStr != ">") {
+
+    // RINEX version 3
+    if      (version() >= 3.0 &&
+             version() <  4.0 &&  firstStr != ">") {
       prn = firstStr;
       sys = prn[0].toLatin1();
-    }
+      navType = "";
+    }
+    // RINEX version 4
     else if (version() >= 4.0 && firstStr == ">") {
-      key = hlp.at(1);
+      QString key = hlp.at(1);
       prn = hlp.at(2);
       sys = prn[0].toLatin1();
-      ephType = hlp.at(3);
+      navType = hlp.at(3);
 
       // ALL Non-EPH messages are currently ignored
@@ -194,7 +197,7 @@
                  sys == 'J' || sys == 'I') {
           lines2skip = 3;
-          if ((sys == 'I' && ephType == "L1NV") || // I: KLOB, NEQN
-              (sys == 'J' && ephType == "CNVX")) { // J: WIDE, JAPN
-            navSubType = hlp.at(4);
+          if ((sys == 'I' && navType == "L1NV") || // I: KLOB, NEQN
+              (sys == 'J' && navType == "CNVX")) { // J: WIDE, JAPN
+            QString navSubType = hlp.at(4);
             if      (navSubType == "KLOB") {
               lines2skip += 1;
@@ -213,4 +216,5 @@
       continue;
     }
+    // RINEX version 2
     else {
       if (glonass()) {
@@ -226,5 +230,12 @@
     lines << line;
     if      (sys == 'G') {
-      for (int ii = 1; ii < 8; ii++) {
+      int nLines = 8;
+      if (navType == "CNAV") {
+        nLines += 1;
+      }
+      if (navType == "CNV2") {
+        nLines += 2;
+      }
+      for (int ii = 1; ii < nLines; ii++) {
         lines << stream->readLine();
       }
@@ -232,9 +243,9 @@
     }
     else if (sys == 'R') {
-      int num = 4;
+      int nLines = 4;
       if (version() >= 3.05) {
-        num += 1;
-      }
-      for (int ii = 1; ii < num; ii++) {
+        nLines += 1;
+      }
+      for (int ii = 1; ii < nLines; ii++) {
         lines << stream->readLine();
       }
@@ -248,5 +259,12 @@
     }
     else if (sys == 'J') {
-      for (int ii = 1; ii < 8; ii++) {
+      int nLines = 8;
+      if (navType == "CNAV") {
+        nLines += 1;
+      }
+      if (navType == "CNV2") {
+        nLines += 2;
+      }
+      for (int ii = 1; ii < nLines; ii++) {
         lines << stream->readLine();
       }
@@ -260,5 +278,13 @@
     }
     else if (sys == 'C') {
-      for (int ii = 1; ii < 8; ii++) {
+      int nLines = 8;
+      if (navType == "CNV1" ||
+          navType == "CNV2") {
+        nLines += 2;
+      }
+      if (navType == "CNV3") {
+        nLines += 1;
+      }
+      for (int ii = 1; ii < nLines; ii++) {
         lines << stream->readLine();
       }
@@ -266,5 +292,9 @@
     }
     else if (sys == 'I') {
-      for (int ii = 1; ii < 8; ii++) {
+      int nLines = 8;
+      if (navType == "L1NV") {
+        nLines += 1;
+      }
+      for (int ii = 1; ii < nLines; ii++) {
         lines << stream->readLine();
       }
@@ -272,14 +302,9 @@
     }
 
-    if (version() >= 4.0 && key == "EPH") {
-      if (eph->setEphType(ephType) != success) {
-        delete eph;
-        continue;
-      }
-    }
-
     if (eph) {
+      eph->setType(navType);
       _ephs.push_back(eph);
     }
+
   }
 }
@@ -363,5 +388,5 @@
   else {
     QString fmt;
-    t_eph::e_type sys = satSystem();
+    t_eph::e_system sys = satSystem();
     switch(sys) {
       case t_eph::GPS:
Index: /trunk/BNC/src/rinex/rnxnavfile.h
===================================================================
--- /trunk/BNC/src/rinex/rnxnavfile.h	(revision 10586)
+++ /trunk/BNC/src/rinex/rnxnavfile.h	(revision 10587)
@@ -38,5 +38,5 @@
 #define defaultRnxNavVersion2 2.11
 #define defaultRnxNavVersion3 3.05
-#define defaultRnxNavVersion4 4.01
+#define defaultRnxNavVersion4 4.02
 
 class t_rnxNavFile {
@@ -52,7 +52,7 @@
     double _version;
     bool   _glonass;
-    t_eph::e_type _satSys;
-    QStringList _comments;
-    QStringList _runByDate;
+    t_eph::e_system _satSys;
+    QStringList     _comments;
+    QStringList     _runByDate;
   };
 
@@ -67,7 +67,7 @@
   QStringList comments() const {return _header._comments;}
   QStringList runByDate() const {return _header._runByDate;}
-  t_eph::e_type satSystem() const {return _header._satSys;}
+  t_eph::e_system satSystem() const {return _header._satSys;}
   void   setGlonass(bool glo) {_header._glonass = glo;}
-  void   setGnssTypeV3(t_eph::e_type sys) {_header._satSys = sys;}
+  void   setGnssTypeV3(t_eph::e_system system) {_header._satSys = system;}
   void   writeHeader(const QMap<QString, QString>* txtMap = 0, int numMergedFiles = 0, int leapSecs = 0);
   void   writeEph(const t_eph* eph);
Index: /trunk/BNC/src/rinex/rnxobsfile.h
===================================================================
--- /trunk/BNC/src/rinex/rnxobsfile.h	(revision 10586)
+++ /trunk/BNC/src/rinex/rnxobsfile.h	(revision 10587)
@@ -40,5 +40,5 @@
 #define defaultRnxObsVersion2 2.11
 #define defaultRnxObsVersion3 3.05
-#define defaultRnxObsVersion4 4.01
+#define defaultRnxObsVersion4 4.02
 
 class t_rnxObsHeader {
Index: /trunk/BNC/src/upload/bncephuploadcaster.cpp
===================================================================
--- /trunk/BNC/src/upload/bncephuploadcaster.cpp	(revision 10586)
+++ /trunk/BNC/src/upload/bncephuploadcaster.cpp	(revision 10587)
@@ -91,10 +91,10 @@
         int size = 0;
 
-        if      (ephGPS && ephGPS->type() == t_eph::GPS  &&  (system == "ALL" || system.contains('G'))) {
+        if      (ephGPS && ephGPS->system() == t_eph::GPS  &&  (system == "ALL" || system.contains('G'))) {
           if (dt < 14400.0 || dt > -7200.0) {
             size = t_ephEncoder::RTCM3(*ephGPS, Array);
           }
         }
-        else if (ephGPS && ephGPS->type() == t_eph::QZSS && (system == "ALL" || system.contains('J'))) {
+        else if (ephGPS && ephGPS->system() == t_eph::QZSS && (system == "ALL" || system.contains('J'))) {
           if (dt <  7200.0 || dt > -3600.0) {
             size = t_ephEncoder::RTCM3(*ephGPS, Array);
@@ -121,5 +121,5 @@
           }
         }
-        else if (ephGPS && ephGPS->type() == t_eph::IRNSS && (system == "ALL" || system.contains('I'))) {
+        else if (ephGPS && ephGPS->system() == t_eph::IRNSS && (system == "ALL" || system.contains('I'))) {
           if (fabs(dt < 86400.0)) {
             size = t_ephEncoder::RTCM3(*ephGPS, Array);
