eyal0 / OctoPrint-PrintTimeGenius

Use a gcode pre-analysis to provide better print time estimation
190 stars 32 forks source link

[Feature request] Show estimated time until Pause #281

Open labatt opened 2 years ago

labatt commented 2 years ago

OctoPrint Version: OctoPrint 1.7.3 running on OctoPi 0.18.0 PrintTimeGenius Version: 2.2.8

https://github.com/eyal0/OctoPrint-PrintTimeGenius/issues/150 added a great feature to show time until filament change, but a number of the prints I'm doing have pauses in the middle to add magnets. They are not filament changes, but pauses in the gcode using an M601 message (sometimes with an M117 message to display a note on an LCD). You can see an example of this with this model: https://www.thingiverse.com/thing:5260589. I believe Octoprint also supports adding an @pause command to the gcode.

It would be great to show ETA until a pause as my printer is in another part of my house and I have to run back and forth to see how close I am to the next pause.

I understand there's the timetofilament plugin, but I'd love to integrate this using your integration to the octoprint dashboard plugin.

Thanks!

eyal0 commented 2 years ago

Rather than have one plugin that does many things, it nicer to have many small plugins. That way people can choose which features they want and not download something bigger than what they want.

TimeToFilament is the plugin that can help you. It is configurable so that you can show how long until the next filament or until the next pause or whatever you want. To configure it, you need to know some coding, specifically regular expressions. If you know how to do some program or want to learn it yourself, you can. Otherwise, I can help you. But you will need the TimeToFilament plugin.

I think that you could use something like this in the TimeToFilament configuration:

"description": "Time to Next Filament Change",
"regex": "^M601",
"format": 'Pause in <b>${formatDuration(this.progress.printTimeLeft - this.plugins.TimeToFilament["^M601"].timeLeft)}</b>'

Add that to your config of TimeToFilament and it should work. If you want support for @Pause then you can do it by replacing the ^M601 above with @Pause.

In the config window, at the bottom, there is a little snippet of pretend gcode where you can put in some gcode and see that TimeToFilament is processing it properly, correctly recognizing the M601 or @Pause or whatever.

Best of luck!