- Timestamp:
- Jan 17, 2007, 4:17:20 PM (18 years ago)
- Location:
- trunk/BNC
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/RTCM/GPSDecoder.h
r341 r366 40 40 GPSWeeks = 0.0; 41 41 C1 = 0.0; 42 C2 = 0.0; 42 43 P1 = 0.0; 43 44 P2 = 0.0; … … 55 56 double GPSWeeks; // Second of Week (GPS-Time) 56 57 double C1; // CA-code pseudorange (meters) 58 double C2; // CA-code pseudorange (meters) 57 59 double P1; // P1-code pseudorange (meters) 58 60 double P2; // P2-code pseudorange (meters) -
trunk/BNC/RTCM/RTCM2.cpp
r361 r366 880 880 t = 0.6*P.modZCount() 881 881 + P.getUnsignedBits(4,20)*1.0e-6; 882 // Round t to 5 milliseconds 883 t = floor(t*200.+0.5)/200.; // g. weber 882 // SC-104 V2.3 4-42 Note 1 4. Assume measurements at hard edges 883 // of receiver clock with minimum divisions of 10ms 884 // and clock error less then recommended 1.1ms 885 t = floor(t*100.+0.5)/100.; 884 886 885 887 // Frequency (exit if neither L1 nor L2) … … 971 973 t = 0.6*P.modZCount() 972 974 + P.getUnsignedBits(4,20)*1.0e-6; 973 // Round t to 5 milliseconds 974 t = floor(t*200.+0.5)/200.; // g. weber 975 // SC-104 V2.3 4-42 Note 1 4. Assume measurements at hard edges 976 // of receiver clock with minimum divisions of 10ms 977 // and clock error less then recommended 1.1ms 978 t = floor(t*100.+0.5)/100.; 975 979 976 980 // Frequency (exit if neither L1 nor L2) -
trunk/BNC/RTCM3/RTCM3Decoder.cpp
r341 r366 90 90 if (rr == 2) { 91 91 std::cerr << "No valid RINEX! All values are modulo 299792.458!\n"; 92 92 // exit(1); 93 93 } 94 94 … … 107 107 108 108 for (int jj = 0; jj < _Parser.numdatatypes; jj++) { 109 110 if ( !(_Parser.Data.dataflags[ii] & _Parser.dataflag[jj]) 111 || isnan(_Parser.Data.measdata[ii][_Parser.datapos[jj]]) 112 || isinf(_Parser.Data.measdata[ii][_Parser.datapos[jj]]) ) { 113 continue; 109 int v = 0; 110 int df = _Parser.dataflag[jj]; 111 int pos = _Parser.datapos[jj]; 112 if ( (_Parser.Data.dataflags[ii] & df) 113 && !isnan(_Parser.Data.measdata[ii][pos]) 114 && !isinf(_Parser.Data.measdata[ii][pos])) { 115 v = 1; 114 116 } 115 117 else { 118 df = _Parser.dataflag2[jj]; 119 pos = _Parser.datapos2[jj]; 120 if ( (_Parser.Data.dataflags[ii] & df) 121 && !isnan(_Parser.Data.measdata[ii][pos]) 122 && !isinf(_Parser.Data.measdata[ii][pos])) { 123 v = 1; 124 } 125 } 126 if(!v) 127 { continue; } 128 else 129 { 116 130 if (_Parser.dataflag[jj] & GNSSDF_C1DATA) { 117 131 obs->C1 = _Parser.Data.measdata[ii][_Parser.datapos[jj]]; 132 } 133 else if (_Parser.dataflag[jj] & GNSSDF_C2DATA) { 134 obs->C2 = _Parser.Data.measdata[ii][_Parser.datapos[jj]]; 118 135 } 119 136 else if (_Parser.dataflag[jj] & GNSSDF_P1DATA) { … … 123 140 obs->P2 = _Parser.Data.measdata[ii][_Parser.datapos[jj]]; 124 141 } 125 else if ( _Parser.dataflag[jj]& (GNSSDF_L1CDATA|GNSSDF_L1PDATA)) {126 obs->L1 = _Parser.Data.measdata[ii][ _Parser.datapos[jj]];142 else if (df & (GNSSDF_L1CDATA|GNSSDF_L1PDATA)) { 143 obs->L1 = _Parser.Data.measdata[ii][pos]; 127 144 obs->SNR1 = _Parser.Data.snrL1[ii]; 128 145 } 129 else if ( _Parser.dataflag[jj]& (GNSSDF_L2CDATA|GNSSDF_L2PDATA)) {130 obs->L2 = _Parser.Data.measdata[ii][ _Parser.datapos[jj]];146 else if (df & (GNSSDF_L2CDATA|GNSSDF_L2PDATA)) { 147 obs->L2 = _Parser.Data.measdata[ii][pos]; 131 148 obs->SNR2 = _Parser.Data.snrL2[ii]; 132 149 } 150 } 133 151 } 134 152 _obsList.push_back(obs); -
trunk/BNC/RTCM3/rtcm3torinex.cpp
r327 r366 1 1 /* 2 2 Converter for RTCM3 data to RINEX. 3 $Id: rtcm3torinex.c,v 1.1 1 2006/11/21 08:27:35stoecker Exp $3 $Id: rtcm3torinex.c,v 1.16 2007/01/11 15:32:26 stoecker Exp $ 4 4 Copyright (C) 2005-2006 by Dirk Stoecker <stoecker@euronik.eu> 5 5 … … 51 51 52 52 /* CVS revision and version */ 53 static char revisionstr[] = "$Revision: 1.1 1$";53 static char revisionstr[] = "$Revision: 1.16 $"; 54 54 55 55 static uint32_t CRC24(long size, const unsigned char *buf) … … 332 332 gnss->dataflags[num] |= s; 333 333 gnss->measdata[num][se] = i*0.25; 334 i /= 4* 4;334 i /= 4*6; 335 335 if(i > 9) i = 9; 336 336 else if(i < 1) i = 1; … … 380 380 gnss->dataflags[num] |= s; 381 381 gnss->measdata[num][se] = i*0.25; 382 i /= 4* 4;382 i /= 4*6; 383 383 if(i > 9) i = 9; 384 384 else if(i < 1) i = 1; … … 495 495 gnss->dataflags[num] |= s; 496 496 gnss->measdata[num][se] = i*0.25; 497 i /= 4* 4;497 i /= 4*6; 498 498 if(i > 9) i = 9; 499 499 else if(i < 1) i = 1; … … 543 543 gnss->dataflags[num] |= s; 544 544 gnss->measdata[num][se] = i*0.25; 545 i /= 4* 4;545 i /= 4*6; 546 546 if(i > 9) i = 9; 547 547 else if(i < 1) i = 1; … … 654 654 } 655 655 656 #define NUMSTARTSKIP 3 656 #define NUMSTARTSKIP 1 657 658 //////////////////////////////////////////////////////////////////// 659 // Aenderung Perlt - kein check auf vorhandene Daten 660 // Abgefragt werden : C1 C2 L1 L2 P1 P2 S1 S2 661 657 662 void HandleHeader(struct RTCM3ParserData *Parser) 658 663 { 659 struct HeaderData hdata;660 char thebuffer[MAXHEADERBUFFERSIZE];661 char *buffer = thebuffer;662 size_t buffersize = sizeof(thebuffer);663 664 int i; 664 665 hdata.data.named.version =666 " 2.11 OBSERVATION DATA M (Mixed)"667 " RINEX VERSION / TYPE";668 669 {670 const char *str;671 time_t t;672 struct tm * t2;673 674 #ifdef NO_RTCM3_MAIN675 if(revisionstr[0] == '$')676 {677 char *a;678 int i=0;679 for(a = revisionstr+11; *a && *a != ' '; ++a)680 revisionstr[i++] = *a;681 revisionstr[i] = 0;682 }683 #endif684 685 str = getenv("USER");686 if(!str) str = "";687 t = time(&t);688 t2 = gmtime(&t);689 hdata.data.named.pgm = buffer;690 i = 1+snprintf(buffer, buffersize,691 "RTCM3TORINEX %-7.7s%-20.20s%04d-%02d-%02d %02d:%02d "692 "PGM / RUN BY / DATE",693 revisionstr, str, 1900+t2->tm_year, t2->tm_mon+1, t2->tm_mday, t2->tm_hour,694 t2->tm_min);695 buffer += i; buffersize -= i;696 697 hdata.data.named.observer = buffer;698 i = 1+snprintf(buffer, buffersize,699 "%-20.20s "700 "OBSERVER / AGENCY", str);701 buffer += i; buffersize -= i;702 }703 704 hdata.data.named.marker =705 "RTCM3TORINEX "706 "MARKER NAME";707 708 hdata.data.named.receiver =709 " "710 "REC # / TYPE / VERS";711 712 hdata.data.named.antenna =713 " "714 "ANT # / TYPE";715 716 hdata.data.named.position =717 " .0000 .0000 .0000 "718 "APPROX POSITION XYZ";719 720 hdata.data.named.antennaposition =721 " .0000 .0000 .0000 "722 "ANTENNA: DELTA H/E/N";723 724 hdata.data.named.wavelength =725 " 1 1 "726 "WAVELENGTH FACT L1/2";727 728 {729 #define CHECKFLAGS(a, b) \730 if(flags & GNSSDF_##a##DATA \731 && !data[RINEXENTRY_##b##DATA]) \732 { \733 Parser->dataflag[Parser->numdatatypes] = GNSSDF_##a##DATA; \734 Parser->datapos[Parser->numdatatypes++] = data[RINEXENTRY_##b##DATA] \735 = GNSSENTRY_##a##DATA; \736 snprintf(tbuffer+tbufferpos, sizeof(tbuffer)-tbufferpos, " "#b); \737 tbufferpos += 6; \738 }739 740 665 int flags = Parser->startflags; 741 666 int data[RINEXENTRY_NUMBER]; 742 char tbuffer[6*RINEXENTRY_NUMBER+1];743 int tbufferpos = 0;744 667 for(i = 0; i < RINEXENTRY_NUMBER; ++i) 745 668 data[i] = 0; … … 747 670 flags |= Parser->Data.dataflags[i]; 748 671 749 CHECKFLAGS(C1,C1) 750 CHECKFLAGS(C2,C2) 751 CHECKFLAGS(P1,P1) 752 CHECKFLAGS(P2,P2) 753 CHECKFLAGS(L1C,L1) 754 CHECKFLAGS(L1P,L1) 755 CHECKFLAGS(L2C,L2) 756 CHECKFLAGS(L2P,L2) 757 CHECKFLAGS(D1C,D1) 758 CHECKFLAGS(D1P,D1) 759 CHECKFLAGS(D2C,D2) 760 CHECKFLAGS(D2P,D2) 761 CHECKFLAGS(S1C,S1) 762 CHECKFLAGS(S1P,S1) 763 CHECKFLAGS(S2C,S2) 764 CHECKFLAGS(S2P,S2) 765 766 hdata.data.named.typesofobs = buffer; 767 i = 1+snprintf(buffer, buffersize, 768 "%6i%-54.54s# / TYPES OF OBSERV", Parser->numdatatypes, tbuffer); 769 if(Parser->numdatatypes>9) 770 { 771 i += snprintf(buffer+i-1, buffersize, 772 "\n %-54.54s# / TYPES OF OBSERV", tbuffer+9*6); 773 } 774 buffer += i; buffersize -= i; 775 } 776 777 { 778 struct converttimeinfo cti; 779 converttime(&cti, Parser->Data.week, 780 (int)floor(Parser->Data.timeofweek/1000.0)); 781 hdata.data.named.timeoffirstobs = buffer; 782 i = 1+snprintf(buffer, buffersize, 783 " %4d %2d %2d %2d %2d %10.7f GPS " 784 "TIME OF FIRST OBS", cti.year%100, cti.month, cti.day, cti.hour, 785 cti.minute, cti.second + fmod(Parser->Data.timeofweek/1000.0,1.0)); 786 787 buffer += i; buffersize -= i; 788 } 789 790 hdata.numheaders = 11; 791 792 if(Parser->headerfile) 793 { 794 FILE *fh; 795 if((fh = fopen(Parser->headerfile, "r"))) 796 { 797 size_t siz; 798 char *lastblockstart; 799 if((siz = fread(buffer, 1, buffersize-1, fh)) > 0) 800 { 801 buffer[siz] = '\n'; 802 if(siz == buffersize) 803 { 804 RTCM3Error("Header file is too large. Only %d bytes read.", 805 siz); 806 } 807 /* scan the file line by line and enter the entries in the list */ 808 /* warn for "# / TYPES OF OBSERV" and "TIME OF FIRST OBS" */ 809 /* overwrites entries, except for comments */ 810 lastblockstart = buffer; 811 for(i = 0; i < (int)siz; ++i) 812 { 813 if(buffer[i] == '\n') 814 { /* we found a line */ 815 char *end; 816 while(buffer[i+1] == '\r') 817 ++i; /* skip \r in case there are any */ 818 end = buffer+i; 819 while(*end == '\t' || *end == ' ' || *end == '\r' || *end == '\n') 820 *(end--) = 0; 821 if(end-lastblockstart < 60+5) /* short line */ 822 RTCM3Error("Short Header line '%s' ignored.\n", lastblockstart); 823 else 824 { 825 int pos; 826 if(!strcmp("COMMENT", lastblockstart+60)) 827 pos = hdata.numheaders; 828 else 829 { 830 for(pos = 0; pos < hdata.numheaders; ++pos) 831 { 832 if(!strcmp(hdata.data.unnamed[pos]+60, lastblockstart+60)) 833 break; 834 } 835 if(!strcmp("# / TYPES OF OBSERV", lastblockstart+60) 836 || !strcmp("TIME OF FIRST OBS", lastblockstart+60)) 837 { 838 RTCM3Error("Overwriting header '%s' is dangerous.\n", 839 lastblockstart+60); 840 } 841 } 842 if(pos >= MAXHEADERLINES) 843 { 844 RTCM3Error("Maximum number of header lines of %d reached.\n", 845 MAXHEADERLINES); 846 } 847 else if(!strcmp("END OF HEADER", lastblockstart+60)) 848 { 849 RTCM3Error("End of header ignored.\n"); 850 } 851 else 852 { 853 hdata.data.unnamed[pos] = lastblockstart; 854 if(pos == hdata.numheaders) 855 ++hdata.numheaders; 856 } 857 } 858 lastblockstart = buffer+i+1; 859 } 860 } 861 } 862 else 863 { 864 RTCM3Error("Could not read data from headerfile '%s'.\n", 865 Parser->headerfile); 866 } 867 fclose(fh); 868 } 869 else 870 { 871 RTCM3Error("Could not open header datafile '%s'.\n", 872 Parser->headerfile); 873 } 874 } 875 876 #ifndef NO_RTCM3_MAIN 877 for(i = 0; i < hdata.numheaders; ++i) 878 RTCM3Text("%s\n", hdata.data.unnamed[i]); 879 RTCM3Text(" " 880 "END OF HEADER\n"); 881 #endif 882 } 672 Parser->dataflag[Parser->numdatatypes] = GNSSDF_C1DATA; 673 Parser->datapos[Parser->numdatatypes] = GNSSENTRY_C1DATA; 674 data[RINEXENTRY_C1DATA] = ++Parser->numdatatypes; 675 676 Parser->dataflag[Parser->numdatatypes] = GNSSDF_C2DATA; 677 Parser->datapos[Parser->numdatatypes] = GNSSENTRY_C2DATA; 678 data[RINEXENTRY_C2DATA] = ++Parser->numdatatypes; 679 680 Parser->dataflag[Parser->numdatatypes] = GNSSDF_P1DATA; 681 Parser->datapos[Parser->numdatatypes] = GNSSENTRY_P1DATA; 682 data[RINEXENTRY_P1DATA] = ++Parser->numdatatypes; 683 684 Parser->dataflag[Parser->numdatatypes] = GNSSDF_P2DATA; 685 Parser->datapos[Parser->numdatatypes] = GNSSENTRY_P2DATA; 686 data[RINEXENTRY_P2DATA] = ++Parser->numdatatypes; 687 688 Parser->dataflag[Parser->numdatatypes] = GNSSDF_L1CDATA; 689 Parser->datapos[Parser->numdatatypes] = GNSSENTRY_L1CDATA; 690 data[RINEXENTRY_L1DATA] = ++Parser->numdatatypes; 691 Parser->dataflag2[data[RINEXENTRY_L1DATA]-1] = GNSSDF_L1PDATA; 692 Parser->datapos2[data[RINEXENTRY_L1DATA]-1] = GNSSENTRY_L1PDATA; 693 694 Parser->dataflag[Parser->numdatatypes] = GNSSDF_L2CDATA; 695 Parser->datapos[Parser->numdatatypes] = GNSSENTRY_L2CDATA; 696 data[RINEXENTRY_L2DATA] = ++Parser->numdatatypes; 697 Parser->dataflag2[data[RINEXENTRY_L2DATA]-1] = GNSSDF_L2PDATA; 698 Parser->datapos2[data[RINEXENTRY_L2DATA]-1] = GNSSENTRY_L2PDATA; 699 700 Parser->dataflag[Parser->numdatatypes] = GNSSDF_S1CDATA; 701 Parser->datapos[Parser->numdatatypes] = GNSSENTRY_S1CDATA; 702 data[RINEXENTRY_S1DATA] = ++Parser->numdatatypes; 703 Parser->dataflag2[data[RINEXENTRY_S1DATA]-1] = GNSSDF_S1PDATA; 704 Parser->datapos2[data[RINEXENTRY_S1DATA]-1] = GNSSENTRY_S1PDATA; 705 706 Parser->dataflag[Parser->numdatatypes] = GNSSDF_S2CDATA; 707 Parser->datapos[Parser->numdatatypes] = GNSSENTRY_S2CDATA; 708 data[RINEXENTRY_S2DATA] = ++Parser->numdatatypes; 709 Parser->dataflag2[data[RINEXENTRY_S2DATA]-1] = GNSSDF_S2PDATA; 710 Parser->datapos2[data[RINEXENTRY_S2DATA]-1] = GNSSENTRY_S2PDATA; 711 712 Parser->dataflag[Parser->numdatatypes] = GNSSDF_D1CDATA; 713 Parser->datapos[Parser->numdatatypes] = GNSSENTRY_D1CDATA; 714 data[RINEXENTRY_D1DATA] = ++Parser->numdatatypes; 715 Parser->dataflag2[data[RINEXENTRY_D1DATA]-1] = GNSSDF_D1PDATA; 716 Parser->datapos2[data[RINEXENTRY_D1DATA]-1] = GNSSENTRY_D1PDATA; 717 718 Parser->dataflag[Parser->numdatatypes] = GNSSDF_D2CDATA; 719 Parser->datapos[Parser->numdatatypes] = GNSSENTRY_D2CDATA; 720 data[RINEXENTRY_D2DATA] = ++Parser->numdatatypes; 721 Parser->dataflag2[data[RINEXENTRY_D2DATA]-1] = GNSSDF_D2PDATA; 722 Parser->datapos2[data[RINEXENTRY_D2DATA]-1] = GNSSENTRY_D2PDATA; 723 } 724 // Ende Aenderung Perlt - kein check auf vorhandene Daten 725 883 726 884 727 void HandleByte(struct RTCM3ParserData *Parser, unsigned int byte) … … 955 798 for(j = 0; j < Parser->numdatatypes; ++j) 956 799 { 957 if(!(Parser->Data.dataflags[i] & Parser->dataflag[j]) 958 || isnan(Parser->Data.measdata[i][Parser->datapos[j]]) 959 || isinf(Parser->Data.measdata[i][Parser->datapos[j]])) 800 int v = 0; 801 int df = Parser->dataflag[j]; 802 int pos = Parser->datapos[j]; 803 if((Parser->Data.dataflags[i] & df) 804 && !isnan(Parser->Data.measdata[i][pos]) 805 && !isinf(Parser->Data.measdata[i][pos])) 806 { 807 v = 1; 808 } 809 else 810 { 811 df = Parser->dataflag2[j]; 812 pos = Parser->datapos2[j]; 813 814 if((Parser->Data.dataflags[i] & df) 815 && !isnan(Parser->Data.measdata[i][pos]) 816 && !isinf(Parser->Data.measdata[i][pos])) 817 { 818 v = 1; 819 } 820 } 821 822 if(!v) 960 823 { /* no or illegal data */ 961 824 RTCM3Text(" "); … … 965 828 char lli = ' '; 966 829 char snr = ' '; 967 if( Parser->dataflag[j]& (GNSSDF_L1CDATA|GNSSDF_L1PDATA))830 if(df & (GNSSDF_L1CDATA|GNSSDF_L1PDATA)) 968 831 { 969 832 if(Parser->Data.dataflags[i] & GNSSDF_LOCKLOSSL1) … … 971 834 snr = '0'+Parser->Data.snrL1[i]; 972 835 } 973 if( Parser->dataflag[j]& (GNSSDF_L2CDATA|GNSSDF_L2PDATA))836 if(df & (GNSSDF_L2CDATA|GNSSDF_L2PDATA)) 974 837 { 975 838 if(Parser->Data.dataflags[i] & GNSSDF_LOCKLOSSL2) … … 978 841 } 979 842 RTCM3Text("%14.3f%c%c", 980 Parser->Data.measdata[i][ Parser->datapos[j]],lli,snr);843 Parser->Data.measdata[i][pos],lli,snr); 981 844 } 982 845 if(j%5 == 4 || j == Parser->numdatatypes-1) … … 989 852 990 853 #ifndef NO_RTCM3_MAIN 991 static char datestr[] = "$Date: 200 6/11/21 08:27:35$";854 static char datestr[] = "$Date: 2007/01/11 15:32:26 $"; 992 855 993 856 /* The string, which is send as agent in HTTP request */ … … 1286 1149 if(!(he=gethostbyname(args.server))) 1287 1150 { 1288 perror("gethostbyname");1151 RTCM3Error("Function gethostbyname: %s\n", strerror(errno)); 1289 1152 exit(1); 1290 1153 } 1291 1154 if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1) 1292 1155 { 1293 perror("socket");1156 RTCM3Error("Function socket: %s\n", strerror(errno)); 1294 1157 exit(1); 1295 1158 } … … 1301 1164 sizeof(struct sockaddr)) == -1) 1302 1165 { 1303 perror("connect");1166 RTCM3Error("Function connect: %s\n", strerror(errno)); 1304 1167 exit(1); 1305 1168 } … … 1339 1202 exit(1); 1340 1203 } 1341 snprintf(buf+i, 5, "\r\n\r\n"); 1342 i += 5; 1204 buf[i++] = '\r'; 1205 buf[i++] = '\n'; 1206 buf[i++] = '\r'; 1207 buf[i++] = '\n'; 1343 1208 } 1344 1209 if(send(sockfd, buf, (size_t)i, 0) != i) 1345 1210 { 1346 perror("send");1211 RTCM3Error("Function send: %s\n", strerror(errno)); 1347 1212 exit(1); 1348 1213 } -
trunk/BNC/RTCM3/rtcm3torinex.h
r320 r366 1 1 #ifndef RTCM3TORINEX_H 2 #define RTCM3TORINE S_H2 #define RTCM3TORINEX_H 3 3 4 4 /* 5 5 Converter for RTCM3 data to RINEX. 6 $Id: rtcm3torinex.h,v 1. 3 2006/11/15 12:31:31stoecker Exp $6 $Id: rtcm3torinex.h,v 1.5 2007/01/11 14:10:13 stoecker Exp $ 7 7 Copyright (C) 2005-2006 by Dirk Stoecker <stoecker@euronik.eu> 8 8 … … 94 94 #define GLO_WAVELENGTH_L2(a) (LIGHTSPEED / GLO_FREQU_L2(a)) /* m */ 95 95 96 /* unimportant, only for approx. time needed */97 #define LEAPSECONDS 1498 99 96 /* Additional flags for the data field, which tell us more. */ 100 97 #define GNSSDF_LOCKLOSSL1 (1<<29) /* lost lock on L1 */ 101 98 #define GNSSDF_LOCKLOSSL2 (1<<30) /* lost lock on L2 */ 99 100 #define LEAPSECONDS 14 /* only needed for approx. time */ 102 101 103 102 struct gnssdata { … … 127 126 int datapos[RINEXENTRY_NUMBER]; 128 127 int dataflag[RINEXENTRY_NUMBER]; 128 int datapos2[RINEXENTRY_NUMBER]; 129 int dataflag2[RINEXENTRY_NUMBER]; 129 130 int numdatatypes; 130 131 int validwarning; -
trunk/BNC/bnccaster.cpp
r350 r366 116 116 void bncCaster::newObs(const QByteArray& staID, const QUrl& mountPoint, 117 117 bool firstObs, Observation* obs, 118 const QByteArray& format) { 118 const QByteArray& format, 119 const QByteArray& latitude, 120 const QByteArray& longitude, 121 const QByteArray& nmea) { 119 122 120 123 QMutexLocker locker(&_mutex); … … 132 135 if (_rinexWriters.find(obs->StatID) == _rinexWriters.end()) { 133 136 _rinexWriters.insert(obs->StatID, new bncRinex(obs->StatID, 134 mountPoint, format)); 137 mountPoint, format, latitude, longitude, nmea)); 135 138 } 136 139 bncRinex* rnx = _rinexWriters.find(obs->StatID).value(); … … 238 241 _out->setFieldWidth(1); *_out << " "; 239 242 _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->C1; 243 _out->setFieldWidth(1); *_out << " "; 244 _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->C2; 240 245 _out->setFieldWidth(1); *_out << " "; 241 246 _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->P1; -
trunk/BNC/bnccaster.h
r350 r366 45 45 int numStations() const {return _staIDs.size();} 46 46 void newObs(const QByteArray& staID, const QUrl& mountPoint, 47 bool firstObs, Observation* obs, const QByteArray& format); 47 bool firstObs, Observation* obs, const QByteArray& format, 48 const QByteArray& latitude, const QByteArray& longitude, 49 const QByteArray& nmea); 48 50 49 51 signals: -
trunk/BNC/bncgetthread.cpp
r358 r366 61 61 //////////////////////////////////////////////////////////////////////////// 62 62 bncGetThread::bncGetThread(const QUrl& mountPoint, 63 const QByteArray& format, int iMount) { 63 const QByteArray& format, 64 const QByteArray& latitude, 65 const QByteArray& longitude, 66 const QByteArray& nmea, int iMount) { 64 67 _decoder = 0; 65 68 _mountPoint = mountPoint; … … 67 70 _staID_orig = _staID; 68 71 _format = format; 72 _latitude = latitude; 73 _longitude = longitude; 74 _nmea = nmea; 69 75 _socket = 0; 70 76 _timeOut = 20*1000; // 20 seconds … … 105 111 // Connect to Caster, send the Request (static) 106 112 //////////////////////////////////////////////////////////////////////////// 107 QTcpSocket* bncGetThread::request(const QUrl& mountPoint, int timeOut, 113 QTcpSocket* bncGetThread::request(const QUrl& mountPoint, 114 QByteArray& latitude, QByteArray& longitude, 115 QByteArray& nmea, int timeOut, 108 116 QString& msg) { 109 117 … … 160 168 161 169 double lat, lon; 162 lat = settings.value("approxLat", 0).toDouble(); 163 lon = settings.value("approxLon", 0).toDouble(); 164 if ((lat != 0.0) && (lon != 0.0) && (hlp.path().length() > 2) && (hlp.path().indexOf(".skl") < 0)) { 170 171 lat = strtod(latitude,NULL); 172 lon = strtod(longitude,NULL); 173 174 if ((nmea == "VRS") && (hlp.path().length() > 2) && (hlp.path().indexOf(".skl") < 0)) { 165 175 const char* flagN="N"; 166 176 const char* flagE="E"; … … 221 231 QString msg; 222 232 223 _socket = bncGetThread::request(_mountPoint, _timeOut, msg); 233 _socket = bncGetThread::request(_mountPoint, _latitude, _longitude, _nmea, _timeOut, msg); 224 234 225 235 //// emit(newMessage(msg.toAscii())); … … 361 371 emit newObs(_staID, *it); 362 372 bool firstObs = (it == _decoder->_obsList.begin()); 363 _global_caster->newObs(_staID, _mountPoint, firstObs, *it, _format); 373 _global_caster->newObs(_staID, _mountPoint, firstObs, *it, _format, _latitude, _longitude, _nmea); 364 374 } 365 375 _decoder->_obsList.clear(); -
trunk/BNC/bncgetthread.h
r350 r366 38 38 public: 39 39 bncGetThread(const QUrl& mountPoint, 40 const QByteArray& format, int iMount); 40 const QByteArray& format, 41 const QByteArray& latitude, 42 const QByteArray& longitude, 43 const QByteArray& nmea, int iMount); 41 44 ~bncGetThread(); 42 45 43 static QTcpSocket* request(const QUrl& mountPoint, 44 int timeOut, QString& msg); 46 static QTcpSocket* request(const QUrl& mountPoint, QByteArray& latitude, QByteArray& longitude, 47 QByteArray& nmea, int timeOut, QString& msg); 45 48 46 49 QByteArray staID() const {return _staID;} … … 65 68 QByteArray _staID_orig; 66 69 QByteArray _format; 70 QByteArray _latitude; 71 QByteArray _longitude; 72 QByteArray _nmea; 67 73 int _timeOut; 68 74 int _nextSleep; -
trunk/BNC/bnchelp.html
r360 r366 60 60 B - 5.5. <a href=#rnxskeleton>RINEX Skeleton Extension</a><br> 61 61 B - 5.6. <a href=#rnxappend>Append Files</a><br> 62 B - 5.7. <a href=#approxlatlon>Approx. Lat./Lon.</a><br>63 62 B - 6. <a href=#mountpoints>Mountpoints</a><br> 64 63 B - 6.1. <a href=#AddMounts>Add Mountpoints</a><br> … … 119 118 <p> 120 119 BNC lets you output synchronized observations epoch by epoch. This output is made available in a plain ASCII format and in a binary format. The output comprises the following observations if available:</p> 121 StatID, SVPRN, GPSWeek, GPSWeeks, C1, P1, P2, L1, L2, SNR1, SNR2. 120 StatID, SVPRN, GPSWeek, GPSWeeks, C1, C2, P1, P2, L1, L2, SNR1, SNR2. 122 121 </p> 123 122 <p> … … 164 163 int GPSWeek; // Week of GPS-Time 165 164 double GPSWeeks; // Second of Week (GPS-Time) 166 double C1; // CA-code pseudorange (meters) 165 double C1; // C1-code pseudorange (meters) 166 double C2; // C2-code pseudorange (meters) 167 167 double P1; // P1-code pseudorange (meters) 168 168 double P2; // P2-code pseudorange (meters) … … 176 176 <p><a name="rinex"><h4>B - 5. RINEX</h4></p> 177 177 <p> 178 Observations are converted to RINEX Version 2.1. RINEX file names are derived by BNC from the first 4 characters of the corresponding mountpoint (4Char Station ID) while omitting the residual part of the mountpoint string. Thus, retrieving data from mountpoints FRANKFURT and WETTZELL leads to hourly RINEX observation files named</p> 178 Observations are converted to RINEX Version 2.11. RINEX file names are derived by BNC from the first 4 characters of the corresponding mountpoint (4Char Station ID) while omitting the residual part of the mountpoint string. Thus, retrieving data from mountpoints FRANKFURT and WETTZELL leads to hourly RINEX observation files named</p> 179 179 <p> 180 180 FRAN{ddd}{h}.{yy}O<br> … … 205 205 </p> 206 206 <p> 207 BNC's RINEX observation files generally contain C1, P1, P2, L1, and L2observations. In case an observation is unavailable, its value is set to zero '0.000'. Note that even if a RINEX file does not contain GLONASS data, the 'RINEX TYPE' field in the RINEX file header may be set to 'M (MIXED)'.207 BNC's RINEX observation files generally contain C1, C2, P1, P2, L1, L2, SNR1, and SNR3 observations. In case an observation is unavailable, its value is set to zero '0.000'. Note that even if a RINEX file does not contain GLONASS data, the 'RINEX TYPE' field in the RINEX file header may be set to 'M (MIXED)'. 208 208 </p> 209 209 … … 283 283 When starting BNC, new RINEX files are created by default. Probably existing files will be overwritten. However, it may be desirable to append observations to already existing RINEX files following a restart of BNC after an intentional 'Stop', a system crash or a crash of BNC. Hit 'Append files' to continue with already existing files and thus save what has been recorded so far. Note that the option 'Append files' also concerns the 'ASCII output file' and the 'Log' file. 284 284 </p> 285 286 <p><a name="approxlatlon"><h4>B - 5.7 Approx. Lat./Lon. - mandatory for Virtual Reference Stations (VRS)</h4></p>287 <p>288 BNC allows to retrieve streams from Virtual Reference Stations (VRS). For that an approximate rover position needs to be send in NMEA format to a VRS supporting NTRIP broadcaster. In return, an individual user-specific data stream is generated by a network RTK software. This stream is tailored exactly to the 'Approx. Lat./Lon.' you enter. The approximate position has to be introduced in northern latitude degrees (example for northern hemisphere: 52.436, example for eastern hemisphere: -24.567) and eastern longitude degrees (example: 358.872 or -1.128).289 </p>290 <p>291 Introducing an 'Approx. Lat./Lon.' is only necessary when retrieving a VRS stream. The approximate position must point to a location within the service area of the affected RTK network. Note that VRS streams that require an 'Approx. Lat./Lon.' are marked by the integer '1' in data field 'nmea' of the affected NTRIP broadcaster source-table. Note further that when working in a Local Area Network (LAN), NMEA messages may be blocked by a proxy server, firewall or virus scanner.292 </p>293 294 285 <p><a name="mountpoints"><h4>B - 6. Mountpoints</h4></p> 295 286 <p> 296 287 Each stream on an NTRIP broadcaster is defined through a unique source ID called mountpoint. An NTRIP client like BNC can access the data of a desired stream by its mountpoint. Information about mountpoints is available through the source-table maintained by the NTRIP broadcaster. Note that mountpoints could show up in BNC more than once when retrieving streams from several NTRIP broadcasters. 297 </p> 288 </p> 289 290 Streams selected for retrieval are listed in the 'Mountpoints' section on BNC's main window. The list provides the following information extracted from NTRIP broadcaster source-tables: 291 292 <table> 293 <tr></tr> 294 <tr><td>'mountpoint' </td><td>NTRIP broadcaster URL, port, and mountpoint.</td></tr> 295 <tr><td>'decoder' </td><td>Internal decoder used to handle the incoming stream content according to its format; editable.</td></tr> 296 <tr><td>'lat' </td><td>Latitude of reference station, degrees, north; editable for VRS streams.</td></tr> 297 <tr><td>'long' </td><td>Longitude of reference station, degrees, east; editable for VRS streams.</td></tr> 298 <tr><td>'type' </td><td>Mountpoint refers to physical Reference Station (RS) or Virtual Reference Station (VRS).</td></tr> 299 <tr><td>'bytes' </td><td>Number of bytes retrieved. 300 </table> 298 301 299 302 <p><a name="AddMounts"><h4>B - 6.1 Add Mountpoints</h4></p> … … 325 328 326 329 <p><a name="edit"><h4>B - 6.6 Edit Mountpoints</h4></p> 327 <p> 328 BNC automatically selects one out of several incorporated decoders for a stream based on its 'format' and 'format-details' as given in the source-table. It may happen that you need to overrule the automated decoder selection because of source-table setup deficiencies. Therefore BNC allows to edit (double-click) the decoder string for each stream shown under 'Mountpoints'. Accepted decoder strings allowed to be introduced are 'RTCM_2.x', 'RTCM_3', and 'RTIGS'. 329 </p> 330 <ul> 331 <li> 332 BNC automatically selects one out of several internal decoders for a stream based on its 'format' and 'format-details' as given in the source-table. It may happen that you need to overrule the automated decoder selection because of source-table setup deficiencies. Therefore BNC allows to edit the decoder string (first double-click, then edit field 'decoder', then hit Enter) for the streams shown under 'Mountpoints'. Accepted decoder strings allowed to be introduced are 'RTCM_2.x', 'RTCM_3', and 'RTIGS'. 333 </li> 334 <li> 335 BNC allows to retrieve streams from Virtual Reference Stations. Whether a stream comes from a physical Reference Station (RS) or a Virtual Reference Station (VRS) is indicated in column 'type' under 'Mountpoints' as well as in column 'type' of the affected source-table. For retrieving a VRS stream, an approximate rover position is required to be send in NMEA format to the NTRIP broadcaster. In return, an individual user-specific data stream is generated, usually by a network RTK software. This stream is tailored exactly to the latitude and longitude shown in the 'lat' and 'long' columns under 'Mountpoints'. Default values for 'lat' and 'long' are taken from the source-table. You may change these values (first double-click, then edit fields 'lat' and/or 'long', then hit Enter) according to your needs. The position has to be introduced in northern latitude degrees (example for northern hemisphere: 52.436, example for eastern hemisphere: -24.567) and eastern longitude degrees (example: 358.872 or -1.128). Editing the 'lat' and 'long' values under 'Mountpoints' is only possible for VRS streams. The position must point to a location within the service area of the affected RTK network. Note that when running BNC in a Local Area Network (LAN), NMEA strings may be blocked by a proxy server, firewall or virus scanner. 336 </li> 337 </ul> 330 338 331 339 <p><a name="log"><h4>B - 7. Log - optional</h4></p> … … 358 366 </li> 359 367 <li> 360 So far BNC only handles GPS and GLONASS data while ignoring Galileo. Furthermore, its function is limited today to processing C1, P1, P2, L1, and L2 observations only.361 </li> 362 <li> 363 Due to a limitation of the RTIGS format and transport protocol, streams coming in that format can only contain GPS data.368 So far BNC only handles GPS and GLONASS data while ignoring Galileo. 369 </li> 370 <li> 371 BNC's function is limited today to processing C1, C2, P1, P2, L1, L2, SNR1, and SNR2 observations. Which observables become available through a specific stream depends on the setup of the affected receiver and the applied data format. Note that RTCM Version 2.x streams can not transport signal-to-noise ratios (SNR) and RTCM Version 3 streams can only transport one code observable per frequency. Note further that signal-to-noise ratios SNR1 and SNR2 are mapped to integer numbers 1 to 9. 364 372 </li> 365 373 <li> … … 367 375 </li> 368 376 <li> 369 If the ambiguity field is not set in RTCM Version 3 streams, the BNC output will be no valid RINEX. All values will be stored modulo 299792.458. A COMMENT line will tell you, when this happens. It would be necessary to approximately calculate the range to fix the ambiguity (needing ephemeris/almanac and easy positioning algorithm). 377 If the ambiguity field is not set in RTCM Version 3 streams (i.e. when sending message type 1003 but no 1004), the BNC output will be no valid RINEX. All values will be stored modulo 299792.458. (It would be necessary to approximately calculate the range to fix the ambiguity, needing ephemeris/almanac and an easy positioning algorithm). 378 </li> 379 <li> 380 As a consequence of the current implementation of the RTIGS format and transport protocol, streams coming in that format contain only GPS data. 370 381 </li> 371 382 <li> -
trunk/BNC/bncmain.cpp
r356 r366 119 119 QUrl url(hlp[0]); 120 120 QByteArray format = hlp[1].toAscii(); 121 bncGetThread* getThread = new bncGetThread(url, format, iMount); 121 QByteArray latitude = hlp[2].toAscii(); 122 QByteArray longitude = hlp[3].toAscii(); 123 QByteArray nmea = hlp[4].toAscii(); 124 bncGetThread* getThread = new bncGetThread(url, format, latitude, longitude, nmea, iMount); 122 125 app.connect(getThread, SIGNAL(newMessage(const QByteArray&)), 123 126 &app, SLOT(slotMessage(const QByteArray&))); -
trunk/BNC/bncrinex.cpp
r356 r366 62 62 //////////////////////////////////////////////////////////////////////////// 63 63 bncRinex::bncRinex(const char* StatID, const QUrl& mountPoint, 64 const QByteArray& format) { 64 const QByteArray& format, const QByteArray& latitude, 65 const QByteArray& longitude, const QByteArray& nmea) { 65 66 _statID = StatID; 66 67 _mountPoint = mountPoint; 67 68 _format = format.left(6); 69 _latitude = latitude; 70 _longitude = longitude; 71 _nmea = nmea; 68 72 _headerWritten = false; 69 73 … … 145 149 const int timeOut = 10*1000; 146 150 QString msg; 147 QTcpSocket* socket = bncGetThread::request(url, timeOut, msg); 151 QByteArray _latitude; 152 QByteArray _longitude; 153 QByteArray _nmea; 154 QTcpSocket* socket = bncGetThread::request(url, _latitude, _longitude, _nmea, timeOut, msg); 148 155 149 156 if (socket) { … … 154 161 line.chop(1); 155 162 if (line.indexOf("RINEX VERSION") != -1) { 156 _headerLines.append(" 2.1 0OBSERVATION DATA"163 _headerLines.append(" 2.11 OBSERVATION DATA" 157 164 " M (MIXED)" 158 165 " RINEX VERSION / TYPE"); … … 294 301 295 302 QSettings settings; 296 // double lat, lon;297 // int vrsstream = 0;298 // lat = settings.value("approxLat", 0).toDouble();299 // lon = settings.value("approxLon", 0).toDouble();300 // if ((lat != 0.0) && (lon != 0.0)) {vrsstream=1;}301 303 302 304 // Open the Output File … … 332 334 } 333 335 else if (line.indexOf("# / TYPES OF OBSERV") != -1) { 334 _out << " 5 C1P1 P2 L1 L2"335 " 336 _out << " 6 C1 C2 P1 P2 L1 L2" 337 " # / TYPES OF OBSERV" << endl; 336 338 } 337 339 else if (line.indexOf("TIME OF FIRST OBS") != -1) { … … 342 344 _mountPoint.path())).leftJustified(60, ' ', true); 343 345 _out << hlp.toAscii().data() << "COMMENT" << endl; 344 // hlp = QString("Approx VRS Position %1%2").arg(lat, -20, 'f', 4).arg(lon, -20, 'f', 4);345 // _out << hlp.toAscii().data() << "COMMENT" << endl;346 346 } 347 347 else { … … 357 357 double antennaNEU[3]; antennaNEU[0] = antennaNEU[1] = antennaNEU[2] = 0.0; 358 358 359 _out << " 2.1 0OBSERVATION DATA M (MIXED) RINEX VERSION / TYPE" << endl;359 _out << " 2.11 OBSERVATION DATA M (MIXED) RINEX VERSION / TYPE" << endl; 360 360 QString hlp = QDate::currentDate().toString("dd-MMM-yyyy").leftJustified(20, ' ', true); 361 361 _out << _pgmName.toAscii().data() << _userName.toAscii().data() … … 380 380 << " " << "ANTENNA: DELTA H/E/N" << endl; 381 381 _out << " 1 1 WAVELENGTH FACT L1/2" << endl; 382 _out << " 5 C1P1 P2 L1 L2382 _out << " 6 C1 C2 P1 P2 L1 L2 # / TYPES OF OBSERV" << endl; 383 383 _out << datTim.toString(" yyyy MM dd" 384 384 " hh mm ss.zzz0000").toAscii().data(); … … 387 387 _mountPoint.path())).leftJustified(60, ' ', true); 388 388 _out << hlp.toAscii().data() << "COMMENT" << endl; 389 // hlp = QString("Approx VRS Position %1%2").arg(lat, -20, 'f', 4).arg(lon, -20, 'f', 4); 390 // _out << hlp.toAscii().data() << "COMMENT" << endl; 389 390 if (_nmea == "VRS") { 391 hlp = ("VRS LAT=" + _latitude + " " + "LONG=" + _longitude).leftJustified(60, ' ',true); 392 _out << hlp.toAscii().data() << "COMMENT" << endl; } 393 391 394 _out << " END OF HEADER" << endl; 392 395 } … … 469 472 char snr = ' '; 470 473 _out << setw(14) << setprecision(3) << ob->C1 << lli << snr; 474 _out << setw(14) << setprecision(3) << ob->C2 << lli << snr; 471 475 _out << setw(14) << setprecision(3) << ob->P1 << lli << snr; 472 476 _out << setw(14) << setprecision(3) << ob->P2 << lli << snr; 473 477 _out << setw(14) << setprecision(3) << ob->L1 << lli 474 << setw(1) << ob->SNR1; 478 << setw(1) << ob->SNR1 << endl; 475 479 _out << setw(14) << setprecision(3) << ob->L2 << lli 476 480 << setw(1) << ob->SNR2; -
trunk/BNC/bncrinex.h
r336 r366 39 39 public: 40 40 bncRinex(const char* StatID, const QUrl& mountPoint, 41 const QByteArray& format); 41 const QByteArray& format, const QByteArray& latitude, 42 const QByteArray& longitude, const QByteArray& nmea); 42 43 ~bncRinex(); 43 44 void deepCopy(const Observation* obs); … … 63 64 QString _sklName; 64 65 QByteArray _format; 66 QByteArray _latitude; 67 QByteArray _longitude; 68 QByteArray _nmea; 65 69 }; 66 70 -
trunk/BNC/bnctabledlg.cpp
r299 r366 87 87 _buttonGet = new QPushButton(tr("Get table"), this); 88 88 connect(_buttonGet, SIGNAL(clicked()), this, SLOT(slotGetTable())); 89 89 90 90 _buttonCancel = new QPushButton(tr("Cancel"), this); 91 91 connect(_buttonCancel, SIGNAL(clicked()), this, SLOT(reject())); … … 142 142 const int timeOut = 10*1000; 143 143 QString msg; 144 QTcpSocket* socket = bncGetThread::request(url, timeOut, msg); 144 QByteArray _latitude; 145 QByteArray _longitude; 146 QByteArray _nmea; 147 QTcpSocket* socket = bncGetThread::request(url, _latitude, _longitude, _nmea, timeOut, msg); 145 148 146 149 if (!socket) { … … 207 210 static const QStringList labels = QString("mountpoint,identifier,format," 208 211 "format-details,carrier,nav-system,network,country,latitude,longitude," 209 " nmea,solution,generator,compression,authentication,fee,bitrate,"212 "type,solution,generator,compression,authentication,fee,bitrate," 210 213 "misc").split(","); 211 214 … … 224 227 ++nRow; 225 228 for (int ic = 0; ic < columns.size()-1; ic++) { 229 230 if (ic+1 == 11) { if (columns[ic+1] == "0") { columns[ic+1] = "RS"; } else { columns[ic+1] = "VRS"; }} 231 226 232 QTableWidgetItem* it = new QTableWidgetItem(columns[ic+1]); 227 233 it->setFlags(it->flags() & ~Qt::ItemIsEditable); … … 251 257 QTableWidgetItem* item = _table->item(ir,0); 252 258 QString format = _table->item(ir,2)->text(); 259 QString latitude = _table->item(ir,8)->text(); 260 QString longitude = _table->item(ir,9)->text(); 261 QString nmea = _table->item(ir,10)->text(); 253 262 format.replace(" ", "_"); 254 263 if (_table->isItemSelected(item)) { … … 260 269 url.setPath(item->text()); 261 270 262 mountPoints->push_back(url.toString() + " " + format); 271 mountPoints->push_back(url.toString() + " " + format + " " + latitude + " " + longitude + " " + nmea); 263 272 } 264 273 } -
trunk/BNC/bncwindow.cpp
r356 r366 47 47 #include "bnchlpdlg.h" 48 48 #include "bnchtml.h" 49 #include "bnctableitem.h" 49 #include "bnctableitem.h" 50 50 51 51 using namespace std; … … 57 57 int ww = QFontMetrics(this->font()).width('w'); 58 58 59 static const QStringList labels = QString("account,mountpoint," 60 "decoder,bytes").split(","); 61 62 setMinimumSize(60*ww, 60*ww); 59 static const QStringList labels = QString("account,mountpoint,decoder,lat,long,type,bytes").split(","); 60 61 setMinimumSize(77*ww, 60*ww); 63 62 setWindowTitle(tr("BKG Ntrip Client (BNC), Version 1.1b")); 64 63 … … 163 162 _rnxSamplSpinBox->setSuffix(" sec"); 164 163 _logFileLineEdit = new QLineEdit(settings.value("logFile").toString()); 165 _LatLineEdit = new QLineEdit(settings.value("approxLat").toString()); 166 _LatLineEdit->setMaximumWidth(9*ww); 167 _LonLineEdit = new QLineEdit(settings.value("approxLon").toString()); 168 _LonLineEdit->setMaximumWidth(9*ww); 169 _mountPointsTable = new QTableWidget(0,4); 164 _mountPointsTable = new QTableWidget(0,7); 170 165 _mountPointsTable->horizontalHeader()->resizeSection(1,25*ww); 166 _mountPointsTable->horizontalHeader()->resizeSection(2,9*ww); 167 _mountPointsTable->horizontalHeader()->resizeSection(3,7*ww); 168 _mountPointsTable->horizontalHeader()->resizeSection(4,7*ww); 169 _mountPointsTable->horizontalHeader()->resizeSection(5,5*ww); 171 170 _mountPointsTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive); 172 171 _mountPointsTable->horizontalHeader()->setStretchLastSection(true); … … 186 185 QStringList hlp = it.next().split(" "); 187 186 if (hlp.size() <= 1) continue; 187 if (hlp.size() == 2) continue; // For downward compatibility 188 188 _mountPointsTable->insertRow(iRow); 189 189 … … 191 191 192 192 QString fullPath = url.host() + QString(":%1").arg(url.port()) + url.path(); 193 QString format(hlp[1]); 193 QString format(hlp[1]); QString latitude(hlp[2]); QString longitude(hlp[3]); 194 QString nmea(hlp[4]); 194 195 195 196 QTableWidgetItem* it; … … 205 206 _mountPointsTable->setItem(iRow, 2, it); 206 207 208 if (nmea == "VRS") { 209 it = new QTableWidgetItem(latitude); 210 _mountPointsTable->setItem(iRow, 3, it); 211 it = new QTableWidgetItem(longitude); 212 _mountPointsTable->setItem(iRow, 4, it); 213 } else { 214 it = new QTableWidgetItem(latitude); 215 it->setFlags(it->flags() & ~Qt::ItemIsEditable); 216 _mountPointsTable->setItem(iRow, 3, it); 217 it = new QTableWidgetItem(longitude); 218 it->setFlags(it->flags() & ~Qt::ItemIsEditable); 219 _mountPointsTable->setItem(iRow, 4, it); 220 } 221 222 it = new QTableWidgetItem(nmea); 223 it->setFlags(it->flags() & ~Qt::ItemIsEditable); 224 _mountPointsTable->setItem(iRow, 5, it); 225 207 226 bncTableItem* bncIt = new bncTableItem(); 208 227 bncIt->setFlags(bncIt->flags() & ~Qt::ItemIsEditable); 209 _mountPointsTable->setItem(iRow, 3, bncIt);228 _mountPointsTable->setItem(iRow, 6, bncIt); 210 229 211 230 iRow++; … … 252 271 253 272 layout->addWidget(new QLabel("Mountpoints"), 8, 0, 1, 2); 254 255 layout->addWidget(new QLabel(tr("Approx. Lat./Lon.")), 8, 2);256 layout->addWidget(_LatLineEdit, 8, 3);257 layout->addWidget(_LonLineEdit, 8, 4);258 273 259 274 layout->addWidget(_mountPointsTable, 9, 0, 1, 5); … … 332 347 QUrl url(hlp[0]); 333 348 QString fullPath = url.host() + QString(":%1").arg(url.port()) + url.path(); 334 QString format(hlp[1]); 349 QString format(hlp[1]); QString latitude(hlp[2]); QString longitude(hlp[3]); 350 QString nmea(hlp[4]); 335 351 336 352 _mountPointsTable->insertRow(iRow); … … 348 364 _mountPointsTable->setItem(iRow, 2, it); 349 365 366 if (nmea == "VRS") { 367 it = new QTableWidgetItem(latitude); 368 _mountPointsTable->setItem(iRow, 3, it); 369 it = new QTableWidgetItem(longitude); 370 _mountPointsTable->setItem(iRow, 4, it); 371 } else { 372 it = new QTableWidgetItem(latitude); 373 it->setFlags(it->flags() & ~Qt::ItemIsEditable); 374 _mountPointsTable->setItem(iRow, 3, it); 375 it = new QTableWidgetItem(longitude); 376 it->setFlags(it->flags() & ~Qt::ItemIsEditable); 377 _mountPointsTable->setItem(iRow, 4, it); 378 } 379 380 it = new QTableWidgetItem(nmea); 381 it->setFlags(it->flags() & ~Qt::ItemIsEditable); 382 _mountPointsTable->setItem(iRow, 5, it); 383 350 384 bncTableItem* bncIt = new bncTableItem(); 351 _mountPointsTable->setItem(iRow, 3, bncIt);385 _mountPointsTable->setItem(iRow, 6, bncIt); 352 386 353 387 iRow++; … … 377 411 settings.setValue("rnxAppend", _rnxAppendCheckBox->checkState()); 378 412 settings.setValue("logFile", _logFileLineEdit->text()); 379 settings.setValue("approxLat", _LatLineEdit->text());380 settings.setValue("approxLon", _LonLineEdit->text());381 413 382 414 QStringList mountPoints; … … 387 419 388 420 mountPoints.append(url.toString() + " " + 389 _mountPointsTable->item(iRow, 2)->text()); 421 _mountPointsTable->item(iRow, 2)->text() 422 + " " + _mountPointsTable->item(iRow, 3)->text() 423 + " " + _mountPointsTable->item(iRow, 4)->text() 424 + " " + _mountPointsTable->item(iRow, 5)->text()); 390 425 } 391 426 settings.setValue("mountPoints", mountPoints); … … 431 466 QByteArray format = _mountPointsTable->item(iRow, 2)->text().toAscii(); 432 467 433 bncGetThread* getThread = new bncGetThread(url, format, iRow); 468 QByteArray latitude = _mountPointsTable->item(iRow, 3)->text().toAscii(); 469 QByteArray longitude = _mountPointsTable->item(iRow, 4)->text().toAscii(); 470 QByteArray nmea = _mountPointsTable->item(iRow, 5)->text().toAscii(); 471 472 bncGetThread* getThread = new bncGetThread(url, format, latitude, longitude, nmea, iRow); 434 473 435 474 connect(getThread, SIGNAL(newMessage(const QByteArray&)), … … 439 478 440 479 connect(getThread, SIGNAL(newObs(const QByteArray&, Observation*)), 441 (bncTableItem*) _mountPointsTable->item(iRow, 3),480 (bncTableItem*) _mountPointsTable->item(iRow, 6), 442 481 SLOT(slotNewObs(const QByteArray&, Observation*))); 443 482
Note:
See TracChangeset
for help on using the changeset viewer.