Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

octoprint.plugin.ProgressPlugin class plugins do not get 0% progress notify #1344

Closed
CapnBry opened this issue May 18, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@CapnBry
Copy link
Contributor

commented May 18, 2016

What were you doing?

Being so happy that Gina implemented a plugin I have wanted that I almost didn't notice that it wasn't resetting when starting a new print.

OctoPrint-DisplayProgress does a lovely job of allowing me to stand in front of the printer and see how far along we are. However, once it gets to 100%% and new print is started, the LCD indicator stays at 100%% until the new print gets to 1%(percent).

This is tracked back into OctoPrint proper, where the notification is doled out to plugins. Specifically
https://github.com/foosel/OctoPrint/blob/master/src/octoprint/printer/standard.py#L632

        if progress:
            progress_int = int(progress * 100)
            if self._lastProgressReport != progress_int:
                self._lastProgressReport = progress_int
                self._reportPrintProgressToPlugins(progress_int)

If progress is 0 then this obviously won't fire. I believe the intent of the code is to make sure there is progress/comms, which would be if progress is not None: the scope of this affects other plugins too, which expect to be called at 0% and 100% and all the wee percents in between. Correct?

What did you expect to happen?

To see 0%% when starting a new print!

What happened instead?

I saw the previous print's 100%% until I saw the new print hit 1%%

Branch & Commit or Version of OctoPrint

Version: 1.2.11 (master branch)

Printer model & used firmware incl. version

N/A

Browser and Version of Browser, Operating System running Browser

N/A

Link to octoprint.log

http://imgur.com/gallery/SrmH7iG

Link to contents of terminal tab or serial.log

N/A

Link to contents of Javascript console in the browser

N/A

Screenshot(s) showing the problem:

N/A

I have read the FAQ. Indeed I have%.

@foosel

This comment has been minimized.

Copy link
Owner

commented May 20, 2016

You are spot on, should just be a None check instead.

foosel added a commit that referenced this issue May 20, 2016

@foosel foosel added this to the 1.2.12 milestone May 20, 2016

@foosel

This comment has been minimized.

Copy link
Owner

commented May 20, 2016

Fixed on maintenance and devel, will be part of the next release. Thanks for spotting this, as always a pleasure ;)

@foosel foosel closed this May 20, 2016

@foosel foosel reopened this Jan 11, 2017

@foosel

This comment has been minimized.

Copy link
Owner

commented Jan 11, 2017

Nope. This is NOT fixed. And never was. And I have no idea what made me think that it was either and why I only now noticed it. This line still also captures 0 and aborts further processing. Stupid!

@CapnBry, you should have complained! :)

@foosel foosel modified the milestones: 1.3.1, 1.2.12 Jan 11, 2017

@CapnBry

This comment has been minimized.

Copy link
Contributor Author

commented Jan 11, 2017

You seemed so confident, I didn't want to break your heart! Find a bug once, shame on me. Find a bug twice, shame on you.

Actually I thought it was working but you can also blame my printer, which had gotten so reliable that I'm never in there any more so I replaced the progress M117 with one that displayed the enclosure temperature from a DS18B20.

Mea culpa!

@foosel

This comment has been minimized.

Copy link
Owner

commented Jan 11, 2017

Ah, well, it should hopefully now definitely be fixed (at least I managed to receive a 0 progress in a plugin just fine after above commit). To be rolled out with 1.3.1 :)

@foosel foosel closed this in fb5d568 Jan 25, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.