diff options
author | nilshah98 | 2019-06-24 12:59:23 +0530 |
---|---|---|
committer | nilshah98 | 2019-06-24 13:16:50 +0530 |
commit | 36d047799641be04f4e8f441187e9382d6e87e7e (patch) | |
tree | 34f91ce13b2990a97566f6d3212919dae789cd2e /src/frontEnd | |
parent | 1d4ee6b6c1254657c497673838922e746f339eca (diff) | |
download | eSim-36d047799641be04f4e8f441187e9382d6e87e7e.tar.gz eSim-36d047799641be04f4e8f441187e9382d6e87e7e.tar.bz2 eSim-36d047799641be04f4e8f441187e9382d6e87e7e.zip |
Resolves #93
Diffstat (limited to 'src/frontEnd')
-rwxr-xr-x | src/frontEnd/Application.py | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index c2790a80..4f40650f 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -30,7 +30,7 @@ import time from PyQt4.Qt import QSize import sys import os - +import time # Its our main window of application. class Application(QtGui.QMainWindow): @@ -324,7 +324,33 @@ class Application(QtGui.QMainWindow): if self.projDir is not None: self.obj_Mainview.obj_dockarea.ngspiceEditor(self.projDir) - time.sleep(2) # Need permanent solution + + # Fail Safe, to never go in infinte loop - + ''' + t_end = time.time() + 5*60 + while(time.time() < t_end): + pass + ''' + # Run the while loop for a max of 300 seconds (5 minutes) + + if("plot_data_i.txt" in os.listdir(self.projDir)): + lastModificationTime = os.path.getmtime(self.projDir+"/plot_data_i.txt") + newModificationTime = os.path.getmtime(self.projDir+"/plot_data_i.txt") + + while(newModificationTime == lastModificationTime): + newModificationTime = os.path.getmtime(self.projDir+"/plot_data_i.txt") + # Poll for data every 0.2 seconds, so system doesn't crash + time.sleep(0.2) + + else: + files = os.listdir(self.projDir) + while("plot_data_i.txt" not in files): + files = os.listdir(self.projDir) + # Poll for data every 0.2 seconds, so system doesn't crash + time.sleep(0.2) + + + # time.sleep(2) # Need permanent solution # Calling Python Plotting try: |