From dff33856ebc12a5db88c3f5ce8478eb4e9f2f3cb Mon Sep 17 00:00:00 2001 From: Zilog80 Date: Sun, 13 Feb 2022 22:43:20 +0100 Subject: [PATCH] mod json: time/position reference --- demod/mod/dfm09mod.c | 8 +++++++- demod/mod/imet54mod.c | 7 ++++++- demod/mod/lms6Xmod.c | 5 +++++ demod/mod/m10mod.c | 10 ++++++++-- demod/mod/mXXmod.c | 5 +++++ demod/mod/meisei100mod.c | 10 ++++++++++ demod/mod/mp3h1mod.c | 5 +++++ demod/mod/rs41mod.c | 4 ++++ demod/mod/rs92mod.c | 8 ++++++-- imet/imet1rs_dft.c | 7 ++++++- mk2a/mk2a1680mod.c | 5 +++++ 11 files changed, 67 insertions(+), 7 deletions(-) diff --git a/demod/mod/dfm09mod.c b/demod/mod/dfm09mod.c index 5054c59..b882ccb 100644 --- a/demod/mod/dfm09mod.c +++ b/demod/mod/dfm09mod.c @@ -557,7 +557,7 @@ static float get_Temp4(gpx_t *gpx) { // meas[0..4] // [ 30.0 , 0.82845 , 3.7 ] // [ 35.0 , 0.68991 , 3.6 ] // [ 40.0 , 0.57742 , 3.5 ] -// -> Steinhart–Hart coefficients (polyfit): +// -> Steinhart-Hart coefficients (polyfit): float p0 = 1.09698417e-03, p1 = 2.39564629e-04, p2 = 2.48821437e-06, @@ -941,6 +941,12 @@ static void print_gpx(gpx_t *gpx) { if (gpx->jsn_freq > 0) { printf(", \"freq\": %d", gpx->jsn_freq); } + + // Reference time/position + printf(", \"ref_datetime\": \"%s\"", "UTC" ); // {"GPS", "UTC"} GPS-UTC=leap_sec + printf(", \"ref_position\": \"%s\"", "GPS" ); // {"GPS", "MSL"} GPS=ellipsoid , MSL=geoid + printf(", \"diff_GPS_MSL\": %+.2f", -gpx->gps.dMSL ); // MSL = GPS + gps.dMSL + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif diff --git a/demod/mod/imet54mod.c b/demod/mod/imet54mod.c index f66abcd..92ccbf3 100644 --- a/demod/mod/imet54mod.c +++ b/demod/mod/imet54mod.c @@ -552,8 +552,13 @@ static int print_position(gpx_t *gpx, int len, int ecc_frm, int ecc_gps) { } fprintf(stdout, ", \"subtype\": \"%s\"", subtype); // "IMET54"/"IMET50" if (gpx->jsn_freq > 0) { - fprintf(stdout, ", \"freq\": %d", gpx->jsn_freq); + fprintf(stdout, ", \"freq\": %d", gpx->jsn_freq ); } + + // Reference time/position + fprintf(stdout, ", \"ref_datetime\": \"%s\"", "UTC" ); // {"GPS", "UTC"} GPS-UTC=leap_sec + fprintf(stdout, ", \"ref_position\": \"%s\"", "MSL" ); // {"GPS", "MSL"} GPS=ellipsoid , MSL=geoid + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif diff --git a/demod/mod/lms6Xmod.c b/demod/mod/lms6Xmod.c index 80071d3..0dd38b0 100644 --- a/demod/mod/lms6Xmod.c +++ b/demod/mod/lms6Xmod.c @@ -778,6 +778,11 @@ static void print_frame(gpx_t *gpx, int crc_err, int len) { if (gpx->jsn_freq > 0) { printf(", \"freq\": %d", gpx->jsn_freq); } + + // Reference time/position + printf(", \"ref_datetime\": \"%s\"", "GPS" ); // {"GPS", "UTC"} GPS-UTC=leap_sec + printf(", \"ref_position\": \"%s\"", "GPS" ); // {"GPS", "MSL"} GPS=ellipsoid , MSL=geoid + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif diff --git a/demod/mod/m10mod.c b/demod/mod/m10mod.c index 8564aff..b343ca6 100644 --- a/demod/mod/m10mod.c +++ b/demod/mod/m10mod.c @@ -657,7 +657,7 @@ static float get_Temp(gpx_t *gpx) { // [ 30.0 , 4.448 ] // [ 35.0 , 3.704 ] // [ 40.0 , 3.100 ] -// -> Steinhart–Hart coefficients (polyfit): +// -> Steinhart-Hart coefficients (polyfit): float p0 = 1.07303516e-03, p1 = 2.41296733e-04, p2 = 2.26744154e-06, @@ -753,7 +753,7 @@ static float get_Tntc2(gpx_t *gpx) { // float R25 = 2.2e3; // float b = 3650.0; // B/Kelvin // float T25 = 25.0 + 273.15; // T0=25C, R0=R25=5k -// -> Steinhart–Hart coefficients (polyfit): +// -> Steinhart-Hart coefficients (polyfit): float p0 = 4.42606809e-03, p1 = -6.58184309e-04, p2 = 8.95735557e-05, @@ -1026,6 +1026,12 @@ static int print_pos(gpx_t *gpx, int csOK) { if (gpx->jsn_freq > 0) { fprintf(stdout, ", \"freq\": %d", gpx->jsn_freq); } + + // Reference time/position (M10 time ref UTC only for json) + fprintf(stdout, ", \"ref_datetime\": \"%s\"", "UTC" ); // {"GPS", "UTC"} GPS-UTC=leap_sec + fprintf(stdout, ", \"ref_position\": \"%s\"", "GPS" ); // {"GPS", "MSL"} GPS=ellipsoid , MSL=geoid + fprintf(stdout, ", \"gpsutc_leapsec\": %d", gpx->utc_ofs); // GPS-UTC offset, utc_s = gpx->gpssec - gpx->utc_ofs; + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif diff --git a/demod/mod/mXXmod.c b/demod/mod/mXXmod.c index ad9b986..139c113 100644 --- a/demod/mod/mXXmod.c +++ b/demod/mod/mXXmod.c @@ -842,6 +842,11 @@ static int print_pos(gpx_t *gpx, int bcOK, int csOK) { if (gpx->jsn_freq > 0) { fprintf(stdout, ", \"freq\": %d", gpx->jsn_freq); } + + // Reference time/position + fprintf(stdout, ", \"ref_datetime\": \"%s\"", "GPS" ); // {"GPS", "UTC"} GPS-UTC=leap_sec + fprintf(stdout, ", \"ref_position\": \"%s\"", "GPS" ); // {"GPS", "MSL"} GPS=ellipsoid , MSL=geoid + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif diff --git a/demod/mod/meisei100mod.c b/demod/mod/meisei100mod.c index ad480a7..760b2b0 100644 --- a/demod/mod/meisei100mod.c +++ b/demod/mod/meisei100mod.c @@ -736,6 +736,11 @@ int main(int argc, char **argv) { if (gpx.fq > 0) { // include frequency derived from subframe information if available fprintf(stdout, ", \"tx_frequency\": %.0f", gpx.fq ); } + + // Reference time/position + printf(", \"ref_datetime\": \"%s\"", "UTC" ); // {"GPS", "UTC"} GPS-UTC=leap_sec + printf(", \"ref_position\": \"%s\"", "MSL" ); // {"GPS", "MSL"} GPS=ellipsoid , MSL=geoid + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif @@ -965,6 +970,11 @@ int main(int argc, char **argv) { if (gpx.fq > 0) { // include frequency derived from subframe information if available fprintf(stdout, ", \"tx_frequency\": %.0f", gpx.fq ); } + + // Reference time/position + printf(", \"ref_datetime\": \"%s\"", "UTC" ); // {"GPS", "UTC"} GPS-UTC=leap_sec + printf(", \"ref_position\": \"%s\"", "MSL" ); // {"GPS", "MSL"} GPS=ellipsoid , MSL=geoid + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif diff --git a/demod/mod/mp3h1mod.c b/demod/mod/mp3h1mod.c index 96a9fdd..ccb553c 100644 --- a/demod/mod/mp3h1mod.c +++ b/demod/mod/mp3h1mod.c @@ -677,6 +677,11 @@ static void print_gpx(gpx_t *gpx, int crcOK) { if (gpx->jsn_freq > 0) { printf(", \"freq\": %d", gpx->jsn_freq); } + + // Reference time/position + printf(", \"ref_datetime\": \"%s\"", "UTC" ); // {"GPS", "UTC"} GPS-UTC=leap_sec + printf(", \"ref_position\": \"%s\"", "GPS" ); // {"GPS", "MSL"} GPS=ellipsoid , MSL=geoid + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif diff --git a/demod/mod/rs41mod.c b/demod/mod/rs41mod.c index 3acad6c..18ba452 100644 --- a/demod/mod/rs41mod.c +++ b/demod/mod/rs41mod.c @@ -2088,6 +2088,10 @@ static int print_position(gpx_t *gpx, int ec) { fprintf(stdout, ", \"tx_frequency\": %d", gpx->freq ); } + // Reference time/position + fprintf(stdout, ", \"ref_datetime\": \"%s\"", "GPS" ); // {"GPS", "UTC"} GPS-UTC=leap_sec + fprintf(stdout, ", \"ref_position\": \"%s\"", "GPS" ); // {"GPS", "MSL"} GPS=ellipsoid , MSL=geoid + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif diff --git a/demod/mod/rs92mod.c b/demod/mod/rs92mod.c index 15a3b80..39e6ad2 100644 --- a/demod/mod/rs92mod.c +++ b/demod/mod/rs92mod.c @@ -1516,14 +1516,18 @@ static int print_position(gpx_t *gpx, int ec) { // GPS-Hoehe ueber Ellipsoid if (gpx->jsn_freq > 0) { // rs92-frequency: gpx->freq int fq_kHz = gpx->jsn_freq; //if (gpx->freq > 0) fq_kHz = gpx->freq; // L-band: option.ngp ? - fprintf(stdout, ", \"freq\": %d", fq_kHz); + fprintf(stdout, ", \"freq\": %d", fq_kHz ); } // Include frequency derived from subframe information if available. if (gpx->freq > 0) { - fprintf(stdout, ", \"tx_frequency\": %d", gpx->freq); + fprintf(stdout, ", \"tx_frequency\": %d", gpx->freq ); } + // Reference time/position + fprintf(stdout, ", \"ref_datetime\": \"%s\"", "GPS" ); // {"GPS", "UTC"} GPS-UTC=leap_sec + fprintf(stdout, ", \"ref_position\": \"%s\"", "GPS" ); // {"GPS", "MSL"} GPS=ellipsoid , MSL=geoid + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif diff --git a/imet/imet1rs_dft.c b/imet/imet1rs_dft.c index b1f9621..af1f34e 100644 --- a/imet/imet1rs_dft.c +++ b/imet/imet1rs_dft.c @@ -619,8 +619,13 @@ int print_frame(int len) { fprintf(stdout, ", \"aux\": \"%s\"", gpx.xdata ); } if (gpx.jsn_freq > 0) { - fprintf(stdout, ", \"freq\": %d", gpx.jsn_freq); + fprintf(stdout, ", \"freq\": %d", gpx.jsn_freq ); } + + // Reference time/position + fprintf(stdout, ", \"ref_datetime\": \"%s\"", "GPS" ); // {"GPS", "UTC"} GPS-UTC=leap_sec + fprintf(stdout, ", \"ref_position\": \"%s\"", "MSL" ); // {"GPS", "MSL"} GPS=ellipsoid , MSL=geoid + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif diff --git a/mk2a/mk2a1680mod.c b/mk2a/mk2a1680mod.c index 6856fb9..0933da3 100644 --- a/mk2a/mk2a1680mod.c +++ b/mk2a/mk2a1680mod.c @@ -2012,6 +2012,11 @@ static void print_frame(gpx_t *gpx, int len, dsp_t *dsp) { if (gpx->jsn_freq > 0) { printf(", \"freq\": %d", gpx->jsn_freq); } + + // Reference time/position + printf(", \"ref_datetime\": \"%s\"", "GPS" ); // {"GPS", "UTC"} GPS-UTC=leap_sec + printf(", \"ref_position\": \"%s\"", "GPS" ); // {"GPS", "MSL"} GPS=ellipsoid , MSL=geoid + #ifdef VER_JSN_STR ver_jsn = VER_JSN_STR; #endif