Index: trunk/BNC/src/rinex/reqcedit.cpp
===================================================================
--- trunk/BNC/src/rinex/reqcedit.cpp	(revision 6817)
+++ trunk/BNC/src/rinex/reqcedit.cpp	(revision 6841)
@@ -244,4 +244,48 @@
   }
 
+  // Put together all phase shifts
+  // -----------------------------
+  QStringList phaseShifts;
+  if (_rnxVersion >= 3.0 && _rnxObsFiles.size() > 1) {
+    for (int ii = 0; ii < _rnxObsFiles.size(); ii++) {
+      t_rnxObsFile* obsFile = _rnxObsFiles[ii];
+      phaseShifts << obsFile->phaseShifts();
+    }
+    phaseShifts.removeDuplicates();
+  }
+
+  // Put together all GLONASS biases
+  // -------------------------------
+  QStringList gloBiases;
+  if (_rnxVersion >= 3.0 && _rnxObsFiles.size() > 1) {
+    for (int ii = 0; ii < _rnxObsFiles.size(); ii++) {
+      t_rnxObsFile* obsFile = _rnxObsFiles[ii];
+      if (ii == 0 &&  obsFile->numGloBiases() == 4) {
+        break;
+      }
+      else {
+        gloBiases << obsFile->gloBiases();
+      }
+    }
+    gloBiases.removeDuplicates();
+  }
+
+  // Put together all GLONASS slots
+  // -----------------------------
+  QStringList gloSlots;
+  if (_rnxVersion >= 3.0 && _rnxObsFiles.size() > 1) {
+    for (int ii = 0; ii < _rnxObsFiles.size(); ii++) {
+      t_rnxObsFile* obsFile = _rnxObsFiles[ii];
+      if (ii == 0 &&
+          obsFile->numGloSlots() == signed(t_prn::MAXPRN_GLONASS)) {
+        break;
+      }
+      else {
+        gloSlots << obsFile->gloSlots();
+      }
+    }
+    gloSlots.removeDuplicates();
+  }
+
   // Loop over all input observation files
   // -------------------------------------
@@ -254,5 +298,6 @@
     }
     if (ii == 0) {
-      outObsFile.setHeader(obsFile->header(), int(_rnxVersion), &useObsTypes);
+      outObsFile.setHeader(obsFile->header(), int(_rnxVersion), &useObsTypes,
+          &phaseShifts, &gloBiases, &gloSlots);
       if (_begTime.valid() && _begTime > outObsFile.startTime()) {
         outObsFile.setStartTime(_begTime);
Index: trunk/BNC/src/rinex/rnxobsfile.cpp
===================================================================
--- trunk/BNC/src/rinex/rnxobsfile.cpp	(revision 6817)
+++ trunk/BNC/src/rinex/rnxobsfile.cpp	(revision 6841)
@@ -244,5 +244,5 @@
         in >> type >> value;
         if (type.size())
-          _gloPhaseBiases[type] = value;
+          _gloBiases[type] = value;
       }
     }
@@ -345,5 +345,8 @@
 ////////////////////////////////////////////////////////////////////////////
 void t_rnxObsHeader::set(const t_rnxObsHeader& header, int version,
-                         const QStringList* useObsTypes) {
+                         const QStringList* useObsTypes,
+                         const QStringList* phaseShifts,
+                         const QStringList* gloBiases,
+                         const QStringList* gloSlots) {
 
   if (version <= 2) {
@@ -370,9 +373,5 @@
   _comments        = header._comments;
   _usedSystems     = header._usedSystems;
-  if (_version >= 3.0) {
-    _phaseShifts    = header._phaseShifts;
-    _gloPhaseBiases = header._gloPhaseBiases;
-    _gloSlots       = header._gloSlots;
-  }
+
   for (unsigned iPrn = 1; iPrn <= t_prn::MAXPRN_GPS; iPrn++) {
     _wlFactorsL1[iPrn] =  header._wlFactorsL1[iPrn]; 
@@ -456,4 +455,57 @@
     }
   }
+
+  if (_version >= 3.0) {
+    // set phase shifts
+    if (!phaseShifts ||  phaseShifts->empty()) {
+      _phaseShifts = header._phaseShifts;
+    }
+    else {
+      foreach (const QString &str, *phaseShifts) {
+        QStringList hlp  = str.split("_", QString::SkipEmptyParts);
+        QStringList hlp1 = hlp.last().split(":", QString::SkipEmptyParts);
+        QString type = hlp.first();
+        double shift = hlp1.first().toDouble();
+        hlp1.removeFirst();
+        QStringList &satList = hlp1;
+        QMap<QString, QPair<double, QStringList> >::iterator it = _phaseShifts.find(type);
+        if ( it != _phaseShifts.end()) {
+          it.value().second.append(satList);
+          it.value().second.removeDuplicates();
+        }
+        else {
+          _phaseShifts.insert(type, QPair<double, QStringList>(shift, satList));
+        }
+      }
+    }
+    // set GLONASS biases
+    if (!gloBiases || gloBiases->empty()) {
+      _gloBiases = header._gloBiases;
+    }
+    else {
+      foreach (const QString &str, *gloBiases) {
+        QStringList hlp = str.split(":", QString::SkipEmptyParts);
+        QString type = hlp.first();;
+        double  value = hlp.last().toDouble();
+        if (type.size())
+          _gloBiases[type] = value;
+      }
+    }
+    // set GLONASS slots
+    if (!gloSlots  || gloSlots->empty()) {
+      _gloSlots = header._gloSlots;
+    }
+    else {
+      foreach (const QString &str, *gloSlots) {
+        QStringList hlp = str.split(":", QString::SkipEmptyParts);
+        QString sat = hlp.first();
+        int    slot = hlp.last().toInt();
+        t_prn prn;
+        prn.set(sat.toStdString());
+        if(sat.size())
+          _gloSlots[prn] = slot;
+      }
+    }
+  }
 }
 
@@ -646,6 +698,6 @@
   if (_version >= 3.0) {
     QString hlp = "";
-    QMap<QString, double>::const_iterator it = _gloPhaseBiases.begin();
-    while (it != _gloPhaseBiases.end()){
+    QMap<QString, double>::const_iterator it = _gloBiases.begin();
+    while (it != _gloBiases.end()){
       hlp += QString("%1%2").arg(it.key(), 4).arg(it.value(), 9, 'f', 3);
       it++;
@@ -723,4 +775,16 @@
 }
 
+// Number of GLONASS biases
+////////////////////////////////////////////////////////////////////////////
+int t_rnxObsHeader::numGloBiases() const {
+  return _gloBiases.size();
+}
+
+// Number of GLONASS biases
+////////////////////////////////////////////////////////////////////////////
+int t_rnxObsHeader::numGloSlots() const {
+  return _gloSlots.size();
+}
+
 // Observation Type (satellite-system specific)
 ////////////////////////////////////////////////////////////////////////////
@@ -743,4 +807,41 @@
   }
   return "";
+}
+
+//
+////////////////////////////////////////////////////////////////////////////
+QStringList t_rnxObsHeader::phaseShifts() const {
+  QStringList strList;
+  QMap<QString, QPair<double, QStringList> >::const_iterator it =  _phaseShifts.begin();
+  while (it != _phaseShifts.end()) {
+    strList.append(QString("%1_%2:%3").arg(it.key(), 3).arg(it.value().first, 9, 'f', 3).arg(it.value().second.join("")));
+    it++;
+  }
+  return strList;
+}
+
+//
+////////////////////////////////////////////////////////////////////////////
+QStringList t_rnxObsHeader::gloBiases() const {
+  QStringList strList;
+  QMap<QString, double>::const_iterator it = _gloBiases.begin();
+  while (it != _gloBiases.end()) {
+    strList.append(QString("%1:%2").arg(it.key(), 3).arg(it.value(), 9, 'f', 3));
+    it++;
+  }
+  return strList;
+}
+
+//
+////////////////////////////////////////////////////////////////////////////
+QStringList t_rnxObsHeader::gloSlots() const {
+  QStringList strList;
+  QMap<t_prn, int>::const_iterator it = _gloSlots.begin();
+  while (it != _gloSlots.end()){
+    QString prn(it.key().toString().c_str());
+    strList.append(QString("%1:%2").arg(prn, 3).arg(it.value()));
+    it++;
+  }
+  return strList;
 }
 
Index: trunk/BNC/src/rinex/rnxobsfile.h
===================================================================
--- trunk/BNC/src/rinex/rnxobsfile.h	(revision 6817)
+++ trunk/BNC/src/rinex/rnxobsfile.h	(revision 6841)
@@ -53,9 +53,16 @@
   t_irc       read(QTextStream* stream, int maxLines = 0);
   void        setDefault(const QString& markerName, int version);
-  void        set(const t_rnxObsHeader& header, int version, const QStringList* useObsTypes = 0);
+  void        set(const t_rnxObsHeader& header, int version,
+                  const QStringList* useObsTypes = 0, const QStringList* phaseShifts = 0,
+                  const QStringList* gloBiases = 0, const QStringList* gloSlots = 0);
   int         numSys() const;
   char        system(int iSys) const;
   int         nTypes(char sys) const;
+  int         numGloBiases() const;
+  int         numGloSlots() const;
   QString     obsType(char sys, int index, double version = 0.0) const;
+  QStringList phaseShifts() const;
+  QStringList gloBiases() const;
+  QStringList gloSlots() const;
   void        write(QTextStream* stream, const QMap<QString, QString>* txtMap = 0) const;
   bncTime     startTime() const {return _startTime;}
@@ -83,5 +90,5 @@
   QMap<char, QStringList> _obsTypes;
   QMap<t_prn, int>        _gloSlots;
-  QMap<QString, double>   _gloPhaseBiases;
+  QMap<QString, double>   _gloBiases;
   int                     _wlFactorsL1[t_prn::MAXPRN_GPS+1];
   int                     _wlFactorsL2[t_prn::MAXPRN_GPS+1];
@@ -134,8 +141,13 @@
   char           system(int iSys) const {return _header.system(iSys);}
   int            nTypes(char sys) const {return _header.nTypes(sys);}
+  int            numGloBiases() const {return _header.numGloBiases();}
+  int            numGloSlots() const {return _header.numGloSlots();}
   const QString& fileName() const {return _fileName;}
   QString obsType(char sys, int index, double version = 0.0) const {
     return _header.obsType(sys, index, version);
   }
+  QStringList phaseShifts() const {return _header.phaseShifts();}
+  QStringList gloBiases() const {return _header.gloBiases();}
+  QStringList gloSlots() const {return _header.gloSlots();}
   const QString& antennaName() const {return _header._antennaName;}
   const QString& antennaNumber() const {return _header._antennaNumber;}
@@ -175,6 +187,8 @@
   const t_rnxObsHeader& header() const {return _header;}
 
-  void setHeader(const t_rnxObsHeader& header, int version, const QStringList* useObsTypes = 0) {
-    _header.set(header, version, useObsTypes);
+  void setHeader(const t_rnxObsHeader& header, int version,
+      const QStringList* useObsTypes = 0, const QStringList* phaseShifts = 0,
+      const QStringList* gloBiases = 0, const QStringList* gloSlots = 0) {
+    _header.set(header, version, useObsTypes, phaseShifts, gloBiases, gloSlots);
   }
 
