From 430d023edead89ba3f66fe4a1d2c09f35dfa24a3 Mon Sep 17 00:00:00 2001 From: supermerill Date: Thu, 14 Feb 2019 17:51:24 +0100 Subject: [PATCH] add filament_max_wipe_tower_speed --- src/libslic3r/GCode/WipeTowerPrusaMM.cpp | 16 +++++++++------- src/libslic3r/GCode/WipeTowerPrusaMM.hpp | 2 +- src/libslic3r/PrintConfig.cpp | 10 ++++++++++ src/libslic3r/PrintConfig.hpp | 2 ++ src/slic3r/GUI/Preset.cpp | 1 + src/slic3r/GUI/Tab.cpp | 3 ++- 6 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/libslic3r/GCode/WipeTowerPrusaMM.cpp b/src/libslic3r/GCode/WipeTowerPrusaMM.cpp index c423e6213..752362193 100644 --- a/src/libslic3r/GCode/WipeTowerPrusaMM.cpp +++ b/src/libslic3r/GCode/WipeTowerPrusaMM.cpp @@ -903,13 +903,15 @@ void WipeTowerPrusaMM::toolchange_Change( m_used_filament_length[m_current_tool] += writer.get_and_reset_used_filament_length(); // Speed override for the material. Go slow for flex and soluble materials. - int speed_override; - switch (new_material) { - case PVA: speed_override = (m_z_pos < 0.80f) ? 60 : 80; break; - case SCAFF: speed_override = 35; break; - case FLEX: speed_override = 35; break; - default: speed_override = 100; - } + int speed_override = m_config->filament_max_wipe_tower_speed.get_at(new_tool); + if (speed_override <= 0) { + switch (new_material) { + case PVA: speed_override = (m_z_pos < 0.80f) ? 60 : 80; break; + case SCAFF: speed_override = 35; break; + case FLEX: speed_override = 35; break; + default: speed_override = 100; + } + } writer.set_tool(new_tool); if (m_retain_speed_override) assert(speed_override == 100); diff --git a/src/libslic3r/GCode/WipeTowerPrusaMM.hpp b/src/libslic3r/GCode/WipeTowerPrusaMM.hpp index 3b05f3372..793518293 100644 --- a/src/libslic3r/GCode/WipeTowerPrusaMM.hpp +++ b/src/libslic3r/GCode/WipeTowerPrusaMM.hpp @@ -75,7 +75,7 @@ public: m_filpar.push_back(FilamentParameters()); m_filpar[idx].material = WipeTowerPrusaMM::parse_material(m_config->filament_type.get_at(idx).c_str()); - if (m_filpar[idx].material == FLEX || m_filpar[idx].material == SCAFF || m_filpar[idx].material == PVA) { + if (m_config->filament_max_wipe_tower_speed.get_at(idx) > 0 || m_filpar[idx].material == FLEX || m_filpar[idx].material == SCAFF || m_filpar[idx].material == PVA) { // MMU2 lowers the print speed using the speed override (M220) for printing of soluble PVA/BVOH and flex materials. // Therefore it does not make sense to use the new M220 B and M220 R (backup / restore). m_retain_speed_override = false; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index d4e74a55e..9806a08cb 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -713,6 +713,16 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->default_value = new ConfigOptionFloats { 0. }; + def = this->add("filament_max_wipe_tower_speed", coFloats); + def->label = L("Max speed on the wipe tower"); + def->tooltip = L("This setting is used to set the maximum speed when extruding inside the wipe tower (use M220). In %, set 0 to disable and use the Filament type instead."); + def->sidetext = L("% of mm/s"); + def->cli = "filament-max-wipe-tower-speed=f@"; + def->min = 0; + def->max = 200; + def->mode = comExpert; + def->default_value = new ConfigOptionFloats { 0 }; + def = this->add("filament_loading_speed", coFloats); def->label = L("Loading speed"); def->tooltip = L("Speed used for loading the filament on the wipe tower. "); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index c6cb66a00..8ff0a64d8 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -708,6 +708,7 @@ public: ConfigOptionBools filament_soluble; ConfigOptionFloats filament_cost; ConfigOptionFloats filament_max_volumetric_speed; + ConfigOptionFloats filament_max_wipe_tower_speed; ConfigOptionFloats filament_loading_speed; ConfigOptionFloats filament_loading_speed_start; ConfigOptionFloats filament_load_time; @@ -786,6 +787,7 @@ protected: OPT_PTR(filament_soluble); OPT_PTR(filament_cost); OPT_PTR(filament_max_volumetric_speed); + OPT_PTR(filament_max_wipe_tower_speed); OPT_PTR(filament_loading_speed); OPT_PTR(filament_loading_speed_start); OPT_PTR(filament_load_time); diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index f2832c63e..8a5c7fec8 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -373,6 +373,7 @@ const std::vector& Preset::filament_options() { static std::vector s_opts { "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_speed", + "filament_max_wipe_tower_speed", "extrusion_multiplier", "filament_density", "filament_cost", "filament_loading_speed", "filament_loading_speed_start", "filament_load_time", "filament_unloading_speed", "filament_toolchange_delay", "filament_unloading_speed_start", "filament_unload_time", "filament_cooling_moves", "filament_cooling_initial_speed", "filament_cooling_final_speed", "filament_ramming_parameters", "filament_minimal_purge_on_wipe_tower", diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 0578a76ea..3c630f0cd 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1548,7 +1548,8 @@ void TabFilament::build() line.widget = [this](wxWindow* parent) { return description_line_widget(parent, &m_volumetric_speed_description_line); }; - optgroup->append_line(line); + optgroup->append_line(line); + optgroup->append_single_option_line("filament_max_wipe_tower_speed"); optgroup = page->new_optgroup(_(L("Toolchange parameters with single extruder MM printers"))); optgroup->append_single_option_line("filament_loading_speed_start");