Skip to content

Commit

Permalink
#276 fix klipper dual extruder problem
Browse files Browse the repository at this point in the history
small voron config fix
  • Loading branch information
supermerill committed Jun 17, 2020
1 parent 0d6ebe7 commit 55b483f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions resources/profiles/Voron.ini
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,12 @@ printer_model = Voron_v2_250_aferburner
printer_notes = Unoffical profile, for now.\nE3DV6

[printer:*Voron_v2_300_aferburner*]
inherits = *Voron_v2_250*; *afterburner*
inherits = *Voron_v2_300*; *afterburner*
printer_model = Voron_v2_300_aferburner
printer_notes = Unoffical profile, for now.\nE3DV6

[printer:*Voron_v2_350_aferburner*]
inherits = *Voron_v2_250*; *afterburner*
inherits = *Voron_v2_350*; *afterburner*
printer_model = Voron_v2_350_aferburner
printer_notes = Unoffical profile, for now.\nE3DV6

Expand Down
13 changes: 13 additions & 0 deletions src/libslic3r/GCode/Analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,19 @@ void GCodeAnalyzer::_process_gcode_line(GCodeReader&, const GCodeReader::GCodeLi
break;
}
}
if (this->m_gcode_flavor == GCodeFlavor::gcfKlipper) {
if (cmd == "ACTIVATE_EXTRUDER") {
std::string rawline = line.raw();
std::string trsf;
while (rawline.back() >= '0' && rawline.back() <= '9') {
trsf = rawline.back() + trsf;
rawline.resize(rawline.size() - 1);
}
if (trsf.empty())
trsf = "0";
_processT("T"+ trsf);
}
}
}

// puts the line back into the gcode
Expand Down
10 changes: 8 additions & 2 deletions src/libslic3r/GCodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ std::string GCodeWriter::toolchange_prefix() const
{
return FLAVOR_IS(gcfMakerWare) ? "M135 T" :
FLAVOR_IS(gcfSailfish) ? "M108 T" :
FLAVOR_IS(gcfKlipper) ? "ACTIVATE_EXTRUDER EXTRUDER=extruder" :
FLAVOR_IS(gcfKlipper) ? "ACTIVATE_EXTRUDER EXTRUDER=" :
"T";
}

Expand Down Expand Up @@ -292,7 +292,13 @@ std::string GCodeWriter::toolchange(unsigned int tool_id)
// if we are running a single-extruder setup, just set the extruder and return nothing
std::ostringstream gcode;
if (this->multiple_extruders) {
gcode << this->toolchange_prefix() << tool_id;
if (FLAVOR_IS(gcfKlipper)) {
gcode << this->toolchange_prefix() << "extruder";
if (tool_id > 0)
gcode << tool_id;
} else {
gcode << this->toolchange_prefix() << tool_id;
}
if (this->config.gcode_comments)
gcode << " ; change extruder";
gcode << "\n";
Expand Down

0 comments on commit 55b483f

Please sign in to comment.