From c706dfbac1c136abe5276cf2c7725e3ba9d4dd12 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Mon, 2 Nov 2026 21:08:25 +0100 Subject: [PATCH] rugnux: _panels.json keeps its keys in the documented order Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UqXYdJKPUFLoeAchjzv3x4 --- rugnux/rugnux_cli.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rugnux/rugnux_cli.cpp b/rugnux/rugnux_cli.cpp index 8167ad9b7..df7ccbf90 100644 --- a/rugnux/rugnux_cli.cpp +++ b/rugnux/rugnux_cli.cpp @@ -144,12 +144,12 @@ std::vector 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"); }