Index: /trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
===================================================================
--- /trunk/BNC/src/RTCM3/RTCM3Decoder.cpp	(revision 10576)
+++ /trunk/BNC/src/RTCM3/RTCM3Decoder.cpp	(revision 10577)
@@ -1134,5 +1134,5 @@
     eph._fitInterval = fitIntervalFromFlag(fitIntervalFalg, eph._IODC, eph.type());
     eph._TOT = 0.9999e9;
-    eph._navType = t_eph::LNAV;
+    eph._ephType = t_eph::LNAV;
 
     emit newGPSEph(eph);
@@ -1315,5 +1315,5 @@
     _gloFrq = QString("%1 %2").arg(eph._prn.toString().c_str()).arg(eph._frequency_number, 2, 'f', 0);
 
-    eph._navType = t_eph::FDMA;
+    eph._ephType = t_eph::FDMA;
 
     emit newGlonassEph(eph);
@@ -1429,8 +1429,5 @@
 
     GETBITS(i, 4)
-    if (i <= 6)
-      eph._ura = ceil(10.0 * pow(2.0, 1.0 + i / 2.0)) / 10.0;
-    else
-      eph._ura = ceil(10.0 * pow(2.0, i / 2.0)) / 10.0;
+    eph._ura = accuracyFromIndex(i, eph.type());
     GETBITS(eph._health, 6)
     GETFLOATSIGN(eph._TGD,       8, 1.0 / (double )(1 << 30) / (double )(1 << 1))
@@ -1439,5 +1436,5 @@
     eph._fitInterval = fitIntervalFromFlag(fitIntervalFalg, eph._IODC, eph.type());
     eph._TOT = 0.9999e9;
-    eph._navType = t_eph::LNAV;
+    eph._ephType = t_eph::LNAV;
 
     emit newGPSEph(eph);
@@ -1570,5 +1567,5 @@
     SKIPBITS(2)
     eph._TOT = 0.9999e9;
-    eph._navType = t_eph::LNAV;
+    eph._ephType = t_eph::LNAV;
 
     emit newGPSEph(eph);
@@ -1645,5 +1642,5 @@
     eph._TOT = 0.9999E9;
     eph._health = 0;
-    eph._navType = t_eph::SBASL1;
+    eph._ephType = t_eph::SBASL1;
 
     emit newSBASEph(eph);
@@ -1770,5 +1767,5 @@
         return false;
       }
-      eph._navType = t_eph::INAF;
+      eph._ephType = t_eph::INAF;
     }
     else {
@@ -1782,5 +1779,5 @@
       GETBITS(eph._E5aHS, 2)
       GETBITS(eph._e5aDataInValid, 1)
-      eph._navType = t_eph::FNAV;
+      eph._ephType = t_eph::FNAV;
     }
     eph._TOT = 0.9999e9;
@@ -1906,8 +1903,8 @@
     eph._TOT = 0.9999E9;
     if (eph._i0 > iMaxGEO) {
-      eph._navType = t_eph::D1;
+      eph._ephType = t_eph::D1;
     }
     else {
-      eph._navType = t_eph::D2;
+      eph._ephType = t_eph::D2;
     }
 
Index: /trunk/BNC/src/bnccore.cpp
===================================================================
--- /trunk/BNC/src/bnccore.cpp	(revision 10576)
+++ /trunk/BNC/src/bnccore.cpp	(revision 10577)
@@ -209,5 +209,5 @@
     messagePrivate(QString("%1: UNHEALTHY %2:%3")
                    .arg(eph->receptStaID())
-                   .arg(eph->navTypeString(eph->navType(), eph->prn(), 99.0))
+                   .arg(eph->ephTypeStr(eph->ephType(), 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->navTypeString(eph->navType(), eph->prn(), 99.0))
+                   .arg(eph->ephTypeStr(eph->ephType(), 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->navTypeString(eph->navType(), eph->prn(), 99.0))
+                   .arg(eph->ephTypeStr(eph->ephType(), eph->prn(), 99.0))
                    .arg(eph->rinexDateStr(eph->TOC(), eph->prn(), 99.0)).toLatin1());
   }
Index: /trunk/BNC/src/bncutils.cpp
===================================================================
--- /trunk/BNC/src/bncutils.cpp	(revision 10576)
+++ /trunk/BNC/src/bncutils.cpp	(revision 10577)
@@ -851,5 +851,6 @@
       type == t_eph::BDS ||
       type == t_eph::SBAS||
-      type == t_eph::QZSS) {
+      type == t_eph::QZSS||
+      type == t_eph::IRNSS) {
     if ((index >= 0) && (index <= 6)) {
       if (index == 3) {
@@ -860,7 +861,8 @@
       }
     }
-    else if ((index > 6) && (index <= 15)) {
+    else if ((index > 6) && (index < 15)) {
       accuracy = (10.0 * pow(2.0, (double(index) - 2.0))) / 10.0;
-    }
+
+    } // index = 15: absence of accuracy prediction => use SV on your own risk
     else {
       accuracy = 8192.0;
@@ -884,23 +886,4 @@
     }
   }
-  else if (type == t_eph::IRNSS) {
-    if ((index >= 0) && (index <= 6)) {
-      if      (index == 1) {
-        accuracy = 2.8;
-      }
-      else if (index == 3) {
-        accuracy = 5.7;
-      }
-      else if (index == 5) {
-        accuracy = 11.3;
-      }
-      else {
-        accuracy = pow(2, 1 + index / 2);
-      }
-    }
-    else if ((index > 6) && (index <= 15)) {
-      accuracy = pow(2, index - 2);
-    }
-  }
   return accuracy;
 }
@@ -913,7 +896,8 @@
       type == t_eph::BDS ||
       type == t_eph::SBAS ||
-      type == t_eph::QZSS) {
-
-    if (accuracy <= 2.40) {
+      type == t_eph::QZSS ||
+      type == t_eph::IRNSS) {
+
+    if      (accuracy <= 2.40) {
       return 0;
     }
@@ -966,6 +950,5 @@
 
   if (type == t_eph::Galileo) {
-
-    if (accuracy <= 0.49) {
+    if      (accuracy <= 0.49) {
       return int(ceil(accuracy * 100.0));
     }
Index: /trunk/BNC/src/ephemeris.cpp
===================================================================
--- /trunk/BNC/src/ephemeris.cpp	(revision 10576)
+++ /trunk/BNC/src/ephemeris.cpp	(revision 10577)
@@ -22,7 +22,7 @@
 t_eph::t_eph() {
   _checkState = unchecked;
-  _navType = undefined;
-  _orbCorr    = 0;
-  _clkCorr    = 0;
+  _ephType = undefined;
+  _orbCorr = 0;
+  _clkCorr = 0;
 }
 // Destructor
@@ -37,5 +37,5 @@
 //
 ////////////////////////////////////////////////////////////////////////////
-void t_eph::setOrbCorr(const t_orbCorr* orbCorr) {
+void t_eph::setOrbCorr(const t_orbCorr *orbCorr) {
   if (_orbCorr) {
     delete _orbCorr;
@@ -47,5 +47,5 @@
 //
 ////////////////////////////////////////////////////////////////////////////
-void t_eph::setClkCorr(const t_clkCorr* clkCorr) {
+void t_eph::setClkCorr(const t_clkCorr *clkCorr) {
   if (_clkCorr) {
     delete _clkCorr;
@@ -57,9 +57,9 @@
 //
 ////////////////////////////////////////////////////////////////////////////
-t_irc t_eph::getCrd(const bncTime& tt, ColumnVector& xc, ColumnVector& vv, bool useCorr) const {
-
-  if (_checkState == bad ||
-      _checkState == unhealthy ||
-      _checkState == outdated) {
+t_irc t_eph::getCrd(const bncTime &tt, ColumnVector &xc, ColumnVector &vv,
+    bool useCorr) const {
+
+  if (_checkState == bad || _checkState == unhealthy
+      || _checkState == outdated) {
     return failure;
   }
@@ -81,5 +81,5 @@
       dx[2] = _orbCorr->_xr[2] + _orbCorr->_dotXr[2] * dtO;
 
-      RSW_to_XYZ(xc.Rows(1,3), vv.Rows(1,3), dx, dx);
+      RSW_to_XYZ(xc.Rows(1, 3), vv.Rows(1, 3), dx, dx);
 
       xc[0] -= dx[0];
@@ -88,5 +88,5 @@
 
       ColumnVector dv(3);
-      RSW_to_XYZ(xc.Rows(1,3), vv.Rows(1,3), _orbCorr->_dotXr, dv);
+      RSW_to_XYZ(xc.Rows(1, 3), vv.Rows(1, 3), _orbCorr->_dotXr, dv);
 
       vv[0] -= dv[0];
@@ -98,7 +98,7 @@
         dtC -= (0.5 * ssrUpdateInt[_clkCorr->_updateInt]);
       }
-      xc[3] += _clkCorr->_dClk + _clkCorr->_dotDClk * dtC + _clkCorr->_dotDotDClk * dtC * dtC;
-    }
-    else {
+      xc[3] += _clkCorr->_dClk + _clkCorr->_dotDClk * dtC
+          + _clkCorr->_dotDotDClk * dtC * dtC;
+    } else {
       return failure;
     }
@@ -106,45 +106,39 @@
   return success;
 }
-
 
 //
 //////////////////////////////////////////////////////////////////////////////
-t_irc t_eph::setNavType(QString navTypeStr) {
-
-  if      (navTypeStr == "LNAV") {
-    _navType =  t_eph::LNAV;
-  }
-  else if (navTypeStr == "FDMA") {
-    _navType =  t_eph::FDMA;
-  }
-  else if (navTypeStr == "FNAV") {
-    _navType =  t_eph::FNAV;
-  }
-  else if (navTypeStr == "INAV") {
-    _navType =  t_eph::INAF;
-  }
-  else if (navTypeStr == "D1")   {
-    _navType =  t_eph::D1;
-  }
-  else if (navTypeStr == "D2")   {
-    _navType =  t_eph::D2;
-  }
-  else if (navTypeStr == "SBAS") {
-    _navType =  t_eph::SBASL1;
-  }
-  else if (navTypeStr == "CNAV") {
-    _navType =  t_eph::CNAV;
-  }
-  else if (navTypeStr == "CNV1") {
-    _navType =  t_eph::CNV1;
-  }
-  else if (navTypeStr == "CNV2") {
-    _navType =  t_eph::CNV2;
-  }
-  else if (navTypeStr == "CNV3") {
-    _navType =  t_eph::CNV3;
-  }
-  else                           {
-    _navType = t_eph::undefined;
+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;
+  } else {
+    _ephType = t_eph::undefined;
     return failure;
   }
@@ -155,67 +149,76 @@
 //
 //////////////////////////////////////////////////////////////////////////////
-QString t_eph::navTypeString(e_navType navType, const t_prn& prn, double version) {
-    QString navTypeString = "";
-    QString epochStart;
-    QString eolStr;
-
-    if (version < 4.0) {
-      return navTypeString;
-    }
-
-    if (version == 99.0) {
-      epochStart = "";
-      eolStr = "";
-    }
-    else {
-      epochStart = "> ";
-      eolStr = "\n";
-    }
-
-    QString ephStr = QString("EPH %1 ").arg(prn.toString().c_str());
-    switch (navType) {
-      case undefined:
-        navTypeString = epochStart + ephStr + "unknown" + eolStr;
-        break;
-      case LNAV:
-        navTypeString = epochStart + ephStr + "LNAV" + eolStr;
-        break;
-      case FDMA:
-        navTypeString = epochStart + ephStr + "FDMA" + eolStr;
-        break;
-      case FNAV:
-        navTypeString = epochStart + ephStr + "FNAV" + eolStr;
-        break;
-      case INAF:
-        navTypeString = epochStart + ephStr + "INAV" + eolStr;
-        break;
-      case D1:
-        navTypeString = epochStart + ephStr + "D1  " + eolStr;
-        break;
-      case D2:
-        navTypeString = epochStart + ephStr + "D2  " + eolStr;
-        break;
-      case SBASL1:
-        navTypeString = epochStart + ephStr + "SBAS" + eolStr;
-        break;
-      case CNAV:
-        navTypeString = epochStart + ephStr + "CNAV" + eolStr;
-        break;
-      case CNV1:
-        navTypeString = epochStart + ephStr + "CNV1" + eolStr;
-        break;
-      case CNV2:
-        navTypeString = epochStart + ephStr + "CNV2" + eolStr;
-        break;
-      case CNV3:
-        navTypeString = epochStart + ephStr + "CNV3" + eolStr;
-        break;
-    }
-    return navTypeString;
-  }
+QString t_eph::ephTypeStr(e_ephType ephType, const t_prn &prn, double version) {
+  QString ephTypeStr = "";
+  QString epochStart;
+  QString eolStr;
+
+  if (version < 4.0) {
+    return ephTypeStr;
+  }
+
+  if (version == 99.0) {
+    epochStart = "";
+    eolStr = "";
+  } else {
+    epochStart = "> ";
+    eolStr = "\n";
+  }
+
+  QString ephStr = QString("EPH %1 ").arg(prn.toString().c_str());
+  switch (ephType) {
+    case undefined:
+      ephTypeStr = epochStart + ephStr + "unknown" + eolStr;
+      break;
+    case LNAV:
+      ephTypeStr = epochStart + ephStr + "LNAV" + eolStr;
+      break;
+    case FDMA:
+      ephTypeStr = epochStart + ephStr + "FDMA" + eolStr;
+      break;
+    case FNAV:
+      ephTypeStr = epochStart + ephStr + "FNAV" + eolStr;
+      break;
+    case INAF:
+      ephTypeStr = epochStart + ephStr + "INAV" + eolStr;
+      break;
+    case D1:
+      ephTypeStr = epochStart + ephStr + "D1  " + eolStr;
+      break;
+    case D2:
+      ephTypeStr = epochStart + ephStr + "D2  " + eolStr;
+      break;
+    case SBASL1:
+      ephTypeStr = epochStart + ephStr + "SBAS" + eolStr;
+      break;
+    case CNAV:
+      ephTypeStr = epochStart + ephStr + "CNAV" + eolStr;
+      break;
+    case CNV1:
+      ephTypeStr = epochStart + ephStr + "CNV1" + eolStr;
+      break;
+    case CNV2:
+      ephTypeStr = epochStart + ephStr + "CNV2" + eolStr;
+      break;
+    case CNV3:
+      ephTypeStr = epochStart + ephStr + "CNV3" + eolStr;
+      break;
+    case L1NV:
+      ephTypeStr = epochStart + ephStr + "L1NV" + eolStr;
+      break;
+    case L1OC:
+      ephTypeStr = epochStart + ephStr + "L1OC" + eolStr;
+      break;
+    case L3OC:
+      ephTypeStr = epochStart + ephStr + "L3OC" + eolStr;
+      break;
+  }
+  return ephTypeStr;
+}
 
 //
 //////////////////////////////////////////////////////////////////////////////
-QString t_eph::rinexDateStr(const bncTime& tt, const t_prn& prn, double version) {
+QString t_eph::rinexDateStr(const bncTime &tt, const t_prn &prn,
+    double version) {
   QString prnStr(prn.toString().c_str());
   return rinexDateStr(tt, prnStr, version);
@@ -224,10 +227,11 @@
 //
 //////////////////////////////////////////////////////////////////////////////
-QString t_eph::rinexDateStr(const bncTime& tt, const QString& prnStr, double version) {
+QString t_eph::rinexDateStr(const bncTime &tt, const QString &prnStr,
+    double version) {
 
   QString datStr;
 
   unsigned year, month, day, hour, min;
-  double   sec;
+  double sec;
   tt.civil_date(year, month, day);
   tt.civil_time(hour, min, sec);
@@ -236,30 +240,20 @@
 
   if (version < 3.0) {
-    QString prnHlp = prnStr.mid(1,2); if (prnHlp[0] == '0') prnHlp[0] = ' ';
-    out << prnHlp << 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) {
-    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 {
-    out << prnStr << 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'));
+    QString prnHlp = prnStr.mid(1, 2);
+    if (prnHlp[0] == '0')
+      prnHlp[0] = ' ';
+    out << prnHlp
+        << 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) {
+    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 {
+    out << prnStr
+        << 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'));
   }
 
@@ -269,12 +263,13 @@
 // Constructor
 //////////////////////////////////////////////////////////////////////////////
-t_ephGPS::t_ephGPS(double rnxVersion, const QStringList& lines) {
-
-  int nLines = 8;
-
-  if (navType() == t_eph::CNAV) {
+t_ephGPS::t_ephGPS(double rnxVersion, const QStringList &lines) {
+
+  int nLines = 8; // LNAV,
+
+  if (ephType() == t_eph::CNAV ||
+      ephType() == t_eph::L1NV) {
     nLines += 1;
   }
-  if (navType() == t_eph::CNV2) {
+  if (ephType() == t_eph::CNV2) {
     nLines += 2;
   }
@@ -290,5 +285,5 @@
 
   int pos[4];
-  pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
+  pos[0] = (rnxVersion <= 2.12) ? 3 : 4;
   pos[1] = pos[0] + fieldLen;
   pos[2] = pos[1] + fieldLen;
@@ -300,7 +295,7 @@
     QString line = lines[iLine];
 
-    if      ( iLine == 0 ) {
+    if (iLine == 0) {
       QTextStream in(line.left(pos[1]).toLatin1());
-      int    year, month, day, hour, min;
+      int year, month, day, hour, min;
       double sec;
 
@@ -308,8 +303,6 @@
       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);
@@ -317,21 +310,17 @@
 
       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') {
+      } else if (prnStr.at(0) == 'J') {
         _prn.set('J', prnStr.mid(1).toInt());
-      }
-      else if (prnStr.at(0) == 'I') {
+      } else if (prnStr.at(0) == 'I') {
         _prn.set('I', prnStr.mid(1).toInt());
-      }
-      else {
+      } else {
         _prn.set('G', prnStr.toInt());
       }
 
-      if      (year <  80) {
+      if (year < 80) {
         year += 2000;
-      }
-      else if (year < 100) {
+      } else if (year < 100) {
         year += 1900;
       }
@@ -339,7 +328,7 @@
       _TOC.set(year, month, day, hour, min, sec);
 
-    if   ( readDbl(line, pos[1], fieldLen, _clock_bias     ) ||
-           readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
-           readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
+      if (   readDbl(line, pos[1], fieldLen, _clock_bias)
+          || readDbl(line, pos[2], fieldLen, _clock_drift)
+          || readDbl(line, pos[3], fieldLen, _clock_driftrate)) {
         _checkState = bad;
         return;
@@ -349,21 +338,20 @@
     // BROADCAST ORBIT - 1
     // =====================
-    else if      ( iLine == 1) {
-
-      if (navType() == t_eph::CNAV ||
-          navType() == t_eph::CNV2) {
-        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;
-                }
-      }
-      else { // LNAV, undefined
-        if ( readDbl(line, pos[0], fieldLen, _IODE   ) ||
-             readDbl(line, pos[1], fieldLen, _Crs    ) ||
-             readDbl(line, pos[2], fieldLen, _Delta_n) ||
-             readDbl(line, pos[3], fieldLen, _M0     ) ) {
+    else if (iLine == 1) {
+      if (ephType() == t_eph::CNAV ||
+          ephType() == t_eph::CNV2 ||
+          ephType() == t_eph::L1NV) {
+        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;
+        }
+      } else { // LNAV, undefined
+        if (   readDbl(line, pos[0], fieldLen, _IODE)
+            || readDbl(line, pos[1], fieldLen, _Crs)
+            || readDbl(line, pos[2], fieldLen, _Delta_n)
+            || readDbl(line, pos[3], fieldLen, _M0)) {
           _checkState = bad;
           return;
@@ -374,9 +362,9 @@
     // BROADCAST ORBIT - 2
     // =====================
-    else if ( iLine == 2 ) {
-      if ( readDbl(line, pos[0], fieldLen, _Cuc   ) ||
-           readDbl(line, pos[1], fieldLen, _e     ) ||
-           readDbl(line, pos[2], fieldLen, _Cus   ) ||
-           readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
+    else if (iLine == 2) {
+      if (   readDbl(line, pos[0], fieldLen, _Cuc)
+          || readDbl(line, pos[1], fieldLen, _e)
+          || readDbl(line, pos[2], fieldLen, _Cus)
+          || readDbl(line, pos[3], fieldLen, _sqrt_A)) {
         _checkState = bad;
         return;
@@ -386,21 +374,27 @@
     // BROADCAST ORBIT - 3
     // =====================
-    else if ( iLine == 3 ) {
-
-      if (navType() == t_eph::CNAV ||
-          navType() == t_eph::CNV2) {
-        if ( readDbl(line, pos[0], fieldLen, _top)  ||
-             readDbl(line, pos[1], fieldLen, _Cic   )  ||
-             readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
-             readDbl(line, pos[3], fieldLen, _Cis   ) ) {
-          _checkState = bad;
-          return;
-        }
-      }
-      else { // LNAV, undefined
-        if ( readDbl(line, pos[0], fieldLen, _TOEsec)  ||
-             readDbl(line, pos[1], fieldLen, _Cic   )  ||
-             readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
-             readDbl(line, pos[3], fieldLen, _Cis   ) ) {
+    else if (iLine == 3) {
+      if (ephType() == t_eph::CNAV ||
+          ephType() == t_eph::CNV2) {
+        if (   readDbl(line, pos[0], fieldLen, _top)
+            || readDbl(line, pos[1], fieldLen, _Cic)
+            || readDbl(line, pos[2], fieldLen, _OMEGA0)
+            || readDbl(line, pos[3], fieldLen, _Cis)) {
+          _checkState = bad;
+          return;
+        }
+      } else if (ephType() == t_eph::L1NV) {
+        if (   readDbl(line, pos[0], fieldLen, _IODE)
+            || readDbl(line, pos[1], fieldLen, _Cic)
+            || readDbl(line, pos[2], fieldLen, _OMEGA0)
+            || readDbl(line, pos[3], fieldLen, _Cis)) {
+          _checkState = bad;
+          return;
+        }
+      } else { // LNAV, undefined
+        if (   readDbl(line, pos[0], fieldLen, _TOEsec)
+            || readDbl(line, pos[1], fieldLen, _Cic)
+            || readDbl(line, pos[2], fieldLen, _OMEGA0)
+            || readDbl(line, pos[3], fieldLen, _Cis)) {
           _checkState = bad;
           return;
@@ -411,9 +405,9 @@
     // BROADCAST ORBIT - 4
     // =====================
-    else if ( iLine == 4 ) {
-      if ( readDbl(line, pos[0], fieldLen, _i0      ) ||
-           readDbl(line, pos[1], fieldLen, _Crc     ) ||
-           readDbl(line, pos[2], fieldLen, _omega   ) ||
-           readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
+    else if (iLine == 4) {
+      if (   readDbl(line, pos[0], fieldLen, _i0)
+          || readDbl(line, pos[1], fieldLen, _Crc)
+          || readDbl(line, pos[2], fieldLen, _omega)
+          || readDbl(line, pos[3], fieldLen, _OMEGADOT)) {
         _checkState = bad;
         return;
@@ -423,12 +417,11 @@
     // BROADCAST ORBIT - 5
     // =====================
-    else if ( iLine == 5 && type() != t_eph::IRNSS) {
-
-      if (navType() == t_eph::CNAV ||
-          navType() == t_eph::CNV2) {
-        if ( readDbl(line, pos[0], fieldLen, _IDOT       ) ||
-             readDbl(line, pos[1], fieldLen, _Delta_n_dot) ||
-             readDbl(line, pos[2], fieldLen, _URAI_NED0  ) ||
-             readDbl(line, pos[3], fieldLen, _URAI_NED1) ) {
+    else if (iLine == 5 && type() != t_eph::IRNSS) {
+      if (ephType() == t_eph::CNAV ||
+          ephType() == t_eph::CNV2) {
+        if (   readDbl(line, pos[0], fieldLen, _IDOT)
+            || readDbl(line, pos[1], fieldLen, _Delta_n_dot)
+            || readDbl(line, pos[2], fieldLen, _URAI_NED0)
+            || readDbl(line, pos[3], fieldLen, _URAI_NED1)) {
           _checkState = bad;
           return;
@@ -436,18 +429,28 @@
       }
       else { // LNAV, undefined
-        if ( readDbl(line, pos[0], fieldLen, _IDOT   ) ||
-             readDbl(line, pos[1], fieldLen, _L2Codes) ||
-             readDbl(line, pos[2], fieldLen, _TOEweek) ||
-             readDbl(line, pos[3], fieldLen, _L2PFlag) ) {
-          _checkState = bad;
-          return;
-        }
-      }
-    }
-    else if ( iLine == 5 && type() == t_eph::IRNSS) {
-      if ( readDbl(line, pos[0], fieldLen, _IDOT   ) ||
-           readDbl(line, pos[2], fieldLen, _TOEweek) ) {
-        _checkState = bad;
-        return;
+        if (   readDbl(line, pos[0], fieldLen, _IDOT)
+            || readDbl(line, pos[1], fieldLen, _L2Codes)
+            || readDbl(line, pos[2], fieldLen, _TOEweek)
+            || readDbl(line, pos[3], fieldLen, _L2PFlag)) {
+          _checkState = bad;
+          return;
+        }
+      }
+    } else if (iLine == 5 && type() == t_eph::IRNSS) {
+      if (ephType() == t_eph::LNAV ||
+          ephType() == t_eph::undefined) {
+        if (   readDbl(line, pos[0], fieldLen, _IDOT)
+            || readDbl(line, pos[2], fieldLen, _TOEweek)) {
+          _checkState = bad;
+          return;
+        }
+      }
+      else if (ephType() == t_eph::L1NV) {
+        if (   readDbl(line, pos[0], fieldLen, _IDOT)
+            || readDbl(line, pos[1], fieldLen, _Delta_n_dot)
+            || readDbl(line, pos[3], fieldLen, _RSF)) {
+          _checkState = bad;
+          return;
+        }
       }
     }
@@ -455,32 +458,44 @@
     // BROADCAST ORBIT - 6
     // =====================
-    else if ( iLine == 6 && type() != t_eph::IRNSS) {
-
-      if (navType() == t_eph::CNAV ||
-          navType() == t_eph::CNV2  ) {
-        if ( readDbl(line, pos[0], fieldLen, _URAI_ED) ||
-             readDbl(line, pos[1], fieldLen, _health ) ||
-             readDbl(line, pos[2], fieldLen, _TGD    ) ||
-             readDbl(line, pos[3], fieldLen, _URAI_NED2) ) {
-          _checkState = bad;
-          return;
-        }
-      }
-      else { // LNAV, undefined
-        if ( readDbl(line, pos[0], fieldLen, _ura   ) ||
-             readDbl(line, pos[1], fieldLen, _health) ||
-             readDbl(line, pos[2], fieldLen, _TGD   ) ||
-             readDbl(line, pos[3], fieldLen, _IODC  ) ) {
-          _checkState = bad;
-          return;
-        }
-      }
-    }
-    else if ( iLine == 6 && type() == t_eph::IRNSS) {
-      if ( readDbl(line, pos[0], fieldLen, _ura   ) ||
-           readDbl(line, pos[1], fieldLen, _health) ||
-           readDbl(line, pos[2], fieldLen, _TGD   ) ) {
-        _checkState = bad;
-        return;
+    else if (iLine == 6 && type() != t_eph::IRNSS) {
+      if (ephType() == t_eph::CNAV ||
+          ephType() == t_eph::CNV2) {
+        if (   readDbl(line, pos[0], fieldLen, _URAI_ED)
+            || readDbl(line, pos[1], fieldLen, _health)
+            || readDbl(line, pos[2], fieldLen, _TGD)
+            || readDbl(line, pos[3], fieldLen, _URAI_NED2)) {
+          _checkState = bad;
+          return;
+        }
+      } else { // LNAV, undefined
+        if (   readDbl(line, pos[0], fieldLen, _ura)
+            || readDbl(line, pos[1], fieldLen, _health)
+            || readDbl(line, pos[2], fieldLen, _TGD)
+            || readDbl(line, pos[3], fieldLen, _IODC)) {
+          _checkState = bad;
+          return;
+        }
+      }
+    }
+    else if (iLine == 6 && type() == t_eph::IRNSS) {
+      if (ephType() == t_eph::LNAV ||
+          ephType() == t_eph::undefined) {
+        if (   readDbl(line, pos[0], fieldLen, _ura)
+            || readDbl(line, pos[1], fieldLen, _health)
+            || readDbl(line, pos[2], fieldLen, _TGD)) {
+          _checkState = bad;
+          return;
+        }
+      }
+      else if (ephType() == t_eph::L1NV) {
+        int i = 0;
+        (!_RSF) ? i = 2 : i = 3;
+        if (   readDbl(line, pos[0], fieldLen, _URAI)
+            || readDbl(line, pos[1], fieldLen, _health)
+            || readDbl(line, pos[i], fieldLen, _TGD)) {
+          _checkState = bad;
+          return;
+        }
+        _ura = accuracyFromIndex(int(_URAI), type());
       }
     }
@@ -488,58 +503,85 @@
     // BROADCAST ORBIT - 7
     // =====================
-    else if ( iLine == 7 ) {
-      if (navType() == t_eph::LNAV ||
-          navType() == t_eph::undefined) {
-
-        if ( readDbl(line, pos[0], fieldLen, _TOT) ) {
-          _checkState = bad;
-          return;
-        }
-
-        if (type() != t_eph::IRNSS) {
-          double fitIntervalRnx;
-          if ( readDbl(line, pos[1], fieldLen, fitIntervalRnx) ) {
+    else if (iLine == 7) {
+      if (ephType() == t_eph::LNAV ||
+          ephType() == t_eph::undefined) {
+        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
+              _fitInterval = fitIntervalRnx;
+            }
+            else if (type() == t_eph::QZSS) { // specified as flag for QZSS
+              if (rnxVersion == 3.02) {
+                _fitInterval = fitIntervalRnx; // specified as time period
+              } else {
+                _fitInterval = fitIntervalFromFlag(fitIntervalRnx, _IODC, t_eph::QZSS);
+              }
+            }
+          }
+        }
+      }
+      else if (ephType() == t_eph::CNAV ||
+               ephType() == t_eph::CNV2) {
+        if (   readDbl(line, pos[0], fieldLen, _ISC_L1CA)
+            || readDbl(line, pos[1], fieldLen, _ISC_L2C)
+            || readDbl(line, pos[2], fieldLen, _ISC_L5I5)
+            || readDbl(line, pos[3], fieldLen, _ISC_L5Q5)) {
+          _checkState = bad;
+          return;
+        }
+      }
+      else if (ephType() == t_eph::L1NV) {
+        if (!_RSF) {
+          if (   readDbl(line, pos[0], fieldLen, _ISC_S)
+              || readDbl(line, pos[1], fieldLen, _ISC_L1D)) {
             _checkState = bad;
             return;
           }
-          if        (type() == 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
-            if (rnxVersion == 3.02) {
-              _fitInterval = fitIntervalRnx; // specified as time period
-            }
-            else {
-              _fitInterval = fitIntervalFromFlag(fitIntervalRnx, _IODC, t_eph::QZSS);
-            }
+        } else {
+          if (   readDbl(line, pos[2], fieldLen, _ISC_L1P)
+              || readDbl(line, pos[3], fieldLen, _ISC_L1D)) {
+            _checkState = bad;
+            return;
           }
         }
       }
-
-      else if (navType() == t_eph::CNAV ||
-               navType() == t_eph::CNV2) {
-        if ( readDbl(line, pos[0], fieldLen, _ISC_L1CA) ||
-             readDbl(line, pos[1], fieldLen, _ISC_L2C ) ||
-             readDbl(line, pos[2], fieldLen, _ISC_L5I5) ||
-             readDbl(line, pos[3], fieldLen, _ISC_L5Q5) ) {
-          _checkState = bad;
-          return;
-        }
-      }
-
     }
     // =====================
     // BROADCAST ORBIT - 8
     // =====================
-    else if ( iLine == 8 ) {
-      if (navType() == t_eph::CNAV) {
-        if ( readDbl(line, pos[0], fieldLen, _TOT) ||
-             readDbl(line, pos[1], fieldLen, _wnop) ) {
-          _checkState = bad;
-          return;
-        }
-      }
-      else if (navType() == t_eph::CNV2) {
-        if ( readDbl(line, pos[0], fieldLen, _ISC_L1Cd) ||
-             readDbl(line, pos[1], fieldLen, _ISC_L1Cp)) {
+    else if (iLine == 8) {
+      if (ephType() == t_eph::CNAV) {
+        double intFlags = -1.0; // optional; blank if not provided
+        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) {
+          // Bit 0:
+          _intSF      = (int(intFlags) & (1 << 0));
+          // Bit 1:
+          _L2Cphasing = (int(intFlags) & (1 << 1));
+          // Bit 2:
+          _alert      = (int(intFlags) & (1 << 2));
+        }
+      }
+      else if (ephType() == t_eph::CNV2) {
+        if (   readDbl(line, pos[0], fieldLen, _ISC_L1Cd)
+            || readDbl(line, pos[1], fieldLen, _ISC_L1Cp)) {
+          _checkState = bad;
+          return;
+        }
+      }
+      else if (ephType() == t_eph::L1NV) {
+        if (   readDbl(line, pos[0], fieldLen, _TOT)) {
           _checkState = bad;
           return;
@@ -550,10 +592,20 @@
     // BROADCAST ORBIT - 9
     // =====================
-    else if ( iLine == 9 ) {
-      if (navType() == t_eph::CNV2) {
-        if ( readDbl(line, pos[0], fieldLen, _TOT) ||
-             readDbl(line, pos[1], fieldLen, _wnop) ) {
-          _checkState = bad;
-          return;
+    else if (iLine == 9) {
+      if (ephType() == t_eph::CNV2) {
+        double intFlags = -1.0;
+        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) {
+          // Bit 0:
+          _intSF = (int(intFlags) & (1 << 0));
+          if (type() == t_eph::QZSS) {
+            // Bit 1:
+            _ephSF = (int(intFlags) & (1 << 1));
+          }
         }
       }
@@ -564,11 +616,12 @@
 // Compute GPS Satellite Position (virtual)
 ////////////////////////////////////////////////////////////////////////////
-t_irc t_ephGPS::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
+t_irc t_ephGPS::position(int GPSweek, double GPSweeks, double *xc,
+    double *vv) const {
 
   static const double omegaEarth = 7292115.1467e-11;
-  static const double gmGRS      = 398.6005e12;
-
-  memset(xc, 0, 6*sizeof(double));
-  memset(vv, 0, 3*sizeof(double));
+  static const double gmGRS = 398.6005e12;
+
+  memset(xc, 0, 6 * sizeof(double));
+  memset(vv, 0, 3 * sizeof(double));
 
   double a0 = _sqrt_A * _sqrt_A;
@@ -577,74 +630,72 @@
   }
 
-  double n0 = sqrt(gmGRS/(a0*a0*a0));
+  double n0 = sqrt(gmGRS / (a0 * a0 * a0));
 
   bncTime tt(GPSweek, GPSweeks);
   double tk = tt - bncTime(int(_TOEweek), _TOEsec);
 
-  double n  = n0 + _Delta_n;
-  double M  = _M0 + n*tk;
-  double E  = M;
+  double n = n0 + _Delta_n;
+  double M = _M0 + n * tk;
+  double E = M;
   double E_last;
-  int    nLoop = 0;
+  int nLoop = 0;
   do {
     E_last = E;
-    E = M + _e*sin(E);
+    E = M + _e * sin(E);
 
     if (++nLoop == 100) {
       return failure;
     }
-  } while ( fabs(E-E_last)*a0 > 0.001);
-  double v      = 2.0*atan( sqrt( (1.0 + _e)/(1.0 - _e) )*tan( E/2 ) );
-  double u0     = v + _omega;
-  double sin2u0 = sin(2*u0);
-  double cos2u0 = cos(2*u0);
-  double r      = a0*(1 - _e*cos(E)) + _Crc*cos2u0 + _Crs*sin2u0;
-  double i      = _i0 + _IDOT*tk + _Cic*cos2u0 + _Cis*sin2u0;
-  double u      = u0 + _Cuc*cos2u0 + _Cus*sin2u0;
-  double xp     = r*cos(u);
-  double yp     = r*sin(u);
-  double OM     = _OMEGA0 + (_OMEGADOT - omegaEarth)*tk -
-                   omegaEarth*_TOEsec;
+  } while (fabs(E - E_last) * a0 > 0.001);
+  double v = 2.0 * atan(sqrt((1.0 + _e) / (1.0 - _e)) * tan(E / 2));
+  double u0 = v + _omega;
+  double sin2u0 = sin(2 * u0);
+  double cos2u0 = cos(2 * u0);
+  double r = a0 * (1 - _e * cos(E)) + _Crc * cos2u0 + _Crs * sin2u0;
+  double i = _i0 + _IDOT * tk + _Cic * cos2u0 + _Cis * sin2u0;
+  double u = u0 + _Cuc * cos2u0 + _Cus * sin2u0;
+  double xp = r * cos(u);
+  double yp = r * sin(u);
+  double OM = _OMEGA0 + (_OMEGADOT - omegaEarth) * tk - omegaEarth * _TOEsec;
 
   double sinom = sin(OM);
   double cosom = cos(OM);
-  double sini  = sin(i);
-  double cosi  = cos(i);
-  xc[0] = xp*cosom - yp*cosi*sinom;
-  xc[1] = xp*sinom + yp*cosi*cosom;
-  xc[2] = yp*sini;
+  double sini = sin(i);
+  double cosi = cos(i);
+  xc[0] = xp * cosom - yp * cosi * sinom;
+  xc[1] = xp * sinom + yp * cosi * cosom;
+  xc[2] = yp * sini;
 
   double tc = tt - _TOC;
-  xc[3] = _clock_bias + _clock_drift*tc + _clock_driftrate*tc*tc;
+  xc[3] = _clock_bias + _clock_drift * tc + _clock_driftrate * tc * tc;
 
   // Velocity
   // --------
-  double tanv2 = tan(v/2);
-  double dEdM  = 1 / (1 - _e*cos(E));
-  double dotv  = sqrt((1.0 + _e)/(1.0 - _e)) / cos(E/2)/cos(E/2) / (1 + tanv2*tanv2)
-               * dEdM * n;
-  double dotu  = dotv + (-_Cuc*sin2u0 + _Cus*cos2u0)*2*dotv;
+  double tanv2 = tan(v / 2);
+  double dEdM = 1 / (1 - _e * cos(E));
+  double dotv = sqrt((1.0 + _e) / (1.0 - _e)) / cos(E / 2) / cos(E / 2)
+      / (1 + tanv2 * tanv2) * dEdM * n;
+  double dotu = dotv + (-_Cuc * sin2u0 + _Cus * cos2u0) * 2 * dotv;
   double dotom = _OMEGADOT - omegaEarth;
-  double doti  = _IDOT + (-_Cic*sin2u0 + _Cis*cos2u0)*2*dotv;
-  double dotr  = a0 * _e*sin(E) * dEdM * n
-                + (-_Crc*sin2u0 + _Crs*cos2u0)*2*dotv;
-  double dotx  = dotr*cos(u) - r*sin(u)*dotu;
-  double doty  = dotr*sin(u) + r*cos(u)*dotu;
-
-  vv[0]  = cosom   *dotx  - cosi*sinom   *doty      // dX / dr
-           - xp*sinom*dotom - yp*cosi*cosom*dotom   // dX / dOMEGA
-                       + yp*sini*sinom*doti;        // dX / di
-
-  vv[1]  = sinom   *dotx  + cosi*cosom   *doty
-           + xp*cosom*dotom - yp*cosi*sinom*dotom
-                          - yp*sini*cosom*doti;
-
-  vv[2]  = sini    *doty  + yp*cosi      *doti;
+  double doti = _IDOT + (-_Cic * sin2u0 + _Cis * cos2u0) * 2 * dotv;
+  double dotr = a0 * _e * sin(E) * dEdM * n
+      + (-_Crc * sin2u0 + _Crs * cos2u0) * 2 * dotv;
+  double dotx = dotr * cos(u) - r * sin(u) * dotu;
+  double doty = dotr * sin(u) + r * cos(u) * dotu;
+
+  vv[0] = cosom * dotx - cosi * sinom * doty      // dX / dr
+  - xp * sinom * dotom - yp * cosi * cosom * dotom   // dX / dOMEGA
+  + yp * sini * sinom * doti;        // dX / di
+
+  vv[1] = sinom * dotx + cosi * cosom * doty + xp * cosom * dotom
+      - yp * cosi * sinom * dotom - yp * sini * cosom * doti;
+
+  vv[2] = sini * doty + yp * cosi * doti;
 
   // Relativistic Correction
   // -----------------------
-  xc[3] -= 4.442807633e-10 * _e * sqrt(a0) *sin(E);
-
-  xc[4] = _clock_drift + _clock_driftrate*tc;
+  xc[3] -= 4.442807633e-10 * _e * sqrt(a0) * sin(E);
+
+  xc[4] = _clock_drift + _clock_driftrate * tc;
   xc[5] = _clock_driftrate;
 
@@ -656,49 +707,53 @@
 QString t_ephGPS::toString(double version) const {
 
-  QString navStr = navTypeString(_navType, _prn, version);
-  QString rnxStr = navStr + rinexDateStr(_TOC, _prn, version);
+  QString ephStr = ephTypeStr(_ephType, _prn, version);
+  QString rnxStr = ephStr + rinexDateStr(_TOC, _prn, version);
 
   QTextStream out(&rnxStr);
 
-  out << QString("%1%2%3\n")
-    .arg(_clock_bias,      19, 'e', 12)
-    .arg(_clock_drift,     19, 'e', 12)
-    .arg(_clock_driftrate, 19, 'e', 12);
+  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 fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
 
-
   // =====================
   // BROADCAST ORBIT - 1
   // =====================
-  if (navType() == t_eph::CNAV ||
-      navType() == t_eph::CNV2) {
-    out << QString(fmt)
-      .arg(_ADOT,    19, 'e', 12)
-      .arg(_Crs,     19, 'e', 12)
-      .arg(_Delta_n, 19, 'e', 12)
-      .arg(_M0,      19, 'e', 12);
-  }
-  else { // LNAV, undefinded
-    out << QString(fmt)
-      .arg(_IODE,    19, 'e', 12)
-      .arg(_Crs,     19, 'e', 12)
-      .arg(_Delta_n, 19, 'e', 12)
-      .arg(_M0,      19, 'e', 12);
+  if (ephType() == t_eph::CNAV ||
+      ephType() == t_eph::CNV2 ||
+      ephType() == t_eph::L1NV) {
+    out
+        << QString(fmt)
+        .arg(_ADOT,    19, 'e', 12)
+        .arg(_Crs,     19, 'e', 12)
+        .arg(_Delta_n, 19, 'e', 12)
+        .arg(_M0,      19, 'e', 12);
+  } else { // LNAV, undefined
+    out
+        << QString(fmt)
+        .arg(_IODE,    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);
+  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
   // =====================
-  if (navType() == t_eph::CNAV ||
-      navType() == t_eph::CNV2) {
-    out << QString(fmt)
+  if (ephType() == t_eph::CNAV ||
+      ephType() == t_eph::CNV2) {
+    out
+        << QString(fmt)
         .arg(_top,    19, 'e', 12)
         .arg(_Cic,    19, 'e', 12)
@@ -706,6 +761,15 @@
         .arg(_Cis,    19, 'e', 12);
   }
-  else {
-    out << QString(fmt)
+  else if (ephType() == t_eph::L1NV) {
+    out
+        << QString(fmt)
+        .arg(_IODE,   19, 'e', 12)
+        .arg(_Cic,    19, 'e', 12)
+        .arg(_OMEGA0, 19, 'e', 12)
+        .arg(_Cis,    19, 'e', 12);
+  }
+  else { // LNAV, undefined
+    out
+        << QString(fmt)
         .arg(_TOEsec, 19, 'e', 12)
         .arg(_Cic,    19, 'e', 12)
@@ -716,64 +780,100 @@
   // 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);
+  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
   // =====================
-  if (type() == t_eph::IRNSS) {
-    out << QString(fmt)
+  if (type() != t_eph::IRNSS) {
+    if (ephType() == t_eph::CNAV ||
+        ephType() == t_eph::CNV2) {
+      out
+          << QString(fmt)
+          .arg(_IDOT,        19, 'e', 12)
+          .arg(_Delta_n_dot, 19, 'e', 12)
+          .arg(_URAI_NED0,   19, 'e', 12)
+          .arg(_URAI_NED1,   19, 'e', 12);
+    }
+    else { // LNAV, undefined
+      out
+          << QString(fmt)
+          .arg(_IDOT,    19, 'e', 12)
+          .arg(_L2Codes, 19, 'e', 12)
+          .arg(_TOEweek, 19, 'e', 12)
+          .arg(_L2PFlag, 19, 'e', 12);
+    }
+  }
+  else {
+    if (ephType() == t_eph::LNAV ||
+        ephType() == t_eph::undefined) {
+      out
+      << QString(fmt)
       .arg(_IDOT,    19, 'e', 12)
-      .arg(0.0,      19, 'e', 12)
+      .arg("",       19, QChar(' '))
       .arg(_TOEweek, 19, 'e', 12)
-      .arg(0.0,      19, 'e', 12);
+      .arg("",       19, QChar(' '));
+    }
+    else if (ephType() == t_eph::L1NV) {
+      out
+      << QString(fmt)
+      .arg(_IDOT,        19, 'e', 12)
+      .arg(_Delta_n_dot, 19, 'e', 12)
+      .arg("",           19, QChar(' '))
+      .arg(_RSF,         19, 'e', 12);
+    }
+  }
+  // =====================
+  // BROADCAST ORBIT - 6
+  // =====================
+  if (type() != t_eph::IRNSS) {
+    if (ephType() == t_eph::CNAV ||
+        ephType() == t_eph::CNV2) {
+      out
+          << QString(fmt)
+          .arg(_URAI_ED,   19, 'e', 12)
+          .arg(_health,    19, 'e', 12)
+          .arg(_TGD,       19, 'e', 12)
+          .arg(_URAI_NED2, 19, 'e', 12);
+    }
+    else { // LNAV, undefined
+      out
+          << QString(fmt)
+          .arg(_ura,    19, 'e', 12)
+          .arg(_health, 19, 'e', 12)
+          .arg(_TGD,    19, 'e', 12)
+          .arg(_IODC,   19, 'e', 12);
+    }
   }
   else {
-    if (navType() == t_eph::CNAV ||
-        navType() == t_eph::CNV2) {
-      out << QString(fmt)
-        .arg(_IDOT,        19, 'e', 12)
-        .arg(_Delta_n_dot, 19, 'e', 12)
-        .arg(_URAI_NED0,   19, 'e', 12)
-        .arg(_URAI_NED1,   19, 'e', 12);
-
-    }
-    else { // LNAV, undefined
-      out << QString(fmt)
-        .arg(_IDOT,    19, 'e', 12)
-        .arg(_L2Codes, 19, 'e', 12)
-        .arg(_TOEweek, 19, 'e', 12)
-        .arg(_L2PFlag, 19, 'e', 12);
-
-    }
-  }
-  // =====================
-  // BROADCAST ORBIT - 6
-  // =====================
-  if (type() == t_eph::IRNSS) {
-    out << QString(fmt)
-      .arg(_ura,    19, 'e', 12)
-      .arg(_health, 19, 'e', 12)
-      .arg(_TGD,    19, 'e', 12)
-      .arg(0.0,     19, 'e', 12);
-  }
-  else {
-    if (navType() == t_eph::CNAV ||
-        navType() == t_eph::CNV2) {
-      out << QString(fmt)
-        .arg(_URAI_ED,  19, 'e', 12)
-        .arg(_health,   19, 'e', 12)
-        .arg(_TGD,      19, 'e', 12)
-        .arg(_URAI_NED2,19, 'e', 12);
-
-    }
-    else { // LNAV, undefined
-      out << QString(fmt)
-        .arg(_ura,    19, 'e', 12)
-        .arg(_health, 19, 'e', 12)
-        .arg(_TGD,    19, 'e', 12)
-        .arg(_IODC,   19, 'e', 12);
+    if (ephType() == t_eph::LNAV ||
+        ephType() == t_eph::undefined) {
+      out
+          << QString(fmt)
+          .arg(_ura,    19, 'e', 12)
+          .arg(_health, 19, 'e', 12)
+          .arg(_TGD,    19, 'e', 12);
+    }
+    else if (ephType() == t_eph::L1NV) {
+      int i = 0; (!_RSF) ? i = 2 : i = 3;
+      if (i == 2) {
+        out
+            << QString(fmt)
+            .arg(_URAI,   19, 'e', 12)
+            .arg(_health, 19, 'e', 12)
+            .arg(_TGD,    19, 'e', 12)
+            .arg("",  19, QChar(' '));
+      }
+      else {
+        out
+            << QString(fmt)
+            .arg(_URAI,   19, 'e', 12)
+            .arg(_health, 19, 'e', 12)
+            .arg("",      19, QChar(' '))
+            .arg(_TGD,    19, 'e', 12);
+      }
     }
   }
@@ -781,6 +881,16 @@
   // BROADCAST ORBIT - 7
   // =====================
-  if (navType() == t_eph::LNAV ||
-      navType() == t_eph::undefined) {
+  /*
+      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) {
 
     double tot = _TOT;
@@ -789,10 +899,11 @@
     }
     // fitInterval
-    if (type() == t_eph::IRNSS) {// not valid for IRNSS
-      out << QString(fmt)
-        .arg(tot,          19, 'e', 12)
-        .arg(0.0,          19, 'e', 12)
-        .arg("",           19, QChar(' '))
-        .arg("",           19, QChar(' '));
+    if (type() == t_eph::IRNSS) {
+      out
+          << QString(fmt)
+          .arg(tot, 19, 'e', 12)
+          .arg("",  19, QChar(' '))
+          .arg("",  19, QChar(' '))
+          .arg("",  19, QChar(' '));
     }
     else {
@@ -803,46 +914,102 @@
         (_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 (navType() == t_eph::CNAV ||
-           navType() == t_eph::CNV2) {
-    out << QString(fmt)
-      .arg(_ISC_L1CA, 19, 'e', 12)
-      .arg(_ISC_L2C,  19, 'e', 12)
-      .arg(_ISC_L5I5, 19, 'e', 12)
-      .arg(_ISC_L5Q5, 19, 'e', 12);
+      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) {
+    out
+        << QString(fmt)
+        .arg(_ISC_L1CA, 19, 'e', 12)
+        .arg(_ISC_L2C,  19, 'e', 12)
+        .arg(_ISC_L5I5, 19, 'e', 12)
+        .arg(_ISC_L5Q5, 19, 'e', 12);
+  }
+  else if (ephType() == t_eph::L1NV) {
+    if (_RSF) {
+      out
+          << QString(fmt)
+          .arg(_ISC_S,   19, 'e', 12)
+          .arg(_ISC_L1D, 19, 'e', 12)
+          .arg("",       19, QChar(' '))
+          .arg("",       19, QChar(' '));
+    }
+    else {
+      out
+          << QString(fmt)
+          .arg("",       19, QChar(' '))
+          .arg("",       19, QChar(' '))
+          .arg(_ISC_L1P, 19, 'e', 12)
+          .arg(_ISC_L1D, 19, 'e', 12);
+    }
   }
   // =====================
   // BROADCAST ORBIT - 8
   // =====================
-  if (navType() == t_eph::CNAV) {
-    out << QString(fmt)
-      .arg(_TOT,  19, 'e', 12)
-      .arg(_wnop, 19, 'e', 12)
-      .arg("",    19, QChar(' '))
-      .arg("",    19, QChar(' '));
-  }
-  else if (navType() == t_eph::CNV2) {
-    out << QString(fmt)
-      .arg(_ISC_L1Cd, 19, 'e', 12)
-      .arg(_ISC_L1Cp, 19, 'e', 12)
-      .arg("",        19, QChar(' '))
-      .arg("",        19, QChar(' '));
-  }
-
+  if (ephType() == t_eph::CNAV) {
+    double intFlags;
+    if (_intSF !=-1 ) {
+      intFlags |= (1 << 0);
+      intFlags |= (1 << 1);
+      intFlags |= (1 << 2);
+      out
+          << QString(fmt)
+          .arg(_TOT,  19, 'e', 12)
+          .arg(_wnop, 19, 'e', 12)
+          .arg(intFlags, 19, 'e', 12)
+          .arg("",    19, QChar(' '));
+    }
+    else {
+      out
+          << QString(fmt)
+          .arg(_TOT,  19, 'e', 12)
+          .arg(_wnop, 19, 'e', 12)
+          .arg("",    19, QChar(' '))
+          .arg("",    19, QChar(' '));
+    }
+  }
+  else if (ephType() == t_eph::CNV2) {
+    out
+        << QString(fmt)
+        .arg(_ISC_L1Cd, 19, 'e', 12)
+        .arg(_ISC_L1Cp, 19, 'e', 12)
+        .arg("", 19, QChar(' '))
+        .arg("", 19, QChar(' '));
+  }
+  else if (ephType() == t_eph::L1NV) {
+    out
+        << QString(fmt)
+        .arg(_TOT, 19, 'e', 12)
+        .arg("",   19, QChar(' '))
+        .arg("",   19, QChar(' '))
+        .arg("",   19, QChar(' '));
+  }
   // =====================
   // BROADCAST ORBIT - 9
   // =====================
-  if (navType() == t_eph::CNV2) {
-    out << QString(fmt)
-      .arg(_TOT,  19, 'e', 12)
-      .arg(_wnop, 19, 'e', 12)
-      .arg("",    19, QChar(' '))
-      .arg("",    19, QChar(' '));
+  if (ephType() == t_eph::CNV2) {
+    double intFlags;
+    if (_intSF !=-1 ) {
+      intFlags |= (1 << 0);
+      out
+          << QString(fmt)
+          .arg(_TOT,     19, 'e', 12)
+          .arg(_wnop,    19, 'e', 12)
+          .arg(intFlags, 19, 'e', 12)
+          .arg("",       19, QChar(' '));
+    }
+    else {
+      out
+          << QString(fmt)
+          .arg(_TOT, 19, 'e', 12)
+          .arg(_wnop, 19, 'e', 12)
+          .arg("",    19, QChar(' '))
+          .arg("",    19, QChar(' '));
+    }
   }
 
@@ -852,11 +1019,10 @@
 // Constructor
 //////////////////////////////////////////////////////////////////////////////
-t_ephGlo::t_ephGlo(double rnxVersion, const QStringList& lines) {
+t_ephGlo::t_ephGlo(double rnxVersion, const QStringList &lines) {
 
   int nLines = 4;
   if (rnxVersion >= 3.05) {
     nLines += 1;
-  }
-  else {
+  } else {
     _M_delta_tau = 0.9999e9; // unknown
     _M_FT = 1.5e1;           // unknown
@@ -875,5 +1041,5 @@
 
   int pos[4];
-  pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
+  pos[0] = (rnxVersion <= 2.12) ? 3 : 4;
   pos[1] = pos[0] + fieldLen;
   pos[2] = pos[1] + fieldLen;
@@ -885,8 +1051,8 @@
     QString line = lines[iLine];
 
-    if      ( iLine == 0 ) {
+    if (iLine == 0) {
       QTextStream in(line.left(pos[1]).toLatin1());
 
-      int    year, month, day, hour, min;
+      int year, month, day, hour, min;
       double sec;
 
@@ -900,13 +1066,11 @@
       if (prnStr.at(0) == 'R') {
         _prn.set('R', prnStr.mid(1).toInt());
-      }
-      else {
+      } else {
         _prn.set('R', prnStr.toInt());
       }
 
-      if      (year <  80) {
+      if (year < 80) {
         year += 2000;
-      }
-      else if (year < 100) {
+      } else if (year < 100) {
         year += 1900;
       }
@@ -915,23 +1079,23 @@
 
       _TOC.set(year, month, day, hour, min, sec);
-      _TOC  = _TOC + _gps_utc;
-      int nd = int((_TOC.gpssec())) / (24.0*60.0*60.0);
-      if ( readDbl(line, pos[1], fieldLen, _tau  ) ||
-           readDbl(line, pos[2], fieldLen, _gamma) ||
-           readDbl(line, pos[3], fieldLen, _tki  ) ) {
+      _TOC = _TOC + _gps_utc;
+      int nd = int((_TOC.gpssec())) / (24.0 * 60.0 * 60.0);
+      if (readDbl(line, pos[1], fieldLen, _tau)
+          || readDbl(line, pos[2], fieldLen, _gamma)
+          || readDbl(line, pos[3], fieldLen, _tki)) {
         _checkState = bad;
         return;
       }
       _tki -= nd * 86400.0;
-      _tau  = -_tau;
+      _tau = -_tau;
     }
     // =====================
     // BROADCAST ORBIT - 1
     // =====================
-    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) ||
-           readDbl(line, pos[3], fieldLen, _health        ) ) {
+    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)
+          || readDbl(line, pos[3], fieldLen, _health)) {
         _checkState = bad;
         return;
@@ -941,9 +1105,9 @@
     // BROADCAST ORBIT - 2
     // =====================
-    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) ) {
+    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;
@@ -953,9 +1117,9 @@
     // BROADCAST ORBIT - 3
     // =====================
-    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             ) ) {
+    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;
@@ -965,41 +1129,39 @@
     // BROADCAST ORBIT - 4
     // =====================
-    else if ( iLine == 4 ) {
-      if (readDbl(line, pos[0], fieldLen, statusflags    ) ) {
+    else if (iLine == 4) {
+      if (readDbl(line, pos[0], fieldLen, statusflags)) {
         //statusflags BLK, do nothing
         _flags_unknown = true;
-      }
-      else {
+      } else {
         _flags_unknown = false;
         // status flags
         // ============
         // bit 0-1
-        _M_P  = double(bitExtracted(statusflags, 2, 0));
+        _M_P = double(bitExtracted(statusflags, 2, 0));
         // bit 2-3
-        _P1   = double(bitExtracted(statusflags, 2, 2));
+        _P1 = double(bitExtracted(statusflags, 2, 2));
         // bit 4
-        _P2   = double(bitExtracted(statusflags, 1, 4));
+        _P2 = double(bitExtracted(statusflags, 1, 4));
         // bit 5
-        _P3   = double(bitExtracted(statusflags, 1, 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));
+        _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          ) ) {
+          _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    ) ) {
+      if (readDbl(line, pos[3], fieldLen, healthflags)) {
         // healthflags BLK
         _flags_unknown = true;
-      }
-      else {
+      } else {
         _flags_unknown = false;
         // health flags
@@ -1008,5 +1170,6 @@
         _almanac_health = double(bitExtracted(healthflags, 1, 0));
         // bit 1
-        _almanac_health_availablility_indicator = double(bitExtracted(healthflags, 1, 1));
+        _almanac_health_availablility_indicator = double(
+            bitExtracted(healthflags, 1, 1));
         //  bit 2
         _M_l3 = double(bitExtracted(healthflags, 1, 2));
@@ -1018,5 +1181,6 @@
   // ------------------------
   _tt = _TOC;
-  _xv.ReSize(6); _xv = 0.0;
+  _xv.ReSize(6);
+  _xv = 0.0;
   _xv(1) = _x_pos * 1.e3;
   _xv(2) = _y_pos * 1.e3;
@@ -1029,10 +1193,11 @@
 // Compute Glonass Satellite Position (virtual)
 ////////////////////////////////////////////////////////////////////////////
-t_irc t_ephGlo::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
+t_irc t_ephGlo::position(int GPSweek, double GPSweeks, double *xc,
+    double *vv) const {
 
   static const double nominalStep = 10.0;
 
-  memset(xc, 0, 6*sizeof(double));
-  memset(vv, 0, 3*sizeof(double));
+  memset(xc, 0, 6 * sizeof(double));
+  memset(vv, 0, 3 * sizeof(double));
 
   double dtPos = bncTime(GPSweek, GPSweeks) - _tt;
@@ -1042,5 +1207,5 @@
   }
 
-  int nSteps  = int(fabs(dtPos) / nominalStep) + 1;
+  int nSteps = int(fabs(dtPos) / nominalStep) + 1;
   double step = dtPos / nSteps;
 
@@ -1080,13 +1245,12 @@
 QString t_ephGlo::toString(double version) const {
 
-  QString navStr = navTypeString(_navType, _prn, version);
-  QString rnxStr = navStr + rinexDateStr(_TOC -_gps_utc, _prn, version);
-  int nd = int((_TOC - _gps_utc).gpssec()) / (24.0*60.0*60.0);
+  QString ephStr = ephTypeStr(_ephType, _prn, version);
+  QString rnxStr = ephStr + rinexDateStr(_TOC - _gps_utc, _prn, version);
+  int nd = int((_TOC - _gps_utc).gpssec()) / (24.0 * 60.0 * 60.0);
   QTextStream out(&rnxStr);
 
-  out << QString("%1%2%3\n")
-    .arg(-_tau,           19, 'e', 12)
-    .arg(_gamma,          19, 'e', 12)
-    .arg(_tki+nd*86400.0, 19, 'e', 12);
+  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 fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
@@ -1094,25 +1258,19 @@
   // BROADCAST ORBIT - 1
   // =====================
-  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);
+  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);
   // =====================
   // 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);
+  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);
   // =====================
   // 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);
+  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
@@ -1121,49 +1279,43 @@
     // unknown (RINEX version < 3.05)
     if (_flags_unknown) {
-      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 {
+      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);
+        statusflags |= (1 << 7);
       }
       // bit 6
       if (_M_P4) {
-        statusflags |= (1<<6);
+        statusflags |= (1 << 6);
       }
       // bit 5
       if (_P3) {
-        statusflags |= (1<<5);
+        statusflags |= (1 << 5);
       }
       // bit 4
       if (_P2) {
-        statusflags |= (1<<4);
+        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);
+      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);
+      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
@@ -1172,19 +1324,18 @@
       // bit 0 (is to be ignored, if bit 1 is zero)
       if (_almanac_health) {
-        healthflags |= (1<<0);
+        healthflags |= (1 << 0);
       }
       // bit 1
       if (_almanac_health_availablility_indicator) {
-        healthflags |= (1<<1);
+        healthflags |= (1 << 1);
       }
       //  bit 2
       if (_M_l3) {
-        healthflags |= (1<<2);
-      }
-      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);
+        healthflags |= (1 << 2);
+      }
+      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);
     }
   }
@@ -1195,25 +1346,26 @@
 // Derivative of the state vector using a simple force model (static)
 ////////////////////////////////////////////////////////////////////////////
-ColumnVector t_ephGlo::glo_deriv(double /* tt */, const ColumnVector& xv,
-                                 double* acc) {
+ColumnVector t_ephGlo::glo_deriv(double /* tt */, const ColumnVector &xv,
+    double *acc) {
 
   // State vector components
   // -----------------------
-  ColumnVector rr = xv.rows(1,3);
-  ColumnVector vv = xv.rows(4,6);
+  ColumnVector rr = xv.rows(1, 3);
+  ColumnVector vv = xv.rows(4, 6);
 
   // Acceleration
   // ------------
   static const double gmWGS = 398.60044e12;
-  static const double AE    = 6378136.0;
+  static const double AE = 6378136.0;
   static const double OMEGA = 7292115.e-11;
-  static const double C20   = -1082.6257e-6;
+  static const double C20 = -1082.6257e-6;
 
   double rho = rr.NormFrobenius();
-  double t1  = -gmWGS/(rho*rho*rho);
-  double t2  = 3.0/2.0 * C20 * (gmWGS*AE*AE) / (rho*rho*rho*rho*rho);
-  double t3  = OMEGA * OMEGA;
-  double t4  = 2.0 * OMEGA;
-  double z2  = rr(3) * rr(3);
+  double t1 = -gmWGS / (rho * rho * rho);
+  double t2 = 3.0 / 2.0 * C20 * (gmWGS * AE * AE)
+      / (rho * rho * rho * rho * rho);
+  double t3 = OMEGA * OMEGA;
+  double t4 = 2.0 * OMEGA;
+  double z2 = rr(3) * rr(3);
 
   // Vector of derivatives
@@ -1223,7 +1375,9 @@
   va(2) = vv(2);
   va(3) = vv(3);
-  va(4) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(1) + t4*vv(2) + acc[0];
-  va(5) = (t1 + t2*(1.0-5.0*z2/(rho*rho)) + t3) * rr(2) - t4*vv(1) + acc[1];
-  va(6) = (t1 + t2*(3.0-5.0*z2/(rho*rho))     ) * rr(3)            + acc[2];
+  va(4) = (t1 + t2 * (1.0 - 5.0 * z2 / (rho * rho)) + t3) * rr(1) + t4 * vv(2)
+      + acc[0];
+  va(5) = (t1 + t2 * (1.0 - 5.0 * z2 / (rho * rho)) + t3) * rr(2) - t4 * vv(1)
+      + acc[1];
+  va(6) = (t1 + t2 * (3.0 - 5.0 * z2 / (rho * rho))) * rr(3) + acc[2];
 
   return va;
@@ -1234,5 +1388,5 @@
 unsigned int t_ephGlo::IOD() const {
   bncTime tMoscow = _TOC - _gps_utc + 3 * 3600.0;
-  return (unsigned long)tMoscow.daysec() / 900;
+  return (unsigned long) tMoscow.daysec() / 900;
 }
 
@@ -1242,11 +1396,10 @@
 
   if (_almanac_health_availablility_indicator) {
-      if ((_health == 0 && _almanac_health == 0) ||
-          (_health == 1 && _almanac_health == 0) ||
-          (_health == 1 && _almanac_health == 1)) {
-        return 1;
-      }
-  }
-  else if (!_almanac_health_availablility_indicator) {
+    if ((_health == 0 && _almanac_health == 0)
+        || (_health == 1 && _almanac_health == 0)
+        || (_health == 1 && _almanac_health == 1)) {
+      return 1;
+    }
+  } else if (!_almanac_health_availablility_indicator) {
     if (_health) {
       return 1;
@@ -1258,8 +1411,8 @@
 // Constructor
 //////////////////////////////////////////////////////////////////////////////
-t_ephGal::t_ephGal(double rnxVersion, const QStringList& lines) {
-  int       year, month, day, hour, min;
-  double    sec;
-  QString   prnStr;
+t_ephGal::t_ephGal(double rnxVersion, const QStringList &lines) {
+  int year, month, day, hour, min;
+  double sec;
+  QString prnStr;
   const int nLines = 8;
   if (lines.size() != nLines) {
@@ -1275,5 +1428,5 @@
 
   int pos[4];
-  pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
+  pos[0] = (rnxVersion <= 2.12) ? 3 : 4;
   pos[1] = pos[0] + fieldLen;
   pos[2] = pos[1] + fieldLen;
@@ -1285,5 +1438,5 @@
     QString line = lines[iLine];
 
-    if      ( iLine == 0 ) {
+    if (iLine == 0) {
       QTextStream in(line.left(pos[1]).toLatin1());
       QString n;
@@ -1294,8 +1447,7 @@
       }
       in >> year >> month >> day >> hour >> min >> sec;
-      if      (year <  80) {
+      if (year < 80) {
         year += 2000;
-      }
-      else if (year < 100) {
+      } else if (year < 100) {
         year += 1900;
       }
@@ -1303,7 +1455,7 @@
       _TOC.set(year, month, day, hour, min, sec);
 
-      if ( readDbl(line, pos[1], fieldLen, _clock_bias     ) ||
-           readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
-           readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
+      if (readDbl(line, pos[1], fieldLen, _clock_bias)
+          || readDbl(line, pos[2], fieldLen, _clock_drift)
+          || readDbl(line, pos[3], fieldLen, _clock_driftrate)) {
         _checkState = bad;
         return;
@@ -1313,9 +1465,9 @@
     // BROADCAST ORBIT - 1
     // =====================
-    else if      ( iLine == 1 ) {
-      if ( readDbl(line, pos[0], fieldLen, _IODnav ) ||
-           readDbl(line, pos[1], fieldLen, _Crs    ) ||
-           readDbl(line, pos[2], fieldLen, _Delta_n) ||
-           readDbl(line, pos[3], fieldLen, _M0     ) ) {
+    else if (iLine == 1) {
+      if (readDbl(line, pos[0], fieldLen, _IODnav)
+          || readDbl(line, pos[1], fieldLen, _Crs)
+          || readDbl(line, pos[2], fieldLen, _Delta_n)
+          || readDbl(line, pos[3], fieldLen, _M0)) {
         _checkState = bad;
         return;
@@ -1325,9 +1477,9 @@
     // BROADCAST ORBIT - 2
     // =====================
-    else if ( iLine == 2 ) {
-      if ( readDbl(line, pos[0], fieldLen, _Cuc   ) ||
-           readDbl(line, pos[1], fieldLen, _e     ) ||
-           readDbl(line, pos[2], fieldLen, _Cus   ) ||
-           readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
+    else if (iLine == 2) {
+      if (readDbl(line, pos[0], fieldLen, _Cuc)
+          || readDbl(line, pos[1], fieldLen, _e)
+          || readDbl(line, pos[2], fieldLen, _Cus)
+          || readDbl(line, pos[3], fieldLen, _sqrt_A)) {
         _checkState = bad;
         return;
@@ -1337,9 +1489,9 @@
     // BROADCAST ORBIT - 3
     // =====================
-    else if ( iLine == 3 ) {
-      if ( readDbl(line, pos[0], fieldLen, _TOEsec)  ||
-           readDbl(line, pos[1], fieldLen, _Cic   )  ||
-           readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
-           readDbl(line, pos[3], fieldLen, _Cis   ) ) {
+    else if (iLine == 3) {
+      if (readDbl(line, pos[0], fieldLen, _TOEsec)
+          || readDbl(line, pos[1], fieldLen, _Cic)
+          || readDbl(line, pos[2], fieldLen, _OMEGA0)
+          || readDbl(line, pos[3], fieldLen, _Cis)) {
         _checkState = bad;
         return;
@@ -1349,9 +1501,9 @@
     // BROADCAST ORBIT - 4
     // =====================
-    else if ( iLine == 4 ) {
-      if ( readDbl(line, pos[0], fieldLen, _i0      ) ||
-           readDbl(line, pos[1], fieldLen, _Crc     ) ||
-           readDbl(line, pos[2], fieldLen, _omega   ) ||
-           readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
+    else if (iLine == 4) {
+      if (readDbl(line, pos[0], fieldLen, _i0)
+          || readDbl(line, pos[1], fieldLen, _Crc)
+          || readDbl(line, pos[2], fieldLen, _omega)
+          || readDbl(line, pos[3], fieldLen, _OMEGADOT)) {
         _checkState = bad;
         return;
@@ -1361,15 +1513,15 @@
     // BROADCAST ORBIT - 5
     // =====================
-    else if ( iLine == 5 ) {
-      if ( readDbl(line, pos[0], fieldLen, _IDOT      ) ||
-           readDbl(line, pos[1], fieldLen, datasource) ||
-           readDbl(line, pos[2], fieldLen, _TOEweek   ) ) {
+    else if (iLine == 5) {
+      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)) {
+        if (int(datasource) & (1 << 8)) {
           _fnav = true;
           _inav = false;
-        } else if (int(datasource) & (1<<9)) {
+        } else if (int(datasource) & (1 << 9)) {
           _fnav = false;
           _inav = true;
@@ -1381,24 +1533,24 @@
     // BROADCAST ORBIT - 6
     // =====================
-    else if ( iLine == 6 ) {
-      if ( readDbl(line, pos[0], fieldLen, _SISA    ) ||
-           readDbl(line, pos[1], fieldLen,  SVhealth) ||
-           readDbl(line, pos[2], fieldLen, _BGD_1_5A) ||
-           readDbl(line, pos[3], fieldLen, _BGD_1_5B) ) {
+    else if (iLine == 6) {
+      if (readDbl(line, pos[0], fieldLen, _SISA)
+          || readDbl(line, pos[1], fieldLen, SVhealth)
+          || readDbl(line, pos[2], fieldLen, _BGD_1_5A)
+          || readDbl(line, pos[3], fieldLen, _BGD_1_5B)) {
         _checkState = bad;
         return;
       } else {
         // Bit 0
-        _e1DataInValid  = (int(SVhealth) & (1<<0));
+        _e1DataInValid = (int(SVhealth) & (1 << 0));
         // Bit 1-2
-        _E1_bHS         = double((int(SVhealth) >> 1) & 0x3);
+        _E1_bHS = double((int(SVhealth) >> 1) & 0x3);
         // Bit 3
-        _e5aDataInValid = (int(SVhealth) & (1<<3));
+        _e5aDataInValid = (int(SVhealth) & (1 << 3));
         // Bit 4-5
-        _E5aHS          = double((int(SVhealth) >> 4) & 0x3);
+        _E5aHS = double((int(SVhealth) >> 4) & 0x3);
         // Bit 6
-        _e5bDataInValid = (int(SVhealth) & (1<<6));
+        _e5bDataInValid = (int(SVhealth) & (1 << 6));
         // Bit 7-8
-        _E5bHS          = double((int(SVhealth) >> 7) & 0x3);
+        _E5bHS = double((int(SVhealth) >> 7) & 0x3);
 
         if (prnStr.at(0) == 'E') {
@@ -1410,6 +1562,6 @@
     // BROADCAST ORBIT - 7
     // =====================
-    else if ( iLine == 7 ) {
-      if ( readDbl(line, pos[0], fieldLen, _TOT) ) {
+    else if (iLine == 7) {
+      if (readDbl(line, pos[0], fieldLen, _TOT)) {
         _checkState = bad;
         return;
@@ -1421,11 +1573,12 @@
 // Compute Galileo Satellite Position (virtual)
 ////////////////////////////////////////////////////////////////////////////
-t_irc t_ephGal::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
+t_irc t_ephGal::position(int GPSweek, double GPSweeks, double *xc,
+    double *vv) const {
 
   static const double omegaEarth = 7292115.1467e-11;
   static const double gmWGS = 398.6004418e12;
 
-  memset(xc, 0, 6*sizeof(double));
-  memset(vv, 0, 3*sizeof(double));
+  memset(xc, 0, 6 * sizeof(double));
+  memset(vv, 0, 3 * sizeof(double));
 
   double a0 = _sqrt_A * _sqrt_A;
@@ -1434,74 +1587,72 @@
   }
 
-  double n0 = sqrt(gmWGS/(a0*a0*a0));
+  double n0 = sqrt(gmWGS / (a0 * a0 * a0));
 
   bncTime tt(GPSweek, GPSweeks);
   double tk = tt - bncTime(_TOC.gpsw(), _TOEsec);
 
-  double n  = n0 + _Delta_n;
-  double M  = _M0 + n*tk;
-  double E  = M;
+  double n = n0 + _Delta_n;
+  double M = _M0 + n * tk;
+  double E = M;
   double E_last;
-  int    nLoop = 0;
+  int nLoop = 0;
   do {
     E_last = E;
-    E = M + _e*sin(E);
+    E = M + _e * sin(E);
 
     if (++nLoop == 100) {
       return failure;
     }
-  } while ( fabs(E-E_last)*a0 > 0.001 );
-  double v      = 2.0*atan( sqrt( (1.0 + _e)/(1.0 - _e) )*tan( E/2 ) );
-  double u0     = v + _omega;
-  double sin2u0 = sin(2*u0);
-  double cos2u0 = cos(2*u0);
-  double r      = a0*(1 - _e*cos(E)) + _Crc*cos2u0 + _Crs*sin2u0;
-  double i      = _i0 + _IDOT*tk + _Cic*cos2u0 + _Cis*sin2u0;
-  double u      = u0 + _Cuc*cos2u0 + _Cus*sin2u0;
-  double xp     = r*cos(u);
-  double yp     = r*sin(u);
-  double OM     = _OMEGA0 + (_OMEGADOT - omegaEarth)*tk -
-                  omegaEarth*_TOEsec;
+  } while (fabs(E - E_last) * a0 > 0.001);
+  double v = 2.0 * atan(sqrt((1.0 + _e) / (1.0 - _e)) * tan(E / 2));
+  double u0 = v + _omega;
+  double sin2u0 = sin(2 * u0);
+  double cos2u0 = cos(2 * u0);
+  double r = a0 * (1 - _e * cos(E)) + _Crc * cos2u0 + _Crs * sin2u0;
+  double i = _i0 + _IDOT * tk + _Cic * cos2u0 + _Cis * sin2u0;
+  double u = u0 + _Cuc * cos2u0 + _Cus * sin2u0;
+  double xp = r * cos(u);
+  double yp = r * sin(u);
+  double OM = _OMEGA0 + (_OMEGADOT - omegaEarth) * tk - omegaEarth * _TOEsec;
 
   double sinom = sin(OM);
   double cosom = cos(OM);
-  double sini  = sin(i);
-  double cosi  = cos(i);
-  xc[0] = xp*cosom - yp*cosi*sinom;
-  xc[1] = xp*sinom + yp*cosi*cosom;
-  xc[2] = yp*sini;
+  double sini = sin(i);
+  double cosi = cos(i);
+  xc[0] = xp * cosom - yp * cosi * sinom;
+  xc[1] = xp * sinom + yp * cosi * cosom;
+  xc[2] = yp * sini;
 
   double tc = tt - _TOC;
-  xc[3] = _clock_bias + _clock_drift*tc + _clock_driftrate*tc*tc;
+  xc[3] = _clock_bias + _clock_drift * tc + _clock_driftrate * tc * tc;
 
   // Velocity
   // --------
-  double tanv2 = tan(v/2);
-  double dEdM  = 1 / (1 - _e*cos(E));
-  double dotv  = sqrt((1.0 + _e)/(1.0 - _e)) / cos(E/2)/cos(E/2) / (1 + tanv2*tanv2)
-               * dEdM * n;
-  double dotu  = dotv + (-_Cuc*sin2u0 + _Cus*cos2u0)*2*dotv;
+  double tanv2 = tan(v / 2);
+  double dEdM = 1 / (1 - _e * cos(E));
+  double dotv = sqrt((1.0 + _e) / (1.0 - _e)) / cos(E / 2) / cos(E / 2)
+      / (1 + tanv2 * tanv2) * dEdM * n;
+  double dotu = dotv + (-_Cuc * sin2u0 + _Cus * cos2u0) * 2 * dotv;
   double dotom = _OMEGADOT - omegaEarth;
-  double doti  = _IDOT + (-_Cic*sin2u0 + _Cis*cos2u0)*2*dotv;
-  double dotr  = a0 * _e*sin(E) * dEdM * n
-                + (-_Crc*sin2u0 + _Crs*cos2u0)*2*dotv;
-  double dotx  = dotr*cos(u) - r*sin(u)*dotu;
-  double doty  = dotr*sin(u) + r*cos(u)*dotu;
-
-  vv[0]  = cosom   *dotx  - cosi*sinom   *doty      // dX / dr
-           - xp*sinom*dotom - yp*cosi*cosom*dotom   // dX / dOMEGA
-                       + yp*sini*sinom*doti;        // dX / di
-
-  vv[1]  = sinom   *dotx  + cosi*cosom   *doty
-           + xp*cosom*dotom - yp*cosi*sinom*dotom
-                          - yp*sini*cosom*doti;
-
-  vv[2]  = sini    *doty  + yp*cosi      *doti;
+  double doti = _IDOT + (-_Cic * sin2u0 + _Cis * cos2u0) * 2 * dotv;
+  double dotr = a0 * _e * sin(E) * dEdM * n
+      + (-_Crc * sin2u0 + _Crs * cos2u0) * 2 * dotv;
+  double dotx = dotr * cos(u) - r * sin(u) * dotu;
+  double doty = dotr * sin(u) + r * cos(u) * dotu;
+
+  vv[0] = cosom * dotx - cosi * sinom * doty      // dX / dr
+  - xp * sinom * dotom - yp * cosi * cosom * dotom   // dX / dOMEGA
+  + yp * sini * sinom * doti;        // dX / di
+
+  vv[1] = sinom * dotx + cosi * cosom * doty + xp * cosom * dotom
+      - yp * cosi * sinom * dotom - yp * sini * cosom * doti;
+
+  vv[2] = sini * doty + yp * cosi * doti;
 
   // Relativistic Correction
   // -----------------------
-  xc[3] -= 4.442807309e-10 * _e * sqrt(a0) *sin(E);
-
-  xc[4] = _clock_drift + _clock_driftrate*tc;
+  xc[3] -= 4.442807309e-10 * _e * sqrt(a0) * sin(E);
+
+  xc[4] = _clock_drift + _clock_driftrate * tc;
   xc[5] = _clock_driftrate;
 
@@ -1512,12 +1663,9 @@
 ////////////////////////////////////////////////////////////////////////////
 unsigned int t_ephGal::isUnhealthy() const {
-  if (_E5aHS  == 1 || _E5aHS  == 3 ||
-      _E5bHS  == 1 || _E5bHS  == 3 ||
-      _E1_bHS == 1 || _E1_bHS == 3 ) {
+  if (_E5aHS == 1 || _E5aHS == 3 || _E5bHS == 1 || _E5bHS == 3 || _E1_bHS == 1
+      || _E1_bHS == 3) {
     return 1;
   }
-  if (_e5aDataInValid ||
-      _e5bDataInValid ||
-      _e1DataInValid) {
+  if (_e5aDataInValid || _e5bDataInValid || _e1DataInValid) {
     return 1;
   }
@@ -1528,10 +1676,10 @@
    * SDD v1.3: SHS=2 leads to a newly-defined "EOM" status.
    * It also means that the satellite signal may be used for PNT.
-  if (_E5aHS  == 2 ||
-      _E5bHS  == 2 ||
-      _E1_bHS == 2 ) {
-    return 1;
-  }
-  */
+   if (_E5aHS  == 2 ||
+   _E5bHS  == 2 ||
+   _E1_bHS == 2 ) {
+   return 1;
+   }
+   */
   return 0;
 }
@@ -1541,13 +1689,12 @@
 QString t_ephGal::toString(double version) const {
 
-  QString navStr = navTypeString(_navType, _prn, version);
-  QString rnxStr = navStr + rinexDateStr(_TOC, _prn, version);
+  QString ephStr = ephTypeStr(_ephType, _prn, version);
+  QString rnxStr = ephStr + rinexDateStr(_TOC, _prn, version);
 
   QTextStream out(&rnxStr);
 
-  out << QString("%1%2%3\n")
-    .arg(_clock_bias,      19, 'e', 12)
-    .arg(_clock_drift,     19, 'e', 12)
-    .arg(_clock_driftrate, 19, 'e', 12);
+  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 fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
@@ -1555,128 +1702,107 @@
   // BROADCAST ORBIT - 1
   // =====================
-  out << QString(fmt)
-    .arg(_IODnav,  19, 'e', 12)
-    .arg(_Crs,     19, 'e', 12)
-    .arg(_Delta_n, 19, 'e', 12)
-    .arg(_M0,      19, 'e', 12);
+  out
+      << 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);
+  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
   // =====================
-  out << QString(fmt)
-    .arg(_TOEsec, 19, 'e', 12)
-    .arg(_Cic,    19, 'e', 12)
-    .arg(_OMEGA0, 19, 'e', 12)
-    .arg(_Cis,    19, 'e', 12);
+  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);
+  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
   // =====================
-  int    dataSource = 0;
-  int    SVhealth   = 0;
-  double BGD_1_5A   = _BGD_1_5A;
-  double BGD_1_5B   = _BGD_1_5B;
+  int dataSource = 0;
+  int SVhealth = 0;
+  double BGD_1_5A = _BGD_1_5A;
+  double BGD_1_5B = _BGD_1_5B;
   if (_fnav) {
-    dataSource |= (1<<1);
-    dataSource |= (1<<8);
+    dataSource |= (1 << 1);
+    dataSource |= (1 << 8);
     BGD_1_5B = 0.0;
     // SVhealth
     //   Bit 3  : E5a DVS
     if (_e5aDataInValid) {
-      SVhealth |= (1<<3);
+      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);
-    }
-  }
-  else if(_inav) {
+      SVhealth |= (1 << 4);
+    } else if (_E5aHS == 2.0) {
+      SVhealth |= (1 << 5);
+    } else if (_E5aHS == 3.0) {
+      SVhealth |= (1 << 4);
+      SVhealth |= (1 << 5);
+    }
+  } else if (_inav) {
     // Bit 2 and 0 are set because from MT1046 the data source cannot be determined
     // and RNXv3.03 says both can be set if the navigation messages were merged
-    dataSource |= (1<<0);
-    dataSource |= (1<<2);
-    dataSource |= (1<<9);
+    dataSource |= (1 << 0);
+    dataSource |= (1 << 2);
+    dataSource |= (1 << 9);
     // SVhealth
     //   Bit 0  : E1-B DVS
     if (_e1DataInValid) {
-      SVhealth |= (1<<0);
+      SVhealth |= (1 << 0);
     }
     //   Bit 1-2: E1-B HS
-    if      (_E1_bHS == 1.0) {
-      SVhealth |= (1<<1);
-    }
-    else if (_E1_bHS == 2.0) {
-      SVhealth |= (1<<2);
-    }
-    else if (_E1_bHS == 3.0) {
-      SVhealth |= (1<<1);
-      SVhealth |= (1<<2);
+    if (_E1_bHS == 1.0) {
+      SVhealth |= (1 << 1);
+    } else if (_E1_bHS == 2.0) {
+      SVhealth |= (1 << 2);
+    } else if (_E1_bHS == 3.0) {
+      SVhealth |= (1 << 1);
+      SVhealth |= (1 << 2);
     }
     //   Bit 3  : E5a DVS
     if (_e5aDataInValid) {
-      SVhealth |= (1<<3);
+      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);
+    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) {
-      SVhealth |= (1<<6);
+      SVhealth |= (1 << 6);
     }
     //   Bit 7-8: E5b HS
-    if      (_E5bHS == 1.0) {
-      SVhealth |= (1<<7);
-    }
-    else if (_E5bHS == 2.0) {
-      SVhealth |= (1<<8);
-    }
-    else if (_E5bHS == 3.0) {
-      SVhealth |= (1<<7);
-      SVhealth |= (1<<8);
-    }
-  }
-
-  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);
+    if (_E5bHS == 1.0) {
+      SVhealth |= (1 << 7);
+    } else if (_E5bHS == 2.0) {
+      SVhealth |= (1 << 8);
+    } else if (_E5bHS == 3.0) {
+      SVhealth |= (1 << 7);
+      SVhealth |= (1 << 8);
+    }
+  }
+
+  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);
   // =====================
   // 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);
+  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);
   // =====================
   // BROADCAST ORBIT - 7
@@ -1686,9 +1812,7 @@
     tot = 0.0;
   }
-  out << QString(fmt)
-    .arg(tot,     19, 'e', 12)
-    .arg("",      19, QChar(' '))
-    .arg("",      19, QChar(' '))
-    .arg("",      19, QChar(' '));
+  out
+      << QString(fmt).arg(tot, 19, 'e', 12).arg("", 19, QChar(' ')).arg("", 19,
+          QChar(' ')).arg("", 19, QChar(' '));
 
   return rnxStr;
@@ -1697,5 +1821,5 @@
 // Constructor
 //////////////////////////////////////////////////////////////////////////////
-t_ephSBAS::t_ephSBAS(double rnxVersion, const QStringList& lines) {
+t_ephSBAS::t_ephSBAS(double rnxVersion, const QStringList &lines) {
 
   const int nLines = 4;
@@ -1711,5 +1835,5 @@
 
   int pos[4];
-  pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
+  pos[0] = (rnxVersion <= 2.12) ? 3 : 4;
   pos[1] = pos[0] + fieldLen;
   pos[2] = pos[1] + fieldLen;
@@ -1721,8 +1845,8 @@
     QString line = lines[iLine];
 
-    if      ( iLine == 0 ) {
+    if (iLine == 0) {
       QTextStream in(line.left(pos[1]).toLatin1());
 
-      int    year, month, day, hour, min;
+      int year, month, day, hour, min;
       double sec;
 
@@ -1736,13 +1860,11 @@
       if (prnStr.at(0) == 'S') {
         _prn.set('S', prnStr.mid(1).toInt());
-      }
-      else {
+      } else {
         _prn.set('S', prnStr.toInt());
       }
 
-      if      (year <  80) {
+      if (year < 80) {
         year += 2000;
-      }
-      else if (year < 100) {
+      } else if (year < 100) {
         year += 1900;
       }
@@ -1750,7 +1872,7 @@
       _TOC.set(year, month, day, hour, min, sec);
 
-      if ( readDbl(line, pos[1], fieldLen, _agf0 ) ||
-           readDbl(line, pos[2], fieldLen, _agf1 ) ||
-           readDbl(line, pos[3], fieldLen, _TOT  ) ) {
+      if (readDbl(line, pos[1], fieldLen, _agf0)
+          || readDbl(line, pos[2], fieldLen, _agf1)
+          || readDbl(line, pos[3], fieldLen, _TOT)) {
         _checkState = bad;
         return;
@@ -1760,9 +1882,9 @@
     // BROADCAST ORBIT - 1
     // =====================
-    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) ||
-           readDbl(line, pos[3], fieldLen, _health        ) ) {
+    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)
+          || readDbl(line, pos[3], fieldLen, _health)) {
         _checkState = bad;
         return;
@@ -1772,9 +1894,9 @@
     // BROADCAST ORBIT - 2
     // =====================
-    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, _ura             ) ) {
+    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, _ura)) {
         _checkState = bad;
         return;
@@ -1784,10 +1906,10 @@
     // BROADCAST ORBIT - 3
     // =====================
-    else if ( iLine == 3 ) {
+    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)  ||
-           readDbl(line, pos[3], fieldLen, iodn           ) ) {
+      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, iodn)) {
         _checkState = bad;
         return;
@@ -1798,10 +1920,10 @@
   }
 
-  _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_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;
@@ -1828,7 +1950,9 @@
   SBASADDBITSFLOAT(10, this->_y_acceleration, 0.0000125)
   SBASADDBITSFLOAT(10, this->_z_acceleration, 0.0000625)
-  SBASADDBITSFLOAT(12, this->_agf0, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<1))
-  SBASADDBITSFLOAT(8, this->_agf1, 1.0/static_cast<double>(1<<30)/static_cast<double>(1<<10))
-  SBASADDBITS(5,0); // the last byte is filled by 0-bits to obtain a length of an integer multiple of 8
+  SBASADDBITSFLOAT(12, this->_agf0,
+      1.0 / static_cast<double>(1 << 30) / static_cast<double>(1 << 1))
+  SBASADDBITSFLOAT(8, this->_agf1,
+      1.0 / static_cast<double>(1 << 30) / static_cast<double>(1 << 10))
+  SBASADDBITS(5, 0); // the last byte is filled by 0-bits to obtain a length of an integer multiple of 8
 
   return CRC24(size, startbuffer);
@@ -1837,8 +1961,9 @@
 // Compute SBAS Satellite Position (virtual)
 ////////////////////////////////////////////////////////////////////////////
-t_irc t_ephSBAS::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
+t_irc t_ephSBAS::position(int GPSweek, double GPSweeks, double *xc,
+    double *vv) const {
 
   bncTime tt(GPSweek, GPSweeks);
-  double  dt = tt - _TOC;
+  double dt = tt - _TOC;
 
   xc[0] = _x_pos + _x_velocity * dt + _x_acceleration * dt * dt / 2.0;
@@ -1863,5 +1988,5 @@
 
   // Bit 5
-  bool URAindexIs15 = (int(_health) & (1<<5));
+  bool URAindexIs15 = (int(_health) & (1 << 5));
   if (URAindexIs15) {
     // in this case it is recommended
@@ -1871,5 +1996,5 @@
 
   // Bit 0-3
-  int   MT17health = (int(_health)) & (0x0f);
+  int MT17health = (int(_health)) & (0x0f);
   if (MT17health) {
     return 1;
@@ -1883,18 +2008,16 @@
 }
 
-
 // RINEX Format String
 //////////////////////////////////////////////////////////////////////////////
 QString t_ephSBAS::toString(double version) const {
 
-  QString navStr = navTypeString(_navType, _prn, version);
-  QString rnxStr = navStr + rinexDateStr(_TOC, _prn, version);
+  QString ephStr = ephTypeStr(_ephType, _prn, version);
+  QString rnxStr = ephStr + rinexDateStr(_TOC, _prn, version);
 
   QTextStream out(&rnxStr);
 
-  out << QString("%1%2%3\n")
-    .arg(_agf0, 19, 'e', 12)
-    .arg(_agf1, 19, 'e', 12)
-    .arg(_TOT,  19, 'e', 12);
+  out
+      << 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";
@@ -1902,25 +2025,22 @@
   // BROADCAST ORBIT - 1
   // =====================
-  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);
+  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);
   // =====================
   // 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);
+  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);
   // =====================
   // 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);
+  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);
 
   return rnxStr;
@@ -1929,13 +2049,12 @@
 // Constructor
 //////////////////////////////////////////////////////////////////////////////
-t_ephBDS::t_ephBDS(double rnxVersion, const QStringList& lines) {
+t_ephBDS::t_ephBDS(double rnxVersion, const QStringList &lines) {
 
   int nLines = 8;
 
-  if (navType() == t_eph::CNV1 ||
-      navType() == t_eph::CNV2) {
+  if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2) {
     nLines += 2;
   }
-  if (navType() == t_eph::CNV3) {
+  if (ephType() == t_eph::CNV3) {
     nLines += 1;
   }
@@ -1951,5 +2070,5 @@
 
   int pos[4];
-  pos[0] = (rnxVersion <= 2.12) ?  3 :  4;
+  pos[0] = (rnxVersion <= 2.12) ? 3 : 4;
   pos[1] = pos[0] + fieldLen;
   pos[2] = pos[1] + fieldLen;
@@ -1961,8 +2080,8 @@
     QString line = lines[iLine];
 
-    if      ( iLine == 0 ) {
+    if (iLine == 0) {
       QTextStream in(line.left(pos[1]).toLatin1());
 
-      int    year, month, day, hour, min;
+      int year, month, day, hour, min;
       double sec;
 
@@ -1976,13 +2095,11 @@
       if (prnStr.at(0) == 'C') {
         _prn.set('C', prnStr.mid(1).toInt());
-      }
-      else {
+      } else {
         _prn.set('C', prnStr.toInt());
       }
 
-      if      (year <  80) {
+      if (year < 80) {
         year += 2000;
-      }
-      else if (year < 100) {
+      } else if (year < 100) {
         year += 1900;
       }
@@ -1990,7 +2107,7 @@
       _TOC.setBDS(year, month, day, hour, min, sec);
 
-      if ( readDbl(line, pos[1], fieldLen, _clock_bias     ) ||
-           readDbl(line, pos[2], fieldLen, _clock_drift    ) ||
-           readDbl(line, pos[3], fieldLen, _clock_driftrate) ) {
+      if (readDbl(line, pos[1], fieldLen, _clock_bias)
+          || readDbl(line, pos[2], fieldLen, _clock_drift)
+          || readDbl(line, pos[3], fieldLen, _clock_driftrate)) {
         _checkState = bad;
         return;
@@ -2000,10 +2117,10 @@
     // BROADCAST ORBIT - 1
     // =====================
-    else if      ( iLine == 1 ) {
+    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     ) ) {
+      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;
@@ -2014,9 +2131,9 @@
     // BROADCAST ORBIT - 2
     // =====================
-    else if ( iLine == 2 ) {
-      if ( readDbl(line, pos[0], fieldLen, _Cuc   ) ||
-           readDbl(line, pos[1], fieldLen, _e     ) ||
-           readDbl(line, pos[2], fieldLen, _Cus   ) ||
-           readDbl(line, pos[3], fieldLen, _sqrt_A) ) {
+    else if (iLine == 2) {
+      if (readDbl(line, pos[0], fieldLen, _Cuc)
+          || readDbl(line, pos[1], fieldLen, _e)
+          || readDbl(line, pos[2], fieldLen, _Cus)
+          || readDbl(line, pos[3], fieldLen, _sqrt_A)) {
         _checkState = bad;
         return;
@@ -2026,9 +2143,9 @@
     // BROADCAST ORBIT - 3
     // =====================
-    else if ( iLine == 3 ) {
-      if ( readDbl(line, pos[0], fieldLen, _TOEsec )  ||
-           readDbl(line, pos[1], fieldLen, _Cic   )  ||
-           readDbl(line, pos[2], fieldLen, _OMEGA0)  ||
-           readDbl(line, pos[3], fieldLen, _Cis   ) ) {
+    else if (iLine == 3) {
+      if (readDbl(line, pos[0], fieldLen, _TOEsec)
+          || readDbl(line, pos[1], fieldLen, _Cic)
+          || readDbl(line, pos[2], fieldLen, _OMEGA0)
+          || readDbl(line, pos[3], fieldLen, _Cis)) {
         _checkState = bad;
         return;
@@ -2038,9 +2155,9 @@
     // BROADCAST ORBIT - 4
     // =====================
-    else if ( iLine == 4 ) {
-      if ( readDbl(line, pos[0], fieldLen, _i0      ) ||
-           readDbl(line, pos[1], fieldLen, _Crc     ) ||
-           readDbl(line, pos[2], fieldLen, _omega   ) ||
-           readDbl(line, pos[3], fieldLen, _OMEGADOT) ) {
+    else if (iLine == 4) {
+      if (readDbl(line, pos[0], fieldLen, _i0)
+          || readDbl(line, pos[1], fieldLen, _Crc)
+          || readDbl(line, pos[2], fieldLen, _omega)
+          || readDbl(line, pos[3], fieldLen, _OMEGADOT)) {
         _checkState = bad;
         return;
@@ -2050,20 +2167,18 @@
     // BROADCAST ORBIT - 5
     // =====================
-    else if ( iLine == 5 ) {
-
-      if (navType() == t_eph::CNV1 ||
-          navType() == t_eph::CNV2 ||
-          navType() == t_eph::CNV3 ) {
-        if ( readDbl(line, pos[0], fieldLen, _IDOT       ) ||
-             readDbl(line, pos[1], fieldLen, _Delta_n_dot) ||
-             readDbl(line, pos[2], fieldLen, _satType    ) ||
-             readDbl(line, pos[3], fieldLen, _top        ) ) {
-          _checkState = bad;
-          return;
-        }
-      }
-      else { // D1, D2, undefined
-        if ( readDbl(line, pos[0], fieldLen, _IDOT    ) ||
-             readDbl(line, pos[2], fieldLen, _BDTweek)) {
+    else if (iLine == 5) {
+
+      if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2
+          || ephType() == t_eph::CNV3) {
+        if (readDbl(line, pos[0], fieldLen, _IDOT)
+            || readDbl(line, pos[1], fieldLen, _Delta_n_dot)
+            || readDbl(line, pos[2], fieldLen, _satType)
+            || readDbl(line, pos[3], fieldLen, _top)) {
+          _checkState = bad;
+          return;
+        }
+      } else { // D1, D2, undefined
+        if (readDbl(line, pos[0], fieldLen, _IDOT)
+            || readDbl(line, pos[2], fieldLen, _BDTweek)) {
           _checkState = bad;
           return;
@@ -2074,22 +2189,20 @@
     // BROADCAST ORBIT - 6
     // =====================
-    else if ( iLine == 6 ) {
-      if (navType() == t_eph::CNV1 ||
-          navType() == t_eph::CNV2 ||
-          navType() == t_eph::CNV3 ) {
-        if ( readDbl(line, pos[0], fieldLen, _SISAI_oe  ) ||
-             readDbl(line, pos[1], fieldLen, _SISAI_ocb ) ||
-             readDbl(line, pos[2], fieldLen, _SISAI_oc1 ) ||
-             readDbl(line, pos[3], fieldLen, _SISAI_oc2  ) ) {
-          _checkState = bad;
-          return;
-        }
-      }
-      else { // D1, D2, undefined
+    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)
+            || readDbl(line, pos[1], fieldLen, _SISAI_ocb)
+            || readDbl(line, pos[2], fieldLen, _SISAI_oc1)
+            || readDbl(line, pos[3], fieldLen, _SISAI_oc2)) {
+          _checkState = bad;
+          return;
+        }
+      } else { // D1, D2, undefined
         double SatH1;
-        if ( readDbl(line, pos[0], fieldLen, _URA ) ||
-             readDbl(line, pos[1], fieldLen, SatH1) ||
-             readDbl(line, pos[2], fieldLen, _TGD1) ||
-             readDbl(line, pos[3], fieldLen, _TGD2) ) {
+        if (readDbl(line, pos[0], fieldLen, _URA)
+            || readDbl(line, pos[1], fieldLen, SatH1)
+            || readDbl(line, pos[2], fieldLen, _TGD1)
+            || readDbl(line, pos[3], fieldLen, _TGD2)) {
           _checkState = bad;
           return;
@@ -2101,36 +2214,33 @@
     // BROADCAST ORBIT - 7
     // =====================
-    else if ( iLine == 7 ) {
-      if (navType() == t_eph::CNV1) {
-        if ( readDbl(line, pos[0], fieldLen, _ISC_B1Cd) ||
-             readDbl(line, pos[2], fieldLen, _TGD_B1Cp) ||
-             readDbl(line, pos[3], fieldLen, _TGD_B2ap) ) {
-          _checkState = bad;
-          return;
-        }
-      }
-      else if (navType() == t_eph::CNV2) {
-        if ( readDbl(line, pos[1], fieldLen, _ISC_B2ad) ||
-             readDbl(line, pos[2], fieldLen, _TGD_B1Cp) ||
-             readDbl(line, pos[3], fieldLen, _TGD_B2ap) ) {
-          _checkState = bad;
-          return;
-        }
-      }
-      else if (navType() == t_eph::CNV3) {
+    else if (iLine == 7) {
+      if (ephType() == t_eph::CNV1) {
+        if (readDbl(line, pos[0], fieldLen, _ISC_B1Cd)
+            || readDbl(line, pos[2], fieldLen, _TGD_B1Cp)
+            || readDbl(line, pos[3], fieldLen, _TGD_B2ap)) {
+          _checkState = bad;
+          return;
+        }
+      } else if (ephType() == t_eph::CNV2) {
+        if (readDbl(line, pos[1], fieldLen, _ISC_B2ad)
+            || readDbl(line, pos[2], fieldLen, _TGD_B1Cp)
+            || readDbl(line, pos[3], fieldLen, _TGD_B2ap)) {
+          _checkState = bad;
+          return;
+        }
+      } else if (ephType() == t_eph::CNV3) {
         double health;
-        if ( readDbl(line, pos[0], fieldLen, _SISMAI        ) ||
-             readDbl(line, pos[1], fieldLen,  health        ) ||
-             readDbl(line, pos[2], fieldLen, _INTEGRITYF_B2b) ||
-             readDbl(line, pos[3], fieldLen, _TGD_B2bI)     )  {
+        if (readDbl(line, pos[0], fieldLen, _SISMAI)
+            || readDbl(line, pos[1], fieldLen, health)
+            || readDbl(line, pos[2], fieldLen, _INTEGRITYF_B2b)
+            || readDbl(line, pos[3], fieldLen, _TGD_B2bI)) {
           _checkState = bad;
           return;
         }
         _health = int(health);
-      }
-      else { // D1, D2 or undefined
+      } else { // D1, D2 or undefined
         double aodc;
-        if ( readDbl(line, pos[0], fieldLen, _TOT) ||
-             readDbl(line, pos[1], fieldLen, aodc) ) {
+        if (readDbl(line, pos[0], fieldLen, _TOT)
+            || readDbl(line, pos[1], fieldLen, aodc)) {
           _checkState = bad;
           return;
@@ -2145,28 +2255,26 @@
     // BROADCAST ORBIT - 8
     // =====================
-    else if ( iLine == 8 ) {
+    else if (iLine == 8) {
       double health;
-      if      (navType() == t_eph::CNV1) {
-        if ( readDbl(line, pos[0], fieldLen, _SISMAI        ) ||
-             readDbl(line, pos[1], fieldLen,  health        ) ||
-             readDbl(line, pos[2], fieldLen, _INTEGRITYF_B1C) ||
-             readDbl(line, pos[3], fieldLen, _IODC)     )  {
+      if (ephType() == t_eph::CNV1) {
+        if (readDbl(line, pos[0], fieldLen, _SISMAI)
+            || readDbl(line, pos[1], fieldLen, health)
+            || readDbl(line, pos[2], fieldLen, _INTEGRITYF_B1C)
+            || readDbl(line, pos[3], fieldLen, _IODC)) {
           _checkState = bad;
           return;
         }
         _health = int(health);
-      }
-      else if (navType() == t_eph::CNV2) {
-        if ( readDbl(line, pos[0], fieldLen, _SISMAI           ) ||
-             readDbl(line, pos[1], fieldLen,  health           ) ||
-             readDbl(line, pos[2], fieldLen, _INTEGRITYF_B2aB1C) ||
-             readDbl(line, pos[3], fieldLen, _IODC)            )  {
+      } else if (ephType() == t_eph::CNV2) {
+        if (readDbl(line, pos[0], fieldLen, _SISMAI)
+            || readDbl(line, pos[1], fieldLen, health)
+            || readDbl(line, pos[2], fieldLen, _INTEGRITYF_B2aB1C)
+            || readDbl(line, pos[3], fieldLen, _IODC)) {
           _checkState = bad;
           return;
         }
         _health = int(health);
-      }
-      else if (navType() == t_eph::CNV3) {
-        if ( readDbl(line, pos[0], fieldLen, _TOT)) {
+      } else if (ephType() == t_eph::CNV3) {
+        if (readDbl(line, pos[0], fieldLen, _TOT)) {
           _checkState = bad;
           return;
@@ -2178,19 +2286,18 @@
     // BROADCAST ORBIT - 9
     // =====================
-    else if ( iLine == 9 ) {
-
-      if      (navType() == t_eph::CNV1 ||
-               navType() == t_eph::CNV2) {
-        if ( readDbl(line, pos[0], fieldLen, _TOT) ||
-             readDbl(line, pos[3], fieldLen, _IODE) ) {
-          _checkState = bad;
-          return;
-        }
-      }
-
-    }
-  }
-
-   _TOE.setBDS(int(_BDTweek), _TOEsec);
+    else if (iLine == 9) {
+
+      if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2) {
+        if (readDbl(line, pos[0], fieldLen, _TOT)
+            || readDbl(line, pos[3], fieldLen, _IODE)) {
+          _checkState = bad;
+          return;
+        }
+      }
+
+    }
+  }
+
+  _TOE.setBDS(int(_BDTweek), _TOEsec);
   // remark: actually should be computed from second_tot
   //         but it seems to be unreliable in RINEX files
@@ -2201,12 +2308,13 @@
 ////////////////////////////////////////////////////////////////////////////
 unsigned int t_ephBDS::IOD() const {
-  return (int(_TOC.gpssec())/720) % 240;   //return (int(_TOEsec)/720) % 240;
+  return (int(_TOC.gpssec()) / 720) % 240;   //return (int(_TOEsec)/720) % 240;
 }
 
 // Compute BDS Satellite Position (virtual)
 //////////////////////////////////////////////////////////////////////////////
-t_irc t_ephBDS::position(int GPSweek, double GPSweeks, double* xc, double* vv) const {
-
-  static const double gmBDS    = 398.6004418e12;
+t_irc t_ephBDS::position(int GPSweek, double GPSweeks, double *xc,
+    double *vv) const {
+
+  static const double gmBDS = 398.6004418e12;
   static const double omegaBDS = 7292115.0000e-11;
 
@@ -2221,48 +2329,48 @@
   double a0 = _sqrt_A * _sqrt_A;
 
-  double n0 = sqrt(gmBDS/(a0*a0*a0));
+  double n0 = sqrt(gmBDS / (a0 * a0 * a0));
   double tk = tt - _TOE;
-  double n  = n0 + _Delta_n;
-  double M  = _M0 + n*tk;
-  double E  = M;
+  double n = n0 + _Delta_n;
+  double M = _M0 + n * tk;
+  double E = M;
   double E_last;
-  int    nLoop = 0;
+  int nLoop = 0;
   do {
     E_last = E;
-    E = M + _e*sin(E);
+    E = M + _e * sin(E);
 
     if (++nLoop == 100) {
       return failure;
     }
-  } while ( fabs(E-E_last)*a0 > 0.001 );
-
-  double v      = atan2(sqrt(1-_e*_e) * sin(E), cos(E) - _e);
-  double u0     = v + _omega;
-  double sin2u0 = sin(2*u0);
-  double cos2u0 = cos(2*u0);
-  double r      = a0*(1 - _e*cos(E)) + _Crc*cos2u0 + _Crs*sin2u0;
-  double i      = _i0 + _IDOT*tk     + _Cic*cos2u0 + _Cis*sin2u0;
-  double u      = u0                 + _Cuc*cos2u0 + _Cus*sin2u0;
-  double xp     = r*cos(u);
-  double yp     = r*sin(u);
+  } while (fabs(E - E_last) * a0 > 0.001);
+
+  double v = atan2(sqrt(1 - _e * _e) * sin(E), cos(E) - _e);
+  double u0 = v + _omega;
+  double sin2u0 = sin(2 * u0);
+  double cos2u0 = cos(2 * u0);
+  double r = a0 * (1 - _e * cos(E)) + _Crc * cos2u0 + _Crs * sin2u0;
+  double i = _i0 + _IDOT * tk + _Cic * cos2u0 + _Cis * sin2u0;
+  double u = u0 + _Cuc * cos2u0 + _Cus * sin2u0;
+  double xp = r * cos(u);
+  double yp = r * sin(u);
   double toesec = (_TOE.gpssec() - 14.0);
   double sinom = 0;
   double cosom = 0;
-  double sini  = 0;
-  double cosi  = 0;
+  double sini = 0;
+  double cosi = 0;
 
   // Velocity
   // --------
-  double tanv2 = tan(v/2);
-  double dEdM  = 1 / (1 - _e*cos(E));
-  double dotv  = sqrt((1.0 + _e)/(1.0 - _e)) / cos(E/2)/cos(E/2)
-                 / (1 + tanv2*tanv2) * dEdM * n;
-  double dotu  = dotv + (-_Cuc*sin2u0 + _Cus*cos2u0)*2*dotv;
-  double doti  = _IDOT + (-_Cic*sin2u0 + _Cis*cos2u0)*2*dotv;
-  double dotr  = a0 * _e*sin(E) * dEdM * n
-                + (-_Crc*sin2u0 + _Crs*cos2u0)*2*dotv;
-
-  double dotx  = dotr*cos(u) - r*sin(u)*dotu;
-  double doty  = dotr*sin(u) + r*cos(u)*dotu;
+  double tanv2 = tan(v / 2);
+  double dEdM = 1 / (1 - _e * cos(E));
+  double dotv = sqrt((1.0 + _e) / (1.0 - _e)) / cos(E / 2) / cos(E / 2)
+      / (1 + tanv2 * tanv2) * dEdM * n;
+  double dotu = dotv + (-_Cuc * sin2u0 + _Cus * cos2u0) * 2 * dotv;
+  double doti = _IDOT + (-_Cic * sin2u0 + _Cis * cos2u0) * 2 * dotv;
+  double dotr = a0 * _e * sin(E) * dEdM * n
+      + (-_Crc * sin2u0 + _Crs * cos2u0) * 2 * dotv;
+
+  double dotx = dotr * cos(u) - r * sin(u) * dotu;
+  double doty = dotr * sin(u) + r * cos(u) * dotu;
 
   const double iMaxGEO = 10.0 / 180.0 * M_PI;
@@ -2271,14 +2379,14 @@
   // ------------------
   if (_i0 > iMaxGEO) {
-    double OM = _OMEGA0 + (_OMEGADOT - omegaBDS)*tk - omegaBDS*toesec;
+    double OM = _OMEGA0 + (_OMEGADOT - omegaBDS) * tk - omegaBDS * toesec;
 
     sinom = sin(OM);
     cosom = cos(OM);
-    sini  = sin(i);
-    cosi  = cos(i);
-
-    xc[0] = xp*cosom - yp*cosi*sinom;
-    xc[1] = xp*sinom + yp*cosi*cosom;
-    xc[2] = yp*sini;
+    sini = sin(i);
+    cosi = cos(i);
+
+    xc[0] = xp * cosom - yp * cosi * sinom;
+    xc[1] = xp * sinom + yp * cosi * cosom;
+    xc[2] = yp * sini;
 
     // Velocity
@@ -2287,13 +2395,12 @@
     double dotom = _OMEGADOT - t_CST::omega;
 
-    vv[0]  = cosom  *dotx   - cosi*sinom   *doty    // dX / dr
-           - xp*sinom*dotom - yp*cosi*cosom*dotom   // dX / dOMEGA
-                            + yp*sini*sinom*doti;   // dX / di
-
-    vv[1]  = sinom  *dotx   + cosi*cosom   *doty
-           + xp*cosom*dotom - yp*cosi*sinom*dotom
-                            - yp*sini*cosom*doti;
-
-    vv[2]  = sini   *doty   + yp*cosi      *doti;
+    vv[0] = cosom * dotx - cosi * sinom * doty    // dX / dr
+    - xp * sinom * dotom - yp * cosi * cosom * dotom   // dX / dOMEGA
+    + yp * sini * sinom * doti;   // dX / di
+
+    vv[1] = sinom * dotx + cosi * cosom * doty + xp * cosom * dotom
+        - yp * cosi * sinom * dotom - yp * sini * cosom * doti;
+
+    vv[2] = sini * doty + yp * cosi * doti;
 
   }
@@ -2302,21 +2409,22 @@
   // -------------
   else {
-    double OM    = _OMEGA0 + _OMEGADOT*tk - omegaBDS*toesec;
-    double ll    = omegaBDS*tk;
+    double OM = _OMEGA0 + _OMEGADOT * tk - omegaBDS * toesec;
+    double ll = omegaBDS * tk;
 
     sinom = sin(OM);
     cosom = cos(OM);
-    sini  = sin(i);
-    cosi  = cos(i);
-
-    double xx = xp*cosom - yp*cosi*sinom;
-    double yy = xp*sinom + yp*cosi*cosom;
-    double zz = yp*sini;
+    sini = sin(i);
+    cosi = cos(i);
+
+    double xx = xp * cosom - yp * cosi * sinom;
+    double yy = xp * sinom + yp * cosi * cosom;
+    double zz = yp * sini;
 
     Matrix RX = BNC_PPP::t_astro::rotX(-5.0 / 180.0 * M_PI);
     Matrix RZ = BNC_PPP::t_astro::rotZ(ll);
 
-    ColumnVector X1(3); X1 << xx << yy << zz;
-    ColumnVector X2 = RZ*RX*X1;
+    ColumnVector X1(3);
+    X1 << xx << yy << zz;
+    ColumnVector X2 = RZ * RX * X1;
 
     xc[0] = X2(1);
@@ -2326,27 +2434,32 @@
     double dotom = _OMEGADOT;
 
-    double vx  = cosom   *dotx  - cosi*sinom   *doty
-               - xp*sinom*dotom - yp*cosi*cosom*dotom
-                                + yp*sini*sinom*doti;
-
-    double vy  = sinom   *dotx  + cosi*cosom   *doty
-               + xp*cosom*dotom - yp*cosi*sinom*dotom
-                                - yp*sini*cosom*doti;
-
-    double vz  = sini    *doty  + yp*cosi      *doti;
-
-    ColumnVector V(3); V << vx << vy << vz;
-
-    Matrix RdotZ(3,3);
+    double vx = cosom * dotx - cosi * sinom * doty - xp * sinom * dotom
+        - yp * cosi * cosom * dotom + yp * sini * sinom * doti;
+
+    double vy = sinom * dotx + cosi * cosom * doty + xp * cosom * dotom
+        - yp * cosi * sinom * dotom - yp * sini * cosom * doti;
+
+    double vz = sini * doty + yp * cosi * doti;
+
+    ColumnVector V(3);
+    V << vx << vy << vz;
+
+    Matrix RdotZ(3, 3);
     double C = cos(ll);
     double S = sin(ll);
-    Matrix UU(3,3);
-    UU[0][0] =  -S;  UU[0][1] =  +C;  UU[0][2] = 0.0;
-    UU[1][0] =  -C;  UU[1][1] =  -S;  UU[1][2] = 0.0;
-    UU[2][0] = 0.0;  UU[2][1] = 0.0;  UU[2][2] = 0.0;
+    Matrix UU(3, 3);
+    UU[0][0] = -S;
+    UU[0][1] = +C;
+    UU[0][2] = 0.0;
+    UU[1][0] = -C;
+    UU[1][1] = -S;
+    UU[1][2] = 0.0;
+    UU[2][0] = 0.0;
+    UU[2][1] = 0.0;
+    UU[2][2] = 0.0;
     RdotZ = omegaBDS * UU;
 
     ColumnVector VV(3);
-    VV = RZ*RX*V + RdotZ*RX*X1;
+    VV = RZ * RX * V + RdotZ * RX * X1;
 
     vv[0] = VV(1);
@@ -2356,5 +2469,5 @@
 
   double tc = tt - _TOC;
-  xc[3] = _clock_bias + _clock_drift*tc + _clock_driftrate*tc*tc;
+  xc[3] = _clock_bias + _clock_drift * tc + _clock_driftrate * tc * tc;
 
 //  dotC  = _clock_drift + _clock_driftrate*tc
@@ -2363,12 +2476,11 @@
   // Relativistic Correction
   // -----------------------
-  xc[3] -= 4.442807309e-10 * _e * sqrt(a0) *sin(E);
-
-  xc[4] = _clock_drift + _clock_driftrate*tc;
+  xc[3] -= 4.442807309e-10 * _e * sqrt(a0) * sin(E);
+
+  xc[4] = _clock_drift + _clock_driftrate * tc;
   xc[5] = _clock_driftrate;
 
   return success;
 }
-
 
 // Health status of SBAS Ephemeris (virtual)
@@ -2376,7 +2488,6 @@
 unsigned int t_ephBDS::isUnhealthy() const {
 
-  if (navType() == t_eph::CNV1 ||
-      navType() == t_eph::CNV2 ||
-      navType() == t_eph::CNV3) {
+  if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2
+      || ephType() == t_eph::CNV3) {
     return static_cast<unsigned int>(_health);
   }
@@ -2385,5 +2496,4 @@
 
 }
-
 
 // RINEX Format String
@@ -2391,13 +2501,12 @@
 QString t_ephBDS::toString(double version) const {
 
-  QString navStr = navTypeString(_navType, _prn, version);
-  QString rnxStr = navStr + rinexDateStr(_TOC-14.0, _prn, version);
+  QString ephStr = ephTypeStr(_ephType, _prn, version);
+  QString rnxStr = ephStr + rinexDateStr(_TOC - 14.0, _prn, version);
 
   QTextStream out(&rnxStr);
 
-  out << QString("%1%2%3\n")
-    .arg(_clock_bias,      19, 'e', 12)
-    .arg(_clock_drift,     19, 'e', 12)
-    .arg(_clock_driftrate, 19, 'e', 12);
+  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 fmt = version < 3.0 ? "   %1%2%3%4\n" : "    %1%2%3%4\n";
@@ -2405,108 +2514,76 @@
   // BROADCAST ORBIT - 1
   // =====================
-  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);
+  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
   // =====================
-  out << QString(fmt)
-    .arg(_Cuc,    19, 'e', 12)
-    .arg(_e,      19, 'e', 12)
-    .arg(_Cus,    19, 'e', 12)
-    .arg(_sqrt_A, 19, 'e', 12);
+  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
   // =====================
-  out << QString(fmt)
-    .arg(_TOEsec, 19, 'e', 12)
-    .arg(_Cic,    19, 'e', 12)
-    .arg(_OMEGA0, 19, 'e', 12)
-    .arg(_Cis,    19, 'e', 12);
+  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);
+  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
   // =====================
-  if (navType() == t_eph::CNV1 ||
-      navType() == t_eph::CNV2 ||
-      navType() == t_eph::CNV3 ) {
-    out << QString(fmt)
-      .arg(_IDOT,        19, 'e', 12)
-      .arg(_Delta_n_dot, 19, 'e', 12)
-      .arg(_satType,     19, 'e', 12)
-      .arg(_top,         19, 'e', 12);
-  }
-  else { // D1, D2, undefined
-    out << QString(fmt)
-      .arg(_IDOT,    19, 'e', 12)
-      .arg("",            19, QChar(' '))
-      .arg(_BDTweek, 19, 'e', 12)
-      .arg("",            19, QChar(' '));
+  if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2
+      || ephType() == t_eph::CNV3) {
+    out
+        << QString(fmt).arg(_IDOT, 19, 'e', 12).arg(_Delta_n_dot, 19, 'e', 12).arg(
+            _satType, 19, 'e', 12).arg(_top, 19, 'e', 12);
+  } else { // D1, D2, undefined
+    out
+        << QString(fmt).arg(_IDOT, 19, 'e', 12).arg("", 19, QChar(' ')).arg(
+            _BDTweek, 19, 'e', 12).arg("", 19, QChar(' '));
   }
   // =====================
   // BROADCAST ORBIT - 6
   // =====================
-  if (navType() == t_eph::CNV1 ||
-      navType() == t_eph::CNV2 ||
-      navType() == t_eph::CNV3 ) {
-    out << QString(fmt)
-      .arg(_SISAI_oe,  19, 'e', 12)
-      .arg(_SISAI_ocb, 19, 'e', 12)
-      .arg(_SISAI_oc1, 19, 'e', 12)
-      .arg(_SISAI_oc2, 19, 'e', 12);
-  }
-  else { // D1, D2, undefined
-    out << QString(fmt)
-      .arg(_URA,           19, 'e', 12)
-      .arg(double(_SatH1), 19, 'e', 12)
-      .arg(_TGD1,          19, 'e', 12)
-      .arg(_TGD2,          19, 'e', 12);
+  if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2
+      || ephType() == t_eph::CNV3) {
+    out
+        << QString(fmt).arg(_SISAI_oe, 19, 'e', 12).arg(_SISAI_ocb, 19, 'e', 12).arg(
+            _SISAI_oc1, 19, 'e', 12).arg(_SISAI_oc2, 19, 'e', 12);
+  } else { // D1, D2, undefined
+    out
+        << QString(fmt).arg(_URA, 19, 'e', 12).arg(double(_SatH1), 19, 'e', 12).arg(
+            _TGD1, 19, 'e', 12).arg(_TGD2, 19, 'e', 12);
   }
   // =====================
   // BROADCAST ORBIT - 7
   // =====================
-  if      (navType() == t_eph::CNV1) {
-    out << QString(fmt)
-      .arg(_ISC_B1Cd, 19, 'e', 12)
-      .arg("",        19, QChar(' '))
-      .arg(_TGD_B1Cp, 19, 'e', 12)
-      .arg(_TGD_B2ap, 19, 'e', 12);
-  }
-  else if (navType() == t_eph::CNV2) {
-    out << QString(fmt)
-      .arg("",        19, QChar(' '))
-      .arg(_ISC_B2ad, 19, 'e', 12)
-      .arg(_TGD_B1Cp, 19, 'e', 12)
-      .arg(_TGD_B2ap, 19, 'e', 12);
-  }
-  else if (navType() == t_eph::CNV3) {
-    out << QString(fmt)
-      .arg(_SISMAI,         19, 'e', 12)
-      .arg(double(_health), 19, 'e', 12)
-      .arg(_INTEGRITYF_B2b, 19, 'e', 12)
-      .arg(_TGD_B2bI,       19, 'e', 12);
-  }
-  else { // D1, D2, undefined
+  if (ephType() == 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) {
+    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) {
+    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
     double tots = 0.0;
-    if (_receptDateTime.isValid()) {// RTCM stream input
+    if (_receptDateTime.isValid()) { // RTCM stream input
       tots = _TOE.bdssec();
-    }
-    else { // RINEX input
+    } else { // RINEX input
       tots = _TOT;
     }
-    out << QString(fmt)
-      .arg(tots,          19, 'e', 12)
-      .arg(double(_AODC), 19, 'e', 12)
-      .arg("",            19, QChar(' '))
-      .arg("",            19, QChar(' '));
+    out
+        << QString(fmt).arg(tots, 19, 'e', 12).arg(double(_AODC), 19, 'e', 12).arg(
+            "", 19, QChar(' ')).arg("", 19, QChar(' '));
   }
 
@@ -2514,24 +2591,16 @@
   // BROADCAST ORBIT - 8
   // =====================
-  if      (navType() == 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 (navType() == 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 (navType() == t_eph::CNV3) {
-    out << QString(fmt)
-      .arg(_TOT,          19, 'e', 12)
-      .arg("",            19, QChar(' '))
-      .arg("",            19, QChar(' '))
-      .arg("",            19, QChar(' '));
+  if (ephType() == 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) {
+    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) {
+    out
+        << QString(fmt).arg(_TOT, 19, 'e', 12).arg("", 19, QChar(' ')).arg("",
+            19, QChar(' ')).arg("", 19, QChar(' '));
   }
 
@@ -2539,13 +2608,9 @@
   // BROADCAST ORBIT - 9
   // =====================
-  if      (navType() == t_eph::CNV1 ||
-           navType() == t_eph::CNV2) {
-    out << QString(fmt)
-      .arg(_TOT,          19, 'e', 12)
-      .arg("",            19, QChar(' '))
-      .arg("",            19, QChar(' '))
-      .arg(_IODE,         19, 'e', 12);
-  }
-
+  if (ephType() == t_eph::CNV1 || ephType() == t_eph::CNV2) {
+    out
+        << QString(fmt).arg(_TOT, 19, 'e', 12).arg("", 19, QChar(' ')).arg("",
+            19, QChar(' ')).arg(_IODE, 19, 'e', 12);
+  }
 
   return rnxStr;
Index: /trunk/BNC/src/ephemeris.h
===================================================================
--- /trunk/BNC/src/ephemeris.h	(revision 10576)
+++ /trunk/BNC/src/ephemeris.h	(revision 10577)
@@ -13,4 +13,5 @@
 class t_orbCorr;
 class t_clkCorr;
+//  enum e_navType {EPH, STO, EOP, ION};
 
 class t_eph {
@@ -18,5 +19,5 @@
   enum e_type {unknown, GPS, QZSS, GLONASS, Galileo, SBAS, BDS, IRNSS};
   enum e_checkState {unchecked, ok, bad, outdated, unhealthy};
-  enum e_navType {undefined, LNAV, FDMA, FNAV, INAF, D1, D2, SBASL1, CNAV, CNV1, CNV2, CNV3};
+  enum e_ephType {undefined, LNAV, FDMA, FNAV, INAF, D1, D2, SBASL1, CNAV, CNV1, CNV2, CNV3, L1NV, L1OC, L3OC};
 
   t_eph();
@@ -27,8 +28,8 @@
   virtual unsigned int IOD() const = 0;
   virtual unsigned int isUnhealthy() const = 0;
-  virtual int     slotNum() const {return 0;}
+  virtual int slotNum() const {return 0;}
   bncTime TOC() const {return _TOC;}
   bool    isNewerThan(const t_eph* eph) const {return earlierTime(eph, this);}
-  void setCheckState(e_checkState checkState) {_checkState = checkState;}
+  void    setCheckState(e_checkState checkState) {_checkState = checkState;}
   e_checkState checkState() const {return _checkState;}
   QString checkStateToString() {
@@ -42,16 +43,16 @@
     }
   }
-  e_navType navType() const {return _navType;}
-  t_irc setNavType(QString navTypeStr);
-
-  t_prn   prn() const {return _prn;}
-  t_irc   getCrd(const bncTime& tt, ColumnVector& xc, ColumnVector& vv, bool useCorr) const;
-  void    setOrbCorr(const t_orbCorr* orbCorr);
-  void    setClkCorr(const t_clkCorr* clkCorr);
+  e_ephType ephType() const {return _ephType;}
+  t_irc setEphType(QString ephTypeStr);
+
+  t_prn prn() const {return _prn;}
+  t_irc getCrd(const bncTime& tt, ColumnVector& xc, ColumnVector& vv, bool useCorr) const;
+  void setOrbCorr(const t_orbCorr* orbCorr);
+  void setClkCorr(const t_clkCorr* clkCorr);
   const QDateTime& receptDateTime() const {return _receptDateTime;}
   const QString receptStaID() const {return _receptStaID;}
   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 navTypeString(e_navType navType, const t_prn& prn, double version);
+  static QString ephTypeStr(e_ephType ephType, 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();}
@@ -64,5 +65,5 @@
   QString          _receptStaID;
   e_checkState     _checkState;
-  e_navType        _navType; // defined in RINEX 4
+  e_ephType        _ephType; // defined in RINEX 4
   t_orbCorr*       _orbCorr;
   t_clkCorr*       _clkCorr;
@@ -106,15 +107,24 @@
     _top             = 0.0;
     _Delta_n_dot     = 0.0;
-   _URAI_NED0        = 0.0;
-   _URAI_NED1        = 0.0;
-   _URAI_NED2        = 0.0;
-   _URAI_ED          = 0.0;
-   _ISC_L1CA         = 0.0;
-   _ISC_L2C          = 0.0;
-   _ISC_L5I5         = 0.0;
-   _ISC_L5Q5         = 0.0;
-   _ISC_L1Cd         = 0.0;
-   _ISC_L1Cp         = 0.0;
-   _wnop             = 0.0;
+    _URAI            = 0.0;
+    _URAI_NED0       = 0.0;
+    _URAI_NED1       = 0.0;
+    _URAI_NED2       = 0.0;
+    _URAI_ED         = 0.0;
+    _ISC_L1CA        = 0.0;
+    _ISC_L2C         = 0.0;
+    _ISC_L5I5        = 0.0;
+    _ISC_L5Q5        = 0.0;
+    _ISC_L1Cd        = 0.0;
+    _ISC_L1Cp        = 0.0;
+    _RSF             = 0.0;
+    _ISC_S           = 0.0;
+    _ISC_L1D         = 0.0;
+    _ISC_L1P         = 0.0;
+    _wnop            = 0.0;
+    _intSF           = -1;
+    _ephSF           = -1;
+    _L2Cphasing      = -1;
+    _alert           = -1;
     _receptStaID     = "";
   }
@@ -180,4 +190,5 @@
   double  _Delta_n_dot;     // [rad/s^2]
 
+  double _URAI;             // [] user range accuracy index
   double _URAI_NED0;        // []
   double _URAI_NED1;        // []
@@ -185,5 +196,5 @@
   double _URAI_ED;          // []
 
-  double _ISC_L1CA;         // [s]
+  double _ISC_L1CA;         // [s] inter signal correction
   double _ISC_L2C;          // [s]
   double _ISC_L5I5;         // [s]
@@ -192,5 +203,15 @@
   double _ISC_L1Cp;         // [s]
 
-  double _wnop;             // GPS continuous week number with the ambiguity resolved
+  double _RSF;              // [-] Reference Signal Flag for IRNSS
+  double _ISC_S;            // [s]
+  double _ISC_L1D;          // [s]
+  double _ISC_L1P;          // [s]
+
+  bool   _intSF;            // [-] integrity status flag
+  bool   _ephSF;            // [-] ephemeris status flag (QZSS)
+  bool   _L2Cphasing;       // [-] L2C phasing flag
+  bool   _alert;            // [-] alert flag
+
+  double _wnop;             // GPS continuous week number with the ambiguity resolved (same as _TOEweek?)
 };
 
@@ -330,4 +351,10 @@
     _BGD_1_5B        = 0.0;
     _TOT             = 0.0;
+    bool    _inav;
+    /** Data comes from F/NAV when <code>true</code> */
+    bool    _fnav;
+    bool    _e1DataInValid;
+    bool    _e5aDataInValid;
+    bool    _e5bDataInValid;
     _receptStaID     = "";
   };
Index: /trunk/BNC/src/rinex/reqcanalyze.cpp
===================================================================
--- /trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 10576)
+++ /trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 10577)
@@ -1019,5 +1019,5 @@
             *_log  << "                     "
                 << navFi.fileName() << ' ' << QString(": WRONG %2:%3\n")
-                           .arg(eph->navTypeString(eph->navType(), eph->prn(), 99.0))
+                           .arg(eph->ephTypeStr(eph->ephType(), 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 10576)
+++ /trunk/BNC/src/rinex/reqcedit.cpp	(revision 10577)
@@ -704,8 +704,8 @@
 
     if (outNavFile.version() < 4.0) {
-      if (eph->navType() == t_eph::CNAV ||
-          eph->navType() == t_eph::CNV1 ||
-          eph->navType() == t_eph::CNV2 ||
-          eph->navType() == t_eph::CNV3) {
+      if (eph->ephType() == t_eph::CNAV ||
+          eph->ephType() == t_eph::CNV1 ||
+          eph->ephType() == t_eph::CNV2 ||
+          eph->ephType() == t_eph::CNV3) {
         continue;
       }
@@ -713,5 +713,5 @@
 
     if (outNavFile.version() >= 4.0 &&
-        eph->navType() == t_eph::undefined) { // input files < version 4.0
+        eph->ephType() == t_eph::undefined) { // input files < version 4.0
       continue;
     }
Index: /trunk/BNC/src/rinex/rnxnavfile.cpp
===================================================================
--- /trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 10576)
+++ /trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 10577)
@@ -149,5 +149,5 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_rnxNavFile::read(QTextStream* stream) {
-  QString navType;
+  QString ephType;
 
   while (stream->status() == QTextStream::Ok && !stream->atEnd()) {
@@ -171,5 +171,5 @@
       prn = hlp.at(2);
       sys = prn[0].toLatin1();
-      navType = hlp.at(3);
+      ephType = hlp.at(3);
 
       // ALL Non-EPH messages are currently ignored
@@ -194,6 +194,6 @@
                  sys == 'J' || sys == 'I') {
           lines2skip = 3;
-          if (sys == 'I' && navType == "L1NV" || // I: KLOB, NEQN
-              sys == 'J' && navType == "CNVX") { // J: WIDE, JAPN
+          if ((sys == 'I' && ephType == "L1NV") || // I: KLOB, NEQN
+              (sys == 'J' && ephType == "CNVX")) { // J: WIDE, JAPN
             navSubType = hlp.at(4);
             if      (navSubType == "KLOB") {
@@ -273,5 +273,5 @@
 
     if (version() >= 4.0 && key == "EPH") {
-      if (eph->setNavType(navType) != success) {
+      if (eph->setEphType(ephType) != success) {
         delete eph;
         continue;
