ENH: wipe_distance should not to be 0 or negative value

As title, fix github issue #220

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: If63c839da1341ac2e16bbfa287c4e32564284d59
This commit is contained in:
salt.wei 2022-09-07 16:26:45 +08:00 committed by Lane.Wei
parent e6f0c5abec
commit 4e1caa428d
4 changed files with 9 additions and 8 deletions

View File

@ -3836,8 +3836,8 @@ std::string GCode::retract(bool toolchange, bool is_last_retraction)
if (m_writer.extruder() == nullptr)
return gcode;
// wipe (if it's enabled for this extruder and we have a stored wipe path)
if (EXTRUDER_CONFIG(wipe) && m_wipe.has_path()) {
// wipe (if it's enabled for this extruder and we have a stored wipe path and no-zero wipe distance)
if (EXTRUDER_CONFIG(wipe) && m_wipe.has_path() && scale_(EXTRUDER_CONFIG(wipe_distance)) > SCALED_EPSILON) {
gcode += toolchange ? m_writer.retract_for_toolchange(true) : m_writer.retract(true);
gcode += m_wipe.wipe(*this, toolchange, is_last_retraction);
}

View File

@ -2497,6 +2497,7 @@ void PrintConfigDef::init_fff_params()
def->label = L("Wipe Distance");
def->tooltip = L("Discribe how long the nozzle will move along the last path when retracting");
def->sidetext = L("mm");
def->min = 0;
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats { 2. });

View File

@ -94,7 +94,6 @@ static constexpr bool RELATIVE_E_AXIS = 1;
static constexpr bool g_config_support_sharp_tails = true;
static constexpr bool g_config_remove_small_overhangs = true;
static constexpr float g_config_tree_support_collision_resolution = 0.2;
static constexpr float g_config_slice_closing_radius = 0.049;
// Write slices as SVG images into out directory during the 2D processing of the slices.
// #define SLIC3R_DEBUG_SLICE_PROCESSING

View File

@ -3395,9 +3395,10 @@ void TabPrinter::toggle_options()
}
wxString extruder_number;
long val;
if (m_active_page->title().StartsWith("Extruder ", &extruder_number) && extruder_number.ToLong(&val) &&
val > 0 && (size_t)val <= m_extruders_count)
long val = 1;
if ( m_active_page->title().IsSameAs("Extruder") ||
(m_active_page->title().StartsWith("Extruder ", &extruder_number) && extruder_number.ToLong(&val) &&
val > 0 && (size_t)val <= m_extruders_count))
{
size_t i = size_t(val - 1);
bool have_retract_length = m_config->opt_float("retraction_length", i) > 0;
@ -3423,10 +3424,10 @@ void TabPrinter::toggle_options()
//BBS
toggle_option(el, retraction, i);
bool wipe = m_config->opt_bool("wipe", i);
bool wipe = retraction && m_config->opt_bool("wipe", i);
toggle_option("retract_before_wipe", wipe, i);
// BBS
toggle_option("wipe_distance", i);
toggle_option("wipe_distance", wipe, i);
toggle_option("retract_length_toolchange", have_multiple_extruders, i);