Merge branch 'main' into dev/ams-heat

This commit is contained in:
SoftFever
2026-07-15 19:45:27 +08:00
committed by GitHub
95 changed files with 18718 additions and 6505 deletions

View File

@@ -721,7 +721,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in
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.
// pattern-centering feature acts on.
auto is_centered_pattern = [](InfillPattern p) {
return p == InfillPattern::ipArchimedeanChords || p == InfillPattern::ipOctagramSpiral;
};
@@ -729,9 +729,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in
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
// Orca: center of surface pattern
toggle_line("center_of_surface_pattern", has_centered_surface);
toggle_line("anisotropic_surfaces", has_centered_surface);
// Orca: separate infills
bool is_internal_infill_separable = is_separable_infill_pattern(config->option<ConfigOptionEnum<InfillPattern>>("sparse_infill_pattern")->value) ||
@@ -739,9 +738,10 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in
config->opt_string("solid_infill_rotate_template") != "";
toggle_line("separated_infills", is_internal_infill_separable);
// Orca: no need gaps
for (auto el : {"gap_fill_target", "filter_out_gap_fill"})
toggle_field(el, !config->opt_bool("anisotropic_surfaces"));
// Fill order is only meaningful for the center-based surface fill patterns; hide it otherwise.
auto is_centered_fill = [](InfillPattern p) { return p == ipConcentric || p == ipArchimedeanChords || p == ipOctagramSpiral; };
toggle_line("top_surface_fill_order", has_top_shell && is_centered_fill(config->opt_enum<InfillPattern>("top_surface_pattern")));
toggle_line("bottom_surface_fill_order", has_bottom_shell && is_centered_fill(config->opt_enum<InfillPattern>("bottom_surface_pattern")));
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",

View File

@@ -353,6 +353,7 @@ bool Mouse3DController::State::apply(const Mouse3DController::Params &params, Ca
rot = Vec3d(rot.x(), -rot.z(), rot.y());
rot = Vec3d(rot.x() * pitchmult, rot.y() * yawmult, rot.z() * rollmult);
camera.rotate_local_around_target(Vec3d(rot.x(), - rot.z(), rot.y()));
camera.auto_type(Camera::EType::Perspective);
} else {
assert(input_queue_item.is_buttons());
switch (input_queue_item.type_or_buttons) {

View File

@@ -13904,7 +13904,6 @@ 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));
@@ -13914,7 +13913,8 @@ void adjust_settings_for_flowrate_calib(ModelObjectPtrs& objects, bool linear, i
_obj->config.set_key_value("seam_slope_type", new ConfigOptionEnum<SeamScarfType>(SeamScarfType::None));
_obj->config.set_key_value("gap_fill_target", new ConfigOptionEnum<GapFillTarget>(GapFillTarget::gftNowhere));
print_config->set_key_value("max_volumetric_extrusion_rate_slope", new ConfigOptionFloat(0));
_obj->config.set_key_value("calib_flowrate_topinfill_special_order", new ConfigOptionBool(true));
// ORCA: print the top surface spiral from the center outwards, so the tiles are comparable.
_obj->config.set_key_value("top_surface_fill_order", new ConfigOptionEnum<SurfaceFillOrder>(SurfaceFillOrder::Outward));
// extract flowrate from name, filename format: flowrate_xxx
std::string obj_name = _obj->name;

View File

@@ -1772,6 +1772,10 @@ static wxString pad_combo_value_for_config(const DynamicPrintConfig &config)
void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
{
// Orca:
// TODO: Move filament-specific checks to TabFilament::on_value_change()
// TODO: Move printer-specific checks to TabPrinter::on_value_change()
if (wxGetApp().plater() == nullptr) {
return;
}
@@ -2762,6 +2766,7 @@ void TabPrint::build()
optgroup->append_single_option_line("top_shell_thickness", "strength_settings_top_bottom_shells#shell-thickness");
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_surface_fill_order", "strength_settings_top_bottom_shells#fill-order");
optgroup->append_single_option_line("top_layer_direction", "strength_settings_infill#top-bottom-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");
@@ -2770,9 +2775,9 @@ void TabPrint::build()
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_surface_fill_order", "strength_settings_top_bottom_shells#fill-order");
optgroup->append_single_option_line("bottom_layer_direction", "strength_settings_infill#top-bottom-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");
@@ -3986,9 +3991,12 @@ void TabFilament::add_filament_overrides_page()
"filament_retraction_minimum_travel",
"filament_retract_when_changing_layer",
"filament_wipe",
//BBS
// BBS
"filament_wipe_distance",
"filament_retract_before_wipe",
// Orca
"filament_retract_after_wipe",
// BBS
"filament_long_retractions_when_cut",
"filament_retraction_distances_when_cut"
//SoftFever
@@ -4112,9 +4120,12 @@ void TabFilament::update_filament_overrides_page(const DynamicPrintConfig* print
"filament_retraction_minimum_travel",
"filament_retract_when_changing_layer",
"filament_wipe",
//BBS
// BBS
"filament_wipe_distance",
"filament_retract_before_wipe",
// Orca
"filament_retract_after_wipe",
// BBS
"filament_long_retractions_when_cut",
"filament_retraction_distances_when_cut"
//SoftFever
@@ -4766,6 +4777,69 @@ void TabFilament::clear_pages()
m_overrides_options.clear();
}
// Orca:
void TabFilament::on_value_change(const std::string& opt_key, const boost::any& value)
{
if (wxGetApp().plater() == nullptr || m_config_manipulation.is_applying())
return;
const int pos = opt_key.find("#");
if (pos > 0) {
std::string temp_str = opt_key;
boost::erase_head(temp_str, pos + 1);
int orig_opt_idx = static_cast<size_t>(atoi(temp_str.c_str()));
int opt_idx = orig_opt_idx >= 0 ? orig_opt_idx : 0;
std::string opt_key_pure = opt_key;
boost::erase_tail(opt_key_pure, opt_key_pure.size() - pos);
if (opt_key_pure == "filament_retract_after_wipe" || opt_key_pure == "filament_retract_before_wipe") {
double dvalue = boost::any_cast<double>(value);
auto percent_value_clamp = [](double percent_value) { return std::clamp(percent_value, 0., 100.); };
auto get_value_by_opt_key = [&](const std::string& opt_key) {
if (opt_key_pure == opt_key && !std::isnan(dvalue)) {
// Return the incoming value (if it is valid) if the opt_key equals the key of the changed option.
return percent_value_clamp(dvalue);
} else if (!m_config->option<ConfigOptionPercents>(opt_key)->is_nil(opt_idx)) {
// Return the overridden value if the option value for the opt_key was overridden for the given filament.
return percent_value_clamp(m_config->option<ConfigOptionPercents>(opt_key)->get_at(opt_idx));
} else {
// Return the value of the option value for opt_key from the printer setting if it was not overridden for the filament.
const auto& printer_config = m_preset_bundle->printers.get_edited_preset().config;
const std::string printer_opt_key = opt_key.substr(strlen("filament_"));
return percent_value_clamp(printer_config.option<ConfigOptionPercents>(printer_opt_key)->get_at(opt_idx));
}
return 0.;
};
double retract_before_wipe = get_value_by_opt_key("filament_retract_before_wipe");
double retract_after_wipe = get_value_by_opt_key("filament_retract_after_wipe");
bool need_to_reload_config = false;
if (percent_value_clamp(dvalue) != dvalue) {
change_opt_value(*m_config, opt_key_pure, percent_value_clamp(dvalue), opt_idx);
need_to_reload_config = true;
}
if (retract_after_wipe > 100. - retract_before_wipe) {
change_opt_value(*m_config, "filament_retract_after_wipe", 100. - retract_before_wipe, opt_idx);
need_to_reload_config = true;
}
if (need_to_reload_config && !m_postpone_update_ui) {
update_dirty();
reload_config();
update_tab_ui();
}
}
}
Tab::on_value_change(opt_key, value);
}
wxSizer* Tab::description_line_widget(wxWindow* parent, ogStaticText* *StaticText, wxString text /*= wxEmptyString*/)
{
*StaticText = new ogStaticText(parent, text);
@@ -5530,6 +5604,8 @@ if (is_marlin_flavor)
optgroup->append_single_option_line("wipe", "printer_extruder_retraction#wipe-while-retracting", extruder_idx);
optgroup->append_single_option_line("wipe_distance", "printer_extruder_retraction#wipe-distance", extruder_idx);
optgroup->append_single_option_line("retract_before_wipe", "printer_extruder_retraction#retract-amount-before-wipe", extruder_idx);
// Orca
optgroup->append_single_option_line("retract_after_wipe", "printer_extruder_retraction#retract-amount-after-wipe", extruder_idx);
optgroup = page->new_optgroup(L("Z-Hop"), L"param_extruder_lift_enforcement");
optgroup->append_single_option_line("retract_lift_enforce", "printer_extruder_z_hop#on-surfaces", extruder_idx);
@@ -5989,16 +6065,20 @@ void TabPrinter::toggle_options()
// some options only apply when not using firmware retraction
vec.resize(0);
vec = {"retraction_speed", "deretraction_speed", "retract_before_wipe",
"retract_length", "retract_restart_extra",
"wipe_distance"};
vec = {"retraction_speed", "deretraction_speed", "retract_before_wipe", "retract_after_wipe",
"retract_length", "retract_restart_extra", "wipe_distance"};
for (auto el : vec)
//BBS
toggle_option(el, retraction && !use_firmware_retraction, i);
bool wipe = retraction && m_config->opt_bool("wipe", variant_index);
toggle_option("retract_before_wipe", wipe, i);
float retract_before_wipe = static_cast<ConfigOptionPercents*>(m_config->option("retract_before_wipe"))->values[variant_index];
// Orca:
double retract_before_wipe = m_config->option<ConfigOptionPercents>("retract_before_wipe")->get_at(variant_index);
double retract_after_wipe = m_config->option<ConfigOptionPercents>("retract_after_wipe")->get_at(variant_index);
toggle_option("retract_before_wipe", wipe && !is_approx(retract_after_wipe, 100.), i);
toggle_option("retract_after_wipe", wipe && !is_approx(retract_before_wipe, 100.), i);
if (use_firmware_retraction && wipe && retract_before_wipe < 100.0) {
//wxMessageDialog dialog(parent(),
@@ -6101,6 +6181,56 @@ void TabPrinter::toggle_options()
}
}
// Orca:
void TabPrinter::on_value_change(const std::string& opt_key, const boost::any& value)
{
if (wxGetApp().plater() == nullptr || m_config_manipulation.is_applying())
return;
const int pos = opt_key.find("#");
if (pos > 0) {
std::string temp_str = opt_key;
boost::erase_head(temp_str, pos + 1);
int orig_opt_idx = static_cast<size_t>(atoi(temp_str.c_str()));
int opt_idx = orig_opt_idx >= 0 ? orig_opt_idx : 0;
std::string opt_key_pure = opt_key;
boost::erase_tail(opt_key_pure, opt_key_pure.size() - pos);
if (opt_key_pure == "retract_after_wipe" || opt_key_pure == "retract_before_wipe") {
auto percent_value_clamp = [](double percent_value) { return std::clamp(percent_value, 0., 100.); };
double dvalue = boost::any_cast<double>(value);
double retract_before_wipe = percent_value_clamp(opt_key_pure == "retract_before_wipe"
? dvalue : m_config->option<ConfigOptionPercents>("retract_before_wipe")->get_at(opt_idx));
double retract_after_wipe = percent_value_clamp(opt_key_pure == "retract_after_wipe"
? dvalue : m_config->option<ConfigOptionPercents>("retract_after_wipe")->get_at(opt_idx));
bool need_to_reload_config = false;
if (percent_value_clamp(dvalue) != dvalue) {
change_opt_value(*m_config, opt_key_pure, percent_value_clamp(dvalue), opt_idx);
need_to_reload_config = true;
}
if (retract_after_wipe > 100. - retract_before_wipe) {
change_opt_value(*m_config, "retract_after_wipe", 100. - retract_before_wipe, opt_idx);
need_to_reload_config = true;
}
if (need_to_reload_config && !m_postpone_update_ui) {
update_dirty();
reload_config();
update_tab_ui();
}
}
}
Tab::on_value_change(opt_key, value);
}
void TabPrinter::update()
{
m_update_cnt++;

View File

@@ -608,6 +608,8 @@ public:
void clear_pages() override;
bool supports_printer_technology(const PrinterTechnology tech) const override { return tech == ptFFF; }
void on_value_change(const std::string& opt_key, const boost::any& value) override;
const std::string& get_custom_gcode(const t_config_option_key& opt_key) override;
void set_custom_gcode(const t_config_option_key& opt_key, const std::string& value) override;
};
@@ -666,11 +668,11 @@ public:
bool supports_printer_technology(const PrinterTechnology /* tech */) const override { return true; }
void set_extruder_volume_type(int extruder_id, NozzleVolumeType type);
void on_value_change(const std::string& opt_key, const boost::any& value) override;
wxSizer* create_bed_shape_widget(wxWindow* parent);
void cache_extruder_cnt(const DynamicPrintConfig* config = nullptr);
bool apply_extruder_cnt_from_cache();
};
class TabSLAMaterial : public Tab