summaryrefslogtreecommitdiff
path: root/DockWidgets
diff options
context:
space:
mode:
Diffstat (limited to 'DockWidgets')
-rw-r--r--DockWidgets/DockWidget.py126
-rw-r--r--DockWidgets/DockWidget.ui4
-rw-r--r--DockWidgets/DockWidgetCompoundSeparator.py7
-rw-r--r--DockWidgets/DockWidgetCompressorExpander.py146
-rw-r--r--DockWidgets/DockWidgetCompressorExpander.ui214
-rw-r--r--DockWidgets/DockWidgetDistillationColumn.py64
-rw-r--r--DockWidgets/DockWidgetDistillationColumn.ui36
-rw-r--r--DockWidgets/DockWidgetFlash.py14
-rw-r--r--DockWidgets/DockWidgetMaterialStream.py139
-rw-r--r--DockWidgets/DockWidgetMaterialStream.ui57
-rw-r--r--DockWidgets/DockWidgetMixer.py14
-rw-r--r--DockWidgets/DockWidgetShortcutColumn.py64
-rw-r--r--DockWidgets/DockWidgetShortcutColumn.ui221
-rw-r--r--DockWidgets/DockWidgetSplitter.py27
-rw-r--r--DockWidgets/__pycache__/DockWidget.cpython-37.pycbin6125 -> 4323 bytes
-rw-r--r--DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pycbin3187 -> 3047 bytes
-rw-r--r--DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pycbin4204 -> 4893 bytes
-rw-r--r--DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pycbin2913 -> 2719 bytes
-rw-r--r--DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pycbin8757 -> 8308 bytes
-rw-r--r--DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pycbin2233 -> 1983 bytes
-rw-r--r--DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pycbin3382 -> 4417 bytes
-rw-r--r--DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pycbin2764 -> 2501 bytes
22 files changed, 754 insertions, 379 deletions
diff --git a/DockWidgets/DockWidget.py b/DockWidgets/DockWidget.py
index 6fc7731..b3845bb 100644
--- a/DockWidgets/DockWidget.py
+++ b/DockWidgets/DockWidget.py
@@ -2,10 +2,7 @@ from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.uic import loadUiType
-import pandas as pd
-from functools import partial
from ComponentSelector import *
-from collections import defaultdict
from Graphics import *
ui_dialog,_ = loadUiType('DockWidgets/DockWidget.ui')
@@ -20,15 +17,13 @@ class DockWidget(QDockWidget,ui_dialog):
self.obj=obj
self.type = comptype
self.input_dict = {}
- self.x_pclist = []
self.modes()
self.comboBox.currentIndexChanged.connect(self.mode_selection)
print("constructor ", self.input_dict)
self.pushButton_2.clicked.connect(self.param)
- self.dict = {}
- self.name_type = None
+ self.dict = {} # a dictionary
self.container = container
# input data tab
@@ -61,72 +56,18 @@ class DockWidget(QDockWidget,ui_dialog):
try:
print("input_params_list ", self.input_dict)
for c,i in enumerate(self.input_dict):
+ print(i)
if i == None:
continue
- if(i=="thermo_package"):
- print("thermo1")
- combo = QComboBox()
- self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')]
- print("thermo2")
- for j in self.lines:
- combo.addItem(str(j))
- combo.setMinimumContentsLength(15)
- lay = QGridLayout()
- lay.addWidget(QLabel(i+":"), 0,0, alignment=Qt.AlignLeft)
- lay.addWidget(combo, 0, 1, alignment=Qt.AlignCenter)
- lay.addWidget(QLabel(''), 0, 2, alignment = Qt.AlignCenter)
- self.formLayout.addRow(lay)
- self.input_dict[i] = combo
- print("thermo")
- elif(i=="Ctype"):
- combo = QComboBox()
- self.lines = ["Total","Partial"]
- for j in self.lines:
- combo.addItem(str(j))
- combo.setMinimumContentsLength(15)
- lay = QGridLayout()
- lay.addWidget(QLabel("Condensor Type :"), 0, 0, alignment=Qt.AlignLeft)
- lay.addWidget(combo, 0, 1, alignment=Qt.AlignCenter)
- lay.addWidget(QLabel(''), 0, 2, alignment = Qt.AlignCenter)
- self.formLayout.addRow(lay)
- self.input_dict[i] = combo
- elif(i=="x_pc"):
- noc = len(compound_selected)
- print(noc)
- self.x_pclist.clear()
- gp = QGroupBox("Compounds")
- lay = QGridLayout()
- for j in range(noc):
- l = QLineEdit()
- self.input_dict[i] = "x_pc"
- lay.addWidget(QLabel(str(compound_selected[j])+":"),j,0, alignment=Qt.AlignLeft)
- lay.addWidget(l,j,1, alignment=Qt.AlignCenter)
- lay.addWidget(QLabel(self.obj.variables[i]['unit']),j,2, alignment=Qt.AlignCenter)
- self.x_pclist.append(l)
- gp.setLayout(lay)
- self.formLayout.addRow(gp)
- else:
- print("elseloop")
- print(i)
- if i == None:
- continue
- l = QLineEdit()
- if self.input_dict[i] != None:
- l.setText(str(self.input_dict[i]))
- print('before lay')
- lay = QGridLayout()
- lay.addWidget(QLabel(self.obj.variables[i]['name']+":"),0,0, alignment=Qt.AlignLeft) #self.obj.variables[i]['name']
- lay.addWidget(l,0,1, alignment=Qt.AlignCenter)
- print('after lay')
- if(i != 'MolFlow'):
- lay.addWidget(QLabel(self.obj.variables[i]['unit']),0,2, alignment=Qt.AlignCenter)
- else:
- lay.addWidget(QLabel('mol/s'),0,2, alignment=Qt.AlignCenter)
- print('after all')
- self.formLayout.addRow(lay)
- self.input_dict[i] = l
-
-
+ l = QLineEdit()
+ if self.input_dict[i] != None:
+ l.setText(str(self.input_dict[i]))
+ lay = QGridLayout()
+ lay.addWidget(QLabel(self.obj.variables[i]['name']+":"),0,0, alignment=Qt.AlignLeft)
+ lay.addWidget(l,0,1, alignment=Qt.AlignCenter)
+ lay.addWidget(QLabel(self.obj.variables[i]['unit']),0,2, alignment=Qt.AlignCenter)
+ self.formLayout.addRow(lay)
+ self.input_dict[i] = l
except Exception as e:
print(e)
@@ -135,40 +76,11 @@ class DockWidget(QDockWidget,ui_dialog):
def param(self):
try:
- self.dict={}
+ self.dict = {}
print("param.input_dict ", self.input_dict)
for i in self.input_dict:
if (self.input_dict[i] == None):
continue
- if(i=="thermo_package"):
- if (self.input_dict[i].currentText()):
- self.dict[i] = self.input_dict[i].currentText()
- else:
- self.show_error()
- break
- elif(i=="Ctype"):
- if (self.input_dict[i].currentText()):
- self.dict[i] = self.input_dict[i].currentText()
- else:
- self.show_error()
- break
- elif(i =="x_pc"):
- l=[]
- mf = []
- total_moles = 0
- for mol_frac in self.x_pclist:
- if (mol_frac.text()):
- l.append(mol_frac.text())
- total_moles += float(l[-1])
- else:
- self.show_error()
- break
- for c in range(len(compound_selected)):
- mf.append(str(float(l[c])/total_moles))
- self.x_pclist[c].setText(mf[-1])
- self.dict[i] = ",".join(mf)
- elif(i == 'Pout' and self.obj.type == 'Mixer' or i == '' or i == 'HKey' or i == 'LKey'):
- self.dict[i] = self.input_dict[i].currentText()
else:
print(self.input_dict[i], i, self.obj.type)
if (self.input_dict[i].text()):
@@ -187,11 +99,15 @@ class DockWidget(QDockWidget,ui_dialog):
@staticmethod
def show_result(lst):
- #DockWidget1.flag = True
for i in lst:
- i.results_category(i.name)
- #i.show()
+ try:
+ i.results_category(i.name)
+ except AttributeError:
+ pass
+ def clear_results(self):
+ self.tableWidget.setRowCount(0)
+
# result data tab
def results_category(self,name):
flag = True
@@ -217,4 +133,6 @@ class DockWidget(QDockWidget,ui_dialog):
self.tableWidget.resizeColumnsToContents()
except Exception as e:
- print(e) \ No newline at end of file
+ print(e)
+
+ \ No newline at end of file
diff --git a/DockWidgets/DockWidget.ui b/DockWidgets/DockWidget.ui
index 5851d71..ba6dc52 100644
--- a/DockWidgets/DockWidget.ui
+++ b/DockWidgets/DockWidget.ui
@@ -101,7 +101,7 @@
<x>10</x>
<y>100</y>
<width>331</width>
- <height>321</height>
+ <height>271</height>
</rect>
</property>
<property name="title">
@@ -117,7 +117,7 @@
<property name="geometry">
<rect>
<x>10</x>
- <y>430</y>
+ <y>380</y>
<width>331</width>
<height>21</height>
</rect>
diff --git a/DockWidgets/DockWidgetCompoundSeparator.py b/DockWidgets/DockWidgetCompoundSeparator.py
index 1818290..6de61a5 100644
--- a/DockWidgets/DockWidgetCompoundSeparator.py
+++ b/DockWidgets/DockWidgetCompoundSeparator.py
@@ -21,18 +21,13 @@ class DockWidgetCompoundSeparator(QDockWidget,ui_dialog):
self.type = comptype
self.input_dict = []
- print("constructor ", self.input_dict)
self.input_params_list()
self.dict = []
def input_params_list(self):
try:
- print("input_params_list ", self.input_dict)
if self.type == 'CompoundSeparator':
-
- # self.gridLayout = QGridLayout()
calculationGroupBox = QGroupBox('Calculation Parameters')
-
calculationLayout = QGridLayout()
r1 = QRadioButton('Stream 1')
@@ -81,7 +76,6 @@ class DockWidgetCompoundSeparator(QDockWidget,ui_dialog):
def param(self):
try:
self.dict=[]
- print("param.input_dict ", self.input_dict)
self.dict = [self.input_dict[0].isChecked(), self.input_dict[1].isChecked()]
j = 2
@@ -91,7 +85,6 @@ class DockWidgetCompoundSeparator(QDockWidget,ui_dialog):
self.dict.append(self.input_dict[j+i+1].text())
j += 1
- print("param ", self.dict)
self.obj.param_setter(self.dict)
self.hide()
diff --git a/DockWidgets/DockWidgetCompressorExpander.py b/DockWidgets/DockWidgetCompressorExpander.py
new file mode 100644
index 0000000..841b850
--- /dev/null
+++ b/DockWidgets/DockWidgetCompressorExpander.py
@@ -0,0 +1,146 @@
+from PyQt5.QtCore import *
+from PyQt5.QtWidgets import *
+from PyQt5.QtGui import *
+from PyQt5.uic import loadUiType
+from ComponentSelector import *
+from Graphics import *
+
+ui_dialog,_ = loadUiType('DockWidgets/DockWidgetCompressorExpander.ui')
+
+class DockWidgetCompressorExpander(QDockWidget,ui_dialog):
+
+ def __init__(self,name,comptype,obj,container, parent=None):
+ QDockWidget.__init__(self,parent)
+ self.setupUi(self)
+ self.setWindowTitle(obj.name)
+ self.name=name
+ self.obj=obj
+ 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)
+ self.dict = {}
+
+ self.name_type = None
+ self.container = container
+
+ # input data tab
+ def modes(self):
+ modes_list = self.obj.modes_list
+ if(modes_list):
+ for j in modes_list:
+ self.comboBox.addItem(str(self.obj.variables[j]['name']))
+ self.mode_selection()
+ else:
+ self.comboBox.setDisabled(True)
+ self.input_dict= {}
+ self.input_dict = self.obj.param_getter()
+ self.input_params_list()
+
+ def mode_selection(self):
+ self.input_dict= {}
+ for i in reversed(range(self.formLayout.count())):
+ self.formLayout.removeRow(i)
+ print(self.comboBox.currentText())
+ for i in self.obj.variables:
+ if self.obj.variables[i]['name'] == self.comboBox.currentText():
+ currentText = i
+ break
+ self.input_dict = self.obj.param_getter(currentText)
+ print('mode selection ', self.input_dict)
+ self.input_params_list()
+
+ def input_params_list(self):
+ try:
+ print("input_params_list ", self.input_dict)
+ for c,i in enumerate(self.input_dict):
+ if i == None:
+ continue
+
+ l = QLineEdit()
+ if self.input_dict[i] != None:
+ l.setText(str(self.input_dict[i]))
+ lay = QGridLayout()
+ lay.addWidget(QLabel(self.obj.variables[i]['name']+":"),0,0, alignment=Qt.AlignLeft)
+ lay.addWidget(l,0,1, alignment=Qt.AlignCenter)
+ lay.addWidget(QLabel(self.obj.variables[i]['unit']),0,2, alignment=Qt.AlignCenter)
+
+ 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)
+
+ def show_error(self):
+ QMessageBox.about(self, 'Important', "Please fill all fields with data")
+
+ def param(self):
+ try:
+ self.dict={}
+ for i in self.input_dict:
+ if (self.input_dict[i] == None):
+ continue
+ elif (i == "Thermo Package"):
+ self.dict[i] = self.input_dict[i].currentText()
+ else:
+ print(self.input_dict[i], i, self.obj.type)
+ if (self.input_dict[i].text()):
+ self.dict[i] = self.input_dict[i].text()
+ else:
+ print(self.input_dict[i].text())
+ self.show_error()
+ break
+
+ self.obj.param_setter(self.dict)
+ self.hide()
+
+ except Exception as e:
+ print(e)
+
+ @staticmethod
+ def show_result(lst):
+ for i in lst:
+ try:
+ i.results_category(i.name)
+ except AttributeError:
+ pass
+
+ def clear_results(self):
+ self.tableWidget.setRowCount(0)
+
+ # result data tab
+ def results_category(self,name):
+ flag = True
+ try:
+ print("Under result category name ", name)
+ result=self.container.result
+ obj = self.container.fetch_object(name)
+ self.tableWidget.setRowCount(0)
+ variKeys = list(obj.variables.keys())
+ print(variKeys)
+ for i, val in enumerate(variKeys):
+ propertyname = name + '.' + val
+ print(i,val, propertyname)
+ if propertyname in result[0]:
+ ind = result[0].index(propertyname)
+ resultval = str(result[-1][ind])
+ print("######Resultsfetch####",val,resultval)
+ rowPosition = self.tableWidget.rowCount()
+ self.tableWidget.insertRow(rowPosition)
+ self.tableWidget.setItem(rowPosition , 0, QTableWidgetItem(obj.variables[val]['name']))
+ self.tableWidget.setItem(rowPosition , 1, QTableWidgetItem(resultval))
+ self.tableWidget.setItem(rowPosition , 2, QTableWidgetItem(obj.variables[val]['unit']))
+ self.tableWidget.resizeColumnsToContents()
+
+ except Exception as e:
+ print(e)
+
+ \ No newline at end of file
diff --git a/DockWidgets/DockWidgetCompressorExpander.ui b/DockWidgets/DockWidgetCompressorExpander.ui
new file mode 100644
index 0000000..372fc0b
--- /dev/null
+++ b/DockWidgets/DockWidgetCompressorExpander.ui
@@ -0,0 +1,214 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>392</width>
+ <height>700</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>3200</width>
+ <height>5000</height>
+ </size>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <widget class="QTabWidget" name="tabWidget">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>30</y>
+ <width>361</width>
+ <height>621</height>
+ </rect>
+ </property>
+ <property name="autoFillBackground">
+ <bool>false</bool>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>Input Data</string>
+ </attribute>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="geometry">
+ <rect>
+ <x>9</x>
+ <y>9</y>
+ <width>331</width>
+ <height>71</height>
+ </rect>
+ </property>
+ <property name="title">
+ <string>Mode Selection</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Mode : </string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboBox">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>100</y>
+ <width>331</width>
+ <height>111</height>
+ </rect>
+ </property>
+ <property name="title">
+ <string>Parameter Selection</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QFormLayout" name="formLayout"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QPushButton" name="pushButton_2">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>280</y>
+ <width>331</width>
+ <height>21</height>
+ </rect>
+ </property>
+ <property name="text">
+ <string>Submit</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>220</y>
+ <width>331</width>
+ <height>51</height>
+ </rect>
+ </property>
+ <property name="title">
+ <string/>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_10">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_11">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Thermo Package</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="cbTP">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Results</string>
+ </attribute>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <widget class="QTableWidget" name="tableWidget">
+ <property name="columnCount">
+ <number>3</number>
+ </property>
+ <attribute name="horizontalHeaderDefaultSectionSize">
+ <number>110</number>
+ </attribute>
+ <attribute name="horizontalHeaderStretchLastSection">
+ <bool>true</bool>
+ </attribute>
+ <column>
+ <property name="text">
+ <string>Attribute</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Unit</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/DockWidgets/DockWidgetDistillationColumn.py b/DockWidgets/DockWidgetDistillationColumn.py
index 65e9932..3255015 100644
--- a/DockWidgets/DockWidgetDistillationColumn.py
+++ b/DockWidgets/DockWidgetDistillationColumn.py
@@ -20,7 +20,6 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog):
self.obj=obj
self.type = comptype
self.input_dict = []
- print("constructor ", self.input_dict)
self.pushButton_2.clicked.connect(self.param)
self.dict = []
self.input_params_list()
@@ -34,10 +33,18 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog):
print("input_params_list ", self.input_dict)
# tab 1
- self.l1.setText(self.obj.variables['Nt']['name']+":")
- self.le1.setText(str(self.obj.variables['Nt']['value']))
- self.l2.setText(self.obj.variables['In_s']['name']+":")
- self.l3.setText(self.obj.variables['InT_s']['name']+":")
+
+ l1 = QLineEdit()
+ self.lay1.addWidget(QLabel(self.obj.variables['Nt']['name'] + " :"), 0 ,0, alignment=Qt.AlignLeft)
+ self.lay1.addWidget(l1,0,1, alignment=Qt.AlignCenter)
+ self.input_dict.append(l1)
+
+ for i in range(self.obj.variables['Ni']['value']):
+ print(i)
+ l = QLineEdit()
+ self.lay1.addWidget(QLabel(self.obj.variables['InT_s']['name'] +" " + str(i+1) + " location :"),i+1,0, alignment=Qt.AlignLeft)
+ self.lay1.addWidget(l,i+1,1, alignment=Qt.AlignCenter)
+ self.input_dict.append(l)
# tab 2
self.l4.setText(self.obj.variables['Ctype']['name']+":")
@@ -55,8 +62,13 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog):
for j in self.obj.compounds:
self.cb2.addItem(str(j))
self.cb2.setDisabled(True)
- self.cb1.currentIndexChanged.connect(self.fun2)
-
+ self.cb1.currentIndexChanged.connect(self.fun2)
+
+ self.input_dict.append(self.cb5)
+ self.input_dict.append(self.le5)
+ self.input_dict.append(self.cb1)
+ self.input_dict.append(self.cb2)
+ self.input_dict.append(self.le6)
# tab3
self.l8.setText(self.obj.variables['Preb']['name']+":")
@@ -72,7 +84,12 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog):
self.cb4.setDisabled(True)
self.cb3.currentIndexChanged.connect(self.fun3)
- self.input_dict = [self.le1, self.le2, self.le3, self.cb5, self.le5, self.cb1, self.cb2, self.le6, self.le7, self.cb3, self.cb4, self.le8]
+ self.input_dict.append(self.le7)
+ self.input_dict.append(self.cb3)
+ self.input_dict.append(self.cb4)
+ self.input_dict.append(self.le8)
+
+ # self.input_dict = [self.le1, self.le2, self.le3, self.cb5, self.le5, self.cb1, self.cb2, self.le6, self.le7, self.cb3, self.cb4, self.le8]
except Exception as e:
print(e)
@@ -95,10 +112,35 @@ class DockWidgetDistillationColumn(QDockWidget,ui_dialog):
def param(self):
try:
self.dict= []
+ temp = 0
print("param.input_dict ", self.input_dict)
- self.dict = [self.input_dict[0].text(),self.input_dict[1].text(), self.input_dict[2].text(), self.input_dict[3].currentText(),
- self.input_dict[4].text(), self.input_dict[5].currentText(), self.input_dict[6].currentText(), self.input_dict[7].text(),
- self.input_dict[8].text(), self.input_dict[9].currentText(), self.input_dict[10].currentText(), self.input_dict[11].text()]
+ self.dict.append(int(self.input_dict[0].text()))
+
+ for i in range(self.obj.variables['Ni']['value']):
+ self.dict.append(int(self.input_dict[i+1].text()))
+ temp = i + 1
+ print(temp)
+
+ print(temp)
+ print(self.input_dict[temp+1])
+ self.dict.append(self.input_dict[temp+1].currentText())
+ print(temp+1)
+ self.dict.append(int(self.input_dict[temp+2].text()))
+ print(temp+2)
+ self.dict.append(self.input_dict[temp+3].currentText())
+ print(temp+3)
+ self.dict.append(self.input_dict[temp+4].currentText())
+ print(temp+4)
+ self.dict.append(int(self.input_dict[temp+5].text()))
+ print(temp+5)
+ self.dict.append(int(self.input_dict[temp+6].text()))
+ print(temp+6)
+ self.dict.append(self.input_dict[temp+7].currentText())
+ print(temp+7)
+ self.dict.append(self.input_dict[temp+8].currentText())
+ print(temp+8)
+ self.dict.append(int(self.input_dict[temp+9].text()))
+ print(temp+9)
print("param ", self.dict)
self.obj.param_setter(self.dict)
diff --git a/DockWidgets/DockWidgetDistillationColumn.ui b/DockWidgets/DockWidgetDistillationColumn.ui
index 0cb1043..e603071 100644
--- a/DockWidgets/DockWidgetDistillationColumn.ui
+++ b/DockWidgets/DockWidgetDistillationColumn.ui
@@ -78,36 +78,12 @@
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<layout class="QGridLayout" name="lay1">
- <item row="1" column="0">
- <widget class="QLabel" name="l2">
- <property name="text">
- <string>TextLabel</string>
- </property>
- </widget>
- </item>
- <item row="0" column="2">
- <widget class="QLineEdit" name="le1"/>
- </item>
- <item row="0" column="0">
- <widget class="QLabel" name="l1">
- <property name="text">
- <string>TextLabel</string>
- </property>
- </widget>
- </item>
- <item row="1" column="2">
- <widget class="QLineEdit" name="le2"/>
- </item>
- <item row="2" column="0">
- <widget class="QLabel" name="l3">
- <property name="text">
- <string>TextLabel</string>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QLineEdit" name="le3"/>
- </item>
+ <property name="sizeConstraint">
+ <enum>QLayout::SetDefaultConstraint</enum>
+ </property>
+ <property name="verticalSpacing">
+ <number>0</number>
+ </property>
</layout>
</item>
</layout>
diff --git a/DockWidgets/DockWidgetFlash.py b/DockWidgets/DockWidgetFlash.py
index 6098b27..4e1c5e3 100644
--- a/DockWidgets/DockWidgetFlash.py
+++ b/DockWidgets/DockWidgetFlash.py
@@ -2,10 +2,7 @@ from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.uic import loadUiType
-import pandas as pd
-from functools import partial
from ComponentSelector import *
-from collections import defaultdict
from Graphics import *
ui_dialog,_ = loadUiType('DockWidgets/DockWidgetFlash.ui')
@@ -20,16 +17,13 @@ class DockWidgetFlash(QDockWidget,ui_dialog):
self.obj=obj
self.type = comptype
self.input_dict = []
- print("constructor ", self.input_dict)
self.input_params_list()
self.btn.clicked.connect(self.param)
- self.dict = []
+ self.dict = [] # a list
def input_params_list(self):
- try:
- print("input_params_list ", self.input_dict)
-
- self.l1.setText(self.obj.variables['thermoPackage']['name']+":")
+ try:
+ self.l1.setText(self.obj.variables['thermo_package']['name']+":")
self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')]
for j in self.lines:
self.cb1.addItem(str(j))
@@ -63,7 +57,7 @@ class DockWidgetFlash(QDockWidget,ui_dialog):
def param(self):
try:
- self.dict={}
+ self.dict = []
print("param.input_dict ", self.input_dict)
self.dict = [self.input_dict[0].currentText(),self.input_dict[1].isChecked(), float(self.input_dict[2].text()), self.input_dict[3].isChecked(), float(self.input_dict[4].text())]
print("param ", self.dict)
diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py
index 78959fc..a661362 100644
--- a/DockWidgets/DockWidgetMaterialStream.py
+++ b/DockWidgets/DockWidgetMaterialStream.py
@@ -2,10 +2,7 @@ from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.uic import loadUiType
-import pandas as pd
-from functools import partial
from ComponentSelector import *
-from collections import defaultdict
from Graphics import *
ui_dialog,_ = loadUiType('DockWidgets/DockWidgetMaterialStream.ui')
@@ -24,9 +21,8 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
self.modes()
self.comboBox.currentIndexChanged.connect(self.mode_selection)
- print("constructor ", self.input_dict)
self.pushButton_2.clicked.connect(self.param)
- self.dict = {}
+ self.dict = {} # a dictionary
self.name_type = None
self.container = container
@@ -36,17 +32,6 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
self.lTreeWidget.setHeaderItem(header)
self.vTreeWidget.setHeaderItem(header)
- self.mTreeWidget.itemClicked.connect(lambda : self.printer(self.mTreeWidget.currentItem()))
- self.lTreeWidget.itemClicked.connect(lambda : self.printer(self.lTreeWidget.currentItem()))
- self.vTreeWidget.itemClicked.connect(lambda : self.printer(self.vTreeWidget.currentItem()))
-
-
- # def printer(self, treeItem ):
- # foldername = treeItem.text(0)
- # comment = treeItem.text(1)
- # data = treeItem.text(2)
- # print(foldername , ': ' , comment , ' (' + data + ')')
-
# input data tab
def modes(self):
modes_list = self.obj.modes_list
@@ -67,55 +52,33 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
self.input_params_list()
def input_params_list(self):
- try:
- print("input_params_list ", self.input_dict)
+ try:
for c,i in enumerate(self.input_dict):
- if(i=="thermo_package"):
- print("thermo1")
- combo = QComboBox()
- self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')]
- print("thermo2")
- for j in self.lines:
- combo.addItem(str(j))
- lay = QGridLayout()
- lay.addWidget(QLabel(i+":"), 0,0, alignment=Qt.AlignLeft)
- lay.addWidget(combo, 0, 1, alignment=Qt.AlignRight)
- self.formLayout.addRow(lay)
- self.input_dict[i] = combo
- print("thermo")
- elif(i=="condType"):
- combo = QComboBox()
- self.lines = ["Total","Partial"]
- for j in self.lines:
- combo.addItem(str(j))
- lay = QGridLayout()
- lay.addWidget(QLabel("Condensor Type :"+":"), 0, 0, alignment=Qt.AlignLeft)
- lay.addWidget(combo, 0, 1, alignment=Qt.AlignCenter)
- self.formLayout.addRow(lay)
- self.input_dict[i] = combo
- elif(i=="x_pc"):
+ if(i=="x_pc"):
noc = len(compound_selected)
print(noc)
self.x_pclist.clear()
-
+
gp = QGroupBox("Mole Fractions")
lay = QGridLayout()
for j in range(noc):
l = QLineEdit()
if self.input_dict[i] != '':
- l.setText(str(self.obj.variables[compound_selected[j]]['value']))
+ l.setText(str(self.obj.variables['x_pc']['value'][j]))
+ print('l = ', str(self.obj.variables['x_pc']['value'][j]))
+
self.input_dict[i] = "x_pc"
lay.addWidget(QLabel(str(compound_selected[j])+":"),j,0, alignment=Qt.AlignLeft)
lay.addWidget(l,j,1, alignment=Qt.AlignCenter)
- self.x_pclist.append(l)
-
+ self.x_pclist.append(l)
gp.setLayout(lay)
- self.formLayout.addRow(gp)
+ self.formLayout.addRow(gp)
else:
print("elseloop")
l = QLineEdit()
if self.input_dict[i] != None:
l.setText(str(self.input_dict[i]))
+
lay = QGridLayout()
lay.addWidget(QLabel(i+":"),0,0, alignment=Qt.AlignLeft)
lay.addWidget(l,0,1, alignment=Qt.AlignCenter)
@@ -124,8 +87,13 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
else:
lay.addWidget(QLabel("mol/s"),0,2, alignment=Qt.AlignCenter)
self.formLayout.addRow(lay)
- self.input_dict[i] = l
-
+ 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)
@@ -135,22 +103,10 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
def param(self):
try:
self.dict={}
-
print("param.input_dict ", self.input_dict)
for i in self.input_dict:
- if(i=="thermo_package"):
- if (self.input_dict[i].currentText()):
- self.dict[i] = self.input_dict[i].currentText()
- else:
- self.show_error()
- break
- elif(i=="condType"):
- if (self.input_dict[i].currentText()):
- self.dict[i] = self.input_dict[i].currentText()
- else:
- self.show_error()
- break
- elif(i =="x_pc"):
+ print(i)
+ if(i =="x_pc"):
l=[]
mf = []
total_moles = 0
@@ -166,14 +122,16 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
self.obj.variables[compound_selected[c]]['value'] = str(float(l[c])/total_moles)
self.x_pclist[c].setText(mf[-1])
self.dict[i] = ",".join(mf)
+ elif (i == "Thermo Package"):
+ self.dict[i] = self.input_dict[i].currentText()
else:
if (self.input_dict[i].text()):
self.dict[i] = self.input_dict[i].text()
else:
- print(self.input_dict[i].text())
+ print(self.input_dict[i])
self.show_error()
break
-
+
print("param ", self.dict)
self.obj.param_setter(self.dict)
self.hide()
@@ -181,14 +139,19 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
except Exception as e:
print(e)
-
@staticmethod
def show_result(lst):
- #DockWidget1.flag = True
for i in lst:
i.results_category(i.name)
- #i.show()
-
+
+ def clear_results(self):
+ self.mTreeWidget.clear()
+ self.mTableWidget.setRowCount(0)
+ self.lTreeWidget.clear()
+ self.lTableWidget.setRowCount(0)
+ self.vTreeWidget.clear()
+ self.vTableWidget.setRowCount(0)
+
# result data tab
def results_category(self,name):
flag = True
@@ -197,6 +160,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
result=self.container.result
obj = self.container.fetch_object(name)
+
d = {"Mole Fraction":"x_pc", "Mass Fraction":"xm_pc", "Mole Flow":"F_pc", "Mass Flow":"Fm_pc"}
lst = list(d.keys())
klst = list(d.values())
@@ -206,21 +170,21 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
# Amounts Tab
if obj.type == 'MaterialStream':
- l = [] # list for basis names
+ ll = [] # list for basis names
for basis in d:
propertyname = name + '.' + d[basis]
print("basis ", basis, propertyname)
for i in result[0]:
if (propertyname in i):
- l.append(i)
- print(l)
+ ll.append(i)
+ print(ll)
j = 0
t = 0
namee = klst[j]
print("namee ", namee)
- for i,k in enumerate(l):
+ for i,k in enumerate(ll):
ind = result[0].index(k)
print("index ", ind)
print("str ", k)
@@ -262,7 +226,6 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
child = QTreeWidgetItem(vroot, [compound_selected[t], str(resultval),obj.variables[k.split('.')[1]]['unit']])
t += 1
flag = False
- #print(obj.variables)
# Phase Properties Tab
phaseResLst = []
@@ -314,7 +277,6 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
self.vTableWidget.setItem(vrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit']))
self.vTableWidget.resizeColumnsToContents()
if not '[' in val:
- #print(p[val.split('.')[1]])
print(obj.variables[val.split('.')[1]]['name'])
mrowPosition = self.mTableWidget.rowCount()
self.mTableWidget.insertRow(mrowPosition)
@@ -323,10 +285,27 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog):
self.mTableWidget.setItem(mrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit']))
self.mTableWidget.resizeColumnsToContents()
- print(obj.variables)
- except Exception as e:
- print(e)
-
+ # updating the input data from fetched results from simulation
+ print(self.comboBox.currentText())
+
+ self.input_dict = {}
+ self.input_dict = self.obj.param_getter(self.comboBox.currentText())
+ print("before", self.input_dict)
+ self.input_dict.pop("x_pc")
+ temp = self.input_dict.pop('thermo_package')
+ for i in range(len(compound_selected)):
+ print(i)
+ self.input_dict['x_pc[1,' + str(i+1) + ']'] = self.obj.variables['x_pc[1,' + str(i+1) +']']['value']
+ self.input_dict['thermo_package'] = temp
+ print("after", self.input_dict)
+
+ # chaning index for updating the input data
+ indexx = self.comboBox.currentIndex()
+ self.comboBox.setCurrentIndex(1)
+ self.comboBox.setCurrentIndex(indexx)
- \ No newline at end of file
+
+
+ except Exception as e:
+ print(e) \ No newline at end of file
diff --git a/DockWidgets/DockWidgetMaterialStream.ui b/DockWidgets/DockWidgetMaterialStream.ui
index 8995ba6..a442eee 100644
--- a/DockWidgets/DockWidgetMaterialStream.ui
+++ b/DockWidgets/DockWidgetMaterialStream.ui
@@ -98,7 +98,7 @@
<x>10</x>
<y>100</y>
<width>331</width>
- <height>321</height>
+ <height>221</height>
</rect>
</property>
<property name="title">
@@ -114,7 +114,7 @@
<property name="geometry">
<rect>
<x>10</x>
- <y>430</y>
+ <y>390</y>
<width>331</width>
<height>21</height>
</rect>
@@ -123,6 +123,51 @@
<string>Submit</string>
</property>
</widget>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>330</y>
+ <width>331</width>
+ <height>51</height>
+ </rect>
+ </property>
+ <property name="title">
+ <string/>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_10">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_11">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Thermo Package</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="cbTP">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
@@ -273,8 +318,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>335</width>
- <height>494</height>
+ <width>151</width>
+ <height>128</height>
</rect>
</property>
<property name="styleSheet">
@@ -362,8 +407,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>335</width>
- <height>494</height>
+ <width>151</width>
+ <height>128</height>
</rect>
</property>
<property name="styleSheet">
diff --git a/DockWidgets/DockWidgetMixer.py b/DockWidgets/DockWidgetMixer.py
index 28cbff0..6c46c39 100644
--- a/DockWidgets/DockWidgetMixer.py
+++ b/DockWidgets/DockWidgetMixer.py
@@ -2,10 +2,7 @@ from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.uic import loadUiType
-import pandas as pd
-from functools import partial
from ComponentSelector import *
-from collections import defaultdict
from Graphics import *
ui_dialog,_ = loadUiType('DockWidgets/DockWidgetMixer.ui')
@@ -21,16 +18,13 @@ class DockWidgetMixer(QDockWidget,ui_dialog):
self.type = comptype
self.input_dict = []
self.x_pclist = []
- print("constructor ", self.input_dict)
self.input_params_list()
self.btn.clicked.connect(self.param)
self.dict = {}
# input data tab
def input_params_list(self):
- try:
- print("input_params_list ", self.input_dict)
-
+ try:
self.l1.setText(self.obj.variables['NI']['name']+":")
self.le1.setText(str(self.obj.variables['NI']['value']))
self.u1.setText(self.obj.variables['NI']['unit'])
@@ -38,8 +32,6 @@ class DockWidgetMixer(QDockWidget,ui_dialog):
self.cb2.addItem(str(i))
self.l2.setText(self.obj.variables['outPress']['name']+":")
-
-
self.input_dict = [self.le1, self.cb2]
except Exception as e:
@@ -51,9 +43,7 @@ class DockWidgetMixer(QDockWidget,ui_dialog):
def param(self):
try:
self.dict={}
- print("param.input_dict ", self.input_dict)
- self.dict = [int(self.input_dict[0].text()),self.input_dict[1].currentText()]
- print("param ", self.dict)
+ self.dict = [int(self.input_dict[0].text()), self.input_dict[1].currentText()]
self.obj.param_setter(self.dict)
self.hide()
diff --git a/DockWidgets/DockWidgetShortcutColumn.py b/DockWidgets/DockWidgetShortcutColumn.py
index af81441..2b7dfae 100644
--- a/DockWidgets/DockWidgetShortcutColumn.py
+++ b/DockWidgets/DockWidgetShortcutColumn.py
@@ -2,10 +2,7 @@ from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.uic import loadUiType
-import pandas as pd
-from functools import partial
from ComponentSelector import *
-from collections import defaultdict
from Graphics import *
ui_dialog,_ = loadUiType('DockWidgets/DockWidgetShortcutColumn.ui')
@@ -20,7 +17,6 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog):
self.obj=obj
self.type = comptype
self.input_dict = []
- print("constructor ", self.input_dict)
self.input_params_list()
self.btn.clicked.connect(self.param)
self.dict = []
@@ -30,17 +26,15 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog):
# input data tab
def input_params_list(self):
- try:
- print("input_params_list ", self.input_dict)
-
+ try:
self.l1.setText(self.obj.variables['HKey']['name']+":")
+ self.l2.setText(self.obj.variables['LKey']['name']+":")
+
print(self.obj.compounds)
for i in self.obj.compounds:
self.cb1.addItem(str(i))
self.cb2.addItem(str(i))
- self.l2.setText(self.obj.variables['LKey']['name']+":")
-
self.l3.setText(self.obj.variables['HKey_x_pc']['name']+":")
self.le3.setText(str(self.obj.variables['HKey_x_pc']['value']))
self.u3.setText(self.obj.variables['HKey_x_pc']['unit'])
@@ -62,7 +56,13 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog):
self.l8.setText(self.obj.variables['RR']['name']+":")
self.le8.setText(str(self.obj.variables['RR']['value']))
- self.input_dict = [self.cb1, self.cb2, self.le3, self.le4, self.cb5, self.le6, self.le7, self.le8]
+ self.l9.setText("Thermo Package :")
+
+ self.lines = [line.rstrip('\n') for line in open('thermopackage.txt')]
+ for j in self.lines:
+ self.cb6.addItem(str(j))
+
+ self.input_dict = [self.cb1, self.cb2, self.le3, self.le4, self.cb5, self.le6, self.le7, self.le8, self.cb6]
except Exception as e:
print(e)
@@ -73,25 +73,49 @@ class DockWidgetShortcutColumn(QDockWidget,ui_dialog):
def param(self):
try:
self.dict=[]
- print("param.input_dict ", self.input_dict)
self.dict = [self.input_dict[0].currentText(),self.input_dict[1].currentText(),float(self.input_dict[2].text()), float(self.input_dict[3].text()),
- self.input_dict[4].currentText(), float(self.input_dict[5].text()), float(self.input_dict[6].text()), float(self.input_dict[7].text())]
-
- print("param ", self.dict)
+ self.input_dict[4].currentText(), float(self.input_dict[5].text()), float(self.input_dict[6].text()), float(self.input_dict[7].text()),
+ self.input_dict[8].currentText()]
self.obj.param_setter(self.dict)
self.hide()
except Exception as e:
print(e)
-
@staticmethod
def show_result(lst):
- #DockWidget1.flag = True
for i in lst:
- i.resultsCategory(i.name)
- #i.show()
-
+ try:
+ i.results_category(i.name)
+ except AttributeError:
+ pass
+
+ def clear_results(self):
+ self.tableWidget.setRowCount(0)
+
# result data tab
def results_category(self,name):
- pass \ No newline at end of file
+ flag = True
+ try:
+ print("Under result category name ", name)
+ result=self.container.result
+ obj = self.container.fetch_object(name)
+ self.tableWidget.setRowCount(0)
+ variKeys = obj.result_parameters
+ print(variKeys)
+ for i, val in enumerate(variKeys):
+ propertyname = name + '.' + val
+ print(i,val, propertyname)
+ if propertyname in result[0]:
+ ind = result[0].index(propertyname)
+ resultval = str(result[-1][ind])
+ obj.variables[val]['value']= result[-1][ind]
+ print("######Resultsfetch####",val,resultval)
+ rowPosition = self.tableWidget.rowCount()
+ self.tableWidget.insertRow(rowPosition)
+ self.tableWidget.setItem(rowPosition , 0, QTableWidgetItem(obj.variables[val]['name']))
+ self.tableWidget.setItem(rowPosition , 1, QTableWidgetItem(resultval))
+ self.tableWidget.setItem(rowPosition , 2, QTableWidgetItem(obj.variables[val]['unit']))
+ self.tableWidget.resizeColumnsToContents()
+ except Exception as e:
+ print(e) \ No newline at end of file
diff --git a/DockWidgets/DockWidgetShortcutColumn.ui b/DockWidgets/DockWidgetShortcutColumn.ui
index c66e699..f79c27e 100644
--- a/DockWidgets/DockWidgetShortcutColumn.ui
+++ b/DockWidgets/DockWidgetShortcutColumn.ui
@@ -33,8 +33,8 @@
<rect>
<x>10</x>
<y>40</y>
- <width>351</width>
- <height>321</height>
+ <width>381</width>
+ <height>611</height>
</rect>
</property>
<property name="currentIndex">
@@ -50,7 +50,7 @@
<x>8</x>
<y>13</y>
<width>331</width>
- <height>237</height>
+ <height>261</height>
</rect>
</property>
<property name="sizePolicy">
@@ -65,8 +65,8 @@
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout">
- <item row="4" column="2">
- <widget class="QComboBox" name="cb5">
+ <item row="3" column="2">
+ <widget class="QLineEdit" name="le4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -75,15 +75,18 @@
</property>
</widget>
</item>
- <item row="3" column="0">
- <widget class="QLabel" name="l4">
- <property name="text">
- <string>TextLabel</string>
+ <item row="5" column="2">
+ <widget class="QLineEdit" name="le6">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
</widget>
</item>
- <item row="3" column="3">
- <widget class="QLabel" name="u4">
+ <item row="6" column="3">
+ <widget class="QLabel" name="u7">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -95,21 +98,25 @@
</property>
</widget>
</item>
- <item row="0" column="0">
- <widget class="QLabel" name="l1">
+ <item row="6" column="0">
+ <widget class="QLabel" name="l7">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2">
+ <widget class="QComboBox" name="cb2">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text">
- <string>TextLabel</string>
- </property>
</widget>
</item>
- <item row="2" column="3">
- <widget class="QLabel" name="u3">
+ <item row="5" column="3">
+ <widget class="QLabel" name="u6">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -121,15 +128,8 @@
</property>
</widget>
</item>
- <item row="2" column="0">
- <widget class="QLabel" name="l3">
- <property name="text">
- <string>TextLabel</string>
- </property>
- </widget>
- </item>
- <item row="2" column="2">
- <widget class="QLineEdit" name="le3">
+ <item row="7" column="2">
+ <widget class="QLineEdit" name="le8">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -138,29 +138,25 @@
</property>
</widget>
</item>
- <item row="4" column="0">
- <widget class="QLabel" name="l5">
- <property name="text">
- <string>TextLabel</string>
- </property>
- </widget>
- </item>
- <item row="5" column="0">
- <widget class="QLabel" name="l6">
+ <item row="7" column="0">
+ <widget class="QLabel" name="l8">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
- <item row="1" column="0">
- <widget class="QLabel" name="l2">
- <property name="text">
- <string>TextLabel</string>
+ <item row="6" column="2">
+ <widget class="QLineEdit" name="le7">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
</widget>
</item>
- <item row="5" column="2">
- <widget class="QLineEdit" name="le6">
+ <item row="0" column="2">
+ <widget class="QComboBox" name="cb1">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -169,28 +165,25 @@
</property>
</widget>
</item>
- <item row="6" column="0">
- <widget class="QLabel" name="l7">
+ <item row="3" column="0">
+ <widget class="QLabel" name="l4">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
- <item row="6" column="3">
- <widget class="QLabel" name="u7">
+ <item row="4" column="2">
+ <widget class="QComboBox" name="cb5">
<property name="sizePolicy">
- <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="text">
- <string>TextLabel</string>
- </property>
</widget>
</item>
- <item row="1" column="2">
- <widget class="QComboBox" name="cb2">
+ <item row="2" column="2">
+ <widget class="QLineEdit" name="le3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -199,18 +192,28 @@
</property>
</widget>
</item>
- <item row="3" column="2">
- <widget class="QLineEdit" name="le4">
+ <item row="2" column="0">
+ <widget class="QLabel" name="l3">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <widget class="QLabel" name="u3">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
</widget>
</item>
- <item row="5" column="3">
- <widget class="QLabel" name="u6">
+ <item row="3" column="3">
+ <widget class="QLabel" name="u4">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -222,40 +225,37 @@
</property>
</widget>
</item>
- <item row="6" column="2">
- <widget class="QLineEdit" name="le7">
+ <item row="0" column="0">
+ <widget class="QLabel" name="l1">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
</widget>
</item>
- <item row="7" column="0">
- <widget class="QLabel" name="l8">
+ <item row="5" column="0">
+ <widget class="QLabel" name="l6">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
- <item row="7" column="2">
- <widget class="QLineEdit" name="le8">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <item row="4" column="0">
+ <widget class="QLabel" name="l5">
+ <property name="text">
+ <string>TextLabel</string>
</property>
</widget>
</item>
- <item row="0" column="2">
- <widget class="QComboBox" name="cb1">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
+ <item row="1" column="0">
+ <widget class="QLabel" name="l2">
+ <property name="text">
+ <string>TextLabel</string>
</property>
</widget>
</item>
@@ -267,7 +267,7 @@
<property name="geometry">
<rect>
<x>10</x>
- <y>250</y>
+ <y>350</y>
<width>331</width>
<height>23</height>
</rect>
@@ -282,11 +282,76 @@
<string>Submit</string>
</property>
</widget>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="geometry">
+ <rect>
+ <x>10</x>
+ <y>280</y>
+ <width>331</width>
+ <height>61</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string/>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout_3">
+ <item>
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="2" column="0">
+ <widget class="QLabel" name="l9">
+ <property name="text">
+ <string>TextLabel</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QComboBox" name="cb6"/>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Results</string>
</attribute>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QTableWidget" name="tableWidget">
+ <property name="columnCount">
+ <number>3</number>
+ </property>
+ <attribute name="horizontalHeaderDefaultSectionSize">
+ <number>110</number>
+ </attribute>
+ <attribute name="horizontalHeaderStretchLastSection">
+ <bool>true</bool>
+ </attribute>
+ <column>
+ <property name="text">
+ <string>Attribute</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Value</string>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Unit</string>
+ </property>
+ </column>
+ </widget>
+ </item>
+ </layout>
</widget>
</widget>
</widget>
diff --git a/DockWidgets/DockWidgetSplitter.py b/DockWidgets/DockWidgetSplitter.py
index 262bd45..303d166 100644
--- a/DockWidgets/DockWidgetSplitter.py
+++ b/DockWidgets/DockWidgetSplitter.py
@@ -2,10 +2,7 @@ from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.uic import loadUiType
-import pandas as pd
-from functools import partial
from ComponentSelector import *
-from collections import defaultdict
from Graphics import *
ui_dialog,_ = loadUiType('DockWidgets/DockWidgetSplitter.ui')
@@ -20,23 +17,19 @@ class DockWidgetSplitter(QDockWidget,ui_dialog):
self.obj=obj
self.type = comptype
self.input_dict = []
- print("constructor ", self.input_dict)
self.input_params_list()
self.btn.clicked.connect(self.param)
self.dict = {}
# input data tab
def input_params_list(self):
- try:
- print("input_params_list ", self.input_dict)
-
- self.l1.setText(self.obj.variables['NOO']['name']+":")
- self.le1.setText(str(self.obj.variables['NOO']['value']))
- self.u1.setText(self.obj.variables['NOO']['unit'])
+ try:
+ self.l1.setText(self.obj.variables['No']['name']+":")
+ self.le1.setText(str(self.obj.variables['No']['value']))
+ self.u1.setText(self.obj.variables['No']['unit'])
for i in self.obj.CalcType_modes:
self.cb2.addItem(str(i))
-
self.l2.setText(self.obj.variables['CalcType']['name']+":")
self.l3.setText("Stream 1 :")
@@ -45,19 +38,18 @@ class DockWidgetSplitter(QDockWidget,ui_dialog):
self.u4.setText('')
self.cb2.currentIndexChanged.connect(self.fun)
-
self.input_dict = [self.le1, self.cb2, self.le3, self.le4]
except Exception as e:
print(e)
def fun(self):
- if self.cb2.currentText() == 'Mole Flow Specs':
+ if self.cb2.currentText() == 'Molar_Flow':
self.u3.setText('mol/s')
self.u4.setText('mol/s')
- elif self.cb2.currentText() == 'Mass Flow Specs':
- self.u3.setText('kg/s')
- self.u4.setText('kg/s')
+ elif self.cb2.currentText() == 'Mass_Flow':
+ self.u3.setText('g/s')
+ self.u4.setText('g/s')
else:
self.u3.setText('')
self.u4.setText('')
@@ -68,11 +60,8 @@ class DockWidgetSplitter(QDockWidget,ui_dialog):
def param(self):
try:
self.dict={}
- print("param.input_dict ", self.input_dict)
self.dict = [int(self.input_dict[0].text()),self.input_dict[1].currentText(), float(self.input_dict[2].text()), float(self.input_dict[3].text())]
- print("param ", self.dict)
self.obj.param_setter(self.dict)
self.hide()
-
except Exception as e:
print(e)
diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc
index 80d0ae1..86045c1 100644
--- a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc
Binary files differ
diff --git a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc
index e5023b1..08716b1 100644
--- a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc
Binary files differ
diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc
index 0584a29..55be9b4 100644
--- a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc
Binary files differ
diff --git a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc
index 7eaaef7..6828ab1 100644
--- a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc
Binary files differ
diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc
index a99f092..a8c9f80 100644
--- a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc
Binary files differ
diff --git a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc
index 52a0ca1..460aa1b 100644
--- a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc
Binary files differ
diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc
index 85449f8..13f8328 100644
--- a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc
Binary files differ
diff --git a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc
index 19250d9..fea33a2 100644
--- a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc
+++ b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc
Binary files differ