mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
Fix extruder number issue when SEMM is not enabled (#8027)
* Revert ac80575b28
* Fix issue that extruder number is not initialized properly when SEMM is not enabled
This commit is contained in:
parent
fab7eaab49
commit
61331ce113
2 changed files with 19 additions and 10 deletions
|
@ -318,17 +318,27 @@ std::string Preset::remove_suffix_modified(const std::string &name)
|
||||||
// Update new extruder fields at the printer profile.
|
// Update new extruder fields at the printer profile.
|
||||||
void Preset::normalize(DynamicPrintConfig &config)
|
void Preset::normalize(DynamicPrintConfig &config)
|
||||||
{
|
{
|
||||||
|
size_t n = 1;
|
||||||
|
if (config.option("single_extruder_multi_material") == nullptr || config.opt_bool("single_extruder_multi_material")) {
|
||||||
// BBS
|
// BBS
|
||||||
auto* filament_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("filament_diameter"));
|
auto* filament_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("filament_diameter"));
|
||||||
if (filament_diameter != nullptr)
|
if (filament_diameter != nullptr) {
|
||||||
|
n = filament_diameter->values.size();
|
||||||
// Loaded the FFF Printer settings. Verify, that all extruder dependent values have enough values.
|
// Loaded the FFF Printer settings. Verify, that all extruder dependent values have enough values.
|
||||||
config.set_num_filaments((unsigned int)filament_diameter->values.size());
|
config.set_num_filaments((unsigned int) n);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
auto* nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("nozzle_diameter"));
|
||||||
|
if (nozzle_diameter != nullptr) {
|
||||||
|
n = nozzle_diameter->values.size();
|
||||||
|
// Loaded the FFF Printer settings. Verify, that all extruder dependent values have enough values.
|
||||||
|
config.set_num_extruders((unsigned int) n);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (config.option("filament_diameter") != nullptr) {
|
if (config.option("filament_diameter") != nullptr) {
|
||||||
// This config contains single or multiple filament presets.
|
// This config contains single or multiple filament presets.
|
||||||
// Ensure that the filament preset vector options contain the correct number of values.
|
// Ensure that the filament preset vector options contain the correct number of values.
|
||||||
// BBS
|
|
||||||
size_t n = (filament_diameter == nullptr) ? 1 : filament_diameter->values.size();
|
|
||||||
const auto &defaults = FullPrintConfig::defaults();
|
const auto &defaults = FullPrintConfig::defaults();
|
||||||
for (const std::string &key : Preset::filament_options()) {
|
for (const std::string &key : Preset::filament_options()) {
|
||||||
if (key == "compatible_prints" || key == "compatible_printers")
|
if (key == "compatible_prints" || key == "compatible_printers")
|
||||||
|
|
|
@ -5118,12 +5118,11 @@ bool Tab::select_preset(std::string preset_name, bool delete_current /*=false*/,
|
||||||
apply_config_from_cache();
|
apply_config_from_cache();
|
||||||
|
|
||||||
// Orca: update presets for the selected printer
|
// Orca: update presets for the selected printer
|
||||||
load_current_preset();
|
|
||||||
|
|
||||||
if (m_type == Preset::TYPE_PRINTER && wxGetApp().app_config->get_bool("remember_printer_config")) {
|
if (m_type == Preset::TYPE_PRINTER && wxGetApp().app_config->get_bool("remember_printer_config")) {
|
||||||
m_preset_bundle->update_selections(*wxGetApp().app_config);
|
m_preset_bundle->update_selections(*wxGetApp().app_config);
|
||||||
wxGetApp().plater()->sidebar().on_filaments_change(m_preset_bundle->filament_presets.size());
|
wxGetApp().plater()->sidebar().on_filaments_change(m_preset_bundle->filament_presets.size());
|
||||||
}
|
}
|
||||||
|
load_current_preset();
|
||||||
|
|
||||||
|
|
||||||
if (delete_third_printer) {
|
if (delete_third_printer) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue