summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--DockWidgets/DockWidgetMaterialStream.py38
-rw-r--r--DockWidgets/DockWidgetMaterialStream.ui57
-rw-r--r--DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pycbin9112 -> 8936 bytes
-rw-r--r--Streams.py12
-rw-r--r--Undo.datbin77818 -> 4021 bytes
5 files changed, 72 insertions, 35 deletions
diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py
index f53e331..915bea3 100644
--- a/DockWidgets/DockWidgetMaterialStream.py
+++ b/DockWidgets/DockWidgetMaterialStream.py
@@ -64,20 +64,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
print("input_params_list ", self.input_dict)
for c,i in enumerate(self.input_dict):
- if(i=="thermo_package"):
- print("thermo1")
- combo = QComboBox()
- self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')]
- print("thermo2")
- for j in self.lines:
- combo.addItem(str(j))
- lay = QGridLayout()
- lay.addWidget(QLabel(i+":"), 0,0, alignment=Qt.AlignLeft)
- lay.addWidget(combo, 0, 1, alignment=Qt.AlignRight)
- self.formLayout.addRow(lay)
- self.input_dict[i] = combo
- print("thermo")
- elif(i=="x_pc"):
+ if(i=="x_pc"):
noc = len(compound_selected)
print(noc)
self.x_pclist.clear()
@@ -111,6 +98,12 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
lay.addWidget(QLabel("mol/s"),0,2, alignment=Qt.AlignCenter)
self.formLayout.addRow(lay)
self.input_dict[i] = l
+
+ self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')]
+ for j in self.lines:
+ self.cbTP.addItem(str(j))
+ self.input_dict['Thermo Package'] = self.cbTP
+
except Exception as e:
print(e)
@@ -123,13 +116,8 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
print("param.input_dict ", self.input_dict)
for i in self.input_dict:
- if(i=="thermo_package"):
- if (self.input_dict[i].currentText()):
- self.dict[i] = self.input_dict[i].currentText()
- else:
- self.show_error()
- break
- elif(i =="x_pc"):
+ print(i)
+ if(i =="x_pc"):
l=[]
mf = []
total_moles = 0
@@ -145,14 +133,18 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
self.obj.variables[compound_selected[c]]['value'] = str(float(l[c])/total_moles)
self.x_pclist[c].setText(mf[-1])
self.dict[i] = ",".join(mf)
+ elif (i == "Thermo Package"):
+ self.dict[i] = self.input_dict[i].currentText()
else:
if (self.input_dict[i].text()):
self.dict[i] = self.input_dict[i].text()
else:
- print(self.input_dict[i].text())
+ print(self.input_dict[i])
self.show_error()
break
-
+ # print(self.input_dict[-1].currentText())
+ # self.dict['Thermo Package'] = self.input_dict['Thermo Package'].currentText()
+
print("param ", self.dict)
self.obj.param_setter(self.dict)
self.hide()
diff --git a/DockWidgets/DockWidgetMaterialStream.ui b/DockWidgets/DockWidgetMaterialStream.ui
index 8995ba6..a442eee 100644
--- a/DockWidgets/DockWidgetMaterialStream.ui
+++ b/DockWidgets/DockWidgetMaterialStream.ui
@@ -98,7 +98,7 @@
<x>10</x>
<y>100</y>
<width>331</width>
- <height>321</height>
+ <height>221</height>
</rect>
</property>
<property name="title">
@@ -114,7 +114,7 @@
<property name="geometry">
<rect>
<x>10</x>
- <y>430</y>
+ <y>390</y>
<width>331</width>
<height>21</height>
</rect>
@@ -123,6 +123,51 @@
<string>Submit</string>
</property>
</widget>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>330</y>
+ <width>331</width>
+ <height>51</height>
+ </rect>
+ </property>
+ <property name="title">
+ <string/>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_10">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_11">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Thermo Package</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="cbTP">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
@@ -273,8 +318,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>335</width>
- <height>494</height>
+ <width>151</width>
+ <height>128</height>
</rect>
</property>
<property name="styleSheet">
@@ -362,8 +407,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>335</width>
- <height>494</height>
+ <width>151</width>
+ <height>128</height>
</rect>
</property>
<property name="styleSheet">
diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc
index d592243..16511b3 100644
--- a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc
Binary files differ
diff --git a/Streams.py b/Streams.py
index c987b4c..bed975d 100644
--- a/Streams.py
+++ b/Streams.py
@@ -90,28 +90,28 @@ class MaterialStream():
self.mode2 = 'T'
dict = {self.mode1:self.variables['P']['value'], self.mode2:self.variables['T']['value'],
- "MolFlow":self.variables['F_p[1]']['value'],"x_pc":self.variables['x_pc']['value'], "thermo_package":self.thermo_package}
+ "MolFlow":self.variables['F_p[1]']['value'],"x_pc":self.variables['x_pc']['value']}
elif(mode=="PH"):
self.mode1 = 'P'
self.mode2 = 'H_p[1]'
dict = {self.mode1:self.variables['P']['value'], self.mode2:self.variables['H_p[1]']['value'],
- "MolFlow":self.variables['F_p[1]']['value'], "x_pc":self.variables['x_pc']['value'], "thermo_package":self.thermo_package}
+ "MolFlow":self.variables['F_p[1]']['value'], "x_pc":self.variables['x_pc']['value']}
elif(mode=="PVF"):
self.mode1 = 'P'
self.mode2 = 'xvap'
dict = {self.mode1:self.variables['P']['value'], self.mode2:self.variables['xvap']['value'],
- "MolFlow":self.variables['F_p[1]']['value'], "x_pc":self.variables['x_pc']['value'], "thermo_package":self.thermo_package}
+ "MolFlow":self.variables['F_p[1]']['value'], "x_pc":self.variables['x_pc']['value']}
elif(mode=="TVF"):
self.mode1 = 'T'
self.mode2 = 'xvap'
dict = {self.mode1:self.variables['T']['value'], self.mode2:self.variables['xvap']['value'],
- "MolFlow":self.variables['F_p[1]']['value'], "x_pc":self.variables['x_pc']['value'], "thermo_package":self.thermo_package}
+ "MolFlow":self.variables['F_p[1]']['value'], "x_pc":self.variables['x_pc']['value']}
elif(mode=="PS"):
self.mode1 = 'P'
self.mode2 = 'S_p[1]'
dict = {self.mode1:self.variables['P']['value'], self.mode2: self.variables['S_p[1]']['value'],
- "MolFlow":self.variables['F_p[1]']['value'], "x_pc":self.variables['x_pc']['value'], "thermo_package":self.thermo_package}
+ "MolFlow":self.variables['F_p[1]']['value'], "x_pc":self.variables['x_pc']['value']}
return dict
@@ -120,7 +120,7 @@ class MaterialStream():
print("inside paramsetter ", dict)
self.variables['x_pc']['value'] = dict['x_pc'].split(",")
- self.thermo_package = dict['thermo_package']
+ self.thermo_package = dict['Thermo package']
self.variables['F_p[1]']['value'] = dict['MolFlow']
print("inside")
# self.Prop[self.mode2] = dict[self.mode2]
diff --git a/Undo.dat b/Undo.dat
index aef1caa..7d03ca8 100644
--- a/Undo.dat
+++ b/Undo.dat
Binary files differ