Skip to content

Commit

Permalink
#645 fix temperature for reprap & first layer temp for multiextruders
Browse files Browse the repository at this point in the history
  • Loading branch information
supermerill committed Nov 10, 2020
1 parent 77f9280 commit 78f1937
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
7 changes: 3 additions & 4 deletions src/libslic3r/GCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,10 @@ void AvoidCrossingPerimeters::init_external_mp(const Print &print)
std::string();
}

int
OozePrevention::_get_temp(GCode& gcodegen)
int OozePrevention::_get_temp(GCode& gcodegen)
{
if (gcodegen.writer().tool_is_extruder())
return (gcodegen.layer() != NULL && gcodegen.layer()->id() == 0)
return (gcodegen.layer() == NULL || gcodegen.layer()->id() == 0)
? gcodegen.config().first_layer_temperature.get_at(gcodegen.writer().tool()->id())
: gcodegen.config().temperature.get_at(gcodegen.writer().tool()->id());
else
Expand Down Expand Up @@ -1933,7 +1932,7 @@ static bool custom_gcode_sets_temperature(const std::string &gcode, const int mc
}
}
}
}
}
// Skip the rest of the line.
for (; *ptr != 0 && *ptr != '\r' && *ptr != '\n'; ++ ptr);
// Skip the end of line indicators.
Expand Down
8 changes: 2 additions & 6 deletions src/libslic3r/GCodeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,8 @@ std::string GCodeWriter::set_temperature(const unsigned int temperature, bool wa
}
gcode << temp_w_offset;
bool multiple_tools = this->multiple_extruders && ! m_single_extruder_multi_material;
if (tool != -1 && (multiple_tools || FLAVOR_IS(gcfMakerWare) || FLAVOR_IS(gcfSailfish)) ) {
if (FLAVOR_IS(gcfRepRap)) {
gcode << " P" << tool;
} else {
gcode << " T" << tool;
}
if (tool != -1 && (multiple_tools || FLAVOR_IS(gcfMakerWare) || FLAVOR_IS(gcfSailfish)) && FLAVOR_IS_NOT(gcfRepRap)) {
gcode << " T" << tool;
}
gcode << " ; " << comment << "\n";

Expand Down

0 comments on commit 78f1937

Please sign in to comment.