• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Real-time gcode stream (window) for current job?

Scheduled Pinned Locked Moved Solved
CNC
3
4
349
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    HebigT
    last edited by HebigT 10 Oct 2022, 19:54 10 Oct 2022, 19:53

    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!

    1 Reply Last reply Reply Quote 2
    • undefined
      chrishamm administrators
      last edited by 10 Oct 2022, 22:48

      @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 Vuex mapState and create a watcher. Then you can keep track of job.filePosition (provided it isn't null) 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 short G0/G1 commands. @Sindarius should be able to explain more in-depth how live movement is visualized in the G-code viewer.

      Duet software engineer

      1 Reply Last reply Reply Quote 2
      • undefined Phaedrux moved this topic from General Discussion 11 Oct 2022, 00:43
      • undefined
        Sindarius
        last edited by 11 Oct 2022, 03:15

        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.

        https://youtu.be/03zWpqM9jDA

        undefined 1 Reply Last reply 19 Oct 2022, 22:21 Reply Quote 2
        • undefined HebigT has marked this topic as solved 19 Oct 2022, 22:20
        • undefined
          HebigT @Sindarius
          last edited by 19 Oct 2022, 22:21

          @Sindarius @chrishamm Thank you for the feedback on this!

          1 Reply Last reply Reply Quote 0
          1 out of 4
          • First post
            1/4
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA