Index: /trunk/BNC/ChangeLog.txt
===================================================================
--- /trunk/BNC/ChangeLog.txt	(revision 8167)
+++ /trunk/BNC/ChangeLog.txt	(revision 8168)
@@ -2,4 +2,5 @@
  BNC VERSION 2.13.0 (xx.xx.xxxx) current
 --------------------------------------------------------------------------------
+    Added   (26.10.2017): IRNSS support is added in RINEX QC
     Added   (12.08.2016): resp. config keywords in context help
     Added   (08.08.2016): some informations about the data source is added as
Index: /trunk/BNC/src/bncconst.cpp
===================================================================
--- /trunk/BNC/src/bncconst.cpp	(revision 8167)
+++ /trunk/BNC/src/bncconst.cpp	(revision 8168)
@@ -54,4 +54,6 @@
   case t_frequency::C7:    return 1207140000.0;
   case t_frequency::C6:    return 1268520000.0;
+  case t_frequency::I5:    return 1176450000.0;
+  case t_frequency::I9:    return 2492028000.0;
   case t_frequency::dummy:
   case t_frequency::max:   return 0.0;
Index: /trunk/BNC/src/bncconst.h
===================================================================
--- /trunk/BNC/src/bncconst.h	(revision 8167)
+++ /trunk/BNC/src/bncconst.h	(revision 8168)
@@ -32,9 +32,9 @@
 class t_frequency {
  public:
-  enum type {dummy = 0, G1, G2, G5, R1, R2, 
-                        E1, // E1  / 1575.42          
-                        E5, // E5a / 1176.45          
-                        E7, // E5b / 1207.140         
-                        E8, // E5(E5a+E5b) / 1191.795 
+  enum type {dummy = 0, G1, G2, G5, R1, R2,
+                        E1, // E1  / 1575.42
+                        E5, // E5a / 1176.45
+                        E7, // E5b / 1207.140
+                        E8, // E5(E5a+E5b) / 1191.795
                         E6, // E6  / 1278.75
                         J1, // 1575.42
@@ -47,4 +47,6 @@
                         C7, // 1207.14
                         C6, // 1268.52
+                        I5, // 1176.45
+                        I9, // 2492.028
              max};
 
@@ -69,4 +71,6 @@
     else if (tt == C7) return "C7";
     else if (tt == C6) return "C6";
+    else if (tt == I5) return "I5";
+    else if (tt == I9) return "I9";
     return std::string();
   }
@@ -91,4 +95,6 @@
     else if (s == "C7") return C7;
     else if (s == "C6") return C6;
+    else if (s == "I5") return I5;
+    else if (s == "I9") return I9;
     return type();
   }
Index: /trunk/BNC/src/bncephuser.cpp
===================================================================
--- /trunk/BNC/src/bncephuser.cpp	(revision 8167)
+++ /trunk/BNC/src/bncephuser.cpp	(revision 8168)
@@ -235,4 +235,8 @@
     return;
   }
+  else if (eph->type() == t_eph::IRNSS   && timeDiff > 4*3600) { // update interval: 2h, data sets are valid for 4 hours
+    eph->setCheckState(t_eph::outdated);
+    return;
+  }
 
 
@@ -278,4 +282,8 @@
       return;
     }
+    else if  (eph->type() == t_eph::IRNSS  && dt > 4*3600) {
+      ephL->setCheckState(t_eph::outdated);
+      return;
+    }
 
     if (diff < MAXDIFF && diffC < MAXDIFF) {
Index: /trunk/BNC/src/ephemeris.cpp
===================================================================
--- /trunk/BNC/src/ephemeris.cpp	(revision 8167)
+++ /trunk/BNC/src/ephemeris.cpp	(revision 8168)
@@ -184,5 +184,7 @@
 
       if (prnStr.size() == 1 &&
-          (prnStr[0] == 'G' || prnStr[0] == 'J')) {
+          (prnStr[0] == 'G' ||
+           prnStr[0] == 'J' ||
+           prnStr[0] == 'I')) {
         in >> n;
         prnStr.append(n);
@@ -195,4 +197,7 @@
       else if (prnStr.at(0) == 'J') {
         _prn.set('J', prnStr.mid(1).toInt());
+      }
+      else if (prnStr.at(0) == 'I') {
+        _prn.set('I', prnStr.mid(1).toInt());
       }
       else {
@@ -257,5 +262,5 @@
     }
 
-    else if ( iLine == 5 ) {
+    else if ( iLine == 5 && type() != t_eph::IRNSS) {
       if ( readDbl(line, pos[0], fieldLen, _IDOT   ) ||
            readDbl(line, pos[1], fieldLen, _L2Codes) ||
@@ -266,10 +271,25 @@
       }
     }
-
-    else if ( iLine == 6 ) {
+    else if ( iLine == 5 && type() == t_eph::IRNSS) {
+      if ( readDbl(line, pos[0], fieldLen, _IDOT   ) ||
+           readDbl(line, pos[2], fieldLen, _TOEweek) ) {
+        _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   ) ||
            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;
@@ -413,15 +433,33 @@
     .arg(_OMEGADOT, 19, 'e', 12);
 
-  out << QString(fmt)
-    .arg(_IDOT,    19, 'e', 12)
-    .arg(_L2Codes, 19, 'e', 12)
-    .arg(_TOEweek, 19, 'e', 12)
-    .arg(_L2PFlag, 19, 'e', 12);
-
-  out << QString(fmt)
-    .arg(_ura,    19, 'e', 12)
-    .arg(_health, 19, 'e', 12)
-    .arg(_TGD,    19, 'e', 12)
-    .arg(_IODC,   19, 'e', 12);
+  if (type() == t_eph::IRNSS) {
+    out << QString(fmt)
+      .arg(_IDOT,    19, 'e', 12)
+      .arg("",       19, QChar(' '))
+      .arg(_TOEweek, 19, 'e', 12)
+      .arg("",       19, QChar(' '));
+  }
+  else {
+    out << QString(fmt)
+      .arg(_IDOT,    19, 'e', 12)
+      .arg(_L2Codes, 19, 'e', 12)
+      .arg(_TOEweek, 19, 'e', 12)
+      .arg(_L2PFlag, 19, 'e', 12);
+  }
+
+  if (type() == t_eph::IRNSS) {
+    out << QString(fmt)
+      .arg(_ura,    19, 'e', 12)
+      .arg(_health, 19, 'e', 12)
+      .arg(_TGD,    19, 'e', 12)
+      .arg("",       19, QChar(' '));
+  }
+  else {
+    out << QString(fmt)
+      .arg(_ura,    19, 'e', 12)
+      .arg(_health, 19, 'e', 12)
+      .arg(_TGD,    19, 'e', 12)
+      .arg(_IODC,   19, 'e', 12);
+  }
 
   double tot = _TOT;
@@ -429,9 +467,18 @@
     tot = 0.0;
   }
-  out << QString(fmt)
-    .arg(tot,          19, 'e', 12)
-    .arg(_fitInterval, 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 {
+    out << QString(fmt)
+      .arg(tot,          19, 'e', 12)
+      .arg(_fitInterval, 19, 'e', 12)
+      .arg("",           19, QChar(' '))
+      .arg("",           19, QChar(' '));
+  }
 
   return rnxStr;
Index: /trunk/BNC/src/ephemeris.h
===================================================================
--- /trunk/BNC/src/ephemeris.h	(revision 8167)
+++ /trunk/BNC/src/ephemeris.h	(revision 8168)
@@ -17,5 +17,5 @@
 class t_eph {
  public:
-  enum e_type {unknown, GPS, QZSS, GLONASS, Galileo, SBAS, BDS};
+  enum e_type {unknown, GPS, QZSS, GLONASS, Galileo, SBAS, BDS, IRNSS};
   enum e_checkState {unchecked, ok, bad, outdated};
 
@@ -89,5 +89,13 @@
   virtual ~t_ephGPS() {}
 
-  virtual e_type type() const {return (_prn.system() == 'J' ? t_eph::QZSS : t_eph::GPS); }
+  virtual e_type type() const {
+    switch (_prn.system()) {
+      case 'J':
+        return t_eph::QZSS;
+      case 'I':
+        return t_eph::IRNSS;
+    };
+    return t_eph::GPS;
+  }
   virtual QString toString(double version) const;
   virtual unsigned int  IOD() const { return static_cast<unsigned int>(_IODE); }
@@ -101,5 +109,5 @@
   double  _clock_driftrate; // [s/s^2]
 
-  double  _IODE;
+  double  _IODE;            // IODEC in case of IRNSS
   double  _Crs;             // [m]
   double  _Delta_n;         // [rad/s]
@@ -122,15 +130,15 @@
 
   double  _IDOT;            // [rad/s]
-  double  _L2Codes;         // Codes on L2 channel
+  double  _L2Codes;         // Codes on L2 channel  (not valid for IRNSS)
   double  _TOEweek;
-  double  _L2PFlag;         // L2 P data flag
+  double  _L2PFlag;         // L2 P data flag (not valid for IRNSS)
 
   mutable double  _ura;     // SV accuracy
   double  _health;          // SV health
   double  _TGD;             // [s]
-  double  _IODC;
+  double  _IODC;            // (not valid for IRNSS)
 
   double  _TOT;             // Transmisstion time
-  double  _fitInterval;     // Fit interval
+  double  _fitInterval;     // Fit interval (not valid for IRNSS)
 };
 
@@ -414,4 +422,3 @@
   double  _TOEweek;          //  BDT week will be set only in case of RINEX file input
 };
-
 #endif
Index: /trunk/BNC/src/rinex/reqcedit.cpp
===================================================================
--- /trunk/BNC/src/rinex/reqcedit.cpp	(revision 8167)
+++ /trunk/BNC/src/rinex/reqcedit.cpp	(revision 8168)
@@ -651,4 +651,7 @@
         ephs.append(new t_ephBDS(*dynamic_cast<t_ephBDS*>(eph)));
       }
+      else if (eph->type() == t_eph::IRNSS) {
+        ephs.append(new t_ephGPS(*dynamic_cast<t_ephGPS*>(eph)));
+      }
     }
   }
Index: /trunk/BNC/src/rinex/rnxnavfile.cpp
===================================================================
--- /trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 8167)
+++ /trunk/BNC/src/rinex/rnxnavfile.cpp	(revision 8168)
@@ -203,4 +203,10 @@
       }
       eph = new t_ephBDS(version(), lines);
+    }
+    else if (prn[0] == 'I') {
+      for (int ii = 1; ii < 8; ii++) {
+        lines << stream->readLine();
+      }
+      eph = new t_ephGPS(version(), lines);
     }
     if (eph &&
Index: /trunk/BNC/src/rinex/rnxobsfile.cpp
===================================================================
--- /trunk/BNC/src/rinex/rnxobsfile.cpp	(revision 8167)
+++ /trunk/BNC/src/rinex/rnxobsfile.cpp	(revision 8168)
@@ -52,5 +52,5 @@
 ////////////////////////////////////////////////////////////////////////////
 t_rnxObsHeader::t_rnxObsHeader() {
-  _usedSystems = "GREJCS";
+  _usedSystems = "GREJCSI";
   _antNEU.ReSize(3); _antNEU = 0.0;
   _antXYZ.ReSize(3); _antXYZ = 0.0;
@@ -447,4 +447,7 @@
                        << "C6I" << "L6I" << "S6I"
                        << "C7I" << "L7I" << "S7I";
+
+        _obsTypes['I'] << "C5A" << "L5A" << "S5A"
+                       << "C9A" << "L9A" << "S9A";
       }
       else {
Index: /trunk/BNC/src/t_prn.cpp
===================================================================
--- /trunk/BNC/src/t_prn.cpp	(revision 8167)
+++ /trunk/BNC/src/t_prn.cpp	(revision 8168)
@@ -26,5 +26,8 @@
   }
   else if (_system == 'C') {
-  	  return MAXPRN_GPS + MAXPRN_GLONASS + MAXPRN_GALILEO + MAXPRN_QZSS + MAXPRN_SBAS + _number;
+  	return MAXPRN_GPS + MAXPRN_GLONASS + MAXPRN_GALILEO + MAXPRN_QZSS + MAXPRN_SBAS + _number;
+  }
+  else if (_system == 'I') {
+    return MAXPRN_GPS + MAXPRN_GLONASS + MAXPRN_GALILEO + MAXPRN_QZSS + MAXPRN_SBAS + MAXPRN_BDS + _number;
   }
   return 0;
@@ -53,8 +56,7 @@
   char        system = '\x0';
   const char* number = 0;
-  if      ( str[0] == 'G' || str[0] == 'R' || str[0] == 'E' ||
-            str[0] == 'J' || str[0] == 'S' || str[0] == 'C' ||
-            str[0] == 'I'
-                ) {
+  if ( str[0] == 'G' || str[0] == 'R' || str[0] == 'E' ||
+       str[0] == 'J' || str[0] == 'S' || str[0] == 'C' ||
+       str[0] == 'I') {
     system = str[0];
     number = str.c_str() + 1;
Index: /trunk/BNC/src/t_prn.h
===================================================================
--- /trunk/BNC/src/t_prn.h	(revision 8167)
+++ /trunk/BNC/src/t_prn.h	(revision 8168)
@@ -12,6 +12,7 @@
   static const unsigned MAXPRN_SBAS = 38;
   static const unsigned MAXPRN_BDS = 37;
+  static const unsigned MAXPRN_IRNSS = 7;
   static const unsigned MAXPRN = MAXPRN_GPS + MAXPRN_GLONASS + MAXPRN_GALILEO
-      + MAXPRN_QZSS + MAXPRN_SBAS + MAXPRN_BDS;
+      + MAXPRN_QZSS + MAXPRN_SBAS + MAXPRN_BDS + MAXPRN_IRNSS;
 
   t_prn() :
