scottrini / OctoPrint-PrusaLevelingGuide

42 stars 6 forks source link

State stored in client? #15

Closed ascheucher closed 4 years ago

ascheucher commented 4 years ago

Hi!

First thanks for the awesome plugin! Currently using it for the first time and could not figure out, whether the result is in mm or an other unit. Would be nice to mention it somewhere in the GUI.

But the real issue I realized: State seems to be stored in the browser and not the server. When I started on my PC's broswer and warmin up had been finished, checking from my smartphone I could not see the correct state. On the smartphone it still wanted to start warming up.

Maybe this is worth to address. Thanks so far

scottrini commented 4 years ago

Hey there - short answers: drop down in the UI specifies the unit. Yes, state is in the client.

Long answers: The only value that isn't specific about unit is "raw values." These are the values just from the fw, so it's expected you'd know what unit you'd get from your fw. The others are self explanatory from the option in the drop down.

Unfortunately, state being only client side is intentional. The process is entirely implemented in JavaScript in the view and there's no need for the MT/backend to behave differently depending on the point on the process, so I made the python work regardless of current state in the process. I prefer to keep the python agnostic of state. So unfortunately, this isn't something I'd work on.

If you wanted to throw together a pull request with some ideas that wouldn't overcomplicate the plugin too much, I'd consider it.