Improve reported output in case of configuration error

This commit is contained in:
Carles Fernandez 2021-01-26 16:11:41 +01:00
parent 720215af30
commit 24041058a6
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 16 additions and 19 deletions

View File

@ -32,16 +32,7 @@ Pass_Through::Pass_Through(const ConfigurationInterface* configuration, const st
out_streams_(out_streams)
{
const std::string default_item_type("gr_complex");
const std::string input_type = configuration->property(role + ".input_item_type", default_item_type);
const std::string output_type = configuration->property(role + ".output_item_type", default_item_type);
if (input_type != output_type)
{
LOG(WARNING) << "input_item_type and output_item_type are different in a Pass_Through implementation! Taking "
<< input_type
<< ", but item_size will supersede it.";
}
item_type_ = configuration->property(role + ".item_type", input_type);
item_type_ = configuration->property(role + ".item_type", default_item_type);
inverted_spectrum = configuration->property(role + ".inverted_spectrum", false);
if (item_type_ == "float")
@ -96,13 +87,11 @@ Pass_Through::Pass_Through(const ConfigurationInterface* configuration, const st
DLOG(INFO) << "kludge_copy(" << kludge_copy_->unique_id() << ")";
if (in_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one input stream";
LOG(ERROR) << in_streams_;
LOG(ERROR) << "This implementation only supports one input stream but it is set to " << in_streams_;
}
if (out_streams_ > 1)
{
LOG(ERROR) << "This implementation only supports one output stream";
LOG(ERROR) << out_streams_;
LOG(ERROR) << "This implementation only supports one output stream but it is set to " << out_streams_;
}
}

View File

@ -736,9 +736,13 @@ int GNSSFlowgraph::connect_signal_conditioners()
{
std::string replace_me("copy");
size_t pos = reported_error.find(replace_me);
size_t len = replace_me.length();
reported_error.replace(pos, len, "PassThrough");
help_hint_ += " * Blocks within the Signal Conditioner are connected with mismatched item size\n";
while (pos != std::string::npos)
{
size_t len = replace_me.length();
reported_error.replace(pos, len, "Pass_Through");
pos = reported_error.find(replace_me, pos + 1);
}
help_hint_ += " * Blocks within the Signal Conditioner are connected with mismatched input/ouput item size\n";
help_hint_ += " Reported error: " + reported_error + '\n';
help_hint_ += " Check the Signal Conditioner documentation at https://gnss-sdr.org/docs/sp-blocks/signal-conditioner/\n";
}
@ -1088,8 +1092,12 @@ int GNSSFlowgraph::connect_signal_sources_to_signal_conditioners()
{
std::string replace_me("copy");
size_t pos = reported_error.find(replace_me);
size_t len = replace_me.length();
reported_error.replace(pos, len, "PassThrough");
while (pos != std::string::npos)
{
size_t len = replace_me.length();
reported_error.replace(pos, len, "Pass_Through");
pos = reported_error.find(replace_me, pos + 1);
}
help_hint_ += " * The SignalSource output item size and the SignalConditioner input item size are mismatched\n";
help_hint_ += " Reported error: " + reported_error + '\n';
}