intelligent-agent / redeem

Firmware for Replicape
http://wiki.thing-printer.com/index.php?title=Redeem
GNU General Public License v3.0
36 stars 44 forks source link

Clean up GCode synchronization #186

Open ThatWileyGuy opened 5 years ago

ThatWileyGuy commented 5 years ago

The buffered/unbuffered/async approach to gcode synchronization seems to work well enough in practice, but there's a lot of cruft left over from before it was implemented. I think a few things need to happen as cleanup:

Blocking is interesting - enabling a fan is expected to wait for the path queue to reach a certain point but not stop the path planner while we turn on fan, whereas setting steps per mm needs to wait and block further movement until it completes.

Wackerbarth commented 5 years ago

In general, I agree with the intent. However, I recommend that we reconsider the naming of these properties. What does "buffered" mean? (Buffered with respect to what?) Or, "async"? Surely there is a more descriptive terminology.

We can have separate classes for each behavior mode and rather than repeatedly providing definitions about the classification, use inheritance to provide the details to each specific gcode.

As such, there would be no "default" gcode base. Each gcode would be based on the class which has the appropriate behavior.

Additionally, by doing it by subclassing, the implementation details become significantly less important because they are now delegated to the behavior classes.

A good place to start would be to develop a list of behaviors with example commands (gcodes) that would belong to each behavior class.