Split dashboard data into two columns
This commit is contained in:
@@ -307,10 +307,23 @@ class ReactorDashboard:
|
|||||||
win.erase()
|
win.erase()
|
||||||
win.box()
|
win.box()
|
||||||
win.addstr(0, 2, " Plant Overview ", curses.color_pair(1) | curses.A_BOLD)
|
win.addstr(0, 2, " Plant Overview ", curses.color_pair(1) | curses.A_BOLD)
|
||||||
y = 2
|
height, width = win.getmaxyx()
|
||||||
y = self._draw_section(
|
inner_height = height - 2
|
||||||
win,
|
inner_width = width - 2
|
||||||
y,
|
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",
|
"Core",
|
||||||
[
|
[
|
||||||
("Fuel Temp", f"{state.core.fuel_temperature:8.1f} K"),
|
("Fuel Temp", f"{state.core.fuel_temperature:8.1f} K"),
|
||||||
@@ -322,10 +335,10 @@ class ReactorDashboard:
|
|||||||
("Reactivity", f"{state.core.reactivity_margin:+.4f}"),
|
("Reactivity", f"{state.core.reactivity_margin:+.4f}"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
y = self._draw_section(win, y, "Key Poisons / Emitters", self._poison_lines(state))
|
left_y = self._draw_section(left_win, left_y, "Key Poisons / Emitters", self._poison_lines(state))
|
||||||
y = self._draw_section(
|
left_y = self._draw_section(
|
||||||
win,
|
left_win,
|
||||||
y,
|
left_y,
|
||||||
"Primary Loop",
|
"Primary Loop",
|
||||||
[
|
[
|
||||||
("Pump1", self._pump_status(state.primary_pumps, 0)),
|
("Pump1", self._pump_status(state.primary_pumps, 0)),
|
||||||
@@ -336,9 +349,9 @@ class ReactorDashboard:
|
|||||||
("Pressure", f"{state.primary_loop.pressure:5.2f} MPa"),
|
("Pressure", f"{state.primary_loop.pressure:5.2f} MPa"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
y = self._draw_section(
|
self._draw_section(
|
||||||
win,
|
left_win,
|
||||||
y,
|
left_y,
|
||||||
"Secondary Loop",
|
"Secondary Loop",
|
||||||
[
|
[
|
||||||
("Pump1", self._pump_status(state.secondary_pumps, 0)),
|
("Pump1", self._pump_status(state.secondary_pumps, 0)),
|
||||||
@@ -349,20 +362,16 @@ class ReactorDashboard:
|
|||||||
("Steam Quality", f"{state.secondary_loop.steam_quality:5.2f}"),
|
("Steam Quality", f"{state.secondary_loop.steam_quality:5.2f}"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
y = self._draw_section(
|
|
||||||
win,
|
right_y = 0
|
||||||
y,
|
|
||||||
"Generators",
|
|
||||||
self._generator_lines(state),
|
|
||||||
)
|
|
||||||
consumer_status = "n/a"
|
consumer_status = "n/a"
|
||||||
consumer_demand = 0.0
|
consumer_demand = 0.0
|
||||||
if self.reactor.consumer:
|
if self.reactor.consumer:
|
||||||
consumer_status = "ONLINE" if self.reactor.consumer.online else "OFF"
|
consumer_status = "ONLINE" if self.reactor.consumer.online else "OFF"
|
||||||
consumer_demand = self.reactor.consumer.demand_mw
|
consumer_demand = self.reactor.consumer.demand_mw
|
||||||
y = self._draw_section(
|
right_y = self._draw_section(
|
||||||
win,
|
right_win,
|
||||||
y,
|
right_y,
|
||||||
"Turbine / Grid",
|
"Turbine / Grid",
|
||||||
[
|
[
|
||||||
("Turbines", " ".join(self._turbine_status_lines())),
|
("Turbines", " ".join(self._turbine_status_lines())),
|
||||||
@@ -381,8 +390,9 @@ class ReactorDashboard:
|
|||||||
("Demand", f"{consumer_demand:7.1f} MW"),
|
("Demand", f"{consumer_demand:7.1f} MW"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
y = self._draw_section(win, y, "Maintenance", self._maintenance_lines())
|
right_y = self._draw_section(right_win, right_y, "Generators", self._generator_lines(state))
|
||||||
y = self._draw_health_bars(win, y)
|
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:
|
def _draw_help_panel(self, win: "curses._CursesWindow") -> None:
|
||||||
win.erase()
|
win.erase()
|
||||||
|
|||||||
Reference in New Issue
Block a user