mlb-led-scoreboard icon indicating copy to clipboard operation
mlb-led-scoreboard copied to clipboard

Added Pitch Count

Open tracerrx opened this issue 2 years ago • 12 comments

Added pitch count to the pitcher scroll. Set show_pitch_count to true/false in config.json to enable/disable

tracerrx avatar Sep 01 '22 17:09 tracerrx

I think we should avoid using config inside the game data. We should just fetch it always and use config in the display side

WardBrian avatar Sep 01 '22 18:09 WardBrian

Agreed, Game objects are data containers. Turning config on or off should swap display options, not what the underlying data includes (unless there's a good reason for that)

ty-porter avatar Sep 01 '22 18:09 ty-porter

Storing it alongside balls/strikes/pitch speed also allows easier control over where the user would like it to be. For example, I think I'd want it as a separate text element rather than part of the pitcher's name

WardBrian avatar Sep 01 '22 19:09 WardBrian

I think this moves it to the right place

tracerrx avatar Sep 01 '22 22:09 tracerrx

How do you feel about this setting being in the layout rather than the config?

WardBrian avatar Sep 02 '22 01:09 WardBrian

Correct me if I'm wrong... The reason it's a config setting is because we want it to scroll with the existing pitcher text?

So our options are:

  • Use the layout system, which won't scroll and may not fit on smaller matrix sizes
  • Use the config system, which lets us concat to the pitcher scroll but is really wonky to pass in
  • Enable it all the time without a config??

ty-porter avatar Sep 02 '22 01:09 ty-porter

I wouldn’t want it on the pitcher text I think, I would want it like the speeds (probably under them, on my layout), but it could be an “off” “pitcher name” “separate” setting in the layout

e.g. just ignore the x and y if it’s set to “name”

WardBrian avatar Sep 02 '22 01:09 WardBrian

I wouldn’t want it on the pitcher text I think, I would want it like the speeds (probably under them, on my layout), but it could be an “off” “pitcher name” “separate” setting in the layout

e.g. just ignore the x and y if it’s set to “name”

I see, it's been a while since I've written any new layouts. I think this is a good approach.

@tracerrx Does this change make sense to you?

ty-porter avatar Sep 02 '22 01:09 ty-porter

I understand the logic of having it an independent and being able to move it around the layout... But wouldn't that prohibit it from being part of the pitcher scroll?

tracerrx avatar Sep 02 '22 01:09 tracerrx

I don’t think so, you should be able to append it right before rendering.

I can sketch this out in my own fork if it’s helpful, you already did the hard part of finding where the data lives in the API

WardBrian avatar Sep 02 '22 01:09 WardBrian

So in layout file, under atbat something like "pitch_count": { "font_name": "4x6", "x": 1, "y": 50, "enabled": true, "append_pitcher_Name": true },

And if append pitch name==true, don't render separately but append to the pitcher name.

tracerrx avatar Sep 02 '22 02:09 tracerrx

That sounds good to me

WardBrian avatar Sep 02 '22 02:09 WardBrian

Agreed.. Not sure how that got there… must have autocompleted in my ide

On Sep 1, 2022 at 9:45:34 PM, Tyler Porter @.***> wrote:

@.**** commented on this pull request.

In renderers/games/game.py https://github.com/MLB-LED-Scoreboard/mlb-led-scoreboard/pull/407#discussion_r961221305 :

@@ -3,6 +3,7 @@ except ImportError: from RGBMatrixEmulator import graphics

+from distutils import config

This import is not needed, probably breaks some stuff

— Reply to this email directly, view it on GitHub https://github.com/MLB-LED-Scoreboard/mlb-led-scoreboard/pull/407#pullrequestreview-1094221689, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJTDESWR4RQLWUDMZWXRG3V4FL35ANCNFSM6AAAAAAQCSQJOY . You are receiving this because you authored the thread.Message ID: @.*** com>

tracerrx avatar Oct 11 '22 07:10 tracerrx

Sure.. I prob can’t get around to it until Tuesday though

On Sep 1, 2022 at 9:24:24 PM, Brian Ward @.***> wrote:

How do you feel about this setting being in the layout rather than the config?

— Reply to this email directly, view it on GitHub https://github.com/MLB-LED-Scoreboard/mlb-led-scoreboard/pull/407#issuecomment-1234963099, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJTDEVBLXCBAXQIQTQRCWTV4FJMRANCNFSM6AAAAAAQCSQJOY . You are receiving this because you authored the thread.Message ID: @.***>

tracerrx avatar Oct 11 '22 07:10 tracerrx

What are the variables that need to changed in order to see the pitch count? I tried some of the above and not the board loops at start up.

pjockey avatar Mar 22 '23 20:03 pjockey

#431 implemented this feature in a way that only uses the coordinates file, not the config. You can see the example here: https://github.com/MLB-LED-Scoreboard/mlb-led-scoreboard/blob/0fee496dfa68232ab07daba329f899f70aeada50/coordinates/w64h32.json.example#L135-L140

WardBrian avatar Mar 22 '23 20:03 WardBrian