#192 make percentage value-only percent-only like for infill ratio.

note: added some code to migrate automatically from float (0.9) to percent (90%). The reverse should not be a problem.
fields: bridge_flow_ratio over_bridge_flow_ratio bridge_overlap fill_top_flow_ratio first_layer_flow_ratio
This commit is contained in:
supermerill 2020-04-17 19:20:58 +02:00
parent e28213b6eb
commit a6b055b484
9 changed files with 112 additions and 51 deletions

View File

@ -30,7 +30,7 @@ default_materials = Generic PLA @BIBO2; Generic PETG @BIBO2; Generic ABS @BIBO2;
avoid_crossing_perimeters = 0 avoid_crossing_perimeters = 0
bottom_fill_pattern = rectilinear bottom_fill_pattern = rectilinear
bridge_angle = 0 bridge_angle = 0
bridge_flow_ratio = 0.95 bridge_flow_ratio = 95%
bridge_speed = 25 bridge_speed = 25
brim_width = 0 brim_width = 0
clip_multipart_objects = 1 clip_multipart_objects = 1
@ -125,7 +125,7 @@ xy_size_compensation = 0
inherits = *common* inherits = *common*
bottom_solid_layers = 10 bottom_solid_layers = 10
bridge_acceleration = 300 bridge_acceleration = 300
bridge_flow_ratio = 0.7 bridge_flow_ratio = 70%
default_acceleration = 500 default_acceleration = 500
external_perimeter_speed = 20 external_perimeter_speed = 20
fill_density = 20% fill_density = 20%
@ -150,7 +150,7 @@ top_solid_layers = 15
inherits = *common* inherits = *common*
bottom_solid_layers = 8 bottom_solid_layers = 8
bridge_acceleration = 300 bridge_acceleration = 300
bridge_flow_ratio = 0.7 bridge_flow_ratio = 70%
bridge_speed = 20 bridge_speed = 20
default_acceleration = 1000 default_acceleration = 1000
external_perimeter_speed = 20 external_perimeter_speed = 20
@ -175,7 +175,7 @@ top_solid_layers = 11
[print:*0.10mm*] [print:*0.10mm*]
inherits = *common* inherits = *common*
bottom_solid_layers = 7 bottom_solid_layers = 7
bridge_flow_ratio = 0.7 bridge_flow_ratio = 70%
layer_height = 0.1 layer_height = 0.1
perimeter_acceleration = 800 perimeter_acceleration = 800
top_solid_layers = 9 top_solid_layers = 9
@ -241,7 +241,7 @@ top_solid_layers = 4
[print:*0.30mm*] [print:*0.30mm*]
inherits = *common* inherits = *common*
bottom_solid_layers = 4 bottom_solid_layers = 4
bridge_flow_ratio = 0.95 bridge_flow_ratio = 95%
external_perimeter_speed = 40 external_perimeter_speed = 40
infill_acceleration = 1100 infill_acceleration = 1100
infill_speed = 60 infill_speed = 60

View File

@ -406,7 +406,7 @@ inherits = *common*
bottom_solid_layers = 7 bottom_solid_layers = 7
top_solid_layers = 9 top_solid_layers = 9
layer_height = 0.08 layer_height = 0.08
bridge_flow_ratio = 0.7 bridge_flow_ratio = 70%
perimeter_acceleration = 400 perimeter_acceleration = 400
[print:*0.16mm*] [print:*0.16mm*]
@ -414,7 +414,7 @@ inherits = *common*
bottom_solid_layers = 5 bottom_solid_layers = 5
top_solid_layers = 6 top_solid_layers = 6
layer_height = 0.16 layer_height = 0.16
bridge_flow_ratio = 0.9 bridge_flow_ratio = 90%
[print:*0.24mm*] [print:*0.24mm*]
@ -422,21 +422,21 @@ inherits = *common*
bottom_solid_layers = 4 bottom_solid_layers = 4
top_solid_layers = 5 top_solid_layers = 5
layer_height = 0.24 layer_height = 0.24
bridge_flow_ratio = 0.9 bridge_flow_ratio = 90%
[print:*0.32mm*] [print:*0.32mm*]
inherits = *common* inherits = *common*
bottom_solid_layers = 3 bottom_solid_layers = 3
top_solid_layers = 4 top_solid_layers = 4
layer_height = 0.32 layer_height = 0.32
bridge_flow_ratio = 0.9 bridge_flow_ratio = 90%
[print:*0.48mm*] [print:*0.48mm*]
inherits = *common* inherits = *common*
bottom_solid_layers = 2 bottom_solid_layers = 2
top_solid_layers = 3 top_solid_layers = 3
layer_height = 0.48 layer_height = 0.48
bridge_flow_ratio = 0.9 bridge_flow_ratio = 90%
[print:*0.05mm*] [print:*0.05mm*]

View File

@ -286,8 +286,8 @@ inherits = *CR-10S5*; *0.8nozzle*
avoid_crossing_perimeters = 0 avoid_crossing_perimeters = 0
bridge_acceleration = 1000 bridge_acceleration = 1000
bridge_angle = 0 bridge_angle = 0
bridge_flow_ratio = 0.8 bridge_flow_ratio = 80%
over_bridge_flow_ratio = 1.1 over_bridge_flow_ratio = 110%
fill_top_flow_ratio = 100% fill_top_flow_ratio = 100%
bottom_fill_pattern = rectilineargapfill bottom_fill_pattern = rectilineargapfill
bridge_speed = 20 bridge_speed = 20
@ -445,7 +445,7 @@ inherits = *common*
bottom_solid_layers = 7 bottom_solid_layers = 7
top_solid_layers = 9 top_solid_layers = 9
layer_height = 0.08 layer_height = 0.08
bridge_flow_ratio = 0.7 bridge_flow_ratio = 70%
perimeter_acceleration = 400 perimeter_acceleration = 400
[print:*0.16mm*] [print:*0.16mm*]
@ -453,7 +453,7 @@ inherits = *common*
bottom_solid_layers = 5 bottom_solid_layers = 5
top_solid_layers = 6 top_solid_layers = 6
layer_height = 0.16 layer_height = 0.16
bridge_flow_ratio = 0.8 bridge_flow_ratio = 80%
[print:*0.24mm*] [print:*0.24mm*]
@ -461,21 +461,21 @@ inherits = *common*
bottom_solid_layers = 4 bottom_solid_layers = 4
top_solid_layers = 5 top_solid_layers = 5
layer_height = 0.24 layer_height = 0.24
bridge_flow_ratio = 0.9 bridge_flow_ratio = 90%
[print:*0.32mm*] [print:*0.32mm*]
inherits = *common* inherits = *common*
bottom_solid_layers = 3 bottom_solid_layers = 3
top_solid_layers = 4 top_solid_layers = 4
layer_height = 0.32 layer_height = 0.32
bridge_flow_ratio = 0.9 bridge_flow_ratio = 90%
[print:*0.48mm*] [print:*0.48mm*]
inherits = *common* inherits = *common*
bottom_solid_layers = 2 bottom_solid_layers = 2
top_solid_layers = 3 top_solid_layers = 3
layer_height = 0.48 layer_height = 0.48
bridge_flow_ratio = 0.9 bridge_flow_ratio = 90%
[print:0.08mm DETAIL 0.2 nozzle] [print:0.08mm DETAIL 0.2 nozzle]
inherits = *0.08mm*; *0.2nozzle* inherits = *0.08mm*; *0.2nozzle*

View File

@ -26,7 +26,7 @@ bottom_fill_pattern = rectilinear
bottom_solid_layers = 3 bottom_solid_layers = 3
bridge_acceleration = 500 bridge_acceleration = 500
bridge_angle = 0 bridge_angle = 0
bridge_flow_ratio = 1 bridge_flow_ratio = 100%
bridge_speed = 30 bridge_speed = 30
brim_width = 0 brim_width = 0
clip_multipart_objects = 0 clip_multipart_objects = 0

View File

@ -377,7 +377,7 @@ perimeter_extrusion_width = 0.65
solid_infill_extrusion_width = 0.65 solid_infill_extrusion_width = 0.65
top_infill_extrusion_width = 0.6 top_infill_extrusion_width = 0.6
support_material_extrusion_width = 0.55 support_material_extrusion_width = 0.55
bridge_flow_ratio = 0.95 bridge_flow_ratio = 95%
bridge_speed = 25 bridge_speed = 25
support_material_contact_distance = 0.15 support_material_contact_distance = 0.15
support_material_xy_spacing = 80% support_material_xy_spacing = 80%
@ -392,7 +392,7 @@ perimeter_extrusion_width = 0.65
solid_infill_extrusion_width = 0.68 solid_infill_extrusion_width = 0.68
top_infill_extrusion_width = 0.6 top_infill_extrusion_width = 0.6
support_material_extrusion_width = 0.55 support_material_extrusion_width = 0.55
bridge_flow_ratio = 0.95 bridge_flow_ratio = 95%
bridge_speed = 25 bridge_speed = 25
support_material_contact_distance = 0.15 support_material_contact_distance = 0.15
support_material_xy_spacing = 80% support_material_xy_spacing = 80%
@ -432,7 +432,7 @@ support_material_interface_speed = 80%
inherits = *common* inherits = *common*
bottom_solid_layers = 10 bottom_solid_layers = 10
bridge_acceleration = 300 bridge_acceleration = 300
bridge_flow_ratio = 0.7 bridge_flow_ratio = 70%
default_acceleration = 1000 default_acceleration = 1000
external_perimeter_speed = 20 external_perimeter_speed = 20
fill_density = 20% fill_density = 20%
@ -497,7 +497,7 @@ fill_density = 20%
inherits = *common* inherits = *common*
bottom_solid_layers = 8 bottom_solid_layers = 8
bridge_acceleration = 300 bridge_acceleration = 300
bridge_flow_ratio = 0.7 bridge_flow_ratio = 70%
bridge_speed = 20 bridge_speed = 20
default_acceleration = 1000 default_acceleration = 1000
external_perimeter_speed = 20 external_perimeter_speed = 20
@ -546,7 +546,7 @@ fill_density = 20%
[print:*0.10mm*] [print:*0.10mm*]
inherits = *common* inherits = *common*
bottom_solid_layers = 7 bottom_solid_layers = 7
bridge_flow_ratio = 0.7 bridge_flow_ratio = 70%
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK2.*/ and nozzle_diameter[0]==0.4 and num_extruders==1 compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK2.*/ and nozzle_diameter[0]==0.4 and num_extruders==1
layer_height = 0.1 layer_height = 0.1
perimeter_acceleration = 800 perimeter_acceleration = 800
@ -623,7 +623,7 @@ top_solid_layers = 7
# MK2 # # MK2 #
[print:0.15mm 100mms Linear Advance] [print:0.15mm 100mms Linear Advance]
inherits = *0.15mm* inherits = *0.15mm*
bridge_flow_ratio = 0.95 bridge_flow_ratio = 95%
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK2[^\.].*/ and nozzle_diameter[0]==0.4 compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK2[^\.].*/ and nozzle_diameter[0]==0.4
external_perimeter_speed = 50 external_perimeter_speed = 50
infill_speed = 100 infill_speed = 100
@ -646,7 +646,7 @@ top_infill_extrusion_width = 0.45
inherits = *0.15mm*; *0.25nozzle* inherits = *0.15mm*; *0.25nozzle*
# alias = 0.15mm OPTIMAL # alias = 0.15mm OPTIMAL
bridge_acceleration = 600 bridge_acceleration = 600
bridge_flow_ratio = 0.7 bridge_flow_ratio = 70%
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK2.*/ and nozzle_diameter[0]==0.25 compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK2.*/ and nozzle_diameter[0]==0.25
external_perimeter_speed = 20 external_perimeter_speed = 20
infill_acceleration = 1000 infill_acceleration = 1000
@ -764,7 +764,7 @@ top_solid_infill_speed = 45
[print:*0.20mm*] [print:*0.20mm*]
inherits = *common* inherits = *common*
bottom_solid_layers = 4 bottom_solid_layers = 4
bridge_flow_ratio = 0.95 bridge_flow_ratio = 95%
external_perimeter_speed = 40 external_perimeter_speed = 40
infill_acceleration = 2000 infill_acceleration = 2000
infill_speed = 60 infill_speed = 60
@ -890,7 +890,7 @@ top_solid_infill_speed = 45
[print:*0.25mm*] [print:*0.25mm*]
inherits = *common* inherits = *common*
bottom_solid_layers = 4 bottom_solid_layers = 4
bridge_flow_ratio = 0.95 bridge_flow_ratio = 95%
external_perimeter_speed = 40 external_perimeter_speed = 40
perimeter_acceleration = 800 perimeter_acceleration = 800
layer_height = 0.25 layer_height = 0.25
@ -904,7 +904,7 @@ top_solid_layers = 4
[print:*0.30mm*] [print:*0.30mm*]
inherits = *common* inherits = *common*
bottom_solid_layers = 4 bottom_solid_layers = 4
bridge_flow_ratio = 0.95 bridge_flow_ratio = 95%
external_perimeter_speed = 40 external_perimeter_speed = 40
infill_acceleration = 2000 infill_acceleration = 2000
infill_speed = 60 infill_speed = 60
@ -998,7 +998,7 @@ top_solid_layers = 4
# MK2 # # MK2 #
[print:0.35mm FAST] [print:0.35mm FAST]
inherits = *0.35mm* inherits = *0.35mm*
bridge_flow_ratio = 0.95 bridge_flow_ratio = 95%
compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK2[^\.].*/ and nozzle_diameter[0]==0.4 compatible_printers_condition = printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/ and printer_notes=~/.*PRINTER_MODEL_MK2[^\.].*/ and nozzle_diameter[0]==0.4
first_layer_extrusion_width = 0.42 first_layer_extrusion_width = 0.42
perimeter_extrusion_width = 0.43 perimeter_extrusion_width = 0.43
@ -1245,7 +1245,7 @@ solid_infill_speed = 80
top_solid_infill_speed = 40 top_solid_infill_speed = 40
fill_pattern = gyroid fill_pattern = gyroid
fill_density = 15% fill_density = 15%
bridge_flow_ratio = 0.85 bridge_flow_ratio = 85%
support_material_xy_spacing = 60% support_material_xy_spacing = 60%
[print:0.15mm SPEED @MINI] [print:0.15mm SPEED @MINI]
@ -1258,7 +1258,7 @@ external_perimeter_speed = 40
infill_speed = 140 infill_speed = 140
solid_infill_speed = 140 solid_infill_speed = 140
top_solid_infill_speed = 40 top_solid_infill_speed = 40
bridge_flow_ratio = 0.85 bridge_flow_ratio = 85%
support_material_xy_spacing = 60% support_material_xy_spacing = 60%
[print:0.20mm QUALITY @MINI] [print:0.20mm QUALITY @MINI]

View File

@ -123,7 +123,7 @@ enum ConfigOptionType {
coString = 3, coString = 3,
// vector of strings // vector of strings
coStrings = coString + coVectorType, coStrings = coString + coVectorType,
// percent value. Currently only used for infill. // percent value. Currently only used for infill & flow ratio.
coPercent = 4, coPercent = 4,
// percents value. Currently used for retract before wipe only. // percents value. Currently used for retract before wipe only.
coPercents = coPercent + coVectorType, coPercents = coPercent + coVectorType,

View File

@ -247,38 +247,43 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionInts{ 100 }); def->set_default_value(new ConfigOptionInts{ 100 });
def = this->add("bridge_flow_ratio", coFloatOrPercent); def = this->add("bridge_flow_ratio", coPercent);
def->label = L("Bridge"); def->label = L("Bridge");
def->full_label = L("Bridge flow ratio"); def->full_label = L("Bridge flow ratio");
def->sidetext = L("%");
def->category = OptionCategory::width; def->category = OptionCategory::width;
def->tooltip = L("This factor affects the amount of plastic for bridging. " def->tooltip = L("This factor affects the amount of plastic for bridging. "
"You can decrease it slightly to pull the extrudates and prevent sagging, " "You can decrease it slightly to pull the extrudates and prevent sagging, "
"although default settings are usually good and you should experiment " "although default settings are usually good and you should experiment "
"with cooling (use a fan) before tweaking this."); "with cooling (use a fan) before tweaking this.");
def->min = 0; def->min = 1;
def->max = 2; def->max = 200;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); def->set_default_value(new ConfigOptionPercent(100));
def = this->add("over_bridge_flow_ratio", coFloatOrPercent); def = this->add("over_bridge_flow_ratio", coPercent);
def->label = L("Above the bridges"); def->label = L("Above the bridges");
def->full_label = L("Above bridge flow ratio"); def->full_label = L("Above bridge flow ratio");
def->sidetext = L("%");
def->category = OptionCategory::width; def->category = OptionCategory::width;
def->tooltip = L("Flow ratio to compensate for the gaps in a bridged top surface. Used for ironing infill" def->tooltip = L("Flow ratio to compensate for the gaps in a bridged top surface. Used for ironing infill"
"pattern to prevent regions where the low-flow pass does not provide a smooth surface due to a lack of plastic." "pattern to prevent regions where the low-flow pass does not provide a smooth surface due to a lack of plastic."
" You can increase it slightly to pull the top layer at the correct height. Recommended maximum: 120%."); " You can increase it slightly to pull the top layer at the correct height. Recommended maximum: 120%.");
def->min = 0; def->min = 1;
def->max = 200;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); def->set_default_value(new ConfigOptionPercent(100));
def = this->add("bridge_overlap", coFloatOrPercent); def = this->add("bridge_overlap", coPercent);
def->label = L("Bridge overlap"); def->label = L("Bridge overlap");
def->full_label = L("Bridge overlap"); def->full_label = L("Bridge overlap");
def->sidetext = L("%");
def->category = OptionCategory::width; def->category = OptionCategory::width;
def->tooltip = L("Amount of overlap between lines of the bridge. If your bridge flow ratio is low, it may be useful to increaase this setting to let lines touch each other. Default to 100%. A value of 200% will create two times more lines."); def->tooltip = L("Amount of overlap between lines of the bridge. If your bridge flow ratio is low, it may be useful to increaase this setting to let lines touch each other. Default to 100%. A value of 200% will create two times more lines.");
def->min = 0; def->min = 50;
def->max = 200;
def->mode = comAdvanced; def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloatOrPercent(105, true)); def->set_default_value(new ConfigOptionPercent(100));
def = this->add("bridge_speed", coFloat); def = this->add("bridge_speed", coFloat);
def->label = L("Bridges"); def->label = L("Bridges");
@ -1252,23 +1257,25 @@ void PrintConfigDef::init_fff_params()
def->enum_labels.push_back(L("Scattered Rectilinear")); def->enum_labels.push_back(L("Scattered Rectilinear"));
def->set_default_value( new ConfigOptionEnum<InfillPattern>(ipStars)); def->set_default_value( new ConfigOptionEnum<InfillPattern>(ipStars));
def = this->add("fill_top_flow_ratio", coFloatOrPercent); def = this->add("fill_top_flow_ratio", coPercent);
def->label = L("Top fill"); def->label = L("Top fill");
def->full_label = L("Top fill flow ratio"); def->full_label = L("Top fill flow ratio");
def->sidetext = L("%");
def->category = OptionCategory::width; def->category = OptionCategory::width;
def->tooltip = L("You can increase this to over-extrude on the top layer if there are not enough plastic to make a good fill."); def->tooltip = L("You can increase this to over-extrude on the top layer if there are not enough plastic to make a good fill.");
def->min = 0; def->min = 0;
def->mode = comExpert; def->mode = comExpert;
def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); def->set_default_value(new ConfigOptionPercent(100));
def = this->add("first_layer_flow_ratio", coFloatOrPercent); def = this->add("first_layer_flow_ratio", coPercent);
def->label = L("First layer"); def->label = L("First layer");
def->full_label = L("First layer flow ratio"); def->full_label = L("First layer flow ratio");
def->sidetext = L("%");
def->category = OptionCategory::width; def->category = OptionCategory::width;
def->tooltip = L("You can increase this to over-extrude on the first layer if there are not enough plastic because your bed isn't levelled."); def->tooltip = L("You can increase this to over-extrude on the first layer if there are not enough plastic because your bed isn't levelled.");
def->min = 0; def->min = 0;
def->mode = comExpert; def->mode = comExpert;
def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); def->set_default_value(new ConfigOptionPercent(100));
def = this->add("fill_smooth_width", coFloatOrPercent); def = this->add("fill_smooth_width", coFloatOrPercent);
def->label = L("width"); def->label = L("width");

View File

@ -562,9 +562,10 @@ class PrintRegionConfig : public StaticPrintConfig
public: public:
ConfigOptionFloat bridge_angle; ConfigOptionFloat bridge_angle;
ConfigOptionInt bottom_solid_layers; ConfigOptionInt bottom_solid_layers;
ConfigOptionFloat bottom_solid_min_thickness; ConfigOptionFloatOrPercent bridge_flow_ratio; ConfigOptionFloat bottom_solid_min_thickness;
ConfigOptionFloatOrPercent over_bridge_flow_ratio; ConfigOptionPercent bridge_flow_ratio;
ConfigOptionFloatOrPercent bridge_overlap; ConfigOptionPercent over_bridge_flow_ratio;
ConfigOptionPercent bridge_overlap;
ConfigOptionEnum<InfillPattern> bottom_fill_pattern; ConfigOptionEnum<InfillPattern> bottom_fill_pattern;
ConfigOptionFloatOrPercent bridged_infill_margin; ConfigOptionFloatOrPercent bridged_infill_margin;
ConfigOptionFloat bridge_speed; ConfigOptionFloat bridge_speed;
@ -587,7 +588,7 @@ public:
ConfigOptionFloat fill_angle; ConfigOptionFloat fill_angle;
ConfigOptionPercent fill_density; ConfigOptionPercent fill_density;
ConfigOptionEnum<InfillPattern> fill_pattern; ConfigOptionEnum<InfillPattern> fill_pattern;
ConfigOptionFloatOrPercent fill_top_flow_ratio; ConfigOptionPercent fill_top_flow_ratio;
ConfigOptionFloatOrPercent fill_smooth_distribution; ConfigOptionFloatOrPercent fill_smooth_distribution;
ConfigOptionFloatOrPercent fill_smooth_width; ConfigOptionFloatOrPercent fill_smooth_width;
ConfigOptionBool gap_fill; ConfigOptionBool gap_fill;
@ -979,7 +980,7 @@ public:
ConfigOptionFloat first_layer_acceleration; ConfigOptionFloat first_layer_acceleration;
ConfigOptionInts first_layer_bed_temperature; ConfigOptionInts first_layer_bed_temperature;
ConfigOptionFloatOrPercent first_layer_extrusion_width; ConfigOptionFloatOrPercent first_layer_extrusion_width;
ConfigOptionFloatOrPercent first_layer_flow_ratio; ConfigOptionPercent first_layer_flow_ratio;
ConfigOptionFloatOrPercent first_layer_speed; ConfigOptionFloatOrPercent first_layer_speed;
ConfigOptionFloatOrPercent first_layer_infill_speed; ConfigOptionFloatOrPercent first_layer_infill_speed;
ConfigOptionInts first_layer_temperature; ConfigOptionInts first_layer_temperature;

View File

@ -155,6 +155,59 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con
apply(config, &new_conf); apply(config, &new_conf);
} }
// check forgotten '%'
{
struct optDescr {
ConfigOptionFloatOrPercent* opt;
std::string name;
float min;
float max;
};
float diameter = 0.4f;
if (config->option<ConfigOptionFloatOrPercent>("extrusion_width")->percent) {
//has to be percent
diameter = 0;
}
else {
diameter = config->option<ConfigOptionFloatOrPercent>("extrusion_width")->value;
}
std::vector<optDescr> opts;
opts.push_back({ config->option<ConfigOptionFloatOrPercent>("infill_overlap"), "infill_overlap", 0, diameter * 10 });
for (int i = 0; i < opts.size(); i++) {
if ( (!opts[i].opt->percent) && (opts[i].opt->get_abs_value(diameter) < opts[i].min || opts[i].opt->get_abs_value(diameter) > opts[i].max) ) {
wxString msg_text = _(L("Did you forgot to put a '%' in the "+opts[i].name+" field? "
"it's currently set to "+std::to_string(opts[i].opt->get_abs_value(diameter)) + " mm."));
if (is_global_config)
msg_text += "\n\n" + _(L("Shall I add the '%'?"));
wxMessageDialog dialog(nullptr, msg_text, _(L("Wipe Tower")),
wxICON_WARNING | (is_global_config ? wxYES | wxNO : wxOK));
DynamicPrintConfig new_conf = *config;
auto answer = dialog.ShowModal();
if (!is_global_config || answer == wxID_YES) {
new_conf.set_key_value(opts[i].name, new ConfigOptionFloatOrPercent(opts[i].opt->value*100, true));
apply(config, &new_conf);
}
}
}
}
// check changes from FloatOrPercent to percent (useful to migrate cofnig from prusa to slic3r++)
{
std::vector<std::string> names;
names.push_back("bridge_flow_ratio");
names.push_back("over_bridge_flow_ratio");
names.push_back("bridge_overlap");
names.push_back("fill_top_flow_ratio");
names.push_back("first_layer_flow_ratio");
for (int i = 0; i < names.size(); i++) {
if (config->option<ConfigOptionPercent>(names[i])->value <= 2) {
DynamicPrintConfig new_conf = *config;
new_conf.set_key_value(names[i], new ConfigOptionPercent(config->option<ConfigOptionPercent>(names[i])->value * 100));
apply(config, &new_conf);
}
}
}
static bool support_material_overhangs_queried = false; static bool support_material_overhangs_queried = false;
if (config->opt_bool("support_material")) { if (config->opt_bool("support_material")) {