Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Switching between multi-extruder printers using tabs can cause t… #7483

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/slic3r/GUI/Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5096,8 +5096,14 @@ bool Tab::select_preset(std::string preset_name, bool delete_current /*=false*/,

// Orca: update presets for the selected printer
if (m_type == Preset::TYPE_PRINTER && wxGetApp().app_config->get_bool("remember_printer_config")) {
m_preset_bundle->update_selections(*wxGetApp().app_config);
wxGetApp().plater()->sidebar().on_filaments_change(m_preset_bundle->filament_presets.size());
m_preset_bundle->update_selections(*wxGetApp().app_config);
int extruders_count = m_preset_bundle->printers.get_edited_preset().config.opt<ConfigOptionFloats>("nozzle_diameter")->values.size();
if (extruders_count > 1) {
// multi tool
wxGetApp().plater()->sidebar().on_filaments_change(extruders_count);
} else {
wxGetApp().plater()->sidebar().on_filaments_change(m_preset_bundle->filament_presets.size());
}
}
load_current_preset();

Expand Down Expand Up @@ -6079,8 +6085,9 @@ void Page::update_visibility(ConfigOptionMode mode, bool update_contolls_visibil
#ifdef __WXMSW__
if (!m_show) return;
// BBS: fix field control position
wxTheApp->CallAfter([this]() {
for (auto group : m_optgroups) {
auto groups = this->m_optgroups;
wxTheApp->CallAfter([groups]() {
for (auto group : groups) {
if (group->custom_ctrl) group->custom_ctrl->fixup_items_positions();
}
});
Expand Down
12 changes: 7 additions & 5 deletions src/slic3r/GUI/UnsavedChangesDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1664,17 +1664,19 @@ void UnsavedChangesDialog::update_tree(Preset::Type type, PresetCollection* pres

// process changes of extruders count
if (type == Preset::TYPE_PRINTER && old_pt == ptFFF &&
old_config.opt<ConfigOptionStrings>("extruder_colour")->values.size() != new_config.opt<ConfigOptionStrings>("extruder_colour")->values.size()) {
old_config.opt<ConfigOptionFloats>("nozzle_diameter")->values.size() != new_config.opt<ConfigOptionFloats>("nozzle_diameter")->values.size()) {
wxString local_label = _L("Extruders count");
wxString old_val = from_u8((boost::format("%1%") % old_config.opt<ConfigOptionStrings>("extruder_colour")->values.size()).str());
wxString new_val = from_u8((boost::format("%1%") % new_config.opt<ConfigOptionStrings>("extruder_colour")->values.size()).str());
wxString old_val = from_u8((boost::format("%1%") % old_config.opt<ConfigOptionFloats>("nozzle_diameter")->values.size()).str());
wxString new_val = from_u8((boost::format("%1%") % new_config.opt<ConfigOptionFloats>("nozzle_diameter")->values.size()).str());

//BBS: the page "General" changed to "Basic information" instead
//m_tree->Append("extruders_count", type, _L("General"), _L("Capabilities"), local_label, old_val, new_val, category_icon_map.at("Basic information"));
//m_tree->Append("extruders_count", type, _L("General"), _L("Capabilities"), local_label, old_val, new_val, category_icon_map.at("General"));

PresetItem pi = {type, "extruders_count", _L("General"), _L("Capabilities"), local_label, old_val, new_val};
m_presetitems.push_back(pi);
if (old_val != new_val) {
PresetItem pi = {type, "extruders_count", _L("General"), _L("Capabilities"), local_label, old_val, new_val};
m_presetitems.push_back(pi);
}
}

for (const std::string& opt_key : dirty_options) {
Expand Down