Changeset 622 in ntrip for trunk/BNC/bncrinex.cpp


Ignore:
Timestamp:
Dec 16, 2007, 4:27:13 PM (16 years ago)
Author:
mervart
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/bncrinex.cpp

    r607 r622  
    9696////////////////////////////////////////////////////////////////////////////
    9797bncRinex::~bncRinex() {
    98   QListIterator<Observation*> it(_obs);
     98  QListIterator<p_obs> it(_obs);
    9999  while (it.hasNext()) {
    100100    delete it.next();
     
    466466// Stores Observation into Internal Array
    467467////////////////////////////////////////////////////////////////////////////
    468 void bncRinex::deepCopy(const Observation* obs) {
    469   Observation* newObs = new Observation();
     468void bncRinex::deepCopy(const p_obs obs) {
     469  p_obs newObs = new t_obs();
    470470  memcpy(newObs, obs, sizeof(*obs));
    471471  _obs.push_back(newObs);
     
    478478  // Select observations older than maxTime
    479479  // --------------------------------------
    480   QList<Observation*> dumpList;
    481   QMutableListIterator<Observation*> mIt(_obs);
     480  QList<p_obs> dumpList;
     481  QMutableListIterator<p_obs> mIt(_obs);
    482482  while (mIt.hasNext()) {
    483     Observation* ob = mIt.next();
    484     if (ob->GPSWeek * 7*24*3600 + ob->GPSWeeks < maxTime - 0.05) {
    485       dumpList.push_back(ob);
     483    p_obs obs = mIt.next();
     484    if (obs->_o.GPSWeek * 7*24*3600 + obs->_o.GPSWeeks < maxTime - 0.05) {
     485      dumpList.push_back(obs);
    486486      mIt.remove();
    487487    }
     
    496496  // Time of Epoch
    497497  // -------------
    498   Observation* fObs = *dumpList.begin();
    499   QDateTime datTim    = dateAndTimeFromGPSweek(fObs->GPSWeek, fObs->GPSWeeks);
    500   QDateTime datTimNom = dateAndTimeFromGPSweek(fObs->GPSWeek,
    501                                                floor(fObs->GPSWeeks+0.5));
     498  p_obs fObs = *dumpList.begin();
     499  QDateTime datTim    = dateAndTimeFromGPSweek(fObs->_o.GPSWeek, fObs->_o.GPSWeeks);
     500  QDateTime datTimNom = dateAndTimeFromGPSweek(fObs->_o.GPSWeek,
     501                                               floor(fObs->_o.GPSWeeks+0.5));
    502502
    503503  // Close the file
     
    514514  }
    515515
    516   double sec = double(datTim.time().second()) + fmod(fObs->GPSWeeks,1.0);
     516  double sec = double(datTim.time().second()) + fmod(fObs->_o.GPSWeeks,1.0);
    517517
    518518  // RINEX Version 3
     
    523523         << "  " << 0 << setw(3)  << dumpList.size() << endl;
    524524
    525     QListIterator<Observation*> it(dumpList);
     525    QListIterator<p_obs> it(dumpList);
    526526    while (it.hasNext()) {
    527       Observation* ob = it.next();
    528       _out << ob->satSys
    529            << setw(2) << setfill('0') << ob->satNum << setfill(' ')
    530            << setw(14) << setprecision(3) << ob->C1 << "  " 
    531            << setw(14) << setprecision(3) << ob->L1 << " "
    532            << setw(1)                     << ob->SNR1
    533            << setw(14) << setprecision(3) << ob->S1 << "  "
    534            << setw(14) << setprecision(3) << ob->P2 << "  "
    535            << setw(14) << setprecision(3) << ob->L2 << " "
    536            << setw(1)                     << ob->SNR2
    537            << setw(14) << setprecision(3) << ob->S2
     527      p_obs obs = it.next();
     528      _out << obs->_o.satSys
     529           << setw(2) << setfill('0') << obs->_o.satNum << setfill(' ')
     530           << setw(14) << setprecision(3) << obs->_o.C1 << "  " 
     531           << setw(14) << setprecision(3) << obs->_o.L1 << " "
     532           << setw(1)                     << obs->_o.SNR1
     533           << setw(14) << setprecision(3) << obs->_o.S1 << "  "
     534           << setw(14) << setprecision(3) << obs->_o.P2 << "  "
     535           << setw(14) << setprecision(3) << obs->_o.L2 << " "
     536           << setw(1)                     << obs->_o.SNR2
     537           << setw(14) << setprecision(3) << obs->_o.S2
    538538           << endl;
    539       delete ob;
     539      delete obs;
    540540    }
    541541  }
     
    548548         << "  " << 0 << setw(3)  << dumpList.size();
    549549   
    550     QListIterator<Observation*> it(dumpList); int iSat = 0;
     550    QListIterator<p_obs> it(dumpList); int iSat = 0;
    551551    while (it.hasNext()) {
    552552      iSat++;
    553       Observation* ob = it.next();
    554       _out << ob->satSys << setw(2) << ob->satNum;
     553      p_obs obs = it.next();
     554      _out << obs->_o.satSys << setw(2) << obs->_o.satNum;
    555555      if (iSat == 12 && it.hasNext()) {
    556556        _out << endl << "                                ";
     
    562562    it.toFront();
    563563    while (it.hasNext()) {
    564       Observation* ob = it.next();
     564      p_obs obs = it.next();
    565565   
    566566      char lli = ' ';
    567567      char snr = ' ';
    568       _out << setw(14) << setprecision(3) << ob->C1 << lli << snr;
    569       _out << setw(14) << setprecision(3) << ob->C2 << lli << snr;
    570       _out << setw(14) << setprecision(3) << ob->P1 << lli << snr;
    571       _out << setw(14) << setprecision(3) << ob->P2 << lli << snr;
    572       _out << setw(14) << setprecision(3) << ob->L1 << lli
    573            << setw(1) << ob->SNR1 << endl;
    574       _out << setw(14) << setprecision(3) << ob->L2 << lli
    575            << setw(1) << ob->SNR2;
    576       _out << setw(14) << setprecision(3) << ob->S1 ;
    577       _out << setw(16) << setprecision(3) << ob->S2 ;
     568      _out << setw(14) << setprecision(3) << obs->_o.C1 << lli << snr;
     569      _out << setw(14) << setprecision(3) << obs->_o.C2 << lli << snr;
     570      _out << setw(14) << setprecision(3) << obs->_o.P1 << lli << snr;
     571      _out << setw(14) << setprecision(3) << obs->_o.P2 << lli << snr;
     572      _out << setw(14) << setprecision(3) << obs->_o.L1 << lli
     573           << setw(1) << obs->_o.SNR1 << endl;
     574      _out << setw(14) << setprecision(3) << obs->_o.L2 << lli
     575           << setw(1) << obs->_o.SNR2;
     576      _out << setw(14) << setprecision(3) << obs->_o.S1 ;
     577      _out << setw(16) << setprecision(3) << obs->_o.S2 ;
    578578      _out << endl;
    579579   
    580       delete ob;
     580      delete obs;
    581581    }
    582582  }
Note: See TracChangeset for help on using the changeset viewer.