mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-22 21:50:51 -05:00
Show RepRapFirmware G10 temperature changes in the G-code preview (#17464)
This commit is contained in:
1 parent
c872776d24
commit
fb0c9884c9
1 file changed
+15
-1
@@ -2844,7 +2844,7 @@ void GCodeProcessor::register_commands()
|
||||
{"G3", [this](const GCodeReader::GCodeLine& line) { process_G2_G3(line, false); }}, // Move
|
||||
{"G4", [this](const GCodeReader::GCodeLine& line) { process_G4(line); }}, // Delay
|
||||
|
||||
{"G10", [this](const GCodeReader::GCodeLine& line) { process_G10(line); }}, // Retract
|
||||
{"G10", [this](const GCodeReader::GCodeLine& line) { process_G10(line); }}, // Retract, or set tool temperature on RepRapFirmware
|
||||
{"G11", [this](const GCodeReader::GCodeLine& line) { process_G11(line); }}, // Unretract
|
||||
|
||||
{"G20", [this](const GCodeReader::GCodeLine& line) { process_G20(line); }}, // Set Units to Inches
|
||||
@@ -6405,6 +6405,20 @@ void GCodeProcessor::process_G29(const GCodeReader::GCodeLine& line)
|
||||
|
||||
void GCodeProcessor::process_G10(const GCodeReader::GCodeLine& line)
|
||||
{
|
||||
// Orca: RepRapFirmware's G10 with parameters sets tool temperatures, offsets or workplaces, only a bare G10 retracts
|
||||
if (m_flavor == gcfRepRapFirmware &&
|
||||
(line.has('P') || line.has('R') || line.has('S') || line.has('L') || line.has_x() || line.has_y() || line.has_z())) {
|
||||
float new_temp;
|
||||
if (line.has_value('S', new_temp)) {
|
||||
float tool;
|
||||
const int filament_id = line.has_value('P', tool) ? static_cast<int>(tool) : get_filament_id();
|
||||
// Orca: RRF turns a heater off with a negative temperature
|
||||
if (filament_id >= 0 && filament_id < static_cast<int>(m_extruder_temps.size()))
|
||||
m_extruder_temps[filament_id] = std::max(new_temp, 0.f);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Emulate G1 retract, decrement G1 count as it's will be incremented in process_G1, but it's fake G1
|
||||
GCodeReader::GCodeLine g10;
|
||||
g10.set(Axis::E, -this->m_parser.config().retraction_length.get_at(m_extruder_id));
|
||||
|
||||
Reference in new issue
Block a user