Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsupermerill <merill@free.fr>2021-11-08 23:30:10 +0300
committersupermerill <merill@free.fr>2021-11-09 02:04:04 +0300
commit521bd256a901cdca142929b07eb6073ced55ec9c (patch)
tree9de8544a6eb3bab11460ad4b357ac9eca6f49b82
parent65bb95cd8171268f18b46b0073dfb7a03b7f6f73 (diff)
Fix acceleration in % of machine_max_acceleration_x
supermerill/SuperSlicer#1829
-rw-r--r--src/libslic3r/Config.cpp14
-rw-r--r--src/libslic3r/PrintConfig.cpp4
2 files changed, 9 insertions, 9 deletions
diff --git a/src/libslic3r/Config.cpp b/src/libslic3r/Config.cpp
index 208a041d2..75f882161 100644
--- a/src/libslic3r/Config.cpp
+++ b/src/libslic3r/Config.cpp
@@ -735,25 +735,25 @@ double ConfigBase::get_computed_value(const t_config_option_key &opt_key, int ex
}
if (idx >= 0) {
if (raw_opt->type() == coFloats || raw_opt->type() == coInts || raw_opt->type() == coBools)
- return vector_opt->getFloat(extruder_id);
+ return vector_opt->getFloat(idx);
if (raw_opt->type() == coFloatsOrPercents) {
const ConfigOptionFloatsOrPercents* opt_fl_per = static_cast<const ConfigOptionFloatsOrPercents*>(raw_opt);
- if (!opt_fl_per->values[extruder_id].percent)
- return opt_fl_per->values[extruder_id].value;
+ if (!opt_fl_per->values[idx].percent)
+ return opt_fl_per->values[idx].value;
if (opt_def->ratio_over.empty())
- return opt_fl_per->get_abs_value(extruder_id, 1);
+ return opt_fl_per->get_abs_value(idx, 1);
if (opt_def->ratio_over != "depends")
- return opt_fl_per->get_abs_value(extruder_id, this->get_computed_value(opt_def->ratio_over, extruder_id));
+ return opt_fl_per->get_abs_value(idx, this->get_computed_value(opt_def->ratio_over, idx));
std::stringstream ss; ss << "ConfigBase::get_abs_value(): " << opt_key << " has no valid ratio_over to compute of";
throw ConfigurationError(ss.str());
}
if (raw_opt->type() == coPercents) {
const ConfigOptionPercents* opt_per = static_cast<const ConfigOptionPercents*>(raw_opt);
if (opt_def->ratio_over.empty())
- return opt_per->get_abs_value(extruder_id, 1);
+ return opt_per->get_abs_value(idx, 1);
if (opt_def->ratio_over != "depends")
- return opt_per->get_abs_value(extruder_id, this->get_computed_value(opt_def->ratio_over, extruder_id));
+ return opt_per->get_abs_value(idx, this->get_computed_value(opt_def->ratio_over, idx));
std::stringstream ss; ss << "ConfigBase::get_abs_value(): " << opt_key << " has no valid ratio_over to compute of";
throw ConfigurationError(ss.str());
}
diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp
index a5f9e23a9..e69d584e4 100644
--- a/src/libslic3r/PrintConfig.cpp
+++ b/src/libslic3r/PrintConfig.cpp
@@ -659,10 +659,10 @@ void PrintConfigDef::init_fff_params()
def->full_label = L("Default acceleration");
def->tooltip = L("This is the acceleration your printer will be reset to after "
"the role-specific acceleration values are used (perimeter/infill). "
- "\nYou can set it as a % of the max of the X/Y machine acceleration limit."
+ "\nYou can set it as a % of the max of the X machine acceleration limit."
"\nSet zero to prevent resetting acceleration at all.");
def->sidetext = L("mm/s² or %");
- def->ratio_over = "machine_max_acceleration_X";
+ def->ratio_over = "machine_max_acceleration_x";
def->min = 0;
def->max_literal = { -200, false };
def->mode = comExpert;