15 auto moveDataImpl = [&](
auto& source_series,
auto& destination_series) {
16 for (
auto& it : source_series)
18 const std::string& ID = it.first;
19 auto& source_plot = it.second;
20 const std::string& plot_name = source_plot.plotName();
22 auto dest_plot_it = destination_series.find(ID);
23 if (dest_plot_it == destination_series.end())
28 if (source_plot.group())
32 dest_plot_it = destination_series
33 .emplace(std::piecewise_construct, std::forward_as_tuple(ID),
34 std::forward_as_tuple(plot_name, group))
39 auto& destination_plot = dest_plot_it->second;
43 for (
const auto& [
name, attr] : source_plot.attributes())
45 if (destination_plot.attribute(
name) != attr)
47 destination_plot.setAttribute(
name, attr);
52 if (source_plot.group())
54 if (!destination_group ||
55 destination_group->name() != source_plot.group()->name())
57 destination_group = destination.
getOrCreateGroup(source_plot.group()->name());
58 destination_plot.changeGroup(destination_group);
61 for (
const auto& [
name, attr] : source_plot.group()->attributes())
63 if (destination_group->attribute(
name) != attr)
65 destination_group->setAttribute(
name, attr);
73 destination_plot.clear();
76 if (source_plot.size() > 0)
81 if constexpr (std::is_same_v<
PlotData, decltype(source_plot)> ||
85 double max_range_x = source_plot.maximumRangeX();
86 destination_plot.setMaximumRangeX(max_range_x);
89 if(destination_plot.size() == 0)
94 for (
size_t i = 0; i < source_plot.size(); i++)
96 destination_plot.pushBack(source_plot.at(i));
MoveDataRet MoveData(PlotDataMapRef &source, PlotDataMapRef &destination, bool remove_older)
std::shared_ptr< PlotGroup > Ptr
TimeseriesMap numeric
Numerical timeseries.
NLOHMANN_BASIC_JSON_TPL_DECLARATION void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL &j1, nlohmann::NLOHMANN_BASIC_JSON_TPL &j2) noexcept(//NOLINT(readability-inconsistent-declaration-parameter-name) is_nothrow_move_constructible< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value &&//NOLINT(misc-redundant-expression) is_nothrow_move_assignable< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value)
exchanges the values of two JSON objects
StringSeriesMap strings
Series of strings.
PlotGroup::Ptr getOrCreateGroup(const std::string &name)
std::vector< std::string > added_curves
AnySeriesMap user_defined