diff options
author | lucaszhao19 | 2020-01-03 17:09:38 +0530 |
---|---|---|
committer | lucaszhao19 | 2020-01-03 17:09:38 +0530 |
commit | 39ecc236c572ae17343b9afb39997233e7eb28f0 (patch) | |
tree | d794428f535e670305a2d24091e10b132deb6292 /container.py | |
parent | e090ba60f611d05d30f5e329536384be0b5f4d6e (diff) | |
download | Chemical-Simulator-GUI-39ecc236c572ae17343b9afb39997233e7eb28f0.tar.gz Chemical-Simulator-GUI-39ecc236c572ae17343b9afb39997233e7eb28f0.tar.bz2 Chemical-Simulator-GUI-39ecc236c572ae17343b9afb39997233e7eb28f0.zip |
Merged changes, load implemented (WIP)
Diffstat (limited to 'container.py')
-rw-r--r-- | container.py | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/container.py b/container.py index f9106ee..8b47c05 100644 --- a/container.py +++ b/container.py @@ -17,10 +17,12 @@ import json import pickle import os import sys - +unitOp = [] class Container(): + + def __init__(self,msgbrowser): - self.unitOp = [] + #self.unitOp = [] self.thermoPackage = None self.compounds = None self.flowsheet = None @@ -31,15 +33,11 @@ class Container(): self.msg.setText("") self.opl=[] self.result=[] - - def currentTime(self): now = datetime.datetime.now() time = str(now.hour) + ":" + str(now.minute) + ":" +str(now.second) return time - - def updateConn(self,key,value): self.conn[key].append(value) @@ -67,7 +65,6 @@ class Container(): except Exception as e: print(e) - def addUnitOp(self,obj,scene,graphics): box = None self.obj = obj @@ -76,17 +73,16 @@ class Container(): box = self.graphics.createNodeItem(self.obj) self.scene.addItem(box) box.setPos(2500-30, 2500-30) - - if(obj in self.unitOp): + if(obj in unitOp): pass else: - self.unitOp.append(obj) - + #self.unitOp.append(obj) + unitOp.append(obj) self.msg.append("<span style=\"color:blue\">["+str(self.currentTime())+"]<b> "+obj.name+" </b>is instantiated .""</span>") def fetchObject(self,name): - for i in self.unitOp: + for i in unitOp: if(i.name==name): return i @@ -95,8 +91,6 @@ class Container(): def add_thermoPackage(self,thermo): self.thermoPackage = thermo - - def msgBrowser(self): std = self.flowsheet.stdout.decode("utf-8") @@ -119,7 +113,7 @@ class Container(): self.flowsheet = Flowsheet() self.flowsheet.add_comp_list(self.compounds) print("######## connection master#########\n",self.conn) - for i in self.unitOp : + for i in unitOp : print("here",i) self.flowsheet.add_UnitOpn(i) |