Changeset 10227 in ntrip for trunk/BNC/src
- Timestamp:
- Oct 20, 2023, 9:45:38 PM (15 months ago)
- Location:
- trunk/BNC/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/src/RTCM3/clock_and_orbit/clock_orbit_igs.cpp
r9962 r10227 23 23 std::vector< std::vector<unsigned int> > status(CLOCKORBIT_SATNUM, std::vector<unsigned int>(COBOFS_NUM)); 24 24 unsigned int i, s; 25 26 //memset(status, 0, sizeof(status));27 25 28 26 STARTDATA -
trunk/BNC/src/combination/bncbiassnx.cpp
r10221 r10227 73 73 delete it.value(); 74 74 } 75 _snxSatCodeBiasMap.clear(); 75 76 } 76 77 … … 101 102 //////////////////////////////////////////////////////////////////////////// 102 103 t_irc bncBiasSnx::readFile(const QString& fileName) { 103 104 clear(); 104 105 QFile inFile(fileName); 105 106 inFile.open(QIODevice::ReadOnly | QIODevice::Text); -
trunk/BNC/src/combination/bnccomb.cpp
r10225 r10227 123 123 124 124 bncSettings settings; 125 126 _running = true; 125 127 126 128 QStringList cmbStreams = settings.value("cmbStreams").toStringList(); … … 291 293 } 292 294 if (_bsx) { 293 _ms = 6.0 * 3600 * 1000.0;295 _ms = 3.0 * 3600 * 1000.0; 294 296 QTimer::singleShot(_ms, this, SLOT(slotReadBiasSnxFile())); 295 297 } … … 301 303 _MAXRES = 999.0; 302 304 } 303 305 _newCorr = 0; 304 306 } 305 307 … … 307 309 //////////////////////////////////////////////////////////////////////////// 308 310 bncComb::~bncComb() { 311 312 _running = false; 313 sleep(2); 309 314 310 315 QListIterator<cmbAC*> icAC(_ACs); … … 317 322 if (_ssrCorr) { 318 323 delete _ssrCorr; 324 } 325 326 if (_newCorr) { 327 delete _newCorr; 319 328 } 320 329 … … 331 340 _buffer.remove(sys); 332 341 } 342 _cmbSysPrn.clear(); 333 343 334 344 while (!_epoClkData.empty()) { … … 645 655 // Create new correction 646 656 // --------------------- 647 cmbCorr*newCorr = new cmbCorr();648 newCorr->_prn = prn;649 newCorr->_time = clkCorr._time;650 newCorr->_iod = clkCorr._iod;651 newCorr->_acName = acName;652 newCorr->_weightFactor = weigthFactor;653 newCorr->_clkCorr = clkCorr;657 _newCorr = new cmbCorr(); 658 _newCorr->_prn = prn; 659 _newCorr->_time = clkCorr._time; 660 _newCorr->_iod = clkCorr._iod; 661 _newCorr->_acName = acName; 662 _newCorr->_weightFactor = weigthFactor; 663 _newCorr->_clkCorr = clkCorr; 654 664 655 665 // Check orbit correction 656 666 // ---------------------- 657 667 if (!_orbCorrections.contains(acName)) { 658 delete newCorr;668 delete _newCorr; _newCorr = 0; 659 669 continue; 660 670 } … … 662 672 QMap<t_prn, t_orbCorr>& storage = _orbCorrections[acName]; 663 673 if (!storage.contains(clkCorr._prn) || 664 storage[clkCorr._prn]._iod != newCorr->_iod) {665 delete newCorr;674 storage[clkCorr._prn]._iod != _newCorr->_iod) { 675 delete _newCorr; _newCorr = 0; 666 676 continue; 667 677 } 668 678 else { 669 newCorr->_orbCorr = storage[clkCorr._prn];679 _newCorr->_orbCorr = storage[clkCorr._prn]; 670 680 } 671 681 } … … 679 689 emit newMessage("bncComb: eph not found for " + prn.mid(0,3).toLatin1(), true); 680 690 #endif 681 delete newCorr;691 delete _newCorr; _newCorr = 0; 682 692 continue; 683 693 } … … 688 698 emit newMessage("bncComb: ephLast not ok (checkState: " + ephLast->checkStateToString().toLatin1() + ") for " + prn.mid(0,3).toLatin1(), true); 689 699 #endif 690 delete newCorr;700 delete _newCorr; _newCorr = 0; 691 701 continue; 692 702 } 693 703 else { 694 if (ephLast->IOD() == newCorr->_iod) {695 newCorr->_eph = ephLast;704 if (ephLast->IOD() == _newCorr->_iod) { 705 _newCorr->_eph = ephLast; 696 706 } 697 707 else if (ephPrev && ephPrev->checkState() == t_eph::ok && 698 ephPrev->IOD() == newCorr->_iod) {699 newCorr->_eph = ephPrev;700 switchToLastEph(ephLast, newCorr);708 ephPrev->IOD() == _newCorr->_iod) { 709 _newCorr->_eph = ephPrev; 710 switchToLastEph(ephLast, _newCorr); 701 711 } 702 712 else { 703 713 #ifdef BNC_DEBUG_CMB 704 714 emit newMessage("bncComb: eph not found for " + prn.mid(0,3).toLatin1() + 705 QString(" with IOD %1").arg( newCorr->_iod).toLatin1(), true);715 QString(" with IOD %1").arg(_newCorr->_iod).toLatin1(), true); 706 716 #endif 707 delete newCorr;717 delete _newCorr; _newCorr = 0; 708 718 continue; 709 719 } … … 715 725 QMap<t_prn, t_satCodeBias>& storage = _satCodeBiases[acName]; 716 726 if (storage.contains(clkCorr._prn)) { 717 newCorr->_satCodeBias = storage[clkCorr._prn];727 _newCorr->_satCodeBias = storage[clkCorr._prn]; 718 728 QMap<t_frequency::type, double> codeBiasesRefSig; 719 729 for (unsigned ii = 1; ii < cmbRefSig::cIF; ii++) { … … 722 732 char attrib = cmbRefSig::toAttrib(sys, static_cast<cmbRefSig::type>(ii)); 723 733 QString rnxType2ch = QString("%1%2").arg(frqNum).arg(attrib); 724 for (unsigned ii = 0; ii < newCorr->_satCodeBias._bias.size(); ii++) {725 const t_frqCodeBias& bias = newCorr->_satCodeBias._bias[ii];734 for (unsigned ii = 0; ii < _newCorr->_satCodeBias._bias.size(); ii++) { 735 const t_frqCodeBias& bias = _newCorr->_satCodeBias._bias[ii]; 726 736 if (rnxType2ch.toStdString() == bias._rnxType2ch) { 727 737 codeBiasesRefSig[frqType] = bias._value; … … 731 741 if (codeBiasesRefSig.size() == 2) { 732 742 map<t_frequency::type, double> codeCoeff; 733 double channel = double( newCorr->_eph->slotNum());743 double channel = double(_newCorr->_eph->slotNum()); 734 744 cmbRefSig::coeff(sys, cmbRefSig::cIF, channel, codeCoeff); 735 745 map<t_frequency::type, double>::const_iterator it; 736 746 for (it = codeCoeff.begin(); it != codeCoeff.end(); it++) { 737 747 t_frequency::type frqType = it->first; 738 newCorr->_satCodeBiasIF += it->second * codeBiasesRefSig[frqType];748 _newCorr->_satCodeBiasIF += it->second * codeBiasesRefSig[frqType]; 739 749 } 740 750 } 741 newCorr->_satCodeBias._bias.clear();751 _newCorr->_satCodeBias._bias.clear(); 742 752 } 743 753 } … … 753 763 QString prn = corr->_prn; 754 764 QString acName = corr->_acName; 755 if ( newCorr->_acName == acName &&newCorr->_prn == prn) {765 if (_newCorr->_acName == acName && _newCorr->_prn == prn) { 756 766 available = true; 757 767 } 758 768 } 769 759 770 if (!available) { 760 corrs.push_back( newCorr);771 corrs.push_back(_newCorr); _newCorr = 0; 761 772 } 762 773 else { 763 delete newCorr;774 delete _newCorr; _newCorr = 0; 764 775 continue; 765 776 } … … 885 896 } 886 897 887 //_buffer.remove(sys);888 898 } 889 899 … … 921 931 // --------------------------------- 922 932 SymmetricMatrix QQ_sav = _QQ[sys]; 923 while ( true) {933 while (_running) { 924 934 925 935 Matrix AA; … … 1236 1246 // Outlier Detection Loop 1237 1247 // ---------------------- 1238 while ( true) {1248 while (_running) { 1239 1249 1240 1250 // Remove Satellites that are not in Master … … 1422 1432 } 1423 1433 1424 while ( true) {1434 while (_running) { 1425 1435 1426 1436 // Compute Mean Corrections for all Satellites -
trunk/BNC/src/combination/bnccomb.h
r10225 r10227 5 5 #include <fstream> 6 6 #include <iostream> 7 #include <unistd.h> 7 8 #include <map> 8 9 #include <newmat.h> … … 244 245 bncTime _lastClkCorrTime; 245 246 bncTime _resTime; 247 cmbCorr* _newCorr; 246 248 QMap<char, cmbEpoch> _buffer; 247 249 bncRtnetDecoder* _rtnetDecoder; … … 271 273 bool _useSbas; 272 274 bool _useIrnss; 275 bool _running; 273 276 }; 274 277 -
trunk/BNC/src/upload/bncrtnetuploadcaster.cpp
r10221 r10227 828 828 || co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0 829 829 || co.NumberOfSat[CLOCKORBIT_SATBDS] > 0) { 830 char obuffer[CLOCKORBIT_BUFFERSIZE] = { 0};830 char obuffer[CLOCKORBIT_BUFFERSIZE] = {'\0'}; 831 831 int len = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_AUTO, 0, obuffer, sizeof(obuffer)); 832 832 if (len > 0) { … … 840 840 else { 841 841 if (co.NumberOfSat[CLOCKORBIT_SATGPS] > 0) { 842 char obuffer[CLOCKORBIT_BUFFERSIZE] = { 0};842 char obuffer[CLOCKORBIT_BUFFERSIZE] = {'\0'}; 843 843 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) { 844 844 co.UpdateInterval = ephUpdInd; 845 int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GPSORBIT, 1, obuffer, 846 sizeof(obuffer)); 845 int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GPSORBIT, 1, obuffer, sizeof(obuffer)); 847 846 co.UpdateInterval = clkUpdInd; 848 847 if (len1 > 0) { … … 855 854 co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0 || 856 855 co.NumberOfSat[CLOCKORBIT_SATBDS] > 0 ) ? 1 : 0; 857 int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GPSCLOCK, mmsg, obuffer, 858 sizeof(obuffer)); 856 int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GPSCLOCK, mmsg, obuffer, sizeof(obuffer)); 859 857 if (len2 > 0) { 860 858 hlpBufferCo += QByteArray(obuffer, len2); … … 865 863 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) { 866 864 co.UpdateInterval = ephUpdInd; 867 int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GLONASSORBIT, 1, obuffer, 868 sizeof(obuffer)); 865 int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GLONASSORBIT, 1, obuffer, sizeof(obuffer)); 869 866 co.UpdateInterval = clkUpdInd; 870 867 if (len1 > 0) { … … 876 873 co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0 || 877 874 co.NumberOfSat[CLOCKORBIT_SATBDS] > 0 ) ? 1 : 0; 878 int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GLONASSCLOCK, mmsg, obuffer, 879 sizeof(obuffer)); 875 int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GLONASSCLOCK, mmsg, obuffer, sizeof(obuffer)); 880 876 if (len2 > 0) { 881 877 hlpBufferCo += QByteArray(obuffer, len2); … … 886 882 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) { 887 883 co.UpdateInterval = ephUpdInd; 888 int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GALILEOORBIT, 1, obuffer, 889 sizeof(obuffer)); 884 int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GALILEOORBIT, 1, obuffer, sizeof(obuffer)); 890 885 co.UpdateInterval = clkUpdInd; 891 886 if (len1 > 0) { … … 896 891 co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0 || 897 892 co.NumberOfSat[CLOCKORBIT_SATBDS] > 0 ) ? 1 : 0; 898 int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GALILEOCLOCK, mmsg, obuffer, 899 sizeof(obuffer)); 893 int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_GALILEOCLOCK, mmsg, obuffer, sizeof(obuffer)); 900 894 if (len2 > 0) { 901 895 hlpBufferCo += QByteArray(obuffer, len2); … … 906 900 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) { 907 901 co.UpdateInterval = ephUpdInd; 908 int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_QZSSORBIT, 1, obuffer, 909 sizeof(obuffer)); 902 int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_QZSSORBIT, 1, obuffer, sizeof(obuffer)); 910 903 co.UpdateInterval = clkUpdInd; 911 904 if (len1 > 0) { … … 915 908 int mmsg = (co.NumberOfSat[CLOCKORBIT_SATSBAS] > 0 || 916 909 co.NumberOfSat[CLOCKORBIT_SATBDS] > 0 ) ? 1 : 0; 917 int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_QZSSCLOCK, mmsg, obuffer, 918 sizeof(obuffer)); 910 int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_QZSSCLOCK, mmsg, obuffer, sizeof(obuffer)); 919 911 if (len2 > 0) { 920 912 hlpBufferCo += QByteArray(obuffer, len2); … … 925 917 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) { 926 918 co.UpdateInterval = ephUpdInd; 927 int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_SBASORBIT, 1, obuffer, 928 sizeof(obuffer)); 919 int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_SBASORBIT, 1, obuffer, sizeof(obuffer)); 929 920 co.UpdateInterval = clkUpdInd; 930 921 if (len1 > 0) { … … 943 934 if (fmod(epoTime.gpssec(), _samplRtcmEphCorr) == 0.0) { 944 935 co.UpdateInterval = ephUpdInd; 945 int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_BDSORBIT, 1, obuffer, 946 sizeof(obuffer)); 936 int len1 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_BDSORBIT, 1, obuffer, sizeof(obuffer)); 947 937 co.UpdateInterval = clkUpdInd; 948 938 if (len1 > 0) { … … 951 941 } 952 942 int mmsg = 0; 953 int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_BDSCLOCK, mmsg, obuffer, 954 sizeof(obuffer)); 943 int len2 = _ssrCorr->MakeClockOrbit(&co, _ssrCorr->COTYPE_BDSCLOCK, mmsg, obuffer, sizeof(obuffer)); 955 944 if (len2 > 0) { 956 945 hlpBufferCo += QByteArray(obuffer, len2); -
trunk/BNC/src/upload/bncuploadcaster.cpp
r10221 r10227 163 163 if (_ntripVersion == "1") { 164 164 _outSocket->write(_outBuffer); 165 _outSocket->flush(); 165 166 } else { 166 167 QString chunkSize = QString("%1").arg(_outBuffer.size(), 0, 16, QLatin1Char('0')); 167 168 QByteArray chunkedData = chunkSize.toLatin1() + "\r\n" + _outBuffer + "\r\n"; 168 169 _outSocket->write(chunkedData); 170 _outSocket->flush(); 169 171 } 170 _outSocket->flush();171 172 emit newBytes(_mountpoint.toLatin1(), _outBuffer.size()); 172 173 }
Note:
See TracChangeset
for help on using the changeset viewer.