FIX: extruder sync visible & nozzle_volume_type

Change-Id: Id25c325fee6facbd15dbc99688ef3e9fb34efaf0
Jira: none
(cherry picked from commit a80e60bd2b02846a3f590add44ba7b91131adbfa)
This commit is contained in:
chunmao.guo 2024-08-07 10:42:30 +08:00 committed by Noisyfox
parent 7771548e8c
commit 05b7e28284

View file

@ -1660,7 +1660,7 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
}
if (opt_key == "print_sequence" && m_config->opt_enum<PrintSequence>("print_sequence") == PrintSequence::ByObject) {
auto printer_structure_opt = wxGetApp().preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<PrinterStructure>>("printer_structure");
auto printer_structure_opt = m_preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnum<PrinterStructure>>("printer_structure");
if (printer_structure_opt && printer_structure_opt->value == PrinterStructure::psI3) {
wxString msg_text = _(L("The current printer does not support timelapse in Traditional Mode when printing By-Object."));
msg_text += "\n\n" + _(L("Still print by object?"));
@ -1792,8 +1792,8 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
}
if(opt_key=="layer_height"){
auto min_layer_height_from_nozzle=wxGetApp().preset_bundle->full_config().option<ConfigOptionFloats>("min_layer_height")->values;
auto max_layer_height_from_nozzle=wxGetApp().preset_bundle->full_config().option<ConfigOptionFloats>("max_layer_height")->values;
auto min_layer_height_from_nozzle=m_preset_bundle->full_config().option<ConfigOptionFloats>("min_layer_height")->values;
auto max_layer_height_from_nozzle=m_preset_bundle->full_config().option<ConfigOptionFloats>("max_layer_height")->values;
auto layer_height_floor = *std::min_element(min_layer_height_from_nozzle.begin(), min_layer_height_from_nozzle.end());
auto layer_height_ceil = *std::max_element(max_layer_height_from_nozzle.begin(), max_layer_height_from_nozzle.end());
const auto lh = m_config->opt_float("layer_height");
@ -2084,10 +2084,10 @@ void Tab::on_presets_changed()
// Instead of PostEvent (EVT_TAB_PRESETS_CHANGED) just call update_presets
wxGetApp().plater()->sidebar().update_presets(m_type);
bool is_bbl_vendor_preset = wxGetApp().preset_bundle->is_bbl_vendor();
bool is_bbl_vendor_preset = m_preset_bundle->is_bbl_vendor();
if (is_bbl_vendor_preset) {
wxGetApp().plater()->get_partplate_list().set_render_option(true, true);
if (wxGetApp().preset_bundle->printers.get_edited_preset().has_cali_lines(wxGetApp().preset_bundle)) {
if (m_preset_bundle->printers.get_edited_preset().has_cali_lines(wxGetApp().preset_bundle)) {
wxGetApp().plater()->get_partplate_list().set_render_cali(true);
} else {
wxGetApp().plater()->get_partplate_list().set_render_cali(false);
@ -2978,7 +2978,7 @@ void TabPrintModel::update_model_config()
PrintSequence plate_print_seq = (PrintSequence)0;
if (!plate_config.has("curr_bed_type")) {
// same as global
DynamicConfig& global_cfg = wxGetApp().preset_bundle->project_config;
DynamicConfig& global_cfg = m_preset_bundle->project_config;
if (global_cfg.has("curr_bed_type")) {
BedType global_bed_type = global_cfg.opt_enum<BedType>("curr_bed_type");
m_config->set_key_value("curr_bed_type", new ConfigOptionEnum<BedType>(global_bed_type));
@ -3378,7 +3378,7 @@ void TabPrintPlate::update_custom_dirty(std::vector<std::string> &dirty_options,
}
}
if (k == "curr_bed_type") {
DynamicConfig& global_cfg = wxGetApp().preset_bundle->project_config;
DynamicConfig& global_cfg = m_preset_bundle->project_config;
if (global_cfg.has("curr_bed_type")) {
BedType global_bed_type = global_cfg.opt_enum<BedType>("curr_bed_type");
if (m_config->opt_enum<BedType>("curr_bed_type") != global_bed_type) {
@ -3706,7 +3706,7 @@ void TabFilament::build()
optgroup->append_line(line);
optgroup->m_on_change = [this, optgroup](t_config_option_key opt_key, boost::any value) {
DynamicPrintConfig &filament_config = wxGetApp().preset_bundle->filaments.get_edited_preset().config;
DynamicPrintConfig &filament_config = m_preset_bundle->filaments.get_edited_preset().config;
update_dirty();
if (!m_postpone_update_ui && (opt_key == "nozzle_temperature_range_low" || opt_key == "nozzle_temperature_range_high")) {
@ -3783,7 +3783,7 @@ void TabFilament::build()
optgroup->m_on_change = [this](t_config_option_key opt_key, boost::any value)
{
DynamicPrintConfig& filament_config = wxGetApp().preset_bundle->filaments.get_edited_preset().config;
DynamicPrintConfig& filament_config = m_preset_bundle->filaments.get_edited_preset().config;
update_dirty();
/*if (opt_key == "cool_plate_temp" || opt_key == "cool_plate_temp_initial_layer") {
@ -5022,7 +5022,7 @@ void TabPrinter::toggle_options()
if (!m_active_page || m_presets->get_edited_preset().printer_technology() == ptSLA)
return;
auto nozzle_volumes = m_config->option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
auto extruders = m_config->option<ConfigOptionEnumsGeneric>("extruder_type");
auto get_index_for_extruder =
[this, &extruders, &nozzle_volumes](int extruder_id, int stride = 1) {
@ -6775,8 +6775,8 @@ void Tab::update_extruder_variants(int extruder_id)
void Tab::switch_excluder(int extruder_id)
{
Preset & printer_preset = wxGetApp().preset_bundle->printers.get_edited_preset();
auto nozzle_volumes = wxGetApp().preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
Preset & printer_preset = m_preset_bundle->printers.get_edited_preset();
auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
auto extruders = printer_preset.config.option<ConfigOptionEnumsGeneric>("extruder_type");
std::pair<std::string, std::string> variant_keys[]{
{}, {"print_extruder_id", "print_extruder_variant"}, // Preset::TYPE_PRINT
@ -7203,7 +7203,7 @@ void TabSLAMaterial::reload_config()
void TabSLAMaterial::toggle_options()
{
const Preset &current_printer = wxGetApp().preset_bundle->printers.get_edited_preset();
const Preset &current_printer = m_preset_bundle->printers.get_edited_preset();
std::string model = current_printer.config.opt_string("printer_model");
m_config_manipulation.toggle_field("material_print_speed", model != "SL1");
}