aboutsummaryrefslogtreecommitdiff
path: root/picostream/cli.py
diff options
context:
space:
mode:
Diffstat (limited to 'picostream/cli.py')
-rw-r--r--picostream/cli.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/picostream/cli.py b/picostream/cli.py
index fa72518..c902348 100644
--- a/picostream/cli.py
+++ b/picostream/cli.py
@@ -46,11 +46,13 @@ class Streamer:
downsample_mode: str = "average",
offset_v: float = 0.0,
max_buffer_seconds: Optional[float] = None,
+ is_gui_mode: bool = False,
) -> None:
# --- Configuration ---
self.output_file = output_file
self.debug = debug
self.enable_live_plot = enable_live_plot
+ self.is_gui_mode = is_gui_mode
self.plot_window_s = plot_window_s
self.max_buffer_seconds = max_buffer_seconds
@@ -212,8 +214,9 @@ class Streamer:
# --- Signal Handling ---
# Only set the signal handler if not in GUI mode.
- # In GUI mode, the main function will handle signals to quit the Qt app.
- if not self.enable_live_plot:
+ # In GUI mode, the main window handles shutdown signals.
+ # In CLI plot mode, the main() function handles SIGINT to quit the Qt app.
+ if not self.is_gui_mode and not self.enable_live_plot:
signal.signal(signal.SIGINT, self.signal_handler)
# --- Live Plotting (optional) ---