mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-11-23 06:01:14 -05:00
Keep Layer Pauses on Their Own Layer in the Preview
The G-code processor remembers where a pause, color change or custom G-code vertex sits in the move list, so it can move that vertex to the first extrusion after it. A pause flushes the time planner first, which inserts actual speed moves ahead of the vertex, so the remembered index pointed at an earlier move: the previous layer's last extrusion was moved instead, a real move was erased, and the time blocks queued after the vertex were left one move off. Shift the remembered index by the moves each flush inserts before it, and shift the queued blocks after the erase. The Preview numbers layers from the move order, so the stray move showed up as extra layers and listed pauses on the wrong layer.
This commit is contained in:
1 parent
069bd402d9
commit
7b05bc5ea1
3 files changed
+74
-6
No files matched your search
@@ -5234,7 +5234,15 @@ void GCodeProcessor::process_G1(const std::array<std::optional<double>, 4>& axes
|
||||
|
||||
if (origin == G1DiscretizationOrigin::G1)
|
||||
m_extruded_last_z = m_end_position[Z];
|
||||
m_options_z_corrector.update(m_height);
|
||||
// The queued blocks of the moves after the erased one follow them down the list.
|
||||
if (const std::optional<size_t> erased = m_options_z_corrector.update(m_height)) {
|
||||
for (TimeMachine& machine : m_time_processor.machines) {
|
||||
for (TimeBlock& block : machine.blocks) {
|
||||
if (block.move_id > *erased)
|
||||
--block.move_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_forced_width > 0.0f)
|
||||
m_width = m_forced_width;
|
||||
@@ -7958,6 +7966,7 @@ void GCodeProcessor::calculate_time(GCodeProcessorResult& result, size_t keep_la
|
||||
it->second : block.move_id + (unsigned int)inserted_actual_speed_moves_count;
|
||||
}
|
||||
}
|
||||
m_options_z_corrector.on_moves_inserted(m_actual_speed_id_map);
|
||||
}
|
||||
|
||||
void GCodeProcessor::simulate_st_synchronize(float additional_time, EMoveType target_move_type)
|
||||
|
||||
Reference in new issue
Block a user