mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
Fix issue that TIMELAPSE_TAKE_FRAME
is recognized as tool change command (#7926)
Fix issue that `TIMELAPSE_TAKE_FRAME` is recognized as tool change command and triggers preheat (SoftFever/OrcaSlicer#7842)
This commit is contained in:
parent
10b9928506
commit
b488fdecec
1 changed files with 6 additions and 3 deletions
|
@ -4918,10 +4918,13 @@ void GCodeProcessor::run_post_process()
|
||||||
// add lines M104 to exported gcode
|
// add lines M104 to exported gcode
|
||||||
auto process_line_T = [this, &export_lines](const std::string& gcode_line, const size_t g1_lines_counter, const ExportLines::Backtrace& backtrace) {
|
auto process_line_T = [this, &export_lines](const std::string& gcode_line, const size_t g1_lines_counter, const ExportLines::Backtrace& backtrace) {
|
||||||
const std::string cmd = GCodeReader::GCodeLine::extract_cmd(gcode_line);
|
const std::string cmd = GCodeReader::GCodeLine::extract_cmd(gcode_line);
|
||||||
|
|
||||||
|
int tool_number = -1;
|
||||||
|
if (!parse_number(std::string_view(cmd).substr(1), tool_number)){
|
||||||
|
// invalid T<n> command, such as the "TIMELAPSE_TAKE_FRAME" gcode, just ignore
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (cmd.size() >= 2) {
|
if (cmd.size() >= 2) {
|
||||||
std::stringstream ss(cmd.substr(1));
|
|
||||||
int tool_number = -1;
|
|
||||||
ss >> tool_number;
|
|
||||||
if (tool_number != -1) {
|
if (tool_number != -1) {
|
||||||
if (tool_number < 0 || (int)m_extruder_temps_config.size() <= tool_number) {
|
if (tool_number < 0 || (int)m_extruder_temps_config.size() <= tool_number) {
|
||||||
// found an invalid value, clamp it to a valid one
|
// found an invalid value, clamp it to a valid one
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue