Skip to content

Commit fdb7008

Browse files
committed
feat: migrate logpanel to table model/view
1 parent c991fae commit fdb7008

10 files changed

Lines changed: 537 additions & 587 deletions

File tree

bec_widgets/cli/client.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2867,24 +2867,24 @@ def get_data(self) -> "np.ndarray":
28672867

28682868

28692869
class LogPanel(RPCBase):
2870-
"""Displays a log panel"""
2870+
"""Live display of the BEC logs in a table view."""
28712871

28722872
@rpc_call
2873-
def set_plain_text(self, text: str) -> None:
2873+
def remove(self):
28742874
"""
2875-
Set the plain text of the widget.
2876-
2877-
Args:
2878-
text (str): The text to set.
2875+
Cleanup the BECConnector
28792876
"""
28802877

28812878
@rpc_call
2882-
def set_html_text(self, text: str) -> None:
2879+
def attach(self):
2880+
"""
2881+
None
28832882
"""
2884-
Set the HTML text of the widget.
28852883

2886-
Args:
2887-
text (str): The text to set.
2884+
@rpc_call
2885+
def detach(self):
2886+
"""
2887+
Detach the widget from its parent dock widget (if widget is in the dock), making it a floating widget.
28882888
"""
28892889

28902890

bec_widgets/widgets/containers/advanced_dock_area/advanced_dock_area.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
from bec_widgets.widgets.progress.ring_progress_bar import RingProgressBar
7979
from bec_widgets.widgets.services.bec_queue.bec_queue import BECQueue
8080
from bec_widgets.widgets.services.bec_status_box.bec_status_box import BECStatusBox
81-
from bec_widgets.widgets.utility.logpanel import LogPanel
8281
from bec_widgets.widgets.utility.visual.dark_mode_button.dark_mode_button import DarkModeButton
8382

8483
logger = bec_logger.logger
@@ -310,7 +309,6 @@ def _setup_toolbar(self):
310309
),
311310
"terminal": (WebConsole.ICON_NAME, "Add Terminal", "WebConsole"),
312311
"bec_shell": (WebConsole.ICON_NAME, "Add BEC Shell", "WebConsole"),
313-
"log_panel": (LogPanel.ICON_NAME, "Add LogPanel - Disabled", "LogPanel"),
314312
"sbb_monitor": ("train", "Add SBB Monitor", "SBBMonitor"),
315313
}
316314

@@ -424,9 +422,7 @@ def _connect_menu(menu_key: str):
424422
# first two items not needed for this part
425423
for key, (_, _, widget_type) in mapping.items():
426424
act = menu.actions[key].action
427-
if widget_type == "LogPanel":
428-
act.setEnabled(False) # keep disabled per issue #644
429-
elif key == "terminal":
425+
if key == "terminal":
430426
act.triggered.connect(
431427
lambda _, t=widget_type: self.new(widget=t, closable=True, startup_cmd=None)
432428
)
@@ -450,10 +446,7 @@ def _connect_flat_actions(mapping: dict[str, tuple[str, str, str]]):
450446
for action_id, (_, _, widget_type) in mapping.items():
451447
flat_action_id = f"flat_{action_id}"
452448
flat_action = self.toolbar.components.get_action(flat_action_id).action
453-
if widget_type == "LogPanel":
454-
flat_action.setEnabled(False) # keep disabled per issue #644
455-
else:
456-
flat_action.triggered.connect(lambda _, t=widget_type: self.new(t))
449+
flat_action.triggered.connect(lambda _, t=widget_type: self.new(t))
457450

458451
_connect_flat_actions(self._ACTION_MAPPINGS["menu_plots"])
459452
_connect_flat_actions(self._ACTION_MAPPINGS["menu_devices"])

bec_widgets/widgets/containers/dock/dock_area.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
from bec_widgets.widgets.progress.ring_progress_bar.ring_progress_bar import RingProgressBar
3838
from bec_widgets.widgets.services.bec_queue.bec_queue import BECQueue
3939
from bec_widgets.widgets.services.bec_status_box.bec_status_box import BECStatusBox
40-
from bec_widgets.widgets.utility.logpanel.logpanel import LogPanel
4140
from bec_widgets.widgets.utility.visual.dark_mode_button.dark_mode_button import DarkModeButton
4241

4342
logger = bec_logger.logger
@@ -222,13 +221,6 @@ def _setup_toolbar(self):
222221
filled=True,
223222
parent=self,
224223
),
225-
# FIXME temporarily disabled -> issue #644
226-
"log_panel": MaterialIconAction(
227-
icon_name=LogPanel.ICON_NAME,
228-
tooltip="Add LogPanel - Disabled",
229-
filled=True,
230-
parent=self,
231-
),
232224
"sbb_monitor": MaterialIconAction(
233225
icon_name="train", tooltip="Add SBB Monitor", filled=True, parent=self
234226
),
@@ -326,8 +318,6 @@ def _hook_toolbar(self):
326318
menu_utils.actions["progress_bar"].action.triggered.connect(
327319
lambda: self._create_widget_from_toolbar(widget_name="RingProgressBar")
328320
)
329-
# FIXME temporarily disabled -> issue #644
330-
menu_utils.actions["log_panel"].action.setEnabled(False)
331321

332322
menu_utils.actions["sbb_monitor"].action.triggered.connect(
333323
lambda: self._create_widget_from_toolbar(widget_name="SBBMonitor")

bec_widgets/widgets/utility/logpanel/_util.py

Lines changed: 0 additions & 58 deletions
This file was deleted.

bec_widgets/widgets/utility/logpanel/log_panel_plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def domXml(self):
3030
return DOM_XML
3131

3232
def group(self):
33-
return "BEC Services"
33+
return ""
3434

3535
def icon(self):
3636
return designer_material_icon(LogPanel.ICON_NAME)
@@ -51,7 +51,7 @@ def name(self):
5151
return "LogPanel"
5252

5353
def toolTip(self):
54-
return "Displays a log panel"
54+
return "LogPanel"
5555

5656
def whatsThis(self):
5757
return self.toolTip()

0 commit comments

Comments
 (0)