summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpravindalve2021-04-14 12:28:10 +0530
committerGitHub2021-04-14 12:28:10 +0530
commit200cb9d719d0b8f702571479c086d915b1a4224c (patch)
tree6944fbe760df89e5d418c7e768666113320947e0
parentd11902175b1bfb5c4fc854b3335fc5686a725647 (diff)
parentfaffb95d8b6bbea5a55efc3550b8e8357d3b381e (diff)
downloadChemical-Simulator-GUI-200cb9d719d0b8f702571479c086d915b1a4224c.tar.gz
Chemical-Simulator-GUI-200cb9d719d0b8f702571479c086d915b1a4224c.tar.bz2
Chemical-Simulator-GUI-200cb9d719d0b8f702571479c086d915b1a4224c.zip
Merge pull request #19 from pravindalve/master
Fixes
-rw-r--r--ComponentSelector.py4
-rw-r--r--DockWidgets/DistillationColumnStagewiseResults.ui6
-rw-r--r--DockWidgets/DockWidgetDistillationColumn.py3
-rw-r--r--DockWidgets/DockWidgetDistillationColumn.ui2
-rw-r--r--DockWidgets/__pycache__/DockWidget.cpython-37.pycbin4411 -> 4390 bytes
-rw-r--r--DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pycbin9426 -> 9430 bytes
-rw-r--r--Graphics.py8
-rw-r--r--OMChem/Flowsheet.py25
-rw-r--r--Simulator/Databases/Databases.py1
-rw-r--r--Undo.datbin28916 -> 3757 bytes
-rw-r--r--UnitOperations.py2
11 files changed, 36 insertions, 15 deletions
diff --git a/ComponentSelector.py b/ComponentSelector.py
index c5ba6f5..79edef4 100644
--- a/ComponentSelector.py
+++ b/ComponentSelector.py
@@ -111,8 +111,8 @@ class ComponentSelector(QDialog,ui_dialog):
self.CAS=self.obj.get_value(self.comp,'CAS')
self.name=self.comp
- self.molecular_formula=self.obj.get_value(self.comp,'Smiles')
- self.molecular_weight=self.obj.get_value(self.comp,'MolecularWeight')
+ self.molecular_formula=self.obj.get_value(self.comp, 'StructureFormula')
+ self.molecular_weight=self.obj.get_value(self.comp, 'MolecularWeight')
dict={'CAS':self.CAS,'Name':self.name,'Molecular Formula':self.molecular_formula,'Molecular Weight':self.molecular_weight}
#converted everything to a dictionary which will be passes to addtable
diff --git a/DockWidgets/DistillationColumnStagewiseResults.ui b/DockWidgets/DistillationColumnStagewiseResults.ui
index 9ce4060..fb0ef9c 100644
--- a/DockWidgets/DistillationColumnStagewiseResults.ui
+++ b/DockWidgets/DistillationColumnStagewiseResults.ui
@@ -38,6 +38,9 @@
<height>391</height>
</rect>
</property>
+ <property name="sizeAdjustPolicy">
+ <enum>QAbstractScrollArea::AdjustToContents</enum>
+ </property>
</widget>
</widget>
<widget class="QWidget" name="x_pc">
@@ -53,6 +56,9 @@
<height>391</height>
</rect>
</property>
+ <property name="sizeAdjustPolicy">
+ <enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum>
+ </property>
</widget>
</widget>
</widget>
diff --git a/DockWidgets/DockWidgetDistillationColumn.py b/DockWidgets/DockWidgetDistillationColumn.py
index e98ba03..bd5a683 100644
--- a/DockWidgets/DockWidgetDistillationColumn.py
+++ b/DockWidgets/DockWidgetDistillationColumn.py
@@ -222,7 +222,7 @@ class DockWidgetDistillationColumn(QDockWidget, ui_dialog):
Nt = self.obj.variables['Nt']['value']
Nc = len(self.obj.compounds)
# initializing temporary arrays
- Stages_T = [None]*Nt
+ Stages_T = [None for i in range(Nt)]
# Can be uncommented when F_p and F_pc implemented in modelica table
# Stages_F_p = [[None for i in range(3)] for j in range(Nt)]
# Stages_F_pc = [[[None for i in range(3)] for j in range(Nc)] for k in range(Nt)]
@@ -342,6 +342,7 @@ class DockWidgetDistillationColumn(QDockWidget, ui_dialog):
for j in range(Nc):
x_pc_table.setItem(i, 2*j, QTableWidgetItem(Stages_x_pc[i][j][1]))
x_pc_table.setItem(i, 2 * j + 1, QTableWidgetItem(Stages_x_pc[i][j][2]))
+
for t in tables:
t.resizeColumnsToContents()
except Exception as e:
diff --git a/DockWidgets/DockWidgetDistillationColumn.ui b/DockWidgets/DockWidgetDistillationColumn.ui
index 932cbdd..920837b 100644
--- a/DockWidgets/DockWidgetDistillationColumn.ui
+++ b/DockWidgets/DockWidgetDistillationColumn.ui
@@ -41,7 +41,7 @@
<bool>true</bool>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc
index a8934e2..0a00568 100644
--- a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc
Binary files differ
diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc
index ee33ca4..066bc00 100644
--- a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc
Binary files differ
diff --git a/Graphics.py b/Graphics.py
index a829849..3660f25 100644
--- a/Graphics.py
+++ b/Graphics.py
@@ -4,6 +4,7 @@ from PyQt5.QtGui import *
import PyQt5.QtGui as QtGui
import PyQt5.QtCore as QtCore
import PyQt5.QtWidgets as QtWidgets
+from PyQt5.QtWidgets import QLineEdit
from DockWidgets.DockWidget import *
from DockWidgets.DockWidgetMaterialStream import *
@@ -43,6 +44,7 @@ class Graphics(QDialog, QtWidgets.QGraphicsItem):
pass
else:
self.unit_operations.append(i)
+ type(i).counter += 1
print(self.unit_operations)
new_box = self.create_node_item(i, container)
new_box.setPos(i.pos.toPoint().x(), i.pos.toPoint().y())
@@ -424,7 +426,8 @@ class NodeItem(QtWidgets.QGraphicsItem):
if self.obj.type == 'Mixer' and not self.obj.saved:
- text, ok = QInputDialog.getText(self.container.graphicsView, 'Mixer', 'Enter number of input:')
+ text, ok = QInputDialog.getText(self.container.graphicsView, 'Mixer', 'Enter number of input:',
+ echo=QLineEdit.Normal, text=str(self.obj.no_of_inputs))
if ok and text:
self.nin = int(text)
self.obj.no_of_inputs = self.nin
@@ -436,7 +439,8 @@ class NodeItem(QtWidgets.QGraphicsItem):
# self.obj.no_of_outputs = self.nop
# self.obj.variables['No']['value'] = self.nop
elif self.obj.type == 'DistillationColumn'and not self.obj.saved:
- text, ok = QInputDialog.getText(self.container.graphicsView, 'DistillationColumn', 'Enter number of input:')
+ text, ok = QInputDialog.getText(self.container.graphicsView, 'DistillationColumn', 'Enter number of input:',
+ echo=QLineEdit.Normal, text=str(self.obj.no_of_inputs))
if ok and text:
self.nin = int(text)
self.obj.no_of_inputs = self.nin
diff --git a/OMChem/Flowsheet.py b/OMChem/Flowsheet.py
index 4fb0459..a61cd52 100644
--- a/OMChem/Flowsheet.py
+++ b/OMChem/Flowsheet.py
@@ -100,14 +100,23 @@ class Flowsheet():
self.sim_method = 'Eqn'
self.data.append("model Flowsheet\n")
- for c in self.compounds:
- ucase = c.title()
- lcase = c.lower()
- self.data.append("parameter database." + ucase +' '+ ucase + "; \n")
+ tempCompounds = self.compounds
+ for c in tempCompounds:
+ CompName = c
+ CompName = CompName.replace(" ", "")
+ CompName = CompName.replace("-", "")
+ CompName = CompName.replace(",", "")
+ CompName = CompName.replace("1", "One")
+ CompName = CompName.replace("2", "Two")
+ CompName = CompName.replace("3", "Three")
+ CompName = CompName.replace("4", "Four")
+ CompName = CompName.replace("5", "Five")
+ self.data.append("parameter database." + CompName +' '+ CompName + "; \n")
+ tempCompounds[tempCompounds.index(c)] = CompName
- self.data.append("parameter Integer Nc = " + str(len(self.compounds)) + ";\n")
+ self.data.append("parameter Integer Nc = " + str(len(tempCompounds)) + ";\n")
self.data.append("parameter Simulator.Files.ChemsepDatabase.GeneralProperties C[Nc] = {" +
- str(self.compounds).strip('[').strip(']').replace("'", "") + "};\n")
+ str(tempCompounds).strip('[').strip(']').replace("'", "") + "};\n")
for unitop in self.unit_operations:
if unitop.type != 'MaterialStream':
@@ -185,9 +194,9 @@ class Flowsheet():
self.data.append("model "+unitop.name.lower()+'\n')
for c in self.compounds:
- ucase = c.title()
+ c = c.title()
lcase = c.lower()
- self.data.append("parameter Simulator.Files.Chemsep_Database." + ucase +' '+ ucase + "; \n")
+ self.data.append("parameter Simulator.Files.Chemsep_Database." + c +' '+ c + "; \n")
self.data.append(unitop.OM_Flowsheet_Initialize())
diff --git a/Simulator/Databases/Databases.py b/Simulator/Databases/Databases.py
index 4b3a4c6..d6e0b46 100644
--- a/Simulator/Databases/Databases.py
+++ b/Simulator/Databases/Databases.py
@@ -60,6 +60,7 @@ class ChemsepDatabase():
CompName = CompName.replace("3","Three")
CompName = CompName.replace("4","Four")
CompName = CompName.replace("5","Five")
+
CAS = comp.getElementsByTagName("CAS")[0].getAttribute("value")
CriticalTemp = comp.getElementsByTagName("CriticalTemperature")[0].getAttribute("value")
CriticalPres = comp.getElementsByTagName("CriticalPressure")[0].getAttribute("value")
diff --git a/Undo.dat b/Undo.dat
index 69b5ce3..c101b89 100644
--- a/Undo.dat
+++ b/Undo.dat
Binary files differ
diff --git a/UnitOperations.py b/UnitOperations.py
index 7f9ed5e..6fc2c9c 100644
--- a/UnitOperations.py
+++ b/UnitOperations.py
@@ -593,7 +593,7 @@ class Mixer(UnitOperation):
UnitOperation.__init__(self)
self.name = name + str(Mixer.counter)
self.type = 'Mixer'
- self.no_of_inputs = 6
+ self.no_of_inputs = 2
self.Pout_modes = ['Inlet_Minimum', 'Inlet_Average', 'Inlet_Maximum']
self.parameters = ['NI', 'outPress']