From 2c675b13659d45d814fbf1b9e50636baa0b4016d Mon Sep 17 00:00:00 2001 From: hemai Date: Thu, 18 Sep 2025 20:15:59 +0800 Subject: [PATCH] FIX: fit proceed action change Jira: [STUDIO-14689] Change-Id: Ia6a842b5b3bd542c25e67545528b847513d533f1 (cherry picked from commit 4cd33fded68797eb3098cb359ba1708b7f0c8bee) --- src/slic3r/GUI/DeviceManager.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 9ab8286e0c..cc82f323ed 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -2994,19 +2994,20 @@ int MachineObject::parse_json(std::string tunnel, std::string payload, bool key_ if (!key_field_only) { - if (is_studio_cmd(sequence_id) && jj.contains("command") && jj.contains("err_code") && jj.contains("result")) + if (is_studio_cmd(sequence_id) && jj.contains("command") && jj.contains("err_code")) { - if (jj["err_code"].is_number()) { add_command_error_code_dlg(jj["err_code"].get());} - } - /* proceed action*/ - else if (is_studio_cmd(sequence_id) && jj.contains("command") && jj.contains("err_code") && jj.contains("err_index")) { - json action_json; - action_json["command"] = jj["command"]; - action_json["err_code"] = jj["err_code"]; - action_json["err_index"] = jj["err_index"]; - action_json["err_ignored"] = jj.contains("err_ignored") ? jj["err_ignored"] : json::array(); - - add_command_error_code_dlg(jj["err_code"].get(), action_json); + if (jj["err_code"].is_number()) + { + json action_json; + if (jj.contains("err_index")) { + /* proceed action*/ + action_json["command"] = jj["command"]; + action_json["err_code"] = jj["err_code"]; + action_json["err_index"] = jj["err_index"]; + action_json["err_ignored"] = jj.contains("err_ignored") ? jj["err_ignored"] : json::array(); + } + add_command_error_code_dlg(jj["err_code"].get(), action_json); + } } }