From aacbcab468d31d073e6667f2a0e59b5321df6d8e Mon Sep 17 00:00:00 2001 From: SoftFever Date: Sat, 9 Aug 2025 10:17:00 +0800 Subject: [PATCH] Allow default_bed_type to be defined in machine profile update some profiles --- resources/profiles/Elegoo.json | 2 +- .../EC/Elegoo Centauri 0.4 nozzle.json | 1 + .../Elegoo Centauri Carbon 0.4 nozzle.json | 1 + resources/profiles/Snapmaker.json | 2 +- ...Extra Fine @Snapmaker U1 (0.4 nozzle).json | 2 -- ...gh Quality @Snapmaker U1 (0.4 nozzle).json | 2 -- ...gh Quality @Snapmaker U1 (0.4 nozzle).json | 2 -- ...gh Quality @Snapmaker U1 (0.4 nozzle).json | 2 -- ...16 Optimal @Snapmaker U1 (0.4 nozzle).json | 2 -- ... Support W @Snapmaker U1 (0.4 nozzle).json | 2 -- ...20 Quality @Snapmaker U1 (0.4 nozzle).json | 2 -- ...0 Standard @Snapmaker U1 (0.4 nozzle).json | 2 -- ...0 Strength @Snapmaker U1 (0.4 nozzle).json | 2 -- ...20 Support @Snapmaker U1 (0.4 nozzle).json | 2 -- ... Support W @Snapmaker U1 (0.4 nozzle).json | 2 -- ...0.24 Draft @Snapmaker U1 (0.4 nozzle).json | 2 -- ...xtra Draft @Snapmaker U1 (0.4 nozzle).json | 2 -- .../Snapmaker/process/fdm_process_U1.json | 2 +- .../process/fdm_process_U1_common.json | 3 +++ src/libslic3r/Preset.cpp | 15 ++++++++--- src/libslic3r/PrintConfig.cpp | 8 ++++++ src/slic3r/GUI/OptionsGroup.cpp | 26 ------------------- 22 files changed, 27 insertions(+), 59 deletions(-) diff --git a/resources/profiles/Elegoo.json b/resources/profiles/Elegoo.json index a30eff8413..c202b84961 100644 --- a/resources/profiles/Elegoo.json +++ b/resources/profiles/Elegoo.json @@ -1,6 +1,6 @@ { "name": "Elegoo", - "version": "02.03.00.03", + "version": "02.03.00.04", "force_update": "0", "description": "Elegoo configurations", "machine_model_list": [ diff --git a/resources/profiles/Elegoo/machine/EC/Elegoo Centauri 0.4 nozzle.json b/resources/profiles/Elegoo/machine/EC/Elegoo Centauri 0.4 nozzle.json index 850152b519..95755f2c00 100644 --- a/resources/profiles/Elegoo/machine/EC/Elegoo Centauri 0.4 nozzle.json +++ b/resources/profiles/Elegoo/machine/EC/Elegoo Centauri 0.4 nozzle.json @@ -46,6 +46,7 @@ "machine_unload_filament_time": "28", "nozzle_type": "hardened_steel", "scan_first_layer": "1", + "default_bed_type": "4", "upward_compatible_machine": [ ], "gcode_flavor": "klipper", diff --git a/resources/profiles/Elegoo/machine/ECC/Elegoo Centauri Carbon 0.4 nozzle.json b/resources/profiles/Elegoo/machine/ECC/Elegoo Centauri Carbon 0.4 nozzle.json index 70e879e911..3472e7ecf0 100644 --- a/resources/profiles/Elegoo/machine/ECC/Elegoo Centauri Carbon 0.4 nozzle.json +++ b/resources/profiles/Elegoo/machine/ECC/Elegoo Centauri Carbon 0.4 nozzle.json @@ -41,6 +41,7 @@ "extruder_offset": [ "0x0" ], + "default_bed_type": "4", "fan_speedup_time": "0.5", "machine_load_filament_time": "29", "machine_unload_filament_time": "28", diff --git a/resources/profiles/Snapmaker.json b/resources/profiles/Snapmaker.json index 102c5b3f6b..c3700bc23e 100644 --- a/resources/profiles/Snapmaker.json +++ b/resources/profiles/Snapmaker.json @@ -1,6 +1,6 @@ { "name": "Snapmaker", - "version": "02.03.00.05", + "version": "02.03.00.06", "force_update": "0", "description": "Snapmaker configurations", "machine_model_list": [ diff --git a/resources/profiles/Snapmaker/process/0.08 Extra Fine @Snapmaker U1 (0.4 nozzle).json b/resources/profiles/Snapmaker/process/0.08 Extra Fine @Snapmaker U1 (0.4 nozzle).json index e259e354a6..c80e4d2b53 100644 --- a/resources/profiles/Snapmaker/process/0.08 Extra Fine @Snapmaker U1 (0.4 nozzle).json +++ b/resources/profiles/Snapmaker/process/0.08 Extra Fine @Snapmaker U1 (0.4 nozzle).json @@ -12,8 +12,6 @@ "Snapmaker U1 (0.4 nozzle)" ], "ooze_prevention": "1", - "prime_tower_width": "50", - "prime_volume": "38", "slowdown_for_curled_perimeters": "0", "standby_temperature_delta": "-150", "wipe_tower_filament": "1" diff --git a/resources/profiles/Snapmaker/process/0.08 High Quality @Snapmaker U1 (0.4 nozzle).json b/resources/profiles/Snapmaker/process/0.08 High Quality @Snapmaker U1 (0.4 nozzle).json index a2b5bd862b..66c8e5d710 100644 --- a/resources/profiles/Snapmaker/process/0.08 High Quality @Snapmaker U1 (0.4 nozzle).json +++ b/resources/profiles/Snapmaker/process/0.08 High Quality @Snapmaker U1 (0.4 nozzle).json @@ -21,8 +21,6 @@ "Snapmaker U1 (0.4 nozzle)" ], "ooze_prevention": "1", - "prime_tower_width": "50", - "prime_volume": "38", "slowdown_for_curled_perimeters": "0", "standby_temperature_delta": "-150", "wipe_tower_filament": "1" diff --git a/resources/profiles/Snapmaker/process/0.12 High Quality @Snapmaker U1 (0.4 nozzle).json b/resources/profiles/Snapmaker/process/0.12 High Quality @Snapmaker U1 (0.4 nozzle).json index a89e55ff34..f70e8f8292 100644 --- a/resources/profiles/Snapmaker/process/0.12 High Quality @Snapmaker U1 (0.4 nozzle).json +++ b/resources/profiles/Snapmaker/process/0.12 High Quality @Snapmaker U1 (0.4 nozzle).json @@ -20,8 +20,6 @@ "compatible_printers": [ "Snapmaker U1 (0.4 nozzle)" ], - "prime_tower_width": "50", - "prime_volume": "38", "slowdown_for_curled_perimeters": "0", "wipe_tower_filament": "1" } \ No newline at end of file diff --git a/resources/profiles/Snapmaker/process/0.16 High Quality @Snapmaker U1 (0.4 nozzle).json b/resources/profiles/Snapmaker/process/0.16 High Quality @Snapmaker U1 (0.4 nozzle).json index 8f31defad7..7c63442c89 100644 --- a/resources/profiles/Snapmaker/process/0.16 High Quality @Snapmaker U1 (0.4 nozzle).json +++ b/resources/profiles/Snapmaker/process/0.16 High Quality @Snapmaker U1 (0.4 nozzle).json @@ -21,8 +21,6 @@ "Snapmaker U1 (0.4 nozzle)" ], "ooze_prevention": "1", - "prime_tower_width": "50", - "prime_volume": "35", "slowdown_for_curled_perimeters": "0", "standby_temperature_delta": "-150", "wipe_tower_filament": "1" diff --git a/resources/profiles/Snapmaker/process/0.16 Optimal @Snapmaker U1 (0.4 nozzle).json b/resources/profiles/Snapmaker/process/0.16 Optimal @Snapmaker U1 (0.4 nozzle).json index b6ceeabb8c..6c2469e391 100644 --- a/resources/profiles/Snapmaker/process/0.16 Optimal @Snapmaker U1 (0.4 nozzle).json +++ b/resources/profiles/Snapmaker/process/0.16 Optimal @Snapmaker U1 (0.4 nozzle).json @@ -12,8 +12,6 @@ "Snapmaker U1 (0.4 nozzle)" ], "ooze_prevention": "1", - "prime_tower_width": "50", - "prime_volume": "38", "slowdown_for_curled_perimeters": "0", "standby_temperature_delta": "-150", "wipe_tower_filament": "1" diff --git a/resources/profiles/Snapmaker/process/0.20 Bambu Support W @Snapmaker U1 (0.4 nozzle).json b/resources/profiles/Snapmaker/process/0.20 Bambu Support W @Snapmaker U1 (0.4 nozzle).json index 44f5f7940b..b614737777 100644 --- a/resources/profiles/Snapmaker/process/0.20 Bambu Support W @Snapmaker U1 (0.4 nozzle).json +++ b/resources/profiles/Snapmaker/process/0.20 Bambu Support W @Snapmaker U1 (0.4 nozzle).json @@ -18,8 +18,6 @@ "Snapmaker U1 (0.4 nozzle)" ], "ooze_prevention": "1", - "prime_tower_width": "50", - "prime_volume": "38", "slowdown_for_curled_perimeters": "0", "standby_temperature_delta": "-150", "wipe_tower_filament": "1" diff --git a/resources/profiles/Snapmaker/process/0.20 Quality @Snapmaker U1 (0.4 nozzle).json b/resources/profiles/Snapmaker/process/0.20 Quality @Snapmaker U1 (0.4 nozzle).json index e06921ec10..f9bb51f002 100644 --- a/resources/profiles/Snapmaker/process/0.20 Quality @Snapmaker U1 (0.4 nozzle).json +++ b/resources/profiles/Snapmaker/process/0.20 Quality @Snapmaker U1 (0.4 nozzle).json @@ -12,8 +12,6 @@ "Snapmaker U1 (0.4 nozzle)" ], "ooze_prevention": "1", - "prime_tower_width": "40", - "prime_volume": "35", "slowdown_for_curled_perimeters": "0", "standby_temperature_delta": "-150", "wipe_tower_filament": "0", diff --git a/resources/profiles/Snapmaker/process/0.20 Standard @Snapmaker U1 (0.4 nozzle).json b/resources/profiles/Snapmaker/process/0.20 Standard @Snapmaker U1 (0.4 nozzle).json index ba4a1de717..671ef7a134 100644 --- a/resources/profiles/Snapmaker/process/0.20 Standard @Snapmaker U1 (0.4 nozzle).json +++ b/resources/profiles/Snapmaker/process/0.20 Standard @Snapmaker U1 (0.4 nozzle).json @@ -12,8 +12,6 @@ "Snapmaker U1 (0.4 nozzle)" ], "ooze_prevention": "1", - "prime_tower_width": "40", - "prime_volume": "15", "slowdown_for_curled_perimeters": "0", "standby_temperature_delta": "-150", "wipe_tower_filament": "0", diff --git a/resources/profiles/Snapmaker/process/0.20 Strength @Snapmaker U1 (0.4 nozzle).json b/resources/profiles/Snapmaker/process/0.20 Strength @Snapmaker U1 (0.4 nozzle).json index a5e91cae4d..016ca6499f 100644 --- a/resources/profiles/Snapmaker/process/0.20 Strength @Snapmaker U1 (0.4 nozzle).json +++ b/resources/profiles/Snapmaker/process/0.20 Strength @Snapmaker U1 (0.4 nozzle).json @@ -15,8 +15,6 @@ "Snapmaker U1 (0.4 nozzle)" ], "ooze_prevention": "1", - "prime_tower_width": "50", - "prime_volume": "38", "slowdown_for_curled_perimeters": "0", "standby_temperature_delta": "-150", "wipe_tower_filament": "1" diff --git a/resources/profiles/Snapmaker/process/0.20 Support @Snapmaker U1 (0.4 nozzle).json b/resources/profiles/Snapmaker/process/0.20 Support @Snapmaker U1 (0.4 nozzle).json index 2b1c67e05f..702206ad5f 100644 --- a/resources/profiles/Snapmaker/process/0.20 Support @Snapmaker U1 (0.4 nozzle).json +++ b/resources/profiles/Snapmaker/process/0.20 Support @Snapmaker U1 (0.4 nozzle).json @@ -12,8 +12,6 @@ "Snapmaker U1 (0.4 nozzle)" ], "ooze_prevention": "1", - "prime_tower_width": "40", - "prime_volume": "15", "slowdown_for_curled_perimeters": "0", "standby_temperature_delta": "-150", "wipe_tower_filament": "0", diff --git a/resources/profiles/Snapmaker/process/0.20 Support W @Snapmaker U1 (0.4 nozzle).json b/resources/profiles/Snapmaker/process/0.20 Support W @Snapmaker U1 (0.4 nozzle).json index 6f8fab0d27..c99c7be31a 100644 --- a/resources/profiles/Snapmaker/process/0.20 Support W @Snapmaker U1 (0.4 nozzle).json +++ b/resources/profiles/Snapmaker/process/0.20 Support W @Snapmaker U1 (0.4 nozzle).json @@ -18,8 +18,6 @@ "Snapmaker U1 (0.4 nozzle)" ], "ooze_prevention": "1", - "prime_tower_width": "50", - "prime_volume": "38", "slowdown_for_curled_perimeters": "0", "standby_temperature_delta": "-150", "wipe_tower_filament": "1" diff --git a/resources/profiles/Snapmaker/process/0.24 Draft @Snapmaker U1 (0.4 nozzle).json b/resources/profiles/Snapmaker/process/0.24 Draft @Snapmaker U1 (0.4 nozzle).json index 989367d0a8..d92b5f68af 100644 --- a/resources/profiles/Snapmaker/process/0.24 Draft @Snapmaker U1 (0.4 nozzle).json +++ b/resources/profiles/Snapmaker/process/0.24 Draft @Snapmaker U1 (0.4 nozzle).json @@ -12,8 +12,6 @@ "Snapmaker U1 (0.4 nozzle)" ], "ooze_prevention": "1", - "prime_tower_width": "50", - "prime_volume": "38", "slowdown_for_curled_perimeters": "0", "standby_temperature_delta": "-150", "wipe_tower_filament": "1" diff --git a/resources/profiles/Snapmaker/process/0.28 Extra Draft @Snapmaker U1 (0.4 nozzle).json b/resources/profiles/Snapmaker/process/0.28 Extra Draft @Snapmaker U1 (0.4 nozzle).json index 23028ae712..37ff7fe81d 100644 --- a/resources/profiles/Snapmaker/process/0.28 Extra Draft @Snapmaker U1 (0.4 nozzle).json +++ b/resources/profiles/Snapmaker/process/0.28 Extra Draft @Snapmaker U1 (0.4 nozzle).json @@ -11,8 +11,6 @@ "compatible_printers": [ "Snapmaker U1 (0.4 nozzle)" ], - "prime_tower_width": "50", - "prime_volume": "38", "slowdown_for_curled_perimeters": "0", "wipe_tower_filament": "1" } \ No newline at end of file diff --git a/resources/profiles/Snapmaker/process/fdm_process_U1.json b/resources/profiles/Snapmaker/process/fdm_process_U1.json index 6c9935cce7..4f4fba0148 100644 --- a/resources/profiles/Snapmaker/process/fdm_process_U1.json +++ b/resources/profiles/Snapmaker/process/fdm_process_U1.json @@ -17,7 +17,7 @@ "line_width": "0.45", "infill_direction": "45", "sparse_infill_density": "15%", - "sparse_infill_pattern": "grid", + "sparse_infill_pattern": "crosshatch", "initial_layer_line_width": "0.42", "initial_layer_print_height": "0.2", "initial_layer_speed": "20", diff --git a/resources/profiles/Snapmaker/process/fdm_process_U1_common.json b/resources/profiles/Snapmaker/process/fdm_process_U1_common.json index 4f9c8a3407..a853007bb8 100644 --- a/resources/profiles/Snapmaker/process/fdm_process_U1_common.json +++ b/resources/profiles/Snapmaker/process/fdm_process_U1_common.json @@ -67,7 +67,10 @@ "travel_speed": "500", "enable_prime_tower": "1", "wipe_tower_no_sparse_layers": "0", + "wipe_tower_cone_angle": "15", + "wipe_tower_wall_type":"cone", "prime_tower_width": "35", + "prime_volume": "15", "wall_generator": "classic", "compatible_printers": [] } \ No newline at end of file diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index bc95d25012..49f5ed10b2 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -754,8 +754,17 @@ BedType Preset::get_default_bed_type(PresetBundle* preset_bundle) if (config.has("default_bed_type") && !config.opt_string("default_bed_type").empty()) { try { std::string str_bed_type = config.opt_string("default_bed_type"); + + // Try parsing as integer first (legacy format) int bed_type_value = atoi(str_bed_type.c_str()); - return BedType(bed_type_value); + if (bed_type_value > 0) { + return BedType(bed_type_value); + } + else { + BOOST_LOG_TRIVIAL(error) << "default_bed_type: invalid bed type: " << str_bed_type; + } + return BedType::btPEI; + } catch(...) { ; } @@ -766,8 +775,6 @@ BedType Preset::get_default_bed_type(PresetBundle* preset_bundle) return BedType::btPC; } else if (model_id == "C11") { return BedType::btPEI; - }else if (model_id == "Elegoo-CC" || model_id == "Elegoo-C") {//set default bed type to PTE for Elegoo-CC - return BedType::btPTE; } return BedType::btPEI; } @@ -906,7 +913,7 @@ static std::vector s_Preset_printer_options { "cooling_tube_retraction", "cooling_tube_length", "high_current_on_filament_swap", "parking_pos_retraction", "extra_loading_move", "purge_in_prime_tower", "enable_filament_ramming", "z_offset", - "disable_m73", "preferred_orientation", "emit_machine_limits_to_gcode", "pellet_modded_printer", "support_multi_bed_types","bed_mesh_min","bed_mesh_max","bed_mesh_probe_distance", "adaptive_bed_mesh_margin", "enable_long_retraction_when_cut","long_retractions_when_cut","retraction_distances_when_cut" + "disable_m73", "preferred_orientation", "emit_machine_limits_to_gcode", "pellet_modded_printer", "support_multi_bed_types", "default_bed_type", "bed_mesh_min","bed_mesh_max","bed_mesh_probe_distance", "adaptive_bed_mesh_margin", "enable_long_retraction_when_cut","long_retractions_when_cut","retraction_distances_when_cut" }; static std::vector s_Preset_sla_print_options { diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 0a980f7bdc..cad71031b0 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -839,6 +839,14 @@ void PrintConfigDef::init_fff_params() def->enum_labels.emplace_back(L("Cool Plate (SuperTack)")); def->set_default_value(new ConfigOptionEnum(btPC)); + // Orca: allow profile maker to set default bed type in machine profile + // This option won't be shown in the UI + def = this->add("default_bed_type", coString); + def->label = L("Default bed type"); + def->tooltip = L("Default bed type for the printer (supports both numeric and string format)."); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionString()); + // BBS def = this->add("first_layer_print_sequence", coInts); def->label = L("First layer print sequence"); diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 4322fc04e3..ba6ff14f37 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -727,27 +727,6 @@ void ConfigOptionsGroup::on_kill_focus(const std::string& opt_key) void ConfigOptionsGroup::reload_config() { -#if 0 - // BBS - auto bed_type_field = this->get_field("bed_type"); - int default_bed_type = BedType::btPC; - if (bed_type_field != nullptr) { - auto iter = m_opt_map.find("bed_temperature"); - const ConfigOptionDef& option = m_options.at("bed_temperature").opt; - if (iter != m_opt_map.end()) { - for (int bed_type = BedType::btPC; bed_type < BedType::btCount; bed_type++) { - int bed_temp = boost::any_cast(config_value("bed_temperature", bed_type, option.gui_flags == "serialized")); - if (bed_temp != 0) { - default_bed_type = bed_type; - break; - } - } - } - - bed_type_field->set_value(default_bed_type, false); - } -#endif - for (auto &kvp : m_opt_map) { // Name of the option field (name of the configuration key, possibly suffixed with '#' and the index of a scalar inside a vector. const std::string &opt_id = kvp.first; @@ -756,11 +735,6 @@ void ConfigOptionsGroup::reload_config() // index in the vector option, zero for scalars int opt_index = kvp.second.second; const ConfigOptionDef &option = m_options.at(opt_id).opt; -#if 0 - // BBS - if ((opt_id == "bed_temperature" || opt_id == "bed_temperature_initial_layer") && bed_type_field != nullptr) - opt_index = default_bed_type; -#endif this->set_value(opt_id, config_value(opt_key, opt_index, option.gui_flags == "serialized")); } }