#852 decimals for xyz & e are now configurable

This commit is contained in:
remi durand 2021-02-23 01:26:29 +01:00
parent 55e6eadc9f
commit 201c6120b6
7 changed files with 30 additions and 4 deletions

View File

@ -36,4 +36,6 @@ group:Retraction when tool is disabled (advanced settings for multi-extruder set
setting:idx:retract_length_toolchange
setting:idx:retract_restart_extra_toolchange
group:Preview
reset_to_filament_color
reset_to_filament_color
group:Gcode
setting:gcode_precision_e

View File

@ -15,6 +15,7 @@ group:silent_mode_event:Firmware
setting:gcode_flavor
setting:silent_mode
setting:remaining_times
setting:gcode_precision_xyz
group:Cooling fan
line:Speedup
setting:label$Speedup time:fan_speedup_time

View File

@ -10,8 +10,8 @@
#define FLAVOR_IS_NOT(val) this->config.gcode_flavor != val
#define COMMENT(comment) if (this->config.gcode_comments && !comment.empty()) gcode << " ; " << comment;
#define PRECISION(val, precision) std::fixed << std::setprecision(precision) << (val)
#define XYZF_NUM(val) PRECISION(val, 3)
#define E_NUM(val) PRECISION(val, 5)
#define XYZF_NUM(val) PRECISION(val, this->config.gcode_precision_xyz.value)
#define E_NUM(val) PRECISION(val, this->config.gcode_precision_e.get_at(m_tool->id()))
namespace Slic3r {

View File

@ -666,7 +666,9 @@ const std::vector<std::string>& Preset::printer_options()
"fan_kickstart",
"fan_speedup_overhangs",
"fan_speedup_time",
"gcode_flavor", "use_relative_e_distances",
"gcode_flavor",
"gcode_precision_xyz",
"use_relative_e_distances",
"use_firmware_retraction", "use_volumetric_e", "variable_layer_height",
"min_length",
//FIXME the print host keys are left here just for conversion from the Printer preset to Physical Printer preset.

View File

@ -120,6 +120,8 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
"gap_fill_speed",
"gcode_comments",
"gcode_label_objects",
"gcode_precision_xyz",
"gcode_precision_e",
"infill_acceleration",
"layer_gcode",
"min_fan_speed",

View File

@ -1876,6 +1876,20 @@ void PrintConfigDef::init_fff_params()
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool(1));
def = this->add("gcode_precision_xyz", coInt);
def->label = L("xyz decimals");
def->category = OptionCategory::output;
def->tooltip = L("Choose how many digit after the dot for xyz coordinates.");
def->mode = comExpert;
def->set_default_value(new ConfigOptionInt(3));
def = this->add("gcode_precision_e", coInts);
def->label = L("Extruder decimals");
def->category = OptionCategory::output;
def->tooltip = L("Choose how many digit after the dot for extruder moves.");
def->mode = comExpert;
def->set_default_value(new ConfigOptionInts{ 5 });
def = this->add("high_current_on_filament_swap", coBool);
def->label = L("High extruder current on filament swap");
def->category = OptionCategory::general;
@ -4182,6 +4196,7 @@ void PrintConfigDef::init_extruder_option_keys()
"extruder_offset",
"extruder_fan_offset",
"extruder_temperature_offset",
"gcode_precision_e",
"tool_name",
"retract_length",
"retract_lift",

View File

@ -1046,6 +1046,8 @@ public:
ConfigOptionBool gcode_comments;
ConfigOptionEnum<GCodeFlavor> gcode_flavor;
ConfigOptionBool gcode_label_objects;
ConfigOptionInt gcode_precision_xyz;
ConfigOptionInts gcode_precision_e;
ConfigOptionString layer_gcode;
ConfigOptionString feature_gcode;
ConfigOptionFloat max_print_speed;
@ -1154,6 +1156,8 @@ protected:
OPT_PTR(gcode_comments);
OPT_PTR(gcode_flavor);
OPT_PTR(gcode_label_objects);
OPT_PTR(gcode_precision_xyz);
OPT_PTR(gcode_precision_e);
OPT_PTR(layer_gcode);
OPT_PTR(feature_gcode);
OPT_PTR(max_print_speed);