Changeset 2918 in ntrip for trunk/BNC/combination/bnccomb.cpp
- Timestamp:
- Jan 27, 2011, 5:39:44 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/combination/bnccomb.cpp
r2915 r2918 30 30 31 31 QStringList combineStreams = settings.value("combineStreams").toStringList(); 32 33 _nStreams = combineStreams.size(); 34 35 if (_nStreams >= 2) { 32 33 if (combineStreams.size() >= 2) { 36 34 QListIterator<QString> it(combineStreams); 37 35 while (it.hasNext()) { 38 36 QStringList hlp = it.next().split(" "); 39 cout << "combination: " << hlp[0].toAscii().data() << endl; 37 cmbAC* newAC = new cmbAC(); 38 newAC->mountPoint = hlp[0]; 39 newAC->name = hlp[1]; 40 newAC->weight = hlp[2].toDouble(); 41 42 _ACs[newAC->mountPoint] = newAC; 40 43 } 41 44 } … … 45 48 //////////////////////////////////////////////////////////////////////////// 46 49 bncComb::~bncComb() { 50 QMapIterator<QString, cmbAC*> it(_ACs); 51 while (it.hasNext()) { 52 it.next(); 53 delete it.value(); 54 } 47 55 } 48 56 … … 52 60 QMutexLocker locker(&_mutex); 53 61 62 // Find the relevant instance of cmbAC class 63 // ----------------------------------------- 64 if (_ACs.find(staID) == _ACs.end()) { 65 return; 66 } 67 cmbAC* AC = _ACs[staID]; 68 69 // Read the Correction 70 // ------------------- 54 71 t_corr* newCorr = new t_corr(); 55 72 if (!newCorr->readLine(line) == success) { … … 58 75 } 59 76 60 cout << staID.toAscii().data() << " " << newCorr->prn.toAscii().data() << " " 61 << newCorr->tt.datestr() << " " << newCorr->tt.timestr() << " " 62 << newCorr->iod << " " << newCorr->dClk << endl; 77 // Find/Create the instance of cmbEpoch class 78 // ------------------------------------------ 79 cmbEpoch* newEpoch = 0; 80 QListIterator<cmbEpoch*> it(AC->epochs); 81 while (it.hasNext()) { 82 cmbEpoch* hlpEpoch = it.next(); 83 if (hlpEpoch->time == newCorr->tt) { 84 newEpoch = hlpEpoch; 85 break; 86 } 87 } 88 if (newEpoch == 0) { 89 newEpoch = new cmbEpoch(); 90 newEpoch->time = newCorr->tt; 91 AC->epochs.append(newEpoch); 92 } 63 93 64 delete newCorr; 94 if (newEpoch->corr.find(newCorr->prn) != newEpoch->corr.end()) { 95 delete newEpoch->corr[newCorr->prn]; 96 } 97 newEpoch->corr[newCorr->prn] = newCorr; 98 99 processEpochsBefore(newCorr->tt); 65 100 } 66 101 102 // 103 //////////////////////////////////////////////////////////////////////////// 104 void bncComb::processEpochsBefore(const bncTime& time) { 105 106 const double waitTime = 10.0; // wait 10 seconds 107 108 QMapIterator<QString, cmbAC*> itAC(_ACs); 109 while (itAC.hasNext()) { 110 itAC.next(); 111 cmbAC* AC = itAC.value(); 112 113 114 QMutableListIterator<cmbEpoch*> itEpo(AC->epochs); 115 while (itEpo.hasNext()) { 116 cmbEpoch* epoch = itEpo.next(); 117 double dt = time - epoch->time; 118 119 if (dt == waitTime) { 120 QMapIterator<QString, t_corr*> itCorr(epoch->corr); 121 while (itCorr.hasNext()) { 122 itCorr.next(); 123 t_corr* corr = itCorr.value(); 124 cout << AC->name.toAscii().data() << " " 125 << AC->mountPoint.toAscii().data() << " " 126 << corr->prn.toAscii().data() << " " 127 << corr->tt.datestr() << " " << corr->tt.timestr() << " " 128 << corr->iod << " " << corr->dClk << endl; 129 } 130 } 131 132 if (dt >= waitTime) { 133 delete epoch; 134 itEpo.remove(); 135 } 136 } 137 } 138 }
Note:
See TracChangeset
for help on using the changeset viewer.