mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
fix some small issues of machine_max_acceleration_travel
This commit is contained in:
parent
bfdaa1c51b
commit
eed0c28bd8
13 changed files with 34 additions and 25 deletions
|
@ -45,8 +45,8 @@
|
||||||
"5000"
|
"5000"
|
||||||
],
|
],
|
||||||
"machine_max_acceleration_travel": [
|
"machine_max_acceleration_travel": [
|
||||||
"9000",
|
"20000",
|
||||||
"9000"
|
"20000"
|
||||||
],
|
],
|
||||||
"machine_max_acceleration_x": [
|
"machine_max_acceleration_x": [
|
||||||
"20000",
|
"20000",
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
"machine_max_acceleration_e": ["5000", "5000"],
|
"machine_max_acceleration_e": ["5000", "5000"],
|
||||||
"machine_max_acceleration_extruding": ["20000", "20000"],
|
"machine_max_acceleration_extruding": ["20000", "20000"],
|
||||||
"machine_max_acceleration_retracting": ["5000", "5000"],
|
"machine_max_acceleration_retracting": ["5000", "5000"],
|
||||||
"machine_max_acceleration_travel": ["9000", "9000"],
|
"machine_max_acceleration_travel": ["20000", "20000"],
|
||||||
"machine_max_acceleration_x": ["20000", "20000"],
|
"machine_max_acceleration_x": ["20000", "20000"],
|
||||||
"machine_max_acceleration_y": ["20000", "20000"],
|
"machine_max_acceleration_y": ["20000", "20000"],
|
||||||
"machine_max_acceleration_z": ["500", "500"],
|
"machine_max_acceleration_z": ["500", "500"],
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
"machine_max_acceleration_e": ["5000", "5000"],
|
"machine_max_acceleration_e": ["5000", "5000"],
|
||||||
"machine_max_acceleration_extruding": ["20000", "20000"],
|
"machine_max_acceleration_extruding": ["20000", "20000"],
|
||||||
"machine_max_acceleration_retracting": ["5000", "5000"],
|
"machine_max_acceleration_retracting": ["5000", "5000"],
|
||||||
"machine_max_acceleration_travel": ["9000", "9000"],
|
"machine_max_acceleration_travel": ["20000", "20000"],
|
||||||
"machine_max_acceleration_x": ["20000", "20000"],
|
"machine_max_acceleration_x": ["20000", "20000"],
|
||||||
"machine_max_acceleration_y": ["20000", "20000"],
|
"machine_max_acceleration_y": ["20000", "20000"],
|
||||||
"machine_max_acceleration_z": ["500", "200"],
|
"machine_max_acceleration_z": ["500", "200"],
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
"machine_max_acceleration_e": [ "5000", "5000" ],
|
"machine_max_acceleration_e": [ "5000", "5000" ],
|
||||||
"machine_max_acceleration_extruding": [ "20000", "20000" ],
|
"machine_max_acceleration_extruding": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_retracting": [ "5000", "5000" ],
|
"machine_max_acceleration_retracting": [ "5000", "5000" ],
|
||||||
"machine_max_acceleration_travel": [ "9000", "9000" ],
|
"machine_max_acceleration_travel": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_x": [ "20000", "20000" ],
|
"machine_max_acceleration_x": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_y": [ "20000", "20000" ],
|
"machine_max_acceleration_y": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_z": [ "500", "500" ],
|
"machine_max_acceleration_z": [ "500", "500" ],
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
"machine_max_acceleration_e": [ "5000", "5000" ],
|
"machine_max_acceleration_e": [ "5000", "5000" ],
|
||||||
"machine_max_acceleration_extruding": [ "20000", "20000" ],
|
"machine_max_acceleration_extruding": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_retracting": [ "5000", "5000" ],
|
"machine_max_acceleration_retracting": [ "5000", "5000" ],
|
||||||
"machine_max_acceleration_travel": [ "9000", "9000" ],
|
"machine_max_acceleration_travel": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_x": [ "20000", "20000" ],
|
"machine_max_acceleration_x": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_y": [ "20000", "20000" ],
|
"machine_max_acceleration_y": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_z": [ "500", "500" ],
|
"machine_max_acceleration_z": [ "500", "500" ],
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
"machine_max_acceleration_e": [ "5000", "5000" ],
|
"machine_max_acceleration_e": [ "5000", "5000" ],
|
||||||
"machine_max_acceleration_extruding": [ "20000", "20000" ],
|
"machine_max_acceleration_extruding": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_retracting": [ "5000", "5000" ],
|
"machine_max_acceleration_retracting": [ "5000", "5000" ],
|
||||||
"machine_max_acceleration_travel": [ "9000", "9000" ],
|
"machine_max_acceleration_travel": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_x": [ "20000", "20000" ],
|
"machine_max_acceleration_x": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_y": [ "20000", "20000" ],
|
"machine_max_acceleration_y": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_z": [ "500", "500" ],
|
"machine_max_acceleration_z": [ "500", "500" ],
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
"machine_max_acceleration_e": [ "5000", "5000" ],
|
"machine_max_acceleration_e": [ "5000", "5000" ],
|
||||||
"machine_max_acceleration_extruding": [ "20000", "20000" ],
|
"machine_max_acceleration_extruding": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_retracting": [ "5000", "5000" ],
|
"machine_max_acceleration_retracting": [ "5000", "5000" ],
|
||||||
"machine_max_acceleration_travel": [ "9000", "9000" ],
|
"machine_max_acceleration_travel": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_x": [ "20000", "20000" ],
|
"machine_max_acceleration_x": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_y": [ "20000", "20000" ],
|
"machine_max_acceleration_y": [ "20000", "20000" ],
|
||||||
"machine_max_acceleration_z": [ "500", "500" ],
|
"machine_max_acceleration_z": [ "500", "500" ],
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
"machine_max_acceleration_e": ["5000", "5000"],
|
"machine_max_acceleration_e": ["5000", "5000"],
|
||||||
"machine_max_acceleration_extruding": ["1250", "20000"],
|
"machine_max_acceleration_extruding": ["1250", "20000"],
|
||||||
"machine_max_acceleration_retracting": ["1250", "5000"],
|
"machine_max_acceleration_retracting": ["1250", "5000"],
|
||||||
"machine_max_acceleration_travel": ["9000", "9000"],
|
"machine_max_acceleration_travel": ["20000", "20000"],
|
||||||
"machine_max_acceleration_x": ["3000", "20000"],
|
"machine_max_acceleration_x": ["3000", "20000"],
|
||||||
"machine_max_acceleration_y": ["3000", "20000"],
|
"machine_max_acceleration_y": ["3000", "20000"],
|
||||||
"machine_max_acceleration_z": ["200", "200"],
|
"machine_max_acceleration_z": ["200", "200"],
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "ExtrusionEntity.hpp"
|
#include "ExtrusionEntity.hpp"
|
||||||
|
#include "PrintConfig.hpp"
|
||||||
#include "libslic3r/libslic3r.h"
|
#include "libslic3r/libslic3r.h"
|
||||||
#include "libslic3r/Utils.hpp"
|
#include "libslic3r/Utils.hpp"
|
||||||
#include "libslic3r/Print.hpp"
|
#include "libslic3r/Print.hpp"
|
||||||
|
@ -973,7 +974,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
|
||||||
|
|
||||||
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper || m_flavor == gcfRepRapFirmware) {
|
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper || m_flavor == gcfRepRapFirmware) {
|
||||||
m_time_processor.machine_limits = reinterpret_cast<const MachineEnvelopeConfig&>(config);
|
m_time_processor.machine_limits = reinterpret_cast<const MachineEnvelopeConfig&>(config);
|
||||||
if (m_flavor == gcfMarlinLegacy) {
|
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfKlipper) {
|
||||||
// Legacy Marlin does not have separate travel acceleration, it uses the 'extruding' value instead.
|
// Legacy Marlin does not have separate travel acceleration, it uses the 'extruding' value instead.
|
||||||
m_time_processor.machine_limits.machine_max_acceleration_travel = m_time_processor.machine_limits.machine_max_acceleration_extruding;
|
m_time_processor.machine_limits.machine_max_acceleration_travel = m_time_processor.machine_limits.machine_max_acceleration_extruding;
|
||||||
}
|
}
|
||||||
|
@ -993,13 +994,18 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
|
||||||
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
|
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
|
||||||
float max_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_extruding, i);
|
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].max_acceleration = max_acceleration;
|
||||||
m_time_processor.machines[i].acceleration = (max_acceleration > 0.0f) ? max_acceleration : DEFAULT_ACCELERATION;
|
m_time_processor.machines[i].acceleration = (max_acceleration > 0.0f) ? max_acceleration : DEFAULT_ACCELERATION;
|
||||||
float max_retract_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_retracting, i);
|
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].max_retract_acceleration = max_retract_acceleration;
|
||||||
m_time_processor.machines[i].retract_acceleration = (max_retract_acceleration > 0.0f) ? max_retract_acceleration : DEFAULT_RETRACT_ACCELERATION;
|
m_time_processor.machines[i].retract_acceleration = (max_retract_acceleration > 0.0f) ? max_retract_acceleration :
|
||||||
|
DEFAULT_RETRACT_ACCELERATION;
|
||||||
float max_travel_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_travel, i);
|
float max_travel_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_travel, i);
|
||||||
|
if (!GCodeWriter::supports_separate_travel_acceleration(config.gcode_flavor.value)){
|
||||||
|
max_travel_acceleration = 0;
|
||||||
|
}
|
||||||
m_time_processor.machines[i].max_travel_acceleration = max_travel_acceleration;
|
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;
|
m_time_processor.machines[i].travel_acceleration = (max_travel_acceleration > 0.0f) ? max_travel_acceleration :
|
||||||
|
DEFAULT_TRAVEL_ACCELERATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ConfigOptionFloat* initial_layer_print_height = config.option<ConfigOptionFloat>("initial_layer_print_height");
|
const ConfigOptionFloat* initial_layer_print_height = config.option<ConfigOptionFloat>("initial_layer_print_height");
|
||||||
|
@ -1242,7 +1248,7 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
||||||
|
|
||||||
|
|
||||||
// Legacy Marlin does not have separate travel acceleration, it uses the 'extruding' value instead.
|
// Legacy Marlin does not have separate travel acceleration, it uses the 'extruding' value instead.
|
||||||
const ConfigOptionFloats* machine_max_acceleration_travel = config.option<ConfigOptionFloats>(m_flavor == gcfMarlinLegacy
|
const ConfigOptionFloats* machine_max_acceleration_travel = config.option<ConfigOptionFloats>(m_flavor == gcfMarlinLegacy || m_flavor == gcfKlipper
|
||||||
? "machine_max_acceleration_extruding"
|
? "machine_max_acceleration_extruding"
|
||||||
: "machine_max_acceleration_travel");
|
: "machine_max_acceleration_travel");
|
||||||
if (machine_max_acceleration_travel != nullptr)
|
if (machine_max_acceleration_travel != nullptr)
|
||||||
|
@ -1261,13 +1267,15 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
||||||
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
|
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
|
||||||
float max_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_extruding, i);
|
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].max_acceleration = max_acceleration;
|
||||||
m_time_processor.machines[i].acceleration = (max_acceleration > 0.0f) ? max_acceleration : DEFAULT_ACCELERATION;
|
m_time_processor.machines[i].acceleration = (max_acceleration > 0.0f) ? max_acceleration : DEFAULT_ACCELERATION;
|
||||||
float max_retract_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_retracting, i);
|
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].max_retract_acceleration = max_retract_acceleration;
|
||||||
m_time_processor.machines[i].retract_acceleration = (max_retract_acceleration > 0.0f) ? max_retract_acceleration : DEFAULT_RETRACT_ACCELERATION;
|
m_time_processor.machines[i].retract_acceleration = (max_retract_acceleration > 0.0f) ? max_retract_acceleration :
|
||||||
|
DEFAULT_RETRACT_ACCELERATION;
|
||||||
float max_travel_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_travel, i);
|
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].max_travel_acceleration = max_travel_acceleration;
|
||||||
m_time_processor.machines[i].travel_acceleration = (max_travel_acceleration > 0.0f) ? max_travel_acceleration : DEFAULT_TRAVEL_ACCELERATION;
|
m_time_processor.machines[i].travel_acceleration = (max_travel_acceleration > 0.0f) ? max_travel_acceleration :
|
||||||
|
DEFAULT_TRAVEL_ACCELERATION;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware) {
|
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware) {
|
||||||
|
|
|
@ -19,7 +19,7 @@ namespace Slic3r {
|
||||||
bool GCodeWriter::full_gcode_comment = true;
|
bool GCodeWriter::full_gcode_comment = true;
|
||||||
const double GCodeWriter::slope_threshold = 3 * PI / 180;
|
const double GCodeWriter::slope_threshold = 3 * PI / 180;
|
||||||
|
|
||||||
bool supports_separate_travel_acceleration(GCodeFlavor flavor)
|
bool GCodeWriter::supports_separate_travel_acceleration(GCodeFlavor flavor)
|
||||||
{
|
{
|
||||||
return (flavor == gcfRepetier || flavor == gcfMarlinFirmware || flavor == gcfRepRapFirmware);
|
return (flavor == gcfRepetier || flavor == gcfMarlinFirmware || flavor == gcfRepRapFirmware);
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,6 +116,8 @@ public:
|
||||||
void set_is_first_layer(bool bval) { m_is_first_layer = bval; }
|
void set_is_first_layer(bool bval) { m_is_first_layer = bval; }
|
||||||
GCodeFlavor get_gcode_flavor() const { return config.gcode_flavor; }
|
GCodeFlavor get_gcode_flavor() const { return config.gcode_flavor; }
|
||||||
|
|
||||||
|
// Returns whether this flavor supports separate print and travel acceleration.
|
||||||
|
static bool supports_separate_travel_acceleration(GCodeFlavor flavor);
|
||||||
private:
|
private:
|
||||||
// Extruders are sorted by their ID, so that binary search is possible.
|
// Extruders are sorted by their ID, so that binary search is possible.
|
||||||
std::vector<Extruder> m_extruders;
|
std::vector<Extruder> m_extruders;
|
||||||
|
|
|
@ -2597,7 +2597,7 @@ def = this->add("filament_loading_speed", coFloats);
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->readonly = false;
|
def->readonly = false;
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
def->set_default_value(new ConfigOptionFloats{ 1500., 1250. });
|
def->set_default_value(new ConfigOptionFloats{ 0., 0. });
|
||||||
|
|
||||||
def = this->add("fan_max_speed", coInts);
|
def = this->add("fan_max_speed", coInts);
|
||||||
def->label = L("Fan speed");
|
def->label = L("Fan speed");
|
||||||
|
|
|
@ -3434,7 +3434,7 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/)
|
||||||
{
|
{
|
||||||
size_t n_before_extruders = 2; // Count of pages before Extruder pages
|
size_t n_before_extruders = 2; // Count of pages before Extruder pages
|
||||||
auto flavor = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
|
auto flavor = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
|
||||||
bool is_marlin_flavor = (flavor == gcfMarlinLegacy || flavor == gcfMarlinFirmware || flavor == gcfKlipper);
|
bool is_marlin_flavor = (flavor == gcfMarlinLegacy || flavor == gcfMarlinFirmware || flavor == gcfKlipper || flavor == gcfRepRapFirmware);
|
||||||
|
|
||||||
/* ! Freeze/Thaw in this function is needed to avoid call OnPaint() for erased pages
|
/* ! Freeze/Thaw in this function is needed to avoid call OnPaint() for erased pages
|
||||||
* and be cause of application crash, when try to change Preset in moment,
|
* and be cause of application crash, when try to change Preset in moment,
|
||||||
|
@ -3461,8 +3461,8 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/)
|
||||||
m_pages.insert(m_pages.begin() + n_before_extruders, page);
|
m_pages.insert(m_pages.begin() + n_before_extruders, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_marlin_flavor)
|
if (is_marlin_flavor)
|
||||||
n_before_extruders++;
|
n_before_extruders++;
|
||||||
size_t n_after_single_extruder_MM = 2; // Count of pages after single_extruder_multi_material page
|
size_t n_after_single_extruder_MM = 2; // Count of pages after single_extruder_multi_material page
|
||||||
|
|
||||||
if (from_initial_build) {
|
if (from_initial_build) {
|
||||||
|
@ -3829,12 +3829,11 @@ void TabPrinter::toggle_options()
|
||||||
|
|
||||||
if (m_active_page->title() == L("Motion ability")) {
|
if (m_active_page->title() == L("Motion ability")) {
|
||||||
auto gcf = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
|
auto gcf = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
|
||||||
assert(gcf == gcfMarlinLegacy || gcf == gcfMarlinFirmware || gcf == gcfKlipper);
|
|
||||||
bool silent_mode = m_config->opt_bool("silent_mode");
|
bool silent_mode = m_config->opt_bool("silent_mode");
|
||||||
int max_field = silent_mode ? 2 : 1;
|
int max_field = silent_mode ? 2 : 1;
|
||||||
for (int i = 0; i < max_field; ++i)
|
for (int i = 0; i < max_field; ++i)
|
||||||
toggle_option("machine_max_acceleration_travel", gcf == gcfMarlinFirmware, i);
|
toggle_option("machine_max_acceleration_travel", gcf != gcfMarlinLegacy && gcf != gcfKlipper, i);
|
||||||
toggle_line("machine_max_acceleration_travel", gcf == gcfMarlinFirmware);
|
toggle_line("machine_max_acceleration_travel", gcf != gcfMarlinLegacy && gcf != gcfKlipper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue