More user-friendly inputs for speed and extrusion width options (explicit "auto" labels instead of having to write 0)

This commit is contained in:
Alessandro Ranellucci 2017-03-05 03:20:39 +01:00
parent abe22fa406
commit 36e148929b
3 changed files with 97 additions and 28 deletions

View File

@ -451,7 +451,7 @@ sub set_value {
package Slic3r::GUI::Tab::Print; package Slic3r::GUI::Tab::Print;
use base 'Slic3r::GUI::Tab'; use base 'Slic3r::GUI::Tab';
use List::Util qw(first); use List::Util qw(first any);
use Wx qw(:icon :dialog :id); use Wx qw(:icon :dialog :id);
sub name { 'print' } sub name { 'print' }
@ -843,6 +843,12 @@ sub _update {
$self->get_field($_)->toggle($have_top_solid_infill) $self->get_field($_)->toggle($have_top_solid_infill)
for qw(top_infill_extrusion_width top_solid_infill_speed); for qw(top_infill_extrusion_width top_solid_infill_speed);
my $have_autospeed = any { $config->get("${_}_speed") eq '0' }
qw(perimeter external_perimeter small_perimeter
infill solid_infill top_solid_infill gap_fill support_material
support_material_interface);
$self->get_field('max_print_speed')->toggle($have_autospeed);
my $have_default_acceleration = $config->default_acceleration > 0; my $have_default_acceleration = $config->default_acceleration > 0;
$self->get_field($_)->toggle($have_default_acceleration) $self->get_field($_)->toggle($have_default_acceleration)
for qw(perimeter_acceleration infill_acceleration bridge_acceleration first_layer_acceleration); for qw(perimeter_acceleration infill_acceleration bridge_acceleration first_layer_acceleration);

View File

@ -569,6 +569,7 @@ class ConfigOptionDef
// The flags may be combined. // The flags may be combined.
// "serialized" - vector valued option is entered in a single edit field. Values are separated by a semicolon. // "serialized" - vector valued option is entered in a single edit field. Values are separated by a semicolon.
// "show_value" - even if enum_values / enum_labels are set, still display the value, not the enum label. // "show_value" - even if enum_values / enum_labels are set, still display the value, not the enum label.
// "align_label_right" - align label to right
std::string gui_flags; std::string gui_flags;
// Label of the GUI input field. // Label of the GUI input field.
// In case the GUI input fields are grouped in some views, the label defines a short label of a grouped value, // In case the GUI input fields are grouped in some views, the label defines a short label of a grouped value,

View File

@ -83,12 +83,15 @@ PrintConfigDef::PrintConfigDef()
def = this->add("bridge_speed", coFloat); def = this->add("bridge_speed", coFloat);
def->label = "Bridges"; def->label = "Bridges";
def->gui_type = "f_enum_open";
def->category = "Speed"; def->category = "Speed";
def->tooltip = "Speed for printing bridges."; def->tooltip = "Speed for printing bridges.";
def->sidetext = "mm/s"; def->sidetext = "mm/s";
def->cli = "bridge-speed=f"; def->cli = "bridge-speed=f";
def->aliases.push_back("bridge_feed_rate"); def->aliases.push_back("bridge_feed_rate");
def->min = 0; def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("auto");
def->default_value = new ConfigOptionFloat(60); def->default_value = new ConfigOptionFloat(60);
def = this->add("brim_connections_width", coFloat); def = this->add("brim_connections_width", coFloat);
@ -183,21 +186,28 @@ PrintConfigDef::PrintConfigDef()
def->default_value = new ConfigOptionEnum<InfillPattern>(ipRectilinear); def->default_value = new ConfigOptionEnum<InfillPattern>(ipRectilinear);
def = this->add("external_perimeter_extrusion_width", coFloatOrPercent); def = this->add("external_perimeter_extrusion_width", coFloatOrPercent);
def->label = "External perimeters"; def->label = "↳ external";
def->gui_type = "f_enum_open";
def->category = "Extrusion Width"; def->category = "Extrusion Width";
def->tooltip = "Set this to a non-zero value to set a manual extrusion width for external perimeters. If left zero, an automatic value will be used that maximizes accuracy of the external visible surfaces. If expressed as percentage (for example 200%) it will be computed over layer height."; def->tooltip = "Set this to a non-zero value to set a manual extrusion width for external perimeters. If auto is chosen, a value will be used that maximizes accuracy of the external visible surfaces. If expressed as percentage (for example 200%) it will be computed over layer height.";
def->sidetext = "mm or % (leave 0 for default)"; def->sidetext = "mm or %";
def->cli = "external-perimeter-extrusion-width=s"; def->cli = "external-perimeter-extrusion-width=s";
def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("auto");
def->default_value = new ConfigOptionFloatOrPercent(0, false); def->default_value = new ConfigOptionFloatOrPercent(0, false);
def = this->add("external_perimeter_speed", coFloatOrPercent); def = this->add("external_perimeter_speed", coFloatOrPercent);
def->label = "External perimeters"; def->label = "↳ external";
def->gui_type = "f_enum_open";
def->category = "Speed"; def->category = "Speed";
def->tooltip = "This separate setting will affect the speed of external perimeters (the visible ones). If expressed as percentage (for example: 80%) it will be calculated on the perimeters speed setting above. Set to zero for auto."; def->tooltip = "This separate setting will affect the speed of external perimeters (the visible ones). If expressed as percentage (for example: 80%) it will be calculated on the perimeters speed setting above.";
def->sidetext = "mm/s or %"; def->sidetext = "mm/s or %";
def->cli = "external-perimeter-speed=s"; def->cli = "external-perimeter-speed=s";
def->ratio_over = "perimeter_speed"; def->ratio_over = "perimeter_speed";
def->min = 0; def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("auto");
def->default_value = new ConfigOptionFloatOrPercent(50, true); def->default_value = new ConfigOptionFloatOrPercent(50, true);
def = this->add("external_perimeters_first", coBool); def = this->add("external_perimeters_first", coBool);
@ -272,10 +282,14 @@ PrintConfigDef::PrintConfigDef()
def = this->add("extrusion_width", coFloatOrPercent); def = this->add("extrusion_width", coFloatOrPercent);
def->label = "Default extrusion width"; def->label = "Default extrusion width";
def->gui_type = "f_enum_open";
def->category = "Extrusion Width"; def->category = "Extrusion Width";
def->tooltip = "Set this to a non-zero value to set a manual extrusion width. If left to zero, Slic3r calculates a width automatically. If expressed as percentage (for example: 230%) it will be computed over layer height."; def->tooltip = "Set this to a non-zero value to set a manual extrusion width. If expressed as percentage (for example: 230%) it will be computed over layer height.";
def->sidetext = "mm or % (leave 0 for auto)"; def->sidetext = "mm or %";
def->cli = "extrusion-width=s"; def->cli = "extrusion-width=s";
def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("auto");
def->default_value = new ConfigOptionFloatOrPercent(0, false); def->default_value = new ConfigOptionFloatOrPercent(0, false);
def = this->add("fan_always_on", coBool); def = this->add("fan_always_on", coBool);
@ -451,11 +465,15 @@ PrintConfigDef::PrintConfigDef()
def = this->add("first_layer_extrusion_width", coFloatOrPercent); def = this->add("first_layer_extrusion_width", coFloatOrPercent);
def->label = "First layer"; def->label = "First layer";
def->gui_type = "f_enum_open";
def->category = "Extrusion Width"; def->category = "Extrusion Width";
def->tooltip = "Set this to a non-zero value to set a manual extrusion width for first layer. You can use this to force fatter extrudates for better adhesion. If expressed as percentage (for example 120%) it will be computed over first layer height. If set to zero, it will use the Default Extrusion Width."; def->tooltip = "Set this to a non-zero value to set a manual extrusion width for first layer. You can use this to force fatter extrudates for better adhesion. If expressed as percentage (for example 120%) it will be computed over first layer height.";
def->sidetext = "mm or % (leave 0 for default)"; def->sidetext = "mm or %";
def->cli = "first-layer-extrusion-width=s"; def->cli = "first-layer-extrusion-width=s";
def->ratio_over = "first_layer_height"; def->ratio_over = "first_layer_height";
def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("default");
def->default_value = new ConfigOptionFloatOrPercent(200, true); def->default_value = new ConfigOptionFloatOrPercent(200, true);
def = this->add("first_layer_height", coFloatOrPercent); def = this->add("first_layer_height", coFloatOrPercent);
@ -488,13 +506,16 @@ PrintConfigDef::PrintConfigDef()
} }
def = this->add("gap_fill_speed", coFloat); def = this->add("gap_fill_speed", coFloat);
def->label = "Gap fill"; def->label = "↳ gaps";
def->gui_type = "f_enum_open";
def->category = "Speed"; def->category = "Speed";
def->tooltip = "Speed for filling gaps. Since these are usually single lines you might want to use a low speed for better sticking. If expressed as percentage (for example: 80%) it will be calculated on the infill speed setting above. Set zero for auto."; def->tooltip = "Speed for filling gaps. Since these are usually single lines you might want to use a low speed for better sticking. If expressed as percentage (for example: 80%) it will be calculated on the infill speed setting above.";
def->sidetext = "mm/s or %"; def->sidetext = "mm/s or %";
def->cli = "gap-fill-speed=s"; def->cli = "gap-fill-speed=s";
def->ratio_over = "infill_speed"; def->ratio_over = "infill_speed";
def->min = 0; def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("auto");
def->default_value = new ConfigOptionFloat(20); def->default_value = new ConfigOptionFloat(20);
def = this->add("gcode_arcs", coBool); def = this->add("gcode_arcs", coBool);
@ -562,10 +583,14 @@ PrintConfigDef::PrintConfigDef()
def = this->add("infill_extrusion_width", coFloatOrPercent); def = this->add("infill_extrusion_width", coFloatOrPercent);
def->label = "Infill"; def->label = "Infill";
def->gui_type = "f_enum_open";
def->category = "Extrusion Width"; def->category = "Extrusion Width";
def->tooltip = "Set this to a non-zero value to set a manual extrusion width for infill. You may want to use fatter extrudates to speed up the infill and make your parts stronger. If expressed as percentage (for example 90%) it will be computed over layer height."; def->tooltip = "Set this to a non-zero value to set a manual extrusion width for infill. You may want to use fatter extrudates to speed up the infill and make your parts stronger. If expressed as percentage (for example 90%) it will be computed over layer height.";
def->sidetext = "mm or % (leave 0 for default)"; def->sidetext = "mm or %";
def->cli = "infill-extrusion-width=s"; def->cli = "infill-extrusion-width=s";
def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("default");
def->default_value = new ConfigOptionFloatOrPercent(0, false); def->default_value = new ConfigOptionFloatOrPercent(0, false);
def = this->add("infill_first", coBool); def = this->add("infill_first", coBool);
@ -592,13 +617,16 @@ PrintConfigDef::PrintConfigDef()
def = this->add("infill_speed", coFloat); def = this->add("infill_speed", coFloat);
def->label = "Infill"; def->label = "Infill";
def->gui_type = "f_enum_open";
def->category = "Speed"; def->category = "Speed";
def->tooltip = "Speed for printing the internal fill. Set to zero for auto."; def->tooltip = "Speed for printing the internal fill.";
def->sidetext = "mm/s"; def->sidetext = "mm/s";
def->cli = "infill-speed=f"; def->cli = "infill-speed=f";
def->aliases.push_back("print_feed_rate"); def->aliases.push_back("print_feed_rate");
def->aliases.push_back("infill_feed_rate"); def->aliases.push_back("infill_feed_rate");
def->min = 0; def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("auto");
def->default_value = new ConfigOptionFloat(80); def->default_value = new ConfigOptionFloat(80);
def = this->add("interface_shells", coBool); def = this->add("interface_shells", coBool);
@ -752,21 +780,28 @@ PrintConfigDef::PrintConfigDef()
def = this->add("perimeter_extrusion_width", coFloatOrPercent); def = this->add("perimeter_extrusion_width", coFloatOrPercent);
def->label = "Perimeters"; def->label = "Perimeters";
def->gui_type = "f_enum_open";
def->category = "Extrusion Width"; def->category = "Extrusion Width";
def->tooltip = "Set this to a non-zero value to set a manual extrusion width for perimeters. You may want to use thinner extrudates to get more accurate surfaces. If expressed as percentage (for example 200%) it will be computed over layer height."; def->tooltip = "Set this to a non-zero value to set a manual extrusion width for perimeters. You may want to use thinner extrudates to get more accurate surfaces. If expressed as percentage (for example 200%) it will be computed over layer height.";
def->sidetext = "mm or % (leave 0 for default)"; def->sidetext = "mm or %";
def->cli = "perimeter-extrusion-width=s"; def->cli = "perimeter-extrusion-width=s";
def->aliases.push_back("perimeters_extrusion_width"); def->aliases.push_back("perimeters_extrusion_width");
def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("default");
def->default_value = new ConfigOptionFloatOrPercent(0, false); def->default_value = new ConfigOptionFloatOrPercent(0, false);
def = this->add("perimeter_speed", coFloat); def = this->add("perimeter_speed", coFloat);
def->label = "Perimeters"; def->label = "Perimeters";
def->gui_type = "f_enum_open";
def->category = "Speed"; def->category = "Speed";
def->tooltip = "Speed for perimeters (contours, aka vertical shells). Set to zero for auto."; def->tooltip = "Speed for perimeters (contours, aka vertical shells).";
def->sidetext = "mm/s"; def->sidetext = "mm/s";
def->cli = "perimeter-speed=f"; def->cli = "perimeter-speed=f";
def->aliases.push_back("perimeter_feed_rate"); def->aliases.push_back("perimeter_feed_rate");
def->min = 0; def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("auto");
def->default_value = new ConfigOptionFloat(60); def->default_value = new ConfigOptionFloat(60);
def = this->add("perimeters", coInt); def = this->add("perimeters", coInt);
@ -1012,13 +1047,16 @@ PrintConfigDef::PrintConfigDef()
def->default_value = new ConfigOptionInt(5); def->default_value = new ConfigOptionInt(5);
def = this->add("small_perimeter_speed", coFloatOrPercent); def = this->add("small_perimeter_speed", coFloatOrPercent);
def->label = "Small perimeters"; def->label = "↳ small";
def->gui_type = "f_enum_open";
def->category = "Speed"; def->category = "Speed";
def->tooltip = "This separate setting will affect the speed of perimeters having radius <= 6.5mm (usually holes). If expressed as percentage (for example: 80%) it will be calculated on the perimeters speed setting above. Set to zero for auto."; def->tooltip = "This separate setting will affect the speed of perimeters having radius <= 6.5mm (usually holes). If expressed as percentage (for example: 80%) it will be calculated on the perimeters speed setting above.";
def->sidetext = "mm/s or %"; def->sidetext = "mm/s or %";
def->cli = "small-perimeter-speed=s"; def->cli = "small-perimeter-speed=s";
def->ratio_over = "perimeter_speed"; def->ratio_over = "perimeter_speed";
def->min = 0; def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("auto");
def->default_value = new ConfigOptionFloatOrPercent(15, false); def->default_value = new ConfigOptionFloatOrPercent(15, false);
def = this->add("solid_infill_below_area", coFloat); def = this->add("solid_infill_below_area", coFloat);
@ -1048,22 +1086,29 @@ PrintConfigDef::PrintConfigDef()
def->default_value = new ConfigOptionInt(0); def->default_value = new ConfigOptionInt(0);
def = this->add("solid_infill_extrusion_width", coFloatOrPercent); def = this->add("solid_infill_extrusion_width", coFloatOrPercent);
def->label = "Solid infill"; def->label = "↳ solid";
def->gui_type = "f_enum_open";
def->category = "Extrusion Width"; def->category = "Extrusion Width";
def->tooltip = "Set this to a non-zero value to set a manual extrusion width for infill for solid surfaces. If expressed as percentage (for example 90%) it will be computed over layer height."; def->tooltip = "Set this to a non-zero value to set a manual extrusion width for infill for solid surfaces. If expressed as percentage (for example 90%) it will be computed over layer height.";
def->sidetext = "mm or % (leave 0 for default)"; def->sidetext = "mm or %";
def->cli = "solid-infill-extrusion-width=s"; def->cli = "solid-infill-extrusion-width=s";
def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("default");
def->default_value = new ConfigOptionFloatOrPercent(0, false); def->default_value = new ConfigOptionFloatOrPercent(0, false);
def = this->add("solid_infill_speed", coFloatOrPercent); def = this->add("solid_infill_speed", coFloatOrPercent);
def->label = "Solid infill"; def->label = "↳ solid";
def->gui_type = "f_enum_open";
def->category = "Speed"; def->category = "Speed";
def->tooltip = "Speed for printing solid regions (top/bottom/internal horizontal shells). This can be expressed as a percentage (for example: 80%) over the default infill speed above. Set to zero for auto."; def->tooltip = "Speed for printing solid regions (top/bottom/internal horizontal shells). This can be expressed as a percentage (for example: 80%) over the default infill speed above.";
def->sidetext = "mm/s or %"; def->sidetext = "mm/s or %";
def->cli = "solid-infill-speed=s"; def->cli = "solid-infill-speed=s";
def->ratio_over = "infill_speed"; def->ratio_over = "infill_speed";
def->aliases.push_back("solid_infill_feed_rate"); def->aliases.push_back("solid_infill_feed_rate");
def->min = 0; def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("auto");
def->default_value = new ConfigOptionFloatOrPercent(20, false); def->default_value = new ConfigOptionFloatOrPercent(20, false);
def = this->add("solid_layers", coInt); def = this->add("solid_layers", coInt);
@ -1149,10 +1194,14 @@ PrintConfigDef::PrintConfigDef()
def = this->add("support_material_extrusion_width", coFloatOrPercent); def = this->add("support_material_extrusion_width", coFloatOrPercent);
def->label = "Support material"; def->label = "Support material";
def->gui_type = "f_enum_open";
def->category = "Extrusion Width"; def->category = "Extrusion Width";
def->tooltip = "Set this to a non-zero value to set a manual extrusion width for support material. If expressed as percentage (for example 90%) it will be computed over layer height."; def->tooltip = "Set this to a non-zero value to set a manual extrusion width for support material. If expressed as percentage (for example 90%) it will be computed over layer height.";
def->sidetext = "mm or % (leave 0 for default)"; def->sidetext = "mm or %";
def->cli = "support-material-extrusion-width=s"; def->cli = "support-material-extrusion-width=s";
def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("default");
def->default_value = new ConfigOptionFloatOrPercent(0, false); def->default_value = new ConfigOptionFloatOrPercent(0, false);
def = this->add("support_material_interface_extruder", coInt); def = this->add("support_material_interface_extruder", coInt);
@ -1182,13 +1231,16 @@ PrintConfigDef::PrintConfigDef()
def->default_value = new ConfigOptionFloat(0); def->default_value = new ConfigOptionFloat(0);
def = this->add("support_material_interface_speed", coFloatOrPercent); def = this->add("support_material_interface_speed", coFloatOrPercent);
def->label = "Support material interface"; def->label = "↳ interface";
def->gui_type = "f_enum_open";
def->category = "Support material"; def->category = "Support material";
def->tooltip = "Speed for printing support material interface layers. If expressed as percentage (for example 50%) it will be calculated over support material speed."; def->tooltip = "Speed for printing support material interface layers. If expressed as percentage (for example 50%) it will be calculated over support material speed.";
def->sidetext = "mm/s or %"; def->sidetext = "mm/s or %";
def->cli = "support-material-interface-speed=s"; def->cli = "support-material-interface-speed=s";
def->ratio_over = "support_material_speed"; def->ratio_over = "support_material_speed";
def->min = 0; def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("auto");
def->default_value = new ConfigOptionFloatOrPercent(100, true); def->default_value = new ConfigOptionFloatOrPercent(100, true);
def = this->add("support_material_pattern", coEnum); def = this->add("support_material_pattern", coEnum);
@ -1218,11 +1270,14 @@ PrintConfigDef::PrintConfigDef()
def = this->add("support_material_speed", coFloat); def = this->add("support_material_speed", coFloat);
def->label = "Support material"; def->label = "Support material";
def->gui_type = "f_enum_open";
def->category = "Support material"; def->category = "Support material";
def->tooltip = "Speed for printing support material."; def->tooltip = "Speed for printing support material.";
def->sidetext = "mm/s"; def->sidetext = "mm/s";
def->cli = "support-material-speed=f"; def->cli = "support-material-speed=f";
def->min = 0; def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("auto");
def->default_value = new ConfigOptionFloat(60); def->default_value = new ConfigOptionFloat(60);
def = this->add("support_material_threshold", coInt); def = this->add("support_material_threshold", coInt);
@ -1276,21 +1331,28 @@ PrintConfigDef::PrintConfigDef()
def->default_value = new ConfigOptionString(""); def->default_value = new ConfigOptionString("");
def = this->add("top_infill_extrusion_width", coFloatOrPercent); def = this->add("top_infill_extrusion_width", coFloatOrPercent);
def->label = "Top solid infill"; def->label = "↳ top solid";
def->gui_type = "f_enum_open";
def->category = "Extrusion Width"; def->category = "Extrusion Width";
def->tooltip = "Set this to a non-zero value to set a manual extrusion width for infill for top surfaces. You may want to use thinner extrudates to fill all narrow regions and get a smoother finish. If expressed as percentage (for example 90%) it will be computed over layer height."; def->tooltip = "Set this to a non-zero value to set a manual extrusion width for infill for top surfaces. You may want to use thinner extrudates to fill all narrow regions and get a smoother finish. If expressed as percentage (for example 90%) it will be computed over layer height.";
def->sidetext = "mm or % (leave 0 for default)"; def->sidetext = "mm or %";
def->cli = "top-infill-extrusion-width=s"; def->cli = "top-infill-extrusion-width=s";
def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("default");
def->default_value = new ConfigOptionFloatOrPercent(0, false); def->default_value = new ConfigOptionFloatOrPercent(0, false);
def = this->add("top_solid_infill_speed", coFloatOrPercent); def = this->add("top_solid_infill_speed", coFloatOrPercent);
def->label = "Top solid infill"; def->label = "↳ top solid";
def->gui_type = "f_enum_open";
def->category = "Speed"; def->category = "Speed";
def->tooltip = "Speed for printing top solid layers (it only applies to the uppermost external layers and not to their internal solid layers). You may want to slow down this to get a nicer surface finish. This can be expressed as a percentage (for example: 80%) over the solid infill speed above. Set to zero for auto."; def->tooltip = "Speed for printing top solid layers (it only applies to the uppermost external layers and not to their internal solid layers). You may want to slow down this to get a nicer surface finish. This can be expressed as a percentage (for example: 80%) over the solid infill speed above.";
def->sidetext = "mm/s or %"; def->sidetext = "mm/s or %";
def->cli = "top-solid-infill-speed=s"; def->cli = "top-solid-infill-speed=s";
def->ratio_over = "solid_infill_speed"; def->ratio_over = "solid_infill_speed";
def->min = 0; def->min = 0;
def->enum_values.push_back("0");
def->enum_labels.push_back("auto");
def->default_value = new ConfigOptionFloatOrPercent(15, false); def->default_value = new ConfigOptionFloatOrPercent(15, false);
def = this->add("top_solid_layers", coInt); def = this->add("top_solid_layers", coInt);