missionpinball / mpf-monitor

Graphical utilty which connects to MPF to let you visually control, troubleshoot, and see the status of the machine
http://missionpinball.org
MIT License
11 stars 10 forks source link

MPF Monitor crashing #38

Closed Pucksnok closed 1 year ago

Pucksnok commented 1 year ago

MPF Monitor is crashing for me, I have now tried on two Windows 11 computers. The second one I went with a completely new installation of Windows, Python and mpf (Python 3.9.13) , and configuration files. Used the installation instructions on the homepage. It start as it should but as soon I move a switch to my playfield it crashes. If I then restart with mpf monitor it crashes again until I remove the configuration file that mpf monitor creates. Monitor.yaml only saves the location for the switch I just placed on the playfield. Exact same issue and error message on both computers.

Traceback (most recent call last): File "C:\Users\Johan.local\pipx\venvs\mpf\lib\site-packages\mpfmonitor\core\playfield.py", line 198, in paint painter.setRenderHint(QPainter.Antialiasing, True) AttributeError: type object 'QPainter' has no attribute 'Antialiasing'

toomanybrians commented 1 year ago

Ah, I think this is an easy one to fix, based on the refactoring from PyQt5 to PyQt6 I did a few days ago I would think. (And I guess there are no tests that cover this so it was not caught.)

I will look up the fix in a bit. You could check too if you want, it’s probably that QPainter.Antialiasing has a new module location in 6.

toomanybrians commented 1 year ago

I just pushed a fix, this is building now and should be available via pypi as 0.56.0.dev5 soon. BTW 0.56.0.dev3 is still available using PyQt5 before the changes were made to move to 6, and of course 0.55.x is available as a stable version. Thanks for creating this issue!

Pucksnok commented 1 year ago

Hi. Been struggling with howto install new version but finally found the correct command to do the update on my Windows machine, would be helpful if it were available in the documentation as well. Running the commands in user documenation still install dev4 on a fresh install.

I now run 0.56.0.dev9 and the error still exist. Same error message and behavior as reported before.

How do I install 0.56.0.dev3? (found it, ==0.56.0.dev3), now also tried install 0.56.0.dev5 but it isn't available anymore, only dev9.

Cheers.

toomanybrians commented 1 year ago

The documentation (like MPF Monitor) is open source and created by volunteers, so you can make the change to the docs yourself. Please submit any corrections!

I don't understand how you can be getting the same error in 0.56.0.dev9. If I look at the line from your error (playfield.py line 198) in dev9, it's this:

painter.setRenderHint(QPainter.RenderHint.Antialiasing, True)

But your error is referencing QPainter.Antialiasing which is not in dev9. So I think you're not actually running dev9?

Pucksnok commented 1 year ago

I'm so sorry, I try to read up before I ask stuff. Sorry for taking your time.

If anyone want to know you can use "pip install mpf-monitor==0.56.0.dev9" to get newest version (today it's dev9), after that you have to use this command to "inject" the new version "pipx inject mpf mpf-monitor --pip-args="--pre" --verbose --include-deps --include-apps". It now works as intended.

Didn't want to sound ungrateful, I will try and contribute in any small way I can. I know my way around computers but Python and it's environment is something new to me. Again thanks and sorry. :)

toomanybrians commented 1 year ago

No worries! If you can submit a pull request for the docs, go for it. (There are instructions in the docs site I think if you scroll to the bottom of the menu on the left.)

And if not, just post here what should be changed and I'll update them. Really the most important thing is getting the most accurate info out there, regardless of how it happens.

It sounds like you're working now, though? That's a relief, because dev9 works for me so I was worried there was some kind of bug that I couldn't see.