summaryrefslogtreecommitdiff
path: root/container.py
diff options
context:
space:
mode:
authorSaurabhAgarwala2019-12-23 17:36:31 +0530
committerSaurabhAgarwala2019-12-23 17:36:31 +0530
commit5cc855cd9a145012382031a5a1e731e297632107 (patch)
tree5fdf932d4ef9ee120fd09754a6a0b4d81446fab3 /container.py
parent5bc560d00c42b9a60b20dae4f237bf37570793ec (diff)
downloadChemical-Simulator-GUI-5cc855cd9a145012382031a5a1e731e297632107.tar.gz
Chemical-Simulator-GUI-5cc855cd9a145012382031a5a1e731e297632107.tar.bz2
Chemical-Simulator-GUI-5cc855cd9a145012382031a5a1e731e297632107.zip
Terminate function UI created and flowsheet made attribute of class
Diffstat (limited to 'container.py')
-rw-r--r--container.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/container.py b/container.py
index 89fb897..4211ed9 100644
--- a/container.py
+++ b/container.py
@@ -13,6 +13,7 @@ class Container():
self.unitOp = []
self.thermoPackage = None
self.compounds = None
+ self.flowsheet = None
self.conn = defaultdict(list)
self.op=defaultdict(list)
self.ip=defaultdict(list)
@@ -71,14 +72,14 @@ class Container():
except Exception as e:
print(e)
- def msgBrowser(self,f):
- std = f.stdout.decode("utf-8")
+ def msgBrowser(self):
+ std = self.flowsheet.stdout.decode("utf-8")
if(std):
stdout = str(std)
stdout = stdout.replace("\n","<br/>")
self.msg.append("<span style=\"color:green\">"+stdout+"</span>")
- stde = f.stderr.decode("utf-8")
+ stde = self.flowsheet.stderr.decode("utf-8")
if(stde):
stdout = str(stde)
stdout = stdout.replace("\n","<br/>")
@@ -88,26 +89,26 @@ class Container():
print(mode)
self.compounds = compound_selected
self.connection()
- f = Flowsheet()
- f.add_comp_list(self.compounds)
+ self.flowsheet = Flowsheet()
+ self.flowsheet.add_comp_list(self.compounds)
print("######## connection master#########\n",self.conn)
for i in self.unitOp :
if i in self.opl:
print("here",i)
- f.add_UnitOpn(i,1)
+ self.flowsheet.add_UnitOpn(i,1)
else:
- f.add_UnitOpn(i,0)
+ self.flowsheet.add_UnitOpn(i,0)
if mode=='SM':
self.msg.append("<span>["+str(self.currentTime())+"] Simulating in <b>Sequential</b> mode ... </span>")
- f.simulateSM(self.ip,self.op)
- self.msgBrowser(f)
- self.result=f.resdata
+ self.flowsheet.simulateSM(self.ip,self.op)
+ self.msgBrowser()
+ self.result=self.flowsheet.resdata
print("under SEQ mode simulation")
elif mode=='EQN':
self.msg.append("<span>["+str(self.currentTime())+"] Simulating in <b>equation</b> mode ... </span>")
- f.simulateEQN()
- self.msgBrowser(f)
- self.result=f.resdata
+ self.flowsheet.simulateEQN()
+ self.msgBrowser()
+ self.result=self.flowsheet.resdata
print("under Eqn mode simulation")
def flatlist(lst):