summaryrefslogtreecommitdiff
path: root/Streams.py
diff options
context:
space:
mode:
authorPravin Dalve2021-06-22 00:33:41 +0530
committerPravin Dalve2021-06-22 00:33:41 +0530
commitce501c2d9e437e3988105595d2e9068045a98720 (patch)
tree3c09fc3bebb65db5942cd4f4a5425bde87978428 /Streams.py
parent3f8095e27df1ea62c4356c08de09cc42ffca00ed (diff)
downloadChemical-Simulator-GUI-ce501c2d9e437e3988105595d2e9068045a98720.tar.gz
Chemical-Simulator-GUI-ce501c2d9e437e3988105595d2e9068045a98720.tar.bz2
Chemical-Simulator-GUI-ce501c2d9e437e3988105595d2e9068045a98720.zip
update compounds method added in all unit operations, material stream and material stream dockwidget
Diffstat (limited to 'Streams.py')
-rw-r--r--Streams.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Streams.py b/Streams.py
index fb0905d..ed35261 100644
--- a/Streams.py
+++ b/Streams.py
@@ -1,6 +1,7 @@
import json
import sys
from PyQt5.QtCore import *
+from ComponentSelector import compound_selected
class MaterialStream():
counter = 1
@@ -56,6 +57,9 @@ class MaterialStream():
}
self.init_variables()
+ def update_compounds(self):
+ self.compound_names = compound_selected
+
def init_variables(self):
Nc = len(self.compound_names)
for i, val in enumerate(self.compound_names):
@@ -82,7 +86,10 @@ class MaterialStream():
temp = []
for i, val in enumerate(self.compound_names):
- temp.append(self.variables['x_pc[1,' + str(i+1) + ']']['value'])
+ try:
+ temp.append(self.variables['x_pc[1,' + str(i+1) + ']']['value'])
+ except:
+ pass
self.variables['x_pc']['value'] = temp
if(mode=="PT"):