From 84224bbc5664a1f5e4a1c0752094bf074f3639c8 Mon Sep 17 00:00:00 2001 From: oaq Date: Wed, 11 Dec 2024 19:02:56 +1100 Subject: [PATCH] convrnx: rinex 3.05 and 4 code support --- app/qtapp/rtkconv_qt/convopt.ui | 20 ++++++++++++++ app/winapp/rtkconv/convopt.dfm | 8 ++++-- src/convrnx.c | 48 ++++++++++++++++++++++++--------- 3 files changed, 61 insertions(+), 15 deletions(-) diff --git a/app/qtapp/rtkconv_qt/convopt.ui b/app/qtapp/rtkconv_qt/convopt.ui index c4a9a7f36..7b10abf2e 100644 --- a/app/qtapp/rtkconv_qt/convopt.ui +++ b/app/qtapp/rtkconv_qt/convopt.ui @@ -87,6 +87,26 @@ 3.04 + + + 3.05 + + + + + 4.00 + + + + + 4.01 + + + + + 4.02 + + diff --git a/app/winapp/rtkconv/convopt.dfm b/app/winapp/rtkconv/convopt.dfm index 28fdf3944..64eb0f7b0 100644 --- a/app/winapp/rtkconv/convopt.dfm +++ b/app/winapp/rtkconv/convopt.dfm @@ -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' @@ -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 diff --git a/src/convrnx.c b/src/convrnx.c index 503b45159..b2771a6a3 100644 --- a/src/convrnx.c +++ b/src/convrnx.c @@ -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) { @@ -392,8 +407,15 @@ static void setopt_obstype(const uint8_t *codes, const uint8_t *types, int sys, if (!(opt->freqtype&(1<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]));