ProtoBuf: Don't use maps, as these don't preserve order of elements

This commit is contained in:
2023-06-26 09:27:47 +02:00
parent 2caba97bb2
commit a43fa2a296
6 changed files with 136 additions and 111 deletions
+10 -6
View File
@@ -703,13 +703,17 @@ JFJochProtoBuf::Plot JFJochReceiver::GetPlots(const JFJochProtoBuf::PlotRequest
JFJochProtoBuf::RadialIntegrationProfiles JFJochReceiver::GetRadialIntegrationProfiles() {
JFJochProtoBuf::RadialIntegrationProfiles ret;
auto &map = *ret.mutable_plots();
if (rad_int_profile) {
auto p = ret.add_profiles();
p->set_title("dataset");
rad_int_profile->GetPlot(*p->mutable_plot());
}
if (rad_int_profile)
rad_int_profile->GetPlot(map["dataset"]);
for (int i = 0; i < rad_int_profile_per_file.size(); i++)
rad_int_profile_per_file[i]->GetPlot(map["file" + std::to_string(i)]);
for (int i = 0; i < rad_int_profile_per_file.size(); i++) {
auto p = ret.add_profiles();
p->set_title("file" + std::to_string(i));
rad_int_profile_per_file[i]->GetPlot(*p->mutable_plot());
}
return ret;
}