Changeset 6017 in ntrip


Ignore:
Timestamp:
Aug 21, 2014, 8:44:50 AM (10 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/PPP/pppInclude.h

    r6016 r6017  
    3838 public:
    3939  t_frqObs() {
     40    _freq            = 0.0;
    4041    _code            = 0.0;         
    4142    _codeValid       = false;     
     
    5152  }
    5253  std::string _rnxType2ch;
     54  double      _freq;
    5355  double      _code;         
    5456  bool        _codeValid;     
     
    122124};
    123125
    124 class t_frequency {
    125  public:
    126   enum type {dummy = 0, G1, G2, G5, R1, R2,
    127                         E1, // E1  / 1575.42         
    128                         E5, // E5a / 1176.45         
    129                         E7, // E5b / 1207.140         
    130                         E8, // E5(E5a+E5b) / 1191.795
    131                         E6, // E6  / 1278.75         
    132              maxFr};
    133 
    134   static std::string toString(type tt) {
    135     if      (tt == G1) return "G1";
    136     else if (tt == G2) return "G2";
    137     else if (tt == G5) return "G5";
    138     else if (tt == R1) return "R1";
    139     else if (tt == R2) return "R2";
    140     else if (tt == E1) return "E1";
    141     else if (tt == E5) return "E5";
    142     else if (tt == E6) return "E6";
    143     else if (tt == E7) return "E7";
    144     else if (tt == E8) return "E8";
    145     return std::string();
    146   }
    147 };
    148 
    149 
    150126class t_lc {
    151127 public:
  • trunk/BNC/src/PPP/pppSatObs.cpp

    r6015 r6017  
    5959////////////////////////////////////////////////////////////////////////////
    6060t_pppSatObs::t_pppSatObs(const t_satObs& pppSatObs) {
    61   _prn  = pppSatObs._prn;
    62   _time = pppSatObs._time;
    63   _outlier    = false;
    64   for (unsigned ii = 0; ii < pppSatObs._obs.size(); ii++) {
    65     _allObs.push_back(new t_frqObs(*pppSatObs._obs[ii]));
    66   }
    67   prepareObs();
     61  _prn     = pppSatObs._prn;
     62  _time    = pppSatObs._time;
     63  _outlier = false;
     64  for (unsigned ii = 0; ii < t_frequency::max; ii++) {
     65    _obs[ii] = 0;
     66  }
     67  prepareObs(pppSatObs);
    6868}
    6969
     
    7171////////////////////////////////////////////////////////////////////////////
    7272t_pppSatObs::~t_pppSatObs() {
    73   for (unsigned ii = 0; ii < _allObs.size(); ii++) {
    74     delete _allObs[ii];
    75   }
    76 }
    77 
    78 //
    79 ////////////////////////////////////////////////////////////////////////////
    80 void t_pppSatObs::prepareObs() {
     73  for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) {
     74    delete _obs[iFreq];
     75  }
     76}
     77
     78//
     79////////////////////////////////////////////////////////////////////////////
     80void t_pppSatObs::prepareObs(const t_satObs& pppSatObs) {
     81
    8182  _model.reset();
    82   _valid     = true;
    83   _validObs1 = 0;
    84   _validObs2 = 0;
    85 
    86   bool dualFreq = OPT->dualFreqRequired(_prn.system());
    87 
    88   // Select two pseudoranges and two phase observations
    89   // --------------------------------------------------
     83
     84  // Select pseudoranges and phase observations
     85  // ------------------------------------------
    9086  const string preferredAttrib = "CWP_";
    91   for (unsigned iPref = 0; iPref < preferredAttrib.length(); iPref++) {
    92     string obsType1 = (preferredAttrib[iPref] == '_') ? string("1") : string("1") + preferredAttrib[iPref];
    93     string obsType2 = (preferredAttrib[iPref] == '_') ? string("2") : string("2") + preferredAttrib[iPref];
    94     if (_validObs1 == 0) {
    95       for (unsigned ii = 0; ii < _allObs.size(); ii++) {
    96         t_frqObs* obs = _allObs[ii];
    97         if (obs->_rnxType2ch == obsType1 && obs->_codeValid && obs->_phaseValid) {
    98           _validObs1 = obs;
    99         }
    100       }
    101     }
    102     if (dualFreq) {
    103       if (_validObs2 == 0) {
    104         for (unsigned ii = 0; ii < _allObs.size(); ii++) {
    105           t_frqObs* obs = _allObs[ii];
    106           if (obs->_rnxType2ch == obsType2 && obs->_codeValid && obs->_phaseValid) {
    107             _validObs2 = obs;
     87
     88  for (unsigned iFreq = 1; iFreq < t_frequency::max; iFreq++) {
     89    string frqNum = t_frequency::toString(t_frequency::type(iFreq)).substr(1);
     90    for (unsigned iPref = 0; iPref < preferredAttrib.length(); iPref++) {
     91      string obsType = (preferredAttrib[iPref] == '_') ? frqNum : frqNum + preferredAttrib[iPref];
     92      if (_obs[iFreq] == 0) {
     93        for (unsigned ii = 0; ii < pppSatObs._obs.size(); ii++) {
     94          const t_frqObs* obs = pppSatObs._obs[ii];
     95          if (obs->_rnxType2ch == obsType && obs->_codeValid && obs->_phaseValid) {
     96            _obs[iFreq] = new t_frqObs(*obs);
    10897          }
    10998        }
     
    111100    }
    112101  }
    113 
    114   if (_validObs1 == 0 || (dualFreq && _validObs2 == 0)) {
    115     _valid = false;
    116     return;
    117   }
    118102
    119103  // Find Glonass Channel Number
  • trunk/BNC/src/PPP/pppSatObs.h

    r5916 r6017  
    1616  t_pppSatObs(const t_satObs& satObs);
    1717  ~t_pppSatObs();
    18   bool                isValid() const {return _valid;}
    19   void                prepareObs();
    2018  const t_prn&        prn() const {return _prn;}
    2119  const ColumnVector& xc() const {return _xcSat;}
     
    4240
    4341  bool slip() const {
    44     for (unsigned ii = 0; ii < _allObs.size(); ii++) {
    45       if (_allObs[ii]->_slip) {
     42    for (unsigned ii = 1; ii < t_frequency::max; ii++) {
     43      if (_obs[ii] && _obs[ii]->_slip) {
    4644        return true;
    4745      }
     
    5250  int slipCounter() const {
    5351    int cnt = -1;
    54     for (unsigned ii = 0; ii < _allObs.size(); ii++) {
    55       if (_allObs[ii]->_slipCounter > cnt) {
    56         cnt = _allObs[ii]->_slipCounter;
     52    for (unsigned ii = 1; ii < t_frequency::max; ii++) {
     53      if (_obs[ii] && _obs[ii]->_slipCounter > cnt) {
     54        cnt = _obs[ii]->_slipCounter;
    5755      }
    5856    }
     
    6260  int biasJumpCounter() const {
    6361    int jmp = -1;
    64     for (unsigned ii = 0; ii < _allObs.size(); ii++) {
    65       if (_allObs[ii]->_biasJumpCounter > jmp) {
    66         jmp = _allObs[ii]->_biasJumpCounter;
     62    for (unsigned ii = 1; ii < t_frequency::max; ii++) {
     63      if (_obs[ii] && _obs[ii]->_biasJumpCounter > jmp) {
     64        jmp = _obs[ii]->_biasJumpCounter;
    6765      }
    6866    }
     
    113111  };
    114112
     113  void prepareObs(const t_satObs& satObs);
     114
    115115  t_prn                        _prn;
    116116  bncTime                      _time;
    117117  int                          _channel;
    118   std::vector<t_frqObs*>       _allObs;
    119   bool                         _valid;
    120   t_frqObs*                    _validObs1;
    121   t_frqObs*                    _validObs2;
    122   double                       _f1;
    123   double                       _f2;
    124   double                       _rawC1;
    125   double                       _rawC2;
    126   double                       _rawL1;
    127   double                       _rawL2;
     118  t_frqObs*                    _obs[t_frequency::max];
    128119  ColumnVector                 _xcSat;
    129120  ColumnVector                 _vvSat;
  • trunk/BNC/src/bncantex.cpp

    r6015 r6017  
    259259double bncAntex::pco(const QString& antName, double eleSat, bool& found) const {
    260260
    261   static const double f1 = t_CST::freq1;
    262   static const double f2 = t_CST::freq2;
     261  static const double f1 = t_CST::freq(t_frequency::G1, 0);
     262  static const double f2 = t_CST::freq(t_frequency::G2, 0);
    263263  static const double c1 =   f1 * f1 / (f1 * f1 - f2 * f2);
    264264  static const double c2 = - f2 * f2 / (f1 * f1 - f2 * f2);
  • trunk/BNC/src/bncconst.cpp

    r4278 r6017  
    2525#include "bncconst.h"
    2626
    27 const double t_CST::c       = 299792458.0;
    28 const double t_CST::freq1   = 1575420000.0; // GPS and Galileo E1
    29 const double t_CST::freq2   = 1227600000.0; // GPS only
    30 const double t_CST::freq5   = 1176450000.0; // GPS and Galileo E5a
    31 const double t_CST::lambda1 = c / freq1;
    32 const double t_CST::lambda2 = c / freq2;
    33 const double t_CST::lambda5 = c / freq5;
    34 const double t_CST::omega   = 7292115.1467e-11;
    35 const double t_CST::aell    = 6378137.000;
    36 const double t_CST::fInv    = 298.2572236;
     27const double t_CST::c     = 299792458.0;
     28const double t_CST::omega = 7292115.1467e-11;
     29const double t_CST::aell  = 6378137.000;
     30const double t_CST::fInv  = 298.2572236;
     31
     32//
     33//////////////////////////////////////////////////////////////////////////////
     34double t_CST::freq(t_frequency::type fType, int slotNum) {
     35  switch (fType) {
     36  case t_frequency::G1:    return 1575420000.0;
     37  case t_frequency::G2:    return 1227600000.0;
     38  case t_frequency::G5:    return 1176450000.0;
     39  case t_frequency::E1:    return 1575420000.0;
     40  case t_frequency::E5:    return 1176450000.0;
     41  case t_frequency::E7:    return 1207140000.0;
     42  case t_frequency::E8:    return 1191795000.0;
     43  case t_frequency::E6:    return 1278750000.0;
     44  case t_frequency::R1:    return 1602000000.0 + 562500.0 * slotNum;
     45  case t_frequency::R2:    return 1246000000.0 + 437500.0 * slotNum;
     46  case t_frequency::dummy:
     47  case t_frequency::max:   return 0.0;
     48  }
     49  return 0.0;
     50}
     51
     52//
     53//////////////////////////////////////////////////////////////////////////////
     54double t_CST::lambda(t_frequency::type fType, int slotNum) {
     55  return c / freq(fType, slotNum);
     56}
  • trunk/BNC/src/bncconst.h

    r4278 r6017  
    2323// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    2424
     25#include <string>
     26
    2527#ifndef BNCCONST_H
    2628#define BNCCONST_H
     
    2830enum t_irc {failure = -1, success, fatal}; // return code
    2931
     32class t_frequency {
     33 public:
     34  enum type {dummy = 0, G1, G2, G5, R1, R2,
     35                        E1, // E1  / 1575.42         
     36                        E5, // E5a / 1176.45         
     37                        E7, // E5b / 1207.140         
     38                        E8, // E5(E5a+E5b) / 1191.795
     39                        E6, // E6  / 1278.75         
     40             max};
     41
     42  static std::string toString(type tt) {
     43    if      (tt == G1) return "G1";
     44    else if (tt == G2) return "G2";
     45    else if (tt == G5) return "G5";
     46    else if (tt == R1) return "R1";
     47    else if (tt == R2) return "R2";
     48    else if (tt == E1) return "E1";
     49    else if (tt == E5) return "E5";
     50    else if (tt == E6) return "E6";
     51    else if (tt == E7) return "E7";
     52    else if (tt == E8) return "E8";
     53    return std::string();
     54  }
     55};
     56
    3057class t_CST {
    3158 public:
    32   static double f1(char satSys, int slotNum) {
    33     if      (satSys == 'G' || satSys == 'E') {
    34       return freq1;
    35     }
    36     else if (satSys == 'R') {
    37       return 1602000000.0 + 562500.0 * slotNum;
    38     }
    39     else {
    40       return 0.0;
    41     }
    42   }
    43   static double f2(char satSys, int slotNum) {
    44     if      (satSys == 'G') {
    45       return freq2;
    46     }
    47     else if (satSys == 'R') {
    48       return 1246000000.0 + 437500.0 * slotNum;
    49     }
    50     else {
    51       return 0.0;
    52     }
    53   }
     59  static double freq(t_frequency::type fType, int slotNum);
     60  static double lambda(t_frequency::type fType, int slotNum);
    5461
    5562  static const double c;
    56   static const double freq1; // GPS and Galileo E1
    57   static const double freq2; // GPS only           
    58   static const double freq5; // GPS and Galileo E5a
    59   static const double lambda1;
    60   static const double lambda2;
    61   static const double lambda5;
    6263  static const double omega;
    6364  static const double aell;
  • trunk/BNC/src/rinex/reqcanalyze.cpp

    r5884 r6017  
    364364  // ----------------------
    365365  if (L1 != 0.0 && L2 != 0.0) {
    366     double f1 = t_CST::f1(obs.satSys, obs.slotNum);
    367     double f2 = obs.satSys == 'E' ? t_CST::freq5 : t_CST::f2(obs.satSys, obs.slotNum);
     366    double f1 = 0.0;
     367    double f2 = 0.0;
     368    if      (obs.satSys == 'G') {
     369      f1 = t_CST::freq(t_frequency::G1, 0);
     370      f2 = t_CST::freq(t_frequency::G2, 0);
     371    }
     372    else if (obs.satSys == 'R') {
     373      f1 = t_CST::freq(t_frequency::R1, obs.slotNum);
     374      f2 = t_CST::freq(t_frequency::R2, obs.slotNum);
     375    }
     376    else if (obs.satSys == 'E') {
     377      f1 = t_CST::freq(t_frequency::E1, 0);
     378      f2 = t_CST::freq(t_frequency::E5, 0);
     379    }
    368380
    369381    L1 = L1 * t_CST::c / f1;
Note: See TracChangeset for help on using the changeset viewer.