summaryrefslogtreecommitdiff
path: root/container.py
diff options
context:
space:
mode:
Diffstat (limited to 'container.py')
-rw-r--r--container.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/container.py b/container.py
index dd3cf89..3652031 100644
--- a/container.py
+++ b/container.py
@@ -26,6 +26,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)
@@ -99,14 +100,14 @@ class Container():
- 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/>")
@@ -117,25 +118,24 @@ 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 :
print("here",i)
- f.add_UnitOpn(i)
-
+ self.flowsheet.add_UnitOpn(i)
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):