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 d63abe409..d63119d6f 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 @@ -292,6 +292,8 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items, gr_vector //decode_page.split_page(page_String, flag_even_word_arrived); flag_even_word_arrived=0; //std::cout << "page odd" << page_String << std::endl; + DLOG(INFO) << "mara prova print page odd" << page_String; + //std::cout<<"Page type ="<< page_part_bits[1]< @@ -63,6 +69,19 @@ extern concurrent_queue global_gps_utc_model_queue; extern concurrent_queue global_gps_almanac_queue; extern concurrent_queue global_gps_acq_assist_queue; +extern concurrent_map global_galileo_ephemeris_map; +extern concurrent_map global_galileo_iono_map; +extern concurrent_map global_galileo_utc_model_map; +extern concurrent_map global_galileo_almanac_map; +//extern concurrent_map global_gps_acq_assist_map; + +extern concurrent_queue global_galileo_ephemeris_queue; +extern concurrent_queue global_galileo_iono_queue; +extern concurrent_queue global_galileo_utc_model_queue; +extern concurrent_queue global_galileo_almanac_queue; +//extern concurrent_queue global_gps_acq_assist_queue; + + using google::LogMessage; DEFINE_string(config_file, "../conf/gnss-sdr.conf", @@ -141,6 +160,8 @@ void ControlThread::run() gps_utc_model_data_collector_thread_ =boost::thread(&ControlThread::gps_utc_model_data_collector, this); 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); + // Main loop to read and process the control messages while (flowgraph_->running() && !stop_) { @@ -150,10 +171,17 @@ void ControlThread::run() } std::cout<<"Stopping GNSS-SDR, please wait!"<stop(); + + // Join GPS threads gps_ephemeris_data_collector_thread_.timed_join(boost::posix_time::seconds(1)); gps_iono_data_collector_thread_.timed_join(boost::posix_time::seconds(1)); gps_utc_model_data_collector_thread_.timed_join(boost::posix_time::seconds(1)); gps_acq_assist_data_collector_thread_.timed_join(boost::posix_time::seconds(1)); + + //Join Galileo threads + galileo_ephemeris_data_collector_thread_.timed_join(boost::posix_time::seconds(1)); + + //Join keyboard threads keyboard_thread_.timed_join(boost::posix_time::seconds(1)); LOG_AT_LEVEL(INFO) << "Flowgraph stopped"; @@ -451,6 +479,51 @@ void ControlThread::gps_ephemeris_data_collector() } } +void ControlThread::galileo_ephemeris_data_collector() +{ + + // ############ 1.bis READ EPHEMERIS/UTC_MODE/IONO QUEUE #################### + Galileo_Ephemeris galileo_eph; + Galileo_Ephemeris galileo_eph_old; + while(stop_==false) + { + global_galileo_ephemeris_queue.wait_and_pop(galileo_eph); + + // 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 + 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) + { + std::cout << "Ephemeris record updated -- GALILEO TOW ="<