Changeset 366 in ntrip


Ignore:
Timestamp:
Jan 17, 2007, 4:17:20 PM (17 years ago)
Author:
mervart
Message:

* empty log message *

Location:
trunk/BNC
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/RTCM/GPSDecoder.h

    r341 r366  
    4040    GPSWeeks  = 0.0;
    4141    C1        = 0.0;
     42    C2        = 0.0;
    4243    P1        = 0.0;
    4344    P2        = 0.0;
     
    5556  double GPSWeeks;    // Second of Week (GPS-Time)
    5657  double C1;          // CA-code pseudorange (meters)
     58  double C2;          // CA-code pseudorange (meters)
    5759  double P1;          // P1-code pseudorange (meters)
    5860  double P2;          // P2-code pseudorange (meters)
  • trunk/BNC/RTCM/RTCM2.cpp

    r361 r366  
    880880    t = 0.6*P.modZCount()
    881881        + 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.;
    884886   
    885887    // Frequency (exit if neither L1 nor L2)
     
    971973    t = 0.6*P.modZCount()
    972974        + 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.;
    975979   
    976980    // Frequency (exit if neither L1 nor L2)
  • trunk/BNC/RTCM3/RTCM3Decoder.cpp

    r341 r366  
    9090        if (rr == 2) {
    9191          std::cerr << "No valid RINEX! All values are modulo 299792.458!\n";
    92           exit(1);
     92//        exit(1);
    9393        }
    9494
     
    107107
    108108          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;
    114116            }
    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          {
    116130            if      (_Parser.dataflag[jj] & GNSSDF_C1DATA) {
    117131              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]];
    118135            }
    119136            else if (_Parser.dataflag[jj] & GNSSDF_P1DATA) {
     
    123140              obs->P2 = _Parser.Data.measdata[ii][_Parser.datapos[jj]];
    124141            }
    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];
    127144              obs->SNR1 = _Parser.Data.snrL1[ii];
    128145            }
    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];
    131148              obs->SNR2 = _Parser.Data.snrL2[ii];
    132149            }
     150          }
    133151          }
    134152          _obsList.push_back(obs);
  • trunk/BNC/RTCM3/rtcm3torinex.cpp

    r327 r366  
    11/*
    22  Converter for RTCM3 data to RINEX.
    3   $Id: rtcm3torinex.c,v 1.11 2006/11/21 08:27:35 stoecker Exp $
     3  $Id: rtcm3torinex.c,v 1.16 2007/01/11 15:32:26 stoecker Exp $
    44  Copyright (C) 2005-2006 by Dirk Stoecker <stoecker@euronik.eu>
    55
     
    5151
    5252/* CVS revision and version */
    53 static char revisionstr[] = "$Revision: 1.11 $";
     53static char revisionstr[] = "$Revision: 1.16 $";
    5454
    5555static uint32_t CRC24(long size, const unsigned char *buf)
     
    332332              gnss->dataflags[num] |= s;
    333333              gnss->measdata[num][se] = i*0.25;
    334               i /= 4*4;
     334              i /= 4*6;
    335335              if(i > 9) i = 9;
    336336              else if(i < 1) i = 1;
     
    380380                gnss->dataflags[num] |= s;
    381381                gnss->measdata[num][se] = i*0.25;
    382                 i /= 4*4;
     382                i /= 4*6;
    383383                if(i > 9) i = 9;
    384384                else if(i < 1) i = 1;
     
    495495              gnss->dataflags[num] |= s;
    496496              gnss->measdata[num][se] = i*0.25;
    497               i /= 4*4;
     497              i /= 4*6;
    498498              if(i > 9) i = 9;
    499499              else if(i < 1) i = 1;
     
    543543                gnss->dataflags[num] |= s;
    544544                gnss->measdata[num][se] = i*0.25;
    545                 i /= 4*4;
     545                i /= 4*6;
    546546                if(i > 9) i = 9;
    547547                else if(i < 1) i = 1;
     
    654654}
    655655
    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
    657662void HandleHeader(struct RTCM3ParserData *Parser)
    658663{
    659   struct HeaderData hdata;
    660   char thebuffer[MAXHEADERBUFFERSIZE];
    661   char *buffer = thebuffer;
    662   size_t buffersize = sizeof(thebuffer);
    663664  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_MAIN
    675     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 #endif
    684 
    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 
    740665    int flags = Parser->startflags;
    741666    int data[RINEXENTRY_NUMBER];
    742     char tbuffer[6*RINEXENTRY_NUMBER+1];
    743     int tbufferpos = 0;
    744667    for(i = 0; i < RINEXENTRY_NUMBER; ++i)
    745668      data[i] = 0;
     
    747670      flags |= Parser->Data.dataflags[i];
    748671
    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 }
     672Parser->dataflag[Parser->numdatatypes] = GNSSDF_C1DATA;
     673Parser->datapos[Parser->numdatatypes] = GNSSENTRY_C1DATA;
     674data[RINEXENTRY_C1DATA] = ++Parser->numdatatypes;
     675
     676Parser->dataflag[Parser->numdatatypes] = GNSSDF_C2DATA;
     677Parser->datapos[Parser->numdatatypes] = GNSSENTRY_C2DATA;
     678data[RINEXENTRY_C2DATA] = ++Parser->numdatatypes;
     679
     680Parser->dataflag[Parser->numdatatypes] = GNSSDF_P1DATA;
     681Parser->datapos[Parser->numdatatypes] = GNSSENTRY_P1DATA;
     682data[RINEXENTRY_P1DATA] = ++Parser->numdatatypes;
     683
     684Parser->dataflag[Parser->numdatatypes] = GNSSDF_P2DATA;
     685Parser->datapos[Parser->numdatatypes] = GNSSENTRY_P2DATA;
     686data[RINEXENTRY_P2DATA] = ++Parser->numdatatypes;
     687
     688Parser->dataflag[Parser->numdatatypes] = GNSSDF_L1CDATA;
     689Parser->datapos[Parser->numdatatypes] = GNSSENTRY_L1CDATA;
     690data[RINEXENTRY_L1DATA] = ++Parser->numdatatypes;
     691Parser->dataflag2[data[RINEXENTRY_L1DATA]-1] = GNSSDF_L1PDATA;
     692Parser->datapos2[data[RINEXENTRY_L1DATA]-1] = GNSSENTRY_L1PDATA;
     693
     694Parser->dataflag[Parser->numdatatypes] = GNSSDF_L2CDATA;
     695Parser->datapos[Parser->numdatatypes] = GNSSENTRY_L2CDATA;
     696data[RINEXENTRY_L2DATA] = ++Parser->numdatatypes;
     697Parser->dataflag2[data[RINEXENTRY_L2DATA]-1] = GNSSDF_L2PDATA;
     698Parser->datapos2[data[RINEXENTRY_L2DATA]-1] = GNSSENTRY_L2PDATA;
     699
     700Parser->dataflag[Parser->numdatatypes] = GNSSDF_S1CDATA;
     701Parser->datapos[Parser->numdatatypes] = GNSSENTRY_S1CDATA;
     702data[RINEXENTRY_S1DATA] = ++Parser->numdatatypes;
     703Parser->dataflag2[data[RINEXENTRY_S1DATA]-1] = GNSSDF_S1PDATA;
     704Parser->datapos2[data[RINEXENTRY_S1DATA]-1] = GNSSENTRY_S1PDATA;
     705
     706Parser->dataflag[Parser->numdatatypes] = GNSSDF_S2CDATA;
     707Parser->datapos[Parser->numdatatypes] = GNSSENTRY_S2CDATA;
     708data[RINEXENTRY_S2DATA] = ++Parser->numdatatypes;
     709Parser->dataflag2[data[RINEXENTRY_S2DATA]-1] = GNSSDF_S2PDATA;
     710Parser->datapos2[data[RINEXENTRY_S2DATA]-1] = GNSSENTRY_S2PDATA;
     711
     712Parser->dataflag[Parser->numdatatypes] = GNSSDF_D1CDATA;
     713Parser->datapos[Parser->numdatatypes] = GNSSENTRY_D1CDATA;
     714data[RINEXENTRY_D1DATA] = ++Parser->numdatatypes;
     715Parser->dataflag2[data[RINEXENTRY_D1DATA]-1] = GNSSDF_D1PDATA;
     716Parser->datapos2[data[RINEXENTRY_D1DATA]-1] = GNSSENTRY_D1PDATA;
     717
     718Parser->dataflag[Parser->numdatatypes] = GNSSDF_D2CDATA;
     719Parser->datapos[Parser->numdatatypes] = GNSSENTRY_D2CDATA;
     720data[RINEXENTRY_D2DATA] = ++Parser->numdatatypes;
     721Parser->dataflag2[data[RINEXENTRY_D2DATA]-1] = GNSSDF_D2PDATA;
     722Parser->datapos2[data[RINEXENTRY_D2DATA]-1] = GNSSENTRY_D2PDATA;
     723}
     724// Ende Aenderung Perlt - kein check auf vorhandene Daten
     725
    883726
    884727void HandleByte(struct RTCM3ParserData *Parser, unsigned int byte)
     
    955798        for(j = 0; j < Parser->numdatatypes; ++j)
    956799        {
    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)
    960823          { /* no or illegal data */
    961824            RTCM3Text("                ");
     
    965828            char lli = ' ';
    966829            char snr = ' ';
    967             if(Parser->dataflag[j] & (GNSSDF_L1CDATA|GNSSDF_L1PDATA))
     830            if(df & (GNSSDF_L1CDATA|GNSSDF_L1PDATA))
    968831            {
    969832              if(Parser->Data.dataflags[i] & GNSSDF_LOCKLOSSL1)
     
    971834              snr = '0'+Parser->Data.snrL1[i];
    972835            }
    973             if(Parser->dataflag[j] & (GNSSDF_L2CDATA|GNSSDF_L2PDATA))
     836            if(df & (GNSSDF_L2CDATA|GNSSDF_L2PDATA))
    974837            {
    975838              if(Parser->Data.dataflags[i] & GNSSDF_LOCKLOSSL2)
     
    978841            }
    979842            RTCM3Text("%14.3f%c%c",
    980             Parser->Data.measdata[i][Parser->datapos[j]],lli,snr);
     843            Parser->Data.measdata[i][pos],lli,snr);
    981844          }
    982845          if(j%5 == 4 || j == Parser->numdatatypes-1)
     
    989852
    990853#ifndef NO_RTCM3_MAIN
    991 static char datestr[]     = "$Date: 2006/11/21 08:27:35 $";
     854static char datestr[]     = "$Date: 2007/01/11 15:32:26 $";
    992855
    993856/* The string, which is send as agent in HTTP request */
     
    12861149    if(!(he=gethostbyname(args.server)))
    12871150    {
    1288       perror("gethostbyname");
     1151      RTCM3Error("Function gethostbyname: %s\n", strerror(errno));
    12891152      exit(1);
    12901153    }
    12911154    if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) == -1)
    12921155    {
    1293       perror("socket");
     1156      RTCM3Error("Function socket: %s\n", strerror(errno));
    12941157      exit(1);
    12951158    }
     
    13011164    sizeof(struct sockaddr)) == -1)
    13021165    {
    1303       perror("connect");
     1166      RTCM3Error("Function connect: %s\n", strerror(errno));
    13041167      exit(1);
    13051168    }
     
    13391202        exit(1);
    13401203      }
    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';
    13431208    }
    13441209    if(send(sockfd, buf, (size_t)i, 0) != i)
    13451210    {
    1346       perror("send");
     1211      RTCM3Error("Function send: %s\n", strerror(errno));
    13471212      exit(1);
    13481213    }
  • trunk/BNC/RTCM3/rtcm3torinex.h

    r320 r366  
    11#ifndef RTCM3TORINEX_H
    2 #define RTCM3TORINES_H
     2#define RTCM3TORINEX_H
    33
    44/*
    55  Converter for RTCM3 data to RINEX.
    6   $Id: rtcm3torinex.h,v 1.3 2006/11/15 12:31:31 stoecker Exp $
     6  $Id: rtcm3torinex.h,v 1.5 2007/01/11 14:10:13 stoecker Exp $
    77  Copyright (C) 2005-2006 by Dirk Stoecker <stoecker@euronik.eu>
    88
     
    9494#define GLO_WAVELENGTH_L2(a) (LIGHTSPEED / GLO_FREQU_L2(a)) /* m */
    9595
    96 /* unimportant, only for approx. time needed */
    97 #define LEAPSECONDS 14
    98 
    9996/* Additional flags for the data field, which tell us more. */
    10097#define GNSSDF_LOCKLOSSL1     (1<<29)  /* lost lock on L1 */
    10198#define GNSSDF_LOCKLOSSL2     (1<<30)  /* lost lock on L2 */
     99
     100#define LEAPSECONDS     14 /* only needed for approx. time */
    102101
    103102struct gnssdata {
     
    127126  int    datapos[RINEXENTRY_NUMBER];
    128127  int    dataflag[RINEXENTRY_NUMBER];
     128  int    datapos2[RINEXENTRY_NUMBER];
     129  int    dataflag2[RINEXENTRY_NUMBER];
    129130  int    numdatatypes;
    130131  int    validwarning;
  • trunk/BNC/bnccaster.cpp

    r350 r366  
    116116void bncCaster::newObs(const QByteArray& staID, const QUrl& mountPoint,
    117117                       bool firstObs, Observation* obs,
    118                        const QByteArray& format) {
     118                       const QByteArray& format,
     119                       const QByteArray& latitude,
     120                       const QByteArray& longitude,
     121                       const QByteArray& nmea) {
    119122
    120123  QMutexLocker locker(&_mutex);
     
    132135  if (_rinexWriters.find(obs->StatID) == _rinexWriters.end()) {
    133136    _rinexWriters.insert(obs->StatID, new bncRinex(obs->StatID,
    134                                                    mountPoint, format));
     137                                                   mountPoint, format, latitude, longitude, nmea));
    135138  }
    136139  bncRinex* rnx = _rinexWriters.find(obs->StatID).value();
     
    238241          _out->setFieldWidth(1); *_out << " ";
    239242          _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->C1;
     243          _out->setFieldWidth(1); *_out << " ";
     244          _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->C2;
    240245          _out->setFieldWidth(1); *_out << " ";
    241246          _out->setFieldWidth(14); _out->setRealNumberPrecision(3); *_out << obs->P1;
  • trunk/BNC/bnccaster.h

    r350 r366  
    4545   int  numStations() const {return _staIDs.size();}
    4646   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);
    4850
    4951 signals:
  • trunk/BNC/bncgetthread.cpp

    r358 r366  
    6161////////////////////////////////////////////////////////////////////////////
    6262bncGetThread::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) {
    6467  _decoder    = 0;
    6568  _mountPoint = mountPoint;
     
    6770  _staID_orig = _staID;
    6871  _format     = format;
     72  _latitude   = latitude;
     73  _longitude  = longitude;
     74  _nmea       = nmea;
    6975  _socket     = 0;
    7076  _timeOut    = 20*1000;  // 20 seconds
     
    105111// Connect to Caster, send the Request (static)
    106112////////////////////////////////////////////////////////////////////////////
    107 QTcpSocket* bncGetThread::request(const QUrl& mountPoint, int timeOut,
     113QTcpSocket* bncGetThread::request(const QUrl& mountPoint,
     114                                  QByteArray& latitude, QByteArray& longitude,
     115                                  QByteArray& nmea, int timeOut,
    108116                                  QString& msg) {
    109117
     
    160168
    161169  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)) {
    165175    const char* flagN="N";
    166176    const char* flagE="E";
     
    221231  QString msg;
    222232
    223   _socket = bncGetThread::request(_mountPoint, _timeOut, msg);
     233  _socket = bncGetThread::request(_mountPoint, _latitude, _longitude, _nmea, _timeOut, msg);
    224234
    225235  ////  emit(newMessage(msg.toAscii()));
     
    361371          emit newObs(_staID, *it);
    362372          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);
    364374        }
    365375        _decoder->_obsList.clear();
  • trunk/BNC/bncgetthread.h

    r350 r366  
    3838 public:
    3939   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);
    4144   ~bncGetThread();
    4245
    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);
    4548
    4649   QByteArray staID() const {return _staID;}
     
    6568   QByteArray  _staID_orig;
    6669   QByteArray  _format;
     70   QByteArray  _latitude;
     71   QByteArray  _longitude;
     72   QByteArray  _nmea;
    6773   int         _timeOut;
    6874   int         _nextSleep;
  • trunk/BNC/bnchelp.html

    r360 r366  
    6060&nbsp; &nbsp; &nbsp; B - 5.5. <a href=#rnxskeleton>RINEX Skeleton Extension</a><br>
    6161&nbsp; &nbsp; &nbsp; B - 5.6. <a href=#rnxappend>Append Files</a><br>
    62 &nbsp; &nbsp; &nbsp; B - 5.7. <a href=#approxlatlon>Approx. Lat./Lon.</a><br>
    6362B - 6. <a href=#mountpoints>Mountpoints</a><br>
    6463&nbsp; &nbsp; &nbsp; B - 6.1. <a href=#AddMounts>Add Mountpoints</a><br>
     
    119118<p>
    120119BNC 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.
     120StatID, SVPRN, GPSWeek, GPSWeeks, C1, C2, P1, P2, L1, L2, SNR1, SNR2.
    122121</p>
    123122<p>
     
    164163  int    GPSWeek;     // Week of GPS-Time
    165164  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)
    167167  double P1;          // P1-code pseudorange (meters)
    168168  double P2;          // P2-code pseudorange (meters)
     
    176176<p><a name="rinex"><h4>B - 5. RINEX</h4></p>
    177177<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>
     178Observations 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>
    179179<p>
    180180FRAN{ddd}{h}.{yy}O<br>
     
    205205</p>
    206206<p>
    207 BNC's RINEX observation files generally contain C1, P1, P2, L1, and L2 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)'.
     207BNC'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)'.
    208208</p>
    209209
     
    283283When 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.
    284284</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 
    294285<p><a name="mountpoints"><h4>B - 6. Mountpoints</h4></p>
    295286<p>
    296287Each 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
     290Streams 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' &nbsp;</td><td>NTRIP broadcaster URL, port, and mountpoint.</td></tr>
     295<tr><td>'decoder' &nbsp;</td><td>Internal decoder used to handle the incoming stream content according to its format; editable.</td></tr>
     296<tr><td>'lat' &nbsp;</td><td>Latitude of reference station, degrees, north; editable for VRS streams.</td></tr>
     297<tr><td>'long' &nbsp;</td><td>Longitude of reference station, degrees, east; editable for VRS streams.</td></tr>
     298<tr><td>'type' &nbsp;</td><td>Mountpoint refers to physical Reference Station (RS) or Virtual Reference Station (VRS).</td></tr>
     299<tr><td>'bytes' &nbsp;</td><td>Number of bytes retrieved.
     300</table>
    298301
    299302<p><a name="AddMounts"><h4>B - 6.1 Add Mountpoints</h4></p>
     
    325328
    326329<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>
     332BNC 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>
     335BNC 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>
    330338
    331339<p><a name="log"><h4>B - 7. Log - optional</h4></p>
     
    358366</li>
    359367<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.
     368So far BNC only handles GPS and GLONASS data while ignoring Galileo.
     369</li>
     370<li>
     371BNC'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.
    364372</li>
    365373<li>
     
    367375</li>
    368376<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).
     377If 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>
     380As a consequence of the current implementation of the RTIGS format and transport protocol, streams coming in that format contain only GPS data.
    370381</li>
    371382<li>
  • trunk/BNC/bncmain.cpp

    r356 r366  
    119119      QUrl url(hlp[0]);
    120120      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);
    122125      app.connect(getThread, SIGNAL(newMessage(const QByteArray&)),
    123126                  &app, SLOT(slotMessage(const QByteArray&)));
  • trunk/BNC/bncrinex.cpp

    r356 r366  
    6262////////////////////////////////////////////////////////////////////////////
    6363bncRinex::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) {
    6566  _statID        = StatID;
    6667  _mountPoint    = mountPoint;
    6768  _format        = format.left(6);
     69  _latitude      = latitude;
     70  _longitude     = longitude;
     71  _nmea          = nmea;
    6872  _headerWritten = false;
    6973
     
    145149      const int timeOut = 10*1000;
    146150      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);
    148155
    149156      if (socket) {
     
    154161            line.chop(1);
    155162            if (line.indexOf("RINEX VERSION") != -1) {
    156               _headerLines.append("     2.10           OBSERVATION DATA"
     163              _headerLines.append("     2.11           OBSERVATION DATA"
    157164                                  "    M (MIXED)"
    158165                                  "           RINEX VERSION / TYPE");
     
    294301
    295302  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;}
    301303
    302304  // Open the Output File
     
    332334      }
    333335      else if (line.indexOf("# / TYPES OF OBSERV") != -1) {
    334         _out << "     5    C1    P1    P2    L1    L2"
    335                 "                        # / TYPES OF OBSERV"  << endl;
     336        _out << "     6    C1    C2    P1    P2    L1    L2"
     337                "                  # / TYPES OF OBSERV"  << endl;
    336338      }
    337339      else if (line.indexOf("TIME OF FIRST OBS") != -1) {
     
    342344                      _mountPoint.path())).leftJustified(60, ' ', true);
    343345        _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;
    346346      }
    347347      else {
     
    357357    double antennaNEU[3]; antennaNEU[0] = antennaNEU[1] = antennaNEU[2] = 0.0;
    358358   
    359     _out << "     2.10           OBSERVATION DATA    M (MIXED)           RINEX VERSION / TYPE" << endl;
     359    _out << "     2.11           OBSERVATION DATA    M (MIXED)           RINEX VERSION / TYPE" << endl;
    360360    QString hlp = QDate::currentDate().toString("dd-MMM-yyyy").leftJustified(20, ' ', true);
    361361    _out << _pgmName.toAscii().data() << _userName.toAscii().data()
     
    380380         << "                  "                                     << "ANTENNA: DELTA H/E/N" << endl;
    381381    _out << "     1     1                                                WAVELENGTH FACT L1/2" << endl;
    382     _out << "     5    C1    P1    P2    L1    L2                        # / TYPES OF OBSERV"  << endl;
     382    _out << "     6    C1    C2    P1    P2    L1    L2                  # / TYPES OF OBSERV"  << endl;
    383383        _out << datTim.toString("  yyyy    MM    dd"
    384384                                "    hh    mm   ss.zzz0000").toAscii().data();
     
    387387          _mountPoint.path())).leftJustified(60, ' ', true);
    388388    _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
    391394    _out << "                                                            END OF HEADER"        << endl;
    392395  }
     
    469472    char snr = ' ';
    470473    _out << setw(14) << setprecision(3) << ob->C1 << lli << snr;
     474    _out << setw(14) << setprecision(3) << ob->C2 << lli << snr;
    471475    _out << setw(14) << setprecision(3) << ob->P1 << lli << snr;
    472476    _out << setw(14) << setprecision(3) << ob->P2 << lli << snr;
    473477    _out << setw(14) << setprecision(3) << ob->L1 << lli
    474          << setw(1) << ob->SNR1;
     478         << setw(1) << ob->SNR1 << endl;
    475479    _out << setw(14) << setprecision(3) << ob->L2 << lli
    476480         << setw(1) << ob->SNR2;
  • trunk/BNC/bncrinex.h

    r336 r366  
    3939 public:
    4040   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);
    4243   ~bncRinex();
    4344   void deepCopy(const Observation* obs);
     
    6364   QString             _sklName;
    6465   QByteArray          _format;
     66   QByteArray          _latitude;
     67   QByteArray          _longitude;
     68   QByteArray          _nmea;
    6569};
    6670
  • trunk/BNC/bnctabledlg.cpp

    r299 r366  
    8787  _buttonGet = new QPushButton(tr("Get table"), this);
    8888  connect(_buttonGet, SIGNAL(clicked()), this, SLOT(slotGetTable()));
    89 
     89 
    9090  _buttonCancel = new QPushButton(tr("Cancel"), this);
    9191  connect(_buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
     
    142142  const int timeOut = 10*1000;
    143143  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);
    145148
    146149  if (!socket) {
     
    207210  static const QStringList labels = QString("mountpoint,identifier,format,"
    208211    "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,"
    210213    "misc").split(",");
    211214
     
    224227      ++nRow;
    225228      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
    226232        QTableWidgetItem* it = new QTableWidgetItem(columns[ic+1]);
    227233        it->setFlags(it->flags() & ~Qt::ItemIsEditable);
     
    251257      QTableWidgetItem* item   = _table->item(ir,0);
    252258      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();
    253262      format.replace(" ", "_");
    254263      if (_table->isItemSelected(item)) {
     
    260269        url.setPath(item->text());
    261270
    262         mountPoints->push_back(url.toString() + " " + format);
     271        mountPoints->push_back(url.toString() + " " + format + " " + latitude + " " + longitude + " " + nmea);
    263272      }
    264273    }
  • trunk/BNC/bncwindow.cpp

    r356 r366  
    4747#include "bnchlpdlg.h"
    4848#include "bnchtml.h"
    49 #include "bnctableitem.h" 
     49#include "bnctableitem.h"
    5050
    5151using namespace std;
     
    5757  int ww = QFontMetrics(this->font()).width('w');
    5858 
    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);
    6362  setWindowTitle(tr("BKG Ntrip Client (BNC), Version 1.1b"));
    6463
     
    163162  _rnxSamplSpinBox->setSuffix(" sec");
    164163  _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);
    170165  _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);
    171170  _mountPointsTable->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
    172171  _mountPointsTable->horizontalHeader()->setStretchLastSection(true);
     
    186185    QStringList hlp = it.next().split(" ");
    187186    if (hlp.size() <= 1) continue;
     187    if (hlp.size() == 2) continue; // For downward compatibility
    188188    _mountPointsTable->insertRow(iRow);
    189189
     
    191191
    192192    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]);
    194195
    195196    QTableWidgetItem* it;
     
    205206    _mountPointsTable->setItem(iRow, 2, it);
    206207
     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
    207226    bncTableItem* bncIt = new bncTableItem();
    208227    bncIt->setFlags(bncIt->flags() & ~Qt::ItemIsEditable);
    209     _mountPointsTable->setItem(iRow, 3, bncIt);
     228    _mountPointsTable->setItem(iRow, 6, bncIt);
    210229
    211230    iRow++;
     
    252271
    253272  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);
    258273
    259274  layout->addWidget(_mountPointsTable,                           9, 0, 1, 5);
     
    332347    QUrl    url(hlp[0]);
    333348    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]);
    335351
    336352    _mountPointsTable->insertRow(iRow);
     
    348364    _mountPointsTable->setItem(iRow, 2, it);
    349365
     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
    350384    bncTableItem* bncIt = new bncTableItem();
    351     _mountPointsTable->setItem(iRow, 3, bncIt);
     385    _mountPointsTable->setItem(iRow, 6, bncIt);
    352386
    353387    iRow++;
     
    377411  settings.setValue("rnxAppend",   _rnxAppendCheckBox->checkState());
    378412  settings.setValue("logFile",     _logFileLineEdit->text());
    379   settings.setValue("approxLat",   _LatLineEdit->text());
    380   settings.setValue("approxLon",   _LonLineEdit->text());
    381413 
    382414QStringList mountPoints;
     
    387419
    388420    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());
    390425  }
    391426  settings.setValue("mountPoints", mountPoints);
     
    431466    QByteArray format = _mountPointsTable->item(iRow, 2)->text().toAscii();
    432467
    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);
    434473
    435474    connect(getThread, SIGNAL(newMessage(const QByteArray&)),
     
    439478
    440479    connect(getThread, SIGNAL(newObs(const QByteArray&, Observation*)),
    441             (bncTableItem*) _mountPointsTable->item(iRow, 3),
     480            (bncTableItem*) _mountPointsTable->item(iRow, 6),
    442481            SLOT(slotNewObs(const QByteArray&, Observation*)));
    443482
Note: See TracChangeset for help on using the changeset viewer.