Changeset 2711 in ntrip for trunk/BNC/RTCM


Ignore:
Timestamp:
Nov 18, 2010, 1:38:51 PM (13 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/RTCM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM/GPSDecoder.h

    r2710 r2711  
    3636class t_obs {
    3737 public:
    38   enum t_obs_status {initial, posted, received};
    3938  t_obs() {
    40     _status     = initial;
    4139    satSys      = 'G';
    4240    satNum      = 0;
     
    7674  double S1() const {return (L1P != 0.0 ? S1P : S1C);}
    7775  double S2() const {return (L2P != 0.0 ? S2P : S2C);}
    78 
    79   t_obs_status  _status;
    8076
    8177  char   StatID[20+1]; // Station ID
     
    118114  virtual t_irc Decode(char* buffer, int bufLen, std::vector<std::string>& errmsg) = 0;
    119115
    120   virtual ~GPSDecoder() {
    121     QListIterator<t_obs*> it(_obsList);
    122     while (it.hasNext()) {
    123       t_obs* obs = it.next();
    124       if (obs && obs->_status == t_obs::initial) {
    125         delete obs;
    126       }
    127     }
    128   }
     116  virtual ~GPSDecoder() {}
    129117
    130118  virtual int corrGPSEpochTime() const {return -1;}
     
    149137  };
    150138
    151   QList<t_obs*>    _obsList;
     139  QList<t_obs>     _obsList;
    152140  QList<int>       _typeList;  // RTCM   message types
    153141  QStringList      _antType;   // RTCM   antenna descriptor
  • trunk/BNC/RTCM/RTCM2Decoder.cpp

    r2710 r2711  
    140140         
    141141        for (int iSat=0; iSat < _ObsBlock.nSat; iSat++) {
    142           t_obs* obs = new t_obs();
    143           _obsList.push_back(obs);
     142          t_obs obs;
    144143          if (_ObsBlock.PRN[iSat] > 100) {
    145             obs->satNum      = _ObsBlock.PRN[iSat] % 100;
    146             obs->satSys      = 'R';
     144            obs.satNum      = _ObsBlock.PRN[iSat] % 100;
     145            obs.satSys      = 'R';
    147146          }                     
    148147          else {               
    149             obs->satNum      = _ObsBlock.PRN[iSat];
    150             obs->satSys      = 'G';
     148            obs.satNum      = _ObsBlock.PRN[iSat];
     149            obs.satSys      = 'G';
    151150          }                     
    152           obs->GPSWeek       = epochWeek;
    153           obs->GPSWeeks      = epochSecs;
    154           obs->C1            = _ObsBlock.rng_C1[iSat];
    155           obs->P1            = _ObsBlock.rng_P1[iSat];
    156           obs->P2            = _ObsBlock.rng_P2[iSat];
    157           obs->L1P           = _ObsBlock.resolvedPhase_L1(iSat);
    158           obs->L2P           = _ObsBlock.resolvedPhase_L2(iSat);
    159           obs->slip_cnt_L1   = _ObsBlock.slip_L1[iSat];
    160           obs->slip_cnt_L2   = _ObsBlock.slip_L2[iSat];
     151          obs.GPSWeek       = epochWeek;
     152          obs.GPSWeeks      = epochSecs;
     153          obs.C1            = _ObsBlock.rng_C1[iSat];
     154          obs.P1            = _ObsBlock.rng_P1[iSat];
     155          obs.P2            = _ObsBlock.rng_P2[iSat];
     156          obs.L1P           = _ObsBlock.resolvedPhase_L1(iSat);
     157          obs.L2P           = _ObsBlock.resolvedPhase_L2(iSat);
     158          obs.slip_cnt_L1   = _ObsBlock.slip_L1[iSat];
     159          obs.slip_cnt_L2   = _ObsBlock.slip_L2[iSat];
     160
     161          _obsList.push_back(obs);
    161162        }
    162163        _ObsBlock.clear();
     
    435436    // Store new observation
    436437    if ( new_obs ) {
    437       _obsList.push_back( new_obs );
    438 
    439       ////ostringstream hasIODstr;
    440       ////copy(hasIOD.begin(), hasIOD.end(), ostream_iterator<string>(hasIODstr, "    "));
    441       ////errmsg.push_back("decoded PRN " + PRN + " : " + hasIODstr.str());
    442     }
    443   }
    444 }
     438      _obsList.push_back(*new_obs);
     439    }
     440  }
     441}
Note: See TracChangeset for help on using the changeset viewer.