From 02eccce6803b074852188c5d2aad94e01a253fdc Mon Sep 17 00:00:00 2001 From: Javier Arribas Date: Mon, 2 Sep 2013 13:58:35 +0000 Subject: [PATCH] Mara Branzanti GSoC commit September 2th. Galileo navigation queues git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@413 64b25241-fba3-4117-9849-534c7e92360d --- .../galileo_e1b_telemetry_decoder_cc.cc | 2 +- src/core/receiver/control_thread.cc | 124 +++++++++++++++--- src/core/receiver/control_thread.h | 8 +- .../system_parameters/galileo_ephemeris.cc | 4 + .../system_parameters/galileo_ephemeris.h | 3 + src/core/system_parameters/galileo_iono.cc | 17 ++- src/core/system_parameters/galileo_iono.h | 18 +-- .../galileo_navigation_message.cc | 44 ++++--- .../galileo_navigation_message.h | 1 + .../system_parameters/galileo_utc_model.cc | 2 +- .../system_parameters/galileo_utc_model.h | 21 +-- 11 files changed, 174 insertions(+), 70 deletions(-) diff --git a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc index d63119d6f..fab6db882 100644 --- a/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc +++ b/src/algorithms/telemetry_decoder/gnuradio_blocks/galileo_e1b_telemetry_decoder_cc.cc @@ -318,7 +318,7 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items, gr_vector if (d_nav.have_new_iono_and_GST()==true) { Galileo_Iono iono=d_nav.get_iono(); //notice that the read operation will clear the valid flag - std::cout<<"New Galileo IONO model received for SV "<push(iono); } if (d_nav.have_new_utc_model()==true) diff --git a/src/core/receiver/control_thread.cc b/src/core/receiver/control_thread.cc index a34941220..ce1ebd09c 100644 --- a/src/core/receiver/control_thread.cc +++ b/src/core/receiver/control_thread.cc @@ -161,7 +161,8 @@ void ControlThread::run() gps_acq_assist_data_collector_thread_=boost::thread(&ControlThread::gps_acq_assist_data_collector,this); galileo_ephemeris_data_collector_thread_ =boost::thread(&ControlThread::galileo_ephemeris_data_collector, this); - + galileo_iono_data_collector_thread_ =boost::thread(&ControlThread::galileo_iono_data_collector, this); + galileo_utc_model_data_collector_thread_ =boost::thread(&ControlThread::galileo_utc_model_data_collector, this); // Main loop to read and process the control messages while (flowgraph_->running() && !stop_) { @@ -180,7 +181,8 @@ void ControlThread::run() //Join Galileo threads galileo_ephemeris_data_collector_thread_.timed_join(boost::posix_time::seconds(1)); - + galileo_iono_data_collector_thread_.timed_join(boost::posix_time::seconds(1)); + galileo_utc_model_data_collector_thread_.timed_join(boost::posix_time::seconds(1)); //Join keyboard threads keyboard_thread_.timed_join(boost::posix_time::seconds(1)); @@ -479,6 +481,7 @@ void ControlThread::gps_ephemeris_data_collector() } } + void ControlThread::galileo_ephemeris_data_collector() { @@ -492,31 +495,35 @@ void ControlThread::galileo_ephemeris_data_collector() // DEBUG MESSAGE std::cout << "Ephemeris record has arrived from SAT ID " << galileo_eph.SV_ID_PRN_4 << std::endl; - // insert new ephemeris record to the global ephemeris map + + // insert new ephemeris record to the global ephemeris map if (global_galileo_ephemeris_map.read(galileo_eph.SV_ID_PRN_4,galileo_eph_old)) { // Check the EPHEMERIS timestamp. If it is newer, then update the ephemeris - if (galileo_eph.WN_5 > galileo_eph_old.WN_5) - { - std::cout << "Ephemeris record updated -- GALILEO Week Number ="< galileo_eph_old.TOW_5) + if (galileo_eph.WN_5 > galileo_eph_old.WN_5) //further check because it is not clear when IOD is reset { - std::cout << "Ephemeris record updated -- GALILEO TOW ="< galileo_eph_old.IOD_ephemeris) + { + std::cout << "Ephemeris record updated in global map-- IOD_ephemeris ="< galileo_iono_old.WNot_6) + { + std::cout << "IONO record updated in global map--new GALILEO UTC-IONO Week Number"<< std::endl; + global_galileo_iono_map.write(0,galileo_iono); + }else{ + if (galileo_iono.t0t_6 > galileo_iono_old.t0t_6) + { + std::cout << "IONO record updated in global map--new GALILEO UTC-IONO time of Week" << std::endl; + global_galileo_iono_map.write(0,galileo_iono); + //std::cout << "GALILEO IONO time of Week old: " << galileo_iono_old.t0t_6< galileo_utc_old.WNot_6) //further check because it is not clear when IOD is reset + { + //std::cout << "UTC record updated --new GALILEO UTC Week Number ="< galileo_utc_old.t0t_6) + { + //std::cout << "UTC record updated --new GALILEO UTC time of Week ="<