Merge branch 'main' into feature/h2c_support_clean

This commit is contained in:
SoftFever
2026-07-09 22:17:20 +08:00
committed by GitHub
24 changed files with 612 additions and 72 deletions

View File

@@ -713,6 +713,36 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in
toggle_field("top_layer_direction", has_top_shell);
toggle_field("bottom_layer_direction", has_bottom_shell);
toggle_line("top_surface_expansion", has_top_shell);
toggle_line("top_surface_expansion_margin", has_top_shell);
bool has_top_surface_expansion = config->opt_float("top_surface_expansion") > 0;
toggle_field("top_surface_expansion_margin", has_top_surface_expansion);
toggle_line("top_surface_expansion_direction", has_top_shell);
toggle_field("top_surface_expansion_direction", has_top_surface_expansion);
// Orca: Archimedean Chords and Octagram Spiral are the centered surface patterns that the
// pattern-centering, anisotropic-surface and separated-infill features act on.
auto is_centered_pattern = [](InfillPattern p) {
return p == InfillPattern::ipArchimedeanChords || p == InfillPattern::ipOctagramSpiral;
};
bool is_top_centered = is_centered_pattern(config->option<ConfigOptionEnum<InfillPattern>>("top_surface_pattern")->value);
bool is_bottom_centered = is_centered_pattern(config->option<ConfigOptionEnum<InfillPattern>>("bottom_surface_pattern")->value);
bool has_centered_surface = (has_top_shell && is_top_centered) || (has_bottom_shell && is_bottom_centered);
// Orca: center of surface pattern / anisotropic surfaces
toggle_line("center_of_surface_pattern", has_centered_surface);
toggle_line("anisotropic_surfaces", has_centered_surface);
// Orca: separate infills
bool is_internal_infill_centered = is_centered_pattern(config->option<ConfigOptionEnum<InfillPattern>>("sparse_infill_pattern")->value) ||
config->opt_string("sparse_infill_rotate_template") != "" ||
config->opt_string("solid_infill_rotate_template") != "";
toggle_line("separated_infills", is_internal_infill_centered);
// Orca: no need gaps
for (auto el : {"gap_fill_target", "filter_out_gap_fill"})
toggle_field(el, !config->opt_bool("anisotropic_surfaces"));
for (auto el : { "infill_direction", "sparse_infill_line_width", "gap_fill_target","filter_out_gap_fill","infill_wall_overlap",
"bridge_angle", "internal_bridge_angle", "relative_bridge_angle",
"solid_infill_direction", "solid_infill_rotate_template", "internal_solid_infill_pattern", "internal_solid_filament_id", "top_surface_filament_id", "bottom_surface_filament_id",

View File

@@ -6965,6 +6965,10 @@ void GUI_App::start_sync_user_preset(bool with_progress_dlg)
// finishFn tears down the progress dialog (and clears the re-entrancy guard), so it
// must run on every exit path — otherwise an early bail-out would leak the modal
// dialog and leave the guard stuck, blocking all later manual syncs.
// Guard the whole thread body: an uncaught exception here (e.g. a transient
// boost::filesystem error while scanning the preset folder) would otherwise
// propagate out of the thread and terminate the entire application.
try {
if (!m_agent) { finishFn(false); return; }
// One-time scan for orphaned .info files left over from offline deletions; queues HTTP DELETEs.
@@ -7206,6 +7210,11 @@ void GUI_App::start_sync_user_preset(bool with_progress_dlg)
boost::this_thread::sleep_for(boost::chrono::milliseconds(500));
}
}
} catch (const std::exception& e) {
BOOST_LOG_TRIVIAL(error) << "user preset sync thread terminated by exception: " << e.what();
} catch (...) {
BOOST_LOG_TRIVIAL(error) << "user preset sync thread terminated by unknown exception";
}
});
}
@@ -8526,8 +8535,13 @@ void GUI_App::scan_orphaned_info_files()
if (!fs::exists(type_dir))
continue;
// Iterate through all .info files
for (auto& entry : boost::filesystem::directory_iterator(type_dir)) {
// Iterate through all .info files. Use the error_code-based iterator so a transient
// directory-read failure (e.g. macOS readdir returning ENOTSUP) is logged and skipped
// instead of throwing an uncaught exception that would terminate the app from the
// background sync thread this runs on.
boost::system::error_code ec;
for (boost::filesystem::directory_iterator it(type_dir, ec), end; !ec && it != end; it.increment(ec)) {
const auto& entry = *it;
if (entry.path().extension() != ".info")
continue;
@@ -8546,6 +8560,8 @@ void GUI_App::scan_orphaned_info_files()
}
}
}
if (ec)
BOOST_LOG_TRIVIAL(warning) << "scan_orphaned_info_files: failed to scan " << type_dir.string() << ": " << ec.message();
}
}

View File

@@ -132,6 +132,9 @@ std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::PART_CATE
{"infill_anchor", "", 1},
{"infill_anchor_max", "", 1},
{"top_surface_pattern", "", 1},
{"top_surface_expansion", "", 1},
{"top_surface_expansion_margin", "", 1},
{"top_surface_expansion_direction", "", 1},
{"bottom_surface_pattern", "", 1},
{"internal_solid_infill_pattern", "", 1},
{"align_infill_direction_to_model", "", 1},
@@ -187,7 +190,7 @@ std::vector<SimpleSettingData> SettingsFactory::get_visible_options(const std::s
//Quality
"wall_infill_order", "ironing_type", "inner_wall_line_width", "outer_wall_line_width", "top_surface_line_width",
//Shell
"wall_loops", "top_shell_layers", "bottom_shell_layers", "top_shell_thickness", "bottom_shell_thickness",
"wall_loops", "top_shell_layers", "bottom_shell_layers", "top_shell_thickness", "bottom_shell_thickness", "top_surface_expansion", "top_surface_expansion_margin", "top_surface_expansion_direction",
//Infill
"sparse_infill_density", "sparse_infill_pattern", "top_surface_pattern", "bottom_surface_pattern", "infill_combination", "infill_direction", "infill_wall_overlap",
//speed

View File

@@ -13699,6 +13699,9 @@ void adjust_settings_for_flowrate_calib(ModelObjectPtrs& objects, bool linear, i
_obj->config.set_key_value("top_solid_infill_flow_ratio", new ConfigOptionFloat(1.0f));
_obj->config.set_key_value("infill_direction", new ConfigOptionFloat(45));
_obj->config.set_key_value("solid_infill_direction", new ConfigOptionFloat(135));
_obj->config.set_key_value("anisotropic_surfaces", new ConfigOptionBool(false));
_obj->config.set_key_value("center_of_surface_pattern", new ConfigOptionEnum<CenterOfSurfacePattern>(CenterOfSurfacePattern::Each_Surface));
_obj->config.set_key_value("separated_infills", new ConfigOptionBool(false));
_obj->config.set_key_value("align_infill_direction_to_model", new ConfigOptionBool(true));
_obj->config.set_key_value("ironing_type", new ConfigOptionEnum<IroningType>(IroningType::NoIroning));
_obj->config.set_key_value("internal_solid_infill_speed", new ConfigOptionFloatsNullable(internal_solid_speeds));

View File

@@ -2764,11 +2764,16 @@ void TabPrint::build()
optgroup->append_single_option_line("top_surface_density", "strength_settings_top_bottom_shells#surface-density");
optgroup->append_single_option_line("top_surface_pattern", "strength_settings_top_bottom_shells#surface-pattern");
optgroup->append_single_option_line("top_layer_direction", "strength_settings_infill#top-direction");
optgroup->append_single_option_line("top_surface_expansion", "strength_settings_top_bottom_shells#surface-expansion");
optgroup->append_single_option_line("top_surface_expansion_margin", "strength_settings_top_bottom_shells#surface-expansion-margin");
optgroup->append_single_option_line("top_surface_expansion_direction", "strength_settings_top_bottom_shells#surface-expansion-direction");
optgroup->append_single_option_line("bottom_shell_layers", "strength_settings_top_bottom_shells#shell-layers");
optgroup->append_single_option_line("bottom_shell_thickness", "strength_settings_top_bottom_shells#shell-thickness");
optgroup->append_single_option_line("bottom_surface_density", "strength_settings_top_bottom_shells#surface-density");
optgroup->append_single_option_line("bottom_surface_pattern", "strength_settings_top_bottom_shells#surface-pattern");
optgroup->append_single_option_line("bottom_layer_direction", "strength_settings_infill#direction");
optgroup->append_single_option_line("center_of_surface_pattern", "strength_settings_top_bottom_shells#center-surface-pattern-on");
optgroup->append_single_option_line("anisotropic_surfaces", "strength_settings_top_bottom_shells#anisotropic-surfaces");
optgroup->append_single_option_line("top_bottom_infill_wall_overlap", "strength_settings_top_bottom_shells#infillwall-overlap");
optgroup = page->new_optgroup(L("Infill"), L"param_infill");
@@ -2799,6 +2804,7 @@ void TabPrint::build()
optgroup->append_single_option_line("solid_infill_rotate_template", "strength_settings_infill_rotation_template_metalanguage");
optgroup->append_single_option_line("gap_fill_target", "strength_settings_infill#apply-gap-fill");
optgroup->append_single_option_line("filter_out_gap_fill", "strength_settings_infill#filter-out-tiny-gaps");
optgroup->append_single_option_line("separated_infills", "strength_settings_infill#separated-infills");
optgroup->append_single_option_line("infill_wall_overlap", "strength_settings_infill#infill-wall-overlap");
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
@@ -2997,6 +3003,7 @@ void TabPrint::build()
optgroup->append_single_option_line("flush_into_support", "multimaterial_settings_flush_options#flush-into-objects-support");
optgroup = page->new_optgroup(L("Advanced"), L"advanced");
optgroup->append_single_option_line("interlocking_beam", "multimaterial_settings_advanced#interlocking-beam");
optgroup->append_single_option_line("toolchange_ordering", "multimaterial_settings_advanced#toolchange-ordering");
optgroup->append_single_option_line("interface_shells", "multimaterial_settings_advanced#interface-shells");
optgroup->append_single_option_line("mmu_segmented_region_max_width", "multimaterial_settings_advanced#maximum-width-of-segmented-region");
optgroup->append_single_option_line("mmu_segmented_region_interlocking_depth", "multimaterial_settings_advanced#interlocking-depth-of-segmented-region");