1 | // Part of BNC, a utility for retrieving decoding and
|
---|
2 | // converting GNSS data streams from NTRIP broadcasters.
|
---|
3 | //
|
---|
4 | // Copyright (C) 2007
|
---|
5 | // German Federal Agency for Cartography and Geodesy (BKG)
|
---|
6 | // http://www.bkg.bund.de
|
---|
7 | // Czech Technical University Prague, Department of Geodesy
|
---|
8 | // http://www.fsv.cvut.cz
|
---|
9 | //
|
---|
10 | // Email: euref-ip@bkg.bund.de
|
---|
11 | //
|
---|
12 | // This program is free software; you can redistribute it and/or
|
---|
13 | // modify it under the terms of the GNU General Public License
|
---|
14 | // as published by the Free Software Foundation, version 2.
|
---|
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 |
|
---|
25 | #include <string>
|
---|
26 |
|
---|
27 | #ifndef BNCCONST_H
|
---|
28 | #define BNCCONST_H
|
---|
29 |
|
---|
30 | enum t_irc {failure = -1, success, fatal}; // return code
|
---|
31 |
|
---|
32 | class t_frequency {
|
---|
33 | public:
|
---|
34 | enum type {dummy = 0,
|
---|
35 | // GPS
|
---|
36 | G1,
|
---|
37 | G2,
|
---|
38 | G5,
|
---|
39 | // GLONASS
|
---|
40 | R1, // G1
|
---|
41 | // R1a,// G1a / 1600.995
|
---|
42 | R2, // G2
|
---|
43 | // R2a,// G1b / 1248.06
|
---|
44 | R3, // G3 / 1202.025
|
---|
45 | // Galileo
|
---|
46 | E1, // E1 / 1575.42
|
---|
47 | E5, // E5a / 1176.45
|
---|
48 | E7, // E5b / 1207.140
|
---|
49 | E8, // E5(E5a+E5b) / 1191.795
|
---|
50 | E6, // E6 / 1278.75
|
---|
51 | // QZSS
|
---|
52 | J1, // 1575.42
|
---|
53 | J2, // 1227.60
|
---|
54 | J5, // 1176.45
|
---|
55 | J6, // 1278.75
|
---|
56 | // BDS
|
---|
57 | C2, // 1561.098
|
---|
58 | C1, // 1575.42
|
---|
59 | C5, // 1176.45
|
---|
60 | C7, // 1207.14
|
---|
61 | C6, // 1268.52
|
---|
62 | // IRNSS
|
---|
63 | I5, // 1176.45
|
---|
64 | I9, // 2492.028
|
---|
65 | // SBAS
|
---|
66 | S1, // 1575.42
|
---|
67 | S5, // 1176.45
|
---|
68 | max};
|
---|
69 |
|
---|
70 | static std::string toString(type tt) {
|
---|
71 | // GPS
|
---|
72 | if (tt == G1) return "G1";
|
---|
73 | else if (tt == G2) return "G2";
|
---|
74 | else if (tt == G5) return "G5";
|
---|
75 | // GLONASS
|
---|
76 | else if (tt == R1) return "R1";
|
---|
77 | // else if (tt == R1a) return "R5";
|
---|
78 | else if (tt == R2) return "R2";
|
---|
79 | // else if (tt == R2a) return "R7";
|
---|
80 | else if (tt == R3) return "R3";
|
---|
81 | // Galileo
|
---|
82 | else if (tt == E1) return "E1";
|
---|
83 | else if (tt == E5) return "E5";
|
---|
84 | else if (tt == E6) return "E6";
|
---|
85 | else if (tt == E7) return "E7";
|
---|
86 | else if (tt == E8) return "E8";
|
---|
87 | // QZSS
|
---|
88 | else if (tt == J1) return "J1";
|
---|
89 | else if (tt == J2) return "J2";
|
---|
90 | else if (tt == J5) return "J5";
|
---|
91 | else if (tt == J6) return "J6";
|
---|
92 | // BDS
|
---|
93 | else if (tt == C2) return "C2";
|
---|
94 | else if (tt == C1) return "C1";
|
---|
95 | else if (tt == C5) return "C5";
|
---|
96 | else if (tt == C7) return "C7";
|
---|
97 | else if (tt == C6) return "C6";
|
---|
98 | // IRNSS
|
---|
99 | else if (tt == I5) return "I5";
|
---|
100 | else if (tt == I9) return "I9";
|
---|
101 | // SBAS
|
---|
102 | else if (tt == S1) return "S1";
|
---|
103 | else if (tt == S5) return "S5";
|
---|
104 | return std::string();
|
---|
105 | }
|
---|
106 | static enum type toInt(std::string s) {
|
---|
107 | // GPS
|
---|
108 | if (s == "G1") return G1;
|
---|
109 | else if (s == "G2") return G2;
|
---|
110 | else if (s == "G5") return G5;
|
---|
111 | // GLONASS
|
---|
112 | else if (s == "R1") return R1;
|
---|
113 | else if (s == "R2") return R2;
|
---|
114 | else if (s == "R3") return R3;
|
---|
115 | // Galileo
|
---|
116 | else if (s == "E1") return E1;
|
---|
117 | else if (s == "E5") return E5;
|
---|
118 | else if (s == "E6") return E6;
|
---|
119 | else if (s == "E7") return E7;
|
---|
120 | else if (s == "E8") return E8;
|
---|
121 | // QZSS
|
---|
122 | else if (s == "J1") return J1;
|
---|
123 | else if (s == "J2") return J2;
|
---|
124 | else if (s == "J5") return J5;
|
---|
125 | else if (s == "J6") return J6;
|
---|
126 | // BDS
|
---|
127 | else if (s == "C2") return C2;
|
---|
128 | else if (s == "C1") return C1;
|
---|
129 | else if (s == "C5") return C5;
|
---|
130 | else if (s == "C7") return C7;
|
---|
131 | else if (s == "C6") return C6;
|
---|
132 | // IRNSS
|
---|
133 | else if (s == "I5") return I5;
|
---|
134 | else if (s == "I9") return I9;
|
---|
135 | // SBAS
|
---|
136 | else if (s == "S1") return S1;
|
---|
137 | else if (s == "S5") return S5;
|
---|
138 | return type();
|
---|
139 | }
|
---|
140 | };
|
---|
141 |
|
---|
142 | class t_CST {
|
---|
143 | public:
|
---|
144 | static double freq(t_frequency::type fType, int slotNum);
|
---|
145 | static double lambda(t_frequency::type fType, int slotNum);
|
---|
146 |
|
---|
147 | static const double c;
|
---|
148 | static const double omega;
|
---|
149 | static const double aell;
|
---|
150 | static const double fInv;
|
---|
151 | static const double rgeoc;
|
---|
152 | };
|
---|
153 |
|
---|
154 |
|
---|
155 | #endif
|
---|