Skip to content

Commit b71bded

Browse files
authored
Disable curve interactivity and point selection in real-time mode (#114)
1 parent 2743d53 commit b71bded

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

robot_log_visualizer/plotter/pyqtgraph_viewer_canvas.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
import pyqtgraph as pg # type: ignore
1111
from qtpy import QtCore, QtWidgets # type: ignore
1212

13-
from robot_log_visualizer.utils.utils import ColorPalette
1413
from robot_log_visualizer.signal_provider.signal_provider import ProviderType
14+
from robot_log_visualizer.utils.utils import ColorPalette
1515

1616
# ------------------------------------------------------------------------
1717
# Type aliases
@@ -201,6 +201,11 @@ def _add_missing_curves(
201201
symbol=None,
202202
)
203203

204+
# For real-time mode, disable curve clickability to avoid interfering with live updates
205+
if self._signal_provider.provider_type == ProviderType.REALTIME:
206+
self._curves[key].setCurveClickable(False)
207+
self._curves[key].setEnabled(False)
208+
204209
def _remove_obsolete_curves(self, paths: Sequence[Path]) -> None:
205210
"""Delete curves that disappeared from *paths*."""
206211
valid = {"/".join(p) for p in paths}
@@ -240,6 +245,10 @@ def _on_mouse_click(self, event) -> None: # noqa: N802
240245
if event.button() != QtCore.Qt.MouseButton.LeftButton:
241246
return # ignore other buttons
242247

248+
# Disable point selection / labels in realtime mode
249+
if self._signal_provider.provider_type == ProviderType.REALTIME:
250+
return
251+
243252
# Scene → data coordinates
244253
scene_pos = event.scenePos()
245254
if not self._plot.sceneBoundingRect().contains(scene_pos):

0 commit comments

Comments
 (0)