Plugin possible to control print progress dialog?


Trying to build an integration for XYZware printers - these use non standard Gcode and send a complete binary file fully to the printer before it starts printing.

Using the plugin system I have most things working

  • I can upload the custom file format .3w
  • I can translate between protocols to update things like the extruder temperature
  • I can capture the print started event on a gcode file and behind the scenes convert that to a .3w and send to the printer (secondary app)
  • I can capture the print started event on a .3w and use that as a trigger to send the file to the printer using a secondary app

However the last two are problematic because I can send the print job (in full) to the printer as soon as I pickup the event that the user selected print.. but then it I can't see any way to interrupting the Gcode stream behavior and controlling the associated progress bar presented to the user

My very hack workaround is to send the file over on the print event and then use a hook to replace each line of outgoing gcode/3w bytes with a x second python delay... this prevents the dialog going quickly to 100% but isn't really in sync with the actual asynchronous progress of the printer (which I can query)

Any advice on how to potentially trap the print started event and prevent the gcode/and or manually control the progress bar by external information?

If that isn't possible with the plugin system - is there a way to maintain state in my plugin, I guess I can query the live status of the print job and use variable delays between each ignored line of data streamed to the printer.. that might keep the % close enough