diff options
author | Pranav P | 2023-04-08 09:10:39 +0530 |
---|---|---|
committer | Pranav P | 2023-04-08 09:10:39 +0530 |
commit | 8f7d5b170b587aa359f6df3b73f998bf8be9f008 (patch) | |
tree | 6c1dbed2ef3d178b249b9542fa1df8be56caea14 | |
parent | f87ebcf83c4a2a614e79b10039021cc5a0d56889 (diff) | |
download | eSim-8f7d5b170b587aa359f6df3b73f998bf8be9f008.tar.gz eSim-8f7d5b170b587aa359f6df3b73f998bf8be9f008.tar.bz2 eSim-8f7d5b170b587aa359f6df3b73f998bf8be9f008.zip |
Hopefully fixed a bug which could have been a racing condition
-rw-r--r-- | src/frontEnd/Application.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 44237d56..4ebb544c 100644 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -83,6 +83,8 @@ class Application(QtWidgets.QMainWindow): self.systemTrayIcon.setIcon(QtGui.QIcon(init_path + 'images/logo.png')) self.systemTrayIcon.setVisible(True) + self.is_file_changed = False + def initToolBar(self): """ This function initializes Tool Bars. @@ -573,8 +575,10 @@ class Application(QtWidgets.QMainWindow): return st = os.stat(os.path.join(self.projDir, "plot_data_i.txt")) - print(st.st_mtime, currTime - 1) - if st.st_mtime >= currTime - 1: + is_ngspice_running = self.checkIfProcessRunning("ngspice") + print("Ngspice is running:", is_ngspice_running) + print(st.st_mtime, currTime) + if st.st_mtime >= currTime and not is_ngspice_running: self.is_file_changed = True self.timer.stop() self.plot_simulation() |