mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 13:02:59 +00:00
Scroll delay changes
This commit is contained in:
@@ -90,7 +90,7 @@
|
||||
"enabled": true,
|
||||
"update_interval": 600,
|
||||
"scroll_speed": 1,
|
||||
"scroll_delay": 0.01,
|
||||
"scroll_delay": 0.005,
|
||||
"toggle_chart": false,
|
||||
"symbols": [
|
||||
"ASTS",
|
||||
@@ -116,7 +116,7 @@
|
||||
"enabled": true,
|
||||
"update_interval": 3600,
|
||||
"scroll_speed": 1,
|
||||
"scroll_delay": 0.01,
|
||||
"scroll_delay": 0.005,
|
||||
"max_headlines_per_symbol": 1,
|
||||
"headlines_per_rotation": 2
|
||||
},
|
||||
@@ -135,7 +135,7 @@
|
||||
],
|
||||
"update_interval": 3600,
|
||||
"scroll_speed": 1,
|
||||
"scroll_delay": 0.01,
|
||||
"scroll_delay": 0.005,
|
||||
"loop": true,
|
||||
"future_fetch_days": 50,
|
||||
"show_channel_logos": true
|
||||
@@ -437,7 +437,7 @@
|
||||
"enabled": true,
|
||||
"update_interval": 300,
|
||||
"scroll_speed": 1,
|
||||
"scroll_delay": 0.01,
|
||||
"scroll_delay": 0.005,
|
||||
"headlines_per_feed": 2,
|
||||
"enabled_feeds": [
|
||||
"NFL",
|
||||
|
||||
@@ -55,7 +55,7 @@ class NewsManager:
|
||||
|
||||
# Get scroll settings from config
|
||||
self.scroll_speed = self.news_config.get('scroll_speed', 2)
|
||||
self.scroll_delay = self.news_config.get('scroll_delay', 0.02)
|
||||
self.scroll_delay = self.news_config.get('scroll_delay', 0.01) # Reduced from 0.02 to 0.01 for smoother scrolling
|
||||
self.update_interval = self.news_config.get('update_interval', 300) # 5 minutes
|
||||
|
||||
# Get headline settings from config
|
||||
|
||||
@@ -555,14 +555,14 @@ class StockManager:
|
||||
self.display_manager.update_display(image_array)
|
||||
|
||||
# Small delay for smooth animation
|
||||
time.sleep(0.01) # Reduced delay to 10ms for smoother scrolling
|
||||
time.sleep(0.005) # Reduced delay to 5ms for smoother scrolling
|
||||
|
||||
# Show final position briefly
|
||||
final_image = full_image.crop((scroll_width - width, 0, scroll_width, height))
|
||||
rgb_image = final_image.convert('RGB')
|
||||
image_array = np.array(rgb_image)
|
||||
self.display_manager.update_display(image_array)
|
||||
time.sleep(0.5) # Brief pause at the end
|
||||
time.sleep(0.2) # Reduced pause at the end for better performance
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Error updating stock display for {symbol}: {str(e)}")
|
||||
|
||||
@@ -35,7 +35,7 @@ class StockNewsManager:
|
||||
|
||||
# Get scroll settings from config with faster defaults
|
||||
self.scroll_speed = self.stock_news_config.get('scroll_speed', 1)
|
||||
self.scroll_delay = self.stock_news_config.get('scroll_delay', 0.001) # Default to 1ms instead of 50ms
|
||||
self.scroll_delay = self.stock_news_config.get('scroll_delay', 0.005) # Default to 5ms for smoother scrolling
|
||||
|
||||
# Get headline settings from config
|
||||
self.max_headlines_per_symbol = self.stock_news_config.get('max_headlines_per_symbol', 1)
|
||||
@@ -370,7 +370,7 @@ class StockNewsManager:
|
||||
draw = ImageDraw.Draw(self.display_manager.image)
|
||||
draw.text((width//4, height//2), "Loading news...", font=self.display_manager.small_font, fill=(255, 255, 255))
|
||||
self.display_manager.update_display()
|
||||
time.sleep(0.1) # Short delay to prevent CPU hogging
|
||||
# Removed sleep delay to improve scrolling performance
|
||||
return True
|
||||
|
||||
# --- Scrolling logic remains the same ---
|
||||
|
||||
Reference in New Issue
Block a user