From fde250fbe3b5bc09909a9c779aad3a571093a634 Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Fri, 23 Aug 2024 15:41:16 +0800 Subject: [PATCH] FIX: add ack info for cali command jira: none Change-Id: Iec36ba2fd1248428234d74adb2089d975c54b7f2 (cherry picked from commit 0312db40c8ee5dfe7a912bf9992240f99036f6a8) (cherry picked from commit 8a279ef30238dc70ef9b4ef473e75b4335059b87) --- src/slic3r/GUI/DeviceManager.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index e8fc6185b6..2fcd9d39cd 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -4492,6 +4492,12 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) } } } else if (jj["command"].get() == "extrusion_cali_set") { + if (jj.contains("result") && jj.contains("reason")) { + if (jj["result"].get() == "fail") { + auto err_code = jj["err_code"].get(); + print_error = err_code; + } + } #ifdef CALI_DEBUG std::string str = jj.dump(); BOOST_LOG_TRIVIAL(info) << "extrusion_cali_set: " << str; @@ -4536,6 +4542,13 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) extrusion_cali_set_hold_start = std::chrono::system_clock::now(); } else if (jj["command"].get() == "extrusion_cali_sel") { + if (jj.contains("result") && jj.contains("reason")) { + if (jj["result"].get() == "fail") { + auto err_code = jj["err_code"].get(); + print_error = err_code; + } + } + #ifdef CALI_DEBUG std::string str = jj.dump(); BOOST_LOG_TRIVIAL(info) << "extrusion_cali_sel: " << str; @@ -4577,6 +4590,13 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) } } else if (jj["command"].get() == "extrusion_cali_get") { + if (jj.contains("result") && jj.contains("reason")) { + if (jj["result"].get() == "fail") { + auto err_code = jj["err_code"].get(); + print_error = err_code; + } + } + reset_pa_cali_history_result(); has_get_pa_calib_tab = true; @@ -4640,6 +4660,13 @@ int MachineObject::parse_json(std::string payload, bool key_field_only) // notify cali history to update } else if (jj["command"].get() == "extrusion_cali_get_result") { + if (jj.contains("result") && jj.contains("reason")) { + if (jj["result"].get() == "fail") { + auto err_code = jj["err_code"].get(); + print_error = err_code; + } + } + reset_pa_cali_result(); get_pa_calib_result = true;