mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-02 18:00:38 +08:00
Fix acceleration in % of machine_max_acceleration_x
supermerill/SuperSlicer#1829
This commit is contained in:
parent
65bb95cd81
commit
521bd256a9
@ -735,25 +735,25 @@ double ConfigBase::get_computed_value(const t_config_option_key &opt_key, int ex
|
|||||||
}
|
}
|
||||||
if (idx >= 0) {
|
if (idx >= 0) {
|
||||||
if (raw_opt->type() == coFloats || raw_opt->type() == coInts || raw_opt->type() == coBools)
|
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) {
|
if (raw_opt->type() == coFloatsOrPercents) {
|
||||||
const ConfigOptionFloatsOrPercents* opt_fl_per = static_cast<const ConfigOptionFloatsOrPercents*>(raw_opt);
|
const ConfigOptionFloatsOrPercents* opt_fl_per = static_cast<const ConfigOptionFloatsOrPercents*>(raw_opt);
|
||||||
if (!opt_fl_per->values[extruder_id].percent)
|
if (!opt_fl_per->values[idx].percent)
|
||||||
return opt_fl_per->values[extruder_id].value;
|
return opt_fl_per->values[idx].value;
|
||||||
|
|
||||||
if (opt_def->ratio_over.empty())
|
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")
|
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";
|
std::stringstream ss; ss << "ConfigBase::get_abs_value(): " << opt_key << " has no valid ratio_over to compute of";
|
||||||
throw ConfigurationError(ss.str());
|
throw ConfigurationError(ss.str());
|
||||||
}
|
}
|
||||||
if (raw_opt->type() == coPercents) {
|
if (raw_opt->type() == coPercents) {
|
||||||
const ConfigOptionPercents* opt_per = static_cast<const ConfigOptionPercents*>(raw_opt);
|
const ConfigOptionPercents* opt_per = static_cast<const ConfigOptionPercents*>(raw_opt);
|
||||||
if (opt_def->ratio_over.empty())
|
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")
|
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";
|
std::stringstream ss; ss << "ConfigBase::get_abs_value(): " << opt_key << " has no valid ratio_over to compute of";
|
||||||
throw ConfigurationError(ss.str());
|
throw ConfigurationError(ss.str());
|
||||||
}
|
}
|
||||||
|
@ -659,10 +659,10 @@ void PrintConfigDef::init_fff_params()
|
|||||||
def->full_label = L("Default acceleration");
|
def->full_label = L("Default acceleration");
|
||||||
def->tooltip = L("This is the acceleration your printer will be reset to after "
|
def->tooltip = L("This is the acceleration your printer will be reset to after "
|
||||||
"the role-specific acceleration values are used (perimeter/infill). "
|
"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.");
|
"\nSet zero to prevent resetting acceleration at all.");
|
||||||
def->sidetext = L("mm/s² or %");
|
def->sidetext = L("mm/s² or %");
|
||||||
def->ratio_over = "machine_max_acceleration_X";
|
def->ratio_over = "machine_max_acceleration_x";
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->max_literal = { -200, false };
|
def->max_literal = { -200, false };
|
||||||
def->mode = comExpert;
|
def->mode = comExpert;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user