diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 517fddd69..1abb71b76 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -824,7 +824,7 @@ namespace DoExport { // If the following block is enabled for other firmwares than the Marlin, then the function // this->print_machine_envelope(file, print); // shall be adjusted as well to produce a G-code block compatible with the particular firmware flavor. - if (config.gcode_flavor.value == gcfMarlin) { + if (config.gcode_flavor.value == gcfMarlin || config.gcode_flavor.value == gcfLerdge) { normal_time_estimator.set_max_acceleration((float)config.machine_max_acceleration_extruding.values[0]); normal_time_estimator.set_retract_acceleration((float)config.machine_max_acceleration_retracting.values[0]); normal_time_estimator.set_minimum_feedrate((float)config.machine_min_extruding_rate.values[0]); @@ -1661,7 +1661,7 @@ static bool custom_gcode_sets_temperature(const std::string &gcode, const int mc // Do not process this piece of G-code by the time estimator, it already knows the values through another sources. void GCode::print_machine_envelope(FILE *file, Print &print) { - if (print.config().gcode_flavor.value == gcfMarlin) { + if (print.config().gcode_flavor.value == gcfMarlin || print.config().gcode_flavor.value == gcfLerdge) { fprintf(file, "M201 X%d Y%d Z%d E%d ; sets maximum accelerations, mm/sec^2\n", int(print.config().machine_max_acceleration_x.values.front() + 0.5), int(print.config().machine_max_acceleration_y.values.front() + 0.5), diff --git a/src/libslic3r/GCodeTimeEstimator.cpp b/src/libslic3r/GCodeTimeEstimator.cpp index ba481e17c..14265222e 100644 --- a/src/libslic3r/GCodeTimeEstimator.cpp +++ b/src/libslic3r/GCodeTimeEstimator.cpp @@ -1231,6 +1231,7 @@ namespace Slic3r { (dialect == gcfMarlin) || (dialect == gcfKlipper) || (dialect == gcfSmoothie) || + (dialect == gcfLerdge) || (dialect == gcfRepRap)) { if (line.has_value('S', value)) @@ -1369,7 +1370,7 @@ namespace Slic3r { // see http://reprap.org/wiki/G-code#M203:_Set_maximum_feedrate // http://smoothieware.org/supported-g-codes - float factor = (dialect == gcfMarlin || dialect == gcfSmoothie) ? 1.0f : MMMIN_TO_MMSEC; + float factor = (dialect == gcfMarlin || dialect == gcfSmoothie || dialect == gcfLerdge) ? 1.0f : MMMIN_TO_MMSEC; if (line.has_x()) set_axis_max_feedrate(X, line.x() * factor); diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index d8b19a698..b9737a91b 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -22,7 +22,7 @@ void GCodeWriter::apply_print_config(const PrintConfig &print_config) this->config.apply(print_config, true); m_extrusion_axis = this->config.get_extrusion_axis(); m_single_extruder_multi_material = print_config.single_extruder_multi_material.value; - m_max_acceleration = std::lrint((print_config.gcode_flavor.value == gcfMarlin || print_config.gcode_flavor.value == gcfKlipper) ? + m_max_acceleration = std::lrint((print_config.gcode_flavor.value == gcfMarlin || print_config.gcode_flavor.value == gcfLerdge || print_config.gcode_flavor.value == gcfKlipper) ? print_config.machine_max_acceleration_extruding.values.front() : 0); } @@ -49,7 +49,7 @@ std::string GCodeWriter::preamble() gcode << "G90 ; use absolute coordinates\n"; } if (FLAVOR_IS(gcfRepRap) || FLAVOR_IS(gcfMarlin) || FLAVOR_IS(gcfTeacup) || FLAVOR_IS(gcfRepetier) || FLAVOR_IS(gcfSmoothie) - || FLAVOR_IS(gcfKlipper)) { + || FLAVOR_IS(gcfKlipper) || FLAVOR_IS(gcfLerdge)) { if (this->config.use_relative_e_distances) { gcode << "M83 ; use relative distances for extrusion\n"; } else { diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index c1d4e8a2b..04c87fdc6 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1478,6 +1478,7 @@ void PrintConfigDef::init_fff_params() def->enum_values.push_back("mach3"); def->enum_values.push_back("machinekit"); def->enum_values.push_back("smoothie"); + def->enum_values.push_back("lerdge"); def->enum_values.push_back("no-extrusion"); def->enum_labels.push_back("RepRap/Sprinter"); def->enum_labels.push_back("Repetier"); @@ -1489,6 +1490,7 @@ void PrintConfigDef::init_fff_params() def->enum_labels.push_back("Mach3/LinuxCNC"); def->enum_labels.push_back("Machinekit"); def->enum_labels.push_back("Smoothie"); + def->enum_labels.push_back("Lerdge"); def->enum_labels.push_back(L("No extrusion")); def->mode = comAdvanced; def->set_default_value(new ConfigOptionEnum(gcfRepRap)); @@ -4249,8 +4251,9 @@ std::string FullPrintConfig::validate() this->gcode_flavor.value != gcfRepRap && this->gcode_flavor.value != gcfMarlin && this->gcode_flavor.value != gcfMachinekit && - this->gcode_flavor.value != gcfRepetier) - return "--use-firmware-retraction is only supported by Marlin, Smoothie, Repetier and Machinekit firmware"; + this->gcode_flavor.value != gcfRepetier && + this->gcode_flavor.value != gcfLerdge) + return "--use-firmware-retraction is only supported by Marlin, Smoothie, Repetier, Machinekit and Lerdge firmware"; if (this->use_firmware_retraction.value) for (unsigned char wipe : this->wipe.values) diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index a3878dc79..c2a3951a4 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -43,7 +43,7 @@ enum WipeAlgo { enum GCodeFlavor : unsigned char { gcfRepRap, gcfRepetier, gcfTeacup, gcfMakerWare, gcfMarlin, gcfKlipper, gcfSailfish, gcfMach3, gcfMachinekit, - gcfSmoothie, gcfNoExtrusion, + gcfSmoothie, gcfNoExtrusion, gcfLerdge, }; enum PrintHostType { @@ -122,6 +122,7 @@ template<> inline const t_config_enum_values& ConfigOptionEnum::get keys_map["teacup"] = gcfTeacup; keys_map["makerware"] = gcfMakerWare; keys_map["marlin"] = gcfMarlin; + keys_map["lerdge"] = gcfLerdge; keys_map["klipper"] = gcfKlipper; keys_map["sailfish"] = gcfSailfish; keys_map["smoothie"] = gcfSmoothie; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 043a130e7..a382d627d 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2771,8 +2771,8 @@ PageShp TabPrinter::build_kinematics_page() { auto page = add_options_page(_(L("Machine limits")), "cog", true); ConfigOptionsGroupShp optgroup; - if (m_config->option>("gcode_flavor")->value != gcfMarlin) { - optgroup = page->new_optgroup(_(L("not-marlin firmware compensation"))); + if (m_config->option>("gcode_flavor")->value != gcfMarlin && m_config->option>("gcode_flavor")->value != gcfLerdge) { + optgroup = page->new_optgroup(_(L("not-marlin/lerdge firmware compensation"))); optgroup->append_single_option_line("time_estimation_compensation"); }