summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrenda-br2023-02-17 17:11:18 +0530
committerbrenda-br2023-02-17 17:11:18 +0530
commitc5f533673ea9ab4315e76940f6d014e349f97884 (patch)
tree0061e4117d1f16fd2fc9e37d078d5b5585af0aef
parent00b5c186d1ba4fba9af41b890e1c47ce45588b5f (diff)
downloadChemical-Simulator-GUI-c5f533673ea9ab4315e76940f6d014e349f97884.tar.gz
Chemical-Simulator-GUI-c5f533673ea9ab4315e76940f6d014e349f97884.tar.bz2
Chemical-Simulator-GUI-c5f533673ea9ab4315e76940f6d014e349f97884.zip
Fix #61 Improved appearance of results
-rw-r--r--DockWidgets/DockWidgetMaterialStream.py14
-rw-r--r--DockWidgets/__pycache__/DockWidget.cpython-37.pycbin4731 -> 4724 bytes
-rw-r--r--DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pycbin9308 -> 9411 bytes
-rw-r--r--Streams.py10
4 files changed, 12 insertions, 12 deletions
diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py
index d476338..422119e 100644
--- a/DockWidgets/DockWidgetMaterialStream.py
+++ b/DockWidgets/DockWidgetMaterialStream.py
@@ -255,13 +255,13 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
compound_no = int(k[k.index(',') + 1]) - 1 # compound is from python list
if phase_no == 1:
- child = QTreeWidgetItem(mroot, [compound_selected[compound_no], str(resultval),
+ child = QTreeWidgetItem(mroot, [compound_selected[compound_no], str(round(float(resultval),4)),
obj.variables[k.split('.')[1]]['unit']])
elif phase_no == 2:
- child = QTreeWidgetItem(lroot, [compound_selected[compound_no], str(resultval),
+ child = QTreeWidgetItem(lroot, [compound_selected[compound_no], str(round(float(resultval),4)),
obj.variables[k.split('.')[1]]['unit']])
elif phase_no == 3:
- child = QTreeWidgetItem(vroot, [compound_selected[compound_no], str(resultval),
+ child = QTreeWidgetItem(vroot, [compound_selected[compound_no], str(round(float(resultval),4)),
obj.variables[k.split('.')[1]]['unit']])
if (compound_no + 1) == len(compound_selected):
j += 1
@@ -299,7 +299,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
mrowPosition = self.mTableWidget.rowCount()
self.mTableWidget.insertRow(mrowPosition)
self.mTableWidget.setItem(mrowPosition , 0, QTableWidgetItem(obj.variables[val.split('.')[1]]['name']))
- self.mTableWidget.setItem(mrowPosition , 1, QTableWidgetItem(resultval))
+ self.mTableWidget.setItem(mrowPosition , 1, QTableWidgetItem(str(round(float(resultval),4))))
self.mTableWidget.setItem(mrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit']))
self.mTableWidget.resizeColumnsToContents()
@@ -307,14 +307,14 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
lrowPosition = self.lTableWidget.rowCount()
self.lTableWidget.insertRow(lrowPosition)
self.lTableWidget.setItem(lrowPosition , 0, QTableWidgetItem(obj.variables[val.split('.')[1]]['name']))
- self.lTableWidget.setItem(lrowPosition , 1, QTableWidgetItem(resultval))
+ self.lTableWidget.setItem(lrowPosition , 1, QTableWidgetItem(str(round(float(resultval),4))))
self.lTableWidget.setItem(lrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit']))
self.lTableWidget.resizeColumnsToContents()
if '3' in val.split('.')[1]:
vrowPosition = self.vTableWidget.rowCount()
self.vTableWidget.insertRow(vrowPosition)
self.vTableWidget.setItem(vrowPosition , 0, QTableWidgetItem(obj.variables[val.split('.')[1]]['name']))
- self.vTableWidget.setItem(vrowPosition , 1, QTableWidgetItem(resultval))
+ self.vTableWidget.setItem(vrowPosition , 1, QTableWidgetItem(str(round(float(resultval),4))))
self.vTableWidget.setItem(vrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit']))
self.vTableWidget.resizeColumnsToContents()
if not '[' in val:
@@ -322,7 +322,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
mrowPosition = self.mTableWidget.rowCount()
self.mTableWidget.insertRow(mrowPosition)
self.mTableWidget.setItem(mrowPosition , 0, QTableWidgetItem(obj.variables[val.split('.')[1]]['name']))
- self.mTableWidget.setItem(mrowPosition , 1, QTableWidgetItem(resultval))
+ self.mTableWidget.setItem(mrowPosition , 1, QTableWidgetItem(str(round(float(resultval),4))))
self.mTableWidget.setItem(mrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit']))
self.mTableWidget.resizeColumnsToContents()
diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc
index 490d62f..bb3ffa1 100644
--- a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc
Binary files differ
diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc
index 41be544..1830c79 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 3118a41..1afa2bc 100644
--- a/Streams.py
+++ b/Streams.py
@@ -160,7 +160,7 @@ class MaterialStream():
mixMolFlo_val = self.variables['F_p[1]']['value']
mixMolFlo_unit = self.variables['F_p[1]']['unit']
mixMassFlo_name = self.variables['Fm_p[1]']['name']
- mixMassFlo_val = self.variables['Fm_p[1]']['value']
+ mixMassFlo_val = round(float(self.variables['Fm_p[1]']['value']),2)
mixMassFlo_unit = self.variables['Fm_p[1]']['unit']
dict = {pressure_name:str(pressure_val)+' '+pressure_unit,
@@ -431,15 +431,15 @@ class MaterialStream():
def disableInputDataTab(self,dockwidget):
#setting the value of input data tab in dock widget and disabling them
dockwidget.comboBox.setDisabled(True)
- dockwidget.input_dict['P'].setText(str(self.variables['P']['value']))
+ dockwidget.input_dict['P'].setText(str(round(float(self.variables['P']['value']),2)))
dockwidget.input_dict['P'].setDisabled(True)
- dockwidget.input_dict['T'].setText(str(self.variables['T']['value']))
+ dockwidget.input_dict['T'].setText(str(round(float(self.variables['T']['value']),2)))
dockwidget.input_dict['T'].setDisabled(True)
- dockwidget.input_dict['MolFlow'].setText(str(self.variables['F_p[1]']['value']))
+ dockwidget.input_dict['MolFlow'].setText(str(round(float(self.variables['F_p[1]']['value']),2)))
dockwidget.input_dict['MolFlow'].setDisabled(True)
dockwidget.cbTP.setCurrentText(str(self.thermo_package))
dockwidget.cbTP.setDisabled(True)
dockwidget.pushButton_2.setDisabled(True)
for index,k in enumerate(dockwidget.x_pclist):
- k.setText(str(self.variables['x_pc[1,'+ str(index+1)+']']['value']))
+ k.setText(str(round(float(self.variables['x_pc[1,'+ str(index+1)+']']['value']),2)))
k.setDisabled(True)