From 80dc2915ff93611a3a8d4852d328f71462ae534d Mon Sep 17 00:00:00 2001 From: brenda-br Date: Tue, 7 Feb 2023 16:27:18 +0530 Subject: Fix #52 Input data tab updated with values and disabled --- Container.py | 17 +++++++++++++++++ DockWidgets/DockWidget.py | 14 +++++++------- DockWidgets/__pycache__/DockWidget.cpython-37.pyc | Bin 4932 -> 4747 bytes Streams.py | 6 +++--- Undo.dat | Bin 5449 -> 14478 bytes 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Container.py b/Container.py index a975bc9..617bd2b 100644 --- a/Container.py +++ b/Container.py @@ -160,6 +160,23 @@ class Container(): for i in self.graphics.scene.items(): if (isinstance(i, NodeItem) and i.type == 'MaterialStream'): i.update_tooltip_selectedVar() + no_input_lines = len(i.input[0].in_lines) + no_output_lines = len(i.output[0].out_lines) + if(no_input_lines>0): #Checks if material stream is input or output stream if it is output stream it continues + #setting the value of input data tab in dock widget and disabling them + i.dock_widget.comboBox.setDisabled(True) + i.dock_widget.input_dict['P'].setText(str(i.obj.variables['P']['value'])) + i.dock_widget.input_dict['P'].setDisabled(True) + i.dock_widget.input_dict['T'].setText(str(i.obj.variables['T']['value'])) + i.dock_widget.input_dict['T'].setDisabled(True) + i.dock_widget.input_dict['MolFlow'].setText(str(i.obj.variables['F_p[1]']['value'])) + i.dock_widget.input_dict['MolFlow'].setDisabled(True) + i.dock_widget.cbTP.setCurrentText(str(i.obj.thermo_package)) + i.dock_widget.cbTP.setDisabled(True) + i.dock_widget.pushButton_2.setDisabled(True) + for index,k in enumerate(i.dock_widget.x_pclist): + k.setText(str(i.obj.variables['x_pc']['value'][index])) + k.setDisabled(True) def flat_list(lst): flat_lst=[] diff --git a/DockWidgets/DockWidget.py b/DockWidgets/DockWidget.py index 71e9624..7f7c7d5 100644 --- a/DockWidgets/DockWidget.py +++ b/DockWidgets/DockWidget.py @@ -57,7 +57,7 @@ class DockWidget(QDockWidget,ui_dialog): try: print("input_params_list ", self.input_dict) for c,i in enumerate(self.input_dict): - print(i) + #print(i) if i == None: continue l = QLineEdit(str(self.obj.variables[i]['value'])) @@ -77,16 +77,16 @@ class DockWidget(QDockWidget,ui_dialog): def param(self): try: self.dict = {} - print("param.input_dict ", self.input_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) + #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()) + #print(self.input_dict[i].text()) self.show_error() break @@ -121,19 +121,19 @@ class DockWidget(QDockWidget,ui_dialog): def results_category(self,name): flag = True try: - print("Under result category name ", name) + #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) + #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) + #print("######Resultsfetch####",val,resultval) rowPosition = self.tableWidget.rowCount() self.tableWidget.insertRow(rowPosition) self.tableWidget.setItem(rowPosition , 0, QTableWidgetItem(obj.variables[val]['name'])) diff --git a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc index 51ca871..6838fb3 100644 Binary files a/DockWidgets/__pycache__/DockWidget.cpython-37.pyc and b/DockWidgets/__pycache__/DockWidget.cpython-37.pyc differ diff --git a/Streams.py b/Streams.py index f90546b..53c0a19 100644 --- a/Streams.py +++ b/Streams.py @@ -156,9 +156,9 @@ class MaterialStream(): vapMolFrac_name = self.variables['xvap']['name'] vapMolFrac_val = self.variables['xvap']['value'] vapMolFrac_unit = self.variables['xvap']['unit'] - mixMolFlo_name = self.variables['F_pc']['name'] - mixMolFlo_val = self.variables['F_pc']['value'] - mixMolFlo_unit = self.variables['F_pc']['unit'] + mixMolFlo_name = self.variables['F_p[1]']['name'] + mixMolFlo_val = self.variables['F_p[1]']['value'] + mixMolFlo_unit = self.variables['F_p[1]']['unit'] mixMassFlo_name = self.variables['Fm_p[1]']['name'] mixMassFlo_val = self.variables['Fm_p[1]']['value'] mixMassFlo_unit = self.variables['Fm_p[1]']['unit'] diff --git a/Undo.dat b/Undo.dat index 25d4faf..cd9e3c1 100644 Binary files a/Undo.dat and b/Undo.dat differ -- cgit