summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlucaszhao192020-08-03 20:45:29 +0630
committerlucaszhao192020-08-03 20:45:29 +0630
commit7a6921b773cf8879cc29c8eb6c0f6ca2a1da961e (patch)
tree85d2b534137c1f14ea1cc65680eb64f95e985603
parent788b7f4bbb7aa51839c0836b1ab163fa831ce8fc (diff)
downloadChemical-Simulator-GUI-7a6921b773cf8879cc29c8eb6c0f6ca2a1da961e.tar.gz
Chemical-Simulator-GUI-7a6921b773cf8879cc29c8eb6c0f6ca2a1da961e.tar.bz2
Chemical-Simulator-GUI-7a6921b773cf8879cc29c8eb6c0f6ca2a1da961e.zip
Add Thermo Package for ShortcutColumn
-rw-r--r--Container.py31
-rw-r--r--DockWidgets/DockWidgetShortcutColumn.py11
-rw-r--r--DockWidgets/DockWidgetShortcutColumn.ui187
-rw-r--r--DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pycbin4325 -> 4661 bytes
-rw-r--r--OMChem/Flowsheet.py10
-rw-r--r--Undo.datbin106405 -> 77818 bytes
-rw-r--r--UnitOperations.py1
-rw-r--r--mainApp.py3
-rw-r--r--thermopackage.txt2
9 files changed, 124 insertions, 121 deletions
diff --git a/Container.py b/Container.py
index 25d5176..db8e173 100644
--- a/Container.py
+++ b/Container.py
@@ -40,41 +40,10 @@ class Container():
time = str(now.hour) + ":" + str(now.minute) + ":" +str(now.second)
return time
- # def updateConn(self,key,value):
- # self.conn[key].append(value)
- # self.msg.append("<span style=\"color:blue\">["+str(self.current_time())+"]<b> "+key.name+" </b> output is connected to input of<b> "+value.name +" </b></span>")
- #
- # def connection(self):
- # try:
- # self.op.clear()
- # self.ip.clear()
- # self.opl.clear()
- # stm = ['MaterialStream','EngStm']
- # for i in self.conn:
- # if i.type not in stm:
- # self.op[i]=self.conn[i]
- #
- # for j in range(len(self.conn[i])):
- # if self.conn[i][j].type not in stm:
- # self.ip[self.conn[i][j]].append(i)
- #
- # for i in self.op:
- # i.connect(InputStms=self.ip[i],OutputStms=self.op[i])
- #
- # self.opl.append([self.op[i] for i in self.op])
- # self.opl=flat_list(flat_list(self.opl))
- # except Exception as e:
- # print(e)
-
- # @staticmethod
- # def addUnitOpObj(obj):
- # self.unit_operations.append(obj)
-
def add_unit_operation(self, obj):
box = None
self.obj = obj
self.scene = self.graphics.get_scene()
- #self.graphicsView = graphicsView
box = self.graphics.create_node_item(self.obj, self)
self.scene.addItem(box)
box.setPos(2500-30, 2500-30)
diff --git a/DockWidgets/DockWidgetShortcutColumn.py b/DockWidgets/DockWidgetShortcutColumn.py
index f3a12b7..409c051 100644
--- a/DockWidgets/DockWidgetShortcutColumn.py
+++ b/DockWidgets/DockWidgetShortcutColumn.py
@@ -63,7 +63,13 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog):
self.l8.setText(self.obj.variables['RR']['name']+":")
self.le8.setText(str(self.obj.variables['RR']['value']))
- self.input_dict = [self.cb1, self.cb2, self.le3, self.le4, self.cb5, self.le6, self.le7, self.le8]
+ self.l9.setText("Thermo Package :")
+
+ self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')]
+ for j in self.lines:
+ self.cb6.addItem(str(j))
+
+ self.input_dict = [self.cb1, self.cb2, self.le3, self.le4, self.cb5, self.le6, self.le7, self.le8, self.cb6]
except Exception as e:
print(e)
@@ -76,7 +82,8 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog):
self.dict=[]
print("param.input_dict ", self.input_dict)
self.dict = [self.input_dict[0].currentText(),self.input_dict[1].currentText(),float(self.input_dict[2].text()), float(self.input_dict[3].text()),
- self.input_dict[4].currentText(), float(self.input_dict[5].text()), float(self.input_dict[6].text()), float(self.input_dict[7].text())]
+ self.input_dict[4].currentText(), float(self.input_dict[5].text()), float(self.input_dict[6].text()), float(self.input_dict[7].text()),
+ self.input_dict[8].currentText()]
print("param ", self.dict)
self.obj.param_setter(self.dict)
diff --git a/DockWidgets/DockWidgetShortcutColumn.ui b/DockWidgets/DockWidgetShortcutColumn.ui
index 47595ec..f79c27e 100644
--- a/DockWidgets/DockWidgetShortcutColumn.ui
+++ b/DockWidgets/DockWidgetShortcutColumn.ui
@@ -50,7 +50,7 @@
<x>8</x>
<y>13</y>
<width>331</width>
- <height>237</height>
+ <height>261</height>
</rect>
</property>
<property name="sizePolicy">
@@ -65,8 +65,8 @@
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout">
- <item row="4" column="2">
- <widget class="QComboBox" name="cb5">
+ <item row="3" column="2">
+ <widget class="QLineEdit" name="le4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -75,15 +75,18 @@
</property>
</widget>
</item>
- <item row="3" column="0">
- <widget class="QLabel" name="l4">
- <property name="text">
- <string>TextLabel</string>
+ <item row="5" column="2">
+ <widget class="QLineEdit" name="le6">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
</widget>
</item>
- <item row="3" column="3">
- <widget class="QLabel" name="u4">
+ <item row="6" column="3">
+ <widget class="QLabel" name="u7">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -95,21 +98,25 @@
</property>
</widget>
</item>
- <item row="0" column="0">
- <widget class="QLabel" name="l1">
+ <item row="6" column="0">
+ <widget class="QLabel" name="l7">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QComboBox" name="cb2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text">
- <string>TextLabel</string>
- </property>
</widget>
</item>
- <item row="2" column="3">
- <widget class="QLabel" name="u3">
+ <item row="5" column="3">
+ <widget class="QLabel" name="u6">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -121,15 +128,8 @@
</property>
</widget>
</item>
- <item row="2" column="0">
- <widget class="QLabel" name="l3">
- <property name="text">
- <string>TextLabel</string>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QLineEdit" name="le3">
+ <item row="7" column="2">
+ <widget class="QLineEdit" name="le8">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -138,29 +138,25 @@
</property>
</widget>
</item>
- <item row="4" column="0">
- <widget class="QLabel" name="l5">
- <property name="text">
- <string>TextLabel</string>
- </property>
- </widget>
- </item>
- <item row="5" column="0">
- <widget class="QLabel" name="l6">
+ <item row="7" column="0">
+ <widget class="QLabel" name="l8">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="l2">
- <property name="text">
- <string>TextLabel</string>
+ <item row="6" column="2">
+ <widget class="QLineEdit" name="le7">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
</widget>
</item>
- <item row="5" column="2">
- <widget class="QLineEdit" name="le6">
+ <item row="0" column="2">
+ <widget class="QComboBox" name="cb1">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -169,28 +165,25 @@
</property>
</widget>
</item>
- <item row="6" column="0">
- <widget class="QLabel" name="l7">
+ <item row="3" column="0">
+ <widget class="QLabel" name="l4">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
- <item row="6" column="3">
- <widget class="QLabel" name="u7">
+ <item row="4" column="2">
+ <widget class="QComboBox" name="cb5">
<property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text">
- <string>TextLabel</string>
- </property>
</widget>
</item>
- <item row="1" column="2">
- <widget class="QComboBox" name="cb2">
+ <item row="2" column="2">
+ <widget class="QLineEdit" name="le3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -199,18 +192,28 @@
</property>
</widget>
</item>
- <item row="3" column="2">
- <widget class="QLineEdit" name="le4">
+ <item row="2" column="0">
+ <widget class="QLabel" name="l3">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="QLabel" name="u3">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
</widget>
</item>
- <item row="5" column="3">
- <widget class="QLabel" name="u6">
+ <item row="3" column="3">
+ <widget class="QLabel" name="u4">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -222,40 +225,37 @@
</property>
</widget>
</item>
- <item row="6" column="2">
- <widget class="QLineEdit" name="le7">
+ <item row="0" column="0">
+ <widget class="QLabel" name="l1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
</widget>
</item>
- <item row="7" column="0">
- <widget class="QLabel" name="l8">
+ <item row="5" column="0">
+ <widget class="QLabel" name="l6">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
- <item row="7" column="2">
- <widget class="QLineEdit" name="le8">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <item row="4" column="0">
+ <widget class="QLabel" name="l5">
+ <property name="text">
+ <string>TextLabel</string>
</property>
</widget>
</item>
- <item row="0" column="2">
- <widget class="QComboBox" name="cb1">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <item row="1" column="0">
+ <widget class="QLabel" name="l2">
+ <property name="text">
+ <string>TextLabel</string>
</property>
</widget>
</item>
@@ -267,7 +267,7 @@
<property name="geometry">
<rect>
<x>10</x>
- <y>250</y>
+ <y>350</y>
<width>331</width>
<height>23</height>
</rect>
@@ -282,6 +282,41 @@
<string>Submit</string>
</property>
</widget>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>280</y>
+ <width>331</width>
+ <height>61</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string/>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="2" column="0">
+ <widget class="QLabel" name="l9">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QComboBox" name="cb6"/>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc
index 3201c35..e1adb56 100644
--- a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc
Binary files differ
diff --git a/OMChem/Flowsheet.py b/OMChem/Flowsheet.py
index 19f1b8e..ab4d729 100644
--- a/OMChem/Flowsheet.py
+++ b/OMChem/Flowsheet.py
@@ -57,13 +57,8 @@ class Flowsheet():
self.process = Popen([self.omc_path, '-s',simpath], stdout=PIPE, stderr=PIPE)
self.stdout, self.stderr = self.process.communicate()
- #s = subprocess.check_output([self.omc_path, '-s',simpath])
- #print(s)
- #print("############### StdOut ################")
- print("stdout ", self.stdout)
- print("stderr ", self.stderr)
+
os.chdir(self.root_dir)
- #os.system(self.omc_path + ' -s ' + simpath)
if ('timeSimulation = 0.0,\n' in self.stdout.decode("utf-8")):
self.result_data = []
else:
@@ -74,10 +69,9 @@ class Flowsheet():
print("opened")
csvreader = csv.reader(resultFile,delimiter=',')
for row in csvreader:
- print("124125")
+ print("in reading csvreader")
self.result_data.append(row)
print(self.result_data)
- #self.ext_data()
def send_for_simulation_SM(self,unitop):
diff --git a/Undo.dat b/Undo.dat
index 67af9b5..aef1caa 100644
--- a/Undo.dat
+++ b/Undo.dat
Binary files differ
diff --git a/UnitOperations.py b/UnitOperations.py
index 45d4259..4d3a92d 100644
--- a/UnitOperations.py
+++ b/UnitOperations.py
@@ -224,6 +224,7 @@ class ShortcutColumn(UnitOperation):
self.variables['Pcond']['value'] = params[5]
self.variables['Preb']['value'] = params[6]
self.variables['RR']['value'] = params[7]
+ self.thermo_package = params[8]
print(self.variables)
diff --git a/mainApp.py b/mainApp.py
index d8ba5fc..78bbd98 100644
--- a/mainApp.py
+++ b/mainApp.py
@@ -41,9 +41,6 @@ class MainApp(QMainWindow,ui):
# Loading and setting up style sheet
self.setupUi(self)
- # style = open('cyan.css','r')
- # style = style.read()
- # self.setStyleSheet(style)
# Initializing attributes
self.zoom_count = 0
diff --git a/thermopackage.txt b/thermopackage.txt
index 9ed6616..f9155f5 100644
--- a/thermopackage.txt
+++ b/thermopackage.txt
@@ -1,6 +1,6 @@
RaoultsLaw
NRTL
-INIQUAC
+UNIQUAC
UNIFAC
PengRobinson
GraysonStreed \ No newline at end of file