Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

convrnx: rinex 3.05 and 4 code support #546

Open
wants to merge 1 commit into
base: demo5
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions app/qtapp/rtkconv_qt/convopt.ui
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,26 @@
<string>3.04</string>
</property>
</item>
<item>
<property name="text">
<string>3.05</string>
</property>
</item>
<item>
<property name="text">
<string>4.00</string>
</property>
</item>
<item>
<property name="text">
<string>4.01</string>
</property>
</item>
<item>
<property name="text">
<string>4.02</string>
</property>
</item>
</widget>
</item>
<item>
Expand Down
8 changes: 6 additions & 2 deletions app/winapp/rtkconv/convopt.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ object ConvOptDialog: TConvOptDialog
Style = csDropDownList
ItemIndex = 0
TabOrder = 2
Text = '2.10'
Text = '3.03'
OnChange = RnxVerChange
Items.Strings = (
'2.10'
Expand All @@ -472,7 +472,11 @@ object ConvOptDialog: TConvOptDialog
'3.01'
'3.02'
'3.03'
'3.04')
'3.04'
'3.05'
'4.00'
'4.01'
'4.02')
end
object RnxFile: TCheckBox
Left = 327
Expand Down
48 changes: 35 additions & 13 deletions src/convrnx.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,33 @@ typedef struct { /* stream file type */
static const int navsys[RNX_NUMSYS]={ /* system codes */
SYS_GPS,SYS_GLO,SYS_GAL,SYS_QZS,SYS_SBS,SYS_CMP,SYS_IRN
};
static const char vercode[][MAXCODE]={ /* supported obs-type by RINEX version */
/* 0........1.........2.........3.........4.........5.........6........ */
/* 11111111111112222222222555777666666688822663331155599991555677788444 CODE */
/* CPWYMNSLEABXZCDSLXPWYMNIQXIQXABCXZSLIQXIQIQIQXIQABCABCXDDPZEDPZDPABX */
"00000000...0.0000000000000..........................................", /* GPS */
"00...........0....0..........44.4..........222...................444", /* GLO */
"0........0000..........0000000000...000.............................", /* GAL */
"2.....22...22..222.....222......2422....................4444........", /* QZS */
"0......................000..........................................", /* SBS */
".4...4...4.4.....1.......41114..1.....41111............444..44444...", /* BDS */
".........................3......................3333333............." /* IRN */

// Supported obs-type by RINEX version.
static const char ver3code[][MAXCODE] = {
// 0........1.........2.........3.........4.........5.........6.........7
// 1111111111111222222222255577766666668882266333115559999155567778844466 CODE
// CPWYMNSLEABXZCDSLXPWYMNIQXIQXABCXZSLIQXIQIQIQXIQABCABCXDDPZEDPZDPABXDP
"00000000...0.0000000000000............................................", // GPS
"00...........0....0..........44.4..........222...................444..", // GLO
"0........0000..........0000000000...000...............................", // GAL
"2.....22...22..222.....222......2422....................4444..........", // QZS
"0......................000............................................", // SBS
".4...455.4.45....1.......41114..15....41111............444..44444...55", // BDS
".........................3......................3333333..............." // IRN
};
static const char ver4code[][MAXCODE] = {
// 0........1.........2.........3.........4.........5.........6.........7
// 1111111111111222222222255577766666668882266333115559999155567778844466 CODE
// CPWYMNSLEABXZCDSLXPWYMNIQXIQXABCXZSLIQXIQIQIQXIQABCABCXDDPZEDPZDPABXDP
"00000000...0.0000000000000............................................", // GPS
"00...........0....0..........00.0..........000...................000..", // GLO
"0........0000..........00000000000..000...............................", // GAL
"0.....000.000..000.....000......0000....................0000..........", // QZS
"0......................000............................................", // SBS
".0....00...00....0.......0000...00....00000............000..00000...00", // BDS
".1.........1.............0......................00000001.............." // IRN
};

/* convert RINEX obs-type ver.3 -> ver.2 -------------------------------------*/
static void convcode(int rnxver, int sys, char *type)
{
Expand Down Expand Up @@ -392,8 +407,15 @@ static void setopt_obstype(const uint8_t *codes, const uint8_t *types, int sys,
if (!(opt->freqtype&(1<<idx))||opt->mask[sys][codes[i]-1]=='0') {
continue;
}
if (opt->rnxver>=300) {
ver=vercode[sys][codes[i]-1];
if (opt->rnxver>=400) {
ver=ver4code[sys][codes[i]-1];
if (ver<'0'||ver>'0'+opt->rnxver-400) {
trace(2,"unsupported obs type: rnxver=%.2f sys=%d code=%s\n",
opt->rnxver/100.0,sys,code2obs(codes[i]));
continue;
}
} else if (opt->rnxver>=300) {
ver=ver3code[sys][codes[i]-1];
if (ver<'0'||ver>'0'+opt->rnxver-300) {
trace(2,"unsupported obs type: rnxver=%.2f sys=%d code=%s\n",
opt->rnxver/100.0,sys,code2obs(codes[i]));
Expand Down