Changeset 1029 in ntrip
- Timestamp:
- Aug 8, 2008, 8:02:33 PM (16 years ago)
- Location:
- trunk/BNC
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM/GPSDecoder.h
r1024 r1029 47 47 double L1; // L1 carrier phase (cycles) 48 48 double L2; // L2 carrier phase (cycles) 49 int slip_cnt_L1; // L1 cumulative loss of continuity indicator50 int slip_cnt_L2; // L2 cumulative loss of continuity indicator51 49 double S1; // L1 signal-to noise ratio 52 50 double S2; // L2 signal-to noise ratio -
trunk/BNC/RTCM/RTCM2.cpp
r1024 r1029 945 945 cph_L1.resize(0); // Carrier phase [m] 946 946 cph_L2.resize(0); // Carrier phase [m] 947 slip_L1.resize(0); // Slip counter948 slip_L2.resize(0); // Slip counter949 947 950 948 availability.reset(); // Message status flags … … 1007 1005 bool isGPS,isCAcode,isL1,isOth; 1008 1006 int NSat,idx; 1009 int sid,prn ,slip_cnt;1007 int sid,prn; 1010 1008 double t,rng,cph; 1011 1009 … … 1119 1117 // Carrier phase measurement (mod 2^23 [cy]; sign matched to range) 1120 1118 cph = -P.getBits(iSat*48+40,32)/256.0; 1121 1122 // Slip counter1123 slip_cnt = P.getUnsignedBits(iSat*48+35,5);1124 1119 1125 1120 // Is this a new PRN? … … 1137 1132 cph_L1.push_back(0.0); 1138 1133 cph_L2.push_back(0.0); 1139 slip_L1.push_back(-1);1140 slip_L2.push_back(-1);1141 1134 }; 1142 1135 1143 1136 // Store measurement 1144 1137 if (isL1) { 1145 cph_L1 [idx] = cph; 1146 slip_L1[idx] = slip_cnt; 1138 cph_L1[idx] = cph; 1147 1139 } 1148 1140 else { 1149 cph_L2 [idx] = cph; 1150 slip_L2[idx] = slip_cnt; 1141 cph_L2[idx] = cph; 1151 1142 }; 1152 1143 … … 1348 1339 1349 1340 }; // End of namespace rtcm2 1350 1351 1352 -
trunk/BNC/RTCM/RTCM2.h
r1024 r1029 309 309 std::vector<double> cph_L1; // Carrier phase on L1 [cy] 310 310 std::vector<double> cph_L2; // Carrier phase on L2 [cy] 311 std::vector<int> slip_L1; // Carrier phase slip counter, L1312 std::vector<int> slip_L2; // Carrier phase slip counter, L1313 311 314 312 private: -
trunk/BNC/RTCM/RTCM2Decoder.cpp
r1027 r1029 39 39 * -----------------------------------------------------------------------*/ 40 40 41 #include <math.h>42 #include <sstream>43 #include <iomanip>44 45 41 #include "../bncutils.h" 46 #include "rtcm_utils.h"47 42 #include "GPSDecoder.h" 48 43 #include "RTCM2Decoder.h" 49 44 50 45 using namespace std; 51 using namespace rtcm2;52 46 53 47 // … … 55 49 // 56 50 57 RTCM2Decoder::RTCM2Decoder( const std::string& ID) {58 _ID = ID; 51 RTCM2Decoder::RTCM2Decoder() { 52 59 53 } 60 54 … … 64 58 65 59 RTCM2Decoder::~RTCM2Decoder() { 66 for (t_pairMap::iterator ii = _ephPair.begin(); ii != _ephPair.end(); ii++) {67 delete ii->second;68 }69 60 } 70 61 62 // 71 63 72 //73 t_irc RTCM2Decoder::getStaCrd(double& xx, double& yy, double& zz) {74 if ( !_msg03.validMsg ) {75 return failure;76 }77 78 xx = _msg03.x + (_msg22.validMsg ? _msg22.dL1[0] : 0.0);79 yy = _msg03.y + (_msg22.validMsg ? _msg22.dL1[1] : 0.0);80 zz = _msg03.z + (_msg22.validMsg ? _msg22.dL1[2] : 0.0);81 82 return success;83 }84 85 86 //87 64 t_irc RTCM2Decoder::Decode(char* buffer, int bufLen) { 88 65 … … 118 95 _obsList.push_back(obs); 119 96 if (_ObsBlock.PRN[iSat] > 100) { 120 obs->_o.satNum = _ObsBlock.PRN[iSat] % 100; 121 obs->_o.satSys = 'R'; 122 } 123 else { 124 obs->_o.satNum = _ObsBlock.PRN[iSat]; 125 obs->_o.satSys = 'G'; 126 } 127 obs->_o.GPSWeek = epochWeek; 128 obs->_o.GPSWeeks = epochSecs; 129 obs->_o.C1 = _ObsBlock.rng_C1[iSat]; 130 obs->_o.P1 = _ObsBlock.rng_P1[iSat]; 131 obs->_o.P2 = _ObsBlock.rng_P2[iSat]; 132 obs->_o.L1 = _ObsBlock.resolvedPhase_L1(iSat); 133 obs->_o.L2 = _ObsBlock.resolvedPhase_L2(iSat); 134 obs->_o.slip_cnt_L1 = _ObsBlock.slip_L1[iSat]; 135 obs->_o.slip_cnt_L2 = _ObsBlock.slip_L2[iSat]; 97 obs->_o.satNum = _ObsBlock.PRN[iSat] % 100; 98 obs->_o.satSys = 'R'; 99 } 100 else { 101 obs->_o.satNum = _ObsBlock.PRN[iSat]; 102 obs->_o.satSys = 'G'; 103 } 104 obs->_o.GPSWeek = epochWeek; 105 obs->_o.GPSWeeks = epochSecs; 106 obs->_o.C1 = _ObsBlock.rng_C1[iSat]; 107 obs->_o.P1 = _ObsBlock.rng_P1[iSat]; 108 obs->_o.P2 = _ObsBlock.rng_P2[iSat]; 109 obs->_o.L1 = _ObsBlock.resolvedPhase_L1(iSat); 110 obs->_o.L2 = _ObsBlock.resolvedPhase_L2(iSat); 136 111 } 137 112 _ObsBlock.clear(); 138 113 } 139 }140 141 else if ( _PP.ID() == 20 || _PP.ID() == 21 ) {142 _msg2021.extract(_PP);143 144 if (_msg2021.valid()) {145 translateCorr2Obs();146 }147 }148 149 else if ( _PP.ID() == 3 ) {150 _msg03.extract(_PP);151 }152 153 else if ( _PP.ID() == 22 ) {154 _msg22.extract(_PP);155 114 } 156 115 } … … 158 117 } 159 118 160 161 162 void RTCM2Decoder::storeEph(const gpsephemeris& gpseph) {163 t_ephGPS* eph = new t_ephGPS; eph->set(&gpseph);164 165 string prn = eph->prn();166 167 t_pairMap::iterator ip = _ephPair.find(prn);168 if (ip == _ephPair.end() ) {169 ip = _ephPair.insert(pair<string, t_ephPair*>(prn, new t_ephPair)).first;170 }171 t_ephPair* pair = ip->second;172 173 if ( !pair->eph || eph->isNewerThan(pair->eph) ) {174 delete pair->oldEph;175 pair->oldEph = pair->eph;176 pair->eph = eph;177 178 return;179 }180 181 delete eph;182 }183 184 185 void RTCM2Decoder::storeEph(const t_ephGPS& gpseph) {186 t_ephGPS* eph = new t_ephGPS(gpseph);187 188 string prn = eph->prn();189 190 t_pairMap::iterator ip = _ephPair.find(prn);191 if (ip == _ephPair.end() ) {192 ip = _ephPair.insert(pair<string, t_ephPair*>(prn, new t_ephPair)).first;193 }194 t_ephPair* pair = ip->second;195 196 if ( !pair->eph || eph->isNewerThan(pair->eph) ) {197 delete pair->oldEph;198 pair->oldEph = pair->eph;199 pair->eph = eph;200 201 return;202 }203 204 delete eph;205 }206 207 208 void RTCM2Decoder::translateCorr2Obs() {209 210 if ( !_msg03.validMsg || !_msg2021.valid() ) {211 return;212 }213 214 double stax = _msg03.x + (_msg22.validMsg ? _msg22.dL1[0] : 0.0);215 double stay = _msg03.y + (_msg22.validMsg ? _msg22.dL1[1] : 0.0);216 double staz = _msg03.z + (_msg22.validMsg ? _msg22.dL1[2] : 0.0);217 218 int refWeek;219 double refSecs;220 currentGPSWeeks(refWeek, refSecs);221 222 // Resolve receiver time of measurement (see RTCM 2.3, page 4-42, Message 18, Note 1)223 // ----------------------------------------------------------------------------------224 double hoursec_est = _msg2021.hoursec(); // estimated time of measurement225 double hoursec_rcv = rint(hoursec_est * 1e2) / 1e2; // receiver clock reading at hoursec_est226 double rcv_clk_bias = (hoursec_est - hoursec_rcv) * c_light;227 228 int GPSWeek;229 double GPSWeeks;230 resolveEpoch(hoursec_est, refWeek, refSecs,231 GPSWeek, GPSWeeks);232 233 int GPSWeek_rcv;234 double GPSWeeks_rcv;235 resolveEpoch(hoursec_rcv, refWeek, refSecs,236 GPSWeek_rcv, GPSWeeks_rcv);237 238 // Loop over all satellites239 // ------------------------240 for (RTCM2_2021::data_iterator icorr = _msg2021.data.begin();241 icorr != _msg2021.data.end(); icorr++) {242 const RTCM2_2021::HiResCorr* corr = icorr->second;243 244 ostringstream oPRN; oPRN.fill('0');245 246 oPRN << (corr->PRN < 200 ? 'G' : 'R')247 << setw(2) << (corr->PRN < 200 ? corr->PRN : corr->PRN - 200);248 249 string PRN(oPRN.str());250 251 t_pairMap::const_iterator ieph = _ephPair.find(PRN);252 const t_eph* eph0 = 0;253 const t_eph* eph1 = 0;254 255 if ( ieph != _ephPair.end() ) {256 eph0 = ieph->second->eph;257 eph1 = ieph->second->oldEph;258 }259 260 261 if ( !eph0 && !eph1 ) {262 continue;263 }264 265 double L1 = 0;266 double L2 = 0;267 double P1 = 0;268 double P2 = 0;269 string obsT = "";270 271 // new observation272 p_obs new_obs = 0;273 274 for (unsigned ii = 0; ii < 4; ii++) {275 int IODcorr = 0;276 double corrVal = 0;277 const t_eph* eph = 0;278 double* obsVal = 0;279 280 switch (ii) {281 case 0: // --- L1 ---282 IODcorr = corr->IODp1;283 corrVal = corr->phase1 * LAMBDA_1;284 obsVal = &L1;285 obsT = "L1";286 break;287 case 1: // --- L2 ---288 IODcorr = corr->IODp2;289 corrVal = corr->phase2 * LAMBDA_2;290 obsVal = &L2;291 obsT = "L2";292 break;293 case 2: // --- P1 ---294 IODcorr = corr->IODr1;295 corrVal = corr->range1;296 obsVal = &P1;297 obsT = "P1";298 break;299 case 3: // --- P2 ---300 IODcorr = corr->IODr2;301 corrVal = corr->range2;302 obsVal = &P2;303 obsT = "P2";304 break;305 default:306 continue;307 }308 309 eph = 0;310 if ( eph0 && eph0->IOD() == IODcorr )311 eph = eph0;312 else if ( eph1 && eph1->IOD() == IODcorr )313 eph = eph1;314 if ( eph && corr ) {315 int GPSWeek_tot;316 double GPSWeeks_tot;317 double rho, xSat, ySat, zSat, clkSat;318 cmpRho(eph, stax, stay, staz,319 GPSWeek, GPSWeeks,320 rho, GPSWeek_tot, GPSWeeks_tot,321 xSat, ySat, zSat, clkSat);322 323 *obsVal = rho - corrVal + rcv_clk_bias - clkSat;324 325 if ( *obsVal == 0 ) *obsVal = ZEROVALUE;326 327 // Allocate new memory328 // -------------------329 if ( !new_obs ) {330 new_obs = new t_obs();331 332 new_obs->_o.StatID[0] = '\x0';333 new_obs->_o.satSys = (corr->PRN < 200 ? 'G' : 'R');334 new_obs->_o.satNum = (corr->PRN < 200 ? corr->PRN : corr->PRN - 200);335 336 new_obs->_o.GPSWeek = GPSWeek_rcv;337 new_obs->_o.GPSWeeks = GPSWeeks_rcv;338 }339 340 // Store estimated measurements341 // ----------------------------342 switch (ii) {343 case 0: // --- L1 ---344 new_obs->_o.L1 = *obsVal / LAMBDA_1;345 new_obs->_o.slip_cnt_L1 = corr->lock1;346 break;347 case 1: // --- L2 ---348 new_obs->_o.L2 = *obsVal / LAMBDA_2;349 new_obs->_o.slip_cnt_L2 = corr->lock2;350 break;351 case 2: // --- C1 / P1 ---352 if ( corr->Pind1 )353 new_obs->_o.P1 = *obsVal;354 else355 new_obs->_o.C1 = *obsVal;356 break;357 case 3: // --- C2 / P2 ---358 if ( corr->Pind2 )359 new_obs->_o.P2 = *obsVal;360 else361 new_obs->_o.C2 = *obsVal;362 break;363 default:364 continue;365 }366 }367 } // loop over frequencies368 369 if ( new_obs ) {370 _obsList.push_back( new_obs );371 }372 }373 } -
trunk/BNC/RTCM/RTCM2Decoder.h
r1024 r1029 26 26 #define INC_RTCM2DECODER_H 27 27 28 #include <list>29 30 28 #include "GPSDecoder.h" 31 29 #include "RTCM2.h" 32 #include "RTCM2_2021.h"33 #include "../RTCM3/rtcm3torinex.h"34 #include "../RTCM3/ephemeris.h"35 30 36 31 class RTCM2Decoder: public GPSDecoder { 37 32 38 33 public: 39 RTCM2Decoder( const std::string& ID);34 RTCM2Decoder(); 40 35 virtual ~RTCM2Decoder(); 41 36 virtual t_irc Decode(char* buffer, int bufLen); 42 37 43 void storeEph(const gpsephemeris& gpseph);44 void storeEph(const t_ephGPS& gpseph);45 46 t_irc getStaCrd(double& xx, double& yy, double& zz);47 48 const rtcm2::RTCM2_2021& msg2021() const { return _msg2021; }49 50 38 private: 51 39 52 class t_ephPair { 53 public: 54 t_ephPair() { 55 eph = 0; 56 oldEph = 0; 57 } 58 59 ~t_ephPair() { 60 delete eph; 61 delete oldEph; 62 } 63 64 t_eph* eph; 65 t_eph* oldEph; 66 }; 40 std::string _buffer; 41 rtcm2::RTCM2_Obs _ObsBlock; 42 rtcm2::RTCM2packet _PP; 67 43 68 void translateCorr2Obs();69 70 std::string _ID;71 72 std::string _buffer;73 rtcm2::RTCM2packet _PP;74 75 // for messages 18, 19 decoding76 rtcm2::RTCM2_Obs _ObsBlock;77 78 // for messages 20, 21 decoding79 rtcm2::RTCM2_03 _msg03;80 rtcm2::RTCM2_22 _msg22;81 rtcm2::RTCM2_2021 _msg2021;82 std::map<std::string, t_ephPair*> _ephPair;83 84 typedef std::map<std::string, t_ephPair*> t_pairMap;85 44 }; 86 45 -
trunk/BNC/bnc.pro
r1028 r1029 3 3 # ----------------------------- 4 4 CONFIG += release 5 CONFIG -= debug5 ###CONFIG -= debug 6 6 7 7 DEFINES += NO_RTCM3_MAIN … … 27 27 bncconst.h bnchtml.h bnctableitem.h bnczerodecoder.h \ 28 28 RTCM/GPSDecoder.h RTCM/RTCM2.h RTCM/RTCM2Decoder.h \ 29 RTCM/RTCM2_2021.h RTCM/rtcm_utils.h \30 29 RTCM3/RTCM3Decoder.h RTCM3/rtcm3torinex.h \ 31 30 RTCM3/RTCM3coDecoder.h RTCM3/clock_orbit_rtcm.h \ 32 RTCM3/ephemeris.h RTCM3/timeutils.h \33 31 RTIGS/RTIGSDecoder.h RTIGS/rtigs_records.h \ 34 32 RTIGS/cgps_transform.h RTIGS/rtstruct.h RTIGS/rtacp.h RTIGS/gpswro.h … … 39 37 bnczerodecoder.cpp \ 40 38 RTCM/RTCM2.cpp RTCM/RTCM2Decoder.cpp \ 41 RTCM/RTCM2_2021.cpp RTCM/rtcm_utils.cpp \42 39 RTCM3/RTCM3Decoder.cpp RTCM3/rtcm3torinex.c \ 43 40 RTCM3/RTCM3coDecoder.cpp RTCM3/clock_orbit_rtcm.c \ 44 RTCM3/ephemeris.cpp RTCM3/timeutils.cpp \45 41 RTIGS/RTIGSDecoder.cpp RTIGS/cgps_transform.cpp 46 42 -
trunk/BNC/bncapp.cpp
r1024 r1029 39 39 * -----------------------------------------------------------------------*/ 40 40 41 #include <iostream> 41 42 #include <QSettings> 42 43 #include <QMessageBox> … … 189 190 void bncApp::slotNewGPSEph(gpsephemeris* gpseph) { 190 191 191 gpsephemeris copy_gpseph = *gpseph;192 emit newEphGPS(copy_gpseph);193 194 192 QMutexLocker locker(&_mutex); 195 193 … … 208 206 delete gpseph; 209 207 } 210 211 208 } 212 209 … … 604 601 //////////////////////////////////////////////////////////////////////////// 605 602 void bncApp::slotQuit() { 603 cout << "bncApp::slotQuit" << endl; 606 604 delete _caster; 607 605 quit(); -
trunk/BNC/bncapp.h
r1024 r1029 49 49 void slotQuit(); 50 50 51 signals: 52 void newEphGPS(gpsephemeris gpseph); 53 void newMessage(QByteArray msg); 51 signals: 52 void newMessage(QByteArray msg); 54 53 55 54 private slots: -
trunk/BNC/bncgetthread.cpp
r1024 r1029 140 140 _rnx = new bncRinex(_staID, mountPoint, format, latitude, longitude, nmea); 141 141 } 142 _rnx_set_position = false;143 142 144 143 msleep(100); //sleep 0.1 sec … … 157 156 } 158 157 delete _decoder; 159 delete _rnx; 158 delete _rnx; 160 159 } 161 160 … … 366 365 if (_format.indexOf("RTCM_2") != -1) { 367 366 emit(newMessage("Get Data: " + _staID + " in RTCM 2.x format")); 368 _decoder = new RTCM2Decoder( _staID.data());367 _decoder = new RTCM2Decoder(); 369 368 } 370 369 else if (_format.indexOf("RTCM_3") != -1) { … … 558 557 559 558 delete [] data; 560 559 561 560 QListIterator<p_obs> it(_decoder->_obsList); 562 561 while (it.hasNext()) { … … 646 645 // ------------ 647 646 if (_rnx) { 648 bool dump = true; 649 650 RTCM2Decoder* decoder2 = dynamic_cast<RTCM2Decoder*>(_decoder); 651 if ( decoder2 && !_rnx_set_position ) { 652 double stax, stay, staz; 653 if ( decoder2->getStaCrd(stax, stay, staz) == success ) { 654 _rnx->setApproxPos(stax, stay, staz); 655 _rnx_set_position = true; 656 } 657 else { 658 dump = false; 659 } 660 } 661 662 if ( dump ) { 663 long iSec = long(floor(obs->_o.GPSWeeks+0.5)); 664 long newTime = obs->_o.GPSWeek * 7*24*3600 + iSec; 665 if (_samplingRate == 0 || iSec % _samplingRate == 0) { 666 _rnx->deepCopy(obs); 667 } 668 _rnx->dumpEpoch(newTime); 669 } 670 } 671 672 // Emit new observation signal 673 // --------------------------- 647 long iSec = long(floor(obs->_o.GPSWeeks+0.5)); 648 long newTime = obs->_o.GPSWeek * 7*24*3600 + iSec; 649 if (_samplingRate == 0 || iSec % _samplingRate == 0) { 650 _rnx->deepCopy(obs); 651 } 652 _rnx->dumpEpoch(newTime); 653 } 654 674 655 bool firstObs = (obs == _decoder->_obsList.first()); 675 656 obs->_status = t_obs::posted; … … 755 736 } 756 737 } 757 758 //759 //////////////////////////////////////////////////////////////////////////////760 void bncGetThread::slotNewEphGPS(gpsephemeris gpseph) {761 RTCM2Decoder* decoder = dynamic_cast<RTCM2Decoder*>(_decoder);762 763 if ( decoder ) {764 QMutexLocker locker(&_mutex);765 766 decoder->storeEph(gpseph);767 }768 }769 -
trunk/BNC/bncgetthread.h
r1024 r1029 26 26 #define BNCGETTHREAD_H 27 27 28 #include <stdio.h>29 30 28 #include <QThread> 31 29 #include <QtNetwork> … … 33 31 34 32 #include "RTCM/GPSDecoder.h" 35 #include "RTCM3/rtcm3torinex.h"36 33 #include "bncconst.h" 37 34 … … 59 56 void error(QByteArray staID); 60 57 void newMessage(QByteArray msg); 61 62 public slots:63 void slotNewEphGPS(gpsephemeris gpseph);64 58 65 59 protected: … … 101 95 int _samplingRate; 102 96 bncRinex* _rnx; 103 bool _rnx_set_position;104 97 QDateTime _decodeFailure; 105 98 QDateTime _decodeStart; -
trunk/BNC/bncrinex.cpp
r1024 r1029 93 93 _rinexVers = 2; 94 94 } 95 96 _approxPos[0] = _approxPos[1] = _approxPos[2] = 0.0;97 95 } 98 96 … … 449 447 // ------------------ 450 448 else { 449 double approxPos[3]; approxPos[0] = approxPos[1] = approxPos[2] = 0.0; 451 450 double antennaNEU[3]; antennaNEU[0] = antennaNEU[1] = antennaNEU[2] = 0.0; 452 451 … … 478 477 << setw(20) << " " << "ANT # / TYPE" << endl; 479 478 _out.unsetf(ios::left); 480 _out << setw(14) << setprecision(4) << _approxPos[0]481 << setw(14) << setprecision(4) << _approxPos[1]482 << setw(14) << setprecision(4) << _approxPos[2]479 _out << setw(14) << setprecision(4) << approxPos[0] 480 << setw(14) << setprecision(4) << approxPos[1] 481 << setw(14) << setprecision(4) << approxPos[2] 483 482 << " " << "APPROX POSITION XYZ" << endl; 484 483 _out << setw(14) << setprecision(4) << antennaNEU[0] … … 566 565 double sec = double(datTim.time().second()) + fmod(fObs->_o.GPSWeeks,1.0); 567 566 568 // Epoch header line:RINEX Version 3569 // --------------- -------------------567 // RINEX Version 3 568 // --------------- 570 569 if (_rinexVers == 3) { 570 char sbasflag = 'S'; 571 571 _out << datTim.toString("> yyyy MM dd hh mm ").toAscii().data() 572 572 << setw(10) << setprecision(7) << sec 573 573 << " " << 0 << setw(3) << dumpList.size() << endl; 574 } 575 // Epoch header line: RINEX Version 2 576 // ---------------------------------- 574 575 QListIterator<p_obs> it(dumpList); 576 while (it.hasNext()) { 577 p_obs obs = it.next(); 578 // Changed data output, C1P, C2C|X, L2C|X, S2C|X added. Changed Output for SBAS Perlt 579 if (sbasflag != obs->_o.satSys) { 580 _out << obs->_o.satSys 581 << setw(2) << setfill('0') << obs->_o.satNum << setfill(' ') 582 << setw(14) << setprecision(3) << obs->_o.C1 << " " 583 << setw(14) << setprecision(3) << obs->_o.P1 << " " 584 << setw(14) << setprecision(3) << obs->_o.L1 << " " 585 << setw(1) << obs->_o.SNR1 586 << setw(14) << setprecision(3) << obs->_o.S1 << " " 587 << setw(14) << setprecision(3) << obs->_o.C2 << " " 588 << setw(14) << setprecision(3) << obs->_o.P2 << " " ; 589 if ((obs->_o.C2 != 0.0) && (obs->_o.P2 == 0.0)) { 590 _out << setw(14) << setprecision(3) << obs->_o.L2 << " " 591 << setw(1) << obs->_o.SNR2 592 << setw(14) << setprecision(3) << obs->_o.S2 << " " 593 << " 0.000 0.000 "; 594 } 595 else { 596 _out << " 0.000 0.000 " 597 << setw(14) << setprecision(3) << obs->_o.L2 << " " 598 << setw(1) << obs->_o.SNR2 599 << setw(14) << setprecision(3) << obs->_o.S2; 600 } 601 _out << endl; 602 } 603 else { 604 _out << obs->_o.satSys 605 << setw(2) << setfill('0') << obs->_o.satNum << setfill(' ') 606 << setw(14) << setprecision(3) << obs->_o.C1 << " " 607 << setw(14) << setprecision(3) << obs->_o.P1 << " " 608 << setw(14) << setprecision(3) << obs->_o.L1 << " " 609 << setw(1) << obs->_o.SNR1 610 << setw(14) << setprecision(3) << obs->_o.S1 << endl; 611 } 612 delete obs; 613 } 614 } 615 616 // RINEX Version 2 617 // --------------- 577 618 else { 578 619 _out << datTim.toString(" yy MM dd hh mm ").toAscii().data() 579 620 << setw(10) << setprecision(7) << sec 580 621 << " " << 0 << setw(3) << dumpList.size(); 581 622 582 623 QListIterator<p_obs> it(dumpList); int iSat = 0; 583 624 while (it.hasNext()) { … … 591 632 } 592 633 _out << endl; 593 } 594 595 QListIterator<p_obs> it(dumpList); 596 while (it.hasNext()) { 597 p_obs obs = it.next(); 598 599 // Cycle slips detection 600 // --------------------- 601 int prn = 0; 602 switch (obs->_o.satSys) { 603 case 'G': prn = obs->_o.satNum; break; 604 case 'R': prn = obs->_o.satNum + 200; break; 605 default: prn = obs->_o.satNum; 606 } 607 608 int lli1 = 0; 609 int lli2 = 0; 610 if ( _slip_cnt_L1.find(prn) != _slip_cnt_L1.end() && 611 _slip_cnt_L1.find(prn).value() != obs->_o.slip_cnt_L1 ) { 612 lli1 = 1; 613 } 614 if ( _slip_cnt_L2.find(prn) != _slip_cnt_L2.end() && 615 _slip_cnt_L2.find(prn).value() != obs->_o.slip_cnt_L2 ) { 616 lli2 = 1; 617 } 618 _slip_cnt_L1[prn]= obs->_o.slip_cnt_L1; 619 _slip_cnt_L2[prn]= obs->_o.slip_cnt_L2; 620 621 // RINEX Version 3 622 // --------------- 623 if (_rinexVers == 3) { 624 char sbasflag = 'S'; 625 // Changed data output, C1P, C2C|X, L2C|X, S2C|X added. Changed Output for SBAS Perlt 626 if (sbasflag != obs->_o.satSys) { 627 _out << obs->_o.satSys 628 << setw(2) << setfill('0') << obs->_o.satNum << setfill(' ') 629 << setw(14) << setprecision(3) << obs->_o.C1 << " " 630 << setw(14) << setprecision(3) << obs->_o.P1 << " " 631 << setw(14) << setprecision(3) << obs->_o.L1 << lli1 632 << setw(1) << obs->_o.SNR1 633 << setw(14) << setprecision(3) << obs->_o.S1 << " " 634 << setw(14) << setprecision(3) << obs->_o.C2 << " " 635 << setw(14) << setprecision(3) << obs->_o.P2 << " " ; 636 if ((obs->_o.C2 != 0.0) && (obs->_o.P2 == 0.0)) { 637 _out << setw(14) << setprecision(3) << obs->_o.L2 << lli2 638 << setw(1) << obs->_o.SNR2 639 << setw(14) << setprecision(3) << obs->_o.S2 << " " 640 << " 0.000 0.000 "; 641 } 642 else { 643 _out << " 0.000 0.000 " 644 << setw(14) << setprecision(3) << obs->_o.L2 << " " 645 << setw(1) << obs->_o.SNR2 646 << setw(14) << setprecision(3) << obs->_o.S2; 647 } 648 _out << endl; 649 } 650 else { 651 _out << obs->_o.satSys 652 << setw(2) << setfill('0') << obs->_o.satNum << setfill(' ') 653 << setw(14) << setprecision(3) << obs->_o.C1 << " " 654 << setw(14) << setprecision(3) << obs->_o.P1 << " " 655 << setw(14) << setprecision(3) << obs->_o.L1 << lli1 656 << setw(1) << obs->_o.SNR1 657 << setw(14) << setprecision(3) << obs->_o.S1 << endl; 658 } 659 } 660 661 // RINEX Version 2 662 // --------------- 663 else { 634 635 it.toFront(); 636 while (it.hasNext()) { 637 p_obs obs = it.next(); 638 664 639 char lli = ' '; 665 640 char snr = ' '; … … 668 643 _out << setw(14) << setprecision(3) << obs->_o.P1 << lli << snr; 669 644 _out << setw(14) << setprecision(3) << obs->_o.P2 << lli << snr; 670 _out << setw(14) << setprecision(3) << obs->_o.L1 << lli 1645 _out << setw(14) << setprecision(3) << obs->_o.L1 << lli 671 646 << setw(1) << obs->_o.SNR1 << endl; 672 _out << setw(14) << setprecision(3) << obs->_o.L2 << lli 2647 _out << setw(14) << setprecision(3) << obs->_o.L2 << lli 673 648 << setw(1) << obs->_o.SNR2; 674 649 _out << setw(14) << setprecision(3) << obs->_o.S1 ; 675 650 _out << setw(16) << setprecision(3) << obs->_o.S2 ; 676 651 _out << endl; 677 }678 679 delete obs;652 653 delete obs; 654 } 680 655 } 681 656 -
trunk/BNC/bncrinex.h
r1024 r1029 49 49 QDateTime* nextEpoch = 0); 50 50 51 void setApproxPos(double stax, double stay, double staz) {52 _approxPos[0] = stax;53 _approxPos[1] = stay;54 _approxPos[2] = staz;55 }56 57 51 protected: 58 52 virtual void run() {}; … … 87 81 bool _reloadTable; 88 82 bool _reloadDone; 89 double _approxPos[3];90 91 QMap<int, int> _slip_cnt_L1;92 QMap<int, int> _slip_cnt_L2;93 83 }; 94 84 -
trunk/BNC/bncwindow.cpp
r1024 r1029 688 688 SLOT(slotNewBytes(QByteArray, double))); 689 689 690 connect(((bncApp*)qApp), SIGNAL(newEphGPS(gpsephemeris)),691 getThread, SLOT(slotNewEphGPS(gpsephemeris)));692 693 690 _caster->addGetThread(getThread); 694 691
Note:
See TracChangeset
for help on using the changeset viewer.