mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-10 20:23:09 +00:00
Cleaning the terminal output and dumping most of the information in the log file. Better use of the glog library, logging can be seen also in Release, in real time by doing './gnss-sdr --logtostderr=1'. Update to latest version of Armadillo.
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@486 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
@@ -52,6 +52,9 @@ if($ENV{GN3S_DRIVER})
|
||||
endif($ENV{GN3S_DRIVER})
|
||||
|
||||
if($ENV{RAW_ARRAY_DRIVER})
|
||||
set(RAW_ARRAY_DRIVER ON)
|
||||
endif($ENV{RAW_ARRAY_DRIVER})
|
||||
if(RAW_ARRAY_DRIVER)
|
||||
##############################################
|
||||
# GRDBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE
|
||||
##############################################
|
||||
@@ -65,6 +68,7 @@ if($ENV{RAW_ARRAY_DRIVER})
|
||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../../gr-dbfcttc
|
||||
UPDATE_COMMAND ""
|
||||
PATCH_COMMAND ""
|
||||
CMAKE_ARGS -DCMAKE_CXX_COMPILER=/usr/bin/clang++
|
||||
INSTALL_COMMAND ""
|
||||
)
|
||||
|
||||
@@ -76,8 +80,7 @@ if($ENV{RAW_ARRAY_DRIVER})
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GRDBFCTTC_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GRDBFCTTC_INCLUDE_DIRS})
|
||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc)
|
||||
|
||||
endif($ENV{RAW_ARRAY_DRIVER})
|
||||
endif(RAW_ARRAY_DRIVER)
|
||||
|
||||
|
||||
if($ENV{RTLSDR_DRIVER})
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
#include <iomanip>
|
||||
#include <exception>
|
||||
#include <gflags/gflags.h>
|
||||
#include <glog/log_severity.h>
|
||||
#include <glog/logging.h>
|
||||
#include "gnss_sdr_valve.h"
|
||||
#include "configuration_interface.h"
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
|
||||
DEFINE_string(signal_source, "-",
|
||||
"If defined, path to the file containing the signal samples (overrides the configuration file)");
|
||||
|
||||
@@ -83,7 +83,7 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << item_type_
|
||||
LOG(WARNING) << item_type_
|
||||
<< " unrecognized item type. Using gr_complex.";
|
||||
item_size_ = sizeof(gr_complex);
|
||||
}
|
||||
@@ -108,7 +108,7 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
||||
<< std::endl
|
||||
<<"gnss-sdr --config_file=my_GNSS_SDR_configuration.conf"
|
||||
<< std::endl;
|
||||
LOG_AT_LEVEL(INFO) << "file_signal_source: Unable to open the samples file "
|
||||
LOG(INFO) << "file_signal_source: Unable to open the samples file "
|
||||
<< filename_.c_str() << ", exiting the program.";
|
||||
throw(e);
|
||||
}
|
||||
@@ -133,7 +133,7 @@ FileSignalSource::FileSignalSource(ConfigurationInterface* configuration,
|
||||
else
|
||||
{
|
||||
std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << std::endl;
|
||||
LOG_AT_LEVEL(ERROR) << "file_signal_source: Unable to open the samples file " << filename_.c_str();
|
||||
LOG(ERROR) << "file_signal_source: Unable to open the samples file " << filename_.c_str();
|
||||
}
|
||||
std::cout << std::setprecision(16);
|
||||
std::cout << "Processing file " << filename_ << ", which contains " << (double)size << " [bytes]" << std::endl;
|
||||
@@ -297,7 +297,7 @@ void FileSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
|
||||
gr::basic_block_sptr FileSignalSource::get_left_block()
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << "Left block of a signal source should not be retrieved";
|
||||
LOG(WARNING) << "Left block of a signal source should not be retrieved";
|
||||
return gr::blocks::file_source::sptr();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,14 +31,12 @@
|
||||
*/
|
||||
|
||||
#include "gen_signal_source.h"
|
||||
//#include "gnss_flowgraph.h"
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <gnuradio/message.h>
|
||||
#include <glog/log_severity.h>
|
||||
#include <glog/logging.h>
|
||||
|
||||
using google::LogMessage;
|
||||
@@ -68,7 +66,7 @@ void GenSignalSource::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (connected_)
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << "Signal conditioner already connected internally";
|
||||
LOG(WARNING) << "Signal conditioner already connected internally";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -88,7 +86,7 @@ void GenSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (!connected_)
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << "Signal conditioner already disconnected internally";
|
||||
LOG(WARNING) << "Signal conditioner already disconnected internally";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
#include "gn3s_signal_source.h"
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include <glog/logging.h>
|
||||
#include <gn3s/gn3s_source_cc.h>
|
||||
#include "configuration_interface.h"
|
||||
#include <glog/log_severity.h>
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
@@ -64,7 +64,7 @@ Gn3sSignalSource::Gn3sSignalSource(ConfigurationInterface* configuration,
|
||||
// }
|
||||
else
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << item_type_
|
||||
LOG(WARNING) << item_type_
|
||||
<< " unrecognized item type for resampler";
|
||||
item_size_ = sizeof(short);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <gflags/gflags.h>
|
||||
#include <glog/log_severity.h>
|
||||
#include <glog/logging.h>
|
||||
#include "gnss_sdr_valve.h"
|
||||
#include "configuration_interface.h"
|
||||
@@ -76,8 +75,7 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << item_type_
|
||||
<< " unrecognized item type. Using byte.";
|
||||
LOG(WARNING) << item_type_ << " unrecognized item type. Using byte.";
|
||||
item_size_ = sizeof(char);
|
||||
}
|
||||
try
|
||||
@@ -102,8 +100,8 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
|
||||
<< std::endl
|
||||
<<"gnss-sdr --config_file=my_GNSS_SDR_configuration.conf"
|
||||
<< std::endl;
|
||||
LOG_AT_LEVEL(INFO) << "file_signal_source: Unable to open the samples file "
|
||||
<< filename_.c_str() << ", exiting the program.";
|
||||
LOG(WARNING) << "file_signal_source: Unable to open the samples file "
|
||||
<< filename_.c_str() << ", exiting the program.";
|
||||
throw(e);
|
||||
}
|
||||
|
||||
@@ -122,28 +120,28 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
|
||||
if (file.is_open())
|
||||
{
|
||||
size = file.tellg();
|
||||
DLOG(INFO) << "Total samples in the file= " << floor((double)size / (double)item_size());
|
||||
LOG(INFO) << "Total samples in the file= " << floor((double)size / (double)item_size());
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "file_signal_source: Unable to open the samples file " << filename_.c_str() << std::endl;
|
||||
LOG_AT_LEVEL(ERROR) << "file_signal_source: Unable to open the samples file " << filename_.c_str();
|
||||
LOG(ERROR) << "file_signal_source: Unable to open the samples file " << filename_.c_str();
|
||||
}
|
||||
std::cout << std::setprecision(16);
|
||||
std::cout << "Processing file " << filename_ << ", which contains " << (double)size << " [bytes]" << std::endl;
|
||||
|
||||
if (size > 0)
|
||||
{
|
||||
int sample_packet_factor=4; // 1 byte -> 4 samples
|
||||
samples_ = floor((double)size / (double)item_size())*sample_packet_factor;
|
||||
samples_=samples_- ceil(0.002 * (double)sampling_frequency_); //process all the samples available in the file excluding the last 2 ms
|
||||
int sample_packet_factor = 4; // 1 byte -> 4 samples
|
||||
samples_ = floor((double)size / (double)item_size())*sample_packet_factor;
|
||||
samples_ = samples_- ceil(0.002 * (double)sampling_frequency_); //process all the samples available in the file excluding the last 2 ms
|
||||
}
|
||||
}
|
||||
|
||||
CHECK(samples_ > 0) << "File does not contain enough samples to process.";
|
||||
double signal_duration_s;
|
||||
signal_duration_s = (double)samples_ * ( 1 /(double)sampling_frequency_);
|
||||
DLOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||
LOG(INFO) << "Total number samples to be processed= " << samples_ << " GNSS signal duration= " << signal_duration_s << " [s]";
|
||||
std::cout << "GNSS signal recorded time to be processed: " << signal_duration_s << " [s]" << std::endl;
|
||||
|
||||
valve_ = gnss_sdr_make_valve(sizeof(float), samples_, queue_);
|
||||
@@ -159,7 +157,6 @@ NsrFileSignalSource::NsrFileSignalSource(ConfigurationInterface* configuration,
|
||||
if (enable_throttle_control_)
|
||||
{
|
||||
throttle_ = gr::blocks::throttle::make(sizeof(float), sampling_frequency_);
|
||||
|
||||
}
|
||||
DLOG(INFO) << "File source filename " << filename_;
|
||||
DLOG(INFO) << "Samples " << samples_;
|
||||
@@ -188,7 +185,6 @@ void NsrFileSignalSource::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
top_block->connect(file_source_, 0, unpack_byte_, 0);
|
||||
top_block->connect(unpack_byte_, 0,throttle_,0);
|
||||
|
||||
DLOG(INFO) << "connected file source to throttle";
|
||||
top_block->connect(throttle_, 0, valve_, 0);
|
||||
DLOG(INFO) << "connected throttle to valve";
|
||||
@@ -275,8 +271,8 @@ void NsrFileSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (enable_throttle_control_ == true)
|
||||
{
|
||||
top_block->disconnect(file_source_, 0, unpack_byte_, 0);
|
||||
DLOG(INFO) << "disconnected file source to unpack_byte_";
|
||||
top_block->disconnect(file_source_, 0, unpack_byte_, 0);
|
||||
DLOG(INFO) << "disconnected file source to unpack_byte_";
|
||||
top_block->disconnect(unpack_byte_, 0, throttle_, 0);
|
||||
DLOG(INFO) << "disconnected unpack_byte_ to throttle";
|
||||
if (dump_)
|
||||
@@ -289,8 +285,8 @@ void NsrFileSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (dump_)
|
||||
{
|
||||
top_block->disconnect(file_source_, 0, unpack_byte_, 0);
|
||||
DLOG(INFO) << "disconnected file source to unpack_byte_";
|
||||
top_block->disconnect(file_source_, 0, unpack_byte_, 0);
|
||||
DLOG(INFO) << "disconnected file source to unpack_byte_";
|
||||
top_block->disconnect(unpack_byte_, 0, sink_, 0);
|
||||
DLOG(INFO) << "disconnected unpack_byte_ to sink";
|
||||
}
|
||||
@@ -304,7 +300,7 @@ void NsrFileSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
|
||||
gr::basic_block_sptr NsrFileSignalSource::get_left_block()
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << "Left block of a signal source should not be retrieved";
|
||||
LOG(WARNING) << "Left block of a signal source should not be retrieved";
|
||||
//return gr_block_sptr();
|
||||
return gr::blocks::file_source::sptr();
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
#include "raw_array_signal_source.h"
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include <gnuradio/msg_queue.h>
|
||||
#include <glog/logging.h>
|
||||
#include <dbfcttc/raw_array.h>
|
||||
#include "configuration_interface.h"
|
||||
#include <glog/log_severity.h>
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
@@ -83,8 +83,7 @@ RawArraySignalSource::RawArraySignalSource(ConfigurationInterface* configuration
|
||||
// }
|
||||
else
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << item_type_
|
||||
<< " unrecognized item type for raw_array_source_";
|
||||
LOG(WARNING) << item_type_ << " unrecognized item type for raw_array_source_";
|
||||
item_size_ = sizeof(gr_complex);
|
||||
}
|
||||
if (dump_)
|
||||
@@ -134,7 +133,7 @@ void RawArraySignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
|
||||
gr::basic_block_sptr RawArraySignalSource::get_left_block()
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << "Left block of a signal source should not be retrieved";
|
||||
LOG(WARNING) << "Left block of a signal source should not be retrieved";
|
||||
return gr::block_sptr();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include "rtlsdr_signal_source.h"
|
||||
#include <iostream>
|
||||
#include <boost/format.hpp>
|
||||
#include <glog/log_severity.h>
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/blocks/file_sink.h>
|
||||
#include "configuration_interface.h"
|
||||
@@ -117,7 +116,7 @@ RtlsdrSignalSource::RtlsdrSignalSource(ConfigurationInterface* configuration,
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << item_type_ << " unrecognized item type. Using short.";
|
||||
LOG(WARNING) << item_type_ << " unrecognized item type. Using short.";
|
||||
item_size_ = sizeof(short);
|
||||
}
|
||||
|
||||
@@ -190,7 +189,7 @@ void RtlsdrSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
|
||||
gr::basic_block_sptr RtlsdrSignalSource::get_left_block()
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << "Trying to get signal source left block.";
|
||||
LOG(WARNING) << "Trying to get signal source left block.";
|
||||
return gr::basic_block_sptr();
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ private:
|
||||
bool dump_;
|
||||
std::string dump_filename_;
|
||||
|
||||
boost::shared_ptr<osmosdr::source> rtlsdr_source_;
|
||||
osmosdr::source::sptr rtlsdr_source_;
|
||||
|
||||
boost::shared_ptr<gr::block> valve_;
|
||||
gr::blocks::file_sink::sptr file_sink_;
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#include <iostream>
|
||||
#include <uhd/types/device_addr.hpp>
|
||||
#include <uhd/exception.hpp>
|
||||
#include <glog/log_severity.h>
|
||||
#include <glog/logging.h>
|
||||
#include "configuration_interface.h"
|
||||
#include "gnss_sdr_valve.h"
|
||||
@@ -159,20 +158,20 @@ UhdSignalSource::UhdSignalSource(ConfigurationInterface* configuration,
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << item_type_ << " unrecognized item type. Using short.";
|
||||
LOG(WARNING) << item_type_ << " unrecognized item type. Using short.";
|
||||
item_size_ = sizeof(short);
|
||||
}
|
||||
|
||||
if (samples_ != 0)
|
||||
{
|
||||
DLOG(INFO) << "Send STOP signal after " << samples_ << " samples";
|
||||
LOG(INFO) << "Send STOP signal after " << samples_ << " samples";
|
||||
valve_ = gnss_sdr_make_valve(item_size_, samples_, queue_);
|
||||
DLOG(INFO) << "valve(" << valve_->unique_id() << ")";
|
||||
}
|
||||
|
||||
if (dump_)
|
||||
{
|
||||
DLOG(INFO) << "Dumping output into file " << dump_filename_;
|
||||
LOG(INFO) << "Dumping output into file " << dump_filename_;
|
||||
//file_sink_ = gr_make_file_sink(item_size_, dump_filename_.c_str());
|
||||
file_sink_ = gr::blocks::file_sink::make(item_size_, dump_filename_.c_str());
|
||||
DLOG(INFO) << "file_sink(" << file_sink_->unique_id() << ")";
|
||||
@@ -215,7 +214,7 @@ void UhdSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
if (samples_ != 0)
|
||||
{
|
||||
top_block->disconnect(uhd_source_, 0, valve_, 0);
|
||||
DLOG(INFO) << "usrp source disconnected";
|
||||
LOG(INFO) << "UHD source disconnected";
|
||||
if (dump_)
|
||||
{
|
||||
top_block->disconnect(valve_, 0, file_sink_, 0);
|
||||
@@ -234,7 +233,7 @@ void UhdSignalSource::disconnect(gr::top_block_sptr top_block)
|
||||
|
||||
gr::basic_block_sptr UhdSignalSource::get_left_block()
|
||||
{
|
||||
LOG_AT_LEVEL(WARNING) << "Trying to get signal source left block.";
|
||||
LOG(WARNING) << "Trying to get signal source left block.";
|
||||
//return gr_basic_block_sptr();
|
||||
return gr::uhd::usrp_source::sptr();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user