diff options
author | pravindalve | 2021-04-24 21:09:40 +0530 |
---|---|---|
committer | pravindalve | 2021-04-24 21:09:40 +0530 |
commit | 3f8095e27df1ea62c4356c08de09cc42ffca00ed (patch) | |
tree | 07ea64387b98044e39c95836e18aaf36fec0f231 | |
parent | 18c252df8431ddb9681efaf26352bbb6ed08b1fb (diff) | |
download | Chemical-Simulator-GUI-3f8095e27df1ea62c4356c08de09cc42ffca00ed.tar.gz Chemical-Simulator-GUI-3f8095e27df1ea62c4356c08de09cc42ffca00ed.tar.bz2 Chemical-Simulator-GUI-3f8095e27df1ea62c4356c08de09cc42ffca00ed.zip |
Fixes for issue #22
-rw-r--r-- | DockWidgets/DockWidgetMaterialStream.py | 17 | ||||
-rw-r--r-- | Streams.py | 15 | ||||
-rw-r--r-- | Undo.dat | bin | 27727 -> 0 bytes |
3 files changed, 20 insertions, 12 deletions
diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py index bfdb22e..60a4aca 100644 --- a/DockWidgets/DockWidgetMaterialStream.py +++ b/DockWidgets/DockWidgetMaterialStream.py @@ -18,7 +18,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): self.type = comptype self.input_dict = {} self.x_pclist = [] - self.modes() + self.comboBox.currentIndexChanged.connect(self.mode_selection) self.pushButton_2.clicked.connect(self.param) @@ -31,7 +31,10 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): self.mTreeWidget.setHeaderItem(header) self.lTreeWidget.setHeaderItem(header) self.vTreeWidget.setHeaderItem(header) - + lines = [line.rstrip('\n') for line in open('thermopackage.txt')] + for j in lines: + self.cbTP.addItem(str(j)) + self.modes() # input data tab def modes(self): modes_list = self.obj.modes_list @@ -79,6 +82,8 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): lay.setSizeConstraint(QLayout.SetFixedSize) gp.setLayout(lay) self.formLayout.addRow(gp) + elif i == "Thermo Package": + self.cbTP.setCurrentText(self.input_dict[i]) else: print("elseloop") l = QLineEdit() @@ -95,10 +100,8 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): 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) @@ -129,7 +132,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): self.x_pclist[c].setText(mf[-1]) self.dict[i] = ",".join(mf) elif (i == "Thermo Package"): - self.dict[i] = self.input_dict[i].currentText() + self.dict[i] = self.cbTP.currentText() else: if (self.input_dict[i].text()): self.dict[i] = self.input_dict[i].text() @@ -90,29 +90,34 @@ 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']} + "MolFlow":self.variables['F_p[1]']['value'],"x_pc":self.variables['x_pc']['value'], + "Thermo Package": self.thermo_package} print('dictionary is :' + str(dict)) 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']} + "MolFlow":self.variables['F_p[1]']['value'], "x_pc":self.variables['x_pc']['value'], + "Thermo Package": self.thermo_package} 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']} + "MolFlow":self.variables['F_p[1]']['value'], "x_pc":self.variables['x_pc']['value'], + "Thermo Package": self.thermo_package} 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']} + "MolFlow":self.variables['F_p[1]']['value'], "x_pc":self.variables['x_pc']['value'], + "Thermo Package": self.thermo_package} 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']} + "MolFlow":self.variables['F_p[1]']['value'], "x_pc":self.variables['x_pc']['value'], + "Thermo Package": self.thermo_package} return dict |