Index: trunk/BNC/src/PPP/pppInclude.h
===================================================================
--- trunk/BNC/src/PPP/pppInclude.h	(revision 6016)
+++ trunk/BNC/src/PPP/pppInclude.h	(revision 6017)
@@ -38,4 +38,5 @@
  public:
   t_frqObs() {
+    _freq            = 0.0;
     _code            = 0.0;          
     _codeValid       = false;     
@@ -51,4 +52,5 @@
   }
   std::string _rnxType2ch; 
+  double      _freq;
   double      _code;          
   bool        _codeValid;     
@@ -122,30 +124,4 @@
 };
 
-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 
-                        E6, // E6  / 1278.75          
-             maxFr};
-
-  static std::string toString(type tt) {
-    if      (tt == G1) return "G1";
-    else if (tt == G2) return "G2";
-    else if (tt == G5) return "G5";
-    else if (tt == R1) return "R1";
-    else if (tt == R2) return "R2";
-    else if (tt == E1) return "E1";
-    else if (tt == E5) return "E5";
-    else if (tt == E6) return "E6";
-    else if (tt == E7) return "E7";
-    else if (tt == E8) return "E8";
-    return std::string();
-  }
-};
-
-
 class t_lc {
  public:
Index: trunk/BNC/src/PPP/pppSatObs.cpp
===================================================================
--- trunk/BNC/src/PPP/pppSatObs.cpp	(revision 6016)
+++ trunk/BNC/src/PPP/pppSatObs.cpp	(revision 6017)
@@ -59,11 +59,11 @@
 ////////////////////////////////////////////////////////////////////////////
 t_pppSatObs::t_pppSatObs(const t_satObs& pppSatObs) {
-  _prn  = pppSatObs._prn;
-  _time = pppSatObs._time;
-  _outlier    = false;
-  for (unsigned ii = 0; ii < pppSatObs._obs.size(); ii++) {
-    _allObs.push_back(new t_frqObs(*pppSatObs._obs[ii]));
-  }
-  prepareObs();
+  _prn     = pppSatObs._prn;
+  _time    = pppSatObs._time;
+  _outlier = false;
+  for (unsigned ii = 0; ii < t_frequency::max; ii++) {
+    _obs[ii] = 0;
+  }
+  prepareObs(pppSatObs);
 }
 
@@ -71,39 +71,28 @@
 ////////////////////////////////////////////////////////////////////////////
 t_pppSatObs::~t_pppSatObs() {
-  for (unsigned ii = 0; ii < _allObs.size(); ii++) {
-    delete _allObs[ii];
-  }
-}
-
-// 
-////////////////////////////////////////////////////////////////////////////
-void t_pppSatObs::prepareObs() {
+  for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) {
+    delete _obs[iFreq];
+  }
+}
+
+// 
+////////////////////////////////////////////////////////////////////////////
+void t_pppSatObs::prepareObs(const t_satObs& pppSatObs) {
+
   _model.reset();
-  _valid     = true;
-  _validObs1 = 0;
-  _validObs2 = 0;
-
-  bool dualFreq = OPT->dualFreqRequired(_prn.system());
-
-  // Select two pseudoranges and two phase observations
-  // --------------------------------------------------
+
+  // Select pseudoranges and phase observations
+  // ------------------------------------------
   const string preferredAttrib = "CWP_";
-  for (unsigned iPref = 0; iPref < preferredAttrib.length(); iPref++) {
-    string obsType1 = (preferredAttrib[iPref] == '_') ? string("1") : string("1") + preferredAttrib[iPref];
-    string obsType2 = (preferredAttrib[iPref] == '_') ? string("2") : string("2") + preferredAttrib[iPref];
-    if (_validObs1 == 0) {
-      for (unsigned ii = 0; ii < _allObs.size(); ii++) {
-        t_frqObs* obs = _allObs[ii];
-        if (obs->_rnxType2ch == obsType1 && obs->_codeValid && obs->_phaseValid) {
-          _validObs1 = obs;
-        }
-      }
-    }
-    if (dualFreq) {
-      if (_validObs2 == 0) {
-        for (unsigned ii = 0; ii < _allObs.size(); ii++) {
-          t_frqObs* obs = _allObs[ii];
-          if (obs->_rnxType2ch == obsType2 && obs->_codeValid && obs->_phaseValid) {
-            _validObs2 = obs;
+
+  for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) {
+    string frqNum = t_frequency::toString(t_frequency::type(iFreq)).substr(1);
+    for (unsigned iPref = 0; iPref < preferredAttrib.length(); iPref++) {
+      string obsType = (preferredAttrib[iPref] == '_') ? frqNum : frqNum + preferredAttrib[iPref];
+      if (_obs[iFreq] == 0) {
+        for (unsigned ii = 0; ii < pppSatObs._obs.size(); ii++) {
+          const t_frqObs* obs = pppSatObs._obs[ii];
+          if (obs->_rnxType2ch == obsType && obs->_codeValid && obs->_phaseValid) {
+            _obs[iFreq] = new t_frqObs(*obs);
           }
         }
@@ -111,9 +100,4 @@
     }
   }
-
-  if (_validObs1 == 0 || (dualFreq && _validObs2 == 0)) {
-    _valid = false;
-    return;
-  } 
 
   // Find Glonass Channel Number
Index: trunk/BNC/src/PPP/pppSatObs.h
===================================================================
--- trunk/BNC/src/PPP/pppSatObs.h	(revision 6016)
+++ trunk/BNC/src/PPP/pppSatObs.h	(revision 6017)
@@ -16,6 +16,4 @@
   t_pppSatObs(const t_satObs& satObs);
   ~t_pppSatObs();
-  bool                isValid() const {return _valid;}
-  void                prepareObs();
   const t_prn&        prn() const {return _prn;}
   const ColumnVector& xc() const {return _xcSat;}
@@ -42,6 +40,6 @@
 
   bool slip() const {
-    for (unsigned ii = 0; ii < _allObs.size(); ii++) {
-      if (_allObs[ii]->_slip) {
+    for (unsigned ii = 1; ii < t_frequency::max; ii++) {
+      if (_obs[ii] && _obs[ii]->_slip) {
         return true;
       }
@@ -52,7 +50,7 @@
   int slipCounter() const {
     int cnt = -1;
-    for (unsigned ii = 0; ii < _allObs.size(); ii++) {
-      if (_allObs[ii]->_slipCounter > cnt) {
-        cnt = _allObs[ii]->_slipCounter;
+    for (unsigned ii = 1; ii < t_frequency::max; ii++) {
+      if (_obs[ii] && _obs[ii]->_slipCounter > cnt) {
+        cnt = _obs[ii]->_slipCounter;
       }
     }
@@ -62,7 +60,7 @@
   int biasJumpCounter() const {
     int jmp = -1;
-    for (unsigned ii = 0; ii < _allObs.size(); ii++) {
-      if (_allObs[ii]->_biasJumpCounter > jmp) {
-        jmp = _allObs[ii]->_biasJumpCounter;
+    for (unsigned ii = 1; ii < t_frequency::max; ii++) {
+      if (_obs[ii] && _obs[ii]->_biasJumpCounter > jmp) {
+        jmp = _obs[ii]->_biasJumpCounter;
       }
     }
@@ -113,17 +111,10 @@
   };
 
+  void prepareObs(const t_satObs& satObs);
+
   t_prn                        _prn;
   bncTime                      _time;
   int                          _channel;
-  std::vector<t_frqObs*>       _allObs;
-  bool                         _valid;
-  t_frqObs*                    _validObs1;
-  t_frqObs*                    _validObs2;
-  double                       _f1;
-  double                       _f2;
-  double                       _rawC1;
-  double                       _rawC2;
-  double                       _rawL1;
-  double                       _rawL2;
+  t_frqObs*                    _obs[t_frequency::max];
   ColumnVector                 _xcSat;
   ColumnVector                 _vvSat;
Index: trunk/BNC/src/bncantex.cpp
===================================================================
--- trunk/BNC/src/bncantex.cpp	(revision 6016)
+++ trunk/BNC/src/bncantex.cpp	(revision 6017)
@@ -259,6 +259,6 @@
 double bncAntex::pco(const QString& antName, double eleSat, bool& found) const {
 
-  static const double f1 = t_CST::freq1;
-  static const double f2 = t_CST::freq2;
+  static const double f1 = t_CST::freq(t_frequency::G1, 0);
+  static const double f2 = t_CST::freq(t_frequency::G2, 0);
   static const double c1 =   f1 * f1 / (f1 * f1 - f2 * f2);
   static const double c2 = - f2 * f2 / (f1 * f1 - f2 * f2);
Index: trunk/BNC/src/bncconst.cpp
===================================================================
--- trunk/BNC/src/bncconst.cpp	(revision 6016)
+++ trunk/BNC/src/bncconst.cpp	(revision 6017)
@@ -25,12 +25,32 @@
 #include "bncconst.h"
 
-const double t_CST::c       = 299792458.0;
-const double t_CST::freq1   = 1575420000.0; // GPS and Galileo E1
-const double t_CST::freq2   = 1227600000.0; // GPS only
-const double t_CST::freq5   = 1176450000.0; // GPS and Galileo E5a
-const double t_CST::lambda1 = c / freq1;
-const double t_CST::lambda2 = c / freq2;
-const double t_CST::lambda5 = c / freq5;
-const double t_CST::omega   = 7292115.1467e-11;
-const double t_CST::aell    = 6378137.000;
-const double t_CST::fInv    = 298.2572236;
+const double t_CST::c     = 299792458.0;
+const double t_CST::omega = 7292115.1467e-11;
+const double t_CST::aell  = 6378137.000;
+const double t_CST::fInv  = 298.2572236;
+
+//
+//////////////////////////////////////////////////////////////////////////////
+double t_CST::freq(t_frequency::type fType, int slotNum) {
+  switch (fType) {
+  case t_frequency::G1:    return 1575420000.0;
+  case t_frequency::G2:    return 1227600000.0;
+  case t_frequency::G5:    return 1176450000.0;
+  case t_frequency::E1:    return 1575420000.0;
+  case t_frequency::E5:    return 1176450000.0;
+  case t_frequency::E7:    return 1207140000.0;
+  case t_frequency::E8:    return 1191795000.0;
+  case t_frequency::E6:    return 1278750000.0;
+  case t_frequency::R1:    return 1602000000.0 + 562500.0 * slotNum;
+  case t_frequency::R2:    return 1246000000.0 + 437500.0 * slotNum;
+  case t_frequency::dummy:
+  case t_frequency::max:   return 0.0;
+  }
+  return 0.0;
+}
+
+//
+//////////////////////////////////////////////////////////////////////////////
+double t_CST::lambda(t_frequency::type fType, int slotNum) {
+  return c / freq(fType, slotNum);
+}
Index: trunk/BNC/src/bncconst.h
===================================================================
--- trunk/BNC/src/bncconst.h	(revision 6016)
+++ trunk/BNC/src/bncconst.h	(revision 6017)
@@ -23,4 +23,6 @@
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
+#include <string>
+
 #ifndef BNCCONST_H
 #define BNCCONST_H
@@ -28,36 +30,35 @@
 enum t_irc {failure = -1, success, fatal}; // return code
 
+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 
+                        E6, // E6  / 1278.75          
+             max};
+
+  static std::string toString(type tt) {
+    if      (tt == G1) return "G1";
+    else if (tt == G2) return "G2";
+    else if (tt == G5) return "G5";
+    else if (tt == R1) return "R1";
+    else if (tt == R2) return "R2";
+    else if (tt == E1) return "E1";
+    else if (tt == E5) return "E5";
+    else if (tt == E6) return "E6";
+    else if (tt == E7) return "E7";
+    else if (tt == E8) return "E8";
+    return std::string();
+  }
+};
+
 class t_CST {
  public:
-  static double f1(char satSys, int slotNum) {
-    if      (satSys == 'G' || satSys == 'E') {
-      return freq1;
-    }
-    else if (satSys == 'R') {
-      return 1602000000.0 + 562500.0 * slotNum; 
-    }
-    else {
-      return 0.0;
-    }
-  }
-  static double f2(char satSys, int slotNum) {
-    if      (satSys == 'G') {
-      return freq2;
-    }
-    else if (satSys == 'R') {
-      return 1246000000.0 + 437500.0 * slotNum;
-    }
-    else {
-      return 0.0;
-    }
-  }
+  static double freq(t_frequency::type fType, int slotNum);
+  static double lambda(t_frequency::type fType, int slotNum);
 
   static const double c;
-  static const double freq1; // GPS and Galileo E1 
-  static const double freq2; // GPS only           
-  static const double freq5; // GPS and Galileo E5a
-  static const double lambda1;
-  static const double lambda2;
-  static const double lambda5;
   static const double omega;
   static const double aell;
Index: trunk/BNC/src/rinex/reqcanalyze.cpp
===================================================================
--- trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 6016)
+++ trunk/BNC/src/rinex/reqcanalyze.cpp	(revision 6017)
@@ -364,6 +364,18 @@
   // ----------------------
   if (L1 != 0.0 && L2 != 0.0) {
-    double f1 = t_CST::f1(obs.satSys, obs.slotNum);
-    double f2 = obs.satSys == 'E' ? t_CST::freq5 : t_CST::f2(obs.satSys, obs.slotNum);
+    double f1 = 0.0;
+    double f2 = 0.0;
+    if      (obs.satSys == 'G') {
+      f1 = t_CST::freq(t_frequency::G1, 0);
+      f2 = t_CST::freq(t_frequency::G2, 0);
+    }
+    else if (obs.satSys == 'R') {
+      f1 = t_CST::freq(t_frequency::R1, obs.slotNum);
+      f2 = t_CST::freq(t_frequency::R2, obs.slotNum);
+    }
+    else if (obs.satSys == 'E') {
+      f1 = t_CST::freq(t_frequency::E1, 0);
+      f2 = t_CST::freq(t_frequency::E5, 0);
+    }
 
     L1 = L1 * t_CST::c / f1;
