-
Many commercial CNC software have a dedicated window that shows a real-time stream of gcode commands.
I'd like to create a plugin to do the same - but have no idea how realistic it is or where to start.
I think Sandarius's gcode viewer offers some similar functionality in that it loads the current job and gives a visual preview of commands to come.
Would it be sufficient to simulate the active job in parallel, provided that they both start (and remain) synchronized?
Any thoughts are appreciated!
-
@hebigt You need to watch
job.file.fileName
in the object model and download the entire file once it changes. If you want to implement it in Vue (backend of DWC), map it to your component using VuexmapState
and create a watcher. Then you can keep track ofjob.filePosition
(provided it isn'tnull
) and highlight everything up to that position. Just bear in mind that the reported file position may not be equal to the move being executed but to the last buffered command, because RRF tries to look ahead (usually) 2 seconds to maintain jerk-free motions. That is especially necessary during circular motions with lots of shortG0
/G1
commands. @Sindarius should be able to explain more in-depth how live movement is visualized in the G-code viewer. -
-
I think the best that can be done is real-ish time due to buffering that happens in RRF. On that note I have been working on incorporating the current gcode in the 3d viewer for live and simulated viewing. However, that is not on my higher priority list at the moment so I can’t provide an ETA on it yet.
-
-
@Sindarius @chrishamm Thank you for the feedback on this!