From 8a279ef30238dc70ef9b4ef473e75b4335059b87 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) --- 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 25019793a..c4c5a1fa0 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -4547,6 +4547,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; @@ -4591,6 +4597,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; @@ -4632,6 +4645,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; @@ -4695,6 +4715,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;