summaryrefslogtreecommitdiff
path: root/src/ngspiceSimulation/NgspiceWidget.py
blob: de56359d0a9dce60aa919ebf5e3e96432108d8d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from PyQt4 import QtGui,QtCore
from configuration.Appconfig import Appconfig

class NgspiceWidget(QtGui.QWidget):
    """
    This Class creates NgSpice Window
    """
    def __init__(self,command):
        QtGui.QWidget.__init__(self)
        self.obj_appconfig = Appconfig()
        self.command = "ngspice "+command
        
        self.process = QtCore.QProcess(self)
        self.terminal = QtGui.QWidget(self)
        self.layout = QtGui.QVBoxLayout(self)
        self.layout.addWidget(self.terminal)
        
        #Creating argument for process
        self.args = ['-into', str(self.terminal.winId()),'-hold','-e', self.command]
        self.process.start('xterm', self.args)