summaryrefslogtreecommitdiff
path: root/src/frontEnd
diff options
context:
space:
mode:
authorRahul Paknikar2021-01-08 13:10:30 +0530
committerGitHub2021-01-08 13:10:30 +0530
commit840090d0eedac3c60026269f50f9bb8365e4801b (patch)
treed518be49a0aacfdba9d18f99da73fc9d9fa7271f /src/frontEnd
parenta61c3edf10706ca0231b4441f84f801f0c9d4773 (diff)
parent1b5e07107e5fcf0269de20885a371b54049823e3 (diff)
downloadeSim-2.1.tar.gz
eSim-2.1.tar.bz2
eSim-2.1.zip
Merge pull request #162 from rahulp13/masterv2.1
fixed crash issues
Diffstat (limited to 'src/frontEnd')
-rw-r--r--src/frontEnd/Application.py32
-rw-r--r--src/frontEnd/Workspace.py12
2 files changed, 33 insertions, 11 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index 44616ab7..94bce4ae 100644
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -13,7 +13,7 @@
# MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in
# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay
# CREATED: Tuesday 24 February 2015
-# REVISION: Saturday 01 August 2020
+# REVISION: Sunday 13 December 2020
# =========================================================================
import os
@@ -293,13 +293,20 @@ class Application(QtWidgets.QMainWindow):
text, ok = QtWidgets.QInputDialog.getText(
self, 'New Project Info', 'Enter Project Name:'
)
+ updated = False
+
if ok:
self.projname = (str(text))
self.project = NewProjectInfo()
directory, filelist = self.project.createProject(self.projname)
- self.obj_Mainview.obj_projectExplorer.addTreeNode(
- directory, filelist)
- else:
+
+ if directory and filelist:
+ self.obj_Mainview.obj_projectExplorer.addTreeNode(
+ directory, filelist
+ )
+ updated = True
+
+ if not updated:
print("No new project created")
self.obj_appconfig.print_info('No new project created')
try:
@@ -532,16 +539,27 @@ class Application(QtWidgets.QMainWindow):
break
except Exception:
pass
- time.sleep(0.5)
+ time.sleep(1)
# Fail Safe ===>
count += 1
if count >= 10:
- raise Exception(
+ print(
"Ngspice taking too long for simulation. "
"Check netlist file to change simulation parameters."
)
+ self.msg = QtWidgets.QErrorMessage()
+ self.msg.setModal(True)
+ self.msg.setWindowTitle("Warning Message")
+ self.msg.showMessage(
+ 'Ngspice taking too long for simulation. '
+ 'Check netlist file to change simulation parameters.'
+ )
+ self.msg.exec_()
+
+ return
+
# Calling Python Plotting
try:
self.obj_Mainview.obj_dockarea.plottingEditor()
@@ -703,7 +721,7 @@ class Application(QtWidgets.QMainWindow):
'Please select the project first. ' +
'You can either create a new project or open existing project'
)
- self.exec_()
+ self.msg.exec_()
def open_OMoptim(self):
"""
diff --git a/src/frontEnd/Workspace.py b/src/frontEnd/Workspace.py
index 0a80d357..4d033539 100644
--- a/src/frontEnd/Workspace.py
+++ b/src/frontEnd/Workspace.py
@@ -13,7 +13,7 @@
# MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in
# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay
# CREATED: Wednesday 05 February 2015
-# REVISION: Saturday 25 July 2020
+# REVISION: Sunday 13 December 2020
# =========================================================================
from PyQt5 import QtCore, QtGui, QtWidgets
@@ -172,7 +172,11 @@ class Workspace(QtWidgets.QWidget):
def browseLocation(self):
print("Function : Browse Location")
- self.workspace_directory = QtWidgets.QFileDialog.getExistingDirectory(
- self, "Browse Location", os.path.expanduser("~")
+ self.workspace_directory = QtCore.QDir.toNativeSeparators(
+ QtWidgets.QFileDialog.getExistingDirectory(
+ self, "Browse Location", os.path.expanduser("~")
+ )
)
- self.workspace_loc.setText(self.workspace_directory)
+
+ if self.workspace_directory:
+ self.workspace_loc.setText(self.workspace_directory)