mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-18 14:32:36 +00:00
Merge main + clean up code + fix missing include
This commit is contained in:
+22
-2
@@ -4,6 +4,7 @@
|
||||
#include "PresetHints.hpp"
|
||||
#include "libslic3r/PresetBundle.hpp"
|
||||
#include "libslic3r/PrintConfig.hpp"
|
||||
#include "libslic3r/FilamentMixer.hpp"
|
||||
#include "libslic3r/Utils.hpp"
|
||||
#include "libslic3r/Model.hpp"
|
||||
#include "libslic3r/GCode/GCodeProcessor.hpp"
|
||||
@@ -2181,8 +2182,11 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
|
||||
std::string new_color = new_col.GetAsString(wxC2S_HTML_SYNTAX).ToStdString();
|
||||
new_colors.push_back(new_color);
|
||||
}
|
||||
wxGetApp().preset_bundle->set_num_filaments(num_extruder, new_colors);
|
||||
wxGetApp().plater()->on_filament_count_change(num_extruder);
|
||||
// Mixed-color slots are virtual filaments at the tail of the list with no nozzle of their
|
||||
// own, so they are carried on top of the new extruder count instead of being truncated.
|
||||
const size_t total_filaments = num_extruder + wxGetApp().preset_bundle->num_mixed_filaments();
|
||||
wxGetApp().preset_bundle->set_num_filaments(total_filaments, new_colors);
|
||||
wxGetApp().plater()->on_filament_count_change(total_filaments);
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update();
|
||||
wxGetApp().preset_bundle->export_selections(*wxGetApp().app_config);
|
||||
}
|
||||
@@ -2629,6 +2633,7 @@ void TabPrint::build()
|
||||
auto optgroup = page->new_optgroup(L("Layer height"), L"param_layer_height");
|
||||
optgroup->append_single_option_line("layer_height","quality_settings_layer_height");
|
||||
optgroup->append_single_option_line("initial_layer_print_height","quality_settings_layer_height");
|
||||
optgroup->append_single_option_line("enable_mixed_color_sublayer");
|
||||
|
||||
optgroup = page->new_optgroup(L("Line width"), L"param_line_width");
|
||||
optgroup->append_single_option_line("line_width","quality_settings_line_width");
|
||||
@@ -3497,6 +3502,21 @@ void TabPrintModel::activate_selected_page(std::function<void()> throw_if_cancel
|
||||
f->set_value(boost::any(), false);
|
||||
}
|
||||
}
|
||||
if (m_type == Preset::TYPE_PLATE)
|
||||
static_cast<TabPrintPlate *>(this)->update_mixed_filament_seq_state();
|
||||
}
|
||||
|
||||
// A mixed-color slot resolves to a different physical filament per layer, so a
|
||||
// user-defined filament print order cannot be honoured while one exists.
|
||||
void TabPrintPlate::update_mixed_filament_seq_state()
|
||||
{
|
||||
if (!m_active_page) return;
|
||||
auto &proj_cfg = m_preset_bundle->project_config;
|
||||
auto *opt = proj_cfg.option<ConfigOptionBools>("filament_is_mixed");
|
||||
bool has_mixed = opt && has_any_mixed_filament(opt->values);
|
||||
|
||||
toggle_option("first_layer_sequence_choice", !has_mixed);
|
||||
toggle_option("other_layers_sequence_choice", !has_mixed);
|
||||
}
|
||||
|
||||
void TabPrintModel::on_value_change(const std::string& opt_id, const boost::any& value)
|
||||
|
||||
Reference in New Issue
Block a user