diff options
author | brenda-br | 2023-02-08 16:52:50 +0530 |
---|---|---|
committer | brenda-br | 2023-02-08 16:52:50 +0530 |
commit | 228b1d1c72f7b962e46a4e2b52d90b84d2235aa0 (patch) | |
tree | 5947cb55c53b20ce4d05436c7b25bb6652389f0b /Graphics.py | |
parent | 733286b141b5ce14d84991b7404f1de945664b8e (diff) | |
download | Chemical-Simulator-GUI-228b1d1c72f7b962e46a4e2b52d90b84d2235aa0.tar.gz Chemical-Simulator-GUI-228b1d1c72f7b962e46a4e2b52d90b84d2235aa0.tar.bz2 Chemical-Simulator-GUI-228b1d1c72f7b962e46a4e2b52d90b84d2235aa0.zip |
Fix #52 Disable input data tab for output material stream
Diffstat (limited to 'Graphics.py')
-rw-r--r-- | Graphics.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/Graphics.py b/Graphics.py index aa032ec..8e3a24c 100644 --- a/Graphics.py +++ b/Graphics.py @@ -348,6 +348,17 @@ class NodeSocket(QtWidgets.QGraphicsItem): self.new_line.source.parent.obj.add_connection(0, self.new_line.source.id, self.new_line.target.parent.obj) if self.new_line.target.parent.obj.type not in stm: self.new_line.target.parent.obj.add_connection(1, self.new_line.target.id, self.new_line.source.parent.obj) # Input stream if flag is 1 + + sc = self.new_line.source.parent + tg = self.new_line.target.parent + if(sc.obj.type == 'MaterialStream'): + sc_no_input_lines = len(sc.input[0].in_lines) + if(sc_no_input_lines > 0): + sc.obj.disableInputDataTab(sc.dock_widget) + if(tg.obj.type == 'MaterialStream'): + tg_no_input_lines = len(tg.input[0].in_lines) + if(tg_no_input_lines > 0): + tg.obj.disableInputDataTab(tg.dock_widget) elif (self.type =='in') and (item.type == 'op'): self.new_line.source = item @@ -359,7 +370,17 @@ class NodeSocket(QtWidgets.QGraphicsItem): self.new_line.source.parent.obj.add_connection(0, self.new_line.source.id, self.new_line.target.parent.obj) if self.new_line.target.parent.obj.type not in stm: self.new_line.target.parent.obj.add_connection(1, self.new_line.target.id, self.new_line.source.parent.obj) - + + sc = self.new_line.source.parent + tg = self.new_line.target.parent + if(sc.obj.type == 'MaterialStream'): + sc_no_input_lines = len(sc.input[0].in_lines) + if(sc_no_input_lines > 0): + sc.obj.disableInputDataTab(sc.dock_widget) + if(tg.obj.type == 'MaterialStream'): + tg_no_input_lines = len(tg.input[0].in_lines) + if(tg_no_input_lines > 0): + tg.obj.disableInputDataTab(tg.dock_widget) else: self.scene().removeItem(self.new_line) |