From 814d2a6150fe6f7e914c6c63b4e9e8a88c0cf5b2 Mon Sep 17 00:00:00 2001 From: brenda-br Date: Tue, 7 Feb 2023 21:47:00 +0530 Subject: Fix #52 Input data tab disabled on reopening saved file --- Container.py | 15 +-------------- Streams.py | 16 ++++++++++++++++ Undo.dat | Bin 14478 -> 0 bytes mainApp.py | 9 +++++++++ 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/Container.py b/Container.py index 617bd2b..6b59b37 100644 --- a/Container.py +++ b/Container.py @@ -163,20 +163,7 @@ class Container(): 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) + i.obj.disableInputDataTab(i.dock_widget) def flat_list(lst): flat_lst=[] diff --git a/Streams.py b/Streams.py index 53c0a19..319819d 100644 --- a/Streams.py +++ b/Streams.py @@ -427,3 +427,19 @@ class MaterialStream(): for key,value in self.eqn_dict.items(): self.OM_data_eqn = self.OM_data_eqn + self.name + '.'+ key + ' = ' + str(value) + ';\n' return self.OM_data_eqn + + def disableInputDataTab(self,dockwidget): + #setting the value of input data tab in dock widget and disabling them + dockwidget.comboBox.setDisabled(True) + dockwidget.input_dict['P'].setText(str(self.variables['P']['value'])) + dockwidget.input_dict['P'].setDisabled(True) + dockwidget.input_dict['T'].setText(str(self.variables['T']['value'])) + dockwidget.input_dict['T'].setDisabled(True) + dockwidget.input_dict['MolFlow'].setText(str(self.variables['F_p[1]']['value'])) + dockwidget.input_dict['MolFlow'].setDisabled(True) + dockwidget.cbTP.setCurrentText(str(self.thermo_package)) + dockwidget.cbTP.setDisabled(True) + dockwidget.pushButton_2.setDisabled(True) + for index,k in enumerate(dockwidget.x_pclist): + k.setText(str(self.variables['x_pc']['value'][index])) + k.setDisabled(True) diff --git a/Undo.dat b/Undo.dat index cd9e3c1..e69de29 100644 Binary files a/Undo.dat and b/Undo.dat differ diff --git a/mainApp.py b/mainApp.py index 32128ae..7350025 100644 --- a/mainApp.py +++ b/mainApp.py @@ -353,8 +353,17 @@ class MainApp(QMainWindow,ui): DockWidget.show_result(dock_widget_lst) for i in dock_widget_lst: + #Submitting values i.param() + #Disbaling input data tab for output stream + for i in self.container.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 + i.obj.disableInputDataTab(i.dock_widget) except Exception as e: print(e) -- cgit