Partial revert of 1bffc2b99b

(deriving the printer technology from the merged configs).
This commit is contained in:
Vojtech Bubnik 2021-01-19 15:17:47 +01:00
parent 7cd218a4ee
commit 2bc6679a62
3 changed files with 26 additions and 26 deletions

View file

@ -3299,15 +3299,20 @@ DynamicPrintConfig* DynamicPrintConfig::new_from_defaults_keys(const std::vector
double min_object_distance(const ConfigBase &cfg)
{
const ConfigOptionEnum<PrinterTechnology> *opt_printer_technology = cfg.option<ConfigOptionEnum<PrinterTechnology>>("printer_technology");
auto printer_technology = opt_printer_technology ? opt_printer_technology->value : ptUnknown;
double ret = 0.;
if (printer_technology(cfg) == ptSLA) ret = 6.;
if (printer_technology == ptSLA)
ret = 6.;
else {
auto ecr_opt = cfg.option<ConfigOptionFloat>("extruder_clearance_radius");
auto dd_opt = cfg.option<ConfigOptionFloat>("duplicate_distance");
auto co_opt = cfg.option<ConfigOptionBool>("complete_objects");
if (!ecr_opt || !dd_opt || !co_opt) ret = 0.;
if (!ecr_opt || !dd_opt || !co_opt)
ret = 0.;
else {
// min object distance is max(duplicate_distance, clearance_radius)
ret = (co_opt->value && ecr_opt->value > dd_opt->value) ?
@ -3318,21 +3323,6 @@ double min_object_distance(const ConfigBase &cfg)
return ret;
}
PrinterTechnology printer_technology(const ConfigBase &cfg)
{
const ConfigOptionEnum<PrinterTechnology> *opt = cfg.option<ConfigOptionEnum<PrinterTechnology>>("printer_technology");
if (opt) return opt->value;
const ConfigOptionBool *export_opt = cfg.option<ConfigOptionBool>("export_sla");
if (export_opt && export_opt->getBool()) return ptSLA;
export_opt = cfg.option<ConfigOptionBool>("export_gcode");
if (export_opt && export_opt->getBool()) return ptFFF;
return ptUnknown;
}
void DynamicPrintConfig::normalize_fdm()
{
if (this->has("extruder")) {