summaryrefslogtreecommitdiff
path: root/src/main/python/utils/Container.py
diff options
context:
space:
mode:
authorbrenda-br2023-03-10 11:03:13 +0530
committerbrenda-br2023-03-10 11:11:25 +0530
commitc42c4267f9dd5763a0b7740aad8855faa452e9db (patch)
treee8e130bd4f8ab2d15ab789bf13c676d14391e2b5 /src/main/python/utils/Container.py
parenta427629ff7f678f5e77f2c15edfa07b3d021c90f (diff)
downloadChemical-Simulator-GUI-c42c4267f9dd5763a0b7740aad8855faa452e9db.tar.gz
Chemical-Simulator-GUI-c42c4267f9dd5763a0b7740aad8855faa452e9db.tar.bz2
Chemical-Simulator-GUI-c42c4267f9dd5763a0b7740aad8855faa452e9db.zip
Fix #67 Show Warning When Connection Not Properly Made and Some Minor Changes
Diffstat (limited to 'src/main/python/utils/Container.py')
-rw-r--r--src/main/python/utils/Container.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/main/python/utils/Container.py b/src/main/python/utils/Container.py
index c72026a..139346c 100644
--- a/src/main/python/utils/Container.py
+++ b/src/main/python/utils/Container.py
@@ -127,14 +127,26 @@ class Container():
def simulate(self,mode):
self.disableInterfaceforSimulation(True)
-
+ toAppend = ''
for i in self.graphics.scene.items():
- if (isinstance(i, NodeItem)):
+ showConnectionWarning = False
+ if isinstance(i, NodeItem):
try:
i.dock_widget.clear_results()
except AttributeError:
pass
+ for ip in i.input:
+ if len(ip.in_lines) == 0:
+ showConnectionWarning = True
+ for op in i.output:
+ if len(op.out_lines) == 0:
+ showConnectionWarning = True
+ if showConnectionWarning:
+ if toAppend != '':
+ toAppend+='<br>'
+ toAppend+="<span style=\"color:#999900\">Warning: "+i.name+" - Missing Socket Connection(s).</span>"
+
#print("SIMULATE")
#print(mode)
self.compounds = compound_selected
@@ -147,12 +159,14 @@ class Container():
if mode=='SM':
self.msg.append("<span>["+str(self.current_time())+"] Simulating in <b>Sequential</b> mode ... </span>")
+ self.msg.append(toAppend)
self.flowsheet.simulate_SM(self.ip,self.op)
self.msg_browser()
self.result=self.flowsheet.result_data
elif mode=='EQN':
self.msg.append("<span>["+str(self.current_time())+"] Simulating in <b>equation</b> mode ... </span>")
+ self.msg.append(toAppend)
self.flowsheet.simulate_EQN(self.msg)
self.result=self.flowsheet.result_data