Start adding Lerdge motherboard support

This commit is contained in:
Alessandro Corbelli 2020-05-12 01:15:34 +02:00 committed by supermerill
parent 397d56fc42
commit 1da021b352
6 changed files with 15 additions and 10 deletions

View File

@ -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),

View File

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

View File

@ -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 {

View File

@ -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<GCodeFlavor>(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)

View File

@ -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<GCodeFlavor>::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;

View File

@ -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<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value != gcfMarlin) {
optgroup = page->new_optgroup(_(L("not-marlin firmware compensation")));
if (m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value != gcfMarlin && m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value != gcfLerdge) {
optgroup = page->new_optgroup(_(L("not-marlin/lerdge firmware compensation")));
optgroup->append_single_option_line("time_estimation_compensation");
}