From f9a7f056e9e58c55cd29b822d2da40b82e2634fc Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Wed, 26 Mar 2025 17:46:14 +0800 Subject: [PATCH] FIX: use different ext image for different machine jira: [STUDIO-11133] Change-Id: Ice69b4f33317e23a2c2d7b8fbdfc94402b4bba28 (cherry picked from commit a67acd8f0ced49052cfe0c4b01a5bf159b046e85) --- ...xt_image.svg => ams_ext_image_default.svg} | 0 resources/images/ams_ext_image_n1.svg | 2692 +++++++++++++++++ resources/images/ams_ext_image_n2s.svg | 1477 +++++++++ ...mage_left.svg => ams_ext_image_o_left.svg} | 0 ...ge_right.svg => ams_ext_image_o_right.svg} | 0 resources/images/ams_ext_image_xp.svg | 322 ++ resources/images/ext_image_default.svg | 5 + resources/images/ext_image_n1.svg | 2692 +++++++++++++++++ resources/images/ext_image_n2s.svg | 1477 +++++++++ resources/images/ext_image_o_left.svg | 25 + resources/images/ext_image_o_right.svg | 25 + resources/images/ext_image_single_nozzle.svg | 5 - resources/images/ext_image_xp.svg | 322 ++ src/slic3r/GUI/StatusPanel.cpp | 2 +- src/slic3r/GUI/Widgets/AMSControl.cpp | 47 +- src/slic3r/GUI/Widgets/AMSControl.hpp | 17 +- src/slic3r/GUI/Widgets/AMSItem.cpp | 108 +- src/slic3r/GUI/Widgets/AMSItem.hpp | 26 +- src/slic3r/GUI/wxExtensions.cpp | 9 + src/slic3r/GUI/wxExtensions.hpp | 10 +- 20 files changed, 9174 insertions(+), 87 deletions(-) rename resources/images/{ams_ext_image.svg => ams_ext_image_default.svg} (100%) create mode 100644 resources/images/ams_ext_image_n1.svg create mode 100644 resources/images/ams_ext_image_n2s.svg rename resources/images/{ext_image_left.svg => ams_ext_image_o_left.svg} (100%) rename resources/images/{ext_image_right.svg => ams_ext_image_o_right.svg} (100%) create mode 100644 resources/images/ams_ext_image_xp.svg create mode 100644 resources/images/ext_image_default.svg create mode 100644 resources/images/ext_image_n1.svg create mode 100644 resources/images/ext_image_n2s.svg create mode 100644 resources/images/ext_image_o_left.svg create mode 100644 resources/images/ext_image_o_right.svg delete mode 100644 resources/images/ext_image_single_nozzle.svg create mode 100644 resources/images/ext_image_xp.svg diff --git a/resources/images/ams_ext_image.svg b/resources/images/ams_ext_image_default.svg similarity index 100% rename from resources/images/ams_ext_image.svg rename to resources/images/ams_ext_image_default.svg diff --git a/resources/images/ams_ext_image_n1.svg b/resources/images/ams_ext_image_n1.svg new file mode 100644 index 0000000000..474a9194c6 --- /dev/null +++ b/resources/images/ams_ext_image_n1.svg @@ -0,0 +1,2692 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/ams_ext_image_n2s.svg b/resources/images/ams_ext_image_n2s.svg new file mode 100644 index 0000000000..d8c59be9da --- /dev/null +++ b/resources/images/ams_ext_image_n2s.svg @@ -0,0 +1,1477 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/ext_image_left.svg b/resources/images/ams_ext_image_o_left.svg similarity index 100% rename from resources/images/ext_image_left.svg rename to resources/images/ams_ext_image_o_left.svg diff --git a/resources/images/ext_image_right.svg b/resources/images/ams_ext_image_o_right.svg similarity index 100% rename from resources/images/ext_image_right.svg rename to resources/images/ams_ext_image_o_right.svg diff --git a/resources/images/ams_ext_image_xp.svg b/resources/images/ams_ext_image_xp.svg new file mode 100644 index 0000000000..c81f8fcb20 --- /dev/null +++ b/resources/images/ams_ext_image_xp.svg @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/ext_image_default.svg b/resources/images/ext_image_default.svg new file mode 100644 index 0000000000..299f4cb943 --- /dev/null +++ b/resources/images/ext_image_default.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/images/ext_image_n1.svg b/resources/images/ext_image_n1.svg new file mode 100644 index 0000000000..474a9194c6 --- /dev/null +++ b/resources/images/ext_image_n1.svg @@ -0,0 +1,2692 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/ext_image_n2s.svg b/resources/images/ext_image_n2s.svg new file mode 100644 index 0000000000..d8c59be9da --- /dev/null +++ b/resources/images/ext_image_n2s.svg @@ -0,0 +1,1477 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/ext_image_o_left.svg b/resources/images/ext_image_o_left.svg new file mode 100644 index 0000000000..dc41b341cf --- /dev/null +++ b/resources/images/ext_image_o_left.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/ext_image_o_right.svg b/resources/images/ext_image_o_right.svg new file mode 100644 index 0000000000..e105d655c4 --- /dev/null +++ b/resources/images/ext_image_o_right.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/images/ext_image_single_nozzle.svg b/resources/images/ext_image_single_nozzle.svg deleted file mode 100644 index 5cad887f9b..0000000000 --- a/resources/images/ext_image_single_nozzle.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/resources/images/ext_image_xp.svg b/resources/images/ext_image_xp.svg new file mode 100644 index 0000000000..c81f8fcb20 --- /dev/null +++ b/resources/images/ext_image_xp.svg @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 9c335ab3e5..fa4f1d6205 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -3262,7 +3262,7 @@ void StatusPanel::update_ams(MachineObject *obj) ExtderData data = obj->m_extder_data; // must select a current can - m_ams_control->UpdateAms(obj->get_printer_series_str(), ams_info, ext_info, data, dev_id, false); + m_ams_control->UpdateAms(obj->get_printer_series_str(), obj->printer_type, ams_info, ext_info, data, dev_id, false); last_tray_exist_bits = obj->tray_exist_bits; last_ams_exist_bits = obj->ams_exist_bits; diff --git a/src/slic3r/GUI/Widgets/AMSControl.cpp b/src/slic3r/GUI/Widgets/AMSControl.cpp index 5bb3352fc8..b1c11dc927 100644 --- a/src/slic3r/GUI/Widgets/AMSControl.cpp +++ b/src/slic3r/GUI/Widgets/AMSControl.cpp @@ -593,7 +593,7 @@ void AMSControl::ClearAms() { pair_id.clear(); } -void AMSControl::CreateAmsDoubleNozzle() +void AMSControl::CreateAmsDoubleNozzle(const std::string &series_name, const std::string &printer_type) { std::vector single_info_left; std::vector single_info_right; @@ -612,7 +612,7 @@ void AMSControl::CreateAmsDoubleNozzle() if (single_info_right.size() == 2){ single_info_right[0].nozzle_id == MAIN_NOZZLE_ID ? m_item_ids[MAIN_NOZZLE_ID].push_back(single_info_right[0].ams_id) : m_item_ids[DEPUTY_NOZZLE_ID].push_back(single_info_right[0].ams_id); single_info_right[1].nozzle_id == MAIN_NOZZLE_ID ? m_item_ids[MAIN_NOZZLE_ID].push_back(single_info_right[1].ams_id) : m_item_ids[DEPUTY_NOZZLE_ID].push_back(single_info_right[1].ams_id); - AddAms(single_info_right); + AddAms(single_info_right, series_name, printer_type); AddAmsPreview(single_info_right, AMSPanelPos::RIGHT_PANEL); pair_id.push_back(std::make_pair(single_info_right[0].ams_id, single_info_right[1].ams_id)); single_info_right.clear(); @@ -623,7 +623,7 @@ void AMSControl::CreateAmsDoubleNozzle() if (single_info_left.size() == 2){ single_info_left[0].nozzle_id == MAIN_NOZZLE_ID ? m_item_ids[MAIN_NOZZLE_ID].push_back(single_info_left[0].ams_id) : m_item_ids[DEPUTY_NOZZLE_ID].push_back(single_info_left[0].ams_id); single_info_left[1].nozzle_id == MAIN_NOZZLE_ID ? m_item_ids[MAIN_NOZZLE_ID].push_back(single_info_left[1].ams_id) : m_item_ids[DEPUTY_NOZZLE_ID].push_back(single_info_left[1].ams_id); - AddAms(single_info_left); + AddAms(single_info_left, series_name, printer_type); AddAmsPreview(single_info_left, AMSPanelPos::LEFT_PANEL); pair_id.push_back(std::make_pair(single_info_left[0].ams_id, single_info_left[1].ams_id)); single_info_left.clear(); @@ -652,7 +652,7 @@ void AMSControl::CreateAmsDoubleNozzle() single_info_right[1].nozzle_id == MAIN_NOZZLE_ID ? m_item_ids[MAIN_NOZZLE_ID].push_back(single_info_right[1].ams_id) : m_item_ids[DEPUTY_NOZZLE_ID].push_back(single_info_right[1].ams_id); pair_id.push_back(std::make_pair(single_info_right[0].ams_id, single_info_right[1].ams_id)); } - AddAms(single_info_right); + AddAms(single_info_right, series_name, printer_type); AddAmsPreview(single_info_right, AMSPanelPos::RIGHT_PANEL); single_info_right.clear(); @@ -670,7 +670,7 @@ void AMSControl::CreateAmsDoubleNozzle() pair_id.push_back(std::make_pair(single_info_left[0].ams_id, single_info_left[1].ams_id)); } AddAmsPreview(single_info_left, AMSPanelPos::LEFT_PANEL); - AddAms(single_info_left); + AddAms(single_info_left, series_name, printer_type); single_info_left.clear(); m_sizer_prv_left->Layout(); @@ -712,7 +712,7 @@ void AMSControl::CreateAmsDoubleNozzle() //Thaw(); } -void AMSControl::CreateAmsSingleNozzle() +void AMSControl::CreateAmsSingleNozzle(const std::string &series_name, const std::string &printer_type) { std::vectorm_item_nums{0,0}; std::vector single_info; @@ -747,7 +747,7 @@ void AMSControl::CreateAmsSingleNozzle() if (single_info.size() > 0){ m_item_ids[DEPUTY_NOZZLE_ID].push_back(single_info[0].ams_id); m_item_nums[DEPUTY_NOZZLE_ID]++; - AddAms(single_info, AMSPanelPos::LEFT_PANEL); + AddAms(single_info, series_name, printer_type, AMSPanelPos::LEFT_PANEL); AddAmsPreview(single_info, AMSPanelPos::LEFT_PANEL); single_info.clear(); } @@ -760,7 +760,7 @@ void AMSControl::CreateAmsSingleNozzle() single_info.push_back(m_ext_info[0]); m_item_ids[MAIN_NOZZLE_ID].push_back(single_info[0].ams_id); - AddAms(single_info, AMSPanelPos::RIGHT_PANEL); + AddAms(single_info, series_name, printer_type, AMSPanelPos::RIGHT_PANEL); auto left_init_mode = findFirstMode(AMSPanelPos::LEFT_PANEL); auto right_init_mode = findFirstMode(AMSPanelPos::RIGHT_PANEL); @@ -894,7 +894,14 @@ std::vector AMSControl::GenerateSimulateData() { } -void AMSControl::UpdateAms(const std::string& series_name, std::vector ams_info, std::vectorext_info, ExtderData data, std::string dev_id, bool is_reset, bool test) +void AMSControl::UpdateAms(const std::string &series_name, + const std::string &printer_type, + std::vector ams_info, + std::vector ext_info, + ExtderData data, + std::string dev_id, + bool is_reset, + bool test) { if (!test){ // update item @@ -925,9 +932,9 @@ void AMSControl::UpdateAms(const std::string& series_name, std::vector if (fresh){ ClearAms(); if (m_extder_data.total_extder_count >= 2){ - CreateAmsDoubleNozzle(); + CreateAmsDoubleNozzle(series_name, printer_type); }else{ - CreateAmsSingleNozzle(); + CreateAmsSingleNozzle(series_name, printer_type); } SetSize(wxSize(FromDIP(578), -1)); SetMinSize(wxSize(FromDIP(578), -1)); @@ -1127,7 +1134,7 @@ AMSRoadShowMode AMSControl::findFirstMode(AMSPanelPos pos) { } } -void AMSControl::createAmsPanel(wxSimplebook *parent, int &idx, std::vector infos, AMSPanelPos pos, int total_ext_num) +void AMSControl::createAmsPanel(wxSimplebook *parent, int &idx, std::vector infos, const std::string &series_name, const std::string &printer_type, AMSPanelPos pos, int total_ext_num) { if (infos.size() <= 0) return; @@ -1139,11 +1146,11 @@ void AMSControl::createAmsPanel(wxSimplebook *parent, int &idx, std::vectorget_ext_image()) { ams1->get_ext_image()->setTotalExtNum(total_ext_num); } + if (ams1->get_ext_image()) { ams1->get_ext_image()->setTotalExtNum(series_name, printer_type, total_ext_num); } if (infos.size() == MAX_AMS_NUM_IN_PANEL) { //n3s and ? in a panel ams2 = new AmsItem(book_panel, infos[1], infos[1].ams_type, pos); - if (ams2->get_ext_image()) { ams2->get_ext_image()->setTotalExtNum(total_ext_num); } + if (ams2->get_ext_image()) { ams2->get_ext_image()->setTotalExtNum(series_name, printer_type, total_ext_num); } if (pos == AMSPanelPos::LEFT_PANEL) { book_sizer->Add(ams1, 0, wxLEFT, FromDIP(4)); @@ -1166,6 +1173,7 @@ void AMSControl::createAmsPanel(wxSimplebook *parent, int &idx, std::vectorAdd(ams1, 0, wxLEFT, FromDIP(30)); book_sizer->Add(ext_image, 0, wxEXPAND | wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(30)); + ext_image->setTotalExtNum(series_name, printer_type, total_ext_num); m_ext_image_list[infos[0].ams_id] = ext_image; } } @@ -1225,24 +1233,25 @@ void AMSControl::AddAms(AMSinfo info, AMSPanelPos pos) // //} -void AMSControl::AddAms(std::vectorsingle_info, AMSPanelPos pos) { +void AMSControl::AddAms(std::vector single_info, const std::string &series_name, const std::string &printer_type, AMSPanelPos pos) +{ if (single_info.size() <= 0){ return; } if (m_extder_data.total_extder_count == 2) { if (single_info[0].nozzle_id == MAIN_NOZZLE_ID) { - createAmsPanel(m_simplebook_ams_right, m_right_page_index, single_info, AMSPanelPos::RIGHT_PANEL, m_extder_data.total_extder_count); + createAmsPanel(m_simplebook_ams_right, m_right_page_index, single_info, series_name, printer_type, AMSPanelPos::RIGHT_PANEL, m_extder_data.total_extder_count); } else if (single_info[0].nozzle_id == DEPUTY_NOZZLE_ID) { - createAmsPanel(m_simplebook_ams_left, m_left_page_index, single_info, AMSPanelPos::LEFT_PANEL, m_extder_data.total_extder_count); + createAmsPanel(m_simplebook_ams_left, m_left_page_index, single_info, series_name, printer_type, AMSPanelPos::LEFT_PANEL, m_extder_data.total_extder_count); } } else if (m_extder_data.total_extder_count == 1) { if (pos == AMSPanelPos::RIGHT_PANEL) { - createAmsPanel(m_simplebook_ams_right, m_right_page_index, single_info, AMSPanelPos::RIGHT_PANEL, m_extder_data.total_extder_count); + createAmsPanel(m_simplebook_ams_right, m_right_page_index, single_info, series_name, printer_type, AMSPanelPos::RIGHT_PANEL, m_extder_data.total_extder_count); } else { - createAmsPanel(m_simplebook_ams_left, m_left_page_index, single_info, AMSPanelPos::LEFT_PANEL, m_extder_data.total_extder_count); + createAmsPanel(m_simplebook_ams_left, m_left_page_index, single_info, series_name, printer_type, AMSPanelPos::LEFT_PANEL, m_extder_data.total_extder_count); } } diff --git a/src/slic3r/GUI/Widgets/AMSControl.hpp b/src/slic3r/GUI/Widgets/AMSControl.hpp index 9fcb55e6c0..86634bf5b4 100644 --- a/src/slic3r/GUI/Widgets/AMSControl.hpp +++ b/src/slic3r/GUI/Widgets/AMSControl.hpp @@ -127,7 +127,7 @@ public: bool IsAmsInRightPanel(std::string ams_id); wxColour GetCanColour(std::string amsid, std::string canid); void createAms(wxSimplebook* parent, int& idx, AMSinfo info, AMSPanelPos pos); - void createAmsPanel(wxSimplebook* parent, int& idx, std::vectorinfos, AMSPanelPos pos, int total_ext_num); + void createAmsPanel(wxSimplebook *parent, int &idx, std::vector infos, const std::string &series_name, const std::string &printer_type, AMSPanelPos pos, int total_ext_num); AMSRoadShowMode findFirstMode(AMSPanelPos pos); AMSModel m_ams_model{AMSModel::EXT_AMS}; @@ -149,10 +149,17 @@ public: void UpdatePassRoad(string ams_id, AMSPassRoadType type, AMSPassRoadSTEP step); void CreateAms(); - void CreateAmsDoubleNozzle(); - void CreateAmsSingleNozzle(); + void CreateAmsDoubleNozzle(const std::string &series_name, const std::string& printer_type); + void CreateAmsSingleNozzle(const std::string &series_name, const std::string &printer_type); void ClearAms(); - void UpdateAms(const std::string& series_name, std::vector ams_info, std::vector ext_info, ExtderData data, std::string dev_id, bool is_reset = true, bool test = false); + void UpdateAms(const std::string &series_name, + const std::string &printer_type, + std::vector ams_info, + std::vector ext_info, + ExtderData data, + std::string dev_id, + bool is_reset = true, + bool test = false); std::vector GenerateSimulateData(); void AddAms(AMSinfo info, AMSPanelPos pos = AMSPanelPos::LEFT_PANEL); @@ -160,7 +167,7 @@ public: void AddAmsPreview(AMSinfo info, AMSModel type); //void AddExtraAms(AMSinfo info); - void AddAms(std::vectorsingle_info, AMSPanelPos pos = AMSPanelPos::LEFT_PANEL); + void AddAms(std::vector single_info, const std::string &series_name, const std::string &printer_type, AMSPanelPos pos = AMSPanelPos::LEFT_PANEL); void AddAmsPreview(std::vectorsingle_info, AMSPanelPos pos); //void AddExtraAms(std::vectorsingle_info); void SetExtruder(bool on_off, std::string ams_id, std::string slot_id); diff --git a/src/slic3r/GUI/Widgets/AMSItem.cpp b/src/slic3r/GUI/Widgets/AMSItem.cpp index b75bae92c3..32512951d0 100644 --- a/src/slic3r/GUI/Widgets/AMSItem.cpp +++ b/src/slic3r/GUI/Widgets/AMSItem.cpp @@ -581,14 +581,7 @@ AMSExtImage::AMSExtImage(wxWindow* parent, AMSPanelPos ext_pos, ExtderData *data } m_ext_pos = ext_pos; - m_ext_left = ScalableBitmap(this, "ext_image_left", 98); - m_ext_right = ScalableBitmap(this, "ext_image_right", 98); - m_ext_single_nozzle = ScalableBitmap(this, "ext_image_single_nozzle", 98); - - m_ams_single_ext = ScalableBitmap(this, "ams_ext_image", 25); - m_ams_ext_left = ScalableBitmap(this, "ext_image_left", 25); - m_ams_ext_right = ScalableBitmap(this, "ext_image_right", 25); - + createImages(); SetBackgroundColour(StateColor::darkModeColorFor(AMS_CONTROL_DEF_LIB_BK_COLOUR)); Bind(wxEVT_PAINT, &AMSExtImage::paintEvent, this); @@ -596,17 +589,63 @@ AMSExtImage::AMSExtImage(wxWindow* parent, AMSPanelPos ext_pos, ExtderData *data AMSExtImage::~AMSExtImage() {} +void AMSExtImage::createImages() +{ + m_ams_ext_o_left = ScalableBitmap(this, "ams_ext_image_o_left", 25); + m_ams_ext_o_right = ScalableBitmap(this, "ams_ext_image_o_right", 25); + m_ams_ext_xp = ScalableBitmap(this, "ams_ext_image_xp", 25); + m_ams_ext_n1 = ScalableBitmap(this, "ams_ext_image_n1", 25); + m_ams_ext_n2s = ScalableBitmap(this, "ams_ext_image_n2s", 25); + m_ams_ext_default = ScalableBitmap(this, "ams_ext_image_default", 25); + + m_ext_o_left = ScalableBitmap(this, "ext_image_o_left", 98); + m_ext_o_right = ScalableBitmap(this, "ext_image_o_right", 98); + m_ext_xp = ScalableBitmap(this, "ext_image_xp", 98); + m_ext_n1 = ScalableBitmap(this, "ext_image_n1", 98); + m_ext_n2s = ScalableBitmap(this, "ext_image_n2s", 98); + m_ext_default = ScalableBitmap(this, "ext_image_default", 98); +} + +const wxBitmap &AMSExtImage::get_bmp(const std::string &series_name, const std::string &printer_type, bool is_ams_ext, AMSPanelPos pos) const +{ + if (MachineObject::is_series_o(series_name)) { + if (pos == AMSPanelPos::LEFT_PANEL) { + return is_ams_ext ? m_ams_ext_o_left.bmp() : m_ext_o_left.bmp(); + } else if (pos == AMSPanelPos::RIGHT_PANEL) { + return is_ams_ext ? m_ams_ext_o_right.bmp() : m_ext_o_right.bmp(); + } + } else if (MachineObject::is_series_x(series_name) || MachineObject::is_series_p(series_name)) { + return is_ams_ext ? m_ams_ext_xp.bmp() : m_ext_xp.bmp(); + } else if (MachineObject::is_series_n(series_name)) { + if (printer_type == "N1") { + return is_ams_ext ? m_ams_ext_n1.bmp() : m_ext_n1.bmp(); + } else if (printer_type == "N2S") { + return is_ams_ext ? m_ams_ext_n2s.bmp() : m_ext_n2s.bmp(); + } + } + + return is_ams_ext ? m_ams_ext_default.bmp() : m_ext_default.bmp(); +} + void AMSExtImage::msw_rescale() { //m_ams_extruder.SetSize(AMS_EXTRUDER_BITMAP_SIZE); //auto image = m_ams_extruder.ConvertToImage(); - m_ext_left.msw_rescale(); - m_ext_right.msw_rescale(); - m_ext_single_nozzle.msw_rescale(); + m_ams_ext_o_left.msw_rescale(); + m_ams_ext_o_right.msw_rescale(); + m_ams_ext_xp.msw_rescale(); + m_ams_ext_n1.msw_rescale(); + m_ams_ext_n2s.msw_rescale(); + m_ams_ext_default.msw_rescale(); - m_ams_single_ext.msw_rescale(); - m_ams_ext_left.msw_rescale(); - m_ams_ext_right.msw_rescale(); + m_ext_o_left.msw_rescale(); + m_ext_o_right.msw_rescale(); + m_ext_xp.msw_rescale(); + m_ext_n1.msw_rescale(); + m_ext_n2s.msw_rescale(); + m_ext_default.msw_rescale(); + + m_ext_default.bmp(); Layout(); Fit(); @@ -622,11 +661,13 @@ void AMSExtImage::setShowAmsExt(bool show) } } -void AMSExtImage::setTotalExtNum(int num) +void AMSExtImage::setTotalExtNum(const std::string &series_name, const std::string &printer_type, int num) { - if (total_ext_num != num) + if ((total_ext_num != num) || (m_series_name != series_name) || (m_printer_type_name != printer_type)) { total_ext_num = num; + m_series_name = series_name; + m_printer_type_name = printer_type; Refresh(); } } @@ -665,21 +706,8 @@ void AMSExtImage::doRender(wxDC& dc) if (m_show_ams_ext) { - if (total_ext_num < 2) - { - dc.DrawBitmap(m_ams_single_ext.bmp(), wxPoint((size.x - m_ams_single_ext.GetBmpSize().x) / 2, 0)); - } - else - { - if (m_ext_pos == AMSPanelPos::LEFT_PANEL) - { - dc.DrawBitmap(m_ams_ext_left.bmp(), wxPoint((size.x - m_ams_ext_left.GetBmpSize().x) / 2, 0)); - } - else - { - dc.DrawBitmap(m_ams_ext_right.bmp(), wxPoint((size.x - m_ams_ext_right.GetBmpSize().x) / 2, 0)); - } - } + const wxBitmap &bmp = get_bmp(m_series_name, m_printer_type_name, true, m_ext_pos); + dc.DrawBitmap(bmp, wxPoint((size.x - ScalableBitmap::GetBmpSize(bmp).x) / 2, 0)); Layout(); return; @@ -687,21 +715,9 @@ void AMSExtImage::doRender(wxDC& dc) if (m_show_ext) { - if (total_ext_num < 2) - { - dc.DrawBitmap(m_ext_single_nozzle.bmp(), wxPoint((size.x - m_ext_right.GetBmpSize().x) / 2, (size.y - m_ext_right.GetBmpSize().GetHeight()))); - } - else - { - if (m_ext_pos == AMSPanelPos::LEFT_PANEL) - { - dc.DrawBitmap(m_ext_left.bmp(), wxPoint((size.x - m_ext_left.GetBmpSize().x) / 2, (size.y - m_ext_right.GetBmpSize().GetHeight()))); - } - else - { - dc.DrawBitmap(m_ext_right.bmp(), wxPoint((size.x - m_ext_right.GetBmpSize().x) / 2, (size.y - m_ext_right.GetBmpSize().GetHeight()))); - } - } + const wxBitmap &bmp = get_bmp(m_series_name, m_printer_type_name, false, m_ext_pos); + const wxSize& bmp_size = ScalableBitmap::GetBmpSize(bmp); + dc.DrawBitmap(bmp, wxPoint((size.x - bmp_size.x) / 2, (size.y - bmp_size.GetHeight()))); Layout(); return; diff --git a/src/slic3r/GUI/Widgets/AMSItem.hpp b/src/slic3r/GUI/Widgets/AMSItem.hpp index 2be75e48ca..ab0d58e94e 100644 --- a/src/slic3r/GUI/Widgets/AMSItem.hpp +++ b/src/slic3r/GUI/Widgets/AMSItem.hpp @@ -367,19 +367,28 @@ public: class AMSExtImage : public wxWindow { private: + std::string m_series_name; + std::string m_printer_type_name; + bool m_show_ams_ext = false; bool m_show_ext = false; AMSPanelPos m_ext_pos; int total_ext_num = 1; - ScalableBitmap m_ams_ext_left; - ScalableBitmap m_ams_ext_right; - ScalableBitmap m_ams_single_ext; + ScalableBitmap m_ams_ext_o_left; + ScalableBitmap m_ams_ext_o_right; + ScalableBitmap m_ams_ext_xp; + ScalableBitmap m_ams_ext_n1; + ScalableBitmap m_ams_ext_n2s; + ScalableBitmap m_ams_ext_default; - ScalableBitmap m_ext_left; - ScalableBitmap m_ext_right; - ScalableBitmap m_ext_single_nozzle; + ScalableBitmap m_ext_o_left; + ScalableBitmap m_ext_o_right; + ScalableBitmap m_ext_xp; + ScalableBitmap m_ext_n1; + ScalableBitmap m_ext_n2s; + ScalableBitmap m_ext_default; public: AMSExtImage(wxWindow *parent, AMSPanelPos ext_pos = AMSPanelPos::RIGHT_PANEL, ExtderData *data = nullptr, wxWindowID id = wxID_ANY, const wxPoint &pos = wxDefaultPosition); @@ -387,12 +396,15 @@ public: void msw_rescale(); void setShowAmsExt(bool show); - void setTotalExtNum(int num); + void setTotalExtNum(const std::string &series_name, const std::string &printer_type, int num); private: void paintEvent(wxPaintEvent &evt); void render(wxDC &dc); void doRender(wxDC &dc); + + void createImages(); + const wxBitmap &get_bmp(const std::string &series_name, const std::string &printer_type, bool is_ams_ext, AMSPanelPos pos) const; }; diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index 61844f92d4..3524289833 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -906,6 +906,15 @@ wxSize ScalableBitmap::GetBmpSize() const #endif } +wxSize ScalableBitmap::GetBmpSize(const wxBitmap &bmp) +{ +#ifdef __APPLE__ + return bmp.GetScaledSize(); +#else + return bmp.GetSize(); +#endif +} + int ScalableBitmap::GetBmpWidth() const { #ifdef __APPLE__ diff --git a/src/slic3r/GUI/wxExtensions.hpp b/src/slic3r/GUI/wxExtensions.hpp index d275b19f76..653b658991 100644 --- a/src/slic3r/GUI/wxExtensions.hpp +++ b/src/slic3r/GUI/wxExtensions.hpp @@ -41,7 +41,7 @@ wxMenuItem* append_menu_radio_item(wxMenu* menu, int id, const wxString& string, wxMenuItem* append_menu_check_item(wxMenu* menu, int id, const wxString& string, const wxString& description, std::function cb, wxEvtHandler* event_handler, - std::function const enable_condition = []() { return true; }, + std::function const enable_condition = []() { return true; }, std::function const check_condition = []() { return true; }, wxWindow* parent = nullptr); void enable_menu_item(wxUpdateUIEvent& evt, std::function const cb_condition, wxMenuItem* item, wxWindow* win); @@ -68,7 +68,7 @@ wxBitmap create_scaled_bitmap2(const std::string& bmp_name_in, Slic3r::GUI::Bitm const int px_cnt = 16, const bool grayscale = false, const bool resize = false, const std::vector& array_new_color = std::vector()); // color witch will used instead of orange #else -wxBitmap create_scaled_bitmap(const std::string& bmp_name, wxWindow *win = nullptr, +wxBitmap create_scaled_bitmap(const std::string& bmp_name, wxWindow *win = nullptr, const int px_cnt = 16, const bool grayscale = false, const bool resize = false); #endif @@ -157,7 +157,7 @@ public: ScalableBitmap() {}; ScalableBitmap( wxWindow *parent, const std::string& icon_name = "", - const int px_cnt = 16, + const int px_cnt = 16, const bool grayscale = false, const bool resize = false, const bool bitmap2 = false, @@ -166,6 +166,8 @@ public: ~ScalableBitmap() {} wxSize GetBmpSize() const; + static wxSize GetBmpSize(const wxBitmap &bmp); + int GetBmpWidth() const; int GetBmpHeight() const; @@ -271,7 +273,7 @@ private: bool m_use_default_disabled_bitmap {false}; - // bitmap dimensions + // bitmap dimensions int m_px_cnt{ 16 }; bool m_has_border {false}; };