From c70fb56631fa4231e2a475ac65d819cfb4336947 Mon Sep 17 00:00:00 2001 From: Anthony DiGirolamo Date: Thu, 19 May 2022 14:29:54 -0700 Subject: [PATCH] pw_console: Early log message arrival fix - The LogView class was not checking for existing messages in the LogStore instance on startup. This gave the impression that only one log arrived until the user scrolls or a new message arrives. - Bump pw_console MAX_FPS to 30. Change-Id: Ib8017e076f0da9d1e6d6b29ee944ade002148bc4 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/95364 Pigweed-Auto-Submit: Anthony DiGirolamo Reviewed-by: Armando Montanez Commit-Queue: Auto-Submit --- pw_console/py/pw_console/console_app.py | 2 +- pw_console/py/pw_console/log_view.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pw_console/py/pw_console/console_app.py b/pw_console/py/pw_console/console_app.py index b8363841ff..80511487ca 100644 --- a/pw_console/py/pw_console/console_app.py +++ b/pw_console/py/pw_console/console_app.py @@ -78,7 +78,7 @@ # Don't send fake_device logs to the root Python logger. _FAKE_DEVICE_LOG.propagate = False -MAX_FPS = 15 +MAX_FPS = 30 MIN_REDRAW_INTERVAL = (60.0 / MAX_FPS) / 60.0 diff --git a/pw_console/py/pw_console/log_view.py b/pw_console/py/pw_console/log_view.py index 2b54f9eb22..5ba56ebdaf 100644 --- a/pw_console/py/pw_console/log_view.py +++ b/pw_console/py/pw_console/log_view.py @@ -143,6 +143,9 @@ def __init__( # Cache of formatted text tuples used in the last UI render. self._line_fragment_cache: List[StyleAndTextTuples] = [] + # Check if any logs are already in the log_store and update the view. + self.new_logs_arrived() + def view_mode_changed(self) -> None: self._reset_log_screen_on_next_render = True