Changeset 6604 in ntrip
- Timestamp:
- Feb 20, 2015, 12:28:49 PM (10 years ago)
- Location:
- trunk/rtcm3torinex/lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/rtcm3torinex/lib/rtcm3torinex.c
r6599 r6604 2626 2626 while((r = RTCM3Parser(Parser))) 2627 2627 { 2628 double ver = Parser->rinex3 ? 3.02 : 2.11; 2628 2629 if(r == 1020 || r == RTCM3ID_BDS || r == 1019 || r == 1044 || r == 1043) 2629 2630 { 2630 2631 FILE *file = 0; 2631 2632 2632 if(Parser->rinex3 && !(file = Parser->gpsfile)) 2633 { 2634 const char *n = Parser->gpsephemeris ? Parser->gpsephemeris 2635 : Parser->qzssephemeris ? Parser->qzssephemeris : Parser->glonassephemeris; 2636 if(n) 2637 { 2638 if(!(Parser->gpsfile = fopen(n, "w"))) 2633 if(Parser->mixedephemeris) 2634 { 2635 if(Parser->mixedephemeris != (const char *)1) 2636 { 2637 if(!(Parser->mixedfile = fopen(Parser->mixedephemeris, "w"))) 2639 2638 { 2640 2639 RTCM3Error("Could not open ephemeris output file.\n"); … … 2643 2642 { 2644 2643 char buffer[100]; 2645 fprintf(Parser-> gpsfile,2646 "%9.2f%11sN: GNSS NAV DATA M: Mixed%12sRINEX VERSION / TYPE\n", 3.0, "", "");2644 fprintf(Parser->mixedfile, 2645 "%9.2f%11sN: GNSS NAV DATA M: Mixed%12sRINEX VERSION / TYPE\n", ver, "", ""); 2647 2646 HandleRunBy(buffer, sizeof(buffer), 0, Parser->rinex3); 2648 fprintf(Parser->gpsfile, "%s\n%60sEND OF HEADER\n", buffer, ""); 2649 } 2650 Parser->qzssephemeris = 0; 2651 Parser->gpsephemeris = 0; 2652 Parser->glonassephemeris = 0; 2653 Parser->sbasephemeris = 0; 2654 file = Parser->gpsfile; 2655 } 2647 fprintf(Parser->mixedfile, "%s\n%60sEND OF HEADER\n", buffer, ""); 2648 } 2649 Parser->mixedephemeris = (const char *)1; 2650 } 2651 file = Parser->mixedfile; 2656 2652 } 2657 2653 else … … 2669 2665 char buffer[100]; 2670 2666 fprintf(Parser->glonassfile, 2671 "%9.2f%11sG: GLONASS NAV DATA%21sRINEX VERSION / TYPE\n", 2.1, "", "");2667 "%9.2f%11sG: GLONASS NAV DATA%21sRINEX VERSION / TYPE\n", ver, "", ""); 2672 2668 HandleRunBy(buffer, sizeof(buffer), 0, Parser->rinex3); 2673 2669 fprintf(Parser->glonassfile, "%s\n%60sEND OF HEADER\n", buffer, ""); … … 2689 2685 char buffer[100]; 2690 2686 fprintf(Parser->gpsfile, 2691 "%9.2f%11sN: GPS NAV DATA%25sRINEX VERSION / TYPE\n", 2.1, "", "");2687 "%9.2f%11sN: GPS NAV DATA%25sRINEX VERSION / TYPE\n", ver, "", ""); 2692 2688 HandleRunBy(buffer, sizeof(buffer), 0, Parser->rinex3); 2693 2689 fprintf(Parser->gpsfile, "%s\n%60sEND OF HEADER\n", buffer, ""); … … 2709 2705 char buffer[100]; 2710 2706 fprintf(Parser->sbasfile, 2711 "%9.2f%11sN: SBAS NAV DATA%24sRINEX VERSION / TYPE\n", 2.1, "", "");2707 "%9.2f%11sN: SBAS NAV DATA%24sRINEX VERSION / TYPE\n", ver, "", ""); 2712 2708 HandleRunBy(buffer, sizeof(buffer), 0, Parser->rinex3); 2713 2709 fprintf(Parser->sbasfile, "%s\n%60sEND OF HEADER\n", buffer, ""); … … 2729 2725 char buffer[100]; 2730 2726 fprintf(Parser->qzssfile, 2731 "%9.2f%11sN: QZSS NAV DATA%24sRINEX VERSION / TYPE\n", 2.1, "", "");2727 "%9.2f%11sN: QZSS NAV DATA%24sRINEX VERSION / TYPE\n", ver, "", ""); 2732 2728 HandleRunBy(buffer, sizeof(buffer), 0, Parser->rinex3); 2733 2729 fprintf(Parser->qzssfile, "%s\n%60sEND OF HEADER\n", buffer, ""); … … 2749 2745 char buffer[100]; 2750 2746 fprintf(Parser->bdsfile, 2751 "%9.2f%11sN: BDS NAV DATA%25sRINEX VERSION / TYPE\n", 2.1, "", "");2747 "%9.2f%11sN: BDS NAV DATA%25sRINEX VERSION / TYPE\n", ver, "", ""); 2752 2748 HandleRunBy(buffer, sizeof(buffer), 0, Parser->rinex3); 2753 2749 fprintf(Parser->bdsfile, "%s\n%60sEND OF HEADER\n", buffer, ""); … … 2837 2833 sep = " "; 2838 2834 } 2839 else 2835 else /* actually this is never used, as BDS is undefined for 2.x */ 2840 2836 { 2841 2837 ConvLine(file, … … 3524 3520 const char *glonassephemeris; 3525 3521 const char *bdsephemeris; 3522 const char *mixedephemeris; 3526 3523 }; 3527 3524 … … 3544 3541 { "glonassephemeris", required_argument, 0, 'G'}, 3545 3542 { "sbasephemeris", required_argument, 0, 'B'}, 3543 { "mixedephemeris", required_argument, 0, 'P'}, 3546 3544 { "rinex3", no_argument, 0, '3'}, 3547 3545 { "changeobs", no_argument, 0, 'O'}, … … 3553 3551 {0,0,0,0}}; 3554 3552 #endif 3555 #define ARGOPT "-d:s:p:r:t:f:u:E:C:G:B: Q:M:S:R:n:h3O"3553 #define ARGOPT "-d:s:p:r:t:f:u:E:C:G:B:P:Q:M:S:R:n:h3O" 3556 3554 3557 3555 enum MODE { HTTP = 1, RTSP = 2, NTRIP1 = 3, AUTO = 4, END }; … … 3687 3685 args->glonassephemeris = 0; 3688 3686 args->bdsephemeris = 0; 3687 args->mixedephemeris = 0; 3689 3688 args->rinex3 = 0; 3690 3689 args->nmea = 0; … … 3714 3713 case 'G': args->glonassephemeris = optarg; break; 3715 3714 case 'Q': args->qzssephemeris = optarg; break; 3715 case 'P': args->mixedephemeris = optarg; break; 3716 3716 case 'r': args->port = optarg; break; 3717 3717 case '3': args->rinex3 = 1; break; … … 3769 3769 datestr[10] = 0; 3770 3770 3771 if(args-> gpsephemeris && args->glonassephemeris &&args->rinex3)3771 if(args->mixedephemeris && !args->rinex3) 3772 3772 { 3773 RTCM3Error("RINEX3 produces a combined ephemeris file, but 2 files were specified.\n" 3773 RTCM3Error("RINEX2 cannot created combined ephemeris file.\n"); 3774 res = 0; 3775 } 3776 else if(args->mixedephemeris && (args->gpsephemeris || args->glonassephemeris 3777 || args->bdsephemeris || args->qzssephemeris || args->sbasephemeris)) 3778 { 3779 RTCM3Error("Combined ephemeris file specified with another one.\n" 3774 3780 "Please specify only one navigation file.\n"); 3781 res = 0; 3782 } 3783 else if(args->bdsephemeris && !args->rinex3) 3784 { 3785 RTCM3Error("RINEX2 cannot produce BDS ephemeris.\n"); 3775 3786 res = 0; 3776 3787 } … … 3791 3802 " -Q " LONG_OPT("--qzssephemeris ") "output file for QZSS ephemeris data\n" 3792 3803 " -B " LONG_OPT("--sbasephemeris ") "output file for SBAS ephemeris data\n" 3804 " -P " LONG_OPT("--mixedephemeris ") "output file for all ephemeris data\n" 3793 3805 " -3 " LONG_OPT("--rinex3 ") "output RINEX type 3 data\n" 3794 3806 " -S " LONG_OPT("--proxyhost ") "proxy name or address\n" … … 3898 3910 Parser.qzssephemeris = args.qzssephemeris; 3899 3911 Parser.sbasephemeris = args.sbasephemeris; 3912 Parser.mixedephemeris = args.mixedephemeris; 3900 3913 Parser.rinex3 = args.rinex3; 3901 3914 Parser.changeobs = args.changeobs; -
trunk/rtcm3torinex/lib/rtcm3torinex.h
r6599 r6604 552 552 const char * sbasephemeris; 553 553 const char * bdsephemeris; 554 const char * mixedephemeris; 554 555 FILE * glonassfile; 555 556 FILE * gpsfile; … … 557 558 FILE * sbasfile; 558 559 FILE * bdsfile; 560 FILE * mixedfile; 559 561 }; 560 562
Note:
See TracChangeset
for help on using the changeset viewer.