Cherry-picked Repetier acceleration fixes, thanks to @lordofhyphens

e0d8101627
885f27b8ae

Added a printer settings to enable / disable variable layer height editing.
This commit is contained in:
Joseph Lenox 2016-07-16 09:52:11 -05:00 committed by bubnikv
parent db30cee6a9
commit abda054720
7 changed files with 30 additions and 9 deletions

View file

@ -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";

View file

@ -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.";

View file

@ -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;
};