From 74f60c47efe96f6d39054f466d51338e4806fb3d Mon Sep 17 00:00:00 2001 From: tao wang Date: Fri, 22 Mar 2024 10:18:27 +0800 Subject: [PATCH] FIX:fix the v tray's filament unload logic jira:[STUDIO-6627] Change-Id: I34420bc4d1d27b6b36defb9852bba2eaf77fdcf2 --- src/slic3r/GUI/StatusPanel.cpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 75fc0a504..98d91f358 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -2738,33 +2738,31 @@ void StatusPanel::update_ams_control_state(bool is_curr_tray_selected) enable[ACTION_BTN_UNLOAD] = false; } else { - if (m_ams_control->GetCurentAms() == std::to_string(VIRTUAL_TRAY_ID)) { - if (obj->m_tray_now == "255") { + if (obj->m_tray_now == "255") { + + if ( m_ams_control->GetCurentAms() == std::to_string(VIRTUAL_TRAY_ID) ) { enable[ACTION_BTN_LOAD] = true; enable[ACTION_BTN_UNLOAD] = false; } - else if (obj->m_tray_now == std::to_string(VIRTUAL_TRAY_ID)) { + else if (!m_ams_control->GetCurrentCan(m_ams_control->GetCurentAms()).empty()) { + enable[ACTION_BTN_LOAD] = false; + enable[ACTION_BTN_UNLOAD] = false; + } + } + else if (obj->m_tray_now == std::to_string(VIRTUAL_TRAY_ID)) { + if (m_ams_control->GetCurentAms() == std::to_string(VIRTUAL_TRAY_ID)) { enable[ACTION_BTN_LOAD] = false; enable[ACTION_BTN_UNLOAD] = true; } - } - else if (!m_ams_control->GetCurrentCan(m_ams_control->GetCurentAms()).empty()) { - enable[ACTION_BTN_LOAD] = false; - enable[ACTION_BTN_UNLOAD] = false; - } - - /* if (obj->m_tray_now == "255") { - enable[ACTION_BTN_LOAD] = true; - enable[ACTION_BTN_UNLOAD] = false; - } - else if (obj->m_tray_now == std::to_string(VIRTUAL_TRAY_ID)) { - enable[ACTION_BTN_LOAD] = false; - enable[ACTION_BTN_UNLOAD] = true; + else if (!m_ams_control->GetCurrentCan(m_ams_control->GetCurentAms()).empty()) { + enable[ACTION_BTN_LOAD] = false; + enable[ACTION_BTN_UNLOAD] = false; + } } else { enable[ACTION_BTN_LOAD] = false; enable[ACTION_BTN_UNLOAD] = false; - }*/ + } } } }