diff --git a/src/reactor_sim/dashboard.py b/src/reactor_sim/dashboard.py index ee8128c..f36b1de 100644 --- a/src/reactor_sim/dashboard.py +++ b/src/reactor_sim/dashboard.py @@ -307,10 +307,23 @@ class ReactorDashboard: win.erase() win.box() win.addstr(0, 2, " Plant Overview ", curses.color_pair(1) | curses.A_BOLD) - y = 2 - y = self._draw_section( - win, - y, + height, width = win.getmaxyx() + inner_height = height - 2 + inner_width = width - 2 + left_width = max(28, inner_width // 2) + right_width = inner_width - left_width + left_win = win.derwin(inner_height, left_width, 1, 1) + right_win = win.derwin(inner_height, right_width, 1, 1 + left_width) + for row in range(1, height - 1): + win.addch(row, 1 + left_width, curses.ACS_VLINE) + + left_win.erase() + right_win.erase() + + left_y = 0 + left_y = self._draw_section( + left_win, + left_y, "Core", [ ("Fuel Temp", f"{state.core.fuel_temperature:8.1f} K"), @@ -322,10 +335,10 @@ class ReactorDashboard: ("Reactivity", f"{state.core.reactivity_margin:+.4f}"), ], ) - y = self._draw_section(win, y, "Key Poisons / Emitters", self._poison_lines(state)) - y = self._draw_section( - win, - y, + left_y = self._draw_section(left_win, left_y, "Key Poisons / Emitters", self._poison_lines(state)) + left_y = self._draw_section( + left_win, + left_y, "Primary Loop", [ ("Pump1", self._pump_status(state.primary_pumps, 0)), @@ -336,9 +349,9 @@ class ReactorDashboard: ("Pressure", f"{state.primary_loop.pressure:5.2f} MPa"), ], ) - y = self._draw_section( - win, - y, + self._draw_section( + left_win, + left_y, "Secondary Loop", [ ("Pump1", self._pump_status(state.secondary_pumps, 0)), @@ -349,20 +362,16 @@ class ReactorDashboard: ("Steam Quality", f"{state.secondary_loop.steam_quality:5.2f}"), ], ) - y = self._draw_section( - win, - y, - "Generators", - self._generator_lines(state), - ) + + right_y = 0 consumer_status = "n/a" consumer_demand = 0.0 if self.reactor.consumer: consumer_status = "ONLINE" if self.reactor.consumer.online else "OFF" consumer_demand = self.reactor.consumer.demand_mw - y = self._draw_section( - win, - y, + right_y = self._draw_section( + right_win, + right_y, "Turbine / Grid", [ ("Turbines", " ".join(self._turbine_status_lines())), @@ -381,8 +390,9 @@ class ReactorDashboard: ("Demand", f"{consumer_demand:7.1f} MW"), ], ) - y = self._draw_section(win, y, "Maintenance", self._maintenance_lines()) - y = self._draw_health_bars(win, y) + right_y = self._draw_section(right_win, right_y, "Generators", self._generator_lines(state)) + right_y = self._draw_section(right_win, right_y, "Maintenance", self._maintenance_lines()) + self._draw_health_bars(right_win, right_y) def _draw_help_panel(self, win: "curses._CursesWindow") -> None: win.erase()