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())
25 ret.added_curves.push_back(ID);
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))
36 ret.curves_updated =
true;
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);
48 ret.curves_updated =
true;
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);
66 ret.curves_updated =
true;
73 destination_plot.clear();
76 if (source_plot.size() > 0)
78 ret.data_pushed =
true;
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)
95 for (
size_t i = 0; i < source_plot.size(); i++)
97 destination_plot.pushBack(source_plot.at(i));