[4417] | 1 | /*
|
---|
| 2 | Converter for RTCM3 data to RINEX.
|
---|
| 3 | $Id: rtcm3torinexsupport.c 4438 2012-07-24 16:07:02Z 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 |
|
---|
[4438] | 27 | #include "rtcm3torinex.h"
|
---|
[4436] | 28 |
|
---|
[4417] | 29 | int rrinex3codetoentry(const char *code)
|
---|
| 30 | {
|
---|
| 31 | int res = 0;
|
---|
| 32 | switch(code[0])
|
---|
| 33 | {
|
---|
| 34 | case 'C': res += GNSSENTRY_CODE; break;
|
---|
| 35 | case 'L': res += GNSSENTRY_PHASE; break;
|
---|
| 36 | case 'D': res += GNSSENTRY_DOPPLER; break;
|
---|
| 37 | case 'S': res += GNSSENTRY_SNR; break;
|
---|
| 38 | default:
|
---|
| 39 | return -1;
|
---|
| 40 | }
|
---|
| 41 | switch(code[1])
|
---|
| 42 | {
|
---|
| 43 | case '1':
|
---|
| 44 | switch(code[2])
|
---|
| 45 | {
|
---|
| 46 | default:
|
---|
| 47 | case 'C': res += GNSSENTRY_TYPEC1; break;
|
---|
| 48 | case 'P': case'W': case 'Y': res += GNSSENTRY_TYPEP1; break;
|
---|
| 49 | case 'A': case'B':
|
---|
| 50 | case 'S': case'L': case 'X': res += GNSSENTRY_TYPEC1N; break;
|
---|
| 51 | case 'Z': res += GNSSENTRY_TYPECSAIF; break;
|
---|
| 52 | }
|
---|
| 53 | break;
|
---|
| 54 | case '2':
|
---|
| 55 | switch(code[2])
|
---|
| 56 | {
|
---|
| 57 | default:
|
---|
| 58 | case 'P': case 'W': case 'Y': res += GNSSENTRY_TYPEP2; break;
|
---|
| 59 | case 'C': case 'S': case 'L': case 'X': res += GNSSENTRY_TYPEC2; break;
|
---|
| 60 | }
|
---|
| 61 | break;
|
---|
| 62 | case '5':
|
---|
| 63 | res += GNSSENTRY_TYPEC5;
|
---|
| 64 | break;
|
---|
| 65 | case '6':
|
---|
| 66 | res += GNSSENTRY_TYPEC6;
|
---|
| 67 | break;
|
---|
| 68 | case '7':
|
---|
| 69 | res += GNSSENTRY_TYPEC5B;
|
---|
| 70 | break;
|
---|
| 71 | case '8':
|
---|
| 72 | res += GNSSENTRY_TYPEC5AB;
|
---|
| 73 | break;
|
---|
| 74 | }
|
---|
[4420] | 75 | return res;
|
---|
[4417] | 76 | }
|
---|