diff options
-rw-r--r-- | DockWidgets/DockWidget.py | 2 | ||||
-rw-r--r-- | DockWidgets/DockWidgetMaterialStream.py | 9 | ||||
-rw-r--r-- | DockWidgets/__pycache__/DockWidget.cpython-37.pyc | bin | 4338 -> 4390 bytes | |||
-rw-r--r-- | DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc | bin | 8124 -> 8227 bytes | |||
-rw-r--r-- | Graphics.py | 2 | ||||
-rw-r--r-- | Streams.py | 3 | ||||
-rw-r--r-- | Undo.dat | bin | 0 -> 2461 bytes | |||
-rw-r--r-- | UnitOperations.py | 7 |
8 files changed, 18 insertions, 5 deletions
diff --git a/DockWidgets/DockWidget.py b/DockWidgets/DockWidget.py index 7e8a221..97ac7c8 100644 --- a/DockWidgets/DockWidget.py +++ b/DockWidgets/DockWidget.py @@ -32,6 +32,7 @@ class DockWidget(QDockWidget,ui_dialog): 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) @@ -69,6 +70,7 @@ class DockWidget(QDockWidget,ui_dialog): except Exception as e: print(e) + def show_error(self): QMessageBox.about(self, 'Important', "Please fill all fields with data") diff --git a/DockWidgets/DockWidgetMaterialStream.py b/DockWidgets/DockWidgetMaterialStream.py index 792a985..31b874e 100644 --- a/DockWidgets/DockWidgetMaterialStream.py +++ b/DockWidgets/DockWidgetMaterialStream.py @@ -38,6 +38,7 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): 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= {} @@ -46,9 +47,13 @@ class DockWidgetMaterialStream(QDockWidget,ui_dialog): def mode_selection(self): self.input_dict= {} - for i in reversed(range(self.formLayout.count())): - self.formLayout.removeRow(i) + 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): diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc Binary files differindex 3386671..1a43e5b 100644 --- a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc diff --git a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc Binary files differindex 7d5b43a..7143602 100644 --- a/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc +++ b/DockWidgets/__pycache__/DockWidgetMaterialStream.cpython-37.pyc diff --git a/Graphics.py b/Graphics.py index a8ee43a..a829849 100644 --- a/Graphics.py +++ b/Graphics.py @@ -416,7 +416,7 @@ class NodeItem(QtWidgets.QGraphicsItem): if (self.obj.modes_list): default_tooltip = f"{self.name}\n\n" - default_tooltip_dict = self.obj.param_getter(self.obj.modes_list[0]) + default_tooltip_dict = self.obj.param_getter(self.obj.mode) for i, j in default_tooltip_dict.items(): if j is not None: default_tooltip = default_tooltip + f" {i} : {j}\n" @@ -27,8 +27,9 @@ class MaterialStream(): MaterialStream.counter+=1 self.start_dict = {} self.eqn_dict = {} - self.modes_list = ["PT","PH","PVF","TVF","PS"] + self.modes_list = ["PT", "PH", "PVF", "TVF", "PS"] self.saved = False + self.mode = self.modes_list[0] self.variables = { 'P' : {'name':'Pressure', 'value':101325, 'unit':'Pa'}, Binary files differdiff --git a/UnitOperations.py b/UnitOperations.py index 20c620f..019aa14 100644 --- a/UnitOperations.py +++ b/UnitOperations.py @@ -46,6 +46,10 @@ class UnitOperation(): def param_setter(self,params): print("param_setter ", params) + try: + self.mode = list(params.keys())[0] + except Exception as e: + print(e) for k,v in params.items(): if k == 'Thermo Package': self.thermo_package = v @@ -56,6 +60,7 @@ class UnitOperation(): self.variables[k]['value'] = v self.mode_val = params[self.mode] + def add_connection(self,flag,sourceId, UnitOpr): if flag==1: # Input stream if flag is 1 self.input_stms[sourceId] = UnitOpr @@ -236,7 +241,7 @@ class DistillationColumn(UnitOperation): self.EngStm1 = EngStm(name='EngStm1'+self.name) self.EngStm2 = EngStm(name='EngStm2'+self.name) self.count = DistillationColumn.counter - + self.thermo_pack_req = True # self.modes_list = ['RR', 'Nout', 'T'] self.modes_list = [] self.parameters = ['Nt', 'Ni', 'Ctype', 'Pcond', 'condmode', 'C_comp', 'C_Spec', 'Preb', 'rebmode', 'rebcomp', 'R_Spec'] |