From 0bf78f8e9e10919c1c6fb7fdf17c2fdf7131dc1b Mon Sep 17 00:00:00 2001 From: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com> Date: Tue, 9 Jan 2024 15:55:11 +0200 Subject: [PATCH 1/2] Bug: Fix retraction issues with PA pattern calibration (#3314) * Attempt to fix retraction issues with PA pattern calibration * PA pattern test fix - retract and wipe on layer change * Naming convention * fix crash --- src/libslic3r/GCode.cpp | 2 +- src/libslic3r/calib.cpp | 2 ++ src/slic3r/GUI/Plater.cpp | 11 ++++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 28655394a01..2c28e4841fe 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -295,7 +295,7 @@ static std::vector get_path_of_change_filament(const Print& print) : gcodegen.config().nozzle_temperature.get_at(gcodegen.writer().extruder()->id()); } - // Ioannis Giannakas: + // Orca: // Function to calculate the excess retraction length that should be retracted either before or after wiping // in order for the wipe operation to respect the filament retraction speed Wipe::RetractionValues Wipe::calculateWipeRetractionLengths(GCode& gcodegen, bool toolchange) { diff --git a/src/libslic3r/calib.cpp b/src/libslic3r/calib.cpp index 2ddad883c27..162d7b9b5a4 100644 --- a/src/libslic3r/calib.cpp +++ b/src/libslic3r/calib.cpp @@ -572,6 +572,7 @@ void CalibPressureAdvancePattern::generate_custom_gcodes(const DynamicPrintConfi gcode << "; start pressure advance pattern for layer\n"; gcode << m_writer.travel_to_z(layer_height, "Move to layer height"); + gcode << m_writer.reset_e(); } // line numbering @@ -650,6 +651,7 @@ void CalibPressureAdvancePattern::generate_custom_gcodes(const DynamicPrintConfi gcode << m_writer.travel_to_z(zhop_height, "z-hop before move"); gcode << move_to(Vec2d(to_x, to_y), m_writer, "Move back to start position"); gcode << m_writer.travel_to_z(layer_height, "undo z-hop"); + gcode << m_writer.reset_e(); // reset extruder before printing placeholder cube to avoid } else { // everything done } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 8fb1b92f10d..61fbb23e16a 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -8843,9 +8843,14 @@ void Plater::_calib_pa_pattern(const Calib_Params& params) changed_objects({ 0 }); _calib_pa_select_added_objects(); - const DynamicPrintConfig& printer_config = wxGetApp().preset_bundle->printers.get_edited_preset().config; + DynamicPrintConfig& printer_config = wxGetApp().preset_bundle->printers.get_edited_preset().config; DynamicPrintConfig& print_config = wxGetApp().preset_bundle->prints.get_edited_preset().config; + auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config; double nozzle_diameter = printer_config.option("nozzle_diameter")->get_at(0); + filament_config->set_key_value("filament_retract_when_changing_layer", new ConfigOptionBoolsNullable{false}); + filament_config->set_key_value("filament_wipe", new ConfigOptionBoolsNullable{false}); + printer_config.set_key_value("wipe", new ConfigOptionBools{false}); + printer_config.set_key_value("retract_when_changing_layer", new ConfigOptionBools{false}); for (const auto opt : SuggestedConfigCalibPAPattern().float_pairs) { print_config.set_key_value( @@ -8879,7 +8884,11 @@ void Plater::_calib_pa_pattern(const Calib_Params& params) ); wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty(); + wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_dirty(); + wxGetApp().get_tab(Preset::TYPE_PRINTER)->update_dirty(); wxGetApp().get_tab(Preset::TYPE_PRINT)->reload_config(); + wxGetApp().get_tab(Preset::TYPE_FILAMENT)->reload_config(); + wxGetApp().get_tab(Preset::TYPE_PRINTER)->reload_config(); const DynamicPrintConfig full_config = wxGetApp().preset_bundle->full_config(); PresetBundle* preset_bundle = wxGetApp().preset_bundle; From b4925363d6e17ebe416c8279089e17527114027b Mon Sep 17 00:00:00 2001 From: gswatkins Date: Tue, 9 Jan 2024 08:56:17 -0500 Subject: [PATCH 2/2] Display accurate precision for percent config values (#3466) Percent config values are managed as float types, but decimal precision is not displayed in the GUI. This change uses the `double_to_string()` converstion rather than casting to an int when retrieving the config option value. --- src/slic3r/GUI/OptionsGroup.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 086e90fc57a..401dede3096 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -981,8 +981,7 @@ boost::any ConfigOptionsGroup::get_config_value(const DynamicPrintConfig& config } case coPercent:{ double val = config.option(opt_key)->value; - text_value = wxString::Format(_T("%i"), int(val)); - ret = text_value;// += "%"; + ret = double_to_string(val);// += "%"; } break; case coPercents: