source: ntrip/trunk/rtcm3torinex/lib/rtcm3torinexsupport.cpp@ 4433

Last change on this file since 4433 was 4433, checked in by mervart, 12 years ago
  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1/*
2 Converter for RTCM3 data to RINEX.
3 $Id: rtcm3torinexsupport.cpp 4433 2012-07-24 15:49:08Z mervart $
4 Copyright (C) 2005-2012 by Dirk Stöcker <stoecker@alberding.eu>
5
6 This software is a complete NTRIP-RTCM3 to RINEX converter as well as
7 a module of the BNC tool for multiformat conversion. Contact Dirk
8 Stöcker for suggestions and bug reports related to the RTCM3 to RINEX
9 conversion problems and the author of BNC for all the other problems.
10
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 or read http://www.gnu.org/licenses/gpl.txt
25*/
26
27int rrinex3codetoentry(const char *code)
28{
29 int res = 0;
30 switch(code[0])
31 {
32 case 'C': res += GNSSENTRY_CODE; break;
33 case 'L': res += GNSSENTRY_PHASE; break;
34 case 'D': res += GNSSENTRY_DOPPLER; break;
35 case 'S': res += GNSSENTRY_SNR; break;
36 default:
37 return -1;
38 }
39 switch(code[1])
40 {
41 case '1':
42 switch(code[2])
43 {
44 default:
45 case 'C': res += GNSSENTRY_TYPEC1; break;
46 case 'P': case'W': case 'Y': res += GNSSENTRY_TYPEP1; break;
47 case 'A': case'B':
48 case 'S': case'L': case 'X': res += GNSSENTRY_TYPEC1N; break;
49 case 'Z': res += GNSSENTRY_TYPECSAIF; break;
50 }
51 break;
52 case '2':
53 switch(code[2])
54 {
55 default:
56 case 'P': case 'W': case 'Y': res += GNSSENTRY_TYPEP2; break;
57 case 'C': case 'S': case 'L': case 'X': res += GNSSENTRY_TYPEC2; break;
58 }
59 break;
60 case '5':
61 res += GNSSENTRY_TYPEC5;
62 break;
63 case '6':
64 res += GNSSENTRY_TYPEC6;
65 break;
66 case '7':
67 res += GNSSENTRY_TYPEC5B;
68 break;
69 case '8':
70 res += GNSSENTRY_TYPEC5AB;
71 break;
72 }
73 return res;
74}
75
76std::string entry2rinexcode(const char* codetype[GNSS_MAXSATS][GNSSENTRY_NUMBER],
77 int iSat, int iEntry) {
78 char str[3];
79 switch(iEntry&3) {
80 case GNSSENTRY_CODE: str[0] = 'C'; break;
81 case GNSSENTRY_PHASE: str[0] = 'L'; break;
82 case GNSSENTRY_DOPPLER: str[0] = 'D'; break;
83 case GNSSENTRY_SNR: str[0] = 'S'; break;
84 }
85 str[1] = codetype[iSat][iEntry][0];
86 str[2] = codetype[iSat][iEntry][1];
87 return std::string(str);
88}
Note: See TracBrowser for help on using the repository browser.