Disallow enabling options avoid_crossing_perimeters and

avoid_curled_filament_during_travels at the same time,
throw warning if both options enabled together - in this case ignore curled filament avoidance
This commit is contained in:
PavelMikus 2022-12-12 11:33:28 +01:00
parent fc929d9faf
commit 30e81fad3b
2 changed files with 11 additions and 3 deletions

View File

@ -3002,10 +3002,15 @@ std::string GCode::travel_to(const Point &point, ExtrusionRole role, std::string
Polyline travel { this->last_pos(), point };
if (this->config().avoid_curled_filament_during_travels) {
if (m_config.avoid_crossing_perimeters) {
BOOST_LOG_TRIVIAL(warning)
<< "Option >avoid curled filament during travels< is not compatible with avoid crossing perimeters and it will be ignored!";
} else {
Point scaled_origin = Point(scaled(this->origin()));
travel = m_avoid_curled_filaments.find_path(this->last_pos() + scaled_origin, point + scaled_origin);
travel.translate(-scaled_origin);
}
}
// check whether a straight travel move would need retraction
bool needs_retraction = this->needs_retraction(travel, role);

View File

@ -315,6 +315,9 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config)
"wipe_tower_bridging", "wipe_tower_no_sparse_layers", "single_extruder_multi_material_priming" })
toggle_field(el, have_wipe_tower);
toggle_field("avoid_curled_filament_during_travels", !config->opt_bool("avoid_crossing_perimeters"));
toggle_field("avoid_crossing_perimeters", !config->opt_bool("avoid_curled_filament_during_travels"));
bool have_avoid_crossing_perimeters = config->opt_bool("avoid_crossing_perimeters");
toggle_field("avoid_crossing_perimeters_max_detour", have_avoid_crossing_perimeters);