Changeset 2711 in ntrip


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

Legend:

Unmodified
Added
Removed
  • trunk/BNC/GPSS/gpssDecoder.cpp

    r2710 r2711  
    9999            for (int is = 0; is < epochHdr.n_svs; is++) {
    100100              obsFound = true;
    101               t_obs* obs = new t_obs();
    102               memcpy(obs, _buffer.data() + 2 + sizeof(recordSize) +
     101              t_obs obs;
     102              memcpy(&obs, _buffer.data() + 2 + sizeof(recordSize) +
    103103                     sizeof(epochHdr) + is * sizeof(t_obs), sizeof(t_obs));
    104104              _obsList.push_back(obs);
  • 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}
  • trunk/BNC/RTCM3/RTCM3Decoder.cpp

    r2710 r2711  
    237237            for (int iSat = 0; iSat < gnssData.numsats; iSat++) {
    238238
    239               t_obs* obs   = new t_obs();
    240               int    satID = gnssData.satellites[iSat];
     239              t_obs obs;
     240              int   satID = gnssData.satellites[iSat];
    241241
    242242              // GPS
    243243              // ---
    244244              if      (satID >= PRN_GPS_START     && satID <= PRN_GPS_END) {
    245                 obs->satSys = 'G';
    246                 obs->satNum = satID;
     245                obs.satSys = 'G';
     246                obs.satNum = satID;
    247247              }
    248248
     
    250250              // -------
    251251              else if (satID >= PRN_GLONASS_START && satID <= PRN_GLONASS_END) {
    252                 obs->satSys = 'R';
    253                 obs->satNum = satID - PRN_GLONASS_START + 1;
    254                 if (obs->satNum <= PRN_GLONASS_NUM &&
    255                     parser.GLOFreq[obs->satNum-1] != 0) {
    256                   obs->slotNum   = parser.GLOFreq[obs->satNum-1] - 100;
     252                obs.satSys = 'R';
     253                obs.satNum = satID - PRN_GLONASS_START + 1;
     254                if (obs.satNum <= PRN_GLONASS_NUM &&
     255                    parser.GLOFreq[obs.satNum-1] != 0) {
     256                  obs.slotNum   = parser.GLOFreq[obs.satNum-1] - 100;
    257257                }
    258258                else {
    259                   delete obs;
    260                   obs = 0;
     259                  continue;
    261260                }
    262261              }
     
    265264              // -------
    266265              else if (satID >= PRN_GALILEO_START && satID <= PRN_GALILEO_END) {
    267                 obs->satSys = 'E';
    268                 obs->satNum = satID - PRN_GALILEO_START + 1;
     266                obs.satSys = 'E';
     267                obs.satNum = satID - PRN_GALILEO_START + 1;
    269268              }
    270269
     
    272271              // ----
    273272              else if (satID >= PRN_WAAS_START && satID <= PRN_WAAS_END) {
    274                 obs->satSys = 'S';
    275                 obs->satNum = satID - PRN_WAAS_START + 20;
     273                obs.satSys = 'S';
     274                obs.satNum = satID - PRN_WAAS_START + 20;
    276275              }
    277276
     
    279278              // -------------
    280279              else if (satID >= PRN_GIOVE_START && satID <= PRN_GIOVE_END) {
    281                 obs->satSys = 'E';
    282                 obs->satNum = satID - PRN_GIOVE_START + PRN_GIOVE_OFFSET;
     280                obs.satSys = 'E';
     281                obs.satNum = satID - PRN_GIOVE_START + PRN_GIOVE_OFFSET;
    283282              }
    284283
     
    286285              // --------------
    287286              else {
    288                 delete obs;
    289                 obs = 0;
    290               }
    291 
    292               if (obs) {
    293                 _obsList.push_back(obs);
    294               }
    295               else {
    296287                continue;
    297288              }
    298289
    299               obs->GPSWeek  = gnssData.week;
    300               obs->GPSWeeks = gnssData.timeofweek / 1000.0;
    301 
    302               QString prn = QString("%1%2").arg(obs->satSys)
    303                             .arg(obs->satNum, 2, 10, QChar('0'));
     290              obs.GPSWeek  = gnssData.week;
     291              obs.GPSWeeks = gnssData.timeofweek / 1000.0;
     292
     293              QString prn = QString("%1%2").arg(obs.satSys)
     294                            .arg(obs.satNum, 2, 10, QChar('0'));
    304295
    305296              // Handle loss-of-lock flags
     
    318309                  _slip_cnt_L1[prn] = 1;
    319310                }
    320                 obs->slip_cnt_L1 = _slip_cnt_L1[prn];
     311                obs.slip_cnt_L1 = _slip_cnt_L1[prn];
    321312              }
    322313              if (GNSSDF2_LOCKLOSSL2 & gnssData.dataflags2[iSat]) {
     
    327318                  _slip_cnt_L2[prn] = 1;
    328319                }
    329                 obs->slip_cnt_L2 = _slip_cnt_L2[prn];
     320                obs.slip_cnt_L2 = _slip_cnt_L2[prn];
    330321              }
    331322              if (GNSSDF2_LOCKLOSSL5 & gnssData.dataflags2[iSat]) {
     
    336327                  _slip_cnt_L5[prn] = 1;
    337328                }
    338                 obs->slip_cnt_L5 = _slip_cnt_L5[prn];
     329                obs.slip_cnt_L5 = _slip_cnt_L5[prn];
    339330              }
    340331
     
    357348
    358349                  if      (iEntry == GNSSENTRY_C1DATA) {
    359                     obs->C1  = gnssData.measdata[iSat][iEntry];
     350                    obs.C1  = gnssData.measdata[iSat][iEntry];
    360351                  }
    361352                  else if (iEntry == GNSSENTRY_C2DATA) {
    362                     obs->C2  = gnssData.measdata[iSat][iEntry];
     353                    obs.C2  = gnssData.measdata[iSat][iEntry];
    363354                  }
    364355                  else if (iEntry == GNSSENTRY_P1DATA) {
    365                     obs->P1  = gnssData.measdata[iSat][iEntry];
     356                    obs.P1  = gnssData.measdata[iSat][iEntry];
    366357                  }
    367358                  else if (iEntry == GNSSENTRY_P2DATA) {
    368                     obs->P2  = gnssData.measdata[iSat][iEntry];
     359                    obs.P2  = gnssData.measdata[iSat][iEntry];
    369360                  }
    370361                  else if (iEntry == GNSSENTRY_L1CDATA) {
    371                     obs->L1C = gnssData.measdata[iSat][iEntry];
     362                    obs.L1C = gnssData.measdata[iSat][iEntry];
    372363                  }
    373364                  else if (iEntry == GNSSENTRY_L1PDATA) {
    374                     obs->L1P = gnssData.measdata[iSat][iEntry];
     365                    obs.L1P = gnssData.measdata[iSat][iEntry];
    375366                  }
    376367                  else if (iEntry == GNSSENTRY_L2CDATA) {
    377                     obs->L2C = gnssData.measdata[iSat][iEntry];
     368                    obs.L2C = gnssData.measdata[iSat][iEntry];
    378369                  }
    379370                  else if (iEntry == GNSSENTRY_L2PDATA) {
    380                     obs->L2P = gnssData.measdata[iSat][iEntry];
     371                    obs.L2P = gnssData.measdata[iSat][iEntry];
    381372                  }
    382373                  else if (iEntry == GNSSENTRY_D1CDATA) {
    383                     obs->D1C = gnssData.measdata[iSat][iEntry];
     374                    obs.D1C = gnssData.measdata[iSat][iEntry];
    384375                  }
    385376                  else if (iEntry == GNSSENTRY_D1PDATA) {
    386                     obs->D1P = gnssData.measdata[iSat][iEntry];
     377                    obs.D1P = gnssData.measdata[iSat][iEntry];
    387378                  }
    388379                  else if (iEntry == GNSSENTRY_S1CDATA) {
    389                     obs->S1C = gnssData.measdata[iSat][iEntry];
     380                    obs.S1C = gnssData.measdata[iSat][iEntry];
    390381                  }
    391382                  else if (iEntry == GNSSENTRY_S1PDATA) {
    392                     obs->S1P = gnssData.measdata[iSat][iEntry];
     383                    obs.S1P = gnssData.measdata[iSat][iEntry];
    393384                  }
    394385                  else if (iEntry == GNSSENTRY_D2CDATA) {
    395                     obs->D2C = gnssData.measdata[iSat][iEntry];
     386                    obs.D2C = gnssData.measdata[iSat][iEntry];
    396387                  }
    397388                  else if (iEntry == GNSSENTRY_D2PDATA) {
    398                     obs->D2P = gnssData.measdata[iSat][iEntry];
     389                    obs.D2P = gnssData.measdata[iSat][iEntry];
    399390                  }
    400391                  else if (iEntry == GNSSENTRY_S2CDATA) {
    401                     obs->S2C = gnssData.measdata[iSat][iEntry];
     392                    obs.S2C = gnssData.measdata[iSat][iEntry];
    402393                  }
    403394                  else if (iEntry == GNSSENTRY_S2PDATA) {
    404                     obs->S2P = gnssData.measdata[iSat][iEntry];
     395                    obs.S2P = gnssData.measdata[iSat][iEntry];
    405396                  }
    406397                  else if (iEntry == GNSSENTRY_C5DATA) {
    407                     obs->C5  = gnssData.measdata[iSat][iEntry];
     398                    obs.C5  = gnssData.measdata[iSat][iEntry];
    408399                  }
    409400                  else if (iEntry == GNSSENTRY_L5DATA) {
    410                     obs->L5  = gnssData.measdata[iSat][iEntry];
     401                    obs.L5  = gnssData.measdata[iSat][iEntry];
    411402                  }
    412403                  else if (iEntry == GNSSENTRY_D5DATA) {
    413                     obs->D5  = gnssData.measdata[iSat][iEntry];
     404                    obs.D5  = gnssData.measdata[iSat][iEntry];
    414405                  }
    415406                  else if (iEntry == GNSSENTRY_S5DATA) {
    416                     obs->S5  = gnssData.measdata[iSat][iEntry];
    417                   }
    418                 }
    419               }
     407                    obs.S5  = gnssData.measdata[iSat][iEntry];
     408                  }
     409                }
     410              }
     411              _obsList.push_back(obs);
    420412            }
    421413          }
  • trunk/BNC/RTIGS/RTIGSDecoder.cpp

    r2710 r2711  
    116116
    117117    for (short ii = 0; ii < numObs; ii++) {
    118       t_obs* obs = new t_obs();
     118      t_obs obs;
     119      obs.satSys   = 'G';
     120      obs.satNum   = _GPSTrans.DecObs.Obs[ii].sat_prn;
     121      obs.GPSWeek  = _GPSTrans.DecObs.Obs[ii].GPSTime / (7 * 86400);
     122      obs.GPSWeeks = _GPSTrans.DecObs.Obs[ii].GPSTime % (7 * 86400);
     123      obs.C1       = _GPSTrans.DecObs.Obs[ii].l1_pseudo_range;
     124      obs.P1       = _GPSTrans.DecObs.Obs[ii].p1_pseudo_range;
     125      obs.P2       = _GPSTrans.DecObs.Obs[ii].p2_pseudo_range;
     126      obs.L1P      = _GPSTrans.DecObs.Obs[ii].p1_phase;
     127      obs.L2P      = _GPSTrans.DecObs.Obs[ii].p2_phase;
     128      obs.S1P      = _GPSTrans.DecObs.Obs[ii].l1_sn;
     129      obs.S2P      = _GPSTrans.DecObs.Obs[ii].l2_sn;
    119130      _obsList.push_back(obs);
    120       obs->satSys   = 'G';
    121       obs->satNum   = _GPSTrans.DecObs.Obs[ii].sat_prn;
    122       obs->GPSWeek  = _GPSTrans.DecObs.Obs[ii].GPSTime / (7 * 86400);
    123       obs->GPSWeeks = _GPSTrans.DecObs.Obs[ii].GPSTime % (7 * 86400);
    124       obs->C1       = _GPSTrans.DecObs.Obs[ii].l1_pseudo_range;
    125       obs->P1       = _GPSTrans.DecObs.Obs[ii].p1_pseudo_range;
    126       obs->P2       = _GPSTrans.DecObs.Obs[ii].p2_pseudo_range;
    127       obs->L1P      = _GPSTrans.DecObs.Obs[ii].p1_phase;
    128       obs->L2P      = _GPSTrans.DecObs.Obs[ii].p2_phase;
    129       obs->S1P      = _GPSTrans.DecObs.Obs[ii].l1_sn;
    130       obs->S2P      = _GPSTrans.DecObs.Obs[ii].l2_sn;
    131131    }
    132132  }
  • trunk/BNC/bnccaster.cpp

    r2710 r2711  
    5555 public:
    5656
    57   t_oldObsInternal(const t_obs* obs) {
    58     strcpy(StatID, obs->StatID);
     57  t_oldObsInternal(const t_obs& obs) {
     58    strcpy(StatID, obs.StatID);
    5959    flags         = 0;
    60     satSys        = obs->satSys;
    61     satNum        = obs->satNum;
    62     slot          = obs->slotNum;
    63     GPSWeek       = obs->GPSWeek;
    64     GPSWeeks      = obs->GPSWeeks;
    65     C1            = obs->C1;
    66     C2            = obs->C2;
    67     P1            = obs->P1;
    68     P2            = obs->P2;
    69     L1            = obs->L1();
    70     L2            = obs->L2();
    71     slip_cnt_L1   = obs->slip_cnt_L1;
    72     slip_cnt_L2   = obs->slip_cnt_L2;
     60    satSys        = obs.satSys;
     61    satNum        = obs.satNum;
     62    slot          = obs.slotNum;
     63    GPSWeek       = obs.GPSWeek;
     64    GPSWeeks      = obs.GPSWeeks;
     65    C1            = obs.C1;
     66    C2            = obs.C2;
     67    P1            = obs.P1;
     68    P2            = obs.P2;
     69    L1            = obs.L1();
     70    L2            = obs.L2();
     71    slip_cnt_L1   = obs.slip_cnt_L1;
     72    slip_cnt_L2   = obs.slip_cnt_L2;
    7373    lock_timei_L1 = -1;
    7474    lock_timei_L2 = -1;
    75     S1            = obs->S1();
    76     S2            = obs->S2();
     75    S1            = obs.S1();
     76    S2            = obs.S2();
    7777    SNR1          = 0;
    7878    SNR2          = 0;
     
    171171  }
    172172
    173   _epochs = new QMultiMap<long, t_obs*>;
     173  _epochs = new QMultiMap<long, t_obs>;
    174174
    175175  _lastDumpSec   = 0;
     
    197197  delete _nmeaServer;
    198198  delete _nmeaSockets;
    199   if (_epochs) {
    200     QListIterator<t_obs*> it(_epochs->values());
    201     while (it.hasNext()) {
    202       delete it.next();
    203     }
    204     delete _epochs;
    205   }
     199  delete _epochs;
    206200}
    207201
    208202// New Observations
    209203////////////////////////////////////////////////////////////////////////////
    210 void bncCaster::newObs(const QByteArray staID, bool firstObs, t_obs* obs) {
     204void bncCaster::newObs(const QByteArray staID, bool firstObs, t_obs obs) {
    211205
    212206  QMutexLocker locker(&_mutex);
    213207
    214   obs->_status = t_obs::received;
    215 
    216   long iSec    = long(floor(obs->GPSWeeks+0.5));
    217   long newTime = obs->GPSWeek * 7*24*3600 + iSec;
     208  long iSec    = long(floor(obs.GPSWeeks+0.5));
     209  long newTime = obs.GPSWeek * 7*24*3600 + iSec;
    218210
    219211  // Rename the Station
    220212  // ------------------
    221   strncpy(obs->StatID, staID.constData(),sizeof(obs->StatID));
    222   obs->StatID[sizeof(obs->StatID)-1] = '\0';
    223        
     213  strncpy(obs.StatID, staID.constData(),sizeof(obs.StatID));
     214  obs.StatID[sizeof(obs.StatID)-1] = '\0';
     215
    224216  const char begObs[] = "BEGOBS";
    225217  const int begObsNBytes = sizeof(begObs) - 1;
     
    283275      }
    284276    }
    285     delete obs;
    286277    return;
    287278  }
     
    323314void bncCaster::addGetThread(bncGetThread* getThread, bool noNewThread) {
    324315
    325   ////  qRegisterMetaType<t_obs*>("p_obs");
     316  qRegisterMetaType<t_obs>("t_obs");
    326317  qRegisterMetaType<gpsephemeris>("gpsephemeris");
    327318  qRegisterMetaType<glonassephemeris>("glonassephemeris");
    328319
    329   connect(getThread, SIGNAL(newObs(QByteArray, bool, t_obs*)),
    330           this,      SLOT(newObs(QByteArray, bool, t_obs*))); /// Qt::DirectConnection);
     320  connect(getThread, SIGNAL(newObs(QByteArray, bool, t_obs)),
     321          this,      SLOT(newObs(QByteArray, bool, t_obs)));
    331322
    332323  connect(getThread, SIGNAL(getThreadFinished(QByteArray)),
     
    385376
    386377    bool first = true;
    387     QList<t_obs*> allObs = _epochs->values(sec);
    388 
    389     QListIterator<t_obs*> it(allObs);
     378    QList<t_obs> allObs = _epochs->values(sec);
     379
     380    QListIterator<t_obs> it(allObs);
    390381    while (it.hasNext()) {
    391       t_obs* obs = it.next();
     382      const t_obs& obs = it.next();
    392383
    393384      if (_samplingRate == 0 || sec % _samplingRate == 0) {
    394385
    395386        if (first) {
    396           QTime enomtime = QTime(0,0,0).addSecs(static_cast<int>(floor(obs->GPSWeeks+0.5)));
     387          QTime enomtime = QTime(0,0,0).addSecs(static_cast<int>(floor(obs.GPSWeeks+0.5)));
    397388//        emit( newMessage( QString("Epoch %1 dumped").arg(enomtime.toString("HH:mm:ss")).toAscii(), true) ); // weber
    398389        }
     
    404395          }
    405396
    406           *_out << obs->StatID << " " << obs->GPSWeek << " "; 
     397          *_out << obs.StatID << " " << obs.GPSWeek << " "; 
    407398          _out->setRealNumberPrecision(7);
    408            *_out << obs->GPSWeeks << " ";
     399           *_out << obs.GPSWeeks << " ";
    409400
    410401           *_out << bncRinex::rinexSatLine(obs, ' ', ' ', ' ').c_str()
     
    461452      }
    462453
    463       delete obs;
    464454      _epochs->remove(sec);
    465455      first = false;
  • trunk/BNC/bnccaster.h

    r2710 r2711  
    4444
    4545 public slots:
    46    void newObs(QByteArray staID, bool firstObs, t_obs* obs);
     46   void newObs(QByteArray staID, bool firstObs, t_obs obs);
    4747   void slotReadMountPoints();
    4848   void slotNewNMEAstr(QByteArray str);
     
    6666   int                      _port;
    6767   QTextStream*             _out;
    68    QMultiMap<long, t_obs*>* _epochs;
     68   QMultiMap<long, t_obs>* _epochs;
    6969   long                     _lastDumpSec;
    7070   QTcpServer*              _server;
  • trunk/BNC/bncgetthread.cpp

    r2710 r2711  
    374374      // Delete old observations
    375375      // -----------------------
    376       QListIterator<t_obs*> itOld(_decoder->_obsList);
    377       while (itOld.hasNext()) {
    378         delete itOld.next();
    379       }
    380376      _decoder->_obsList.clear();
    381377
     
    439435      // Loop over all observations (observations output)
    440436      // ------------------------------------------------
    441       QListIterator<t_obs*> it(_decoder->_obsList);
     437      QListIterator<t_obs> it(_decoder->_obsList);
     438      bool firstObs = true;
    442439      while (it.hasNext()) {
    443         t_obs* obs = it.next();
    444      
     440        const t_obs& obs = it.next();
     441
    445442        // Check observation epoch
    446443        // -----------------------
     
    451448          const double secPerWeek = 7.0 * 24.0 * 3600.0;
    452449         
    453           double currSec = week         * secPerWeek + sec;
    454           double obsSec  = obs->GPSWeek * secPerWeek + obs->GPSWeeks;
     450          double currSec = week        * secPerWeek + sec;
     451          double obsSec  = obs.GPSWeek * secPerWeek + obs.GPSWeeks;
    455452
    456453          const double maxDt = 600.0;
     
    458455          if (fabs(currSec - obsSec) > maxDt) {
    459456              emit( newMessage(_staID + ": Wrong observation epoch(s)", false) );
    460             delete obs;
    461457            continue;
    462458          }
     
    466462        // ------------
    467463        if (_rnx) {
    468           long iSec    = long(floor(obs->GPSWeeks+0.5));
    469           long newTime = obs->GPSWeek * 7*24*3600 + iSec;
     464          long iSec    = long(floor(obs.GPSWeeks+0.5));
     465          long newTime = obs.GPSWeek * 7*24*3600 + iSec;
    470466          if (_samplingRate == 0 || iSec % _samplingRate == 0) {
    471467            _rnx->deepCopy(obs);
     
    484480        // Emit new observation signal
    485481        // ---------------------------
    486         bool firstObs = (obs == _decoder->_obsList.first());
    487         obs->_status = t_obs::posted;
    488          if (!_isToBeDeleted) {
    489            emit newObs(_staID, firstObs, obs);
    490          }
     482        if (!_isToBeDeleted) {
     483          emit newObs(_staID, firstObs, obs);
     484        }
     485        firstObs = false;
    491486      }
    492487      _decoder->_obsList.clear();
  • trunk/BNC/bncgetthread.h

    r2710 r2711  
    7979   void newBytes(QByteArray staID, double nbyte);
    8080   void newLatency(QByteArray staID, double clate);
    81    void newObs(QByteArray staID, bool firstObs, t_obs* obs);
     81   void newObs(QByteArray staID, bool firstObs, t_obs obs);
    8282   void newAntCrd(QByteArray staID, double xx, double yy, double zz, QByteArray antType);
    8383   void newMessage(QByteArray msg, bool showOnScreen);
  • trunk/BNC/bncpppclient.cpp

    r2710 r2711  
    119119//
    120120////////////////////////////////////////////////////////////////////////////
    121 void bncPPPclient::putNewObs(t_obs* obs) {
     121void bncPPPclient::putNewObs(const t_obs& obs) {
    122122  QMutexLocker locker(&_mutex);
    123123
    124   if (obs->satSys != 'G' && !_useGlonass) {
     124  if (obs.satSys != 'G' && !_useGlonass) {
    125125    return;
    126126  }
     
    130130  // Satellite Number
    131131  // ----------------
    132   if      (obs->satSys == 'G') {
    133     QString prn = QString("G%1").arg(obs->satNum, 2, 10, QChar('0'));
     132  if      (obs.satSys == 'G') {
     133    QString prn = QString("G%1").arg(obs.satNum, 2, 10, QChar('0'));
    134134    satData->prn = prn;
    135135  }
    136   else if (obs->satSys == 'R') {
    137     QString prn = QString("R%1").arg(obs->satNum, 2, 10, QChar('0'));
     136  else if (obs.satSys == 'R') {
     137    QString prn = QString("R%1").arg(obs.satNum, 2, 10, QChar('0'));
    138138    satData->prn = prn;
    139139  }
     
    142142  // -----------
    143143  slipInfo& sInfo  = _slips[satData->prn];
    144   if ( sInfo.slipCntL1 == obs->slip_cnt_L1  &&
    145        sInfo.slipCntL2 == obs->slip_cnt_L2 ) {
     144  if ( sInfo.slipCntL1 == obs.slip_cnt_L1  &&
     145       sInfo.slipCntL2 == obs.slip_cnt_L2 ) {
    146146    satData->slipFlag = false;
    147147  }
     
    149149    satData->slipFlag = true;
    150150  }
    151   sInfo.slipCntL1 = obs->slip_cnt_L1;
    152   sInfo.slipCntL2 = obs->slip_cnt_L2;
     151  sInfo.slipCntL1 = obs.slip_cnt_L1;
     152  sInfo.slipCntL2 = obs.slip_cnt_L2;
    153153
    154154  // Handle Code Biases
     
    161161  // Set Code Observations
    162162  // --------------------- 
    163   if      (obs->P1) {
    164     satData->P1         = obs->P1 + (bb ? bb->p1 : 0.0);
     163  if      (obs.P1) {
     164    satData->P1         = obs.P1 + (bb ? bb->p1 : 0.0);
    165165    satData->codeTypeF1 = t_satData::P_CODE;
    166166  }
    167   else if (obs->C1) {
    168     satData->P1         = obs->C1 + (bb ? bb->c1 : 0.0);
     167  else if (obs.C1) {
     168    satData->P1         = obs.C1 + (bb ? bb->c1 : 0.0);
    169169    satData->codeTypeF1 = t_satData::C_CODE;
    170170  }
     
    174174  }
    175175   
    176   if      (obs->P2) {
    177     satData->P2         = obs->P2 + (bb ? bb->p2 : 0.0);
     176  if      (obs.P2) {
     177    satData->P2         = obs.P2 + (bb ? bb->p2 : 0.0);
    178178    satData->codeTypeF2 = t_satData::P_CODE;
    179179  }
    180   else if (obs->C2) {
    181     satData->P2         = obs->C2;
     180  else if (obs.C2) {
     181    satData->P2         = obs.C2;
    182182    satData->codeTypeF2 = t_satData::C_CODE;
    183183  }
     
    190190  double f2 = t_CST::freq2;
    191191
    192   if (obs->satSys == 'R') {
    193     f1 = 1602000000.0 + 562500.0 * obs->slotNum;
    194     f2 = 1246000000.0 + 437500.0 * obs->slotNum;
     192  if (obs.satSys == 'R') {
     193    f1 = 1602000000.0 + 562500.0 * obs.slotNum;
     194    f2 = 1246000000.0 + 437500.0 * obs.slotNum;
    195195  }
    196196
     
    204204  // Set Phase Observations
    205205  // ---------------------- 
    206   if (obs->L1() && obs->L2()) {
    207     satData->L1 = obs->L1() * t_CST::c / f1;
    208     satData->L2 = obs->L2() * t_CST::c / f2;
     206  if (obs.L1() && obs.L2()) {
     207    satData->L1 = obs.L1() * t_CST::c / f1;
     208    satData->L2 = obs.L2() * t_CST::c / f2;
    209209  }
    210210  else {
     
    220220  // Add new Satellite to the epoch
    221221  // ------------------------------
    222   bncTime tt(obs->GPSWeek, obs->GPSWeeks);
     222  bncTime tt(obs.GPSWeek, obs.GPSWeeks);
    223223 
    224224  if      (!_epoData) {
     
    233233  }
    234234
    235   if      (obs->satSys == 'G') {
     235  if      (obs.satSys == 'G') {
    236236    _epoData->satDataGPS[satData->prn] = satData;
    237237  }
    238   else if (obs->satSys == 'R') {
     238  else if (obs.satSys == 'R') {
    239239    _epoData->satDataGlo[satData->prn] = satData;
    240240  }
  • trunk/BNC/bncpppclient.h

    r2710 r2711  
    120120  bncPPPclient(QByteArray staID);
    121121  ~bncPPPclient();
    122   void putNewObs(t_obs* pp);
     122  void putNewObs(const t_obs& pp);
    123123
    124124 public slots:
  • trunk/BNC/bncrinex.cpp

    r2710 r2711  
    107107////////////////////////////////////////////////////////////////////////////
    108108bncRinex::~bncRinex() {
    109   QListIterator<t_obs*> it(_obs);
    110   while (it.hasNext()) {
    111     delete it.next();
    112   }
    113109  bncSettings settings;
    114110  if ((_rinexVers == 3) && ( Qt::CheckState(settings.value("rnxAppend").toInt()) != Qt::Checked) ) {
     
    518514// Stores Observation into Internal Array
    519515////////////////////////////////////////////////////////////////////////////
    520 void bncRinex::deepCopy(const t_obs* obs) {
    521   t_obs* newObs = new t_obs();
    522   memcpy(newObs, obs, sizeof(t_obs));
    523   _obs.push_back(newObs);
     516void bncRinex::deepCopy(t_obs obs) {
     517  _obs.push_back(obs);
    524518}
    525519
     
    530524  // Select observations older than maxTime
    531525  // --------------------------------------
    532   QList<t_obs*> dumpList;
    533   QMutableListIterator<t_obs*> mIt(_obs);
     526  QList<t_obs> dumpList;
     527  QMutableListIterator<t_obs> mIt(_obs);
    534528  while (mIt.hasNext()) {
    535     t_obs* obs = mIt.next();
    536     if (obs->GPSWeek * 7*24*3600 + obs->GPSWeeks < maxTime - 0.05) {
     529    t_obs obs = mIt.next();
     530    if (obs.GPSWeek * 7*24*3600 + obs.GPSWeeks < maxTime - 0.05) {
    537531      dumpList.push_back(obs);
    538532      mIt.remove();
     
    548542  // Time of Epoch
    549543  // -------------
    550   t_obs* fObs = *dumpList.begin();
    551   QDateTime datTim    = dateAndTimeFromGPSweek(fObs->GPSWeek, fObs->GPSWeeks);
    552   QDateTime datTimNom = dateAndTimeFromGPSweek(fObs->GPSWeek,
    553                                                floor(fObs->GPSWeeks+0.5));
     544  const t_obs& fObs   = dumpList.first();
     545  QDateTime datTim    = dateAndTimeFromGPSweek(fObs.GPSWeek, fObs.GPSWeeks);
     546  QDateTime datTimNom = dateAndTimeFromGPSweek(fObs.GPSWeek,
     547                                               floor(fObs.GPSWeeks+0.5));
    554548
    555549  // Close the file
     
    566560  }
    567561
    568   double sec = double(datTim.time().second()) + fmod(fObs->GPSWeeks,1.0);
     562  double sec = double(datTim.time().second()) + fmod(fObs.GPSWeeks,1.0);
    569563
    570564  // Epoch header line: RINEX Version 3
     
    582576         << "  " << 0 << setw(3)  << dumpList.size();
    583577
    584     QListIterator<t_obs*> it(dumpList); int iSat = 0;
     578    QListIterator<t_obs> it(dumpList); int iSat = 0;
    585579    while (it.hasNext()) {
    586580      iSat++;
    587       t_obs* obs = it.next();
    588       _out << obs->satSys << setw(2) << obs->satNum;
     581      const t_obs& obs = it.next();
     582      _out << obs.satSys << setw(2) << obs.satNum;
    589583      if (iSat == 12 && it.hasNext()) {
    590584        _out << endl << "                                ";
     
    595589  }
    596590
    597   QListIterator<t_obs*> it(dumpList);
     591  QListIterator<t_obs> it(dumpList);
    598592  while (it.hasNext()) {
    599     t_obs* obs = it.next();
     593    const t_obs& obs = it.next();
    600594
    601595    // Cycle slips detection
    602596    // ---------------------
    603     QString prn = QString("%1%2").arg(obs->satSys)
    604                             .arg(obs->satNum, 2, 10, QChar('0'));
     597    QString prn = QString("%1%2").arg(obs.satSys)
     598                            .arg(obs.satNum, 2, 10, QChar('0'));
    605599
    606600    char lli1 = ' ';
    607601    char lli2 = ' ';
    608602    char lli5 = ' ';
    609     if      ( obs->slip_cnt_L1 >= 0 ) {
     603    if      ( obs.slip_cnt_L1 >= 0 ) {
    610604      if ( _slip_cnt_L1.find(prn)         != _slip_cnt_L1.end() &&
    611            _slip_cnt_L1.find(prn).value() != obs->slip_cnt_L1 ) {
     605           _slip_cnt_L1.find(prn).value() != obs.slip_cnt_L1 ) {
    612606        lli1 = '1';
    613607      }
    614608    }
    615609
    616     if ( obs->slip_cnt_L2 >= 0 ) {
     610    if ( obs.slip_cnt_L2 >= 0 ) {
    617611      if ( _slip_cnt_L2.find(prn)         != _slip_cnt_L2.end() &&
    618            _slip_cnt_L2.find(prn).value() != obs->slip_cnt_L2 ) {
     612           _slip_cnt_L2.find(prn).value() != obs.slip_cnt_L2 ) {
    619613        lli2 = '1';
    620614      }
    621615    }
    622616
    623     if ( obs->slip_cnt_L5 >= 0 ) {
     617    if ( obs.slip_cnt_L5 >= 0 ) {
    624618      if ( _slip_cnt_L5.find(prn)         != _slip_cnt_L5.end() &&
    625            _slip_cnt_L5.find(prn).value() != obs->slip_cnt_L5 ) {
     619           _slip_cnt_L5.find(prn).value() != obs.slip_cnt_L5 ) {
    626620        lli5 = '1';
    627621      }
    628622    }
    629623
    630     _slip_cnt_L1[prn]   = obs->slip_cnt_L1;
    631     _slip_cnt_L2[prn]   = obs->slip_cnt_L2;
    632     _slip_cnt_L5[prn]   = obs->slip_cnt_L5;
     624    _slip_cnt_L1[prn]   = obs.slip_cnt_L1;
     625    _slip_cnt_L2[prn]   = obs.slip_cnt_L2;
     626    _slip_cnt_L5[prn]   = obs.slip_cnt_L5;
    633627
    634628    // RINEX Version 3
     
    642636    // ---------------
    643637    else {
    644       _out << setw(14) << setprecision(3) << obs->C1 << ' '  << ' '
    645            << setw(14) << setprecision(3) << obs->P1 << ' '  << ' '
    646            << setw(14) << setprecision(3) << obs->L1()  << lli1 << ' '
    647            << setw(14) << setprecision(3) << obs->S1()  << ' '  << ' '
    648            << setw(14) << setprecision(3) << obs->C2 << ' '  << ' ' << endl
    649            << setw(14) << setprecision(3) << obs->P2 << ' '  << ' '
    650            << setw(14) << setprecision(3) << obs->L2()  << lli2 << ' '
    651            << setw(16) << setprecision(3) << obs->S2()  << endl;
    652     }
    653 
    654     delete obs;
     638      _out << setw(14) << setprecision(3) << obs.C1 << ' '  << ' '
     639           << setw(14) << setprecision(3) << obs.P1 << ' '  << ' '
     640           << setw(14) << setprecision(3) << obs.L1()  << lli1 << ' '
     641           << setw(14) << setprecision(3) << obs.S1()  << ' '  << ' '
     642           << setw(14) << setprecision(3) << obs.C2 << ' '  << ' ' << endl
     643           << setw(14) << setprecision(3) << obs.P2 << ' '  << ' '
     644           << setw(14) << setprecision(3) << obs.L2()  << lli2 << ' '
     645           << setw(16) << setprecision(3) << obs.S2()  << endl;
     646    }
    655647  }
    656648
     
    679671// One Line in RINEX v3 (static)
    680672////////////////////////////////////////////////////////////////////////////
    681 string bncRinex::rinexSatLine(const t_obs* obs,
     673string bncRinex::rinexSatLine(const t_obs& obs,
    682674                              char lli1, char lli2, char lli5) {
    683675  ostringstream str;
    684676  str.setf(ios::showpoint | ios::fixed);
    685677
    686   if      (obs->satSys == 'G') { // GPS
    687     str << obs->satSys
    688         << setw(2) << setfill('0') << obs->satNum << setfill(' ')
    689         << setw(14) << setprecision(3) << obs->C1  << ' '  << ' ' 
    690         << setw(14) << setprecision(3) << obs->L1C << lli1 << ' '
    691         << setw(14) << setprecision(3) << obs->D1C << ' '  << ' '
    692         << setw(14) << setprecision(3) << obs->S1C << ' '  << ' '
    693         << setw(14) << setprecision(3) << obs->P1  << ' '  << ' ' 
    694         << setw(14) << setprecision(3) << obs->L1P << lli1 << ' '
    695         << setw(14) << setprecision(3) << obs->D1P << ' '  << ' '
    696         << setw(14) << setprecision(3) << obs->S1P << ' '  << ' '
    697         << setw(14) << setprecision(3) << obs->P2  << ' '  << ' '
    698         << setw(14) << setprecision(3) << obs->L2P << lli2 << ' '
    699         << setw(14) << setprecision(3) << obs->D2P << ' '  << ' '
    700         << setw(14) << setprecision(3) << obs->S2P << ' '  << ' '
    701         << setw(14) << setprecision(3) << obs->C2  << ' '  << ' ' 
    702         << setw(14) << setprecision(3) << obs->L2C << lli2 << ' '
    703         << setw(14) << setprecision(3) << obs->D2C << ' '  << ' '
    704         << setw(14) << setprecision(3) << obs->S2C << ' '  << ' '
    705         << setw(14) << setprecision(3) << obs->C5  << ' '  << ' ' 
    706         << setw(14) << setprecision(3) << obs->L5  << lli5 << ' '
    707         << setw(14) << setprecision(3) << obs->D5  << ' '  << ' ' 
    708         << setw(14) << setprecision(3) << obs->S5;
    709   }
    710   else if (obs->satSys == 'R') { // Glonass
    711     str << obs->satSys
    712         << setw(2) << setfill('0') << obs->satNum << setfill(' ')
    713         << setw(14) << setprecision(3) << obs->C1  << ' '  << ' ' 
    714         << setw(14) << setprecision(3) << obs->L1C << lli1 << ' '
    715         << setw(14) << setprecision(3) << obs->D1C << ' '  << ' ' 
    716         << setw(14) << setprecision(3) << obs->S1C << ' '  << ' '
    717         << setw(14) << setprecision(3) << obs->P1  << ' '  << ' ' 
    718         << setw(14) << setprecision(3) << obs->L1P << lli1 << ' '
    719         << setw(14) << setprecision(3) << obs->D1P << ' '  << ' ' 
    720         << setw(14) << setprecision(3) << obs->S1P << ' '  << ' '
    721         << setw(14) << setprecision(3) << obs->P2  << ' '  << ' ' 
    722         << setw(14) << setprecision(3) << obs->L2P << lli2 << ' '
    723         << setw(14) << setprecision(3) << obs->D2P << ' '  << ' ' 
    724         << setw(14) << setprecision(3) << obs->S2P << ' '  << ' '
    725         << setw(14) << setprecision(3) << obs->C2  << ' '  << ' '
    726         << setw(14) << setprecision(3) << obs->L2C << lli2 << ' '
    727         << setw(14) << setprecision(3) << obs->D2C << ' '  << ' ' 
    728         << setw(14) << setprecision(3) << obs->S2C;
    729   }
    730   else if (obs->satSys == 'S') { // SBAS
    731     str << obs->satSys
    732         << setw(2) << setfill('0') << obs->satNum << setfill(' ')
    733         << setw(14) << setprecision(3) << obs->C1  << ' '  << ' ' 
    734         << setw(14) << setprecision(3) << obs->L1C << lli1 << ' '
    735         << setw(14) << setprecision(3) << obs->D1C << ' '  << ' ' 
    736         << setw(14) << setprecision(3) << obs->S1C << ' '  << ' '
    737         << setw(14) << setprecision(3) << obs->P1  << ' '  << ' ' 
    738         << setw(14) << setprecision(3) << obs->L1P << lli1 << ' '
    739         << setw(14) << setprecision(3) << obs->D1P << ' '  << ' ' 
    740         << setw(14) << setprecision(3) << obs->S1P;
    741   }
    742   else if (obs->satSys == 'E') { // Galileo
    743     str << obs->satSys
    744         << setw(2) << setfill('0') << obs->satNum << setfill(' ')
    745         << setw(14) << setprecision(3) << obs->C1  << ' '  << ' ' 
    746         << setw(14) << setprecision(3) << obs->L1C << lli1 << ' '
    747         << setw(14) << setprecision(3) << obs->D1C << ' '  << ' '
    748         << setw(14) << setprecision(3) << obs->S1C << ' '  << ' '
    749         << setw(14) << setprecision(3) << obs->C5  << ' '  << ' ' 
    750         << setw(14) << setprecision(3) << obs->L5  << lli5 << ' '
    751         << setw(14) << setprecision(3) << obs->D5  << ' '  << ' ' 
    752         << setw(14) << setprecision(3) << obs->S5;
     678  if      (obs.satSys == 'G') { // GPS
     679    str << obs.satSys
     680        << setw(2) << setfill('0') << obs.satNum << setfill(' ')
     681        << setw(14) << setprecision(3) << obs.C1  << ' '  << ' ' 
     682        << setw(14) << setprecision(3) << obs.L1C << lli1 << ' '
     683        << setw(14) << setprecision(3) << obs.D1C << ' '  << ' '
     684        << setw(14) << setprecision(3) << obs.S1C << ' '  << ' '
     685        << setw(14) << setprecision(3) << obs.P1  << ' '  << ' ' 
     686        << setw(14) << setprecision(3) << obs.L1P << lli1 << ' '
     687        << setw(14) << setprecision(3) << obs.D1P << ' '  << ' '
     688        << setw(14) << setprecision(3) << obs.S1P << ' '  << ' '
     689        << setw(14) << setprecision(3) << obs.P2  << ' '  << ' '
     690        << setw(14) << setprecision(3) << obs.L2P << lli2 << ' '
     691        << setw(14) << setprecision(3) << obs.D2P << ' '  << ' '
     692        << setw(14) << setprecision(3) << obs.S2P << ' '  << ' '
     693        << setw(14) << setprecision(3) << obs.C2  << ' '  << ' ' 
     694        << setw(14) << setprecision(3) << obs.L2C << lli2 << ' '
     695        << setw(14) << setprecision(3) << obs.D2C << ' '  << ' '
     696        << setw(14) << setprecision(3) << obs.S2C << ' '  << ' '
     697        << setw(14) << setprecision(3) << obs.C5  << ' '  << ' ' 
     698        << setw(14) << setprecision(3) << obs.L5  << lli5 << ' '
     699        << setw(14) << setprecision(3) << obs.D5  << ' '  << ' ' 
     700        << setw(14) << setprecision(3) << obs.S5;
     701  }
     702  else if (obs.satSys == 'R') { // Glonass
     703    str << obs.satSys
     704        << setw(2) << setfill('0') << obs.satNum << setfill(' ')
     705        << setw(14) << setprecision(3) << obs.C1  << ' '  << ' ' 
     706        << setw(14) << setprecision(3) << obs.L1C << lli1 << ' '
     707        << setw(14) << setprecision(3) << obs.D1C << ' '  << ' ' 
     708        << setw(14) << setprecision(3) << obs.S1C << ' '  << ' '
     709        << setw(14) << setprecision(3) << obs.P1  << ' '  << ' ' 
     710        << setw(14) << setprecision(3) << obs.L1P << lli1 << ' '
     711        << setw(14) << setprecision(3) << obs.D1P << ' '  << ' ' 
     712        << setw(14) << setprecision(3) << obs.S1P << ' '  << ' '
     713        << setw(14) << setprecision(3) << obs.P2  << ' '  << ' ' 
     714        << setw(14) << setprecision(3) << obs.L2P << lli2 << ' '
     715        << setw(14) << setprecision(3) << obs.D2P << ' '  << ' ' 
     716        << setw(14) << setprecision(3) << obs.S2P << ' '  << ' '
     717        << setw(14) << setprecision(3) << obs.C2  << ' '  << ' '
     718        << setw(14) << setprecision(3) << obs.L2C << lli2 << ' '
     719        << setw(14) << setprecision(3) << obs.D2C << ' '  << ' ' 
     720        << setw(14) << setprecision(3) << obs.S2C;
     721  }
     722  else if (obs.satSys == 'S') { // SBAS
     723    str << obs.satSys
     724        << setw(2) << setfill('0') << obs.satNum << setfill(' ')
     725        << setw(14) << setprecision(3) << obs.C1  << ' '  << ' ' 
     726        << setw(14) << setprecision(3) << obs.L1C << lli1 << ' '
     727        << setw(14) << setprecision(3) << obs.D1C << ' '  << ' ' 
     728        << setw(14) << setprecision(3) << obs.S1C << ' '  << ' '
     729        << setw(14) << setprecision(3) << obs.P1  << ' '  << ' ' 
     730        << setw(14) << setprecision(3) << obs.L1P << lli1 << ' '
     731        << setw(14) << setprecision(3) << obs.D1P << ' '  << ' ' 
     732        << setw(14) << setprecision(3) << obs.S1P;
     733  }
     734  else if (obs.satSys == 'E') { // Galileo
     735    str << obs.satSys
     736        << setw(2) << setfill('0') << obs.satNum << setfill(' ')
     737        << setw(14) << setprecision(3) << obs.C1  << ' '  << ' ' 
     738        << setw(14) << setprecision(3) << obs.L1C << lli1 << ' '
     739        << setw(14) << setprecision(3) << obs.D1C << ' '  << ' '
     740        << setw(14) << setprecision(3) << obs.S1C << ' '  << ' '
     741        << setw(14) << setprecision(3) << obs.C5  << ' '  << ' ' 
     742        << setw(14) << setprecision(3) << obs.L5  << lli5 << ' '
     743        << setw(14) << setprecision(3) << obs.D5  << ' '  << ' ' 
     744        << setw(14) << setprecision(3) << obs.S5;
    753745  }
    754746  return str.str();
  • trunk/BNC/bncrinex.h

    r2710 r2711  
    4242            const QByteArray& ntripVersion);
    4343   ~bncRinex();
    44    void deepCopy(const t_obs* obs);
     44   void deepCopy(t_obs obs);
    4545   void dumpEpoch(long maxTime);
    4646   void setReconnectFlag(bool flag){_reconnectFlag = flag;}
     
    5555   }
    5656
    57    static std::string rinexSatLine(const t_obs* obs,
     57   static std::string rinexSatLine(const t_obs& obs,
    5858                                   char lli1, char lli2, char lli5);
    5959
     
    6767   QByteArray    _statID;
    6868   QByteArray    _fName;
    69    QList<t_obs*> _obs;
     69   QList<t_obs> _obs;
    7070   std::ofstream _out;
    7171   QStringList   _headerLines;
  • trunk/BNC/latencychecker.cpp

    r2710 r2711  
    307307// Perform latency checks (observations)
    308308//////////////////////////////////////////////////////////////////////////////
    309 void latencyChecker::checkObsLatency(const QList<t_obs*>& obsList) {
     309void latencyChecker::checkObsLatency(const QList<t_obs>& obsList) {
    310310
    311311  if (_perfIntr > 0 ) {
    312312
    313     QListIterator<t_obs*> it(obsList);
     313    QListIterator<t_obs> it(obsList);
    314314    while (it.hasNext()) {
    315       t_obs* obs = it.next();
     315      const t_obs& obs = it.next();
    316316     
    317       _newSecGPS = static_cast<int>(obs->GPSWeeks);
     317      _newSecGPS = static_cast<int>(obs.GPSWeeks);
    318318      if (_newSecGPS != _oldSecGPS) {
    319319        if (_newSecGPS % _perfIntr < _oldSecGPS % _perfIntr) {
     
    368368        currentGPSWeeks(week, sec);
    369369        const double secPerWeek = 7.0 * 24.0 * 3600.0;
    370         if (week < obs->GPSWeek) {
     370        if (week < obs.GPSWeek) {
    371371          week += 1;
    372372          sec  -= secPerWeek;
    373373        }
    374         if (week > obs->GPSWeek) {
     374        if (week > obs.GPSWeek) {
    375375          week -= 1;
    376376          sec  += secPerWeek;
    377377        }
    378          _curLat   = sec - obs->GPSWeeks;
     378         _curLat   = sec - obs.GPSWeeks;
    379379        _sumLat  += _curLat;
    380380        _sumLatQ += _curLat * _curLat;
  • trunk/BNC/latencychecker.h

    r2710 r2711  
    3838  void checkReconnect();
    3939  void checkOutage(bool decoded);
    40   void checkObsLatency(const QList<t_obs*>& obsList);
     40  void checkObsLatency(const QList<t_obs>& obsList);
    4141  void checkCorrLatency(int corrGPSEpochTime);
    4242  double currentLatency() const {return _curLat;}
Note: See TracChangeset for help on using the changeset viewer.