fix: Reduce flickering in Modbus tool UI over SSH
Replaced with and with in the and functions of . This change optimizes screen updates in the Curses-based UI, which should significantly reduce flickering when running the tool over SSH connections. Signed-off-by: Eduard Iten <eduard@iten.pro>
This commit is contained in:
parent
4df0181d7f
commit
32bb77926f
|
|
@ -189,7 +189,7 @@ def file_browser(stdscr):
|
|||
selected_index = 0
|
||||
|
||||
while True:
|
||||
stdscr.clear()
|
||||
stdscr.erase()
|
||||
h, w = stdscr.getmaxyx()
|
||||
stdscr.addstr(0, 0, f"Select Firmware File: {path}".ljust(w-1), curses.color_pair(2))
|
||||
|
||||
|
|
@ -293,7 +293,7 @@ def main_menu(stdscr, slave_id):
|
|||
else:
|
||||
message = "-> Firmware update cancelled."
|
||||
|
||||
stdscr.clear()
|
||||
stdscr.erase()
|
||||
if is_updating:
|
||||
with update_lock: prog, msg = update_status["progress"], update_status["message"]
|
||||
stdscr.addstr(h // 2 - 1, w // 2 - 25, "FIRMWARE UPDATE IN PROGRESS", curses.A_BOLD | curses.color_pair(2))
|
||||
|
|
@ -328,7 +328,7 @@ def main_menu(stdscr, slave_id):
|
|||
if input_mode:
|
||||
curses.curs_set(1); stdscr.addstr(h - 2, 0, (input_prompt + input_str).ljust(w-1), curses.color_pair(2)); stdscr.move(h - 2, len(input_prompt) + len(input_str))
|
||||
else: curses.curs_set(0)
|
||||
stdscr.refresh()
|
||||
curses.doupdate()
|
||||
|
||||
def main():
|
||||
global client
|
||||
|
|
|
|||
Loading…
Reference in New Issue