summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpravindalve2021-04-24 21:09:40 +0530
committerpravindalve2021-04-24 21:09:40 +0530
commit3f8095e27df1ea62c4356c08de09cc42ffca00ed (patch)
tree07ea64387b98044e39c95836e18aaf36fec0f231
parent18c252df8431ddb9681efaf26352bbb6ed08b1fb (diff)
downloadChemical-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.py17
-rw-r--r--Streams.py15
-rw-r--r--Undo.datbin27727 -> 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()
diff --git a/Streams.py b/Streams.py
index efc7428..fb0905d 100644
--- a/Streams.py
+++ b/Streams.py
@@ -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
diff --git a/Undo.dat b/Undo.dat
index bc64b22..e69de29 100644
--- a/Undo.dat
+++ b/Undo.dat
Binary files differ