Changeset 2927 in ntrip


Ignore:
Timestamp:
Jan 29, 2011, 1:04:04 PM (13 years ago)
Author:
mervart
Message:
 
Location:
trunk/BNC/combination
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/combination/bnccomb.cpp

    r2924 r2927  
    1919#include "bnccomb.h"
    2020#include "bncapp.h"
     21#include "cmbcaster.h"
    2122#include "bncsettings.h"
    2223
     
    4344    }
    4445  }
     46
     47  _caster = new cmbCaster();
    4548}
    4649
     
    5356    delete it.value();
    5457  }
     58  delete _caster;
    5559}
    5660
     
    8690  const double waitTime = 5.0; // wait 5 sec
    8791  _processedBeforeTime = newCorr->tt - waitTime;
    88   processEpochs();
     92
     93  QList<cmbEpoch*> epochsToProcess;
     94
     95  QMapIterator<QString, cmbAC*> itAC(_ACs);
     96  while (itAC.hasNext()) {
     97    itAC.next();
     98    cmbAC* AC = itAC.value();
     99
     100    QMutableListIterator<cmbEpoch*> itEpo(AC->epochs);
     101    while (itEpo.hasNext()) {
     102      cmbEpoch* epoch = itEpo.next();
     103      if (epoch->time < _processedBeforeTime) {
     104        epochsToProcess.append(epoch);
     105        itEpo.remove();
     106      }
     107    }
     108  }
     109
     110  if (epochsToProcess.size()) {
     111    processEpochs(epochsToProcess);
     112  }
    89113
    90114  // Check Modulo Time
     
    108132  }
    109133  if (newEpoch == 0) {
    110     newEpoch = new cmbEpoch();
     134    newEpoch = new cmbEpoch(AC->name);
    111135    newEpoch->time = newCorr->tt;
    112136    AC->epochs.append(newEpoch);
     
    125149//
    126150////////////////////////////////////////////////////////////////////////////
    127 void bncComb::processEpochs() {
    128 
    129   bool corrProcessed = false;
    130 
    131   QMapIterator<QString, cmbAC*> itAC(_ACs);
    132   while (itAC.hasNext()) {
    133     itAC.next();
    134     cmbAC* AC = itAC.value();
    135 
    136     QMutableListIterator<cmbEpoch*> itEpo(AC->epochs);
    137     while (itEpo.hasNext()) {
    138       cmbEpoch* epoch = itEpo.next();
    139       if (epoch->time < _processedBeforeTime) {
    140         QMapIterator<QString, t_corr*> itCorr(epoch->corr);
    141         while (itCorr.hasNext()) {
    142           itCorr.next();
    143           t_corr* corr = itCorr.value();
    144           processSingleCorr(AC, corr);
    145           corrProcessed = true;
    146         }
    147         delete epoch;
    148         itEpo.remove();
    149       }
    150     }
    151   }
    152 
    153   if (corrProcessed) {
    154     printResults();
    155   }
    156 }
    157 
    158 //
    159 ////////////////////////////////////////////////////////////////////////////
    160 void bncComb::processSingleCorr(const cmbAC* AC, const t_corr* corr) {
     151void bncComb::processEpochs(const QList<cmbEpoch*>& epochs) {
     152
     153  QListIterator<cmbEpoch*> itEpo(epochs);
     154  while (itEpo.hasNext()) {
     155    cmbEpoch* epo = itEpo.next();
     156    QMapIterator<QString, t_corr*> itCorr(epo->corr);
     157    while (itCorr.hasNext()) {
     158      itCorr.next();
     159      t_corr* corr = itCorr.value();
     160      printSingleCorr(epo->acName, corr);
     161    }
     162  }
     163
     164  cout << "Corrections processed" << endl << endl;
     165}
     166
     167//
     168////////////////////////////////////////////////////////////////////////////
     169void bncComb::printSingleCorr(const QString& acName, const t_corr* corr) {
    161170  cout.setf(ios::fixed);
    162   cout << AC->name.toAscii().data()                           << " "
    163        << AC->mountPoint.toAscii().data()                     << " "
     171  cout << acName.toAscii().data()                             << " "
    164172       << corr->prn.toAscii().data()                          << " "
    165173       << corr->tt.timestr()                                  << " "
     
    171179}
    172180
    173 //
    174 ////////////////////////////////////////////////////////////////////////////
    175 void bncComb::printResults() const {
    176 
    177   cout << "Corrections processed" << endl << endl;
    178 
    179 }
     181// //
     182// ////////////////////////////////////////////////////////////////////////////
     183// void bncComb::printResults() const {
     184//
     185// //  _caster->open();     
     186// //
     187// //  //// beg test
     188// //  cmbEpoch* resEpoch = 0;
     189// //  if (_ACs->find("CLK10") != _ACs->end()) {
     190// //    cmbAC* AC = _ACs["CLK10"];
     191// //    QMutableListIterator<cmbEpoch*> itEpo(AC->epochs);
     192// //    while (itEpo.hasNext()) {
     193// //     
     194// //
     195// //  }
     196// //  //// end test
     197//
     198// struct ClockOrbit co;
     199//
     200// //  memset(&co, 0, sizeof(co));
     201// //  co.GPSEpochTime      = (int)_GPSweeks;
     202// //  co.GLONASSEpochTime  = (int)fmod(_GPSweeks, 86400.0)
     203// //                       + 3 * 3600 - gnumleap(_year, _month, _day);
     204// //  co.ClockDataSupplied = 1;
     205// //  co.OrbitDataSupplied = 1;
     206// //  co.SatRefDatum       = DATUM_ITRF;
     207// //
     208// //  // struct ClockOrbit::SatData* sd = 0;
     209//   // if      (prn[0] == 'G') {
     210//   //   sd = co.Sat + co.NumberOfGPSSat;
     211//   //   ++co.NumberOfGPSSat;
     212//   // }
     213//   // else if (prn[0] == 'R') {
     214//   //   sd = co.Sat + CLOCKORBIT_NUMGPS + co.NumberOfGLONASSSat;
     215//   //   ++co.NumberOfGLONASSSat;
     216//   // }
     217//
     218//   // sd->ID                    = prn.mid(1).toInt();
     219//   // sd->IOD                   = ep->IOD();
     220//   // sd->Clock.DeltaA0         = dClk;
     221//   // sd->Orbit.DeltaRadial     = rsw(1);
     222//   // sd->Orbit.DeltaAlongTrack = rsw(2);
     223//   // sd->Orbit.DeltaCrossTrack = rsw(3);
     224//   // sd->Orbit.DotDeltaRadial     = (rsw2(1) - rsw(1)) / xx(11);
     225//   // sd->Orbit.DotDeltaAlongTrack = (rsw2(2) - rsw(2)) / xx(11);
     226//   // sd->Orbit.DotDeltaCrossTrack = (rsw2(3) - rsw(3)) / xx(11);
     227//
     228//   if ( _caster->usedSocket() &&
     229//        (co.NumberOfGPSSat > 0 || co.NumberOfGLONASSSat > 0) ) {
     230//     char obuffer[CLOCKORBIT_BUFFERSIZE];
     231//     int len = MakeClockOrbit(&co, COTYPE_AUTO, 0, obuffer, sizeof(obuffer));
     232//     if (len > 0) {
     233//       _caster->write(obuffer, len);
     234//     }
     235//   }
     236//
     237//   cout << "Corrections processed" << endl << endl;
     238//
     239// }
  • trunk/BNC/combination/bnccomb.h

    r2924 r2927  
    44
    55#include "bncephuser.h"
     6
     7class cmbCaster;
    68
    79class bncComb : public bncEphUser  {
     
    2123  class cmbEpoch {
    2224   public:
    23     cmbEpoch() {}
     25    cmbEpoch(const QString& name) {acName = name;}
    2426    ~cmbEpoch() {
    2527      QMapIterator<QString, t_corr*> it(corr);
     
    2931      }
    3032    }
     33    QString                acName;
    3134    bncTime                time;
    3235    QMap<QString, t_corr*> corr; // Corrections (key is PRN)
     
    4851  };
    4952
    50   void processEpochs();
    51   void processSingleCorr(const cmbAC* AC, const t_corr* corr);
    52   void printResults() const;
     53  void processEpochs(const QList<cmbEpoch*>& epochs);
     54  void printSingleCorr(const QString& acName, const t_corr* corr);
    5355
    5456  QMap<QString, cmbAC*> _ACs;   // Analytical Centers (key is mountpoint)
    5557  bncTime               _processedBeforeTime;
     58  cmbCaster*            _caster;
    5659};
    5760
Note: See TracChangeset for help on using the changeset viewer.