From 0b1e716e222a6f64dc7ee2517df864e70a5060bf Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Fri, 17 Sep 2021 08:21:25 +0200 Subject: [PATCH] Tech ENABLE_RETRACT_ACCELERATION set as default --- src/libslic3r/GCode/GCodeProcessor.cpp | 25 ------------------------- src/libslic3r/GCode/GCodeProcessor.hpp | 4 ---- src/libslic3r/Technologies.hpp | 2 -- 3 files changed, 31 deletions(-) diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index 143e32dc5..d26e085e4 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -27,9 +27,7 @@ static const float DEFAULT_TOOLPATH_HEIGHT = 0.2f; static const float INCHES_TO_MM = 25.4f; static const float MMMIN_TO_MMSEC = 1.0f / 60.0f; static const float DEFAULT_ACCELERATION = 1500.0f; // Prusa Firmware 1_75mm_MK2 -#if ENABLE_RETRACT_ACCELERATION static const float DEFAULT_RETRACT_ACCELERATION = 1500.0f; // Prusa Firmware 1_75mm_MK2 -#endif // ENABLE_RETRACT_ACCELERATION static const float DEFAULT_TRAVEL_ACCELERATION = 1250.0f; static const size_t MIN_EXTRUDERS_COUNT = 5; @@ -184,10 +182,8 @@ void GCodeProcessor::TimeMachine::reset() enabled = false; acceleration = 0.0f; max_acceleration = 0.0f; -#if ENABLE_RETRACT_ACCELERATION retract_acceleration = 0.0f; max_retract_acceleration = 0.0f; -#endif // ENABLE_RETRACT_ACCELERATION travel_acceleration = 0.0f; max_travel_acceleration = 0.0f; extrude_factor_override_percentage = 1.0f; @@ -891,11 +887,9 @@ void GCodeProcessor::apply_config(const PrintConfig& config) float max_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_extruding, i); m_time_processor.machines[i].max_acceleration = max_acceleration; m_time_processor.machines[i].acceleration = (max_acceleration > 0.0f) ? max_acceleration : DEFAULT_ACCELERATION; -#if ENABLE_RETRACT_ACCELERATION float max_retract_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_retracting, i); m_time_processor.machines[i].max_retract_acceleration = max_retract_acceleration; m_time_processor.machines[i].retract_acceleration = (max_retract_acceleration > 0.0f) ? max_retract_acceleration : DEFAULT_RETRACT_ACCELERATION; -#endif // ENABLE_RETRACT_ACCELERATION float max_travel_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_travel, i); m_time_processor.machines[i].max_travel_acceleration = max_travel_acceleration; m_time_processor.machines[i].travel_acceleration = (max_travel_acceleration > 0.0f) ? max_travel_acceleration : DEFAULT_TRAVEL_ACCELERATION; @@ -1113,11 +1107,9 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config) float max_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_extruding, i); m_time_processor.machines[i].max_acceleration = max_acceleration; m_time_processor.machines[i].acceleration = (max_acceleration > 0.0f) ? max_acceleration : DEFAULT_ACCELERATION; -#if ENABLE_RETRACT_ACCELERATION float max_retract_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_retracting, i); m_time_processor.machines[i].max_retract_acceleration = max_retract_acceleration; m_time_processor.machines[i].retract_acceleration = (max_retract_acceleration > 0.0f) ? max_retract_acceleration : DEFAULT_RETRACT_ACCELERATION; -#endif // ENABLE_RETRACT_ACCELERATION float max_travel_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_travel, i); m_time_processor.machines[i].max_travel_acceleration = max_travel_acceleration; m_time_processor.machines[i].travel_acceleration = (max_travel_acceleration > 0.0f) ? max_travel_acceleration : DEFAULT_TRAVEL_ACCELERATION; @@ -2915,22 +2907,14 @@ void GCodeProcessor::process_M204(const GCodeReader::GCodeLine& line) set_acceleration(static_cast(i), value); set_travel_acceleration(static_cast(i), value); if (line.has_value('T', value)) -#if ENABLE_RETRACT_ACCELERATION set_retract_acceleration(static_cast(i), value); -#else - set_option_value(m_time_processor.machine_limits.machine_max_acceleration_retracting, i, value); -#endif // ENABLE_RETRACT_ACCELERATION } else { // New acceleration format, compatible with the upstream Marlin. if (line.has_value('P', value)) set_acceleration(static_cast(i), value); if (line.has_value('R', value)) -#if ENABLE_RETRACT_ACCELERATION set_retract_acceleration(static_cast(i), value); -#else - set_option_value(m_time_processor.machine_limits.machine_max_acceleration_retracting, i, value); -#endif // ENABLE_RETRACT_ACCELERATION if (line.has_value('T', value)) // Interpret the T value as the travel acceleration in the new Marlin format. set_travel_acceleration(static_cast(i), value); @@ -3188,20 +3172,12 @@ float GCodeProcessor::get_axis_max_jerk(PrintEstimatedStatistics::ETimeMode mode } } -#if ENABLE_RETRACT_ACCELERATION float GCodeProcessor::get_retract_acceleration(PrintEstimatedStatistics::ETimeMode mode) const { size_t id = static_cast(mode); return (id < m_time_processor.machines.size()) ? m_time_processor.machines[id].retract_acceleration : DEFAULT_RETRACT_ACCELERATION; } -#else -float GCodeProcessor::get_retract_acceleration(PrintEstimatedStatistics::ETimeMode mode) const -{ - return get_option_value(m_time_processor.machine_limits.machine_max_acceleration_retracting, static_cast(mode)); -} -#endif // ENABLE_RETRACT_ACCELERATION -#if ENABLE_RETRACT_ACCELERATION void GCodeProcessor::set_retract_acceleration(PrintEstimatedStatistics::ETimeMode mode, float value) { size_t id = static_cast(mode); @@ -3211,7 +3187,6 @@ void GCodeProcessor::set_retract_acceleration(PrintEstimatedStatistics::ETimeMod std::min(value, m_time_processor.machines[id].max_retract_acceleration); } } -#endif // ENABLE_RETRACT_ACCELERATION float GCodeProcessor::get_acceleration(PrintEstimatedStatistics::ETimeMode mode) const { diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 29f08187e..5af040307 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -242,11 +242,9 @@ namespace Slic3r { float acceleration; // mm/s^2 // hard limit for the acceleration, to which the firmware will clamp. float max_acceleration; // mm/s^2 -#if ENABLE_RETRACT_ACCELERATION float retract_acceleration; // mm/s^2 // hard limit for the acceleration, to which the firmware will clamp. float max_retract_acceleration; // mm/s^2 -#endif // ENABLE_RETRACT_ACCELERATION float travel_acceleration; // mm/s^2 // hard limit for the travel acceleration, to which the firmware will clamp. float max_travel_acceleration; // mm/s^2 @@ -720,9 +718,7 @@ namespace Slic3r { float get_axis_max_acceleration(PrintEstimatedStatistics::ETimeMode mode, Axis axis) const; float get_axis_max_jerk(PrintEstimatedStatistics::ETimeMode mode, Axis axis) const; float get_retract_acceleration(PrintEstimatedStatistics::ETimeMode mode) const; -#if ENABLE_RETRACT_ACCELERATION void set_retract_acceleration(PrintEstimatedStatistics::ETimeMode mode, float value); -#endif // ENABLE_RETRACT_ACCELERATION float get_acceleration(PrintEstimatedStatistics::ETimeMode mode) const; void set_acceleration(PrintEstimatedStatistics::ETimeMode mode, float value); float get_travel_acceleration(PrintEstimatedStatistics::ETimeMode mode) const; diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index 8da21d56a..dd1aaf46e 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -41,8 +41,6 @@ //==================== #define ENABLE_2_4_0_ALPHA1 1 -// Enable implementation of retract acceleration in gcode processor -#define ENABLE_RETRACT_ACCELERATION (1 && ENABLE_2_4_0_ALPHA1) // Enable the fix for exporting and importing to/from 3mf file of mirrored volumes #define ENABLE_FIX_MIRRORED_VOLUMES_3MF_IMPORT_EXPORT (1 && ENABLE_2_4_0_ALPHA1) // Enable rendering seams (and other options) in preview using models