Skip to content

Commit

Permalink
Move TimeSeries creation
Browse files Browse the repository at this point in the history
If this commit is applied then TimeSeries creation post topic selection
will be moved to a new auxiliar method.
So that I can perform some changes in it to manage keyed topics.

Issue: [#eProsima#56]
Signed-off-by: Manuel Valch <manuelValch@proton.me>
  • Loading branch information
manuelValch committed May 28, 2024
1 parent 265a22e commit 9b48a51
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 21 deletions.
48 changes: 27 additions & 21 deletions plugins/datastreamer_plugin/datastreamer/FastDdsDataStreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ bool FastDdsDataStreamer::start(
configuration_ = select_topics_dialog_.get_configuration();
// Store as default configuration
configuration_.save_default_settings(CONFIGURATION_SETTINGS_PREFIX_);

// Topics selected
const auto& topics = configuration_.topics_selected; // Decorator variable to avoid calling internal member

Expand All @@ -96,27 +96,9 @@ bool FastDdsDataStreamer::start(
configuration_.data_type_configuration);
}

// Get all series from topics and create them
// NUMERIC
std::vector<types::DatumLabel> numeric_series = fastdds_handler_.numeric_data_series_names();
for (const auto& series : numeric_series)
{
// Create a series
DEBUG("Creating numeric series: " << series);
dataMap().addNumeric(series);
}

// STRING
std::vector<types::DatumLabel> string_series = fastdds_handler_.string_data_series_names();
for (const auto& series : string_series)
{
// Create a series
DEBUG("Creating string series: " << series);
dataMap().addStringSeries(series);
}
running_ = timeSeriesCreation();

running_ = true;
return true;
return running_;
}

void FastDdsDataStreamer::shutdown()
Expand Down Expand Up @@ -255,6 +237,30 @@ void FastDdsDataStreamer::connect_to_domain_(
select_topics_dialog_.connect_to_domain(domain_id);
}

bool FastDdsDataStreamer::timeSeriesCreation()
{

// Get all series from topics and create them
// NUMERIC
std::vector<types::DatumLabel> numeric_series = fastdds_handler_.numeric_data_series_names();
for (const auto& series : numeric_series)
{
// Create a series
DEBUG("Creating numeric series: " << series);
dataMap().addNumeric(series);
}

// STRING
std::vector<types::DatumLabel> string_series = fastdds_handler_.string_data_series_names();
for (const auto& series : string_series)
{
// Create a series
DEBUG("Creating string series: " << series);
dataMap().addStringSeries(series);
}
return true;
}

} /* namespace datastreamer */
} /* namespace plotjuggler */
} /* namespace eprosima */
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ class FastDdsDataStreamer :
unsigned int domain_id);


bool timeSeriesCreation();

////////////////////////////////////////////////////
// INTERNAL VALUES
////////////////////////////////////////////////////
Expand Down

0 comments on commit 9b48a51

Please sign in to comment.