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"); }