From dcba7d32bb73e04a2f65e35f86d047d619d2c6ad Mon Sep 17 00:00:00 2001 From: pravindalve Date: Mon, 12 Apr 2021 20:41:30 +0530 Subject: Small fixes for Distillation column and mixer --- DockWidgets/DistillationColumnStagewiseResults.ui | 6 ++++++ DockWidgets/DockWidgetDistillationColumn.py | 3 ++- DockWidgets/DockWidgetDistillationColumn.ui | 2 +- DockWidgets/__pycache__/DockWidget.cpython-37.pyc | Bin 4411 -> 4390 bytes .../DockWidgetDistillationColumn.cpython-37.pyc | Bin 9426 -> 9430 bytes Graphics.py | 7 +++++-- Undo.dat | Bin 28916 -> 924 bytes UnitOperations.py | 2 +- 8 files changed, 15 insertions(+), 5 deletions(-) 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 @@ 391 + + QAbstractScrollArea::AdjustToContents + @@ -53,6 +56,9 @@ 391 + + QAbstractScrollArea::AdjustToContentsOnFirstShow + 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 @@ true - 1 + 0 diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc index a8934e2..0a00568 100644 Binary files a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc differ diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc index ee33ca4..066bc00 100644 Binary files a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc differ diff --git a/Graphics.py b/Graphics.py index a829849..3deb9e2 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 * @@ -424,7 +425,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 +438,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/Undo.dat b/Undo.dat index 69b5ce3..f3f5d61 100644 Binary files a/Undo.dat and b/Undo.dat 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'] -- cgit