mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 15:15:54 +08:00
Follow-up of 2424f9826fd13a4f5174067d6c417468bdf45284 - Fixed the fix in GCodeProcessor.cpp
This commit is contained in:
parent
7d82c4c412
commit
c03a9d1a3e
@ -3922,29 +3922,29 @@ void GCodeProcessor::post_process()
|
|||||||
if (m_print != nullptr)
|
if (m_print != nullptr)
|
||||||
m_print->active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL, warning);
|
m_print->active_step_add_warning(PrintStateBase::WarningLevel::CRITICAL, warning);
|
||||||
}
|
}
|
||||||
export_lines.insert_lines(backtrace, cmd,
|
|
||||||
// line inserter
|
|
||||||
[tool_number, this](unsigned int id, float time, float time_diff) {
|
|
||||||
int temperature = int( m_layer_id != 1 ? m_extruder_temps_config[tool_number] : m_extruder_temps_first_layer_config[tool_number]);
|
|
||||||
const std::string out = "M104 T" + std::to_string(tool_number) + " P" + std::to_string(int(std::round(time_diff))) + " S" + std::to_string(temperature) + "\n";
|
|
||||||
return out;
|
|
||||||
},
|
|
||||||
// line replacer
|
|
||||||
[this, tool_number](const std::string& line) {
|
|
||||||
if (GCodeReader::GCodeLine::cmd_is(line, "M104")) {
|
|
||||||
GCodeReader::GCodeLine gline;
|
|
||||||
GCodeReader reader;
|
|
||||||
reader.parse_line(line, [&gline](GCodeReader& reader, const GCodeReader::GCodeLine& l) { gline = l; });
|
|
||||||
|
|
||||||
float val;
|
|
||||||
if (gline.has_value('T', val) && gline.raw().find("cooldown") != std::string::npos && m_is_XL_printer) {
|
|
||||||
if (static_cast<int>(val) == tool_number)
|
|
||||||
return std::string("; removed M104\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return line;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
export_lines.insert_lines(backtrace, cmd,
|
||||||
|
// line inserter
|
||||||
|
[tool_number, this](unsigned int id, float time, float time_diff) {
|
||||||
|
int temperature = int( m_layer_id != 1 ? m_extruder_temps_config[tool_number] : m_extruder_temps_first_layer_config[tool_number]);
|
||||||
|
const std::string out = "M104 T" + std::to_string(tool_number) + " P" + std::to_string(int(std::round(time_diff))) + " S" + std::to_string(temperature) + "\n";
|
||||||
|
return out;
|
||||||
|
},
|
||||||
|
// line replacer
|
||||||
|
[this, tool_number](const std::string& line) {
|
||||||
|
if (GCodeReader::GCodeLine::cmd_is(line, "M104")) {
|
||||||
|
GCodeReader::GCodeLine gline;
|
||||||
|
GCodeReader reader;
|
||||||
|
reader.parse_line(line, [&gline](GCodeReader& reader, const GCodeReader::GCodeLine& l) { gline = l; });
|
||||||
|
|
||||||
|
float val;
|
||||||
|
if (gline.has_value('T', val) && gline.raw().find("cooldown") != std::string::npos && m_is_XL_printer) {
|
||||||
|
if (static_cast<int>(val) == tool_number)
|
||||||
|
return std::string("; removed M104\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return line;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user