winder / Universal-G-Code-Sender

A cross-platform G-Code sender for GRBL, Smoothieware, TinyG and G2core.
http://winder.github.io/ugs_website/
GNU General Public License v3.0
1.92k stars 768 forks source link

Start streaming when cycle start button pressed on GRBL board #1138

Open Harvie opened 6 years ago

Harvie commented 6 years ago

When GRBL is idle and UGS platform receives Pn:S (or any other Pn: combination containing S flag) it should start streaming the g-code. This will allow machine operator to start cycle using machine buttons without having to work with PC.

I've already implemented this feature to bCNC, so you can use it as reference:

https://github.com/Harvie/bCNC/commit/4a77780c9a01e2d63af036784097a404c510a336

quick grep of ugs-core/src/com/willwinder/universalgcodesender/GrblUtils.java seems that Pn: is already parsed in UGS:

else if (part.startsWith("Pn:")) {

so that can be good base for this functionality.

Once cycle is started this function should be locked out until GRBL idle status report is received again. (Grbl does not send RUN status report immediately after start, which means that depending purely on grbl state is not enough in case you press cycle start two times in short interval)

jdkcz commented 4 years ago

Has this been added yet? Would really be a helpful upgrade, I see bCNC has it but I find the UGS interface simpler and better for some applications.

Mickel-Talala commented 1 week ago

Hi! How are things going with the implementation of this function? It is very necessary! Perhaps this would be better done as an additional checkbox in the settings menu if not everyone needs it. Thank you for your work