feat(gui): Add pause/resume button and visual indicator
This commit is contained in:
13
src/gui_2.py
13
src/gui_2.py
@@ -2143,11 +2143,15 @@ class App:
|
|||||||
imgui.same_line()
|
imgui.same_line()
|
||||||
imgui.text(" | Status:")
|
imgui.text(" | Status:")
|
||||||
imgui.same_line()
|
imgui.same_line()
|
||||||
|
if self.mma_status == "paused":
|
||||||
|
imgui.text_colored(imgui.ImVec4(1, 0.5, 0, 1), "PIPELINE PAUSED")
|
||||||
|
imgui.same_line()
|
||||||
status_col = imgui.ImVec4(1, 1, 1, 1)
|
status_col = imgui.ImVec4(1, 1, 1, 1)
|
||||||
if self.mma_status == "idle": status_col = imgui.ImVec4(0.7, 0.7, 0.7, 1)
|
if self.mma_status == "idle": status_col = imgui.ImVec4(0.7, 0.7, 0.7, 1)
|
||||||
elif self.mma_status == "running": status_col = imgui.ImVec4(1, 1, 0, 1)
|
elif self.mma_status == "running": status_col = imgui.ImVec4(1, 1, 0, 1)
|
||||||
elif self.mma_status == "done": status_col = imgui.ImVec4(0, 1, 0, 1)
|
elif self.mma_status == "done": status_col = imgui.ImVec4(0, 1, 0, 1)
|
||||||
elif self.mma_status == "error": status_col = imgui.ImVec4(1, 0, 0, 1)
|
elif self.mma_status == "error": status_col = imgui.ImVec4(1, 0, 0, 1)
|
||||||
|
elif self.mma_status == "paused": status_col = imgui.ImVec4(1, 0.5, 0, 1)
|
||||||
imgui.text_colored(status_col, self.mma_status.upper())
|
imgui.text_colored(status_col, self.mma_status.upper())
|
||||||
imgui.same_line()
|
imgui.same_line()
|
||||||
imgui.text(" | Cost:")
|
imgui.text(" | Cost:")
|
||||||
@@ -2273,6 +2277,15 @@ class App:
|
|||||||
pass
|
pass
|
||||||
imgui.same_line()
|
imgui.same_line()
|
||||||
imgui.text(f"Status: {self.mma_status.upper()}")
|
imgui.text(f"Status: {self.mma_status.upper()}")
|
||||||
|
if self.controller and self.controller.engine and hasattr(self.controller.engine, '_pause_event'):
|
||||||
|
imgui.same_line()
|
||||||
|
is_paused = self.controller.engine._pause_event.is_set()
|
||||||
|
label = "Resume" if is_paused else "Pause"
|
||||||
|
if imgui.button(label):
|
||||||
|
if is_paused:
|
||||||
|
self.controller.engine.resume()
|
||||||
|
else:
|
||||||
|
self.controller.engine.pause()
|
||||||
if self.active_tier:
|
if self.active_tier:
|
||||||
imgui.same_line()
|
imgui.same_line()
|
||||||
imgui.text_colored(C_VAL, f"| Active: {self.active_tier}")
|
imgui.text_colored(C_VAL, f"| Active: {self.active_tier}")
|
||||||
|
|||||||
Reference in New Issue
Block a user