diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4a209fcaf..62f3cec71 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -351,7 +351,7 @@ set(GNSSSDR_ARMADILLO_LOCAL_VERSION "9.200.x")
set(GNSSSDR_GTEST_LOCAL_VERSION "1.8.1")
set(GNSSSDR_GNSS_SIM_LOCAL_VERSION "master")
set(GNSSSDR_GPSTK_LOCAL_VERSION "2.10.6")
-set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.12")
+set(GNSSSDR_MATIO_LOCAL_VERSION "1.5.13")
diff --git a/conf/front-end-cal.conf b/conf/front-end-cal.conf
index 16bf70407..8a2b55cb5 100644
--- a/conf/front-end-cal.conf
+++ b/conf/front-end-cal.conf
@@ -39,7 +39,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=217
-GNSS-SDR.SUPL_MNS=7
+GNSS-SDR.SUPL_MNC=7
GNSS-SDR.SUPL_LAC=861
GNSS-SDR.SUPL_CI=40184
diff --git a/conf/gnss-sdr.conf b/conf/gnss-sdr.conf
index 4c9ae11a4..353bdb2fd 100644
--- a/conf/gnss-sdr.conf
+++ b/conf/gnss-sdr.conf
@@ -23,7 +23,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf b/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf
index ba96a533e..f437366bf 100644
--- a/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf
+++ b/conf/gnss-sdr_GPS_L1_USRP_X300_realtime.conf
@@ -24,7 +24,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_GPS_L1_USRP_realtime.conf b/conf/gnss-sdr_GPS_L1_USRP_realtime.conf
index b432eb6b2..323feec08 100644
--- a/conf/gnss-sdr_GPS_L1_USRP_realtime.conf
+++ b/conf/gnss-sdr_GPS_L1_USRP_realtime.conf
@@ -23,7 +23,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf b/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf
index 3de8486d8..b2d0604bb 100644
--- a/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf
+++ b/conf/gnss-sdr_GPS_L1_fmcomms2_realtime.conf
@@ -21,7 +21,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_GPS_L1_nsr.conf b/conf/gnss-sdr_GPS_L1_nsr.conf
index 49ae18b56..4b0b05ae2 100644
--- a/conf/gnss-sdr_GPS_L1_nsr.conf
+++ b/conf/gnss-sdr_GPS_L1_nsr.conf
@@ -25,7 +25,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf b/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf
index 82d382a27..dfe6e331a 100644
--- a/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf
+++ b/conf/gnss-sdr_GPS_L1_nsr_twobit_packed.conf
@@ -25,7 +25,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf b/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf
index fa8996dc7..872f56bf4 100644
--- a/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf
+++ b/conf/gnss-sdr_GPS_L1_plutosdr_realtime.conf
@@ -24,7 +24,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf b/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf
index e186f1da7..618341f48 100644
--- a/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf
+++ b/conf/gnss-sdr_GPS_L1_pulse_blanking_gr_complex.conf
@@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf b/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf
index 91b952ad0..4b91a9344 100644
--- a/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf
+++ b/conf/gnss-sdr_GPS_L1_rtl_tcp_realtime.conf
@@ -24,7 +24,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5_1C
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf b/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf
index f3252578b..2cec70e8c 100644
--- a/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf
+++ b/conf/gnss-sdr_GPS_L1_rtlsdr_realtime.conf
@@ -24,7 +24,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf b/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf
index 84753bee7..b58fc57ba 100644
--- a/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf
+++ b/conf/gnss-sdr_GPS_L1_two_bits_cpx.conf
@@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf b/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf
index 6d61e063b..cce644be9 100644
--- a/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf
+++ b/conf/gnss-sdr_GPS_L2C_USRP1_realtime.conf
@@ -23,7 +23,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf b/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf
index 55a84a13e..49868f37a 100644
--- a/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf
+++ b/conf/gnss-sdr_GPS_L2C_USRP_X300_realtime.conf
@@ -23,7 +23,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_Galileo_E5a.conf b/conf/gnss-sdr_Galileo_E5a.conf
index c4df4139f..81dddd613 100644
--- a/conf/gnss-sdr_Galileo_E5a.conf
+++ b/conf/gnss-sdr_Galileo_E5a.conf
@@ -22,7 +22,7 @@ GNSS-SDR.internal_fs_sps=32000000
;GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
;GNSS-SDR.SUPL_gps_acquisition_port=7275
;GNSS-SDR.SUPL_MCC=244
-;GNSS-SDR.SUPL_MNS=5
+;GNSS-SDR.SUPL_MNC=5
;GNSS-SDR.SUPL_LAC=0x59e2
;GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf b/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf
index f66079cb4..26d01617d 100644
--- a/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf
+++ b/conf/gnss-sdr_Galileo_E5a_IFEN_CTTC.conf
@@ -21,7 +21,7 @@ GNSS-SDR.internal_fs_sps=50000000
;GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
;GNSS-SDR.SUPL_gps_acquisition_port=7275
;GNSS-SDR.SUPL_MCC=244
-;GNSS-SDR.SUPL_MNS=5
+;GNSS-SDR.SUPL_MNC=5
;GNSS-SDR.SUPL_LAC=0x59e2
;GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_Hybrid_ishort.conf b/conf/gnss-sdr_Hybrid_ishort.conf
index 55a70b7a2..c634009f3 100644
--- a/conf/gnss-sdr_Hybrid_ishort.conf
+++ b/conf/gnss-sdr_Hybrid_ishort.conf
@@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_bin_file_III_1a.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_bin_file_III_1a.conf
index 7b978be5b..c395a5f3c 100644
--- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_bin_file_III_1a.conf
+++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_bin_file_III_1a.conf
@@ -21,7 +21,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1a.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1a.conf
index bb5d4327e..134bfa457 100644
--- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1a.conf
+++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1a.conf
@@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1b.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1b.conf
index 2ef22b956..9552ebabe 100644
--- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1b.conf
+++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_III_1b.conf
@@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_II_3b.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_II_3b.conf
index 1d7fa6097..f1e5d264b 100644
--- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_II_3b.conf
+++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_II_3b.conf
@@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_I_1b.conf b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_I_1b.conf
index 2072f8c7d..201fff1ab 100644
--- a/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_I_1b.conf
+++ b/conf/gnss-sdr_multichannel_GPS_L1_Flexiband_realtime_I_1b.conf
@@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_multichannel_GPS_L1_L2_Flexiband_realtime_III_1b.conf b/conf/gnss-sdr_multichannel_GPS_L1_L2_Flexiband_realtime_III_1b.conf
index 3094d8c97..48eabee34 100644
--- a/conf/gnss-sdr_multichannel_GPS_L1_L2_Flexiband_realtime_III_1b.conf
+++ b/conf/gnss-sdr_multichannel_GPS_L1_L2_Flexiband_realtime_III_1b.conf
@@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_multichannel_GPS_L1_L2_Galileo_E1B_Flexiband_bin_file_III_1b.conf b/conf/gnss-sdr_multichannel_GPS_L1_L2_Galileo_E1B_Flexiband_bin_file_III_1b.conf
index d27d98d62..7c19ebc2c 100644
--- a/conf/gnss-sdr_multichannel_GPS_L1_L2_Galileo_E1B_Flexiband_bin_file_III_1b.conf
+++ b/conf/gnss-sdr_multichannel_GPS_L1_L2_Galileo_E1B_Flexiband_bin_file_III_1b.conf
@@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf b/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf
index 411a712ab..63746aea4 100644
--- a/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf
+++ b/conf/gnss-sdr_multichannel_GPS_L1_USRP_X300_realtime.conf
@@ -22,7 +22,7 @@ GNSS-SDR.SUPL_1C_ephemeris_port=7275
GNSS-SDR.SUPL_1C_acquisition_server=supl.google.com
GNSS-SDR.SUPL_1C_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b.conf b/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b.conf
index fb6fae1c2..9c2a86def 100644
--- a/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b.conf
+++ b/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b.conf
@@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b_real.conf b/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b_real.conf
index 6d62e65b3..a52349af1 100644
--- a/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b_real.conf
+++ b/conf/gnss-sdr_multichannel_GPS_L2_M_Flexiband_bin_file_III_1b_real.conf
@@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/conf/gnss-sdr_multichannel_all_in_one_Flexiband_bin_file_III_1b.conf b/conf/gnss-sdr_multichannel_all_in_one_Flexiband_bin_file_III_1b.conf
index 50e49f2e9..a3e23b001 100644
--- a/conf/gnss-sdr_multichannel_all_in_one_Flexiband_bin_file_III_1b.conf
+++ b/conf/gnss-sdr_multichannel_all_in_one_Flexiband_bin_file_III_1b.conf
@@ -22,7 +22,7 @@ GNSS-SDR.SUPL_gps_ephemeris_port=7275
GNSS-SDR.SUPL_gps_acquisition_server=supl.google.com
GNSS-SDR.SUPL_gps_acquisition_port=7275
GNSS-SDR.SUPL_MCC=244
-GNSS-SDR.SUPL_MNS=5
+GNSS-SDR.SUPL_MNC=5
GNSS-SDR.SUPL_LAC=0x59e2
GNSS-SDR.SUPL_CI=0x31b0
diff --git a/docs/xml-schemas/README.md b/docs/xml-schemas/README.md
new file mode 100644
index 000000000..e85c643fe
--- /dev/null
+++ b/docs/xml-schemas/README.md
@@ -0,0 +1,34 @@
+# XML Schemas for Assisted GNSS-SDR
+
+GNSS-SDR can read assistance data from [Extensible Markup Language (XML)](https://www.w3.org/XML/) files for faster [Time-To-First-Fix](https://gnss-sdr.org/design-forces/availability/#time-to-first-fix-ttff), and can store navigation data decoded from GNSS signals in the same format. This folder provides XML Schemas which describe those XML files structure.
+
+[XSD (XML Schema Definition)](https://www.w3.org/XML/Schema) is a World Wide Web Consortium (W3C) recommendation that specifies how to formally describe the elements in an XML document.
+
+
+GPS L1 C/A
+----------
+
+ - [ephemeris_map.xsd](./ephemeris_map.xsd) - GPS NAV message ephemeris parameters.
+ - [iono_model.xsd](./iono_model.xsd) - GPS NAV message ionospheric model parameters.
+ - [utc_model.xsd](./utc_model.xsd) - GPS NAV message UTC model parameters.
+ - [gps_almanac_map.xsd](./gps_almanac_map.xsd) - GPS NAV message almanac.
+
+
+GPS L2C and L5
+--------------
+
+ - [cnav_ephemeris_map.xsd](./cnav_ephemeris_map.xsd) - GPS CNAV message ephemeris parameters.
+
+
+Galileo
+-------
+
+ - [gal_ephemeris_map.xsd](./gal_ephemeris_map.xsd) - Galileo ephemeris parameters.
+ - [gal_iono_model.xsd](./gal_iono_model.xsd) - Galileo ionospheric model parameters.
+ - [gal_utc_model.xsd](./gal_utc_model.xsd) - Galileo UTC model parameters.
+ - [gal_almanac_map.xsd](./gal_almanac_map.xsd) - Galileo almanac.
+
+-------
+
+Please check https://gnss-sdr.org/docs/sp-blocks/global-parameters/ for more information about the usage of XML files in GNSS-SDR.
+
diff --git a/docs/xml-schemas/cnav_ephemeris_map.xsd b/docs/xml-schemas/cnav_ephemeris_map.xsd
new file mode 100644
index 000000000..139756f36
--- /dev/null
+++ b/docs/xml-schemas/cnav_ephemeris_map.xsd
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/xml-schemas/ephemeris_map.xsd b/docs/xml-schemas/ephemeris_map.xsd
new file mode 100644
index 000000000..f76c5e900
--- /dev/null
+++ b/docs/xml-schemas/ephemeris_map.xsd
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/xml-schemas/gal_almanac_map.xsd b/docs/xml-schemas/gal_almanac_map.xsd
new file mode 100644
index 000000000..887caf064
--- /dev/null
+++ b/docs/xml-schemas/gal_almanac_map.xsd
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/xml-schemas/gal_ephemeris_map.xsd b/docs/xml-schemas/gal_ephemeris_map.xsd
new file mode 100644
index 000000000..06c541af5
--- /dev/null
+++ b/docs/xml-schemas/gal_ephemeris_map.xsd
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/xml-schemas/gal_iono_model.xsd b/docs/xml-schemas/gal_iono_model.xsd
new file mode 100644
index 000000000..dc0219273
--- /dev/null
+++ b/docs/xml-schemas/gal_iono_model.xsd
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/xml-schemas/gal_utc_model.xsd b/docs/xml-schemas/gal_utc_model.xsd
new file mode 100644
index 000000000..a589f94fb
--- /dev/null
+++ b/docs/xml-schemas/gal_utc_model.xsd
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/xml-schemas/gps_almanac_map.xsd b/docs/xml-schemas/gps_almanac_map.xsd
new file mode 100644
index 000000000..5e96b4af1
--- /dev/null
+++ b/docs/xml-schemas/gps_almanac_map.xsd
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/xml-schemas/iono_model.xsd b/docs/xml-schemas/iono_model.xsd
new file mode 100644
index 000000000..26cda74bd
--- /dev/null
+++ b/docs/xml-schemas/iono_model.xsd
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/xml-schemas/utc_model.xsd b/docs/xml-schemas/utc_model.xsd
new file mode 100644
index 000000000..44005a628
--- /dev/null
+++ b/docs/xml-schemas/utc_model.xsd
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/algorithms/PVT/adapters/rtklib_pvt.cc b/src/algorithms/PVT/adapters/rtklib_pvt.cc
index 3e63a19a6..74b2f4c5d 100644
--- a/src/algorithms/PVT/adapters/rtklib_pvt.cc
+++ b/src/algorithms/PVT/adapters/rtklib_pvt.cc
@@ -30,6 +30,7 @@
#include "rtklib_pvt.h"
+#include "pvt_conf.h"
#include "configuration_interface.h"
#include "gnss_sdr_flags.h"
#include
@@ -54,84 +55,86 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
in_streams_(in_streams),
out_streams_(out_streams)
{
+ Pvt_Conf pvt_output_parameters = Pvt_Conf();
// dump parameters
std::string default_dump_filename = "./pvt.dat";
std::string default_nmea_dump_filename = "./nmea_pvt.nmea";
std::string default_nmea_dump_devname = "/dev/tty1";
std::string default_rtcm_dump_devname = "/dev/pts/1";
DLOG(INFO) << "role " << role;
- dump_ = configuration->property(role + ".dump", false);
- dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
+ pvt_output_parameters.dump = configuration->property(role + ".dump", false);
+ pvt_output_parameters.dump_filename = configuration->property(role + ".dump_filename", default_dump_filename);
+ pvt_output_parameters.dump_mat = configuration->property(role + ".dump_mat", true);
// output rate
- int output_rate_ms = configuration->property(role + ".output_rate_ms", 500);
+ pvt_output_parameters.output_rate_ms = configuration->property(role + ".output_rate_ms", 500);
// display rate
- int display_rate_ms = configuration->property(role + ".display_rate_ms", 500);
+ pvt_output_parameters.display_rate_ms = configuration->property(role + ".display_rate_ms", 500);
// NMEA Printer settings
- bool flag_nmea_tty_port = configuration->property(role + ".flag_nmea_tty_port", false);
- std::string nmea_dump_filename = configuration->property(role + ".nmea_dump_filename", default_nmea_dump_filename);
+ pvt_output_parameters.flag_nmea_tty_port = configuration->property(role + ".flag_nmea_tty_port", false);
+ pvt_output_parameters.nmea_dump_filename = configuration->property(role + ".nmea_dump_filename", default_nmea_dump_filename);
std::string nmea_dump_devname = configuration->property(role + ".nmea_dump_devname", default_nmea_dump_devname);
// RINEX version
- int rinex_version = configuration->property(role + ".rinex_version", 3);
+ pvt_output_parameters.rinex_version = configuration->property(role + ".rinex_version", 3);
if (FLAGS_RINEX_version.compare("3.01") == 0)
{
- rinex_version = 3;
+ pvt_output_parameters.rinex_version = 3;
}
else if (FLAGS_RINEX_version.compare("3.02") == 0)
{
- rinex_version = 3;
+ pvt_output_parameters.rinex_version = 3;
}
else if (FLAGS_RINEX_version.compare("3") == 0)
{
- rinex_version = 3;
+ pvt_output_parameters.rinex_version = 3;
}
else if (FLAGS_RINEX_version.compare("2.11") == 0)
{
- rinex_version = 2;
+ pvt_output_parameters.rinex_version = 2;
}
else if (FLAGS_RINEX_version.compare("2.10") == 0)
{
- rinex_version = 2;
+ pvt_output_parameters.rinex_version = 2;
}
else if (FLAGS_RINEX_version.compare("2") == 0)
{
- rinex_version = 2;
+ pvt_output_parameters.rinex_version = 2;
}
- int rinexobs_rate_ms = bc::lcm(configuration->property(role + ".rinexobs_rate_ms", 1000), output_rate_ms);
- int rinexnav_rate_ms = bc::lcm(configuration->property(role + ".rinexnav_rate_ms", 6000), output_rate_ms);
+ pvt_output_parameters.rinexobs_rate_ms = bc::lcm(configuration->property(role + ".rinexobs_rate_ms", 1000), pvt_output_parameters.output_rate_ms);
+ pvt_output_parameters.rinexnav_rate_ms = bc::lcm(configuration->property(role + ".rinexnav_rate_ms", 6000), pvt_output_parameters.output_rate_ms);
// RTCM Printer settings
- bool flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false);
- std::string rtcm_dump_devname = configuration->property(role + ".rtcm_dump_devname", default_rtcm_dump_devname);
- bool flag_rtcm_server = configuration->property(role + ".flag_rtcm_server", false);
- unsigned short rtcm_tcp_port = configuration->property(role + ".rtcm_tcp_port", 2101);
- unsigned short rtcm_station_id = configuration->property(role + ".rtcm_station_id", 1234);
+ pvt_output_parameters.flag_rtcm_tty_port = configuration->property(role + ".flag_rtcm_tty_port", false);
+ pvt_output_parameters.rtcm_dump_devname = configuration->property(role + ".rtcm_dump_devname", default_rtcm_dump_devname);
+ pvt_output_parameters.flag_rtcm_server = configuration->property(role + ".flag_rtcm_server", false);
+ pvt_output_parameters.rtcm_tcp_port = configuration->property(role + ".rtcm_tcp_port", 2101);
+ pvt_output_parameters.rtcm_station_id = configuration->property(role + ".rtcm_station_id", 1234);
// RTCM message rates: least common multiple with output_rate_ms
- int rtcm_MT1019_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1019_rate_ms", 5000), output_rate_ms);
- int rtcm_MT1020_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1020_rate_ms", 5000), output_rate_ms);
- int rtcm_MT1045_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1045_rate_ms", 5000), output_rate_ms);
- int rtcm_MSM_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MSM_rate_ms", 1000), output_rate_ms);
- int rtcm_MT1077_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), output_rate_ms);
- int rtcm_MT1087_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), output_rate_ms);
- int rtcm_MT1097_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), output_rate_ms);
- std::map rtcm_msg_rate_ms;
- rtcm_msg_rate_ms[1019] = rtcm_MT1019_rate_ms;
- rtcm_msg_rate_ms[1020] = rtcm_MT1020_rate_ms;
- rtcm_msg_rate_ms[1045] = rtcm_MT1045_rate_ms;
+ int rtcm_MT1019_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1019_rate_ms", 5000), pvt_output_parameters.output_rate_ms);
+ int rtcm_MT1020_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1020_rate_ms", 5000), pvt_output_parameters.output_rate_ms);
+ int rtcm_MT1045_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1045_rate_ms", 5000), pvt_output_parameters.output_rate_ms);
+ int rtcm_MSM_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MSM_rate_ms", 1000), pvt_output_parameters.output_rate_ms);
+ int rtcm_MT1077_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1077_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
+ int rtcm_MT1087_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1087_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
+ int rtcm_MT1097_rate_ms = bc::lcm(configuration->property(role + ".rtcm_MT1097_rate_ms", rtcm_MSM_rate_ms), pvt_output_parameters.output_rate_ms);
+ //std::map rtcm_msg_rate_ms;
+ pvt_output_parameters.rtcm_msg_rate_ms[1019] = rtcm_MT1019_rate_ms;
+ pvt_output_parameters.rtcm_msg_rate_ms[1020] = rtcm_MT1020_rate_ms;
+ pvt_output_parameters.rtcm_msg_rate_ms[1045] = rtcm_MT1045_rate_ms;
for (int k = 1071; k < 1078; k++) // All GPS MSM
{
- rtcm_msg_rate_ms[k] = rtcm_MT1077_rate_ms;
+ pvt_output_parameters.rtcm_msg_rate_ms[k] = rtcm_MT1077_rate_ms;
}
for (int k = 1081; k < 1088; k++) // All GLONASS MSM
{
- rtcm_msg_rate_ms[k] = rtcm_MT1087_rate_ms;
+ pvt_output_parameters.rtcm_msg_rate_ms[k] = rtcm_MT1087_rate_ms;
}
for (int k = 1091; k < 1098; k++) // All Galileo MSM
{
- rtcm_msg_rate_ms[k] = rtcm_MT1097_rate_ms;
+ pvt_output_parameters.rtcm_msg_rate_ms[k] = rtcm_MT1097_rate_ms;
}
// Infer the type of receiver
@@ -176,47 +179,46 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
int glo_1G_count = configuration->property("Channels_1G.count", 0);
int glo_2G_count = configuration->property("Channels_2G.count", 0);
- unsigned int type_of_receiver = 0;
+ if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 1; // L1
+ if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 2;
+ if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 3; // L5
+ if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 4; // E1
+ if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 5; // E5a
+ if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 6;
- // *******************WARNING!!!!!!!***********
- // GPS L5 only configurable for single frequency, single system at the moment!!!!!!
- if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 1;
- if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 2;
- if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 3;
- if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 4;
- if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 5;
- if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 6;
+ if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 7;
+ if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 8; // L1+L5
+ if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 9; // L1+E1
+ if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 10;
+ if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 11;
+ if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 12;
+ if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 13; // L5+E5a
+ if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 14;
+ if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 15;
+ //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 16;
+ if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 17;
+ if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 18;
+ //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 19;
+ //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) pvt_output_parameters.type_of_receiver = 20;
+ if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 21;
+ //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) pvt_output_parameters.type_of_receiver = 22;
+ if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) pvt_output_parameters.type_of_receiver = 23;
+ if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 24;
+ if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 25;
+ if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 26;
+ if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 27;
+ if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 28;
+ if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 29;
+ if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 30;
+ if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) pvt_output_parameters.type_of_receiver = 31;
- if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 7;
- //if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 8;
- if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 9;
- if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 10;
- if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 11;
- if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 12;
- //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 13;
- if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 14;
- if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 15;
- //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 16;
- if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 17;
- if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 18;
- //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 19;
- //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 20;
- if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 21;
- //if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) type_of_receiver = 22;
- if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 23;
- if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 24;
- if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0)) type_of_receiver = 25;
- if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) type_of_receiver = 26;
- if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) type_of_receiver = 27;
- if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) type_of_receiver = 28;
- if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 29;
- if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 30;
- if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 31;
- //RTKLIB PVT solver options
+ if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) pvt_output_parameters.type_of_receiver = 32; // L1+E1+L5+E5a
+
+ // RTKLIB PVT solver options
// Settings 1
int positioning_mode = -1;
std::string default_pos_mode("Single");
- std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); /* (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h */
+ std::string positioning_mode_str = configuration->property(role + ".positioning_mode", default_pos_mode); // (PMODE_XXX) see src/algorithms/libs/rtklib/rtklib.h
if (positioning_mode_str.compare("Single") == 0) positioning_mode = PMODE_SINGLE;
if (positioning_mode_str.compare("Static") == 0) positioning_mode = PMODE_STATIC;
if (positioning_mode_str.compare("Kinematic") == 0) positioning_mode = PMODE_KINEMA;
@@ -477,8 +479,29 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
rtkinit(&rtk, &rtklib_configuration_options);
+ // Outputs
+ bool default_output_enabled = configuration->property(role + ".output_enabled", true);
+ pvt_output_parameters.output_enabled = default_output_enabled;
+ pvt_output_parameters.rinex_output_enabled = configuration->property(role + ".rinex_output_enabled", default_output_enabled);
+ pvt_output_parameters.gpx_output_enabled = configuration->property(role + ".gpx_output_enabled", default_output_enabled);
+ pvt_output_parameters.geojson_output_enabled = configuration->property(role + ".geojson_output_enabled", default_output_enabled);
+ pvt_output_parameters.kml_output_enabled = configuration->property(role + ".kml_output_enabled", default_output_enabled);
+ pvt_output_parameters.xml_output_enabled = configuration->property(role + ".xml_output_enabled", default_output_enabled);
+ pvt_output_parameters.nmea_output_file_enabled = configuration->property(role + ".nmea_output_file_enabled", default_output_enabled);
+ pvt_output_parameters.rtcm_output_file_enabled = configuration->property(role + ".rtcm_output_file_enabled", default_output_enabled);
+
+ std::string default_output_path = configuration->property(role + ".output_path", std::string("."));
+ pvt_output_parameters.output_path = default_output_path;
+ pvt_output_parameters.rinex_output_path = configuration->property(role + ".rinex_output_path", default_output_path);
+ pvt_output_parameters.gpx_output_path = configuration->property(role + ".gpx_output_path", default_output_path);
+ pvt_output_parameters.geojson_output_path = configuration->property(role + ".geojson_output_path", default_output_path);
+ pvt_output_parameters.kml_output_path = configuration->property(role + ".kml_output_path", default_output_path);
+ pvt_output_parameters.xml_output_path = configuration->property(role + ".xml_output_path", default_output_path);
+ pvt_output_parameters.nmea_output_file_path = configuration->property(role + ".nmea_output_file_path", default_output_path);
+ pvt_output_parameters.rtcm_output_file_path = configuration->property(role + ".rtcm_output_file_path", default_output_path);
+
// make PVT object
- pvt_ = rtklib_make_pvt_cc(in_streams_, dump_, dump_filename_, output_rate_ms, display_rate_ms, flag_nmea_tty_port, nmea_dump_filename, nmea_dump_devname, rinex_version, rinexobs_rate_ms, rinexnav_rate_ms, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_msg_rate_ms, rtcm_dump_devname, type_of_receiver, rtk);
+ pvt_ = rtklib_make_pvt_cc(in_streams_, pvt_output_parameters, rtk);
DLOG(INFO) << "pvt(" << pvt_->unique_id() << ")";
if (out_streams_ > 0)
{
diff --git a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt
index 72ce3f436..adaac0125 100644
--- a/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/PVT/gnuradio_blocks/CMakeLists.txt
@@ -36,6 +36,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/core/receiver
${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs
${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib
+ ${CMAKE_SOURCE_DIR}/src/algorithms/libs
${ARMADILLO_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc
index f055915cc..fe2cce6e1 100644
--- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc
+++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.cc
@@ -29,11 +29,16 @@
*/
#include "rtklib_pvt_cc.h"
+#include "galileo_almanac.h"
+#include "galileo_almanac_helper.h"
+#include "pvt_conf.h"
#include "display.h"
+#include "gnss_sdr_create_directory.h"
#include
#include
#include
#include
+#include
#include
#include
#include
@@ -50,52 +55,15 @@ namespace bc = boost::math;
namespace bc = boost::integer;
#endif
-//includes used by the observables serializarion (export observables for rtklib unit test)
-#include
-#include
-#include
-
using google::LogMessage;
rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels,
- bool dump,
- std::string dump_filename,
- int32_t output_rate_ms,
- int32_t display_rate_ms,
- bool flag_nmea_tty_port,
- std::string nmea_dump_filename,
- std::string nmea_dump_devname,
- int32_t rinex_version,
- int32_t rinexobs_rate_ms,
- int32_t rinexnav_rate_ms,
- bool flag_rtcm_server,
- bool flag_rtcm_tty_port,
- uint16_t rtcm_tcp_port,
- uint16_t rtcm_station_id,
- std::map rtcm_msg_rate_ms,
- std::string rtcm_dump_devname,
- const uint32_t type_of_receiver,
+ const Pvt_Conf& conf_,
rtk_t& rtk)
{
return rtklib_pvt_cc_sptr(new rtklib_pvt_cc(nchannels,
- dump,
- dump_filename,
- output_rate_ms,
- display_rate_ms,
- flag_nmea_tty_port,
- nmea_dump_filename,
- nmea_dump_devname,
- rinex_version,
- rinexobs_rate_ms,
- rinexnav_rate_ms,
- flag_rtcm_server,
- flag_rtcm_tty_port,
- rtcm_tcp_port,
- rtcm_station_id,
- rtcm_msg_rate_ms,
- rtcm_dump_devname,
- type_of_receiver,
+ conf_,
rtk));
}
@@ -160,6 +128,15 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg)
DLOG(INFO) << "New CNAV UTC record has arrived ";
}
+ else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr))
+ {
+ // ### GPS ALMANAC ###
+ std::shared_ptr gps_almanac;
+ gps_almanac = boost::any_cast>(pmt::any_ref(msg));
+ d_ls_pvt->gps_almanac_map[gps_almanac->i_satellite_PRN] = *gps_almanac;
+ DLOG(INFO) << "New GPS almanac record has arrived ";
+ }
+
// **************** Galileo telemetry ********************
else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr))
{
@@ -189,14 +166,28 @@ void rtklib_pvt_cc::msg_handler_telemetry(pmt::pmt_t msg)
d_ls_pvt->galileo_utc_model = *galileo_utc_model;
DLOG(INFO) << "New UTC record has arrived ";
}
+ else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr))
+ {
+ // ### Galileo Almanac ###
+ std::shared_ptr galileo_almanac_helper;
+ galileo_almanac_helper = boost::any_cast>(pmt::any_ref(msg));
+
+ Galileo_Almanac sv1 = galileo_almanac_helper->get_almanac(1);
+ Galileo_Almanac sv2 = galileo_almanac_helper->get_almanac(2);
+ Galileo_Almanac sv3 = galileo_almanac_helper->get_almanac(3);
+
+ if (sv1.i_satellite_PRN != 0) d_ls_pvt->galileo_almanac_map[sv1.i_satellite_PRN] = sv1;
+ if (sv2.i_satellite_PRN != 0) d_ls_pvt->galileo_almanac_map[sv2.i_satellite_PRN] = sv2;
+ if (sv3.i_satellite_PRN != 0) d_ls_pvt->galileo_almanac_map[sv3.i_satellite_PRN] = sv3;
+ DLOG(INFO) << "New Galileo Almanac data have arrived ";
+ }
else if (pmt::any_ref(msg).type() == typeid(std::shared_ptr))
{
// ### Galileo Almanac ###
- std::shared_ptr galileo_almanac;
- galileo_almanac = boost::any_cast>(pmt::any_ref(msg));
- // update/insert new ephemeris record to the global ephemeris map
- d_ls_pvt->galileo_almanac = *galileo_almanac;
- DLOG(INFO) << "New Galileo Almanac has arrived ";
+ std::shared_ptr galileo_alm;
+ galileo_alm = boost::any_cast>(pmt::any_ref(msg));
+ // update/insert new almanac record to the global almanac map
+ d_ls_pvt->galileo_almanac_map[galileo_alm->i_satellite_PRN] = *galileo_alm;
}
// **************** GLONASS GNAV Telemetry **************************
@@ -250,34 +241,53 @@ std::map rtklib_pvt_cc::get_GPS_L1_ephemeris_map()
rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels,
- bool dump,
- std::string dump_filename,
- int32_t output_rate_ms,
- int32_t display_rate_ms,
- bool flag_nmea_tty_port,
- std::string nmea_dump_filename,
- std::string nmea_dump_devname,
- int32_t rinex_version,
- int32_t rinexobs_rate_ms,
- int32_t rinexnav_rate_ms,
- bool flag_rtcm_server,
- bool flag_rtcm_tty_port,
- uint16_t rtcm_tcp_port,
- uint16_t rtcm_station_id,
- std::map rtcm_msg_rate_ms,
- std::string rtcm_dump_devname,
- const uint32_t type_of_receiver,
+ const Pvt_Conf& conf_,
rtk_t& rtk) : gr::sync_block("rtklib_pvt_cc",
gr::io_signature::make(nchannels, nchannels, sizeof(Gnss_Synchro)),
gr::io_signature::make(0, 0, 0))
{
- d_output_rate_ms = output_rate_ms;
- d_display_rate_ms = display_rate_ms;
- d_dump = dump;
+ d_output_rate_ms = conf_.output_rate_ms;
+ d_display_rate_ms = conf_.display_rate_ms;
+ d_dump = conf_.dump;
+ d_dump_mat = conf_.dump_mat and d_dump;
+ d_dump_filename = conf_.dump_filename;
+ std::string dump_ls_pvt_filename = conf_.dump_filename;
+ if (d_dump)
+ {
+ std::string dump_path;
+ // Get path
+ if (d_dump_filename.find_last_of("/") != std::string::npos)
+ {
+ std::string dump_filename_ = d_dump_filename.substr(d_dump_filename.find_last_of("/") + 1);
+ dump_path = d_dump_filename.substr(0, d_dump_filename.find_last_of("/"));
+ d_dump_filename = dump_filename_;
+ }
+ else
+ {
+ dump_path = std::string(".");
+ }
+ if (d_dump_filename.empty())
+ {
+ d_dump_filename = "pvt";
+ }
+ // remove extension if any
+ if (d_dump_filename.substr(1).find_last_of(".") != std::string::npos)
+ {
+ d_dump_filename = d_dump_filename.substr(0, d_dump_filename.find_last_of("."));
+ }
+ dump_ls_pvt_filename = dump_path + boost::filesystem::path::preferred_separator + d_dump_filename;
+ dump_ls_pvt_filename.append(".dat");
+ // create directory
+ if (!gnss_sdr_create_directory(dump_path))
+ {
+ std::cerr << "GNSS-SDR cannot create dump file for the PVT block. Wrong permissions?" << std::endl;
+ d_dump = false;
+ }
+ }
+
d_nchannels = nchannels;
- d_dump_filename = dump_filename;
- std::string dump_ls_pvt_filename = dump_filename;
- type_of_rx = type_of_receiver;
+
+ type_of_rx = conf_.type_of_receiver;
// GPS Ephemeris data message port in
this->message_port_register_in(pmt::mp("telemetry"));
@@ -286,98 +296,183 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels,
// initialize kml_printer
std::string kml_dump_filename;
kml_dump_filename = d_dump_filename;
- d_kml_dump = std::make_shared();
- d_kml_dump->set_headers(kml_dump_filename);
+ d_kml_output_enabled = conf_.kml_output_enabled;
+ if (d_kml_output_enabled)
+ {
+ d_kml_dump = std::make_shared(conf_.kml_output_path);
+ d_kml_dump->set_headers(kml_dump_filename);
+ }
+ else
+ {
+ d_kml_dump = nullptr;
+ }
// initialize gpx_printer
std::string gpx_dump_filename;
gpx_dump_filename = d_dump_filename;
- d_gpx_dump = std::make_shared();
- d_gpx_dump->set_headers(gpx_dump_filename);
+ d_gpx_output_enabled = conf_.gpx_output_enabled;
+ if (d_gpx_output_enabled)
+ {
+ d_gpx_dump = std::make_shared(conf_.gpx_output_path);
+ d_gpx_dump->set_headers(gpx_dump_filename);
+ }
+ else
+ {
+ d_gpx_dump = nullptr;
+ }
// initialize geojson_printer
std::string geojson_dump_filename;
geojson_dump_filename = d_dump_filename;
- d_geojson_printer = std::make_shared();
- d_geojson_printer->set_headers(geojson_dump_filename);
+
+ d_geojson_output_enabled = conf_.geojson_output_enabled;
+ if (d_geojson_output_enabled)
+ {
+ d_geojson_printer = std::make_shared(conf_.geojson_output_path);
+ d_geojson_printer->set_headers(geojson_dump_filename);
+ }
+ else
+ {
+ d_geojson_printer = nullptr;
+ }
// initialize nmea_printer
- d_nmea_printer = std::make_shared(nmea_dump_filename, flag_nmea_tty_port, nmea_dump_devname);
+ d_nmea_printer = std::make_shared(conf_.nmea_dump_filename, conf_.nmea_output_file_enabled, conf_.flag_nmea_tty_port, conf_.nmea_dump_devname, conf_.nmea_output_file_path);
// initialize rtcm_printer
std::string rtcm_dump_filename;
rtcm_dump_filename = d_dump_filename;
- d_rtcm_printer = std::make_shared(rtcm_dump_filename, flag_rtcm_server, flag_rtcm_tty_port, rtcm_tcp_port, rtcm_station_id, rtcm_dump_devname);
- if (rtcm_msg_rate_ms.find(1019) != rtcm_msg_rate_ms.end())
+ if (conf_.flag_rtcm_server or conf_.flag_rtcm_tty_port or conf_.rtcm_output_file_enabled)
{
- d_rtcm_MT1019_rate_ms = rtcm_msg_rate_ms[1019];
+ d_rtcm_printer = std::make_shared(rtcm_dump_filename, conf_.rtcm_output_file_enabled, conf_.flag_rtcm_server, conf_.flag_rtcm_tty_port, conf_.rtcm_tcp_port, conf_.rtcm_station_id, conf_.rtcm_dump_devname, true, conf_.rtcm_output_file_path);
+ std::map rtcm_msg_rate_ms = conf_.rtcm_msg_rate_ms;
+ if (rtcm_msg_rate_ms.find(1019) != rtcm_msg_rate_ms.end())
+ {
+ d_rtcm_MT1019_rate_ms = rtcm_msg_rate_ms[1019];
+ }
+ else
+ {
+ d_rtcm_MT1019_rate_ms = bc::lcm(5000, d_output_rate_ms); // default value if not set
+ }
+ if (rtcm_msg_rate_ms.find(1020) != rtcm_msg_rate_ms.end())
+ {
+ d_rtcm_MT1020_rate_ms = rtcm_msg_rate_ms[1020];
+ }
+ else
+ {
+ d_rtcm_MT1020_rate_ms = bc::lcm(5000, d_output_rate_ms); // default value if not set
+ }
+ if (rtcm_msg_rate_ms.find(1045) != rtcm_msg_rate_ms.end())
+ {
+ d_rtcm_MT1045_rate_ms = rtcm_msg_rate_ms[1045];
+ }
+ else
+ {
+ d_rtcm_MT1045_rate_ms = bc::lcm(5000, d_output_rate_ms); // default value if not set
+ }
+ if (rtcm_msg_rate_ms.find(1077) != rtcm_msg_rate_ms.end()) // whatever between 1071 and 1077
+ {
+ d_rtcm_MT1077_rate_ms = rtcm_msg_rate_ms[1077];
+ }
+ else
+ {
+ d_rtcm_MT1077_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set
+ }
+ if (rtcm_msg_rate_ms.find(1087) != rtcm_msg_rate_ms.end()) // whatever between 1081 and 1087
+ {
+ d_rtcm_MT1087_rate_ms = rtcm_msg_rate_ms[1087];
+ }
+ else
+ {
+ d_rtcm_MT1087_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set
+ }
+ if (rtcm_msg_rate_ms.find(1097) != rtcm_msg_rate_ms.end()) // whatever between 1091 and 1097
+ {
+ d_rtcm_MT1097_rate_ms = rtcm_msg_rate_ms[1097];
+ d_rtcm_MSM_rate_ms = rtcm_msg_rate_ms[1097];
+ }
+ else
+ {
+ d_rtcm_MT1097_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set
+ d_rtcm_MSM_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set
+ }
+ b_rtcm_writing_started = false;
+ b_rtcm_enabled = true;
}
else
{
- d_rtcm_MT1019_rate_ms = bc::lcm(5000, d_output_rate_ms); // default value if not set
+ d_rtcm_MT1019_rate_ms = 0;
+ d_rtcm_MT1045_rate_ms = 0;
+ d_rtcm_MT1020_rate_ms = 0;
+ d_rtcm_MT1077_rate_ms = 0;
+ d_rtcm_MT1087_rate_ms = 0;
+ d_rtcm_MT1097_rate_ms = 0;
+ d_rtcm_MSM_rate_ms = 0;
+ b_rtcm_enabled = false;
+ b_rtcm_writing_started = false;
+ d_rtcm_printer = nullptr;
}
- if (rtcm_msg_rate_ms.find(1020) != rtcm_msg_rate_ms.end())
- {
- d_rtcm_MT1020_rate_ms = rtcm_msg_rate_ms[1020];
- }
- else
- {
- d_rtcm_MT1020_rate_ms = bc::lcm(5000, d_output_rate_ms); // default value if not set
- }
- if (rtcm_msg_rate_ms.find(1045) != rtcm_msg_rate_ms.end())
- {
- d_rtcm_MT1045_rate_ms = rtcm_msg_rate_ms[1045];
- }
- else
- {
- d_rtcm_MT1045_rate_ms = bc::lcm(5000, d_output_rate_ms); // default value if not set
- }
- if (rtcm_msg_rate_ms.find(1077) != rtcm_msg_rate_ms.end()) // whatever between 1071 and 1077
- {
- d_rtcm_MT1077_rate_ms = rtcm_msg_rate_ms[1077];
- }
- else
- {
- d_rtcm_MT1077_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set
- }
- if (rtcm_msg_rate_ms.find(1087) != rtcm_msg_rate_ms.end()) // whatever between 1081 and 1087
- {
- d_rtcm_MT1087_rate_ms = rtcm_msg_rate_ms[1087];
- }
- else
- {
- d_rtcm_MT1087_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set
- }
- if (rtcm_msg_rate_ms.find(1097) != rtcm_msg_rate_ms.end()) // whatever between 1091 and 1097
- {
- d_rtcm_MT1097_rate_ms = rtcm_msg_rate_ms[1097];
- d_rtcm_MSM_rate_ms = rtcm_msg_rate_ms[1097];
- }
- else
- {
- d_rtcm_MT1097_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set
- d_rtcm_MSM_rate_ms = bc::lcm(1000, d_output_rate_ms); // default value if not set
- }
- b_rtcm_writing_started = false;
// initialize RINEX printer
b_rinex_header_written = false;
b_rinex_header_updated = false;
- d_rinex_version = rinex_version;
- rp = std::make_shared(d_rinex_version);
- d_rinexobs_rate_ms = rinexobs_rate_ms;
- d_rinexnav_rate_ms = rinexnav_rate_ms;
+ b_rinex_output_enabled = conf_.rinex_output_enabled;
+ d_rinex_version = conf_.rinex_version;
+ if (b_rinex_output_enabled)
+ {
+ rp = std::make_shared(d_rinex_version, conf_.rinex_output_path);
+ }
+ else
+ {
+ rp = nullptr;
+ }
+ d_rinexobs_rate_ms = conf_.rinexobs_rate_ms;
+ d_rinexnav_rate_ms = conf_.rinexnav_rate_ms;
- dump_ls_pvt_filename.append("_pvt.dat");
+ // XML printer
+ d_xml_storage = conf_.xml_output_enabled;
+ if (d_xml_storage)
+ {
+ xml_base_path = conf_.xml_output_path;
+ boost::filesystem::path full_path(boost::filesystem::current_path());
+ const boost::filesystem::path p(xml_base_path);
+ if (!boost::filesystem::exists(p))
+ {
+ std::string new_folder;
+ for (auto& folder : boost::filesystem::path(xml_base_path))
+ {
+ new_folder += folder.string();
+ boost::system::error_code ec;
+ if (!boost::filesystem::exists(new_folder))
+ {
+ if (!boost::filesystem::create_directory(new_folder, ec))
+ {
+ std::cout << "Could not create the " << new_folder << " folder." << std::endl;
+ xml_base_path = full_path.string();
+ }
+ }
+ new_folder += boost::filesystem::path::preferred_separator;
+ }
+ }
+ else
+ {
+ xml_base_path = p.string();
+ }
+ if (xml_base_path.compare(".") != 0)
+ {
+ std::cout << "XML files will be stored at " << xml_base_path << std::endl;
+ }
- d_ls_pvt = std::make_shared(static_cast(nchannels), dump_ls_pvt_filename, d_dump, rtk);
+ xml_base_path = xml_base_path + boost::filesystem::path::preferred_separator;
+ }
+
+ d_ls_pvt = std::make_shared(static_cast(nchannels), dump_ls_pvt_filename, d_dump, d_dump_mat, rtk);
d_ls_pvt->set_averaging_depth(1);
d_rx_time = 0.0;
d_last_status_print_seg = 0;
-
// Create Sys V message queue
first_fix = true;
sysv_msg_key = 1101;
@@ -394,203 +489,315 @@ rtklib_pvt_cc::rtklib_pvt_cc(uint32_t nchannels,
rtklib_pvt_cc::~rtklib_pvt_cc()
{
msgctl(sysv_msqid, IPC_RMID, NULL);
+ if (d_xml_storage)
+ {
+ // save GPS L2CM ephemeris to XML file
+ std::string file_name = xml_base_path + "gps_cnav_ephemeris.xml";
+ if (d_ls_pvt->gps_cnav_ephemeris_map.empty() == false)
+ {
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_cnav_ephemeris_map", d_ls_pvt->gps_cnav_ephemeris_map);
+ LOG(INFO) << "Saved GPS L2CM or L5 Ephemeris map data";
+ }
+ catch (std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
+ }
+ else
+ {
+ LOG(INFO) << "Failed to save GPS L2CM or L5 Ephemeris, map is empty";
+ }
- // save GPS L2CM ephemeris to XML file
- std::string file_name = "gps_cnav_ephemeris.xml";
- if (d_ls_pvt->gps_cnav_ephemeris_map.empty() == false)
- {
- std::ofstream ofs;
- try
+ // save GPS L1 CA ephemeris to XML file
+ file_name = xml_base_path + "gps_ephemeris.xml";
+ if (d_ls_pvt->gps_ephemeris_map.empty() == false)
{
- ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
- boost::archive::xml_oarchive xml(ofs);
- xml << boost::serialization::make_nvp("GNSS-SDR_cnav_ephemeris_map", d_ls_pvt->gps_cnav_ephemeris_map);
- LOG(INFO) << "Saved GPS L2CM or L5 Ephemeris map data";
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_ls_pvt->gps_ephemeris_map);
+ LOG(INFO) << "Saved GPS L1 CA Ephemeris map data";
+ }
+ catch (const std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
}
- catch (std::exception& e)
+ else
{
- LOG(WARNING) << e.what();
+ LOG(INFO) << "Failed to save GPS L1 CA Ephemeris, map is empty";
}
- }
- else
- {
- LOG(INFO) << "Failed to save GPS L2CM or L5 Ephemeris, map is empty";
- }
- // save GPS L1 CA ephemeris to XML file
- file_name = "gps_ephemeris.xml";
- if (d_ls_pvt->gps_ephemeris_map.empty() == false)
- {
- std::ofstream ofs;
- try
+ // save Galileo E1 ephemeris to XML file
+ file_name = xml_base_path + "gal_ephemeris.xml";
+ if (d_ls_pvt->galileo_ephemeris_map.empty() == false)
{
- ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
- boost::archive::xml_oarchive xml(ofs);
- xml << boost::serialization::make_nvp("GNSS-SDR_ephemeris_map", d_ls_pvt->gps_ephemeris_map);
- LOG(INFO) << "Saved GPS L1 CA Ephemeris map data";
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", d_ls_pvt->galileo_ephemeris_map);
+ LOG(INFO) << "Saved Galileo E1 Ephemeris map data";
+ }
+ catch (const std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
}
- catch (const std::exception& e)
+ else
{
- LOG(WARNING) << e.what();
+ LOG(INFO) << "Failed to save Galileo E1 Ephemeris, map is empty";
}
- }
- else
- {
- LOG(INFO) << "Failed to save GPS L1 CA Ephemeris, map is empty";
- }
- // save Galileo E1 ephemeris to XML file
- file_name = "gal_ephemeris.xml";
- if (d_ls_pvt->galileo_ephemeris_map.empty() == false)
- {
- std::ofstream ofs;
- try
+ // save GLONASS GNAV ephemeris to XML file
+ file_name = xml_base_path + "eph_GLONASS_GNAV.xml";
+ if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false)
{
- ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
- boost::archive::xml_oarchive xml(ofs);
- xml << boost::serialization::make_nvp("GNSS-SDR_gal_ephemeris_map", d_ls_pvt->galileo_ephemeris_map);
- LOG(INFO) << "Saved Galileo E1 Ephemeris map data";
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_ls_pvt->glonass_gnav_ephemeris_map);
+ LOG(INFO) << "Saved GLONASS GNAV Ephemeris map data";
+ }
+ catch (std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
}
- catch (const std::exception& e)
+ else
{
- LOG(WARNING) << e.what();
+ LOG(INFO) << "Failed to save GLONASS GNAV Ephemeris, map is empty";
}
- }
- else
- {
- LOG(INFO) << "Failed to save Galileo E1 Ephemeris, map is empty";
- }
- // save GLONASS GNAV ephemeris to XML file
- file_name = "eph_GLONASS_GNAV.xml";
- if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false)
- {
- std::ofstream ofs;
- try
+ // Save GPS UTC model parameters
+ file_name = xml_base_path + "gps_utc_model.xml";
+ if (d_ls_pvt->gps_utc_model.valid)
{
- ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
- boost::archive::xml_oarchive xml(ofs);
- xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_ls_pvt->glonass_gnav_ephemeris_map);
- LOG(INFO) << "Saved GLONASS GNAV Ephemeris map data";
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_utc_model", d_ls_pvt->gps_utc_model);
+ LOG(INFO) << "Saved GPS UTC model parameters";
+ }
+ catch (std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
}
- catch (std::exception& e)
+ else
{
- LOG(WARNING) << e.what();
+ LOG(INFO) << "Failed to save GPS UTC model parameters, not valid data";
}
- }
- else
- {
- LOG(INFO) << "Failed to save GLONASS GNAV Ephemeris, map is empty";
- }
- // Save GPS UTC model parameters
- file_name = "gps_utc_model.xml";
- if (d_ls_pvt->gps_utc_model.valid)
- {
- std::ofstream ofs;
- try
+ // Save Galileo UTC model parameters
+ file_name = xml_base_path + "gal_utc_model.xml";
+ if (d_ls_pvt->galileo_utc_model.Delta_tLS_6 != 0.0)
{
- ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
- boost::archive::xml_oarchive xml(ofs);
- xml << boost::serialization::make_nvp("GNSS-SDR_utc_model", d_ls_pvt->gps_utc_model);
- LOG(INFO) << "Saved GPS UTC model parameters";
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_gal_utc_model", d_ls_pvt->galileo_utc_model);
+ LOG(INFO) << "Saved Galileo UTC model parameters";
+ }
+ catch (std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
}
- catch (std::exception& e)
+ else
{
- LOG(WARNING) << e.what();
+ LOG(INFO) << "Failed to save Galileo UTC model parameters, not valid data";
}
- }
- else
- {
- LOG(INFO) << "Failed to save GPS UTC model parameters, not valid data";
- }
- // Save Galileo UTC model parameters
- file_name = "gal_utc_model.xml";
- if (d_ls_pvt->galileo_utc_model.Delta_tLS_6 != 0.0)
- {
- std::ofstream ofs;
- try
+ // Save GPS iono parameters
+ file_name = xml_base_path + "gps_iono.xml";
+ if (d_ls_pvt->gps_iono.valid == true)
{
- ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
- boost::archive::xml_oarchive xml(ofs);
- xml << boost::serialization::make_nvp("GNSS-SDR_gal_utc_model", d_ls_pvt->galileo_utc_model);
- LOG(INFO) << "Saved Galileo UTC model parameters";
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_iono_model", d_ls_pvt->gps_iono);
+ LOG(INFO) << "Saved GPS ionospheric model parameters";
+ }
+ catch (std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
}
- catch (std::exception& e)
+ else
{
- LOG(WARNING) << e.what();
+ LOG(INFO) << "Failed to save GPS ionospheric model parameters, not valid data";
}
- }
- else
- {
- LOG(INFO) << "Failed to save Galileo UTC model parameters, not valid data";
- }
- // Save GPS CNAV UTC model parameters
- file_name = "gps_cnav_utc_model.xml";
- if (d_ls_pvt->gps_cnav_utc_model.valid)
- {
- std::ofstream ofs;
- try
+ // Save GPS CNAV iono parameters
+ file_name = xml_base_path + "gps_cnav_iono.xml";
+ if (d_ls_pvt->gps_cnav_iono.valid == true)
{
- ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
- boost::archive::xml_oarchive xml(ofs);
- xml << boost::serialization::make_nvp("GNSS-SDR_cnav_utc_model", d_ls_pvt->gps_cnav_utc_model);
- LOG(INFO) << "Saved GPS CNAV UTC model parameters";
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_cnav_iono_model", d_ls_pvt->gps_cnav_iono);
+ LOG(INFO) << "Saved GPS CNAV ionospheric model parameters";
+ }
+ catch (std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
}
- catch (std::exception& e)
+ else
{
- LOG(WARNING) << e.what();
+ LOG(INFO) << "Failed to save GPS CNAV ionospheric model parameters, not valid data";
}
- }
- else
- {
- LOG(INFO) << "Failed to save GPS CNAV UTC model parameters, not valid data";
- }
- // save GLONASS GNAV ephemeris to XML file
- file_name = "glo_gnav_ephemeris.xml";
- if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false)
- {
- std::ofstream ofs;
- try
+ // Save Galileo iono parameters
+ file_name = xml_base_path + "gal_iono.xml";
+ if (d_ls_pvt->galileo_iono.ai0_5 != 0.0)
{
- ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
- boost::archive::xml_oarchive xml(ofs);
- xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_ls_pvt->glonass_gnav_ephemeris_map);
- LOG(INFO) << "Saved GLONASS GNAV ephemeris map data";
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_gal_iono_model", d_ls_pvt->galileo_iono);
+ LOG(INFO) << "Saved Galileo ionospheric model parameters";
+ }
+ catch (std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
}
- catch (std::exception& e)
+ else
{
- LOG(WARNING) << e.what();
+ LOG(INFO) << "Failed to save Galileo ionospheric model parameters, not valid data";
}
- }
- else
- {
- LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, map is empty";
- }
- // save GLONASS UTC model parameters to XML file
- file_name = "glo_utc_model.xml";
- if (d_ls_pvt->glonass_gnav_utc_model.valid)
- {
- std::ofstream ofs;
- try
+ // save GPS almanac to XML file
+ file_name = xml_base_path + "gps_almanac.xml";
+ if (d_ls_pvt->gps_almanac_map.empty() == false)
{
- ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
- boost::archive::xml_oarchive xml(ofs);
- xml << boost::serialization::make_nvp("GNSS-SDR_gnav_utc_model", d_ls_pvt->glonass_gnav_utc_model);
- LOG(INFO) << "Saved GLONASS UTC model parameters";
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_gps_almanac_map", d_ls_pvt->gps_almanac_map);
+ LOG(INFO) << "Saved GPS almanac map data";
+ }
+ catch (const std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
}
- catch (std::exception& e)
+ else
{
- LOG(WARNING) << e.what();
+ LOG(INFO) << "Failed to save GPS almanac, map is empty";
+ }
+
+ // Save Galileo almanac
+ file_name = xml_base_path + "gal_almanac.xml";
+ if (d_ls_pvt->galileo_almanac_map.empty() == false)
+ {
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_gal_almanac_map", d_ls_pvt->galileo_almanac_map);
+ LOG(INFO) << "Saved Galileo almanac data";
+ }
+ catch (std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
+ }
+ else
+ {
+ LOG(INFO) << "Failed to save Galileo almanac, not valid data";
+ }
+
+ // Save GPS CNAV UTC model parameters
+ file_name = xml_base_path + "gps_cnav_utc_model.xml";
+ if (d_ls_pvt->gps_cnav_utc_model.valid)
+ {
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_cnav_utc_model", d_ls_pvt->gps_cnav_utc_model);
+ LOG(INFO) << "Saved GPS CNAV UTC model parameters";
+ }
+ catch (std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
+ }
+ else
+ {
+ LOG(INFO) << "Failed to save GPS CNAV UTC model parameters, not valid data";
+ }
+
+ // save GLONASS GNAV ephemeris to XML file
+ file_name = xml_base_path + "glo_gnav_ephemeris.xml";
+ if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false)
+ {
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_gnav_ephemeris_map", d_ls_pvt->glonass_gnav_ephemeris_map);
+ LOG(INFO) << "Saved GLONASS GNAV ephemeris map data";
+ }
+ catch (std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
+ }
+ else
+ {
+ LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, map is empty";
+ }
+
+ // save GLONASS UTC model parameters to XML file
+ file_name = xml_base_path + "glo_utc_model.xml";
+ if (d_ls_pvt->glonass_gnav_utc_model.valid)
+ {
+ std::ofstream ofs;
+ try
+ {
+ ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
+ boost::archive::xml_oarchive xml(ofs);
+ xml << boost::serialization::make_nvp("GNSS-SDR_gnav_utc_model", d_ls_pvt->glonass_gnav_utc_model);
+ LOG(INFO) << "Saved GLONASS UTC model parameters";
+ }
+ catch (std::exception& e)
+ {
+ LOG(WARNING) << e.what();
+ }
+ }
+ else
+ {
+ LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, not valid data";
}
- }
- else
- {
- LOG(INFO) << "Failed to save GLONASS GNAV ephemeris, not valid data";
}
}
@@ -678,9 +885,6 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
bool flag_write_RTCM_MSM_output = false;
bool flag_write_RINEX_obs_output = false;
bool flag_write_RINEX_nav_output = false;
- uint32_t gps_channel = 0;
- uint32_t gal_channel = 0;
- uint32_t glo_channel = 0;
gnss_observables_map.clear();
const Gnss_Synchro** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer
@@ -698,46 +902,49 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
// store valid observables in a map.
gnss_observables_map.insert(std::pair(i, in[i][epoch]));
}
- try
+ if (b_rtcm_enabled)
{
- if (d_ls_pvt->gps_ephemeris_map.empty() == false)
+ try
{
- if (tmp_eph_iter_gps != d_ls_pvt->gps_ephemeris_map.end())
+ if (d_ls_pvt->gps_ephemeris_map.empty() == false)
{
- d_rtcm_printer->lock_time(d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time
+ if (tmp_eph_iter_gps != d_ls_pvt->gps_ephemeris_map.cend())
+ {
+ d_rtcm_printer->lock_time(d_ls_pvt->gps_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time
+ }
+ }
+ if (d_ls_pvt->galileo_ephemeris_map.empty() == false)
+ {
+ if (tmp_eph_iter_gal != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ d_rtcm_printer->lock_time(d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time
+ }
+ }
+ if (d_ls_pvt->gps_cnav_ephemeris_map.empty() == false)
+ {
+ if (tmp_eph_iter_cnav != d_ls_pvt->gps_cnav_ephemeris_map.cend())
+ {
+ d_rtcm_printer->lock_time(d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time
+ }
+ }
+ if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false)
+ {
+ if (tmp_eph_iter_glo_gnav != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ {
+ d_rtcm_printer->lock_time(d_ls_pvt->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time
+ }
}
}
- if (d_ls_pvt->galileo_ephemeris_map.empty() == false)
+ catch (const boost::exception& ex)
{
- if (tmp_eph_iter_gal != d_ls_pvt->galileo_ephemeris_map.end())
- {
- d_rtcm_printer->lock_time(d_ls_pvt->galileo_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time
- }
+ std::cout << "RTCM boost exception: " << boost::diagnostic_information(ex) << std::endl;
+ LOG(ERROR) << "RTCM boost exception: " << boost::diagnostic_information(ex);
}
- if (d_ls_pvt->gps_cnav_ephemeris_map.empty() == false)
+ catch (const std::exception& ex)
{
- if (tmp_eph_iter_cnav != d_ls_pvt->gps_cnav_ephemeris_map.end())
- {
- d_rtcm_printer->lock_time(d_ls_pvt->gps_cnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time
- }
+ std::cout << "RTCM std exception: " << ex.what() << std::endl;
+ LOG(ERROR) << "RTCM std exception: " << ex.what();
}
- if (d_ls_pvt->glonass_gnav_ephemeris_map.empty() == false)
- {
- if (tmp_eph_iter_glo_gnav != d_ls_pvt->glonass_gnav_ephemeris_map.end())
- {
- d_rtcm_printer->lock_time(d_ls_pvt->glonass_gnav_ephemeris_map.find(in[i][epoch].PRN)->second, in[i][epoch].RX_time, in[i][epoch]); // keep track of locking time
- }
- }
- }
- catch (const boost::exception& ex)
- {
- std::cout << "RTCM boost exception: " << boost::diagnostic_information(ex) << std::endl;
- LOG(ERROR) << "RTCM boost exception: " << boost::diagnostic_information(ex);
- }
- catch (const std::exception& ex)
- {
- std::cout << "RTCM std exception: " << ex.what() << std::endl;
- LOG(ERROR) << "RTCM std exception: " << ex.what();
}
}
}
@@ -760,14 +967,13 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
// receiver clock correction is disabled to be coherent with the RINEX and RTCM standard
// std::cout << TEXT_RED << "(internal) accumulated RX clock offset: " << d_ls_pvt->get_time_offset_s() << "[s]" << TEXT_RESET << std::endl;
- // for (std::map::iterator it = gnss_observables_map.begin(); it != gnss_observables_map.end(); ++it)
+ // for (std::map::iterator it = gnss_observables_map.begin(); it != gnss_observables_map.cend(); ++it)
// {
// todo: check if it has effect to correct the receiver time for the internal pvt solution
// take into account that the RINEX obs with the RX time (integer ms) CAN NOT be corrected to keep the coherence in obs time
// it->second.Pseudorange_m = it->second.Pseudorange_m - d_ls_pvt->get_time_offset_s() * GPS_C_m_s;
// }
-
if (d_ls_pvt->get_PVT(gnss_observables_map, false))
{
//Optional debug code: export observables snapshot for rtklib unit testing
@@ -780,17 +986,26 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
flag_display_pvt = true;
}
- if (current_RX_time_ms % d_rtcm_MT1019_rate_ms == 0 and d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0
+ if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- flag_write_RTCM_1019_output = true;
+ if (current_RX_time_ms % d_rtcm_MT1019_rate_ms == 0)
+ {
+ flag_write_RTCM_1019_output = true;
+ }
}
- if (current_RX_time_ms % d_rtcm_MT1020_rate_ms == 0 and d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0
+ if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- flag_write_RTCM_1020_output = true;
+ if (current_RX_time_ms % d_rtcm_MT1020_rate_ms == 0)
+ {
+ flag_write_RTCM_1020_output = true;
+ }
}
- if (current_RX_time_ms % d_rtcm_MT1045_rate_ms == 0 and d_rtcm_MT1045_rate_ms != 0)
+ if (d_rtcm_MT1045_rate_ms != 0)
{
- flag_write_RTCM_1045_output = true;
+ if (current_RX_time_ms % d_rtcm_MT1045_rate_ms == 0)
+ {
+ flag_write_RTCM_1045_output = true;
+ }
}
// TODO: RTCM 1077, 1087 and 1097 are not used, so, disable the output rates
// if (current_RX_time_ms % d_rtcm_MT1077_rate_ms==0 and d_rtcm_MT1077_rate_ms != 0)
@@ -805,19 +1020,26 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
// {
// last_RTCM_1097_output_time = current_RX_time;
// }
-
- if (current_RX_time_ms % d_rtcm_MSM_rate_ms == 0 and d_rtcm_MSM_rate_ms != 0)
+ if (d_rtcm_MSM_rate_ms != 0)
{
- flag_write_RTCM_MSM_output = true;
+ if (current_RX_time_ms % d_rtcm_MSM_rate_ms == 0)
+ {
+ flag_write_RTCM_MSM_output = true;
+ }
}
- if (current_RX_time_ms % static_cast(d_rinexobs_rate_ms) == 0)
+ if (d_rinexobs_rate_ms != 0)
{
- flag_write_RINEX_obs_output = true;
+ if (current_RX_time_ms % static_cast(d_rinexobs_rate_ms) == 0)
+ {
+ flag_write_RINEX_obs_output = true;
+ }
}
-
- if (current_RX_time_ms % static_cast(d_rinexnav_rate_ms) == 0)
+ if (d_rinexnav_rate_ms != 0)
{
- flag_write_RINEX_nav_output = true;
+ if (current_RX_time_ms % static_cast(d_rinexnav_rate_ms) == 0)
+ {
+ flag_write_RINEX_nav_output = true;
+ }
}
if (first_fix == true)
@@ -833,9 +1055,9 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
send_sys_v_ttff_msg(ttff);
first_fix = false;
}
- d_kml_dump->print_position(d_ls_pvt, false);
- d_gpx_dump->print_position(d_ls_pvt, false);
- d_geojson_printer->print_position(d_ls_pvt, false);
+ if (d_kml_output_enabled) d_kml_dump->print_position(d_ls_pvt, false);
+ if (d_gpx_output_enabled) d_gpx_dump->print_position(d_ls_pvt, false);
+ if (d_geojson_output_enabled) d_geojson_printer->print_position(d_ls_pvt, false);
d_nmea_printer->Print_Nmea_Line(d_ls_pvt, false);
/*
@@ -872,571 +1094,677 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
* 29 | GPS L1 C/A + GLONASS L2 C/A
* 30 | Galileo E1B + GLONASS L2 C/A
* 31 | GPS L2C + GLONASS L2 C/A
+ * 32 | GPS L1 C/A + Galileo E1B + GPS L5 + Galileo E5a
*/
// ####################### RINEX FILES #################
-
- std::map::const_iterator galileo_ephemeris_iter;
- std::map::const_iterator gps_ephemeris_iter;
- std::map::const_iterator gps_cnav_ephemeris_iter;
- std::map::const_iterator glonass_gnav_ephemeris_iter;
- std::map::const_iterator gnss_observables_iter;
-
- if (!b_rinex_header_written) // & we have utc data in nav message!
+ if (b_rinex_output_enabled)
{
- galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
- gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
- gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
- glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
+ std::map::const_iterator galileo_ephemeris_iter;
+ std::map::const_iterator gps_ephemeris_iter;
+ std::map::const_iterator gps_cnav_ephemeris_iter;
+ std::map::const_iterator glonass_gnav_ephemeris_iter;
+ if (!b_rinex_header_written) // & we have utc data in nav message!
+ {
+ galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
+ glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
- if (type_of_rx == 1) // GPS L1 C/A only
- {
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
- {
- rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time);
- rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 2) // GPS L2C only
- {
- if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())
- {
- rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time);
- rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 3) // GPS L5 only
- {
- if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())
- {
- rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time);
- rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 4) // Galileo E1B only
- {
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
- {
- rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time);
- rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 5) // Galileo E5a only
- {
- std::string signal("5X");
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
- {
- rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal);
- rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 6) // Galileo E5b only
- {
- std::string signal("7X");
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
- {
- rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal);
- rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 7) // GPS L1 C/A + GPS L2C
- {
- if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
- {
- rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time);
- rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
-
- if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B
- {
- if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()))
- {
- std::string gal_signal("1B");
- rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
- rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 10) // GPS L1 C/A + Galileo E5a
- {
- if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()))
- {
- std::string gal_signal("5X");
- rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
- rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 11) // GPS L1 C/A + Galileo E5b
- {
- if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()))
- {
- std::string gal_signal("7X");
- rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
- rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 14) // Galileo E1B + Galileo E5a
- {
- if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()))
- {
- std::string gal_signal("1B 5X");
- rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
- rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 15) // Galileo E1B + Galileo E5b
- {
- if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()))
- {
- std::string gal_signal("1B 7X");
- rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
- rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 23) // GLONASS L1 C/A only
- {
- std::string signal("1G");
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
- {
- rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal);
- rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 24) // GLONASS L2 C/A only
- {
- std::string signal("2G");
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
- {
- rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal);
- rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A
- {
- std::string signal("1G 2G");
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
- {
- rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal);
- rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
-
- if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A
- {
- if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()))
- {
- std::string glo_signal("1G");
- rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal);
- if (d_rinex_version == 3)
- rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- if (d_rinex_version == 2)
- {
- rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
- rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
- }
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A
- {
- if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()))
- {
- std::string glo_signal("1G");
- std::string gal_signal("1B");
- rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal);
- rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A
- {
- if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
- {
- std::string glo_signal("1G");
- rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal);
- rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A
- {
- if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()))
- {
- std::string glo_signal("2G");
- rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal);
- if (d_rinex_version == 3)
- rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- if (d_rinex_version == 2)
- {
- rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
- rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
- }
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A
- {
- if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()))
- {
- std::string glo_signal("2G");
- std::string gal_signal("1B");
- rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal);
- rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A
- {
- if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
- {
- std::string glo_signal("2G");
- rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal);
- rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- b_rinex_header_written = true; // do not write header anymore
- }
- }
- }
- if (b_rinex_header_written) // The header is already written, we can now log the navigation message data
- {
- if (flag_write_RINEX_nav_output)
- {
if (type_of_rx == 1) // GPS L1 C/A only
{
- rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map);
+ if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ {
+ rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, d_rx_time);
+ rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
+ }
}
if (type_of_rx == 2) // GPS L2C only
{
- rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map);
+ if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())
+ {
+ std::string signal("2S");
+ rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, signal);
+ rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
+ }
}
if (type_of_rx == 3) // GPS L5 only
{
- rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map);
- }
- if ((type_of_rx == 4) or (type_of_rx == 5) or (type_of_rx == 6)) // Galileo
- {
- rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map);
- }
- if (type_of_rx == 7) // GPS L1 C/A + GPS L2C
- {
- rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map);
- }
- if ((type_of_rx == 9) or (type_of_rx == 10) or (type_of_rx == 11)) // GPS L1 C/A + Galileo
- {
- rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map);
- }
- if ((type_of_rx == 14) or (type_of_rx == 15)) // Galileo E1B + Galileo E5a
- {
- rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map);
- }
- if ((type_of_rx == 23) or (type_of_rx == 24) or (type_of_rx == 25)) // GLONASS L1 C/A, GLONASS L2 C/A
- {
- rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map);
- }
- if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A
- {
- if (d_rinex_version == 3)
- rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
- if (d_rinex_version == 2)
+ if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())
{
- rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map);
- rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map);
- }
- }
- if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A
- {
- rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
- }
- if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A
- {
- rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
- }
- if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A
- {
- if (d_rinex_version == 3)
- rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
- if (d_rinex_version == 2)
- {
- rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map);
- rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map);
- }
- }
- if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A
- {
- rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
- }
- if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A
- {
- rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
- }
- }
- galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
- gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
- gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
- glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
-
- // Log observables into the RINEX file
- if (flag_write_RINEX_obs_output)
- {
- if (type_of_rx == 1) // GPS L1 C/A only
- {
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
- {
- rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_observables_map);
- }
- if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0))
- {
- rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model);
- rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono);
- b_rinex_header_updated = true;
- }
- }
- if (type_of_rx == 2) // GPS L2C only
- {
- if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())
- {
- rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
- }
- if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0))
- {
- rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model);
- rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono);
- b_rinex_header_updated = true;
- }
- }
- if (type_of_rx == 3) // GPS L5
- {
- if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end())
- {
- rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
- }
- if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0))
- {
- rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model);
- rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono);
- b_rinex_header_updated = true;
+ std::string signal("L5");
+ rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, signal);
+ rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
}
}
if (type_of_rx == 4) // Galileo E1B only
{
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+ if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
- rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B");
- }
- if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
- {
- rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
- b_rinex_header_updated = true;
+ rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time);
+ rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
}
}
if (type_of_rx == 5) // Galileo E5a only
{
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+ std::string signal("5X");
+ if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
- rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "5X");
- }
- if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
- {
- rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
- b_rinex_header_updated = true;
+ rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal);
+ rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
}
}
if (type_of_rx == 6) // Galileo E5b only
{
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+ std::string signal("7X");
+ if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
- rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "7X");
- }
- if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
- {
- rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
- b_rinex_header_updated = true;
+ rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, signal);
+ rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
}
}
if (type_of_rx == 7) // GPS L1 C/A + GPS L2C
{
- if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()))
+ if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
{
- rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ std::string signal("1C 2S");
+ rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal);
+ rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
}
- if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0))
+ }
+ if (type_of_rx == 8) // GPS L1 + GPS L5
+ {
+ if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
{
- rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model);
- rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono);
- b_rinex_header_updated = true;
+ std::string signal("1C L5");
+ rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, signal);
+ rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
}
}
if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B
{
- if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()))
+ if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()))
{
- rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map);
- }
- if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0))
- {
- rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model);
- rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- b_rinex_header_updated = true;
+ std::string gal_signal("1B");
+ rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
+ rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
}
}
- if (type_of_rx == 14) // Galileo E1B + Galileo E5a
+ if (type_of_rx == 10) // GPS L1 C/A + Galileo E5a
{
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+ if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()))
{
- rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 5X");
- }
- if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
- {
- rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
- b_rinex_header_updated = true;
+ std::string gal_signal("5X");
+ rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
+ rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
}
}
- if (type_of_rx == 15) // Galileo E1B + Galileo E5b
+ if (type_of_rx == 11) // GPS L1 C/A + Galileo E5b
{
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+ if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()))
{
- rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 7X");
+ std::string gal_signal("7X");
+ rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
+ rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
}
- if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+ }
+ if (type_of_rx == 13) // L5+E5a
+ {
+ if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
{
- rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac);
- rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
- b_rinex_header_updated = true;
+ std::string gal_signal("5X");
+ std::string gps_signal("L5");
+ rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal);
+ rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
+ }
+ }
+ if (type_of_rx == 14) // Galileo E1B + Galileo E5a
+ {
+ if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()))
+ {
+ std::string gal_signal("1B 5X");
+ rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
+ rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
+ }
+ }
+ if (type_of_rx == 15) // Galileo E1B + Galileo E5b
+ {
+ if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()))
+ {
+ std::string gal_signal("1B 7X");
+ rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gal_signal);
+ rp->rinex_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
}
}
if (type_of_rx == 23) // GLONASS L1 C/A only
{
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
+ std::string signal("1G");
+ if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
{
- rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C");
- }
- if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0))
- {
- rp->update_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model);
- b_rinex_header_updated = true;
+ rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal);
+ rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
+ b_rinex_header_written = true; // do not write header anymore
}
}
if (type_of_rx == 24) // GLONASS L2 C/A only
{
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
+ std::string signal("2G");
+ if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
{
- rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "2C");
- }
- if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0))
- {
- rp->update_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model);
- b_rinex_header_updated = true;
+ rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal);
+ rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
+ b_rinex_header_written = true; // do not write header anymore
}
}
if (type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A
{
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
+ std::string signal("1G 2G");
+ if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
{
- rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C 2C");
- }
- if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0))
- {
- rp->update_nav_header(rp->navMixFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model);
- b_rinex_header_updated = true;
+ rp->rinex_obs_header(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, signal);
+ rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
+ b_rinex_header_written = true; // do not write header anymore
}
}
+
if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A
{
- if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()))
+ if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()))
{
- rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
- }
- if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0))
- {
- rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model);
- rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- b_rinex_header_updated = true; // do not write header anymore
+ std::string glo_signal("1G");
+ rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal);
+ if (d_rinex_version == 3)
+ rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ if (d_rinex_version == 2)
+ {
+ rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
+ rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
+ }
+ b_rinex_header_written = true; // do not write header anymore
}
}
- if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A
+ if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A
{
- if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()))
+ if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()))
{
- rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
- }
- if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
- {
- rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
- rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- b_rinex_header_updated = true; // do not write header anymore
+ std::string glo_signal("1G");
+ std::string gal_signal("1B");
+ rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal);
+ rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ b_rinex_header_written = true; // do not write header anymore
}
}
if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A
{
- if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()))
+ if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
{
- rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
- }
- if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0))
- {
- rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model);
- rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- b_rinex_header_updated = true; // do not write header anymore
+ std::string glo_signal("1G");
+ rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal);
+ rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ b_rinex_header_written = true; // do not write header anymore
}
}
if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A
{
- if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end()))
+ if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()))
{
- rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
- }
- if (!b_rinex_header_updated && (d_ls_pvt->gps_utc_model.d_A0 != 0))
- {
- rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model);
- rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- b_rinex_header_updated = true; // do not write header anymore
+ std::string glo_signal("2G");
+ rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal);
+ if (d_rinex_version == 3)
+ rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ if (d_rinex_version == 2)
+ {
+ rp->rinex_nav_header(rp->navFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model);
+ rp->rinex_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, glonass_gnav_ephemeris_iter->second);
+ }
+ b_rinex_header_written = true; // do not write header anymore
}
}
- if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A
+ if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A
{
- if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()))
+ if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()))
{
- rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
- }
- if (!b_rinex_header_updated && (d_ls_pvt->galileo_utc_model.A0_6 != 0))
- {
- rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
- rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->galileo_almanac, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- b_rinex_header_updated = true; // do not write header anymore
+ std::string glo_signal("2G");
+ std::string gal_signal("1B");
+ rp->rinex_obs_header(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal, gal_signal);
+ rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ b_rinex_header_written = true; // do not write header anymore
}
}
if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A
{
- if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.end()))
+ if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
{
- rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ std::string glo_signal("2G");
+ rp->rinex_obs_header(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, glo_signal);
+ rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ b_rinex_header_written = true; // do not write header anymore
}
- if (!b_rinex_header_updated && (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0))
+ }
+
+ if (type_of_rx == 32) // L1+E1+L5+E5a
+ {
+ if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and
+ (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and
+ (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()))
{
- rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model);
- rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
- b_rinex_header_updated = true; // do not write header anymore
+ std::string gal_signal("1B 5X");
+ std::string gps_signal("1C L5");
+ rp->rinex_obs_header(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gps_signal, gal_signal);
+ rp->rinex_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_written = true; // do not write header anymore
+ }
+ }
+ }
+
+ if (b_rinex_header_written) // The header is already written, we can now log the navigation message data
+ {
+ if (flag_write_RINEX_nav_output)
+ {
+ if (type_of_rx == 1) // GPS L1 C/A only
+ {
+ rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map);
+ }
+ if (type_of_rx == 2) // GPS L2C only
+ {
+ rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map);
+ }
+ if (type_of_rx == 3) // GPS L5 only
+ {
+ rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map);
+ }
+ if ((type_of_rx == 4) or (type_of_rx == 5) or (type_of_rx == 6)) // Galileo
+ {
+ rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map);
+ }
+ if (type_of_rx == 7) // GPS L1 C/A + GPS L2C
+ {
+ rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map);
+ }
+ if (type_of_rx == 8) // L1+L5
+ {
+ rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map);
+ }
+ if ((type_of_rx == 9) or (type_of_rx == 10) or (type_of_rx == 11)) // GPS L1 C/A + Galileo
+ {
+ rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map);
+ }
+ if (type_of_rx == 13) // L5+E5a
+ {
+ rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->galileo_ephemeris_map);
+ }
+ if ((type_of_rx == 14) or (type_of_rx == 15)) // Galileo E1B + Galileo E5a
+ {
+ rp->log_rinex_nav(rp->navGalFile, d_ls_pvt->galileo_ephemeris_map);
+ }
+ if ((type_of_rx == 23) or (type_of_rx == 24) or (type_of_rx == 25)) // GLONASS L1 C/A, GLONASS L2 C/A
+ {
+ rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map);
+ }
+ if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A
+ {
+ if (d_rinex_version == 3)
+ rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
+ if (d_rinex_version == 2)
+ {
+ rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map);
+ rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map);
+ }
+ }
+ if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A
+ {
+ rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
+ }
+ if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A
+ {
+ rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
+ }
+ if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A
+ {
+ if (d_rinex_version == 3)
+ rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
+ if (d_rinex_version == 2)
+ {
+ rp->log_rinex_nav(rp->navFile, d_ls_pvt->gps_ephemeris_map);
+ rp->log_rinex_nav(rp->navGloFile, d_ls_pvt->glonass_gnav_ephemeris_map);
+ }
+ }
+ if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A
+ {
+ rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->galileo_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
+ }
+ if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A
+ {
+ rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_cnav_ephemeris_map, d_ls_pvt->glonass_gnav_ephemeris_map);
+ }
+ if (type_of_rx == 32) // L1+E1+L5+E5a
+ {
+ rp->log_rinex_nav(rp->navMixFile, d_ls_pvt->gps_ephemeris_map, d_ls_pvt->galileo_ephemeris_map);
+ }
+ }
+ galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
+ glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
+
+ // Log observables into the RINEX file
+ if (flag_write_RINEX_obs_output)
+ {
+ if (type_of_rx == 1) // GPS L1 C/A only
+ {
+ if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ {
+ rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0))
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model);
+ rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono);
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 2) // GPS L2C only
+ {
+ if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())
+ {
+ rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0))
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model);
+ rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono);
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 3) // GPS L5
+ {
+ if (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())
+ {
+ rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0))
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model);
+ rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono);
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 4) // Galileo E1B only
+ {
+ if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B");
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+ {
+ rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 5) // Galileo E5a only
+ {
+ if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "5X");
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+ {
+ rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 6) // Galileo E5b only
+ {
+ if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "7X");
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+ {
+ rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 7) // GPS L1 C/A + GPS L2C
+ {
+ if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
+ {
+ rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0))
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model);
+ rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono);
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 8) // L1+L5
+ {
+ if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
+ {
+ rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and ((d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) or (d_ls_pvt->gps_utc_model.d_A0 != 0)))
+ {
+ if (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model);
+ rp->update_nav_header(rp->navFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono);
+ }
+ else
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model);
+ rp->update_nav_header(rp->navFile, d_ls_pvt->gps_utc_model, d_ls_pvt->gps_iono);
+ }
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 9) // GPS L1 C/A + Galileo E1B
+ {
+ if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()))
+ {
+ rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0))
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model);
+ rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 13) // L5+E5a
+ {
+ if ((gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()))
+ {
+ rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model);
+ rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_updated = true; // do not write header anymore
+ }
+ }
+ if (type_of_rx == 14) // Galileo E1B + Galileo E5a
+ {
+ if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 5X");
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+ {
+ rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 15) // Galileo E1B + Galileo E5b
+ {
+ if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1B 7X");
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+ {
+ rp->update_nav_header(rp->navGalFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 23) // GLONASS L1 C/A only
+ {
+ if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ {
+ rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C");
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0))
+ {
+ rp->update_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model);
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 24) // GLONASS L2 C/A only
+ {
+ if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ {
+ rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "2C");
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0))
+ {
+ rp->update_nav_header(rp->navGloFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model);
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 25) // GLONASS L1 C/A + GLONASS L2 C/A
+ {
+ if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ {
+ rp->log_rinex_obs(rp->obsFile, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, "1C 2C");
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->glonass_gnav_utc_model.d_tau_c != 0))
+ {
+ rp->update_nav_header(rp->navMixFile, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->glonass_gnav_utc_model);
+ b_rinex_header_updated = true;
+ }
+ }
+ if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A
+ {
+ if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()))
+ {
+ rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0))
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model);
+ rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ b_rinex_header_updated = true; // do not write header anymore
+ }
+ }
+ if (type_of_rx == 27) // Galileo E1B + GLONASS L1 C/A
+ {
+ if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()))
+ {
+ rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
+ rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ b_rinex_header_updated = true; // do not write header anymore
+ }
+ }
+ if (type_of_rx == 28) // GPS L2C + GLONASS L1 C/A
+ {
+ if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
+ {
+ rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0))
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model);
+ rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ b_rinex_header_updated = true; // do not write header anymore
+ }
+ }
+ if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A
+ {
+ if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()))
+ {
+ rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->gps_utc_model.d_A0 != 0))
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model);
+ rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ b_rinex_header_updated = true; // do not write header anymore
+ }
+ }
+ if (type_of_rx == 30) // Galileo E1B + GLONASS L2 C/A
+ {
+ if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()))
+ {
+ rp->log_rinex_obs(rp->obsFile, galileo_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->galileo_utc_model);
+ rp->update_nav_header(rp->navMixFile, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ b_rinex_header_updated = true; // do not write header anymore
+ }
+ }
+ if (type_of_rx == 31) // GPS L2C + GLONASS L2 C/A
+ {
+ if ((glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
+ {
+ rp->log_rinex_obs(rp->obsFile, gps_cnav_ephemeris_iter->second, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0))
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model);
+ rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_iono, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->glonass_gnav_utc_model, d_ls_pvt->glonass_gnav_almanac);
+ b_rinex_header_updated = true; // do not write header anymore
+ }
+ }
+ if (type_of_rx == 32) // L1+E1+L5+E5a
+ {
+ if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()) and (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend()))
+ {
+ rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_observables_map);
+ }
+ if (!b_rinex_header_updated and ((d_ls_pvt->gps_cnav_utc_model.d_A0 != 0) or (d_ls_pvt->gps_utc_model.d_A0 != 0)) and (d_ls_pvt->galileo_utc_model.A0_6 != 0))
+ {
+ if (d_ls_pvt->gps_cnav_utc_model.d_A0 != 0)
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_cnav_utc_model);
+ rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_cnav_utc_model, d_ls_pvt->gps_cnav_iono, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ }
+ else
+ {
+ rp->update_obs_header(rp->obsFile, d_ls_pvt->gps_utc_model);
+ rp->update_nav_header(rp->navMixFile, d_ls_pvt->gps_iono, d_ls_pvt->gps_utc_model, d_ls_pvt->galileo_iono, d_ls_pvt->galileo_utc_model);
+ }
+ b_rinex_header_updated = true; // do not write header anymore
+ }
}
}
}
@@ -1445,25 +1773,23 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
// ####################### RTCM MESSAGES #################
try
{
- if (b_rtcm_writing_started)
+ if (b_rtcm_writing_started and b_rtcm_enabled)
{
if (type_of_rx == 1) // GPS L1 C/A
{
if (flag_write_RTCM_1019_output == true)
{
- for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++)
+ for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
}
}
if (flag_write_RTCM_MSM_output == true)
{
- std::map::const_iterator gps_ephemeris_iter;
- gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
-
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
- d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
}
}
@@ -1471,18 +1797,17 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
if (flag_write_RTCM_1045_output == true)
{
- for (std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++)
+ for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1045(gal_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second);
}
}
if (flag_write_RTCM_MSM_output == true)
{
- std::map::const_iterator gal_ephemeris_iter;
- gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
- if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
}
}
@@ -1490,20 +1815,37 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
if (flag_write_RTCM_1019_output == true)
{
- for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++)
+ for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
}
}
if (flag_write_RTCM_MSM_output == true)
{
- std::map::const_iterator gps_ephemeris_iter;
- gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
- std::map::const_iterator gps_cnav_ephemeris_iter;
- gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
- if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
+ if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
{
- d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ }
+ }
+ if (type_of_rx == 8) // L1+L5
+ {
+ if (flag_write_RTCM_1019_output == true)
+ {
+ for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
+ {
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
+ }
+ }
+ if (flag_write_RTCM_MSM_output == true)
+ {
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
+ if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
}
}
@@ -1511,23 +1853,25 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
if (flag_write_RTCM_1019_output == true)
{
- for (gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end(); gps_ephemeris_iter++)
+ for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
}
}
if (flag_write_RTCM_1045_output == true)
{
- for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); galileo_ephemeris_iter++)
+ for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second);
}
}
if (flag_write_RTCM_MSM_output == true)
{
- //gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end();
- //galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end();
- uint32_t i = 0;
+ std::map::const_iterator gnss_observables_iter;
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ int gps_channel = 0;
+ int gal_channel = 0;
for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
{
std::string system(&gnss_observables_iter->second.System, 1);
@@ -1536,10 +1880,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
if (system.compare("G") == 0)
{
// This is a channel with valid GPS signal
- gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
- gps_channel = i;
+ gps_channel = 1;
}
}
}
@@ -1547,28 +1891,46 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
if (system.compare("E") == 0)
{
- galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
- gal_channel = i;
+ gal_channel = 1;
}
}
}
- i++;
}
- if (flag_write_RTCM_MSM_output == true)
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
- if (flag_write_RTCM_MSM_output == true)
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ }
+ }
+ if (type_of_rx == 13) // L5+E5a
+ {
+ std::map::const_iterator gal_eph_iter;
+ std::map::const_iterator gps_cnav_eph_iter;
+ if (flag_write_RTCM_1045_output == true)
+ {
+ for (gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++)
+ {
+ d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second);
+ }
+ }
+ gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
+ if (flag_write_RTCM_MSM_output == true)
+ {
+ if (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
}
}
@@ -1581,22 +1943,24 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model);
}
}
-
- std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
-
- if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ if (flag_write_RTCM_MSM_output == true)
{
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
+ if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
}
b_rtcm_writing_started = true;
}
if (type_of_rx == 26) // GPS L1 C/A + GLONASS L1 C/A
{
+ std::map::const_iterator gps_eph_iter;
if (flag_write_RTCM_1019_output == true)
{
- for (gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++)
+ for (gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
}
}
if (flag_write_RTCM_1020_output == true)
@@ -1608,10 +1972,12 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
}
if (flag_write_RTCM_MSM_output == true)
{
- //gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end();
- //galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end();
- uint32_t i = 0;
- for (gnss_observables_iter = gnss_observables_map.begin(); gnss_observables_iter != gnss_observables_map.end(); gnss_observables_iter++)
+ std::map::const_iterator gnss_observables_iter;
+ std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ int gps_channel = 0;
+ int glo_channel = 0;
+ for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
{
std::string system(&gnss_observables_iter->second.System, 1);
if (gps_channel == 0)
@@ -1619,10 +1985,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
if (system.compare("G") == 0)
{
// This is a channel with valid GPS signal
- gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
- gps_channel = i;
+ gps_channel = 1;
}
}
}
@@ -1630,28 +1996,22 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
if (system.compare("R") == 0)
{
- glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
{
- glo_channel = i;
+ glo_channel = 1;
}
}
}
- i++;
}
- if (flag_write_RTCM_MSM_output == true)
+
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
{
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
- if (flag_write_RTCM_MSM_output == true)
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
}
}
@@ -1659,23 +2019,25 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
if (flag_write_RTCM_1020_output == true)
{
- for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++)
+ for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model);
+ d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model);
}
}
if (flag_write_RTCM_1045_output == true)
{
- for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++)
+ for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second);
}
}
if (flag_write_RTCM_MSM_output == true)
{
- // gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end();
- // galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end();
- uint32_t i = 0;
+ std::map::const_iterator gnss_observables_iter;
+ std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
+ int gal_channel = 0;
+ int glo_channel = 0;
for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
{
std::string system(&gnss_observables_iter->second.System, 1);
@@ -1684,10 +2046,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
if (system.compare("E") == 0)
{
// This is a channel with valid GPS signal
- galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
- gal_channel = i;
+ gal_channel = 1;
}
}
}
@@ -1695,28 +2057,21 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
if (system.compare("R") == 0)
{
- glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
+ glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
{
- glo_channel = i;
+ glo_channel = 1;
}
}
}
- i++;
}
- if (flag_write_RTCM_MSM_output == true)
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
- if (flag_write_RTCM_MSM_output == true)
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
{
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
}
}
@@ -1724,24 +2079,26 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
if (flag_write_RTCM_1019_output == true)
{
- for (gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++)
+ for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
}
}
if (flag_write_RTCM_1020_output == true)
{
- for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++)
+ for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model);
+ d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model);
}
}
if (flag_write_RTCM_MSM_output == true)
{
- // gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end();
- // galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end();
- uint32_t i = 0;
- for (gnss_observables_iter = gnss_observables_map.begin(); gnss_observables_iter != gnss_observables_map.end(); gnss_observables_iter++)
+ std::map::const_iterator gnss_observables_iter;
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
+ int gps_channel = 0;
+ int glo_channel = 0;
+ for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
{
std::string system(&gnss_observables_iter->second.System, 1);
if (gps_channel == 0)
@@ -1749,10 +2106,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
if (system.compare("G") == 0)
{
// This is a channel with valid GPS signal
- gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
- gps_channel = i;
+ gps_channel = 1;
}
}
}
@@ -1760,28 +2117,21 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
if (system.compare("R") == 0)
{
- glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
{
- glo_channel = i;
+ glo_channel = 1;
}
}
}
- i++;
}
- if (flag_write_RTCM_MSM_output == true)
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
{
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
- if (flag_write_RTCM_MSM_output == true)
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
}
}
@@ -1789,23 +2139,25 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
if (flag_write_RTCM_1020_output == true)
{
- for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++)
+ for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model);
+ d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model);
}
}
if (flag_write_RTCM_1045_output == true)
{
- for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++)
+ for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second);
}
}
if (flag_write_RTCM_MSM_output == true)
{
- // gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end();
- // galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end();
- uint32_t i = 0;
+ std::map::const_iterator gnss_observables_iter;
+ std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
+ int gal_channel = 0;
+ int glo_channel = 0;
for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
{
std::string system(&gnss_observables_iter->second.System, 1);
@@ -1814,10 +2166,10 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
if (system.compare("E") == 0)
{
// This is a channel with valid GPS signal
- galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
- gal_channel = i;
+ gal_channel = 1;
}
}
}
@@ -1825,78 +2177,164 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
if (system.compare("R") == 0)
{
- glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
+ glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
{
- glo_channel = i;
+ glo_channel = 1;
}
}
}
- i++;
}
- if (flag_write_RTCM_MSM_output == true)
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ }
+ }
+ if (type_of_rx == 32) // L1+E1+L5+E5a
+ {
+ if (flag_write_RTCM_1019_output == true)
+ {
+ for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
+ {
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
+ }
+ }
+ if (flag_write_RTCM_1045_output == true)
+ {
+ for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++)
+ {
+ d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second);
+ }
+ }
+ if (flag_write_RTCM_MSM_output == true)
+ {
+ std::map::const_iterator gnss_observables_iter;
+ std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ int gal_channel = 0;
+ int gps_channel = 0;
+ for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
+ {
+ std::string system(&gnss_observables_iter->second.System, 1);
+ if (gal_channel == 0)
{
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ if (system.compare("E") == 0)
+ {
+ // This is a channel with valid GPS signal
+ gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ gal_channel = 1;
+ }
+ }
+ }
+ if (gps_channel == 0)
+ {
+ if (system.compare("G") == 0)
+ {
+ gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ {
+ gps_channel = 1;
+ }
+ }
}
}
- if (flag_write_RTCM_MSM_output == true)
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
}
}
}
- if (!b_rtcm_writing_started) // the first time
+ if (!b_rtcm_writing_started and b_rtcm_enabled) // the first time
{
if (type_of_rx == 1) // GPS L1 C/A
{
- for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++)
+ if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
+ for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
+ {
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
+ }
}
-
- std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
-
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ if (d_rtcm_MSM_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
}
b_rtcm_writing_started = true;
}
if ((type_of_rx == 4) || (type_of_rx == 5) || (type_of_rx == 6) || (type_of_rx == 14) || (type_of_rx == 15)) // Galileo
{
- for (std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_ephemeris_iter++)
+ if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- d_rtcm_printer->Print_Rtcm_MT1045(gal_ephemeris_iter->second);
+ for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++)
+ {
+ d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second);
+ }
}
-
- std::map::const_iterator gal_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
-
- if (gal_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ if (d_rtcm_MSM_rate_ms != 0)
{
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
}
b_rtcm_writing_started = true;
}
if (type_of_rx == 7) // GPS L1 C/A + GPS L2C
{
- for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++)
+ if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
+ for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
+ {
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
+ }
}
-
- std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
- std::map::const_iterator gps_cnav_ephemeris_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
-
- if ((gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend()) && (gps_cnav_ephemeris_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
+ if (d_rtcm_MSM_rate_ms != 0)
{
- d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, gps_cnav_ephemeris_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
+ if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ }
+ b_rtcm_writing_started = true;
+ }
+ if (type_of_rx == 8) // L1+L5
+ {
+ if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0
+ {
+ for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
+ {
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
+ }
+ }
+ if (d_rtcm_MSM_rate_ms != 0)
+ {
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ std::map::const_iterator gps_cnav_eph_iter = d_ls_pvt->gps_cnav_ephemeris_map.cbegin();
+ if ((gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend()) and (gps_cnav_eph_iter != d_ls_pvt->gps_cnav_ephemeris_map.cend()))
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, gps_cnav_eph_iter->second, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
}
b_rtcm_writing_started = true;
}
@@ -1904,72 +2342,99 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- for (std::map::const_iterator gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++)
+ for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
}
}
if (d_rtcm_MT1045_rate_ms != 0)
{
- for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end(); galileo_ephemeris_iter++)
+ for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second);
}
}
-
- uint32_t i = 0;
- for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
+ if (d_rtcm_MSM_rate_ms != 0)
{
- std::string system(&gnss_observables_iter->second.System, 1);
- if (gps_channel == 0)
+ std::map::const_iterator gnss_observables_iter;
+ std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ int gps_channel = 0;
+ int gal_channel = 0;
+ for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
{
- if (system.compare("G") == 0)
+ std::string system(&gnss_observables_iter->second.System, 1);
+ if (gps_channel == 0)
{
- // This is a channel with valid GPS signal
- gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())
+ if (system.compare("G") == 0)
{
- gps_channel = i;
+ // This is a channel with valid GPS signal
+ gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ {
+ gps_channel = 1;
+ }
+ }
+ }
+ if (gal_channel == 0)
+ {
+ if (system.compare("E") == 0)
+ {
+ gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ gal_channel = 1;
+ }
}
}
}
- if (gal_channel == 0)
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
{
- if (system.compare("E") == 0)
- {
- galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
- {
- gal_channel = i;
- }
- }
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
- i++;
- }
-
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end() && (d_rtcm_MT1077_rate_ms != 0))
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
-
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end() && (d_rtcm_MT1097_rate_ms != 0))
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
b_rtcm_writing_started = true;
}
if ((type_of_rx == 23) || (type_of_rx == 24) || (type_of_rx == 25)) // GLONASS
{
- for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++)
+ if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model);
+ for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++)
+ {
+ d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model);
+ }
}
-
- std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
-
- if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ if (d_rtcm_MSM_rate_ms != 0)
{
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ std::map::const_iterator glo_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
+ if (glo_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glo_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ }
+ b_rtcm_writing_started = true;
+ }
+ if (type_of_rx == 13) // L5+E5a
+ {
+ std::map::const_iterator gal_eph_iter;
+ if (d_rtcm_MT1045_rate_ms != 0)
+ {
+ for (gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++)
+ {
+ d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second);
+ }
+ }
+ if (d_rtcm_MSM_rate_ms != 0)
+ {
+ gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend() and (d_rtcm_MT1097_rate_ms != 0))
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
}
b_rtcm_writing_started = true;
}
@@ -1977,235 +2442,310 @@ int rtklib_pvt_cc::work(int noutput_items, gr_vector_const_void_star& input_item
{
if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- for (gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++)
+ for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
}
}
if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++)
+ for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model);
+ d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model);
}
}
-
- // gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end();
- // galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end();
- uint32_t i = 0;
- for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
+ if (d_rtcm_MSM_rate_ms != 0)
{
- std::string system(&gnss_observables_iter->second.System, 1);
- if (gps_channel == 0)
+ std::map::const_iterator gnss_observables_iter;
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
+ int gps_channel = 0;
+ int glo_channel = 0;
+ for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
{
- if (system.compare("G") == 0)
+ std::string system(&gnss_observables_iter->second.System, 1);
+ if (gps_channel == 0)
{
- // This is a channel with valid GPS signal
- gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ if (system.compare("G") == 0)
{
- gps_channel = i;
+ // This is a channel with valid GPS signal
+ gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ {
+ gps_channel = 1;
+ }
+ }
+ }
+ if (glo_channel == 0)
+ {
+ if (system.compare("R") == 0)
+ {
+ glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ {
+ glo_channel = 1;
+ }
}
}
}
- if (glo_channel == 0)
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
{
- if (system.compare("R") == 0)
- {
- glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
- {
- glo_channel = i;
- }
- }
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
- i++;
}
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
-
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
-
b_rtcm_writing_started = true;
}
if (type_of_rx == 27) // GLONASS L1 C/A + Galileo E1B
{
if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++)
+ for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model);
+ d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model);
}
}
if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++)
+ for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second);
}
}
-
- uint32_t i = 0;
- for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
+ if (d_rtcm_MSM_rate_ms != 0)
{
- std::string system(&gnss_observables_iter->second.System, 1);
- if (gal_channel == 0)
+ int gal_channel = 0;
+ int glo_channel = 0;
+ std::map::const_iterator gnss_observables_iter;
+ std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
+ for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
{
- if (system.compare("E") == 0)
+ std::string system(&gnss_observables_iter->second.System, 1);
+ if (gal_channel == 0)
{
- // This is a channel with valid GPS signal
- galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ if (system.compare("E") == 0)
{
- gal_channel = i;
+ // This is a channel with valid GPS signal
+ gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ gal_channel = 1;
+ }
+ }
+ }
+ if (glo_channel == 0)
+ {
+ if (system.compare("R") == 0)
+ {
+ glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ {
+ glo_channel = 1;
+ }
}
}
}
- if (glo_channel == 0)
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
- if (system.compare("R") == 0)
- {
- glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
- {
- glo_channel = i;
- }
- }
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
- i++;
- }
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
+ b_rtcm_writing_started = true;
}
if (type_of_rx == 29) // GPS L1 C/A + GLONASS L2 C/A
{
if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- for (gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_ephemeris_iter++)
+ for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1019(gps_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
}
}
if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++)
+ for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model);
+ d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model);
}
}
-
- // gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.end();
- // galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.end();
- uint32_t i = 0;
- for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
+ if (d_rtcm_MSM_rate_ms != 0)
{
- std::string system(&gnss_observables_iter->second.System, 1);
- if (gps_channel == 0)
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
+ std::map::const_iterator gnss_observables_iter;
+ int gps_channel = 0;
+ int glo_channel = 0;
+ for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
{
- if (system.compare("G") == 0)
+ std::string system(&gnss_observables_iter->second.System, 1);
+ if (gps_channel == 0)
{
- // This is a channel with valid GPS signal
- gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ if (system.compare("G") == 0)
{
- gps_channel = i;
+ // This is a channel with valid GPS signal
+ gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ {
+ gps_channel = 1;
+ }
+ }
+ }
+ if (glo_channel == 0)
+ {
+ if (system.compare("R") == 0)
+ {
+ glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ {
+ glo_channel = 1;
+ }
}
}
}
- if (glo_channel == 0)
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
{
- if (system.compare("R") == 0)
- {
- glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
- {
- glo_channel = i;
- }
- }
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
}
- i++;
- }
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
- if (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.cend())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, gps_ephemeris_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
}
-
b_rtcm_writing_started = true;
}
if (type_of_rx == 30) // GLONASS L2 C/A + Galileo E1B
{
if (d_rtcm_MT1020_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- for (std::map::const_iterator glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_ephemeris_iter++)
+ for (std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin(); glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend(); glonass_gnav_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_ephemeris_iter->second, d_ls_pvt->glonass_gnav_utc_model);
+ d_rtcm_printer->Print_Rtcm_MT1020(glonass_gnav_eph_iter->second, d_ls_pvt->glonass_gnav_utc_model);
}
}
if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0
{
- for (galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend(); galileo_ephemeris_iter++)
+ for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++)
{
- d_rtcm_printer->Print_Rtcm_MT1045(galileo_ephemeris_iter->second);
+ d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second);
}
}
-
- uint32_t i = 0;
- for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
+ if (d_rtcm_MSM_rate_ms != 0)
{
- std::string system(&gnss_observables_iter->second.System, 1);
- if (gal_channel == 0)
+ int gal_channel = 0;
+ int glo_channel = 0;
+ std::map::const_iterator gnss_observables_iter;
+ std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ std::map::const_iterator glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.cbegin();
+ for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
{
- if (system.compare("E") == 0)
+ std::string system(&gnss_observables_iter->second.System, 1);
+ if (gal_channel == 0)
{
- // This is a channel with valid GPS signal
- galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ if (system.compare("E") == 0)
{
- gal_channel = i;
+ // This is a channel with valid GPS signal
+ gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ gal_channel = 1;
+ }
+ }
+ }
+ if (glo_channel == 0)
+ {
+ if (system.compare("R") == 0)
+ {
+ glonass_gnav_eph_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ {
+ glo_channel = 1;
+ }
}
}
}
- if (glo_channel == 0)
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
{
- if (system.compare("R") == 0)
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ if (glonass_gnav_eph_iter != d_ls_pvt->glonass_gnav_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_eph_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ }
+ b_rtcm_writing_started = true;
+ }
+ if (type_of_rx == 32) // L1+E1+L5+E5a
+ {
+ if (d_rtcm_MT1019_rate_ms != 0) // allows deactivating messages by setting rate = 0
+ {
+ for (std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin(); gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend(); gps_eph_iter++)
+ {
+ d_rtcm_printer->Print_Rtcm_MT1019(gps_eph_iter->second);
+ }
+ }
+ if (d_rtcm_MT1045_rate_ms != 0) // allows deactivating messages by setting rate = 0
+ {
+ for (std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin(); gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend(); gal_eph_iter++)
+ {
+ d_rtcm_printer->Print_Rtcm_MT1045(gal_eph_iter->second);
+ }
+ }
+ if (d_rtcm_MSM_rate_ms != 0)
+ {
+ std::map::const_iterator gnss_observables_iter;
+ std::map::const_iterator gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.cbegin();
+ std::map::const_iterator gps_eph_iter = d_ls_pvt->gps_ephemeris_map.cbegin();
+ int gps_channel = 0;
+ int gal_channel = 0;
+ for (gnss_observables_iter = gnss_observables_map.cbegin(); gnss_observables_iter != gnss_observables_map.cend(); gnss_observables_iter++)
+ {
+ std::string system(&gnss_observables_iter->second.System, 1);
+ if (gps_channel == 0)
{
- glonass_gnav_ephemeris_iter = d_ls_pvt->glonass_gnav_ephemeris_map.find(gnss_observables_iter->second.PRN);
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
+ if (system.compare("G") == 0)
{
- glo_channel = i;
+ // This is a channel with valid GPS signal
+ gps_eph_iter = d_ls_pvt->gps_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ {
+ gps_channel = 1;
+ }
+ }
+ }
+ if (gal_channel == 0)
+ {
+ if (system.compare("E") == 0)
+ {
+ gal_eph_iter = d_ls_pvt->galileo_ephemeris_map.find(gnss_observables_iter->second.PRN);
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ gal_channel = 1;
+ }
}
}
}
- i++;
- }
- if (galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, galileo_ephemeris_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
- }
- if (glonass_gnav_ephemeris_iter != d_ls_pvt->glonass_gnav_ephemeris_map.end())
- {
- d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, {}, glonass_gnav_ephemeris_iter->second, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ if (gps_eph_iter != d_ls_pvt->gps_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, gps_eph_iter->second, {}, {}, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
+ if (gal_eph_iter != d_ls_pvt->galileo_ephemeris_map.cend())
+ {
+ d_rtcm_printer->Print_Rtcm_MSM(7, {}, {}, gal_eph_iter->second, {}, d_rx_time, gnss_observables_map, 0, 0, 0, 0, 0);
+ }
}
+ b_rtcm_writing_started = true;
}
}
}
-
catch (const boost::exception& ex)
{
std::cout << "RTCM boost exception: " << boost::diagnostic_information(ex) << std::endl;
diff --git a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h
index 3dfb87858..427936704 100644
--- a/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h
+++ b/src/algorithms/PVT/gnuradio_blocks/rtklib_pvt_cc.h
@@ -38,6 +38,7 @@
#include "geojson_printer.h"
#include "rinex_printer.h"
#include "rtcm_printer.h"
+#include "pvt_conf.h"
#include "rtklib_solver.h"
#include
#include
@@ -55,23 +56,7 @@ class rtklib_pvt_cc;
typedef boost::shared_ptr rtklib_pvt_cc_sptr;
rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t n_channels,
- bool dump,
- std::string dump_filename,
- int32_t output_rate_ms,
- int32_t display_rate_ms,
- bool flag_nmea_tty_port,
- std::string nmea_dump_filename,
- std::string nmea_dump_devname,
- int32_t rinex_version,
- int32_t rinexobs_rate_ms,
- int32_t rinexnav_rate_ms,
- bool flag_rtcm_server,
- bool flag_rtcm_tty_port,
- uint16_t rtcm_tcp_port,
- uint16_t rtcm_station_id,
- std::map rtcm_msg_rate_ms,
- std::string rtcm_dump_devname,
- const uint32_t type_of_receiver,
+ const Pvt_Conf& conf_,
rtk_t& rtk);
/*!
@@ -81,28 +66,14 @@ class rtklib_pvt_cc : public gr::sync_block
{
private:
friend rtklib_pvt_cc_sptr rtklib_make_pvt_cc(uint32_t nchannels,
- bool dump,
- std::string dump_filename,
- int32_t output_rate_ms,
- int32_t display_rate_ms,
- bool flag_nmea_tty_port,
- std::string nmea_dump_filename,
- std::string nmea_dump_devname,
- int32_t rinex_version,
- int32_t rinexobs_rate_ms,
- int32_t rinexnav_rate_ms,
- bool flag_rtcm_server,
- bool flag_rtcm_tty_port,
- uint16_t rtcm_tcp_port,
- uint16_t rtcm_station_id,
- std::map rtcm_msg_rate_ms,
- std::string rtcm_dump_devname,
- const uint32_t type_of_receiver,
+ const Pvt_Conf& conf_,
rtk_t& rtk);
void msg_handler_telemetry(pmt::pmt_t msg);
bool d_dump;
+ bool d_dump_mat;
+ bool b_rinex_output_enabled;
bool b_rinex_header_written;
bool b_rinex_header_updated;
double d_rinex_version;
@@ -110,6 +81,7 @@ private:
int32_t d_rinexnav_rate_ms;
bool b_rtcm_writing_started;
+ bool b_rtcm_enabled;
int32_t d_rtcm_MT1045_rate_ms; //!< Galileo Broadcast Ephemeris
int32_t d_rtcm_MT1019_rate_ms; //!< GPS Broadcast Ephemeris (orbits)
int32_t d_rtcm_MT1020_rate_ms; //!< GLONASS Broadcast Ephemeris (orbits)
@@ -134,6 +106,10 @@ private:
std::shared_ptr d_rtcm_printer;
double d_rx_time;
+ bool d_geojson_output_enabled;
+ bool d_gpx_output_enabled;
+ bool d_kml_output_enabled;
+
std::shared_ptr d_ls_pvt;
std::map gnss_observables_map;
@@ -156,24 +132,13 @@ private:
bool load_gnss_synchro_map_xml(const std::string file_name); //debug helper function
+ bool d_xml_storage;
+ std::string xml_base_path;
+
+
public:
rtklib_pvt_cc(uint32_t nchannels,
- bool dump, std::string dump_filename,
- int32_t output_rate_ms,
- int32_t display_rate_ms,
- bool flag_nmea_tty_port,
- std::string nmea_dump_filename,
- std::string nmea_dump_devname,
- int32_t rinex_version,
- int32_t rinexobs_rate_ms,
- int32_t rinexnav_rate_ms,
- bool flag_rtcm_server,
- bool flag_rtcm_tty_port,
- uint16_t rtcm_tcp_port,
- uint16_t rtcm_station_id,
- std::map rtcm_msg_rate_ms,
- std::string rtcm_dump_devname,
- const uint32_t type_of_receiver,
+ const Pvt_Conf& conf_,
rtk_t& rtk);
/*!
diff --git a/src/algorithms/PVT/libs/CMakeLists.txt b/src/algorithms/PVT/libs/CMakeLists.txt
index caf02a4ce..6807e9602 100644
--- a/src/algorithms/PVT/libs/CMakeLists.txt
+++ b/src/algorithms/PVT/libs/CMakeLists.txt
@@ -29,6 +29,7 @@ set(PVT_LIB_SOURCES
rtcm_printer.cc
geojson_printer.cc
rtklib_solver.cc
+ pvt_conf.cc
)
set(PVT_LIB_HEADERS
@@ -42,6 +43,7 @@ set(PVT_LIB_HEADERS
rtcm_printer.h
geojson_printer.h
rtklib_solver.h
+ pvt_conf.h
)
@@ -57,6 +59,7 @@ include_directories(
${ARMADILLO_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
+ ${MATIO_INCLUDE_DIRS}
)
list(SORT PVT_LIB_HEADERS)
@@ -64,7 +67,12 @@ list(SORT PVT_LIB_SOURCES)
add_library(pvt_lib ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS})
source_group(Headers FILES ${PVT_LIB_HEADERS})
-add_dependencies(pvt_lib rtklib_lib armadillo-${armadillo_RELEASE} glog-${glog_RELEASE})
+
+if(MATIO_FOUND)
+ add_dependencies(pvt_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE})
+else(MATIO_FOUND)
+ add_dependencies(pvt_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE} matio-${GNSSSDR_MATIO_LOCAL_VERSION})
+endif(MATIO_FOUND)
target_link_libraries(
pvt_lib
@@ -75,4 +83,5 @@ target_link_libraries(
${ARMADILLO_LIBRARIES}
${BLAS}
${LAPACK}
+ ${MATIO_LIBRARIES}
)
diff --git a/src/algorithms/PVT/libs/geojson_printer.cc b/src/algorithms/PVT/libs/geojson_printer.cc
index 5dd3ecdba..b79a4edae 100644
--- a/src/algorithms/PVT/libs/geojson_printer.cc
+++ b/src/algorithms/PVT/libs/geojson_printer.cc
@@ -32,14 +32,48 @@
#include "geojson_printer.h"
#include
+#include // for create_directories, exists
+#include // for path, operator<<
+#include // for filesystem
#include
#include
#include
-GeoJSON_Printer::GeoJSON_Printer()
+GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path)
{
first_pos = true;
+ geojson_base_path = base_path;
+ boost::filesystem::path full_path(boost::filesystem::current_path());
+ const boost::filesystem::path p(geojson_base_path);
+ if (!boost::filesystem::exists(p))
+ {
+ std::string new_folder;
+ for (auto& folder : boost::filesystem::path(geojson_base_path))
+ {
+ new_folder += folder.string();
+ boost::system::error_code ec;
+ if (!boost::filesystem::exists(new_folder))
+ {
+ if (!boost::filesystem::create_directory(new_folder, ec))
+ {
+ std::cout << "Could not create the " << new_folder << " folder." << std::endl;
+ geojson_base_path = full_path.string();
+ }
+ }
+ new_folder += boost::filesystem::path::preferred_separator;
+ }
+ }
+ else
+ {
+ geojson_base_path = p.string();
+ }
+ if (geojson_base_path.compare(".") != 0)
+ {
+ std::cout << "GeoJSON files will be stored at " << geojson_base_path << std::endl;
+ }
+
+ geojson_base_path = geojson_base_path + boost::filesystem::path::preferred_separator;
}
@@ -96,6 +130,7 @@ bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name)
{
filename_ = filename + ".geojson";
}
+ filename_ = geojson_base_path + filename_;
geojson_file.open(filename_.c_str());
@@ -124,6 +159,7 @@ bool GeoJSON_Printer::set_headers(std::string filename, bool time_tag_name)
}
else
{
+ std::cout << "File " << filename_ << " cannot be saved. Wrong permissions?" << std::endl;
return false;
}
}
diff --git a/src/algorithms/PVT/libs/geojson_printer.h b/src/algorithms/PVT/libs/geojson_printer.h
index 9963e64d2..63630552c 100644
--- a/src/algorithms/PVT/libs/geojson_printer.h
+++ b/src/algorithms/PVT/libs/geojson_printer.h
@@ -50,9 +50,10 @@ private:
std::ofstream geojson_file;
bool first_pos;
std::string filename_;
+ std::string geojson_base_path;
public:
- GeoJSON_Printer();
+ GeoJSON_Printer(const std::string& base_path = ".");
~GeoJSON_Printer();
bool set_headers(std::string filename, bool time_tag_name = true);
bool print_position(const std::shared_ptr& position, bool print_average_values);
diff --git a/src/algorithms/PVT/libs/gpx_printer.cc b/src/algorithms/PVT/libs/gpx_printer.cc
index 51fa6760f..f0b4b3ff3 100644
--- a/src/algorithms/PVT/libs/gpx_printer.cc
+++ b/src/algorithms/PVT/libs/gpx_printer.cc
@@ -32,11 +32,53 @@
#include "gpx_printer.h"
#include
+#include // for create_directories, exists
+#include // for path, operator<<
+#include // for filesystem
#include
#include
using google::LogMessage;
+
+Gpx_Printer::Gpx_Printer(const std::string& base_path)
+{
+ positions_printed = false;
+ indent = " ";
+ gpx_base_path = base_path;
+ boost::filesystem::path full_path(boost::filesystem::current_path());
+ const boost::filesystem::path p(gpx_base_path);
+ if (!boost::filesystem::exists(p))
+ {
+ std::string new_folder;
+ for (auto& folder : boost::filesystem::path(gpx_base_path))
+ {
+ new_folder += folder.string();
+ boost::system::error_code ec;
+ if (!boost::filesystem::exists(new_folder))
+ {
+ if (!boost::filesystem::create_directory(new_folder, ec))
+ {
+ std::cout << "Could not create the " << new_folder << " folder." << std::endl;
+ gpx_base_path = full_path.string();
+ }
+ }
+ new_folder += boost::filesystem::path::preferred_separator;
+ }
+ }
+ else
+ {
+ gpx_base_path = p.string();
+ }
+ if (gpx_base_path.compare(".") != 0)
+ {
+ std::cout << "GPX files will be stored at " << gpx_base_path << std::endl;
+ }
+
+ gpx_base_path = gpx_base_path + boost::filesystem::path::preferred_separator;
+}
+
+
bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name)
{
boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time();
@@ -84,6 +126,8 @@ bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name)
{
gpx_filename = filename + ".gpx";
}
+
+ gpx_filename = gpx_base_path + gpx_filename;
gpx_file.open(gpx_filename.c_str());
if (gpx_file.is_open())
@@ -105,6 +149,7 @@ bool Gpx_Printer::set_headers(std::string filename, bool time_tag_name)
}
else
{
+ std::cout << "File " << gpx_filename << " cannot be saved. Wrong permissions?" << std::endl;
return false;
}
}
@@ -171,13 +216,6 @@ bool Gpx_Printer::close_file()
}
-Gpx_Printer::Gpx_Printer()
-{
- positions_printed = false;
- indent = " ";
-}
-
-
Gpx_Printer::~Gpx_Printer()
{
close_file();
diff --git a/src/algorithms/PVT/libs/gpx_printer.h b/src/algorithms/PVT/libs/gpx_printer.h
index f158b6fb9..d4efcf81d 100644
--- a/src/algorithms/PVT/libs/gpx_printer.h
+++ b/src/algorithms/PVT/libs/gpx_printer.h
@@ -52,9 +52,10 @@ private:
bool positions_printed;
std::string gpx_filename;
std::string indent;
+ std::string gpx_base_path;
public:
- Gpx_Printer();
+ Gpx_Printer(const std::string& base_path = ".");
~Gpx_Printer();
bool set_headers(std::string filename, bool time_tag_name = true);
bool print_position(const std::shared_ptr& position, bool print_average_values);
diff --git a/src/algorithms/PVT/libs/hybrid_ls_pvt.h b/src/algorithms/PVT/libs/hybrid_ls_pvt.h
index f8a6fc32c..2fe5fd9f3 100644
--- a/src/algorithms/PVT/libs/hybrid_ls_pvt.h
+++ b/src/algorithms/PVT/libs/hybrid_ls_pvt.h
@@ -36,6 +36,7 @@
#include "galileo_navigation_message.h"
#include "gps_navigation_message.h"
#include "gps_cnav_navigation_message.h"
+#include "galileo_almanac.h"
#include "gnss_synchro.h"
#include "rtklib_rtkcmn.h"
#include
diff --git a/src/algorithms/PVT/libs/kml_printer.cc b/src/algorithms/PVT/libs/kml_printer.cc
index 1233df036..4ebfcb970 100644
--- a/src/algorithms/PVT/libs/kml_printer.cc
+++ b/src/algorithms/PVT/libs/kml_printer.cc
@@ -31,11 +31,52 @@
#include "kml_printer.h"
#include
+#include // for create_directories, exists
+#include // for path, operator<<
+#include // for filesystem
#include
#include
using google::LogMessage;
+
+Kml_Printer::Kml_Printer(const std::string& base_path)
+{
+ positions_printed = false;
+ kml_base_path = base_path;
+ boost::filesystem::path full_path(boost::filesystem::current_path());
+ const boost::filesystem::path p(kml_base_path);
+ if (!boost::filesystem::exists(p))
+ {
+ std::string new_folder;
+ for (auto& folder : boost::filesystem::path(kml_base_path))
+ {
+ new_folder += folder.string();
+ boost::system::error_code ec;
+ if (!boost::filesystem::exists(new_folder))
+ {
+ if (!boost::filesystem::create_directory(new_folder, ec))
+ {
+ std::cout << "Could not create the " << new_folder << " folder." << std::endl;
+ kml_base_path = full_path.string();
+ }
+ }
+ new_folder += boost::filesystem::path::preferred_separator;
+ }
+ }
+ else
+ {
+ kml_base_path = p.string();
+ }
+ if (kml_base_path.compare(".") != 0)
+ {
+ std::cout << "KML files will be stored at " << kml_base_path << std::endl;
+ }
+
+ kml_base_path = kml_base_path + boost::filesystem::path::preferred_separator;
+}
+
+
bool Kml_Printer::set_headers(std::string filename, bool time_tag_name)
{
boost::posix_time::ptime pt = boost::posix_time::second_clock::local_time();
@@ -83,6 +124,7 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name)
{
kml_filename = filename + ".kml";
}
+ kml_filename = kml_base_path + kml_filename;
kml_file.open(kml_filename.c_str());
if (kml_file.is_open())
@@ -119,6 +161,7 @@ bool Kml_Printer::set_headers(std::string filename, bool time_tag_name)
}
else
{
+ std::cout << "File " << kml_filename << " cannot be saved. Wrong permissions?" << std::endl;
return false;
}
}
@@ -178,12 +221,6 @@ bool Kml_Printer::close_file()
}
-Kml_Printer::Kml_Printer()
-{
- positions_printed = false;
-}
-
-
Kml_Printer::~Kml_Printer()
{
close_file();
diff --git a/src/algorithms/PVT/libs/kml_printer.h b/src/algorithms/PVT/libs/kml_printer.h
index 435943a6c..9aed7c02c 100644
--- a/src/algorithms/PVT/libs/kml_printer.h
+++ b/src/algorithms/PVT/libs/kml_printer.h
@@ -50,9 +50,10 @@ private:
std::ofstream kml_file;
bool positions_printed;
std::string kml_filename;
+ std::string kml_base_path;
public:
- Kml_Printer();
+ Kml_Printer(const std::string& base_path = std::string("."));
~Kml_Printer();
bool set_headers(std::string filename, bool time_tag_name = true);
bool print_position(const std::shared_ptr& position, bool print_average_values);
diff --git a/src/algorithms/PVT/libs/nmea_printer.cc b/src/algorithms/PVT/libs/nmea_printer.cc
index c9c1e8052..1337526b9 100644
--- a/src/algorithms/PVT/libs/nmea_printer.cc
+++ b/src/algorithms/PVT/libs/nmea_printer.cc
@@ -35,6 +35,9 @@
#include "nmea_printer.h"
#include
+#include // for create_directories, exists
+#include // for path, operator<<
+#include // for filesystem
#include
#include
#include
@@ -44,13 +47,55 @@
using google::LogMessage;
-Nmea_Printer::Nmea_Printer(std::string filename, bool flag_nmea_tty_port, std::string nmea_dump_devname)
+Nmea_Printer::Nmea_Printer(std::string filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_devname, const std::string& base_path)
{
- nmea_filename = filename;
- nmea_file_descriptor.open(nmea_filename.c_str(), std::ios::out);
- if (nmea_file_descriptor.is_open())
+ nmea_base_path = base_path;
+ d_flag_nmea_output_file = flag_nmea_output_file;
+ if (d_flag_nmea_output_file == true)
{
- DLOG(INFO) << "NMEA printer writing on " << nmea_filename.c_str();
+ boost::filesystem::path full_path(boost::filesystem::current_path());
+ const boost::filesystem::path p(nmea_base_path);
+ if (!boost::filesystem::exists(p))
+ {
+ std::string new_folder;
+ for (auto& folder : boost::filesystem::path(nmea_base_path))
+ {
+ new_folder += folder.string();
+ boost::system::error_code ec;
+ if (!boost::filesystem::exists(new_folder))
+ {
+ if (!boost::filesystem::create_directory(new_folder, ec))
+ {
+ std::cout << "Could not create the " << new_folder << " folder." << std::endl;
+ nmea_base_path = full_path.string();
+ }
+ }
+ new_folder += boost::filesystem::path::preferred_separator;
+ }
+ }
+ else
+ {
+ nmea_base_path = p.string();
+ }
+
+ if ((nmea_base_path.compare(".") != 0) and (d_flag_nmea_output_file == true))
+ {
+ std::cout << "NMEA files will be stored at " << nmea_base_path << std::endl;
+ }
+
+ nmea_base_path = nmea_base_path + boost::filesystem::path::preferred_separator;
+
+ nmea_filename = nmea_base_path + filename;
+
+ nmea_file_descriptor.open(nmea_filename.c_str(), std::ios::out);
+ if (nmea_file_descriptor.is_open())
+ {
+ DLOG(INFO) << "NMEA printer writing on " << nmea_filename.c_str();
+ }
+ else
+ {
+ std::cout << "File " << nmea_filename << " cannot be saved. Wrong permissions?" << std::endl;
+ }
}
nmea_devname = nmea_dump_devname;
@@ -94,13 +139,13 @@ int Nmea_Printer::init_serial(std::string serial_device)
int64_t PARITY;
fd = open(serial_device.c_str(), O_RDWR | O_NOCTTY | O_NDELAY);
- if (fd == -1) return fd; //failed to open TTY port
+ if (fd == -1) return fd; // failed to open TTY port
if (fcntl(fd, F_SETFL, 0) == -1) LOG(INFO) << "Error enabling direct I/O"; // clear all flags on descriptor, enable direct I/O
tcgetattr(fd, &options); // read serial port options
BAUD = B9600;
- //BAUD = B38400;
+ // BAUD = B38400;
DATABITS = CS8;
STOPBITS = 0;
PARITYON = 0;
@@ -108,7 +153,7 @@ int Nmea_Printer::init_serial(std::string serial_device)
options.c_cflag = BAUD | DATABITS | STOPBITS | PARITYON | PARITY | CLOCAL | CREAD;
// enable receiver, set 8 bit data, ignore control lines
- //options.c_cflag |= (CLOCAL | CREAD | CS8);
+ // options.c_cflag |= (CLOCAL | CREAD | CS8);
options.c_iflag = IGNPAR;
// set the new port options
@@ -139,34 +184,36 @@ bool Nmea_Printer::Print_Nmea_Line(const std::shared_ptr& pvt_dat
// generate the NMEA sentences
- //GPRMC
+ // GPRMC
GPRMC = get_GPRMC();
- //GPGGA (Global Positioning System Fixed Data)
+ // GPGGA (Global Positioning System Fixed Data)
GPGGA = get_GPGGA();
- //GPGSA
+ // GPGSA
GPGSA = get_GPGSA();
- //GPGSV
+ // GPGSV
GPGSV = get_GPGSV();
// write to log file
- try
+ if (d_flag_nmea_output_file)
{
- //GPRMC
- nmea_file_descriptor << GPRMC;
- //GPGGA (Global Positioning System Fixed Data)
- nmea_file_descriptor << GPGGA;
- //GPGSA
- nmea_file_descriptor << GPGSA;
- //GPGSV
- nmea_file_descriptor << GPGSV;
- }
- catch (const std::exception& ex)
- {
- DLOG(INFO) << "NMEA printer can not write on output file" << nmea_filename.c_str();
- ;
+ try
+ {
+ // GPRMC
+ nmea_file_descriptor << GPRMC;
+ // GPGGA (Global Positioning System Fixed Data)
+ nmea_file_descriptor << GPGGA;
+ // GPGSA
+ nmea_file_descriptor << GPGSA;
+ // GPGSV
+ nmea_file_descriptor << GPGSV;
+ }
+ catch (const std::exception& ex)
+ {
+ DLOG(INFO) << "NMEA printer can not write on output file" << nmea_filename.c_str();
+ }
}
- //write to serial device
+ // write to serial device
if (nmea_dev_descriptor != -1)
{
if (write(nmea_dev_descriptor, GPRMC.c_str(), GPRMC.length()) == -1)
@@ -284,7 +331,7 @@ std::string Nmea_Printer::longitude_to_hm(double longitude)
std::string Nmea_Printer::get_UTC_NMEA_time(boost::posix_time::ptime d_position_UTC_time)
{
- //UTC Time: hhmmss.sss
+ // UTC Time: hhmmss.sss
std::stringstream sentence_str;
boost::posix_time::time_duration td = d_position_UTC_time.time_of_day();
@@ -335,20 +382,19 @@ std::string Nmea_Printer::get_GPRMC()
double speed_over_ground_knots = 0;
double course_over_ground_deg = 0;
- //boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time();
+ // boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time();
std::stringstream sentence_str;
- //GPRMC (RMC-Recommended,Minimum Specific GNSS Data)
+ // GPRMC (RMC-Recommended,Minimum Specific GNSS Data)
std::string sentence_header;
sentence_header = "$GPRMC,";
sentence_str << sentence_header;
- //UTC Time: hhmmss.sss
+ // UTC Time: hhmmss.sss
sentence_str << get_UTC_NMEA_time(d_PVT_data->get_position_UTC_time());
- //Status: A: data valid, V: data NOT valid
-
+ // Status: A: data valid, V: data NOT valid
if (valid_fix == true)
{
sentence_str << ",A";
@@ -373,13 +419,13 @@ std::string Nmea_Printer::get_GPRMC()
sentence_str << "," << longitude_to_hm(d_PVT_data->get_longitude());
}
- //Speed over ground (knots)
+ // Speed over ground (knots)
sentence_str << ",";
sentence_str.setf(std::ios::fixed, std::ios::floatfield);
sentence_str.precision(2);
sentence_str << speed_over_ground_knots;
- //course over ground (degrees)
+ // course over ground (degrees)
sentence_str << ",";
sentence_str.setf(std::ios::fixed, std::ios::floatfield);
sentence_str.precision(2);
@@ -403,11 +449,11 @@ std::string Nmea_Printer::get_GPRMC()
year_strs << std::dec << year;
sentence_str << std::dec << year_strs.str().substr(2);
- //Magnetic Variation (degrees)
+ // Magnetic Variation (degrees)
// ToDo: Implement magnetic compass
sentence_str << ",";
- //Magnetic Variation (E or W)
+ // Magnetic Variation (E or W)
// ToDo: Implement magnetic compass
sentence_str << ",";
@@ -429,7 +475,7 @@ std::string Nmea_Printer::get_GPRMC()
std::string Nmea_Printer::get_GPGSA()
{
- //$GPGSA,A,3,07,02,26,27,09,04,15, , , , , ,1.8,1.0,1.5*33
+ // $GPGSA,A,3,07,02,26,27,09,04,15, , , , , ,1.8,1.0,1.5*33
// GSA-GNSS DOP and Active Satellites
bool valid_fix = d_PVT_data->is_valid_position();
int n_sats_used = d_PVT_data->get_num_valid_observations();
@@ -480,14 +526,14 @@ std::string Nmea_Printer::get_GPGSA()
sentence_str.precision(1);
sentence_str.fill('0');
sentence_str << pdop;
- //HDOP
+ // HDOP
sentence_str << ",";
sentence_str.setf(std::ios::fixed, std::ios::floatfield);
sentence_str.width(2);
sentence_str.precision(1);
sentence_str.fill('0');
sentence_str << hdop;
- //VDOP
+ // VDOP
sentence_str << ",";
sentence_str.setf(std::ios::fixed, std::ios::floatfield);
sentence_str.width(2);
@@ -548,7 +594,7 @@ std::string Nmea_Printer::get_GPGSV()
frame_str.fill('0');
frame_str << std::dec << n_sats_used;
- //satellites info
+ // satellites info
for (int j = 0; j < 4; j++)
{
// write satellite info
@@ -595,13 +641,13 @@ std::string Nmea_Printer::get_GPGSV()
sentence_str << frame_str.str();
}
return sentence_str.str();
- //$GPGSV,2,1,07,07,79,048,42,02,51,062,43,26,36,256,42,27,27,138,42*71
+ // $GPGSV,2,1,07,07,79,048,42,02,51,062,43,26,36,256,42,27,27,138,42*71
}
std::string Nmea_Printer::get_GPGGA()
{
- //boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time();
+ // boost::posix_time::ptime d_position_UTC_time=boost::posix_time::microsec_clock::universal_time();
bool valid_fix = d_PVT_data->is_valid_position();
int n_channels = d_PVT_data->get_num_valid_observations(); //d_nchannels
double hdop = d_PVT_data->get_hdop();
@@ -618,12 +664,12 @@ std::string Nmea_Printer::get_GPGGA()
std::stringstream sentence_str;
- //GPGGA (Global Positioning System Fixed Data)
+ // GPGGA (Global Positioning System Fixed Data)
std::string sentence_header;
sentence_header = "$GPGGA,";
sentence_str << sentence_header;
- //UTC Time: hhmmss.sss
+ // UTC Time: hhmmss.sss
sentence_str << get_UTC_NMEA_time(d_PVT_data->get_position_UTC_time());
if (d_PVT_data->is_averaging() == true)
@@ -708,5 +754,5 @@ std::string Nmea_Printer::get_GPGGA()
// end NMEA sentence
sentence_str << "\r\n";
return sentence_str.str();
- //$GPGGA,104427.591,5920.7009,N,01803.2938,E,1,05,3.3,78.2,M,23.2,M,0.0,0000*4A
+ // $GPGGA,104427.591,5920.7009,N,01803.2938,E,1,05,3.3,78.2,M,23.2,M,0.0,0000*4A
}
diff --git a/src/algorithms/PVT/libs/nmea_printer.h b/src/algorithms/PVT/libs/nmea_printer.h
index 318745e1c..b2f961756 100644
--- a/src/algorithms/PVT/libs/nmea_printer.h
+++ b/src/algorithms/PVT/libs/nmea_printer.h
@@ -53,7 +53,7 @@ public:
/*!
* \brief Default constructor.
*/
- Nmea_Printer(std::string filename, bool flag_nmea_tty_port, std::string nmea_dump_filename);
+ Nmea_Printer(std::string filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_filename, const std::string& base_path = ".");
/*!
* \brief Print NMEA PVT and satellite info to the initialized device
@@ -66,7 +66,8 @@ public:
~Nmea_Printer();
private:
- std::string nmea_filename; // String with the NMEA log filename
+ std::string nmea_filename; // String with the NMEA log filename
+ std::string nmea_base_path;
std::ofstream nmea_file_descriptor; // Output file stream for NMEA log file
std::string nmea_devname;
int nmea_dev_descriptor; // NMEA serial device descriptor (i.e. COM port)
@@ -82,6 +83,7 @@ private:
std::string latitude_to_hm(double lat);
char checkSum(std::string sentence);
bool print_avg_pos;
+ bool d_flag_nmea_output_file;
};
#endif
diff --git a/src/algorithms/PVT/libs/pvt_conf.cc b/src/algorithms/PVT/libs/pvt_conf.cc
new file mode 100644
index 000000000..0f528f438
--- /dev/null
+++ b/src/algorithms/PVT/libs/pvt_conf.cc
@@ -0,0 +1,70 @@
+/*!
+ * \file pvt_conf.cc
+ * \brief Class that contains all the configuration parameters for a PVT block
+ * \author Carles Fernandez, 2018. cfernandez(at)cttc.es
+ *
+ * -------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
+ *
+ * GNSS-SDR is a software defined Global Navigation
+ * Satellite Systems receiver
+ *
+ * This file is part of GNSS-SDR.
+ *
+ * GNSS-SDR is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GNSS-SDR is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNSS-SDR. If not, see .
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#include "pvt_conf.h"
+
+Pvt_Conf::Pvt_Conf()
+{
+ type_of_receiver = 0U;
+ output_rate_ms = 0;
+ display_rate_ms = 0;
+
+ rinex_version = 0;
+ rinexobs_rate_ms = 0;
+ rinexnav_rate_ms = 0;
+
+ dump = false;
+ dump_mat = true;
+
+ flag_nmea_tty_port = false;
+
+ flag_rtcm_server = false;
+ flag_rtcm_tty_port = false;
+ rtcm_tcp_port = 0U;
+ rtcm_station_id = 0U;
+
+ output_enabled = true;
+ rinex_output_enabled = true;
+ gpx_output_enabled = true;
+ geojson_output_enabled = true;
+ nmea_output_file_enabled = true;
+ kml_output_enabled = true;
+ xml_output_enabled = true;
+ rtcm_output_file_enabled = true;
+
+ output_path = std::string(".");
+ rinex_output_path = std::string(".");
+ gpx_output_path = std::string(".");
+ geojson_output_path = std::string(".");
+ nmea_output_file_path = std::string(".");
+ kml_output_path = std::string(".");
+ xml_output_path = std::string(".");
+ rtcm_output_file_path = std::string(".");
+}
diff --git a/src/algorithms/PVT/libs/pvt_conf.h b/src/algorithms/PVT/libs/pvt_conf.h
new file mode 100644
index 000000000..1719863e1
--- /dev/null
+++ b/src/algorithms/PVT/libs/pvt_conf.h
@@ -0,0 +1,86 @@
+/*!
+ * \file pvt_conf.h
+ * \brief Class that contains all the configuration parameters for the PVT block
+ * \author Carles Fernandez, 2018. cfernandez(at)cttc.es
+ *
+ * -------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
+ *
+ * GNSS-SDR is a software defined Global Navigation
+ * Satellite Systems receiver
+ *
+ * This file is part of GNSS-SDR.
+ *
+ * GNSS-SDR is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GNSS-SDR is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNSS-SDR. If not, see .
+ *
+ * -------------------------------------------------------------------------
+ */
+
+#ifndef GNSS_SDR_PVT_CONF_H_
+#define GNSS_SDR_PVT_CONF_H_
+
+#include
+#include
+#include
+#include