Changeset 7278 in ntrip for trunk/BNC/src/pppRun.cpp


Ignore:
Timestamp:
Sep 15, 2015, 4:48:34 AM (9 years ago)
Author:
stuerze
Message:

some memory leaks fixed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/pppRun.cpp

    r7231 r7278  
    3636 * Created:    29-Jul-2014
    3737 *
    38  * Changes:   
     38 * Changes:
    3939 *
    4040 * -----------------------------------------------------------------------*/
     
    6767  _opt = opt;
    6868
    69   connect(this, SIGNAL(newMessage(QByteArray,bool)), 
     69  connect(this, SIGNAL(newMessage(QByteArray,bool)),
    7070          BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
    7171
     
    9191    connect(BNC_CORE, SIGNAL(newGPSEph(t_ephGPS)),
    9292            this, SLOT(slotNewGPSEph(t_ephGPS)),conType);
    93  
     93
    9494    connect(BNC_CORE, SIGNAL(newGlonassEph(t_ephGlo)),
    9595            this, SLOT(slotNewGlonassEph(t_ephGlo)),conType);
    96  
     96
    9797    connect(BNC_CORE, SIGNAL(newGalileoEph(t_ephGal)),
    9898            this, SLOT(slotNewGalileoEph(t_ephGal)),conType);
     
    120120    connect(this, SIGNAL(progressRnxPPP(int)), BNC_CORE, SIGNAL(progressRnxPPP(int)));
    121121    connect(this, SIGNAL(finishedRnxPPP()),    BNC_CORE, SIGNAL(finishedRnxPPP()));
    122     connect(BNC_CORE, SIGNAL(mapSpeedSliderChanged(int)),   
     122    connect(BNC_CORE, SIGNAL(mapSpeedSliderChanged(int)),
    123123            this, SLOT(slotSetSpeed(int)));
    124124    connect(BNC_CORE, SIGNAL(stopRinexPPP()), this, SLOT(slotSetStopFlag()));
    125125  }
    126  
     126
    127127  _stopFlag = false;
    128128
     
    183183}
    184184
    185 // 
     185//
    186186////////////////////////////////////////////////////////////////////////////
    187187void t_pppRun::slotNewGPSEph(t_ephGPS eph) {
     
    190190}
    191191
    192 // 
     192//
    193193////////////////////////////////////////////////////////////////////////////
    194194void t_pppRun::slotNewGlonassEph(t_ephGlo eph) {
     
    196196  _pppClient->putEphemeris(&eph);
    197197}
    198  
    199 // 
     198
     199//
    200200////////////////////////////////////////////////////////////////////////////
    201201void t_pppRun::slotNewGalileoEph(t_ephGal eph) {
     
    220220  }
    221221
    222   // Loop over all obsevations (possible different epochs)
     222  // Loop over all observations (possible different epochs)
    223223  // -----------------------------------------------------
    224224  QListIterator<t_satObs> it(obsList);
     
    276276
    277277    delete _epoData.front(); _epoData.pop_front();
    278    
     278
    279279    ostringstream log;
    280280    if (output._error) {
     
    295295
    296296    if (_logFile && output._epoTime.valid()) {
    297       _logFile->write(output._epoTime.gpsw(), output._epoTime.gpssec(), 
    298                       QString(output._log.c_str())); 
     297      _logFile->write(output._epoTime.gpsw(), output._epoTime.gpssec(),
     298                      QString(output._log.c_str()));
    299299    }
    300300
     
    335335}
    336336
    337 // 
     337//
    338338////////////////////////////////////////////////////////////////////////////
    339339void t_pppRun::slotNewOrbCorrections(QList<t_orbCorr> orbCorr) {
     
    352352  }
    353353
    354   _pppClient->putOrbCorrections(corrections);
    355 }
    356 
    357 //
     354  _pppClient->putOrbCorrections(corrections);
     355
     356  for (unsigned ii = 0; ii < corrections.size(); ii++) {
     357    delete corrections[ii];
     358  }
     359}
     360
     361//
    358362////////////////////////////////////////////////////////////////////////////
    359363void t_pppRun::slotNewClkCorrections(QList<t_clkCorr> clkCorr) {
     
    372376    _lastClkCorrTime = clkCorr[ii]._time;
    373377  }
    374   _pppClient->putClkCorrections(corrections);
    375 }
    376 
    377 //
     378  _pppClient->putClkCorrections(corrections);
     379
     380  for (unsigned ii = 0; ii < corrections.size(); ii++) {
     381    delete corrections[ii];
     382  }
     383}
     384
     385//
    378386////////////////////////////////////////////////////////////////////////////
    379387void t_pppRun::slotNewCodeBiases(QList<t_satCodeBias> codeBiases) {
     
    392400  }
    393401
    394   _pppClient->putCodeBiases(biases);
    395 }
    396 
    397 //
     402  _pppClient->putCodeBiases(biases);
     403
     404  for (unsigned ii = 0; ii < biases.size(); ii++) {
     405    delete biases[ii];
     406  }
     407}
     408
     409//
    398410////////////////////////////////////////////////////////////////////////////
    399411void t_pppRun::processFiles() {
     
    468480    for (unsigned iObs = 0; iObs < epo->rnxSat.size(); iObs++) {
    469481      const t_rnxObsFile::t_rnxSat& rnxSat = epo->rnxSat[iObs];
    470    
     482
    471483      t_satObs obs;
    472484      t_rnxObsFile::setObsFromRnx(_rnxObsFile, epo, rnxSat, obs);
     
    479491      emit progressRnxPPP(nEpo);
    480492    }
    481  
     493
    482494    QCoreApplication::processEvents();
    483495  }
     
    493505}
    494506
    495 // 
     507//
    496508////////////////////////////////////////////////////////////////////////////
    497509void t_pppRun::slotSetSpeed(int speed) {
     
    500512}
    501513
    502 // 
     514//
    503515////////////////////////////////////////////////////////////////////////////
    504516void t_pppRun::slotSetStopFlag() {
     
    507519}
    508520
    509 // 
     521//
    510522////////////////////////////////////////////////////////////////////////////
    511523QString t_pppRun::nmeaString(char strType, const t_output& output) {
    512524
    513   double ell[3]; 
     525  double ell[3];
    514526  xyz2ell(output._xyzRover, ell);
    515527  double phiDeg = ell[0] * 180 / M_PI;
     
    520532    phiDeg = -phiDeg;
    521533    phiCh  =  'S';
    522   }   
     534  }
    523535  char lamCh = 'E';
    524536  if (lamDeg < 0) {
    525537    lamDeg = -lamDeg;
    526538    lamCh  =  'W';
    527   }   
     539  }
    528540
    529541  ostringstream out;
     
    532544  if      (strType == 'R') {
    533545    string datestr = output._epoTime.datestr(0); // yyyymmdd
    534     out << "GPRMC," 
     546    out << "GPRMC,"
    535547        << output._epoTime.timestr(0,0) << ",A,"
    536         << setw(2) << setfill('0') << int(phiDeg) 
    537         << setw(6) << setprecision(3) << setfill('0') 
     548        << setw(2) << setfill('0') << int(phiDeg)
     549        << setw(6) << setprecision(3) << setfill('0')
    538550        << fmod(60*phiDeg,60) << ',' << phiCh << ','
    539         << setw(3) << setfill('0') << int(lamDeg) 
    540         << setw(6) << setprecision(3) << setfill('0') 
     551        << setw(3) << setfill('0') << int(lamDeg)
     552        << setw(6) << setprecision(3) << setfill('0')
    541553        << fmod(60*lamDeg,60) << ',' << lamCh << ",,,"
    542554        << datestr[6] << datestr[7] << datestr[4] << datestr[5]
     
    544556  }
    545557  else if (strType == 'G') {
    546     out << "GPGGA," 
     558    out << "GPGGA,"
    547559        << output._epoTime.timestr(0,0) << ','
    548         << setw(2) << setfill('0') << int(phiDeg) 
    549         << setw(10) << setprecision(7) << setfill('0') 
     560        << setw(2) << setfill('0') << int(phiDeg)
     561        << setw(10) << setprecision(7) << setfill('0')
    550562        << fmod(60*phiDeg,60) << ',' << phiCh << ','
    551         << setw(3) << setfill('0') << int(lamDeg) 
    552         << setw(10) << setprecision(7) << setfill('0') 
    553         << fmod(60*lamDeg,60) << ',' << lamCh 
     563        << setw(3) << setfill('0') << int(lamDeg)
     564        << setw(10) << setprecision(7) << setfill('0')
     565        << fmod(60*lamDeg,60) << ',' << lamCh
    554566        << ",1," << setw(2) << setfill('0') << output._numSat << ','
    555567        << setw(3) << setprecision(1) << output._pDop << ','
     
    569581}
    570582
    571 // 
     583//
    572584////////////////////////////////////////////////////////////////////////////
    573585bool t_pppRun::waitForCorr(const bncTime& epoTime) const {
Note: See TracChangeset for help on using the changeset viewer.