From a3365e14f074137b2e0bbda2c17ad23b6ed4220b Mon Sep 17 00:00:00 2001 From: tao wang Date: Fri, 15 Mar 2024 19:39:26 +0800 Subject: [PATCH] FIX:fix the load status of vtray jira:[STUDIO-6435] Change-Id: I8cafcc0b6caf19492aae6c153fb509f470dc7e83 --- src/slic3r/GUI/AMSMaterialsSetting.cpp | 6 +++--- src/slic3r/GUI/StatusPanel.cpp | 19 +++++++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/AMSMaterialsSetting.cpp b/src/slic3r/GUI/AMSMaterialsSetting.cpp index 34ff5fe0c..c40ea8400 100644 --- a/src/slic3r/GUI/AMSMaterialsSetting.cpp +++ b/src/slic3r/GUI/AMSMaterialsSetting.cpp @@ -254,8 +254,8 @@ void AMSMaterialsSetting::create_panel_normal(wxWindow* parent) m_tip_readonly = new Label(parent, _L("Setting AMS slot information while printing is not supported")); m_tip_readonly->SetForegroundColour(*wxBLACK); m_tip_readonly->SetBackgroundColour(*wxWHITE); - m_tip_readonly->SetMinSize(wxSize(FromDIP(450), -1)); - m_tip_readonly->SetMaxSize(wxSize(FromDIP(450), -1)); + m_tip_readonly->SetMinSize(wxSize(FromDIP(380), -1)); + m_tip_readonly->SetMaxSize(wxSize(FromDIP(380), -1)); m_tip_readonly->Hide(); m_tip_sizer->Add(m_tip_readonly, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(20)); @@ -420,7 +420,7 @@ void AMSMaterialsSetting::enable_confirm_button(bool en) else { m_tip_readonly->SetLabelText(_L("Setting Virtual slot information while printing is not supported")); } - m_tip_readonly->Wrap(FromDIP(450)); + m_tip_readonly->Wrap(FromDIP(380)); m_tip_readonly->Show(!en); } } diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index d8f37e7f7..75fc0a504 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -2738,7 +2738,22 @@ void StatusPanel::update_ams_control_state(bool is_curr_tray_selected) enable[ACTION_BTN_UNLOAD] = false; } else { - if (obj->m_tray_now == "255") { + if (m_ams_control->GetCurentAms() == std::to_string(VIRTUAL_TRAY_ID)) { + 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; + } + + /* if (obj->m_tray_now == "255") { enable[ACTION_BTN_LOAD] = true; enable[ACTION_BTN_UNLOAD] = false; } @@ -2749,7 +2764,7 @@ void StatusPanel::update_ams_control_state(bool is_curr_tray_selected) else { enable[ACTION_BTN_LOAD] = false; enable[ACTION_BTN_UNLOAD] = false; - } + }*/ } } }