From ddc052749c64d89acbd1e8b817a41ed63897b8e5 Mon Sep 17 00:00:00 2001 From: "hu.wang" Date: Mon, 4 Sep 2023 15:54:58 +0800 Subject: [PATCH] ENH:Don't call the interface when task id is incorrect JIRA:STUDIO-4322 Change-Id: I6fc1dc7379cba0702927e30cab0aa271074c59da (cherry picked from commit 109e3570a898706f449ccac7878c50aef2df9f75) --- src/slic3r/GUI/DeviceManager.cpp | 5 ++--- src/slic3r/GUI/StatusPanel.cpp | 5 ++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 884062a808..1a4bbe6d40 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -4508,7 +4508,8 @@ void MachineObject::update_slice_info(std::string project_id, std::string profil } if (project_id.compare("0") == 0 - || profile_id.compare("0") == 0) return; + || profile_id.compare("0") == 0 + || subtask_id.compare("0") == 0) return; BOOST_LOG_TRIVIAL(trace) << "slice_info: start"; slice_info = new BBLSliceInfo(); @@ -4520,8 +4521,6 @@ void MachineObject::update_slice_info(std::string project_id, std::string profil if (plate_idx >= 0) { plate_index = plate_idx; } else { - if (subtask_id.compare("0") == 0) - return; std::string subtask_json; unsigned http_code = 0; diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index e3faac6fc0..807a7df92d 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -2712,7 +2712,10 @@ void StatusPanel::update_model_info() if (!curr_model_task) { curr_model_task = new BBLModelTask(); curr_model_task->task_id = curr_task->task_id; - wxGetApp().getAgent()->get_subtask(curr_model_task, get_subtask_fn); + request_model_info_flag = true; + if (!curr_model_task->task_id.empty() && curr_model_task->task_id.compare("0") != 0) { + wxGetApp().getAgent()->get_subtask(curr_model_task, get_subtask_fn); + } } } }