Changeset 9089 in ntrip for branches/BNC_2.12
- Timestamp:
- Sep 2, 2020, 10:49:54 PM (4 years ago)
- Location:
- branches/BNC_2.12/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/BNC_2.12/src/RTCM/RTCM2Decoder.cpp
r7875 r9089 154 154 frqObs1P->_phaseValid = true; 155 155 frqObs1P->_phase = _ObsBlock.resolvedPhase_L1(iSat); 156 //frqObs1P->_slipCounter = _ObsBlock.slip_L1[iSat]; 157 frqObs1P->_slipCounter = -1; // because RTCM2 definition is vice versa to RTCM3 156 frqObs1P->_slipCounter = _ObsBlock.slip_L1[iSat]; 158 157 obs._obs.push_back(frqObs1P); 159 158 … … 164 163 frqObs2P->_phaseValid = true; 165 164 frqObs2P->_phase = _ObsBlock.resolvedPhase_L2(iSat); 166 //frqObs2P->_slipCounter = _ObsBlock.slip_L2[iSat]; 167 frqObs2P->_slipCounter = -1; // because RTCM2 definition is vice versa to RTCM3 165 frqObs2P->_slipCounter = _ObsBlock.slip_L2[iSat]; 168 166 obs._obs.push_back(frqObs2P); 169 167 -
branches/BNC_2.12/src/RTCM3/RTCM3Decoder.cpp
r9049 r9089 148 148 frqObs->_codeValid = frqObs->_phaseValid = true; 149 149 } 150 GETBITS( i, 7);151 frqObs->_lockTime = lti2sec(type, i);150 GETBITS(frqObs->_lockTimeIndicator, 7); 151 frqObs->_lockTime = lti2sec(type, frqObs->_lockTimeIndicator); 152 152 frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid); 153 frqObs->_slipCounter = i;154 153 if (type == 1002 || type == 1004) { 155 154 GETBITS(amb, 8); … … 194 193 frqObs->_phaseValid = true; 195 194 } 196 GETBITS( i, 7);197 frqObs->_lockTime = lti2sec(type, i);195 GETBITS(frqObs->_lockTimeIndicator, 7); 196 frqObs->_lockTime = lti2sec(type, frqObs->_lockTimeIndicator); 198 197 frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid); 199 frqObs->_slipCounter = i;200 198 if (type == 1004) { 201 199 GETBITS(i, 8); … … 768 766 frqObs->_lockTime = lti2sec(type,ll[count]); 769 767 frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0); 770 frqObs->_ slipCounter = ll[count];768 frqObs->_lockTimeIndicator = ll[count]; 771 769 } 772 770 break; … … 777 775 frqObs->_codeValid = true; 778 776 } 779 780 777 if (cp[count] > -1.0 / (1 << 8)) { 781 778 frqObs->_phase = cp[count] * LIGHTSPEED / 1000.0 / cd.wl … … 784 781 frqObs->_lockTime = lti2sec(type,ll[count]); 785 782 frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0); 786 frqObs->_ slipCounter = ll[count];783 frqObs->_lockTimeIndicator = ll[count]; 787 784 } 788 785 break; … … 799 796 frqObs->_lockTime = lti2sec(type,ll[count]); 800 797 frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0); 801 frqObs->_ slipCounter = ll[count];798 frqObs->_lockTimeIndicator = ll[count]; 802 799 } 803 800 frqObs->_snr = cnr[count]; … … 816 813 frqObs->_lockTime = lti2sec(type,ll[count]); 817 814 frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0); 818 frqObs->_ slipCounter = ll[count];815 frqObs->_lockTimeIndicator = ll[count]; 819 816 } 820 817 frqObs->_snr = cnr[count]; … … 837 834 frqObs->_lockTime = lti2sec(type,ll[count]); 838 835 frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0); 839 frqObs->_ slipCounter = ll[count];836 frqObs->_lockTimeIndicator = ll[count]; 840 837 } 841 838 … … 855 852 frqObs->_lockTime = lti2sec(type,ll[count]); 856 853 frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0); 857 frqObs->_ slipCounter = ll[count];854 frqObs->_lockTimeIndicator = ll[count]; 858 855 } 859 856 … … 943 940 frqObs->_codeValid = frqObs->_phaseValid = true; 944 941 } 945 GETBITS( i, 7);946 frqObs->_lockTime = lti2sec(type, i);942 GETBITS(frqObs->_lockTimeIndicator, 7); 943 frqObs->_lockTime = lti2sec(type, frqObs->_lockTimeIndicator); 947 944 frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid); 948 frqObs->_slipCounter = i;949 945 if (type == 1010 || type == 1012) { 950 946 GETBITS(amb, 7); … … 989 985 frqObs->_phaseValid = true; 990 986 } 991 GETBITS( i, 7);992 frqObs->_lockTime = lti2sec(type, i);987 GETBITS(frqObs->_lockTimeIndicator, 7); 988 frqObs->_lockTime = lti2sec(type, frqObs->_lockTimeIndicator); 993 989 frqObs->_lockTimeValid = (frqObs->_lockTime >= 0.0 && frqObs->_phaseValid); 994 frqObs->_slipCounter = i;995 990 if (type == 1012) { 996 991 GETBITS(i, 8); -
branches/BNC_2.12/src/bnccaster.cpp
r9021 r9089 164 164 obs._staID = staID.data(); 165 165 166 // Update/Set Slip Counters 167 // ------------------------ 168 setSlipCounters(obs); 169 166 170 // Output into the socket 167 171 // ---------------------- … … 560 564 .arg(_miscSockets->size()).toAscii(), true) ); 561 565 } 566 567 568 // Set/Update Slip Counters 569 //////////////////////////////////////////////////////////////////////////// 570 void bncCaster::setSlipCounters(t_satObs& obs) { 571 572 double minLockTime = -1.0; 573 for (unsigned ii = 0; ii < obs._obs.size(); ii++) { 574 const t_frqObs* frqObs = obs._obs[ii]; 575 if (frqObs->_lockTimeValid) { 576 if (minLockTime == -1.0 || minLockTime < frqObs->_lockTime) { 577 minLockTime = frqObs->_lockTime; 578 } 579 } 580 } 581 582 if (minLockTime == -1.0) { 583 return; 584 } 585 586 QMap<t_prn, double>& ltMap = _lockTimeMap[obs._staID]; 587 QMap<t_prn, int>& jcMap = _jumpCounterMap[obs._staID]; 588 589 QMap<t_prn, double>::const_iterator it = ltMap.find(obs._prn); 590 if (it == ltMap.end()) { 591 ltMap[obs._prn] = minLockTime; 592 jcMap[obs._prn] = 0; 593 } 594 else { 595 if (ltMap[obs._prn] < minLockTime) { 596 ltMap[obs._prn] = minLockTime; 597 jcMap[obs._prn] += 1; 598 if (jcMap[obs._prn] > 9999) { 599 jcMap[obs._prn] = 0; 600 } 601 } 602 } 603 for (unsigned ii = 0; ii < obs._obs.size(); ii++) { 604 t_frqObs* frqObs = obs._obs[ii]; 605 frqObs->_slipCounter = jcMap[obs._prn]; 606 } 607 } -
branches/BNC_2.12/src/bnccaster.h
r9021 r9089 64 64 static int myWrite(QTcpSocket* sock, const char* buf, int bufLen); 65 65 void reopenOutFile(); 66 void setSlipCounters(t_satObs& obs); 66 67 67 68 QFile* _outFile; … … 84 85 QTcpServer* _miscServer; 85 86 QList<QTcpSocket*>* _miscSockets; 87 QMap<std::string, QMap<t_prn, double> > _lockTimeMap; 88 QMap<std::string, QMap<t_prn, int> > _jumpCounterMap; 86 89 }; 87 90 -
branches/BNC_2.12/src/bncrinex.cpp
r8791 r9089 640 640 << left << setw(3) << "L" + frqObs->_rnxType2ch << ' ' 641 641 << right << setw(14) << setprecision(3) << frqObs->_phase << ' ' 642 << right << setw(4) << frqObs->_slipCounter; 642 //<< right << setw(4) << frqObs->_slipCounter; 643 << right << setw(4) << frqObs->_lockTimeIndicator; 643 644 } 644 645 if (frqObs->_dopplerValid) { -
branches/BNC_2.12/src/bncutils.cpp
r8855 r9089 1002 1002 } 1003 1003 1004 // Convert RTCM3 lock-time indicator to lock time in seconds1004 // Convert RTCM3 lock-time indicator to minimum lock time in seconds 1005 1005 //////////////////////////////////////////////////////////////////////////// 1006 1006 double lti2sec(int type, int lti) { … … 1016 1016 else if (lti< 127) return 32*lti-3096; // [744 32 905] 1017 1017 else if (lti==127) return 937; 1018 else return -1 ;1018 else return -1.0; 1019 1019 } 1020 1020 else if (type%10==2 || type%10==3 || … … 1037 1037 case(14) : return 262144e-3; 1038 1038 case(15) : return 524288e-3; 1039 default : return -1 ;1039 default : return -1.0; 1040 1040 }; 1041 1041 } … … 1064 1064 else if (lti< 704) return (1048576*lti-671088640 )*1e-3; 1065 1065 else if (lti==704) return (2097152*lti-1409286144)*1e-3; 1066 else return ( -1 );1066 else return ( -1.0 ); 1067 1067 } 1068 1068 else { 1069 return -1 ;1069 return -1.0; 1070 1070 }; 1071 1071 }; -
branches/BNC_2.12/src/satObs.h
r8616 r9089 15 15 public: 16 16 t_frqObs() { 17 _code = 0.0; 18 _codeValid = false; 19 _phase = 0.0; 20 _phaseValid = false; 21 _doppler = 0.0; 22 _dopplerValid = false; 23 _snr = 0.0; 24 _snrValid = false; 25 _lockTime = 0.0; 26 _lockTimeValid = false; 27 _slip = false; 28 _slipCounter = 0; 29 _biasJumpCounter = 0; 17 _code = 0.0; 18 _codeValid = false; 19 _phase = 0.0; 20 _phaseValid = false; 21 _doppler = 0.0; 22 _dopplerValid = false; 23 _snr = 0.0; 24 _snrValid = false; 25 _lockTime = -1.0; 26 _lockTimeValid = false; 27 _slip = false; 28 _slipCounter = 0; 29 _biasJumpCounter = 0; 30 _lockTimeIndicator = -1; 30 31 } 31 32 std::string _rnxType2ch; … … 39 40 bool _snrValid; 40 41 double _lockTime; 41 bool _lockTimeValid; 42 bool _slip; 43 int _slipCounter; 44 int _biasJumpCounter; 42 bool _lockTimeValid; 43 bool _slip; // RINEX 44 int _slipCounter; // RTCM2 or converted from RTCM3 45 int _lockTimeIndicator; // RTCM3 46 int _biasJumpCounter; // ?? 45 47 }; 46 48
Note:
See TracChangeset
for help on using the changeset viewer.