Refactoring: removed the non-idempotent init_extruders() step. Also, infill_extruder was not limited to the available number of extruders when slicing from the plater, and support material extruder was considered also when support material was disabled

This commit is contained in:
Alessandro Ranellucci 2015-03-06 09:56:58 +01:00
parent a3b843b24e
commit 722e94513c
16 changed files with 83 additions and 84 deletions

View file

@ -79,38 +79,7 @@ class DynamicPrintConfig : public DynamicConfig
this->def = &PrintConfigDef::def;
};
void normalize() {
if (this->has("extruder")) {
int extruder = this->option("extruder")->getInt();
this->erase("extruder");
if (extruder != 0) {
if (!this->has("infill_extruder"))
this->option("infill_extruder", true)->setInt(extruder);
if (!this->has("perimeter_extruder"))
this->option("perimeter_extruder", true)->setInt(extruder);
if (!this->has("support_material_extruder"))
this->option("support_material_extruder", true)->setInt(extruder);
if (!this->has("support_material_interface_extruder"))
this->option("support_material_interface_extruder", true)->setInt(extruder);
}
}
if (!this->has("solid_infill_extruder") && this->has("infill_extruder"))
this->option("solid_infill_extruder", true)->setInt(this->option("infill_extruder")->getInt());
if (this->has("spiral_vase") && this->opt<ConfigOptionBool>("spiral_vase", true)->value) {
{
// this should be actually done only on the spiral layers instead of all
ConfigOptionBools* opt = this->opt<ConfigOptionBools>("retract_layer_change", true);
opt->values.assign(opt->values.size(), false); // set all values to false
}
{
this->opt<ConfigOptionInt>("perimeters", true)->value = 1;
this->opt<ConfigOptionInt>("top_solid_layers", true)->value = 0;
this->opt<ConfigOptionPercent>("fill_density", true)->value = 0;
}
}
};
void normalize();
};
class StaticPrintConfig : public virtual StaticConfig