Changeset 2927 in ntrip for trunk/BNC/combination
- Timestamp:
- Jan 29, 2011, 1:04:04 PM (14 years ago)
- Location:
- trunk/BNC/combination
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/combination/bnccomb.cpp
r2924 r2927 19 19 #include "bnccomb.h" 20 20 #include "bncapp.h" 21 #include "cmbcaster.h" 21 22 #include "bncsettings.h" 22 23 … … 43 44 } 44 45 } 46 47 _caster = new cmbCaster(); 45 48 } 46 49 … … 53 56 delete it.value(); 54 57 } 58 delete _caster; 55 59 } 56 60 … … 86 90 const double waitTime = 5.0; // wait 5 sec 87 91 _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 } 89 113 90 114 // Check Modulo Time … … 108 132 } 109 133 if (newEpoch == 0) { 110 newEpoch = new cmbEpoch( );134 newEpoch = new cmbEpoch(AC->name); 111 135 newEpoch->time = newCorr->tt; 112 136 AC->epochs.append(newEpoch); … … 125 149 // 126 150 //////////////////////////////////////////////////////////////////////////// 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) { 151 void 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 //////////////////////////////////////////////////////////////////////////// 169 void bncComb::printSingleCorr(const QString& acName, const t_corr* corr) { 161 170 cout.setf(ios::fixed); 162 cout << AC->name.toAscii().data() << " " 163 << AC->mountPoint.toAscii().data() << " " 171 cout << acName.toAscii().data() << " " 164 172 << corr->prn.toAscii().data() << " " 165 173 << corr->tt.timestr() << " " … … 171 179 } 172 180 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 4 4 5 5 #include "bncephuser.h" 6 7 class cmbCaster; 6 8 7 9 class bncComb : public bncEphUser { … … 21 23 class cmbEpoch { 22 24 public: 23 cmbEpoch( ) {}25 cmbEpoch(const QString& name) {acName = name;} 24 26 ~cmbEpoch() { 25 27 QMapIterator<QString, t_corr*> it(corr); … … 29 31 } 30 32 } 33 QString acName; 31 34 bncTime time; 32 35 QMap<QString, t_corr*> corr; // Corrections (key is PRN) … … 48 51 }; 49 52 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); 53 55 54 56 QMap<QString, cmbAC*> _ACs; // Analytical Centers (key is mountpoint) 55 57 bncTime _processedBeforeTime; 58 cmbCaster* _caster; 56 59 }; 57 60
Note:
See TracChangeset
for help on using the changeset viewer.