Changeset 4342 in ntrip for trunk/BNC/src/rinex/reqcanalyze.cpp


Ignore:
Timestamp:
Jun 24, 2012, 4:06:05 PM (12 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/rinex/reqcanalyze.cpp

    r4341 r4342  
    6464
    6565  _currEpo = 0;
    66   _dataMP1 = 0;
    67   _dataMP2 = 0;
    68 
    69   connect(this, SIGNAL(displayGraph()), this, SLOT(slotDisplayGraph()));
     66
     67  connect(this, SIGNAL(displayGraph(QVector<t_polarPoint*>*, QVector<t_polarPoint*>*)),
     68          this, SLOT(slotDisplayGraph(QVector<t_polarPoint*>*, QVector<t_polarPoint*>*)));
    7069}
    7170
     
    8584// 
    8685////////////////////////////////////////////////////////////////////////////
    87 void t_reqcAnalyze::slotDisplayGraph() {
     86void t_reqcAnalyze::slotDisplayGraph(QVector<t_polarPoint*>* dataMP1,
     87                                     QVector<t_polarPoint*>* dataMP2) {
     88
    8889  if (((bncApp*) qApp)->mode() == bncApp::interactive) {
    8990
    9091    t_polarPlot* plotMP1 = new t_polarPlot(0);
    91     plotMP1->addCurve(_dataMP1);
    92     _dataMP1 = 0;
     92    plotMP1->addCurve(dataMP1);
    9393
    9494    t_polarPlot* plotMP2 = new t_polarPlot(0);
    95     plotMP2->addCurve(_dataMP2);
    96     _dataMP2 = 0;
     95    plotMP2->addCurve(dataMP2);
    9796   
    9897    QVector<QWidget*> plots;
     
    151150        << obsFile->fileName().toAscii().data() << endl << endl;
    152151
     152  // A priori Coordinates
     153  // --------------------
     154  ColumnVector xyz = obsFile->xyz();
     155
    153156  // Loop over all Epochs
    154157  // --------------------
     
    179182      t_satStat& satStat = _satStat[prn];
    180183
    181       satStat.addObs(eph, obs);
     184      satStat.addObs(obs, eph, xyz);
    182185    }
    183186
     
    189192  _log->setRealNumberPrecision(2);
    190193
    191   delete _dataMP1; _dataMP1 = new QVector<t_polarPoint*>;
    192   delete _dataMP2; _dataMP2 = new QVector<t_polarPoint*>;
     194  QVector<t_polarPoint*>*  dataMP1 = new QVector<t_polarPoint*>;
     195  QVector<t_polarPoint*>*  dataMP2 = new QVector<t_polarPoint*>;
    193196
    194197  QMapIterator<QString, t_satStat> it(_satStat);
     
    218221        stddev2 += diff2 * diff2;
    219222        //// beg test
    220         (*_dataMP1) << (new t_polarPoint(anaObs->az, anaObs->zen, 0.5));
    221         (*_dataMP2) << (new t_polarPoint(anaObs->az, anaObs->zen, 1.0));
     223        (*dataMP1) << (new t_polarPoint(anaObs->az, anaObs->zen, 0.5));
     224        (*dataMP2) << (new t_polarPoint(anaObs->az, anaObs->zen, 1.0));
    222225        //// end test
    223226      }
     
    230233  }
    231234
    232   emit displayGraph();
     235  emit displayGraph(dataMP1, dataMP2);
    233236
    234237  _log->flush();
     
    237240// 
    238241////////////////////////////////////////////////////////////////////////////
    239 void t_reqcAnalyze::t_satStat::addObs(const t_eph* eph, const t_obs& obs) {
     242void t_reqcAnalyze::t_satStat::addObs(const t_obs& obs, const t_eph* eph,
     243                                      const ColumnVector& xyz) {
    240244
    241245  t_anaObs* newObs = new t_anaObs(obs);
     
    261265  // Compute the Azimuth and Zenith Distance
    262266  // ---------------------------------------
    263   if (eph) {
     267  if (eph && xyz.size()) {
    264268    double xSat, ySat, zSat, clkSat;
    265269    eph->position(obs.GPSWeek, obs.GPSWeeks, xSat, ySat, zSat, clkSat);
    266270
    267     //// beg test
    268     double xRec = -3947762.7496;
    269     double yRec =  3364399.8789;
    270     double zRec =  3699428.5111;
    271     //// end test
    272    
    273271    double rho, eleSat, azSat;
    274     topos(xRec, yRec, zRec, xSat, ySat, zSat, rho, eleSat, azSat);
     272    topos(xyz(1), xyz(2), xyz(3), xSat, ySat, zSat, rho, eleSat, azSat);
    275273
    276274    newObs->az  = azSat * 180.0/M_PI;
Note: See TracChangeset for help on using the changeset viewer.