mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-24 17:26:47 +00:00
Merge branch 'main' into feat/printer-agent-impl
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "DeviceCore/DevManager.h"
|
||||
#include "DeviceCore/DevMapping.h"
|
||||
#include "DeviceCore/DevStorage.h"
|
||||
#include "FilamentBitmapUtils.hpp"
|
||||
|
||||
using namespace Slic3r;
|
||||
using namespace Slic3r::GUI;
|
||||
@@ -2575,6 +2576,10 @@ void SyncAmsInfoDialog::reset_and_sync_ams_list()
|
||||
m_materialList.clear();
|
||||
m_filaments.clear();
|
||||
|
||||
// Mixed-color slots are virtual: they never occupy a tray, so they must not appear as
|
||||
// AMS sync targets.
|
||||
auto* is_mixed_opt = preset_bundle->project_config.option<ConfigOptionBools>("filament_is_mixed");
|
||||
|
||||
bool use_double_extruder = get_is_double_extruder();
|
||||
if (use_double_extruder) {
|
||||
const auto &project_config = preset_bundle->project_config;
|
||||
@@ -2592,6 +2597,8 @@ void SyncAmsInfoDialog::reset_and_sync_ams_list()
|
||||
auto colour_rgb = wxColour((int) rgb[0], (int) rgb[1], (int) rgb[2], (int) rgb[3]);
|
||||
if (extruder >= materials.size() || extruder < 0 || extruder >= display_materials.size())
|
||||
continue;
|
||||
if (is_mixed_opt && extruder < (int) is_mixed_opt->values.size() && is_mixed_opt->values[extruder])
|
||||
continue;
|
||||
|
||||
if (contronal_index % SYNC_FLEX_GRID_COL == 0) {
|
||||
wxBoxSizer *ams_tip_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
@@ -2793,6 +2800,10 @@ void SyncAmsInfoDialog::generate_override_fix_ams_list()
|
||||
m_fix_materialList.clear();
|
||||
m_fix_filaments.clear();
|
||||
|
||||
// Mixed-color slots are virtual: they never occupy a tray, so they must not appear as
|
||||
// AMS sync targets.
|
||||
auto* is_mixed_opt = preset_bundle->project_config.option<ConfigOptionBools>("filament_is_mixed");
|
||||
|
||||
bool use_double_extruder = get_is_double_extruder();
|
||||
if (use_double_extruder) {
|
||||
const auto &project_config = preset_bundle->project_config;
|
||||
@@ -2810,6 +2821,8 @@ void SyncAmsInfoDialog::generate_override_fix_ams_list()
|
||||
auto colour_rgb = wxColour((int) rgb[0], (int) rgb[1], (int) rgb[2], (int) rgb[3]);
|
||||
if (extruder >= extruders.size() || extruder < 0 || extruder >= m_ams_combo_info.ams_filament_colors.size())
|
||||
continue;
|
||||
if (is_mixed_opt && extruder < (int) is_mixed_opt->values.size() && is_mixed_opt->values[extruder])
|
||||
continue;
|
||||
|
||||
if (contronal_index % SYNC_FLEX_GRID_COL == 0) {
|
||||
wxBoxSizer *ams_tip_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
@@ -2931,6 +2944,20 @@ void SyncAmsInfoDialog::clone_thumbnail_data()
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
|
||||
// Expand color arrays to cover mixed (virtual) slots and compute their blended colors
|
||||
const auto& cfg = wxGetApp().preset_bundle->project_config;
|
||||
size_t total = 0;
|
||||
if (auto* opt = cfg.option<ConfigOptionBools>("filament_is_mixed"))
|
||||
total = opt->values.size();
|
||||
size_t target = std::max(total, m_cur_colors_in_thumbnail.size());
|
||||
if (m_cur_colors_in_thumbnail.size() < target)
|
||||
m_cur_colors_in_thumbnail.resize(target);
|
||||
if (m_preview_colors_in_thumbnail.size() < target)
|
||||
m_preview_colors_in_thumbnail.resize(target);
|
||||
recompute_mixed_slot_colors(m_preview_colors_in_thumbnail, cfg);
|
||||
recompute_mixed_slot_colors(m_cur_colors_in_thumbnail, cfg);
|
||||
|
||||
// copy data
|
||||
auto &data = m_cur_input_thumbnail_data;
|
||||
m_preview_thumbnail_data.reset();
|
||||
@@ -3119,6 +3146,10 @@ void SyncAmsInfoDialog::change_default_normal(int old_filament_id, wxColour temp
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Recompute mixed slot colors after physical slot color change
|
||||
const auto& cfg = wxGetApp().preset_bundle->project_config;
|
||||
recompute_mixed_slot_colors(m_cur_colors_in_thumbnail, cfg);
|
||||
|
||||
ThumbnailData &data = m_cur_input_thumbnail_data;
|
||||
ThumbnailData &no_light_data = m_cur_no_light_thumbnail_data;
|
||||
if (data.width > 0 && data.height > 0 && data.width == no_light_data.width && data.height == no_light_data.height) {
|
||||
|
||||
Reference in New Issue
Block a user