summaryrefslogtreecommitdiff
path: root/src/ngspiceSimulation/NgspiceWidget.py
diff options
context:
space:
mode:
authorfossee2019-08-29 12:03:11 +0530
committerfossee2019-08-29 12:03:11 +0530
commitfe3bd934634bb2dae1cadf35e7c6d59facbedf66 (patch)
treeab841ad9ca3d56f7eb85cb3650f6608b80656027 /src/ngspiceSimulation/NgspiceWidget.py
parentf7567ac99f21fb6c87d60f309f0aa71dee6ae975 (diff)
downloadeSim-fe3bd934634bb2dae1cadf35e7c6d59facbedf66.tar.gz
eSim-fe3bd934634bb2dae1cadf35e7c6d59facbedf66.tar.bz2
eSim-fe3bd934634bb2dae1cadf35e7c6d59facbedf66.zip
adding files
Diffstat (limited to 'src/ngspiceSimulation/NgspiceWidget.py')
-rw-r--r--src/ngspiceSimulation/NgspiceWidget.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py
new file mode 100644
index 00000000..310cbe3c
--- /dev/null
+++ b/src/ngspiceSimulation/NgspiceWidget.py
@@ -0,0 +1,37 @@
+from PyQt4 import QtGui,QtCore
+from configuration.Appconfig import Appconfig
+import platform
+import os
+
+class NgspiceWidget(QtGui.QWidget):
+ """
+ This Class creates NgSpice Window
+ """
+ def __init__(self,command,projPath):
+ QtGui.QWidget.__init__(self)
+ self.obj_appconfig = Appconfig()
+ self.process = QtCore.QProcess(self)
+ self.terminal = QtGui.QWidget(self)
+ self.layout = QtGui.QVBoxLayout(self)
+ self.layout.addWidget(self.terminal)
+
+ print "Argument to ngspice command : ",command
+
+ if platform.system() == 'Linux':
+ self.command = "cd "+projPath+";ngspice "+command
+ #Creating argument for process
+ #self.args = ['-into', str(self.terminal.winId()),'-hold','-e', self.command]
+ self.args = ['-hold','-e', self.command]
+ self.process.start('xterm', self.args)
+ self.obj_appconfig.process_obj.append(self.process)
+ self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']].append(self.process.pid())
+
+ elif platform.system() == 'Windows':
+ tempdir= os.getcwd()
+ projPath = self.obj_appconfig.current_project["ProjectName"]
+ os.chdir(projPath)
+ self.command = "ngspice "+command
+ self.process.start(self.command)
+ os.chdir(tempdir)
+
+