Future of segment displays, replace vs stack #143
Replies: 3 comments
-
Thank you for the investigation and detailed analysis. The The best way to handle situations like this is with unit tests, because tests are run against all PRs and merges to help prevent regressions. If you can create a very basic config that demonstrates the problems, then we can write tests that fail on those problems and verify that your proposed fixes work. Claim 1 It'd be great to have some segment_display_player commands in the unit test config that demonstrate the issue you're describing, and from there it should be simple enough to write a test to confirm the color, text, and flashing state. Claim 2 Next |
Beta Was this translation helpful? Give feedback.
-
Thanks for your swift response. I might not be the best Python developer but like to investigate things to the root... So I spend quite some time today on the coding to figure out what is going on. I got some basic transitions working for About the test, more than happy to help here. I have no clue how to write unit test, but if I understand you correctly you only need config files, correct? How do you verify - without the segment displays - if it is working or not? One last technical question, with MPF 0.80 so without MC how can I add my keyboard that I can use keys to trigger events? Would be easier than tapping the switches on my machine. This https://missionpinball.org/latest/tutorial/6_keyboard/ doesn't work anymore without the MC, or too many things spin in my head about these configs that I messed it up... |
Beta Was this translation helpful? Give feedback.
-
Closed for me with missionpinball/mpf#1820 |
Beta Was this translation helpful? Give feedback.
-
Hello,
probably more a question to @avanwinkle but maybe others use as well segment displays and can contribute or benefit. I did some Python debugging on the segment display (MPF 0.80). I am pretty certain the code is buggy, why only pretty? Well I am not a professional Python developer and secondly here and there I am not 100% sure why the flow in code as it is.
First of all I believe the update_method
replace
is buggier thanstack
. Since with 0.80 there is the announcement thatreplace
is the future default it should basically work and the features of what can be used and what not should be documented. Of course I am willing to help with documentation and debugging where ever I can - I am not expecting a ready made fix necessarily. I just want to understand the way forward to continue most efficiently.Claims:
Claim 1:
replace
will not show anything on the display with the current codeI claim the faulty code is here
https://github.com/missionpinball/mpf/blob/35a84ba29c54acc6ce1afab28bb0e9edca07e301/mpf/devices/segment_display/segment_display.py#L159
the color you give as an argument is None. If you add before
color = self._current_state.text.get_colors()
then you get a text output. Is that single line of code the final solution? I don't know, here comes my uncertainty what I need to check which color is the right one to set somewhere else. For me that adds white as color and I have a single color segment display, so I don't care about the color.
Next problem now is that the full text is flashing, because the flashing parameter is None which is probably not an acceptable value. If you add another line
flashing = self._current_state.flashing
then the flashing is gone (I don't care about the flashing for now, but most likely something similar is needed for the flashing mask). Again not sure if that is the final answer to solve that problem.
Claim 2: Configured transitions will not work at all for update_method
replace
I see in the code for update method
stack
that certain code is being executed for transitions, I am not able to find any code execution for transitions if update methodreplace
is being used.From here:
https://github.com/missionpinball/mpf/blob/35a84ba29c54acc6ce1afab28bb0e9edca07e301/mpf/devices/segment_display/segment_display.py#L159
We jump directly to set the text to the display:
https://github.com/missionpinball/mpf/blob/35a84ba29c54acc6ce1afab28bb0e9edca07e301/mpf/devices/segment_display/segment_display.py#L361
Claim 3:
stack
has issues as wellCannot prove with code lines at the moment, but the behavior is more than strange. I believe I personally don't need
stack
(ifreplace
works), sincereplace
is the new default I would assume that most people are fine withreplace
.Questions:
Of course I understand people work on this a hobby and things take time. In order to avoid frustration for mpf users I hope some clear communication can be made, even if the statement is "won't touch in the next 2 years" - fully acceptable from my point of view, people will figure out how to deal with the situation.
Q1:
Is there a timeline on the to do list when this will be handled?
Q2:
Can I help? Reach out to me (may 1:1) what is most efficient for you.
Q3:
Is my claim 2 correct? If yes I would add that to the mpf docs that people are aware. Best with a statement if that will change in the near/far future.
Beta Was this translation helpful? Give feedback.
All reactions