summaryrefslogtreecommitdiff
path: root/src/ngspiceSimulation/NgspiceWidget.py
diff options
context:
space:
mode:
authorrahulp132020-08-02 01:25:18 +0530
committerrahulp132020-08-02 01:25:18 +0530
commit4aefb4d9d607a59e77a3bd25bb23d0a46adcef7b (patch)
tree915c330567079a3f67e5e07756acd2b2180d00c1 /src/ngspiceSimulation/NgspiceWidget.py
parentcde494dc77c0d48cffa1e9aca77121fec0e94cf0 (diff)
parent4a7aade3374afb981b57330b640d4ec2c24e9c69 (diff)
downloadeSim-4aefb4d9d607a59e77a3bd25bb23d0a46adcef7b.tar.gz
eSim-4aefb4d9d607a59e77a3bd25bb23d0a46adcef7b.tar.bz2
eSim-4aefb4d9d607a59e77a3bd25bb23d0a46adcef7b.zip
Merge branch 'master' of https://github.com/rahulp13/eSim
Diffstat (limited to 'src/ngspiceSimulation/NgspiceWidget.py')
-rw-r--r--src/ngspiceSimulation/NgspiceWidget.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py
index a963c51f..136510e1 100644
--- a/src/ngspiceSimulation/NgspiceWidget.py
+++ b/src/ngspiceSimulation/NgspiceWidget.py
@@ -1,10 +1,12 @@
from PyQt4 import QtGui, QtCore
from configuration.Appconfig import Appconfig
+from configparser import SafeConfigParser
import platform
import os
-
# This Class creates NgSpice Window
+
+
class NgspiceWidget(QtGui.QWidget):
def __init__(self, command, projPath):
@@ -20,6 +22,17 @@ class NgspiceWidget(QtGui.QWidget):
self.layout = QtGui.QVBoxLayout(self)
self.layout.addWidget(self.terminal)
+ if os.name == 'nt':
+ home = os.path.expanduser("~")
+
+ parser_nghdl = SafeConfigParser()
+ parser_nghdl.read(os.path.join(
+ home, os.path.join('.nghdl', 'config.ini')))
+ try:
+ msys_bin = parser_nghdl.get('COMPILER', 'MSYS_HOME')
+ except BaseException:
+ pass
+
print("Argument to ngspice command : ", command)
# For Linux OS
if platform.system() == 'Linux':
@@ -40,6 +53,7 @@ class NgspiceWidget(QtGui.QWidget):
tempdir = os.getcwd()
projPath = self.obj_appconfig.current_project["ProjectName"]
os.chdir(projPath)
- self.command = "ngspice " + command
+ self.command = 'cmd /c '+'"start /min ' + \
+ msys_bin + "/mintty.exe ngspice " + command + '"'
self.process.start(self.command)
os.chdir(tempdir)