From 0ffcd9cc13ce7bbc1f6f96a09647e2f6afa112b1 Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Fri, 7 Mar 2025 11:36:47 +0800 Subject: [PATCH] FIX: update the image size jira: [STUDIO-10732] Change-Id: Ib4d55b911740cef079f38cd497d40a29ae3b1031 --- src/slic3r/GUI/Widgets/AMSControl.cpp | 5 ++++- src/slic3r/GUI/Widgets/AMSItem.cpp | 13 ++++++++----- src/slic3r/GUI/Widgets/AMSItem.hpp | 5 +++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/slic3r/GUI/Widgets/AMSControl.cpp b/src/slic3r/GUI/Widgets/AMSControl.cpp index e494b68af..10d965f9f 100644 --- a/src/slic3r/GUI/Widgets/AMSControl.cpp +++ b/src/slic3r/GUI/Widgets/AMSControl.cpp @@ -3481,7 +3481,10 @@ void AMSControl::UpdateAms(const std::string& series_name, std::vector } /*update ams extruder*/ - m_extruder->updateNozzleNum(m_extder_data.total_extder_count, series_name); + if (m_extruder->updateNozzleNum(m_extder_data.total_extder_count, series_name)) + { + m_amswin->Layout(); + } } void AMSControl::AddAmsPreview(AMSinfo info, AMSModel type) diff --git a/src/slic3r/GUI/Widgets/AMSItem.cpp b/src/slic3r/GUI/Widgets/AMSItem.cpp index 1ab66c5dd..b75bae92c 100644 --- a/src/slic3r/GUI/Widgets/AMSItem.cpp +++ b/src/slic3r/GUI/Widgets/AMSItem.cpp @@ -766,9 +766,10 @@ void AMSextruder::OnAmsLoading(bool load, int nozzle_id, wxColour col /*= AMS_CO } } -void AMSextruder::updateNozzleNum(int nozzle_num, const string& series_name) +/*return true if something is updated*/ +bool AMSextruder::updateNozzleNum(int nozzle_num, const string& series_name) { - if (m_nozzle_num == nozzle_num && m_series_name == series_name) return; + if (m_nozzle_num == nozzle_num && m_series_name == series_name) return false; m_series_name = series_name; m_nozzle_num = nozzle_num; this->DestroyChildren(); @@ -789,15 +790,15 @@ void AMSextruder::updateNozzleNum(int nozzle_num, const string& series_name) { if (MachineObject::is_series_n(m_series_name)) { - m_left_extruder = new AMSextruderImage(this, wxID_ANY, "single_nozzle_n", AMS_EXTRUDER_SINGLE_NOZZLE_BITMAP_SIZE); + m_left_extruder = new AMSextruderImage(this, wxID_ANY, "single_nozzle_n", AMS_EXTRUDER_SINGLE_NOZZLE_N_SIZE); } else if(MachineObject::is_series_x(m_series_name) || MachineObject::is_series_p(m_series_name)) { - m_left_extruder = new AMSextruderImage(this, wxID_ANY, "single_nozzle_xp", AMS_EXTRUDER_SINGLE_NOZZLE_BITMAP_SIZE); + m_left_extruder = new AMSextruderImage(this, wxID_ANY, "single_nozzle_xp", AMS_EXTRUDER_SINGLE_NOZZLE_XP_SIZE); } else { - m_left_extruder = new AMSextruderImage(this, wxID_ANY, "single_nozzle_xp", AMS_EXTRUDER_SINGLE_NOZZLE_BITMAP_SIZE); + m_left_extruder = new AMSextruderImage(this, wxID_ANY, "single_nozzle_xp", AMS_EXTRUDER_SINGLE_NOZZLE_XP_SIZE); } m_left_extruder->setShowState(true); @@ -809,6 +810,8 @@ void AMSextruder::updateNozzleNum(int nozzle_num, const string& series_name) SetSizer(m_bitmap_sizer); Layout(); Refresh(); + + return true; } void AMSextruder::msw_rescale() diff --git a/src/slic3r/GUI/Widgets/AMSItem.hpp b/src/slic3r/GUI/Widgets/AMSItem.hpp index f5b99015a..2be75e48c 100644 --- a/src/slic3r/GUI/Widgets/AMSItem.hpp +++ b/src/slic3r/GUI/Widgets/AMSItem.hpp @@ -157,7 +157,8 @@ enum FilamentStepType { #define AMS_REFRESH_SIZE wxSize(FromDIP(28), FromDIP(28)) #define AMS_EXTRUDER_SIZE wxSize(FromDIP(29), FromDIP(37)) #define AMS_EXTRUDER_DOUBLE_NOZZLE_BITMAP_SIZE wxSize(FromDIP(13), FromDIP(36)) -#define AMS_EXTRUDER_SINGLE_NOZZLE_BITMAP_SIZE wxSize(FromDIP(18), FromDIP(36)) +#define AMS_EXTRUDER_SINGLE_NOZZLE_N_SIZE wxSize(FromDIP(18), FromDIP(36)) +#define AMS_EXTRUDER_SINGLE_NOZZLE_XP_SIZE wxSize(FromDIP(25), FromDIP(36)) #define AMS_BODY_SIZE wxSize(FromDIP(36), FromDIP(55)) #define AMS_DOWN_ROAD_SIZE wxSize(FromDIP(568), FromDIP(10)) @@ -409,7 +410,7 @@ public: void msw_rescale(); void has_ams(bool hams) {m_has_vams = hams; Refresh();}; void no_ams_mode(bool mode) {m_none_ams_mode = mode; Refresh();}; - void updateNozzleNum(int nozzle_num, const std::string& series_name = string()); + bool updateNozzleNum(int nozzle_num, const std::string& series_name = string()); bool m_none_ams_mode{true}; bool m_has_vams{false};