summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrenda-br2023-02-10 13:48:16 +0530
committerbrenda-br2023-02-10 13:48:16 +0530
commit383c19228c83802c72ba7155a0d43cef2c4cebe4 (patch)
tree265261288624263bc37e60d260560695ba76051d
parent228b1d1c72f7b962e46a4e2b52d90b84d2235aa0 (diff)
downloadChemical-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--.gitignore1
-rw-r--r--Container.py18
-rw-r--r--Undo.datbin18267 -> 0 bytes
3 files changed, 12 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index cf57c05..aa892f0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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:
diff --git a/Undo.dat b/Undo.dat
index 55201d3..e69de29 100644
--- a/Undo.dat
+++ b/Undo.dat
Binary files differ