summaryrefslogtreecommitdiff
path: root/container.py
diff options
context:
space:
mode:
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 8b47c05..6cfc689 100644
--- a/container.py
+++ b/container.py
@@ -10,19 +10,18 @@ from PyQt5.QtWidgets import QGraphicsProxyWidget, QGraphicsObject, QGraphicsElli
from PyQt5.QtGui import QBrush ,QTransform ,QMouseEvent
import PyQt5.QtCore as QtCore
import PyQt5.QtWidgets as QtWidgets
-from dockWidget import dockWidget
import datetime
import itertools
import json
import pickle
import os
import sys
-unitOp = []
+from Graphics import *
+
class Container():
-
def __init__(self,msgbrowser):
- #self.unitOp = []
+ self.unitOp = []
self.thermoPackage = None
self.compounds = None
self.flowsheet = None
@@ -33,6 +32,7 @@ class Container():
self.msg.setText("")
self.opl=[]
self.result=[]
+ self.graphics = Graphics(self.unitOp)
def currentTime(self):
now = datetime.datetime.now()
@@ -65,24 +65,26 @@ class Container():
except Exception as e:
print(e)
- def addUnitOp(self,obj,scene,graphics):
+ @staticmethod
+ def addUnitOpObj(obj):
+ self.unitOp.append(obj)
+
+ def addUnitOp(self,obj):
box = None
self.obj = obj
- self.scene = scene
- self.graphics = graphics
+ self.scene = self.graphics.getScene()
box = self.graphics.createNodeItem(self.obj)
self.scene.addItem(box)
box.setPos(2500-30, 2500-30)
- if(obj in unitOp):
+ if(obj in self.unitOp):
pass
else:
- #self.unitOp.append(obj)
- unitOp.append(obj)
+ self.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 unitOp:
+ for i in self.unitOp:
if(i.name==name):
return i
@@ -109,11 +111,10 @@ class Container():
print("SIMULATE")
print(mode)
self.compounds = compound_selected
- #self.connection()
self.flowsheet = Flowsheet()
self.flowsheet.add_comp_list(self.compounds)
print("######## connection master#########\n",self.conn)
- for i in unitOp :
+ for i in self.unitOp :
print("here",i)
self.flowsheet.add_UnitOpn(i)