mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-12 05:42:59 +00:00
Add debug logging for ball and strike count
This commit is contained in:
@@ -325,12 +325,19 @@ class BaseMLBManager:
|
|||||||
strikes = situation.get('strikes', 0)
|
strikes = situation.get('strikes', 0)
|
||||||
outs = situation.get('outs', 0)
|
outs = situation.get('outs', 0)
|
||||||
|
|
||||||
|
if is_favorite_game:
|
||||||
|
self.logger.debug(f"[MLB] Raw situation data: {situation}")
|
||||||
|
self.logger.debug(f"[MLB] Count: {balls}-{strikes}, Outs: {outs}")
|
||||||
|
|
||||||
# Get base runners
|
# Get base runners
|
||||||
bases_occupied = [
|
bases_occupied = [
|
||||||
situation.get('onFirst', False),
|
situation.get('onFirst', False),
|
||||||
situation.get('onSecond', False),
|
situation.get('onSecond', False),
|
||||||
situation.get('onThird', False)
|
situation.get('onThird', False)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if is_favorite_game:
|
||||||
|
self.logger.debug(f"[MLB] Bases occupied: {bases_occupied}")
|
||||||
else:
|
else:
|
||||||
# Default values for non-live games
|
# Default values for non-live games
|
||||||
inning = 1
|
inning = 1
|
||||||
@@ -538,7 +545,6 @@ class MLBLiveManager(BaseMLBManager):
|
|||||||
new_logo_height = 32
|
new_logo_height = 32
|
||||||
logo_size = (new_logo_height, new_logo_height) # Increase size
|
logo_size = (new_logo_height, new_logo_height) # Increase size
|
||||||
logo_y_offset = 0# Center vertically
|
logo_y_offset = 0# Center vertically
|
||||||
# center_y = height // 2 # center_y not used for logo placement now
|
|
||||||
|
|
||||||
# Load and place team logos (same as base method)
|
# Load and place team logos (same as base method)
|
||||||
away_logo = self._get_team_logo(game_data['away_team'])
|
away_logo = self._get_team_logo(game_data['away_team'])
|
||||||
@@ -652,6 +658,12 @@ class MLBLiveManager(BaseMLBManager):
|
|||||||
# --- Draw Balls-Strikes Count (BDF Font) ---
|
# --- Draw Balls-Strikes Count (BDF Font) ---
|
||||||
balls = game_data.get('balls', 0)
|
balls = game_data.get('balls', 0)
|
||||||
strikes = game_data.get('strikes', 0)
|
strikes = game_data.get('strikes', 0)
|
||||||
|
|
||||||
|
# Add debug logging for count
|
||||||
|
if game_data['home_team'] in self.favorite_teams or game_data['away_team'] in self.favorite_teams:
|
||||||
|
self.logger.debug(f"[MLB] Displaying count: {balls}-{strikes}")
|
||||||
|
self.logger.debug(f"[MLB] Raw count data: balls={game_data.get('balls')}, strikes={game_data.get('strikes')}")
|
||||||
|
|
||||||
count_text = f"{balls}-{strikes}"
|
count_text = f"{balls}-{strikes}"
|
||||||
bdf_font = self.display_manager.calendar_font
|
bdf_font = self.display_manager.calendar_font
|
||||||
bdf_font.set_char_size(height=7*64) # Set 7px height
|
bdf_font.set_char_size(height=7*64) # Set 7px height
|
||||||
@@ -662,7 +674,6 @@ class MLBLiveManager(BaseMLBManager):
|
|||||||
count_y = cluster_bottom_y + 2 # Start 2 pixels below cluster
|
count_y = cluster_bottom_y + 2 # Start 2 pixels below cluster
|
||||||
|
|
||||||
# Center horizontally within the BASE cluster width
|
# Center horizontally within the BASE cluster width
|
||||||
# count_x = overall_start_x + (total_width - count_text_width) // 2 # Old way
|
|
||||||
count_x = bases_origin_x + (base_cluster_width - count_text_width) // 2
|
count_x = bases_origin_x + (base_cluster_width - count_text_width) // 2
|
||||||
|
|
||||||
# Ensure draw object is set and draw text
|
# Ensure draw object is set and draw text
|
||||||
|
|||||||
Reference in New Issue
Block a user