Index: trunk/BNC/src/rinex/reqcedit.cpp
===================================================================
--- trunk/BNC/src/rinex/reqcedit.cpp	(revision 8797)
+++ trunk/BNC/src/rinex/reqcedit.cpp	(revision 8798)
@@ -522,5 +522,7 @@
     }
   }
+  // TODO: enable user decision 
   qStableSort(ephs.begin(), ephs.end(), t_eph::earlierTime);
+  //qStableSort(ephs.begin(), ephs.end(), t_eph::prnSort); 
 }
 
@@ -653,5 +655,4 @@
 void t_reqcEdit::appendEphemerides(const QString& fileName,
                                    QVector<t_eph*>& ephs) {
-
   t_rnxNavFile rnxNavFile(fileName, t_rnxNavFile::input);
   for (unsigned ii = 0; ii < rnxNavFile.ephs().size(); ii++) {
Index: trunk/BNC/src/rinex/rnxobsfile.cpp
===================================================================
--- trunk/BNC/src/rinex/rnxobsfile.cpp	(revision 8797)
+++ trunk/BNC/src/rinex/rnxobsfile.cpp	(revision 8798)
@@ -360,5 +360,5 @@
                    << "C8Q" << "L8Q" << "S8Q"
                    << "C8X" << "L8X" << "S8X";
-                   
+
     _obsTypes['S'] << "C1C" << "L1C" << "S1C"
                    << "C5I" << "L5I" << "S5I"
@@ -1315,7 +1315,15 @@
     const t_rnxSat& rnxSat = epo->rnxSat[ii];
     if (_header._obsTypes[rnxSat.prn.system()].size() > 0) {
+      if (_header.version() < 3.0) { // exclude new GNSS such as BDS, QZSS, IRNSS, etc.
+          if (rnxSat.prn.system() != 'G' && rnxSat.prn.system() != 'R' &&
+              rnxSat.prn.system() != 'E' && rnxSat.prn.system() != 'S' &&
+              rnxSat.prn.system() != 'I') {
+            continue;
+          }
+      }
       epoLocal.rnxSat.push_back(rnxSat);
     }
   }
+  std::stable_sort(epoLocal.rnxSat.begin(), epoLocal.rnxSat.end(), t_rnxSat::prnSort);
 
   if (version() < 3.0) {
Index: trunk/BNC/src/rinex/rnxobsfile.h
===================================================================
--- trunk/BNC/src/rinex/rnxobsfile.h	(revision 8797)
+++ trunk/BNC/src/rinex/rnxobsfile.h	(revision 8798)
@@ -46,5 +46,4 @@
 
  public:
-  static const QString defaultSystems;
 
   t_rnxObsHeader();
@@ -124,4 +123,5 @@
     t_prn                   prn;
     QMap<QString, t_rnxObs> obs;
+    static bool prnSort(const t_rnxSat rnxSat1, const t_rnxSat rnxSat2) {return rnxSat1.prn < rnxSat2.prn;}
   };
 
@@ -221,5 +221,6 @@
         if (header.version() < 3.0) { // exclude new GNSS such as BDS, QZSS, IRNSS, etc.
             if (rnxSat.prn.system() != 'G' && rnxSat.prn.system() != 'R' &&
-                rnxSat.prn.system() != 'E' && rnxSat.prn.system() != 'S') {
+                rnxSat.prn.system() != 'E' && rnxSat.prn.system() != 'S' &&
+                rnxSat.prn.system() != 'I') {
               continue;
             }
@@ -228,4 +229,6 @@
       }
     }
+    std::stable_sort(epoLocal.rnxSat.begin(), epoLocal.rnxSat.end(), t_rnxSat::prnSort);
+
     if (header.version() >= 3.0) {
       writeEpochV3(stream, header, &epoLocal);
