Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/supermerill/SuperSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorremi durand <remi-j.durand@thalesgroup.com>2021-02-23 03:26:29 +0300
committerremi durand <remi-j.durand@thalesgroup.com>2021-02-23 03:26:29 +0300
commit201c6120b6c6122843ea04a388c3d93eb9cce1b7 (patch)
tree6e4d0f135514c78cfdb6ec2dab55c3cec1147b82
parent55e6eadc9f8941bb7fa05ae86fcbc1fea7f46531 (diff)
#852 decimals for xyz & e are now configurable2.3.55.5
-rw-r--r--resources/ui_layout/extruder.ui4
-rw-r--r--resources/ui_layout/printer_fff.ui1
-rw-r--r--src/libslic3r/GCodeWriter.cpp4
-rw-r--r--src/libslic3r/Preset.cpp4
-rw-r--r--src/libslic3r/Print.cpp2
-rw-r--r--src/libslic3r/PrintConfig.cpp15
-rw-r--r--src/libslic3r/PrintConfig.hpp4
7 files changed, 30 insertions, 4 deletions
diff --git a/resources/ui_layout/extruder.ui b/resources/ui_layout/extruder.ui
index 8dcec3661..458b92150 100644
--- a/resources/ui_layout/extruder.ui
+++ b/resources/ui_layout/extruder.ui
@@ -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 \ No newline at end of file
+ reset_to_filament_color
+group:Gcode
+ setting:gcode_precision_e \ No newline at end of file
diff --git a/resources/ui_layout/printer_fff.ui b/resources/ui_layout/printer_fff.ui
index af1a25a23..0c3844e46 100644
--- a/resources/ui_layout/printer_fff.ui
+++ b/resources/ui_layout/printer_fff.ui
@@ -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
diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp
index 3afd40cd9..b0ac0ad44 100644
--- a/src/libslic3r/GCodeWriter.cpp
+++ b/src/libslic3r/GCodeWriter.cpp
@@ -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 {
diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp
index af865fb6d..a30786fdc 100644
--- a/src/libslic3r/Preset.cpp
+++ b/src/libslic3r/Preset.cpp
@@ -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.
diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp
index b20638421..4b58a4270 100644
--- a/src/libslic3r/Print.cpp
+++ b/src/libslic3r/Print.cpp
@@ -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",
diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp
index 5311aad01..e689d665a 100644
--- a/src/libslic3r/PrintConfig.cpp
+++ b/src/libslic3r/PrintConfig.cpp
@@ -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",
diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp
index 41bb8273b..6ed08fec3 100644
--- a/src/libslic3r/PrintConfig.hpp
+++ b/src/libslic3r/PrintConfig.hpp
@@ -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);