diff options
Diffstat (limited to 'DockWidgets')
-rw-r--r-- | DockWidgets/DockWidgetMaterialStream.py | 38 | ||||
-rw-r--r-- | DockWidgets/DockWidgetMaterialStream.ui | 57 | ||||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc | bin | 9112 -> 8936 bytes |
3 files changed, 66 insertions, 29 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 Binary files differindex d592243..16511b3 100644 --- a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc |