Put the Default Extruder option in a less confusing position

This commit is contained in:
Alessandro Ranellucci 2014-06-19 20:07:16 +02:00
parent 4bf23c67bb
commit b9e8fbacb7
7 changed files with 132 additions and 40 deletions

View file

@ -432,6 +432,8 @@ class ConfigOptionDef
{
public:
ConfigOptionType type;
std::string gui_type;
std::string gui_flags;
std::string label;
std::string full_label;
std::string category;

View file

@ -144,11 +144,17 @@ PrintConfigDef::build_def() {
Options["extra_perimeters"].cli = "extra-perimeters!";
Options["extruder"].type = coInt;
Options["extruder"].label = "Default extruder";
Options["extruder"].gui_type = "i_enum_open";
Options["extruder"].label = "Extruder";
Options["extruder"].category = "Extruders";
Options["extruder"].tooltip = "The extruder to use (unless more specific extruder settings are specified).";
Options["extruder"].cli = "extruder=i";
Options["extruder"].min = 1;
Options["extruder"].min = 0; // 0 = inherit defaults
Options["extruder"].enum_labels.push_back("default"); // override label for item 0
Options["extruder"].enum_labels.push_back("1");
Options["extruder"].enum_labels.push_back("2");
Options["extruder"].enum_labels.push_back("3");
Options["extruder"].enum_labels.push_back("4");
Options["extruder_clearance_height"].type = coFloat;
Options["extruder_clearance_height"].label = "Height";
@ -218,6 +224,8 @@ PrintConfigDef::build_def() {
Options["fill_angle"].max = 359;
Options["fill_density"].type = coPercent;
Options["fill_density"].gui_type = "i_enum_open";
Options["fill_density"].gui_flags = "show_value";
Options["fill_density"].label = "Fill density";
Options["fill_density"].category = "Infill";
Options["fill_density"].tooltip = "Density of internal infill, expressed in the range 0% - 100%.";

View file

@ -81,14 +81,16 @@ class DynamicPrintConfig : public DynamicConfig
if (this->has("extruder")) {
int extruder = this->option("extruder")->getInt();
this->erase("extruder");
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 (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("spiral_vase") && this->opt<ConfigOptionBool>("spiral_vase", true)->value) {
{

View file

@ -154,6 +154,8 @@ print_config_def()
throw "Unknown option type";
}
(void)hv_stores( hv, "type", newSVpv(opt_type, 0) );
(void)hv_stores( hv, "gui_type", newSVpvn(optdef->gui_type.c_str(), optdef->gui_type.length()) );
(void)hv_stores( hv, "gui_flags", newSVpvn(optdef->gui_flags.c_str(), optdef->gui_flags.length()) );
(void)hv_stores( hv, "label", newSVpvn_utf8(optdef->label.c_str(), optdef->label.length(), true) );
if (!optdef->full_label.empty())
(void)hv_stores( hv, "full_label", newSVpvn_utf8(optdef->full_label.c_str(), optdef->full_label.length(), true) );