grbl/grbl — pull request #112 by jgeisler0303 (2012-07-29 19:52:26+00:00)
Title: Grbl Simulator

Hi fellow maintainers,
I finally managed to finish the grbl simulator with comments and tested it. The changes may seem immense but grbl really only changes in one place: the execute_runtime is moved to a separate module, so that I can overwrite it for the simulator. All the other grbl files are only changed to use float declaration instead of double (I didn't find a noninvasive way of telling gcc to compile the double like avrgcc does).
The rest of the simulator is in the new directory 'sim'. The simulator uses as much code from grbl as possible and should work with many changes to grbl without touching it.
It is built by calling 'make all' in the 'sim' directory (only MinGW on Windows supported at the time but all other platforms should be straigth forward since its all pure c).
grbl_sim takes commands from stdin until an EOF is encountered. It resonds just like grbl does plus giving info about newly created blocks on stdout. On stderr it gives info on the stepper position. This can be configured by a commandline argument (just a float number) that tells the simulator the time step for printing the info.
The stepper is simulated so that the buffer is always maximally full except when plan_synchronize is called.

What do you say?