rugnux: <prefix>_panels.json keeps its keys in the documented order

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UqXYdJKPUFLoeAchjzv3x4
This commit is contained in:
leonarski_fandClaude Opus 5.5 committed 2026-11-03 07:15:17 +01:00
1 parent 3b60dace7b
commit c706dfbac1
1 file changed
+2 -2
+2 -2
View File
@@ -144,12 +144,12 @@ std::vector<DetectorModule> ReadModulePlacementJson(const std::string &path) {
}
void WriteModulePlacementJson(const std::string &path, const DetectorModules &modules) {
nlohmann::json list = nlohmann::json::array();
nlohmann::ordered_json list = nlohmann::ordered_json::array();
for (const auto &m: modules.Get())
list.push_back({{"x0", m.x0}, {"y0", m.y0}, {"width", m.width}, {"height", m.height},
{"ox", m.ox}, {"oy", m.oy}, {"fx", m.fx}, {"fy", m.fy}, {"sx", m.sx}, {"sy", m.sy}});
std::ofstream out(path);
out << nlohmann::json{{"module_geometry", list}}.dump(2) << "\n";
out << nlohmann::ordered_json{{"module_geometry", list}}.dump(2) << "\n";
if (!out)
throw std::runtime_error("write failed");
}