Fixed signal tree and added progress bar in besim
This commit is contained in:
@@ -15,6 +15,14 @@ from bedit_gui.views.simulation_window import SimulationWindow
|
||||
logger = get_logger(__name__)
|
||||
|
||||
|
||||
def _signal_tree_parts(signal: str) -> list[str]:
|
||||
if signal.startswith("der(") and signal.endswith(")"):
|
||||
parts = signal[4:-1].split(".")
|
||||
if len(parts) > 1:
|
||||
return [*parts[:-1], f"der({parts[-1]})"]
|
||||
return signal.split(".")
|
||||
|
||||
|
||||
class SimulationPlotController(QObject):
|
||||
def __init__(self, window: SimulationWindow, files: SimulationFileController) -> None:
|
||||
super().__init__(window)
|
||||
@@ -129,7 +137,7 @@ class SimulationPlotController(QObject):
|
||||
nodes: dict[tuple[str, ...], QTreeWidgetItem] = {}
|
||||
for signal in signals:
|
||||
parent = tree.invisibleRootItem()
|
||||
parts = signal.split(".")
|
||||
parts = _signal_tree_parts(signal)
|
||||
for depth, part in enumerate(parts, start=1):
|
||||
path = tuple(parts[:depth])
|
||||
item = nodes.get(path)
|
||||
|
||||
Reference in New Issue
Block a user