Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Commit

Permalink
Properly reset flow state after each process iteration
Browse files Browse the repository at this point in the history
CURA-11044
  • Loading branch information
casperlamboo committed Sep 20, 2023
1 parent d86bbfa commit 4ff21e1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/gradual_flow/gcode_path.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ struct GCodeState
{
current_flow = target_flow;
discretized_duration_remaining = 0;
flow_state = FlowState::STABLE;
return { path };
}

Expand All @@ -400,6 +401,7 @@ struct GCodeState
}
else
{
flow_state = FlowState::TRANSITION;
return { partitioned_gcode_path };
}
}
Expand All @@ -418,6 +420,7 @@ struct GCodeState
{
remaining_path.speed = segment_speed;
discretized_duration_remaining = std::max(discretized_duration_remaining - remaining_path.totalDuration(), .0);
flow_state = discretized_duration_remaining > 0. ? FlowState::TRANSITION : FlowState::STABLE;
discretized_paths.emplace_back(remaining_path);
return discretized_paths;
}
Expand All @@ -439,12 +442,15 @@ struct GCodeState
}
else
{
flow_state = FlowState::TRANSITION;
discretized_duration_remaining = remaining_partition_duration;
return discretized_paths;
}
}
discretized_paths.emplace_back(remaining_path);

flow_state = discretized_duration_remaining > 0. ? FlowState::TRANSITION : FlowState::STABLE;

return discretized_paths;
}
};
Expand Down

0 comments on commit 4ff21e1

Please sign in to comment.