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

@ -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);