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

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/xs
diff options
context:
space:
mode:
authorJoseph Lenox <lenox.joseph@gmail.com>2016-07-16 17:52:11 +0300
committerbubnikv <bubnikv@gmail.com>2017-02-10 11:39:19 +0300
commitabda05472081e5fe831135ac72b14791bd35fbd1 (patch)
tree30f50cd514f9c5fea5d9e878b7cb3906090dcc55 /xs
parentdb30cee6a9b914778d0adfcbefbb86e7da9dd680 (diff)
Cherry-picked Repetier acceleration fixes, thanks to @lordofhyphens
https://github.com/lordofhyphens/Slic3r/commit/e0d8101627659ef2dcf1c49d5c9b512eb4e31a46 https://github.com/lordofhyphens/Slic3r/commit/885f27b8aea0df8be351825b9dd6061696f5edc9 Added a printer settings to enable / disable variable layer height editing.
Diffstat (limited to 'xs')
-rw-r--r--xs/src/libslic3r/GCodeWriter.cpp11
-rw-r--r--xs/src/libslic3r/PrintConfig.cpp12
-rw-r--r--xs/src/libslic3r/PrintConfig.hpp7
3 files changed, 25 insertions, 5 deletions
diff --git a/xs/src/libslic3r/GCodeWriter.cpp b/xs/src/libslic3r/GCodeWriter.cpp
index bb74ff124..ab92c6f36 100644
--- a/xs/src/libslic3r/GCodeWriter.cpp
+++ b/xs/src/libslic3r/GCodeWriter.cpp
@@ -41,7 +41,7 @@ GCodeWriter::preamble()
gcode << "G21 ; set units to millimeters\n";
gcode << "G90 ; use absolute coordinates\n";
}
- if (FLAVOR_IS(gcfRepRap) || FLAVOR_IS(gcfTeacup)) {
+ if (FLAVOR_IS(gcfRepRap) || FLAVOR_IS(gcfTeacup) || FLAVOR_IS(gcfRepetier) || FLAVOR_IS(gcfSmoothie)) {
if (this->config.use_relative_e_distances) {
gcode << "M83 ; use relative distances for extrusion\n";
} else {
@@ -172,7 +172,14 @@ GCodeWriter::set_acceleration(unsigned int acceleration)
this->_last_acceleration = acceleration;
std::ostringstream gcode;
- gcode << "M204 S" << acceleration;
+ if (FLAVOR_IS(gcfRepetier)) {
+ gcode << "M201 X" << acceleration << " Y" << acceleration;
+ if (this->config.gcode_comments) gcode << " ; adjust acceleration";
+ gcode << "\n";
+ gcode << "M202 X" << acceleration << " Y" << acceleration;
+ } else {
+ gcode << "M204 S" << acceleration;
+ }
if (this->config.gcode_comments) gcode << " ; adjust acceleration";
gcode << "\n";
diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp
index a478496ca..8c002aab6 100644
--- a/xs/src/libslic3r/PrintConfig.cpp
+++ b/xs/src/libslic3r/PrintConfig.cpp
@@ -526,18 +526,22 @@ PrintConfigDef::PrintConfigDef()
def->cli = "gcode-flavor=s";
def->enum_keys_map = ConfigOptionEnum<GCodeFlavor>::get_enum_values();
def->enum_values.push_back("reprap");
+ def->enum_values.push_back("repetier");
def->enum_values.push_back("teacup");
def->enum_values.push_back("makerware");
def->enum_values.push_back("sailfish");
def->enum_values.push_back("mach3");
def->enum_values.push_back("machinekit");
+ def->enum_values.push_back("smoothie");
def->enum_values.push_back("no-extrusion");
- def->enum_labels.push_back("RepRap (Marlin/Sprinter/Repetier)");
+ def->enum_labels.push_back("RepRap (Marlin/Sprinter)");
+ def->enum_labels.push_back("Repetier");
def->enum_labels.push_back("Teacup");
def->enum_labels.push_back("MakerWare (MakerBot)");
def->enum_labels.push_back("Sailfish (MakerBot)");
def->enum_labels.push_back("Mach3/LinuxCNC");
def->enum_labels.push_back("Machinekit");
+ def->enum_labels.push_back("Smoothie");
def->enum_labels.push_back("No extrusion");
def->default_value = new ConfigOptionEnum<GCodeFlavor>(gcfRepRap);
@@ -1432,6 +1436,12 @@ PrintConfigDef::PrintConfigDef()
def->cli = "use-volumetric-e!";
def->default_value = new ConfigOptionBool(false);
+ def = this->add("variable_layer_height", coBool);
+ def->label = "Enable variable layer height feature";
+ def->tooltip = "Some printers or printer setups may have difficulties printing with a variable layer height. Enabled by default.";
+ def->cli = "variable-layer-height!";
+ def->default_value = new ConfigOptionBool(true);
+
def = this->add("wipe", coBools);
def->label = "Wipe while retracting";
def->tooltip = "This flag will move the nozzle while retracting to minimize the possible blob on leaky extruders.";
diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp
index 9964d6f28..5ee787285 100644
--- a/xs/src/libslic3r/PrintConfig.hpp
+++ b/xs/src/libslic3r/PrintConfig.hpp
@@ -26,7 +26,7 @@
namespace Slic3r {
enum GCodeFlavor {
- gcfRepRap, gcfTeacup, gcfMakerWare, gcfSailfish, gcfMach3, gcfMachinekit, gcfNoExtrusion,
+ gcfRepRap, gcfTeacup, gcfMakerWare, gcfSailfish, gcfMach3, gcfMachinekit, gcfNoExtrusion, gcfSmoothie, gcfRepetier,
};
enum InfillPattern {
@@ -45,9 +45,11 @@ enum SeamPosition {
template<> inline t_config_enum_values ConfigOptionEnum<GCodeFlavor>::get_enum_values() {
t_config_enum_values keys_map;
keys_map["reprap"] = gcfRepRap;
+ keys_map["repetier"] = gcfRepetier;
keys_map["teacup"] = gcfTeacup;
keys_map["makerware"] = gcfMakerWare;
keys_map["sailfish"] = gcfSailfish;
+ keys_map["smoothie"] = gcfSmoothie;
keys_map["mach3"] = gcfMach3;
keys_map["machinekit"] = gcfMachinekit;
keys_map["no-extrusion"] = gcfNoExtrusion;
@@ -324,6 +326,7 @@ class GCodeConfig : public virtual StaticPrintConfig
ConfigOptionBool use_firmware_retraction;
ConfigOptionBool use_relative_e_distances;
ConfigOptionBool use_volumetric_e;
+ ConfigOptionBool variable_layer_height;
GCodeConfig(bool initialize = true) : StaticPrintConfig() {
if (initialize)
@@ -361,7 +364,7 @@ class GCodeConfig : public virtual StaticPrintConfig
OPT_PTR(use_firmware_retraction);
OPT_PTR(use_relative_e_distances);
OPT_PTR(use_volumetric_e);
-
+ OPT_PTR(variable_layer_height);
return NULL;
};