diff options
author | brenda-br | 2023-02-10 13:48:16 +0530 |
---|---|---|
committer | brenda-br | 2023-02-10 13:48:16 +0530 |
commit | 383c19228c83802c72ba7155a0d43cef2c4cebe4 (patch) | |
tree | 265261288624263bc37e60d260560695ba76051d | |
parent | 228b1d1c72f7b962e46a4e2b52d90b84d2235aa0 (diff) | |
download | Chemical-Simulator-GUI-383c19228c83802c72ba7155a0d43cef2c4cebe4.tar.gz Chemical-Simulator-GUI-383c19228c83802c72ba7155a0d43cef2c4cebe4.tar.bz2 Chemical-Simulator-GUI-383c19228c83802c72ba7155a0d43cef2c4cebe4.zip |
Fix #51 Disable menubar, toolbar and componentSelector when simulating
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Container.py | 18 | ||||
-rw-r--r-- | Undo.dat | bin | 18267 -> 0 bytes |
3 files changed, 12 insertions, 7 deletions
@@ -12,3 +12,4 @@ __pycache__/* DockWidgets/__pycache__/* Undo.dat test.py +Undo.dat diff --git a/Container.py b/Container.py index 39ea6ad..1471653 100644 --- a/Container.py +++ b/Container.py @@ -118,6 +118,11 @@ class Container(): self.msg.append("<span style=\"color:red\">"+stdout+"</span>") def simulate(self,mode): + self.graphicsView.parent().parent().menubar.setProperty('enabled',False) + self.graphicsView.parent().parent().toolBar.setProperty('enabled',False) + self.graphicsView.parent().parent().dockWidget.setProperty('enabled',False) + self.graphicsView.setInteractive(False) + QApplication.instance().setOverrideCursor(QCursor(Qt.WaitCursor)) for i in self.graphics.scene.items(): if (isinstance(i, NodeItem)): @@ -143,17 +148,10 @@ class Container(): self.result=self.flowsheet.result_data elif mode=='EQN': - self.graphicsView.setInteractive(False) - QApplication.instance().setOverrideCursor(QCursor(Qt.WaitCursor)) - self.msg.append("<span>["+str(self.current_time())+"] Simulating in <b>equation</b> mode ... </span>") self.flowsheet.simulate_EQN() self.result=self.flowsheet.result_data - self.graphicsView.setInteractive(True) - QApplication.instance().restoreOverrideCursor() - QApplication.instance().setOverrideCursor(QCursor(Qt.ArrowCursor)) - if(len(self.result)== 4): #self.msg_browser() self.msg.append("<span style=\"color:green\">["+str(self.current_time())+"] Simulation <b>Successful.</b></span>") @@ -172,6 +170,12 @@ class Container(): 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) + self.graphicsView.parent().parent().menubar.setProperty('enabled',True) + self.graphicsView.parent().parent().toolBar.setProperty('enabled',True) + self.graphicsView.parent().parent().dockWidget.setProperty('enabled',True) + self.graphicsView.setInteractive(True) + QApplication.instance().restoreOverrideCursor() + QApplication.instance().setOverrideCursor(QCursor(Qt.ArrowCursor)) def flat_list(lst): flat_lst=[] for sublist in lst: Binary files differ |