From 1a628cb6552c608227768515c74c088857bb7b93 Mon Sep 17 00:00:00 2001 From: Chirag Koyande Date: Thu, 12 Nov 2026 14:55:02 +0530 Subject: [PATCH 1/2] Fix component inputs editable after simulation --- src/main/python/utils/Container.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/python/utils/Container.py b/src/main/python/utils/Container.py index cdb32f7..1b3cd0c 100644 --- a/src/main/python/utils/Container.py +++ b/src/main/python/utils/Container.py @@ -367,7 +367,7 @@ def try_get_other_node_from_line(ln, this_item): # Lock all dock widgets to read-only on success for dw in dock_widget_lst: if hasattr(dw, 'set_read_only'): - dw.set_read_only(True) + dw.set_read_only(False) else: self.signals.msg_signal.emit( f"[{self.current_time()}] Simulation Failed." @@ -425,9 +425,19 @@ def _populate_results(self): DockWidget.show_result(dock_widget_lst) # Re-apply read-only state because show_result recreates the input fields + # Keep recreated input fields editable after results are populated for dw in dock_widget_lst: if hasattr(dw, 'set_read_only'): - dw.set_read_only(True) + dw.set_read_only(False) + + # Preserve connection-based restrictions for MaterialStream + for it in self.graphics.scene.items(): + if isinstance(it, NodeItem) and getattr(it, "type", "") == "MaterialStream": + try: + if len(it.input[0].in_lines) > 0: + it.obj.disableInputDataTab(it.dock_widget) + except Exception as e: + print(f"[DEBUG] MaterialStream input state update failed: {e}") # Make all result table items non-editable for dw in dock_widget_lst: From efce8e1a55b4e7e4b95b7ada2f3d02a141ec0008 Mon Sep 17 00:00:00 2001 From: Chirag Koyande Date: Thu, 12 Nov 2026 15:03:25 +0530 Subject: [PATCH 2/2] Update tests for editable inputs after simulation --- tests/test_container.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_container.py b/tests/test_container.py index 549693d..1c741fc 100644 --- a/tests/test_container.py +++ b/tests/test_container.py @@ -397,11 +397,11 @@ def test_partially_connected_mixer_warns(self): self.container.simulate("EQN") self.assertTrue(self.any_message_contains(f"Warning: {mixer.name} - Missing Socket Connection(s).")) - def test_success_sets_dock_widgets_read_only(self): + def test_success_keeps_dock_widgets_editable(self): dw = MagicMock() dock_widget_lst.append(dw) self.container.simulate("EQN") - dw.set_read_only.assert_called_with(True) + dw.set_read_only.assert_called_with(False) def test_failure_when_result_is_too_short(self): dw = MagicMock() @@ -488,7 +488,7 @@ def test_results_are_shown_and_tables_made_read_only(self): self.container._populate_results() mock_show.assert_called_once_with(dock_widget_lst) - dock.set_read_only.assert_called_once_with(True) + dock.set_read_only.assert_called_once_with(False) for r in range(2): for c in range(2): flags = table.item(r, c).flags()