diff options
Diffstat (limited to 'DockWidgets')
36 files changed, 0 insertions, 3703 deletions
diff --git a/DockWidgets/DistillationColumnStagewiseResults.py b/DockWidgets/DistillationColumnStagewiseResults.py deleted file mode 100644 index c5bd67d..0000000 --- a/DockWidgets/DistillationColumnStagewiseResults.py +++ /dev/null @@ -1,12 +0,0 @@ -from PyQt5.uic import loadUiType -from PyQt5.QtWidgets import QWidget - -ui_dialog,_ = loadUiType('DockWidgets/DistillationColumnStagewiseResults.ui') - - -class DistillationColumnStagewiseResults(QWidget,ui_dialog): - - def __init__(self, parent=None): - QWidget.__init__(self, parent) - self.setupUi(self) - # self.setWindowTitle(self.parent.obj.name) diff --git a/DockWidgets/DistillationColumnStagewiseResults.ui b/DockWidgets/DistillationColumnStagewiseResults.ui deleted file mode 100644 index fb0ef9c..0000000 --- a/DockWidgets/DistillationColumnStagewiseResults.ui +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>DistillationColumnStagewiseResults</class> - <widget class="QWidget" name="DistillationColumnStagewiseResults"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>594</width> - <height>411</height> - </rect> - </property> - <property name="windowTitle"> - <string>Form</string> - </property> - <widget class="QTabWidget" name="tabWidget"> - <property name="geometry"> - <rect> - <x>-1</x> - <y>-1</y> - <width>591</width> - <height>411</height> - </rect> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="T"> - <attribute name="title"> - <string>Temperature(K)</string> - </attribute> - <widget class="QTableWidget" name="T_table"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>591</width> - <height>391</height> - </rect> - </property> - <property name="sizeAdjustPolicy"> - <enum>QAbstractScrollArea::AdjustToContents</enum> - </property> - </widget> - </widget> - <widget class="QWidget" name="x_pc"> - <attribute name="title"> - <string>Component Mole Fractions</string> - </attribute> - <widget class="QTableWidget" name="x_pc_table"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>591</width> - <height>391</height> - </rect> - </property> - <property name="sizeAdjustPolicy"> - <enum>QAbstractScrollArea::AdjustToContentsOnFirstShow</enum> - </property> - </widget> - </widget> - </widget> - </widget> - <resources/> - <connections/> -</ui> diff --git a/DockWidgets/DockWidget.py b/DockWidgets/DockWidget.py deleted file mode 100644 index bb8ddf5..0000000 --- a/DockWidgets/DockWidget.py +++ /dev/null @@ -1,160 +0,0 @@ -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/DockWidget.ui') - -class DockWidget(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.modes() - self.comboBox.currentIndexChanged.connect(self.mode_selection) - - print("constructor ", self.input_dict) - self.pushButton_2.clicked.connect(self.param) - - self.dict = {} # a dictionary - 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.comboBox.setCurrentText(self.obj.variables[self.obj.mode]['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): - #print(i) - if i == None: - continue - l = QLineEdit(str(self.obj.variables[i]['value'])) - 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) - - - def show_error(self): - QMessageBox.about(self, 'Important', "Please fill all fields with data") - - def param(self): - try: - self.dict = {} - #print("param.input_dict ", self.input_dict) - for i in self.input_dict: - if (self.input_dict[i] == None): - continue - 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 - - #print("param ", self.dict) - self.obj.param_setter(self.dict) - for i in self.container.graphics.graphicsView.items(): - try: - if(i.name == self.name): - i.update_tooltip() - except: - pass - if(self.isVisible()): - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189) - 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() - - # Updating result in class - obj.variables[val]['value'] = resultval - # try: - # if obj.type == "Heater": - # print(obj.variables[val]['name'] + str(obj.variables[val]['value'])) - # except Exception as e: - # print(e) - - - - except Exception as e: - print(e) - - def closeEvent(self,event): - scrollHVal = self.parent().container.graphics.graphicsView.horizontalScrollBarVal - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189)
\ No newline at end of file diff --git a/DockWidgets/DockWidget.ui b/DockWidgets/DockWidget.ui deleted file mode 100644 index ba6dc52..0000000 --- a/DockWidgets/DockWidget.ui +++ /dev/null @@ -1,169 +0,0 @@ -<?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>271</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>380</y> - <width>331</width> - <height>21</height> - </rect> - </property> - <property name="text"> - <string>Submit</string> - </property> - </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/DockWidgetCompoundSeparator.py b/DockWidgets/DockWidgetCompoundSeparator.py deleted file mode 100644 index 57b1339..0000000 --- a/DockWidgets/DockWidgetCompoundSeparator.py +++ /dev/null @@ -1,126 +0,0 @@ -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/DockWidgetCompoundSeparator.ui') - -class DockWidgetCompoundSeparator(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.lst = [] - self.input_params_list() - self.dict = [] - - def input_params_list(self): - try: - if self.type == 'CompoundSeparator': - self.lst.clear() - self.calculationGroupBox = QGroupBox('Calculation Parameters') - self.calculationLayout = QGridLayout() - - r1 = QRadioButton('Stream 1') - r1.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - r2 = QRadioButton('Stream 2') - r2.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - if self.obj.variables['SepStrm']['value'] == 1: - r1.setChecked(True) - r2.setChecked(False) - else: - r1.setChecked(False) - r2.setChecked(True) - - - self.lst = [r1, r2] - self.calculationLayout.addWidget(r1, 0, 1) - self.calculationLayout.addWidget(r2, 0, 2) - - for k,val in enumerate(self.obj.compounds): - combo = QComboBox() - #print("CompoundSeparator combo") - for j in self.obj.SepFact_modes: - combo.addItem(str(j)) - #print(self.obj.variables['SepFact_c']['value'][k]) - combo.setCurrentText(self.obj.variables['SepFact_c']['value'][k]) - combo.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - l = QLineEdit(str(self.obj.variables['SepVal_c']['value'][k])) - l.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - self.calculationLayout.addWidget(QLabel(val+" :"), k+1,0, alignment=Qt.AlignLeft) - self.calculationLayout.addWidget(combo, k+1, 1, alignment=Qt.AlignCenter) - self.calculationLayout.addWidget(l,k+1,2, alignment=Qt.AlignCenter) - self.lst.append(combo) - self.lst.append(l) - - self.calculationLayout.setColumnStretch(3, len(self.obj.compounds)+1) - self.calculationGroupBox.setLayout(self.calculationLayout) - - btn = QPushButton('Submit') - btn.clicked.connect(self.param) - - self.gridLayout.setVerticalSpacing(5) - self.gridLayout.addWidget(self.calculationGroupBox,0,0) - self.gridLayout.addWidget(btn,1,0) - - self.input_dict = self.lst - - except Exception as e: - print(e) - - def show_error(self): - QMessageBox.about(self, 'Important', "Please fill all fields with data") - - def update_compounds(self): - try: - self.obj.init_variables() - t_item = self.calculationGroupBox.layout().itemAt(0) - self.calculationGroupBox.layout().removeItem(t_item) - while(t_item): - t_widget = t_item.widget() - if(t_widget): - t_widget.setHidden(True) - self.calculationGroupBox.layout().removeWidget(t_widget) - t_item = self.calculationGroupBox.layout().itemAt(0) - self.input_params_list() - except Exception as e: - print(e) - - - def param(self): - try: - self.dict=[] - - self.dict = [self.input_dict[0].isChecked(), self.input_dict[1].isChecked()] - j = 2 - for i in range(len(self.obj.compounds)): - self.dict.append(self.input_dict[j+i].currentText()) - if(self.input_dict[j+i+1].text()): - self.dict.append(self.input_dict[j+i+1].text()) - j += 1 - else: - self.show_error() - - - self.obj.param_setter(self.dict) - if(self.isVisible()): - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189) - self.hide() - - except Exception as e: - print(e) - def closeEvent(self,event): - scrollHVal = self.parent().container.graphics.graphicsView.horizontalScrollBarVal - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189)
\ No newline at end of file diff --git a/DockWidgets/DockWidgetCompoundSeparator.ui b/DockWidgets/DockWidgetCompoundSeparator.ui deleted file mode 100644 index ad9cda4..0000000 --- a/DockWidgets/DockWidgetCompoundSeparator.ui +++ /dev/null @@ -1,45 +0,0 @@ -<?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> - <widget class="QWidget" name="gridLayoutWidget"> - <property name="geometry"> - <rect> - <x>10</x> - <y>40</y> - <width>331</width> - <height>281</height> - </rect> - </property> - <layout class="QGridLayout" name="gridLayout"/> - </widget> - </widget> - <resources/> - <connections/> -</ui> diff --git a/DockWidgets/DockWidgetCompressorExpander.py b/DockWidgets/DockWidgetCompressorExpander.py deleted file mode 100644 index e8e2b31..0000000 --- a/DockWidgets/DockWidgetCompressorExpander.py +++ /dev/null @@ -1,159 +0,0 @@ -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) - - for i in self.container.graphics.graphicsView.items(): - try: - if(i.name == self.name): - i.update_tooltip() - except: - pass - if(self.isVisible()): - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189) - 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) - - def closeEvent(self,event): - scrollHVal = self.parent().container.graphics.graphicsView.horizontalScrollBarVal - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189)
\ No newline at end of file diff --git a/DockWidgets/DockWidgetCompressorExpander.ui b/DockWidgets/DockWidgetCompressorExpander.ui deleted file mode 100644 index 372fc0b..0000000 --- a/DockWidgets/DockWidgetCompressorExpander.ui +++ /dev/null @@ -1,214 +0,0 @@ -<?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 deleted file mode 100644 index e2e1031..0000000 --- a/DockWidgets/DockWidgetDistillationColumn.py +++ /dev/null @@ -1,367 +0,0 @@ -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 DockWidgets.DistillationColumnStagewiseResults import DistillationColumnStagewiseResults -from Graphics import * - -ui_dialog,_ = loadUiType('DockWidgets/DockWidgetDistillationColumn.ui') - - -class DockWidgetDistillationColumn(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.pushButton_2.clicked.connect(self.param) - self.dict = [] - self.input_params_list() - self.name_type = None - self.container = container - self.stage_res_table = DistillationColumnStagewiseResults() - self.stageResultsButton.clicked.connect(self.showStagewiseResults) - - # input data tab - - def input_params_list(self): - try: - print("input_params_list ", self.input_dict) - - # tab 1 - - l1 = QLineEdit() - l1.setText(str(self.obj.variables['Nt']['value'])) - self.lay1.addWidget(QLabel(self.obj.variables['Nt']['name'] + " :"), 0 ,0, alignment=Qt.AlignLeft) - self.lay1.addWidget(l1,0,1, alignment=Qt.AlignLeft) - self.input_dict.append(l1) - - for i in range(self.obj.variables['Ni']['value']): - print(i) - l = QLineEdit() - if len(self.obj.variables['InT_s']['value']) is not 0: - l.setText(str(self.obj.variables['InT_s']['value'][i])) - self.lay1.addWidget(QLabel(self.obj.variables['InT_s']['name'] +" " + str(i+1) + " location :"),2*(i+1),0, alignment=Qt.AlignLeft) - self.lay1.addWidget(l,2*(i+1),1, alignment=Qt.AlignLeft) - self.input_dict.append(l) - - # tab 2 - self.l4.setText(self.obj.variables['Ctype']['name']+":") - - self.u1.setText(self.obj.variables['Ctype']['unit']) - self.l5.setText(self.obj.variables['Pcond']['name']+":") - self.le5.setText(str(self.obj.variables['Pcond']['value'])) - self.u2.setText(self.obj.variables['Pcond']['unit']) - self.l6.setText(self.obj.variables['C_Spec']['name']+":") - self.le6.setText(str(self.obj.variables['C_Spec']['value'])) - self.l7.setText("Compounds :") - - self.cb5.addItem("Total") - self.cb5.addItem("Partial") - self.cb5.setCurrentText(self.obj.variables['Ctype']['value']) - for j in self.obj.Cspec_list: - self.cb1.addItem(str(j)) - self.cb1.setCurrentText(self.obj.variables['C_Spec']['type']) - for j in self.obj.compounds: - self.cb2.addItem(str(j)) - self.cb2.setCurrentText(self.obj.variables['C_Spec']['comp']) - - self.cb2.setDisabled(True) - 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']+":") - self.le7.setText(str(self.obj.variables['Preb']['value'])) - self.u3.setText(self.obj.variables['Preb']['unit']) - self.l9.setText(self.obj.variables['R_Spec']['name']+":") - self.le8.setText(str(self.obj.variables['R_Spec']['value'])) - self.l10.setText('Compounds') - - for j in self.obj.Rspec_list: - self.cb3.addItem(str(j)) - self.cb3.setCurrentText(self.obj.variables['R_Spec']['type']) - for j in self.obj.compounds: - self.cb4.addItem(str(j)) - self.cb4.setCurrentText(self.obj.variables['R_Spec']['comp']) - self.cb4.setDisabled(True) - self.cb3.currentIndexChanged.connect(self.fun3) - - 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.lines = [line.rstrip('\n') for line in open('thermopackage.txt')] - for j in self.lines: - self.cbTP.addItem(str(j)) - self.cbTP.setCurrentText(self.obj.variables['thermo_package']['value']) - - self.input_dict.append(self.cbTP) - - # 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) - - def update_compounds(self): - self.cb2.clear() - self.cb4.clear() - for j in self.obj.compounds: - self.cb2.addItem(str(j)) - self.cb2.setCurrentText(self.obj.variables['C_Spec']['comp']) - for j in self.obj.compounds: - self.cb4.addItem(str(j)) - self.cb4.setCurrentText(self.obj.variables['R_Spec']['comp']) - - def fun2(self): - if self.cb1.currentText() == 'Compound Molar Fraction' or self.cb1.currentText() == 'Compound Molar Flow (mol/s)': - self.cb2.setDisabled(False) - else: - self.cb2.setDisabled(True) - - def fun3(self): - if self.cb3.currentText() == 'Compound Molar Fraction' or self.cb3.currentText() == 'Compound Molar Flow (mol/s)': - self.cb4.setDisabled(False) - else: - self.cb4.setDisabled(True) - - def Show_Error(self): - QMessageBox.about(self, 'Important', "Please fill all fields with data") - - def param(self): - try: - self.dict= [] - temp = 0 - print("param.input_dict ", self.input_dict) - 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) - self.dict.append(self.input_dict[temp+10].currentText()) - print(temp + 10) - - print("param ", self.dict) - self.obj.param_setter(self.dict) - if(self.isVisible()): - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189) - self.hide() - - except Exception as e: - print(e) - - def showStagewiseResults(self): - self.stage_res_table.show() - - @staticmethod - def showResult(lst): - # DockWidget1.flag = True - for i in lst: - try: - i.results_category(i.name) - except AttributeError: - pass - - def clear_results(self): - self.tableWidget.setRowCount(0) - self.stage_res_table.T_table.setRowCount(0) - self.stage_res_table.T_table.setColumnCount(0) - self.stage_res_table.x_pc_table.setRowCount(0) - self.stage_res_table.x_pc_table.setColumnCount(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 = 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() - - # Stagewise Results - Nt = self.obj.variables['Nt']['value'] - Nc = len(self.obj.compounds) - # initializing temporary arrays - 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)] - Stages_x_pc = [[[None for i in range(3)] for j in range(Nc)] for k in range(Nt)] - - Stages_res_varikeys = ['T'] - for i in range(Nc): - for j in range(3): - Stages_res_varikeys.append('x_pc[' + str(j + 1) + ',' + str(i + 1) + ']') - - for v in Stages_res_varikeys: - propertyname = name + '.condenser.' + v - if propertyname in result[0]: - ind = result[0].index(propertyname) - if v == 'T': - Stages_T[0] = result[-1][ind] - # Can be uncommented when F_p is implemented in modelica model - # elif v == 'F_p': - # if result[0][ind][result[0][ind].index('[') + 1] == '1': - # Stages_F_p[0][0] = result[-1][ind] - # elif result[0][ind][result[0][ind].index('[') + 1] == '2': - # Stages_F_p[0][1] = result[-1][ind] - # else: - # Stages_F_p[0][2] = result[-1][ind] - else: - print(ind) - phase_no = int(result[0][ind][result[0][ind].index('[') + 1]) - comp_no = int(result[0][ind][result[0][ind].index(']') - 1]) - Stages_x_pc[0][comp_no - 1][phase_no - 1] = result[-1][ind] - # Can be uncommented and improved when F_pc implemented in modelica model - # if v == 'F_pc': - # Stages_F_pc[0][comp_no - 1][phase_no - 1] = result[-1][ind] - # else: - # Stages_x_pc[0][comp_no - 1][phase_no - 1] = result[-1][ind] - - for i in range(1, Nt - 1): - propertyname = name + '.tray[' + str(i) + '].' + v - if propertyname in result[0]: - ind = result[0].index(propertyname) - if v == 'T': - Stages_T[i] = result[-1][ind] - # Can be uncommented when F_p implemented in modelica model - # elif v == 'F_p': - # if result[0][ind][result[0][ind].index('[') + 1] == '1': - # Stages_F_p[i][0] = result[-1][ind] - # elif result[0][ind][result[0][ind].index('[') + 1] == '2': - # Stages_F_p[i][1] = result[-1][ind] - # else: - # Stages_F_p[i][2] = result[-1][ind] - else: - print(ind) - print(result[0][ind]) - phase_no = int(result[0][ind].split('.')[-1][result[0][ind].split('.')[-1].index('[') + 1]) - comp_no = int(result[0][ind].split('.')[-1][result[0][ind].split('.')[-1].index(']') - 1]) - Stages_x_pc[i][comp_no - 1][phase_no - 1] = result[-1][ind] - # Can be uncommented when F_pc implemented in modelica model - # if v == 'F_pc': - # Stages_F_pc[i][comp_no - 1][phase_no - 1] = result[-1][ind] - # else: - # Stages_x_pc[i][comp_no - 1][phase_no - 1] = result[-1][ind] - - propertyname = name + '.reboiler.' + v - if propertyname in result[0]: - ind = result[0].index(propertyname) - if v == 'T': - Stages_T[-1] = result[-1][ind] - # Can be uncommented when F_p implemented in modelica model - # elif v == 'F_p': - # if result[0][ind][result[0][ind].index('[') + 1] == '1': - # Stages_F_p[-1][0] = result[-1][ind] - # elif result[0][ind][result[0][ind].index('[') + 1] == '2': - # Stages_F_p[-1][1] = result[-1][ind] - # else: - # Stages_F_p[-1][2] = result[-1][ind] - else: - print(ind) - phase_no = int(result[0][ind][result[0][ind].index('[') + 1]) - comp_no = int(result[0][ind][result[0][ind].index(']') - 1]) - Stages_x_pc[-1][comp_no - 1][phase_no - 1] = result[-1][ind] - # Can be uncommented when F_pc implemented in modelica model - # if v == 'F_pc': - # Stages_F_pc[-1][comp_no - 1][phase_no - 1] = result[-1][ind] - # else: - # Stages_x_pc[-1][comp_no - 1][phase_no - 1] = result[-1][ind] - - # Assigning temp variables to obj variabes - self.obj.variables['Stages.T']['value'] = Stages_T - # Can be uncommented when F_p and F_pc implemented in modelica model - # self.obj.variables['Stages.F_p']['value'] = Stages_F_p - # self.obj.variables['Stages.F_pc']['value'] = Stages_F_pc - self.obj.variables['Stages.x_pc']['value'] = Stages_x_pc - - # filling stagewise result table - tables = [self.stage_res_table.T_table, self.stage_res_table.x_pc_table] - # Can be uncommented when F_p and F_pc implemented in modelica model - # tables = [self.stage_res_table.T_table, self.stage_res_table.F_p_table, self.stage_res_table.F_pc_table, self.stage_res_table.x_pc_table] - - for t in tables: - t.setRowCount(Nt) - t.setVerticalHeaderItem(0, QTableWidgetItem('Condenser')) - t.setVerticalHeaderItem(Nt -1, QTableWidgetItem('Reboiler')) - for i in range(1, Nt - 1): - t.setVerticalHeaderItem(i, QTableWidgetItem('Stage ' + str(i))) - - T_table = self.stage_res_table.T_table - T_table.setColumnCount(1) - for i in range(Nt): - T_table.setItem(i, 0, QTableWidgetItem(Stages_T[i])) - - x_pc_table = self.stage_res_table.x_pc_table - x_pc_table.setColumnCount(2*Nc) - for i in range(Nc): - x_pc_table.setHorizontalHeaderItem(2*i, QTableWidgetItem(self.obj.compounds[i] + '(Vapor)')) - x_pc_table.setHorizontalHeaderItem(2*i + 1, QTableWidgetItem(self.obj.compounds[i] + '(Liquid)')) - - for i in range(Nt): - 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: - print(e) - - def closeEvent(self,event): - scrollHVal = self.parent().container.graphics.graphicsView.horizontalScrollBarVal - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189)
\ No newline at end of file diff --git a/DockWidgets/DockWidgetDistillationColumn.ui b/DockWidgets/DockWidgetDistillationColumn.ui deleted file mode 100644 index 920837b..0000000 --- a/DockWidgets/DockWidgetDistillationColumn.ui +++ /dev/null @@ -1,311 +0,0 @@ -<?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>382</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> - <widget class="QTabWidget" name="tabWidget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>30</y> - <width>381</width> - <height>481</height> - </rect> - </property> - <property name="autoFillBackground"> - <bool>true</bool> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="tab"> - <attribute name="title"> - <string>Input Data</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QGroupBox" name="groupBox_2"> - <property name="title"> - <string>Parameter Selection</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="sizeConstraint"> - <enum>QLayout::SetFixedSize</enum> - </property> - <item> - <widget class="QTabWidget" name="tabWidget_5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="tab1"> - <attribute name="title"> - <string>General</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_6"> - <item> - <layout class="QGridLayout" name="lay1"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <property name="verticalSpacing"> - <number>0</number> - </property> - </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab2"> - <attribute name="title"> - <string>Condenser</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <item> - <layout class="QGridLayout" name="lay2"> - <item row="3" column="0"> - <widget class="QLabel" name="l7"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="l4"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="l5"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QComboBox" name="cb1"/> - </item> - <item row="1" column="2"> - <widget class="QLineEdit" name="le5"/> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="l6"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="3" column="2"> - <widget class="QComboBox" name="cb2"> - <property name="enabled"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="0" column="3"> - <widget class="QLabel" name="u1"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="1" column="3"> - <widget class="QLabel" name="u2"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="4" column="2"> - <widget class="QLineEdit" name="le6"/> - </item> - <item row="0" column="2"> - <widget class="QComboBox" name="cb5"/> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab3"> - <attribute name="title"> - <string>Reboiler</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_7"> - <item> - <layout class="QGridLayout" name="lay3"> - <item row="4" column="0"> - <widget class="QLabel" name="l9"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="l8"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="l10"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="5" column="2"> - <widget class="QComboBox" name="cb4"> - <property name="enabled"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="3" column="2"> - <widget class="QLineEdit" name="le7"/> - </item> - <item row="4" column="2"> - <widget class="QComboBox" name="cb3"/> - </item> - <item row="6" column="2"> - <widget class="QLineEdit" name="le8"/> - </item> - <item row="3" column="3"> - <widget class="QLabel" name="u3"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox"> - <property name="title"> - <string/> - </property> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <widget class="QLabel" name="label"> - <property name="text"> - <string>Thermo Package</string> - </property> - </widget> - </item> - <item> - <widget class="QComboBox" name="cbTP"/> - </item> - </layout> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QPushButton" name="pushButton_2"> - <property name="text"> - <string>Submit</string> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_2"> - <attribute name="title"> - <string>Results</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_8"> - <item> - <widget class="QGroupBox" name="groupBox_3"> - <property name="title"> - <string/> - </property> - <widget class="QTableWidget" name="tableWidget"> - <property name="geometry"> - <rect> - <x>12</x> - <y>15</y> - <width>341</width> - <height>151</height> - </rect> - </property> - <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> - </widget> - </item> - <item> - <widget class="QPushButton" name="stageResultsButton"> - <property name="text"> - <string>Stagewise Results</string> - </property> - </widget> - </item> - </layout> - </widget> - </widget> - </widget> - <resources/> - <connections/> -</ui> diff --git a/DockWidgets/DockWidgetFlash.py b/DockWidgets/DockWidgetFlash.py deleted file mode 100644 index c75f950..0000000 --- a/DockWidgets/DockWidgetFlash.py +++ /dev/null @@ -1,79 +0,0 @@ -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/DockWidgetFlash.ui') - -class DockWidgetFlash(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.input_params_list() - self.btn.clicked.connect(self.param) - self.dict = [] # a list - - def input_params_list(self): - 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)) - self.cb1.setCurrentText(self.obj.variables['thermo_package']['value']) - - self.check1.setText(self.obj.variables['Tdef']['name']+":") - self.le2.setText(str(self.obj.variables['Tdef']['value'])) - self.u2.setText(self.obj.variables['Tdef']['unit']) - self.check1.toggled.connect(self.fun) - self.check1.setChecked(self.obj.variables['BTdef']['value']) - self.check2.setText(self.obj.variables['Pdef']['name']+":") - self.le3.setText(str(self.obj.variables['Pdef']['value'])) - self.u3.setText(self.obj.variables['Pdef']['unit']) - self.check2.toggled.connect(self.fun) - self.check2.setChecked(self.obj.variables['BPdef']['value']) - - self.input_dict = [self.cb1, self.check1, self.le2, self.check2, self.le3] - - except Exception as e: - print(e) - - def fun(self): - if self.check1.isChecked(): - self.le2.setDisabled(False) - else: - self.le2.setDisabled(True) - if self.check2.isChecked(): - self.le3.setDisabled(False) - else: - self.le3.setDisabled(True) - - def show_error(self): - QMessageBox.about(self, 'Important', "Please fill all fields with data") - - def param(self): - try: - 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) - self.obj.param_setter(self.dict) - if(self.isVisible()): - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189) - self.hide() - - except Exception as e: - print(e) - - def closeEvent(self,event): - scrollHVal = self.parent().container.graphics.graphicsView.horizontalScrollBarVal - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189)
\ No newline at end of file diff --git a/DockWidgets/DockWidgetFlash.ui b/DockWidgets/DockWidgetFlash.ui deleted file mode 100644 index c781aa6..0000000 --- a/DockWidgets/DockWidgetFlash.ui +++ /dev/null @@ -1,161 +0,0 @@ -<?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> - <widget class="QGroupBox" name="groupBox"> - <property name="geometry"> - <rect> - <x>10</x> - <y>40</y> - <width>341</width> - <height>141</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="autoFillBackground"> - <bool>true</bool> - </property> - <property name="styleSheet"> - <string notr="true">Q</string> - </property> - <property name="title"> - <string>Calculation Parameters</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <layout class="QGridLayout" name="gridLayout"> - <item row="2" column="2"> - <widget class="QLineEdit" name="le3"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item row="2" column="3"> - <widget class="QLabel" name="u3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QLineEdit" name="le2"> - <property name="enabled"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="1" column="3"> - <widget class="QLabel" name="u2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="l1"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QCheckBox" name="check2"> - <property name="text"> - <string>CheckBox</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> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QCheckBox" name="check1"> - <property name="text"> - <string>CheckBox</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QPushButton" name="btn"> - <property name="geometry"> - <rect> - <x>10</x> - <y>190</y> - <width>341</width> - <height>23</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Submit</string> - </property> - </widget> - </widget> - <resources/> - <connections/> -</ui> diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py deleted file mode 100644 index 422119e..0000000 --- a/DockWidgets/DockWidgetMaterialStream.py +++ /dev/null @@ -1,367 +0,0 @@ -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/DockWidgetMaterialStream.ui') - -class DockWidgetMaterialStream(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.comboBox.currentIndexChanged.connect(self.mode_selection) - - self.pushButton_2.clicked.connect(self.param) - self.dict = {} # a dictionary - - self.name_type = None - self.container = container - - header = QTreeWidgetItem(['Compound','Value','Unit']) - 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 - if(modes_list): - for j in modes_list: - self.comboBox.addItem(str(j)) - self.comboBox.setCurrentText(self.obj.mode) - self.mode_selection() - else: - self.input_dict= {} - self.input_dict = self.obj.param_getter() - self.input_params_list() - - def mode_selection(self): - self.input_dict= {} - try: # removing existing rows while changing modes - for i in reversed(range(self.formLayout.count())): - self.formLayout.removeRow(i) - except Exception as e: - print(e) - self.input_dict = self.obj.param_getter(self.comboBox.currentText()) - self.obj.mode = self.comboBox.currentText() - self.input_params_list() - - def input_params_list(self): - try: - for c,i in enumerate(self.input_dict): - if(i=="x_pc"): - noc = len(compound_selected) - #print(noc) - self.x_pclist.clear() - - self.comp_gb = QGroupBox("Mole Fractions") - lay = QGridLayout() - for j in range(noc): - try: - l = QLineEdit(str(self.obj.variables['x_pc']['value'][j])) - except: - l = QLineEdit() - # if self.input_dict[i] != '': - # 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) - lay.setSizeConstraint(QLayout.SetFixedSize) - self.comp_gb.setLayout(lay) - self.formLayout.addRow(self.comp_gb) - elif i == "Thermo Package": - self.cbTP.setCurrentText(self.input_dict[i]) - else: - #print("elseloop") - l = QLineEdit() - if self.input_dict[i] != None: - l.setText(str(self.input_dict[i])) - - lay = QGridLayout() - if i !='MolFlow': - lay.addWidget(QLabel(self.obj.variables[i]['name']+":"),0,0, alignment=Qt.AlignLeft) - else: - lay.addWidget(QLabel(i+":"),0,0, alignment=Qt.AlignLeft) - lay.addWidget(l,0,1, alignment=Qt.AlignCenter) - 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) - self.formLayout.addRow(lay) - self.input_dict[i] = l - - - except Exception as e: - print(e) - - def show_error(self): - QMessageBox.about(self, 'Important', "Please fill all fields with data") - - def update_compounds(self): - try: - noc = len(compound_selected) - #print(noc) - self.x_pclist.clear() - - lay = QGridLayout() - for j in range(noc): - l = QLineEdit() - 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) - lay.setSizeConstraint(QLayout.SetFixedSize) - self.comp_gb.setLayout(lay) - indexx = self.comboBox.currentIndex() - self.comboBox.setCurrentIndex(1) - self.comboBox.setCurrentIndex(indexx) - self.obj.init_variables() - except Exception as e: - print(e) - - def param(self): - try: - self.dict={} - #print("param.input_dict ", self.input_dict) - for i in self.input_dict: - #print(i) - if(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.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.cbTP.currentText() - else: - if (self.input_dict[i].text()): - self.dict[i] = self.input_dict[i].text() - else: - #print(self.input_dict[i]) - self.show_error() - break - - #print("param ", self.dict) - - self.obj.param_setter(self.dict) - - for i in self.container.graphics.graphicsView.items(): - try: - if(i.name == self.name): - i.update_tooltip() - except: - pass - if(self.isVisible()): - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189) - self.hide() - - except Exception as e: - print(e) - - def update_input_values(self): - self.init() - - @staticmethod - def show_result(ms_lst): - for i in ms_lst: - i.results_category(i.name) - - 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): - try: - #print("Under result category name ", name) - 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"} - ms_lst = list(d.keys()) - klst = list(d.values()) - - p = {"Pressure":"P", "Temperature":"T","Vapour Phase Mole Fraction":"xvap", "Phase Molar Enthalpy":"H_p", - "Phase Molar Entropy":"S_p", "Molar Flow Rate":"F_p","Mass Flow Rate":"Fm_p"} - - # Amounts Tab - if obj.type == 'MaterialStream': - 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): - ll.append(i) - #print(ll) - - j = 0 - namee = 'none' - #print("namee ", namee) - #initialization for treewidgets - lroot = 1 - mroot = 1 - vroot = 1 - - - for i,k in enumerate(ll): - ind = result[0].index(k) - #print("index ", ind) - #print("str ", k) - resultval = str(result[-1][ind]) - #print("######Resultsfetch####",resultval) - #print(k[k.find(".")+1:k.find("[")]) - obj.variables[k.split('.')[1]]['value'] = resultval - - if namee not in k: - mroot = QTreeWidgetItem(self.mTreeWidget, [ms_lst[j]]) - lroot = QTreeWidgetItem(self.lTreeWidget, [ms_lst[j]]) - vroot = QTreeWidgetItem(self.vTreeWidget, [ms_lst[j]]) - namee = klst[j] - - phase_no = int(k[k.index(',') - 1]) # phase no is from modelica list - 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(round(float(resultval),4)), - obj.variables[k.split('.')[1]]['unit']]) - elif phase_no == 2: - 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(round(float(resultval),4)), - obj.variables[k.split('.')[1]]['unit']]) - if (compound_no + 1) == len(compound_selected): - j += 1 - - - - # Phase Properties Tab - phaseResLst = [] - for phase in p: - propertyname = name + '.' + p[phase] - #print("phase ", phase, propertyname) - for i in result[0]: - if i.find('['): - if (propertyname == i[0:i.find('[')]): - phaseResLst.append(i) - if propertyname == i: - phaseResLst.append(i) - #print(phaseResLst) - - self.mTableWidget.setRowCount(0) - self.lTableWidget.setRowCount(0) - self.vTableWidget.setRowCount(0) - - for i,val in enumerate(phaseResLst): - ind = result[0].index(val) - resultval = str(result[-1][ind]) - #print(resultval, i, val) - obj.variables[val.split('.')[1]]['value'] = resultval - if '[' in val: - #print(val) - temp = val[val.find('.')+1:val.find('[')] - #print(temp) - if '1' in val.split('.')[1]: - #print(obj.variables[val.split('.')[1]]['name']) - 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(str(round(float(resultval),4)))) - self.mTableWidget.setItem(mrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit'])) - self.mTableWidget.resizeColumnsToContents() - - if '2' in val.split('.')[1]: - 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(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(str(round(float(resultval),4)))) - self.vTableWidget.setItem(vrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit'])) - self.vTableWidget.resizeColumnsToContents() - if not '[' in val: - #print(obj.variables[val.split('.')[1]]['name']) - 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(str(round(float(resultval),4)))) - self.mTableWidget.setItem(mrowPosition , 2, QTableWidgetItem(obj.variables[val.split('.')[1]]['unit'])) - self.mTableWidget.resizeColumnsToContents() - - - # 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) - - # changing index for updating the input data - indexx = self.comboBox.currentIndex() - self.comboBox.setCurrentIndex(1) - self.comboBox.setCurrentIndex(indexx) - - try: - - for i in self.parent().container.graphics.graphicsView.items(): - try: - if i.obj == self.obj: - i.update_tooltip() - except Exception as e: - pass - except Exception as e: - print(e) - - - except Exception as e: - print(e) - def closeEvent(self,event): - scrollHVal = self.parent().container.graphics.graphicsView.horizontalScrollBarVal - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189) -
\ No newline at end of file diff --git a/DockWidgets/DockWidgetMaterialStream.ui b/DockWidgets/DockWidgetMaterialStream.ui deleted file mode 100644 index 8b9df28..0000000 --- a/DockWidgets/DockWidgetMaterialStream.ui +++ /dev/null @@ -1,490 +0,0 @@ -<?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> - <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>true</bool> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="tab"> - <attribute name="title"> - <string>Input Data</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_5"> - <property name="sizeConstraint"> - <enum>QLayout::SetFixedSize</enum> - </property> - <item> - <widget class="QGroupBox" name="groupBox"> - <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> - </item> - <item> - <widget class="QGroupBox" name="groupBox_2"> - <property name="title"> - <string>Parameter Selection</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <property name="sizeConstraint"> - <enum>QLayout::SetFixedSize</enum> - </property> - <item> - <layout class="QFormLayout" name="formLayout"/> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="groupBox_3"> - <property name="title"> - <string/> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_10"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <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> - </item> - <item> - <widget class="QPushButton" name="pushButton_2"> - <property name="text"> - <string>Submit</string> - </property> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_2"> - <attribute name="title"> - <string>Results</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_3"> - <item> - <widget class="QToolBox" name="toolBox"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="font"> - <font> - <pointsize>8</pointsize> - <weight>75</weight> - <bold>true</bold> - </font> - </property> - <property name="styleSheet"> - <string notr="true">QToolBox{ - background: white; - border: 1px solid gray; - selection-background-color: rgb(255, 170, 127); -} -</string> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="mixtureTB"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>341</width> - <height>518</height> - </rect> - </property> - <property name="styleSheet"> - <string notr="true">QWidget{ - background: white; -}</string> - </property> - <attribute name="label"> - <string>Mixture</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_4"> - <item> - <widget class="QTabWidget" name="tabWidget_2"> - <property name="autoFillBackground"> - <bool>false</bool> - </property> - <property name="styleSheet"> - <string notr="true">QTabWidget{ - background: rgb(240, 240, 240); -}</string> - </property> - <property name="tabPosition"> - <enum>QTabWidget::North</enum> - </property> - <property name="tabShape"> - <enum>QTabWidget::Triangular</enum> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <property name="elideMode"> - <enum>Qt::ElideNone</enum> - </property> - <widget class="QWidget" name="tab_3"> - <attribute name="title"> - <string>Amounts</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_5"> - <item> - <widget class="QTreeWidget" name="mTreeWidget"> - <attribute name="headerCascadingSectionResizes"> - <bool>false</bool> - </attribute> - <attribute name="headerDefaultSectionSize"> - <number>150</number> - </attribute> - <attribute name="headerShowSortIndicator" stdset="0"> - <bool>false</bool> - </attribute> - <column> - <property name="text"> - <string notr="true">1</string> - </property> - </column> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_4"> - <attribute name="title"> - <string>Phase Properties</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_3"> - <item> - <widget class="QTableWidget" name="mTableWidget"> - <property name="columnCount"> - <number>3</number> - </property> - <attribute name="horizontalHeaderCascadingSectionResizes"> - <bool>false</bool> - </attribute> - <attribute name="horizontalHeaderDefaultSectionSize"> - <number>100</number> - </attribute> - <attribute name="horizontalHeaderShowSortIndicator" stdset="0"> - <bool>false</bool> - </attribute> - <attribute name="horizontalHeaderStretchLastSection"> - <bool>true</bool> - </attribute> - <attribute name="verticalHeaderStretchLastSection"> - <bool>false</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> - </item> - </layout> - </widget> - <widget class="QWidget" name="liquidTB"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>341</width> - <height>518</height> - </rect> - </property> - <property name="styleSheet"> - <string notr="true">QWidget{ - background: white; -}</string> - </property> - <attribute name="label"> - <string>Liquid</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_2"> - <item> - <widget class="QTabWidget" name="tabWidget_3"> - <property name="styleSheet"> - <string notr="true">QTabWidget{ - background: rgb(240, 240, 240); -}</string> - </property> - <property name="tabShape"> - <enum>QTabWidget::Triangular</enum> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="tab_5"> - <attribute name="title"> - <string>Amounts</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_6"> - <item> - <widget class="QTreeWidget" name="lTreeWidget"> - <attribute name="headerDefaultSectionSize"> - <number>150</number> - </attribute> - <column> - <property name="text"> - <string notr="true">1</string> - </property> - </column> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_6"> - <attribute name="title"> - <string>Phase Properties</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_9"> - <item> - <widget class="QTableWidget" name="lTableWidget"> - <property name="columnCount"> - <number>3</number> - </property> - <attribute name="horizontalHeaderDefaultSectionSize"> - <number>100</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> - </item> - </layout> - </widget> - <widget class="QWidget" name="vapourTB"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>137</width> - <height>96</height> - </rect> - </property> - <property name="styleSheet"> - <string notr="true">QWidget{ - background: white; - -}</string> - </property> - <attribute name="label"> - <string>Vapour</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_7"> - <item> - <widget class="QTabWidget" name="tabWidget_4"> - <property name="styleSheet"> - <string notr="true">QTabWidget{ - background: rgb(240, 240, 240); -}</string> - </property> - <property name="tabShape"> - <enum>QTabWidget::Triangular</enum> - </property> - <property name="currentIndex"> - <number>0</number> - </property> - <widget class="QWidget" name="tab_7"> - <attribute name="title"> - <string>Amounts</string> - </attribute> - <layout class="QHBoxLayout" name="horizontalLayout_8"> - <item> - <widget class="QTreeWidget" name="vTreeWidget"> - <attribute name="headerDefaultSectionSize"> - <number>150</number> - </attribute> - <column> - <property name="text"> - <string notr="true">1</string> - </property> - </column> - </widget> - </item> - </layout> - </widget> - <widget class="QWidget" name="tab_8"> - <attribute name="title"> - <string>Phase Properties</string> - </attribute> - <layout class="QVBoxLayout" name="verticalLayout_4"> - <item> - <widget class="QTableWidget" name="vTableWidget"> - <property name="columnCount"> - <number>3</number> - </property> - <attribute name="horizontalHeaderDefaultSectionSize"> - <number>100</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> - </item> - </layout> - </widget> - </widget> - </item> - </layout> - </widget> - </widget> - </widget> - <resources/> - <connections/> -</ui> diff --git a/DockWidgets/DockWidgetMixer.py b/DockWidgets/DockWidgetMixer.py deleted file mode 100644 index 2d02f8c..0000000 --- a/DockWidgets/DockWidgetMixer.py +++ /dev/null @@ -1,59 +0,0 @@ -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/DockWidgetMixer.ui') - -class DockWidgetMixer(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.input_params_list() - self.btn.clicked.connect(self.param) - self.dict = {} - - # input data tab - def input_params_list(self): - 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']) - for i in self.obj.Pout_modes: - self.cb2.addItem(str(i)) - self.cb2.setCurrentText(self.obj.variables['outPress']['value']) - - self.l2.setText(self.obj.variables['outPress']['name']+":") - self.input_dict = [self.le1, self.cb2] - - 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={} - self.dict = [int(self.input_dict[0].text()), self.input_dict[1].currentText()] - self.obj.param_setter(self.dict) - if(self.isVisible()): - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189) - self.hide() - - except Exception as e: - print(e) - def closeEvent(self,event): - scrollHVal = self.parent().container.graphics.graphicsView.horizontalScrollBarVal - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189)
\ No newline at end of file diff --git a/DockWidgets/DockWidgetMixer.ui b/DockWidgets/DockWidgetMixer.ui deleted file mode 100644 index e039490..0000000 --- a/DockWidgets/DockWidgetMixer.ui +++ /dev/null @@ -1,137 +0,0 @@ -<?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> - <widget class="QGroupBox" name="groupBox"> - <property name="geometry"> - <rect> - <x>10</x> - <y>40</y> - <width>341</width> - <height>101</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="autoFillBackground"> - <bool>true</bool> - </property> - <property name="title"> - <string>Calculation Parameters</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <layout class="QGridLayout" name="gridLayout"> - <item row="0" column="3"> - <widget class="QLabel" name="u1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <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"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="l1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QLineEdit" name="le1"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="l2"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QPushButton" name="btn"> - <property name="geometry"> - <rect> - <x>10</x> - <y>150</y> - <width>341</width> - <height>23</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Submit</string> - </property> - </widget> - </widget> - <resources/> - <connections/> -</ui> diff --git a/DockWidgets/DockWidgetShortcutColumn.py b/DockWidgets/DockWidgetShortcutColumn.py deleted file mode 100644 index 9b65021..0000000 --- a/DockWidgets/DockWidgetShortcutColumn.py +++ /dev/null @@ -1,141 +0,0 @@ -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/DockWidgetShortcutColumn.ui') - -class DockWidgetShortcutColumn(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.input_params_list() - self.btn.clicked.connect(self.param) - self.dict = [] - - self.name_type = None - self.container = container - - # input data tab - def input_params_list(self): - 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.cb1.setCurrentText(self.obj.compounds[int(self.obj.variables['HKey']['value'])-1]) - self.cb2.setCurrentText(self.obj.compounds[int(self.obj.variables['LKey']['value'])-1]) - - 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']) - self.l4.setText(self.obj.variables['LKey_x_pc']['name']+":") - self.u4.setText(self.obj.variables['LKey_x_pc']['unit']) - self.le4.setText(str(self.obj.variables['LKey_x_pc']['value'])) - - self.l5.setText(self.obj.variables['Ctype']['name']+":") - self.cb5.addItem('Total') - self.cb5.addItem('Partial') - self.cb5.setCurrentText(self.obj.variables['Ctype']['value']) - - self.l6.setText(self.obj.variables['Pcond']['name']+":") - self.le6.setText(str(self.obj.variables['Pcond']['value'])) - self.u6.setText(self.obj.variables['Pcond']['unit']) - self.l7.setText(self.obj.variables['Preb']['name']+":") - self.u7.setText(self.obj.variables['Preb']['unit']) - self.le7.setText(str(self.obj.variables['Preb']['value'])) - - self.l8.setText(self.obj.variables['RR']['name']+":") - self.le8.setText(str(self.obj.variables['RR']['value'])) - - 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.cb6.setCurrentText(self.obj.variables['thermo_package']['value']) - - 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) - - def update_compounds(self): - self.cb1.clear() - self.cb2.clear() - for i in self.obj.compounds: - self.cb1.addItem(str(i)) - self.cb2.addItem(str(i)) - self.cb1.setCurrentText(self.obj.compounds[int(self.obj.variables['HKey']['value']) - 1]) - self.cb2.setCurrentText(self.obj.compounds[int(self.obj.variables['LKey']['value']) - 1]) - - def show_error(self): - QMessageBox.about(self, 'Important', "Please fill all fields with data") - - def param(self): - try: - self.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()), - self.input_dict[8].currentText()] - self.obj.param_setter(self.dict) - if(self.isVisible()): - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189) - 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 = 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) - def closeEvent(self,event): - scrollHVal = self.parent().container.graphics.graphicsView.horizontalScrollBarVal - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189)
\ No newline at end of file diff --git a/DockWidgets/DockWidgetShortcutColumn.ui b/DockWidgets/DockWidgetShortcutColumn.ui deleted file mode 100644 index f79c27e..0000000 --- a/DockWidgets/DockWidgetShortcutColumn.ui +++ /dev/null @@ -1,360 +0,0 @@ -<?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> - <widget class="QTabWidget" name="tabWidget"> - <property name="geometry"> - <rect> - <x>10</x> - <y>40</y> - <width>381</width> - <height>611</height> - </rect> - </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>8</x> - <y>13</y> - <width>331</width> - <height>261</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Calculation Parameters</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> - <item> - <layout class="QGridLayout" name="gridLayout"> - <item row="3" column="2"> - <widget class="QLineEdit" name="le4"> - <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"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item row="6" column="3"> - <widget class="QLabel" name="u7"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <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="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item row="5" column="3"> - <widget class="QLabel" name="u6"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <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> - </property> - </widget> - </item> - <item row="7" column="0"> - <widget class="QLabel" name="l8"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <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="0" column="2"> - <widget class="QComboBox" name="cb1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="l4"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="4" column="2"> - <widget class="QComboBox" name="cb5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QLineEdit" name="le3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </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="3"> - <widget class="QLabel" name="u3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="3" column="3"> - <widget class="QLabel" name="u4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="l1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="5" column="0"> - <widget class="QLabel" name="l6"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="4" column="0"> - <widget class="QLabel" name="l5"> - <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> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QPushButton" name="btn"> - <property name="geometry"> - <rect> - <x>10</x> - <y>350</y> - <width>331</width> - <height>23</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <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> - <resources/> - <connections/> -</ui> diff --git a/DockWidgets/DockWidgetSplitter.py b/DockWidgets/DockWidgetSplitter.py deleted file mode 100644 index 24a8ee2..0000000 --- a/DockWidgets/DockWidgetSplitter.py +++ /dev/null @@ -1,78 +0,0 @@ -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/DockWidgetSplitter.ui') - -class DockWidgetSplitter(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.input_params_list() - self.btn.clicked.connect(self.param) - self.dict = {} - - # input data tab - def input_params_list(self): - 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']) - - self.l2.setText(self.obj.variables['CalcType']['name'] + ":") - for i in self.obj.CalcType_modes: - self.cb2.addItem(str(i)) - self.cb2.setCurrentText(self.obj.variables['CalcType']['value']) - - self.l3.setText("Stream 1 :") - self.le3.setText(str(self.obj.variables['SpecVal_s']['value'][0])) - self.u3.setText(self.obj.variables['SpecVal_s']['unit']) - self.l4.setText("Stream 2 :") - self.le4.setText(str(self.obj.variables['SpecVal_s']['value'][1])) - self.u4.setText(str(self.obj.variables['SpecVal_s']['unit'])) - 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() == 'Molar_Flow': - self.u3.setText('mol/s') - self.u4.setText('mol/s') - elif self.cb2.currentText() == 'Mass_Flow': - self.u3.setText('g/s') - self.u4.setText('g/s') - else: - self.u3.setText('') - self.u4.setText('') - - def show_error(self): - QMessageBox.about(self, 'Important', "Please fill all fields with data") - - def param(self): - try: - self.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())] - self.obj.param_setter(self.dict) - if(self.isVisible()): - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189) - self.hide() - except Exception as e: - print(e) - - def closeEvent(self,event): - scrollHVal = self.parent().container.graphics.graphicsView.horizontalScrollBarVal - currentVal = self.parent().container.graphics.graphicsView.horizontalScrollBar().value() - self.parent().container.graphics.graphicsView.horizontalScrollBar().setValue(currentVal-189)
\ No newline at end of file diff --git a/DockWidgets/DockWidgetSplitter.ui b/DockWidgets/DockWidgetSplitter.ui deleted file mode 100644 index 02a865e..0000000 --- a/DockWidgets/DockWidgetSplitter.ui +++ /dev/null @@ -1,200 +0,0 @@ -<?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> - <widget class="QGroupBox" name="groupBox"> - <property name="geometry"> - <rect> - <x>10</x> - <y>40</y> - <width>341</width> - <height>161</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="autoFillBackground"> - <bool>true</bool> - </property> - <property name="styleSheet"> - <string notr="true">Q</string> - </property> - <property name="title"> - <string>Calculation Parameters</string> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <layout class="QGridLayout" name="gridLayout"> - <item row="1" column="0"> - <widget class="QLabel" name="l2"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="l1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QLineEdit" name="le1"> - <property name="enabled"> - <bool>false</bool> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </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"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QComboBox" name="cb2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item row="0" column="3"> - <widget class="QLabel" name="u1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="l4"> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="3" column="2"> - <widget class="QLineEdit" name="le4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - </widget> - </item> - <item row="2" column="3"> - <widget class="QLabel" name="u3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - <item row="3" column="3"> - <widget class="QLabel" name="u4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>TextLabel</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - <widget class="QPushButton" name="btn"> - <property name="geometry"> - <rect> - <x>10</x> - <y>210</y> - <width>341</width> - <height>23</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Submit</string> - </property> - </widget> - </widget> - <resources/> - <connections/> -</ui> diff --git a/DockWidgets/__pycache__/DockWidget.cpython-36.pyc b/DockWidgets/__pycache__/DockWidget.cpython-36.pyc Binary files differdeleted file mode 100644 index 362d798..0000000 --- a/DockWidgets/__pycache__/DockWidget.cpython-36.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc Binary files differdeleted file mode 100644 index bb3ffa1..0000000 --- a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-36.pyc b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-36.pyc Binary files differdeleted file mode 100644 index 35f8cc8..0000000 --- a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-36.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc Binary files differdeleted file mode 100644 index ac95283..0000000 --- a/DockWidgets/__pycache__/DockWidgetCompoundSeparator.cpython-37.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-36.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-36.pyc Binary files differdeleted file mode 100644 index b2d28ee..0000000 --- a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-36.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc Binary files differdeleted file mode 100644 index 9be19e9..0000000 --- a/DockWidgets/__pycache__/DockWidgetDistillationColumn.cpython-37.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetFlash.cpython-36.pyc b/DockWidgets/__pycache__/DockWidgetFlash.cpython-36.pyc Binary files differdeleted file mode 100644 index 5d96e15..0000000 --- a/DockWidgets/__pycache__/DockWidgetFlash.cpython-36.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc Binary files differdeleted file mode 100644 index 53e426a..0000000 --- a/DockWidgets/__pycache__/DockWidgetFlash.cpython-37.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-36.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-36.pyc Binary files differdeleted file mode 100644 index dcdd91b..0000000 --- a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-36.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc Binary files differdeleted file mode 100644 index 1830c79..0000000 --- a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetMixer.cpython-36.pyc b/DockWidgets/__pycache__/DockWidgetMixer.cpython-36.pyc Binary files differdeleted file mode 100644 index 7ce7bc5..0000000 --- a/DockWidgets/__pycache__/DockWidgetMixer.cpython-36.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc Binary files differdeleted file mode 100644 index ce2d5af..0000000 --- a/DockWidgets/__pycache__/DockWidgetMixer.cpython-37.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-36.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-36.pyc Binary files differdeleted file mode 100644 index a43a296..0000000 --- a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-36.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc Binary files differdeleted file mode 100644 index 84d18de..0000000 --- a/DockWidgets/__pycache__/DockWidgetShortcutColumn.cpython-37.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-36.pyc b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-36.pyc Binary files differdeleted file mode 100644 index ddefbdd..0000000 --- a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-36.pyc +++ /dev/null diff --git a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc Binary files differdeleted file mode 100644 index 2f45777..0000000 --- a/DockWidgets/__pycache__/DockWidgetSplitter.cpython-37.pyc +++ /dev/null |