summaryrefslogtreecommitdiff
path: root/src/kicadtoNgspice
diff options
context:
space:
mode:
Diffstat (limited to 'src/kicadtoNgspice')
-rw-r--r--src/kicadtoNgspice/Analysis.py5
-rw-r--r--src/kicadtoNgspice/Analysis.pycbin4527 -> 4527 bytes
-rw-r--r--src/kicadtoNgspice/Convert.py106
-rw-r--r--src/kicadtoNgspice/KicadtoNgspice.py77
-rw-r--r--src/kicadtoNgspice/KicadtoNgspice.pycbin3356 -> 3961 bytes
-rw-r--r--src/kicadtoNgspice/Processing.py184
-rw-r--r--src/kicadtoNgspice/Source.py144
-rw-r--r--src/kicadtoNgspice/TrackWidget.py7
8 files changed, 506 insertions, 17 deletions
diff --git a/src/kicadtoNgspice/Analysis.py b/src/kicadtoNgspice/Analysis.py
index 15d20039..f05654e4 100644
--- a/src/kicadtoNgspice/Analysis.py
+++ b/src/kicadtoNgspice/Analysis.py
@@ -6,9 +6,7 @@ class Analysis(QtGui.QWidget):
def __init__(self):
QtGui.QWidget.__init__(self)
self.createAnalysisWidget()
-
-
-
+
def createAnalysisWidget(self):
self.grid = QtGui.QGridLayout()
self.grid.addWidget(self.createCheckBobx(),0,0)
@@ -59,7 +57,6 @@ class Analysis(QtGui.QWidget):
self.checkgrid.addWidget(self.checkAC,0,0)
self.checkgrid.addWidget(self.checkDC,0,1)
self.checkgrid.addWidget(self.checkTRAN,0,2)
-
self.checkbox.setLayout(self.checkgrid)
diff --git a/src/kicadtoNgspice/Analysis.pyc b/src/kicadtoNgspice/Analysis.pyc
index 3a756f63..77f4d3ff 100644
--- a/src/kicadtoNgspice/Analysis.pyc
+++ b/src/kicadtoNgspice/Analysis.pyc
Binary files differ
diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py
new file mode 100644
index 00000000..92bc2945
--- /dev/null
+++ b/src/kicadtoNgspice/Convert.py
@@ -0,0 +1,106 @@
+
+
+class Convert:
+ def __init__(self,sourcelisttrack,entry_var,schematicInfo):
+ print "Start Conversion"
+ self.sourcelisttrack = sourcelisttrack
+ self.schematicInfo = schematicInfo
+ self.entry_var = entry_var
+ self.sourcelistvalue = []
+
+ def addSourceParameter(self):
+ print "Adding Source parameter"
+ print "SourceListTrack : ",self.sourcelisttrack
+ print "Schematic Info ",self.schematicInfo
+ print "Entry Var",self.entry_var
+ self.start = 0
+ self.end = 0
+
+ for compline in self.sourcelisttrack:
+ self.index = compline[0]
+ self.addline = self.schematicInfo[self.index]
+ if compline[1] == 'sine':
+ try:
+ self.start = compline[2]
+ self.end = compline[3]
+ vo_val = str(self.entry_var[self.start].text()) if len(str(self.entry_var[self.start].text())) > 0 else '0'
+ va_val = str(self.entry_var[self.start+1].text()) if len(str(self.entry_var[self.start+1].text())) > 0 else '0'
+ freq_val = str(self.entry_var[self.start+2].text()) if len(str(self.entry_var[self.start+2].text())) > 0 else '0'
+ td_val = str(self.entry_var[self.start+3].text()) if len(str(self.entry_var[self.start+3].text())) > 0 else '0'
+ theta_val = str(self.entry_var[self.end].text()) if len(str(self.entry_var[self.end].text())) > 0 else '0'
+ self.addline = self.addline.partition('(')[0] + "("+vo_val+" "+va_val+" "+freq_val+" "+td_val+" "+theta_val+")"
+ self.sourcelistvalue.append([self.index,self.addline])
+ except:
+ print "Caught an exception in sine voltage source ",self.addline
+
+ elif compline[1] == 'pulse':
+ try:
+ self.start = compline[2]
+ self.end = compline[3]
+ v1_val = str(self.entry_var[self.start].text()) if len(str(self.entry_var[self.start].text())) > 0 else '0'
+ v2_val = str(self.entry_var[self.start+1].text()) if len(str(self.entry_var[self.start+1].text())) > 0 else '0'
+ td_val = str(self.entry_var[self.start+2].text()) if len(str(self.entry_var[self.start+2].text())) > 0 else '0'
+ tr_val = str(self.entry_var[self.start+3].text()) if len(str(self.entry_var[self.start+3].text())) > 0 else '0'
+ tf_val = str(self.entry_var[self.start+4].text()) if len(str(self.entry_var[self.start+4].text())) > 0 else '0'
+ pw_val = str(self.entry_var[self.start+5].text()) if len(str(self.entry_var[self.start+5].text())) > 0 else '0'
+ tp_val = str(self.entry_var[self.end].text()) if len(str(self.entry_var[self.end].text())) > 0 else '0'
+
+ self.addline = self.addline.partition('(')[0] + "("+v1_val+" "+v2_val+" "+td_val+" "+tr_val+" "+tf_val+" "+pw_val+" "+tp_val+")"
+ self.sourcelistvalue.append([self.index,self.addline])
+ except:
+ print "Caught an exception in pulse voltage source ",self.addline
+
+ elif compline[1] == 'pwl':
+ try:
+ self.start = compline[2]
+ self.end = compline[3]
+ t_v_val = str(self.entry_var[self.start].text()) if len(str(self.entry_var[self.start].text())) > 0 else '0 0'
+ self.addline = self.addline.partition('(')[0] + "("+t_v_val+")"
+ self.sourcelistvalue.append([self.index,self.addline])
+ except:
+ print "Caught an exception in pwl voltage source ",self.addline
+
+ elif compline[1] == 'ac':
+ try:
+ self.start = compline[2]
+ self.end = compline[3]
+ va_val=str(self.entry_var[self.start].text()) if len(str(self.entry_var[self.start].text())) > 0 else '0'
+ self.addline = ' '.join(self.addline.split())
+ self.addline = self.addline.partition('ac')[0] +" "+'ac'+" "+ va_val
+ self.sourcelistvalue.append([self.index,self.addline])
+ except:
+ print "Caught an exception in ac voltage source ",self.addline
+
+ elif compline[1] == 'dc':
+ try:
+ self.start = compline[2]
+ self.end = compline[3]
+ v1_val = str(self.entry_var[self.start].text()) if len(str(self.entry_var[self.start].text())) > 0 else '0'
+ self.addline = ' '.join(self.addline.split())
+ self.addline = self.addline.partition('dc')[0] + " " +'dc'+ " "+v1_val
+ self.sourcelistvalue.append([self.index,self.addline])
+ except:
+ print "Caught an exception in dc voltage source",self.addline
+
+ elif compline[1] == 'exp':
+ try:
+ self.start = compline[2]
+ self.end = compline[3]
+ v1_val = str(self.entry_var[self.start].text()) if len(str(self.entry_var[self.start].text())) > 0 else '0'
+ v2_val = str(self.entry_var[self.start+1].text()) if len(str(self.entry_var[self.start+1].text())) > 0 else '0'
+ td1_val = str(self.entry_var[self.start+2].text()) if len(str(self.entry_var[self.start+2].text())) > 0 else '0'
+ tau1_val = str(self.entry_var[self.start+3].text()) if len(str(self.entry_var[self.start+3].text())) > 0 else '0'
+ td2_val = str(self.entry_var[self.start+4].text()) if len(str(self.entry_var[self.start+4].text())) > 0 else '0'
+ tau2_val = str(self.entry_var[self.end].text()) if len(str(self.entry_var[self.end].text())) > 0 else '0'
+
+ self.addline = self.addline.partition('(')[0] + "("+v1_val+" "+v2_val+" "+td1_val+" "+tau1_val+" "+td2_val+" "+tau2_val+")"
+ self.sourcelistvalue.append([self.index,self.addline])
+ except:
+ print "Caught an exception in exp voltage source ",self.addline
+
+ #Updating Schematic with source value
+ for item in self.sourcelistvalue:
+ del self.schematicInfo[item[0]]
+ self.schematicInfo.insert(item[0],item[1])
+
+ return self.schematicInfo \ No newline at end of file
diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py
index 01887ec5..4af345fc 100644
--- a/src/kicadtoNgspice/KicadtoNgspice.py
+++ b/src/kicadtoNgspice/KicadtoNgspice.py
@@ -17,32 +17,39 @@
#===============================================================================
import sys
import os
-from PyQt4 import QtGui
+from PyQt4 import QtGui,QtCore
+from Processing import PrcocessNetlist
import Analysis
import Source
+import Convert
+import TrackWidget
+
class MainWindow(QtGui.QWidget):
def __init__(self):
QtGui.QWidget.__init__(self)
- #self.kicadfile = sys.argv[1]
- self.kicadfile = "/home/fahim/eSim-Workspace/BJT_amplifier/BJT_amplifier.cir"
- print "Init Kicad to Ngspice"
-
+ #Create object of track widget
+ self.obj_track = TrackWidget.TrackWidget()
+
+ print "Init Kicad to Ngspice"
#Creating GUI for kicadtoNgspice window
self.grid = QtGui.QGridLayout(self)
self.convertbtn = QtGui.QPushButton("Convert")
+ self.convertbtn.clicked.connect(self.callConvert)
self.cancelbtn = QtGui.QPushButton("Cancel")
self.cancelbtn.clicked.connect(self.close)
self.grid.addWidget(self.createcreateConvertWidget(),0,0)
self.grid.addWidget(self.convertbtn,1,1)
self.grid.addWidget(self.cancelbtn,1,2)
- self.setGeometry(500, 500, 600, 600)
+ #self.setGeometry(800, 800, 1000, 1000)
+ self.setWindowState(QtCore.Qt.WindowMaximized)
self.setLayout(self.grid)
self.show()
def createcreateConvertWidget(self):
+
self.convertWindow = QtGui.QWidget()
self.analysisTab = QtGui.QScrollArea()
@@ -51,7 +58,7 @@ class MainWindow(QtGui.QWidget):
self.analysisTab.setWidgetResizable(True)
self.sourceTab = QtGui.QScrollArea()
- self.sourceTab.setWidget(Source.Source(self.kicadfile))
+ self.sourceTab.setWidget(Source.Source(sourcelist,sourcelisttrack))
self.sourceTabLayout = QtGui.QVBoxLayout(self.sourceTab.widget())
self.sourceTab.setWidgetResizable(True)
@@ -72,6 +79,19 @@ class MainWindow(QtGui.QWidget):
return self.convertWindow
+
+ def callConvert(self):
+ """
+ Calling Convert Class Constructor
+ """
+ global schematicInfo
+ self.obj_convert = Convert.Convert(self.obj_track.sourcelisttrack["ITEMS"],
+ self.obj_track.entry_var["ITEMS"],
+ schematicInfo)
+
+ #Adding Source Value to Schematic Info
+ schematicInfo = self.obj_convert.addSourceParameter()
+
@@ -79,9 +99,50 @@ def main(args):
print "=================================="
print "Kicad to Ngspice netlist converter "
print "=================================="
+ global kicadFile,kicadNetlist,schematicInfo
+ kicadFile = "/home/fahim/eSim-Workspace/BJT_amplifier/BJT_amplifier.cir"
+ #kicadFile = sys.argv[1]
+
+ #Object of Processing
+ obj_proc = PrcocessNetlist()
+
+ # Read the netlist
+ kicadNetlist = obj_proc.readNetlist(kicadFile)
+
+ # Construct parameter information
+ param=obj_proc.readParamInfo(kicadNetlist)
+
+ # Replace parameter with values
+ netlist,infoline=obj_proc.preprocessNetlist(kicadNetlist,param)
+
+ print "NETLIST ",netlist
+ print "INFOLINE",infoline
+
+ # Separate option and schematic information
+ optionInfo, schematicInfo=obj_proc.separateNetlistInfo(netlist)
+
+ print "OPTIONINFO",optionInfo
+ print "SCHEMATICINFO",schematicInfo
+
+ #Getting model and subckt list
+ modelList=[]
+ subcktList=[]
+ modelList,subcktList = obj_proc.getModelSubcktList(schematicInfo,modelList,subcktList)
+
+ print "MODEL LIST ",modelList
+ print "SUBCKT ",subcktList
+
+ #List for storing source and its value
+ global sourcelist, sourcelisttrack
+ sourcelist=[]
+ sourcelisttrack=[]
+ schematicInfo,sourcelist=obj_proc.insertSpecialSourceParam(schematicInfo,sourcelist)
- #print "The passed netlist file is ",sys.argv[1]
+ print "SOURCELIST",sourcelist
+ print "SCHEMATICINFO",schematicInfo
+
+
app = QtGui.QApplication(args)
#app.setApplicationName("KicadToNgspice")
#app.setQuitOnLastWindowClosed(True)
diff --git a/src/kicadtoNgspice/KicadtoNgspice.pyc b/src/kicadtoNgspice/KicadtoNgspice.pyc
index bb6ada22..8e4cf3eb 100644
--- a/src/kicadtoNgspice/KicadtoNgspice.pyc
+++ b/src/kicadtoNgspice/KicadtoNgspice.pyc
Binary files differ
diff --git a/src/kicadtoNgspice/Processing.py b/src/kicadtoNgspice/Processing.py
index b8b5ae66..4dee9446 100644
--- a/src/kicadtoNgspice/Processing.py
+++ b/src/kicadtoNgspice/Processing.py
@@ -8,3 +8,187 @@ class PrcocessNetlist:
data=f.read()
f.close()
return data.splitlines()
+
+ def readParamInfo(self,kicadNetlis):
+ """Read Parameter information and store it into dictionary"""
+ param={}
+ for eachline in kicadNetlis:
+ print eachline
+ eachline=eachline.strip()
+ if len(eachline)>1:
+ words=eachline.split()
+ option=words[0].lower()
+ if option=='.param':
+ for i in range(1, len(words), 1):
+ paramList=words[i].split('=')
+ param[paramList[0]]=paramList[1]
+ return param
+
+ def preprocessNetlist(self,kicadNetlis,param):
+ """Preprocess netlist (replace parameters)"""
+ netlist=[]
+ for eachline in kicadNetlis:
+ # Remove leading and trailing blanks spaces from line
+ eachline=eachline.strip()
+ # Remove special character $
+ eachline=eachline.replace('$','')
+ # Replace parameter with values
+ for subParam in eachline.split():
+ if '}' in subParam:
+ key=subParam.split()[0]
+ key=key.strip('{')
+ key=key.strip('}')
+ if key in param:
+ eachline=eachline.replace('{'+key+'}',param[key])
+ else:
+ print "Parameter " + key +" does not exists"
+ value=raw_input('Enter parameter value: ')
+ eachline=eachline.replace('{'+key+'}',value)
+ #Convert netlist into lower case letter
+ eachline=eachline.lower()
+ # Construct netlist
+ if len(eachline)>1:
+ if eachline[0]=='+':
+ netlist.append(netlist.pop()+eachline.replace('+',' '))
+ else:
+ netlist.append(eachline)
+ #Copy information line
+ infoline=netlist[0]
+ netlist.remove(netlist[0])
+ return netlist,infoline
+
+ def separateNetlistInfo(self,netlist):
+ optionInfo=[]
+ schematicInfo=[]
+ for eachline in netlist:
+ if eachline[0]=='*':
+ continue
+ elif eachline[0]=='.':
+ optionInfo.append(eachline)
+ else:
+ schematicInfo.append(eachline)
+ return optionInfo,schematicInfo
+
+ def getModelSubcktList(self,schematicInfo,modelList,subcktList):
+ #Processing Netlist for modellist and subcktlist details
+ for eachline in schematicInfo:
+ words = eachline.split()
+ if eachline[0]=='d':
+ modelName=words[3]
+ if modelName in modelList:
+ continue
+ else:
+ modelList.append(modelName)
+ elif eachline[0]=='q':
+ modelName=words[4]
+ index=schematicInfo.index(eachline)
+ schematicInfo.remove(eachline)
+ schematicInfo.insert(index,words[0]+" "+words[3]+" "+words[2]+" "+words[1]+" "+words[4])
+ if modelName in modelList:
+ continue
+ else:
+ modelList.append(modelName)
+ elif eachline[0]=='m':
+ modelName=words[4]
+ index=schematicInfo.index(eachline)
+ schematicInfo.remove(eachline)
+ width=raw_input(' Enter width of mosfet '+words[0]+'(default=100u):')
+ length=raw_input(' Enter length of mosfet '+words[0]+'(default=100u):')
+ multiplicative_factor=raw_input(' Enter multiplicative factor of mosfet '+words[0]+'(default=1):')
+ if width=="": width="100u"
+ if multiplicative_factor=="": multiplicative_factor="100u"
+ if length=="": length="100u"
+ schematicInfo.insert(index,words[0]+" "+words[1]+" "+words[2]+" "+words[3]+" "+words[3]+" "+words[4]+" "+'M='+multiplicative_factor+" "+'L='+length+" "+'W='+width)
+ if modelName in modelList:
+ continue
+ modelList.append(modelName)
+ elif eachline[0]=='j':
+ modelName=words[4]
+ index=schematicInfo.index(eachline)
+ schematicInfo.remove(eachline)
+ schematicInfo.insert(index,words[0]+" "+words[1]+" "+words[2]+" "+words[3]+" "+words[4])
+ if modelName in modelList:
+ continue
+ else:
+ modelList.append(modelName)
+ elif eachline[0]=='x':
+ subcktName=words[len(words)-1]
+ if subcktName in subcktList:
+ continue
+ else:
+ subcktList.append(subcktName)
+
+ return modelList,subcktList
+
+ def insertSpecialSourceParam(self,schematicInfo,sourcelist):
+ #Inser Special source parameter
+ schematicInfo1=[]
+
+ for compline in schematicInfo:
+ words=compline.split()
+ compName=words[0]
+ # Ask for parameters of source
+ if compName[0]=='v' or compName=='i':
+ # Find the index component from circuit
+ index=schematicInfo.index(compline)
+ if words[3]=="pulse":
+ Title="Add parameters for pulse source "+compName
+ v1=' Enter initial value(Volts/Amps): '
+ v2=' Enter pulsed value(Volts/Amps): '
+ td=' Enter delay time (seconds): '
+ tr=' Enter rise time (seconds): '
+ tf=' Enter fall time (seconds): '
+ pw=' Enter pulse width (seconds): '
+ tp=' Enter period (seconds): '
+ sourcelist.append([index,compline,words[3],Title,v1,v2,td,tr,tf,pw,tp])
+
+ elif words[3]=="sine":
+ Title="Add parameters for sine source "+compName
+ vo=' Enter offset value (Volts/Amps): '
+ va=' Enter amplitude (Volts/Amps): '
+ freq=' Enter frequency (Hz): '
+ td=' Enter delay time (seconds): '
+ theta=' Enter damping factor (1/seconds): '
+ sourcelist.append([index,compline,words[3],Title,vo,va,freq,td,theta])
+
+ elif words[3]=="pwl":
+ Title="Add parameters for pwl source "+compName
+ t_v=' Enter in pwl format without bracket i.e t1 v1 t2 v2.... '
+ sourcelist.append([index,compline,words[3],Title,t_v])
+
+ elif words[3]=="ac":
+ Title="Add parameters for ac source "+compName
+ v_a=' Enter amplitude (Volts/Amps): '
+ sourcelist.append([index,compline,words[3],Title,v_a])
+
+ elif words[3]=="exp":
+ Title="Add parameters for exponential source "+compName
+ v1=' Enter initial value(Volts/Amps): '
+ v2=' Enter pulsed value(Volts/Amps): '
+ td1=' Enter rise delay time (seconds): '
+ tau1=' Enter rise time constant (seconds): '
+ td2=' Enter fall time (seconds): '
+ tau2=' Enter fall time constant (seconds): '
+ sourcelist.append([index,compline,words[3],Title,v1,v2,td1,tau1,td2,tau2])
+
+ elif words[3]=="dc":
+ Title="Add parameters for DC source "+compName
+ v1=' Enter value(Volts/Amps): '
+ v2=' Enter zero frequency: '
+ sourcelist.append([index,compline,words[3],Title,v1,v2])
+
+ elif compName[0]=='h' or compName[0]=='f':
+ # Find the index component from the circuit
+ index=schematicInfo.index(compline)
+ schematicInfo.remove(compline)
+ schematicInfo.insert(index,"* "+compName)
+ schematicInfo1.append("V"+compName+" "+words[3]+" "+words[4]+" 0")
+ schematicInfo1.append(compName+" "+words[1]+" "+words[2]+" "+"V"+compName+" "+words[5])
+
+ schematicInfo=schematicInfo+schematicInfo1
+ #print sourcelist
+ #print schematicInfo
+ return schematicInfo,sourcelist
+
+
+ \ No newline at end of file
diff --git a/src/kicadtoNgspice/Source.py b/src/kicadtoNgspice/Source.py
index 054928b2..f37ccb56 100644
--- a/src/kicadtoNgspice/Source.py
+++ b/src/kicadtoNgspice/Source.py
@@ -1,15 +1,149 @@
from PyQt4 import QtGui
from Processing import PrcocessNetlist
+import TrackWidget
+
class Source(QtGui.QWidget):
- def __init__(self,kicadfile=None):
+
+ def __init__(self,sourcelist,sourcelisttrack):
QtGui.QWidget.__init__(self)
- self.obj_proc = PrcocessNetlist()
+ print "My Net List ",sourcelist
+ self.obj_track = TrackWidget.TrackWidget()
+ #Variable
+ self.count = 1
+ self.start = 0
+ self.end = 0
+ self.row = 0
+ self.entry_var = {}
+
+ #Creating Source Widget
+ self.createSourceWidget(sourcelist,sourcelisttrack)
+
+
+
+ def createSourceWidget(self,sourcelist,sourcelisttrack):
+
+ self.grid = QtGui.QGridLayout()
+ self.setLayout(self.grid)
+
+ if sourcelist:
+ for line in sourcelist:
+ #print "Voltage source line index: ",line[0]
+ #print "SourceList line Test: ",line
+ track_id=line[0]
+ print "track_id is ",track_id
+ if line[2]=='ac':
+ label=QtGui.QLabel(line[3])
+ self.grid.addWidget(label,self.row,1)
+ self.row=self.row+1
+ self.start=self.count
+ label=QtGui.QLabel(line[4])
+ self.grid.addWidget(label,self.row,0)
+ self.entry_var[self.count]=QtGui.QLineEdit()
+ self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ #Value Need to check previuouse value
+ self.entry_var[self.count].setText("")
+ self.row=self.row+1
+ self.end=self.count
+ self.count=self.count+1
+ sourcelisttrack.append([track_id,'ac',self.start,self.end])
+
+ elif line[2]=='dc':
+ label=QtGui.QLabel(line[3])
+ self.grid.addWidget(label,self.row,1)
+ self.row=self.row+1
+ self.start=self.count
+ label=QtGui.QLabel(line[4])
+ self.grid.addWidget(label,self.row,0)
+ self.entry_var[self.count]=QtGui.QLineEdit()
+ self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ self.entry_var[self.count].setText("")
+ self.row=self.row+1
+ self.end=self.count
+ self.count=self.count+1
+ sourcelisttrack.append([track_id,'dc',self.start,self.end])
+
+ elif line[2]=='sine':
+ label=QtGui.QLabel(line[3])
+ self.grid.addWidget(label,self.row,1)
+ self.row=self.row+1
+ self.start=self.count
+
+ for it in range(4,9):
+ label=QtGui.QLabel(line[it])
+ self.grid.addWidget(label,self.row,0)
+ self.entry_var[self.count]=QtGui.QLineEdit()
+ self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ self.entry_var[self.count].setText("")
+ self.row=self.row+1
+ self.count=self.count+1
+ self.end=self.count-1
+ sourcelisttrack.append([track_id,'sine',self.start,self.end])
+
+ elif line[2]=='pulse':
+ label=QtGui.QLabel(line[3])
+ self.grid.addWidget(label,self.row,1)
+ self.row=self.row+1
+ self.start=self.count
+ for it in range(4,11):
+ label=QtGui.QLabel(line[it])
+ self.grid.addWidget(label,self.row,0)
+ self.entry_var[self.count]=QtGui.QLineEdit()
+ self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ self.entry_var[self.count].setText("")
+ self.row=self.row+1
+ self.count=self.count+1
+ self.end=self.count-1
+ sourcelisttrack.append([track_id,'pulse',self.start,self.end])
+
+ elif line[2]=='pwl':
+ label=QtGui.QLabel(line[3])
+ self.grid.addWidget(label,self.row,1)
+ self.row=self.row+1
+ self.start=self.count
+ label=QtGui.QLabel(line[4])
+ self.grid.addWidget(label,self.row,0)
+ self.entry_var[self.count]=QtGui.QLineEdit()
+ self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ self.entry_var[self.count].setText("");
+ self.row=self.row+1
+ self.end=self.count
+ self.count=self.count+1
+ sourcelisttrack.append([track_id,'pwl',self.start,self.end])
+
+ elif line[2]=='exp':
+ label=QtGui.QLabel(line[3])
+ self.grid.addWidget(label,self.row,1)
+ self.row=self.row+1
+ self.start=self.count
+ for it in range(4,10):
+ label=QtGui.QLabel(line[it])
+ self.grid.addWidget(label,self.row,0)
+ self.entry_var[self.count]=QtGui.QLineEdit()
+ self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ self.entry_var[self.count].setText("")
+ self.row=self.row+1
+ self.count=self.count+1
+ self.end=self.count-1
+ sourcelisttrack.append([track_id,'exp',self.start,self.end])
+
+
+ self.count=self.count+1
+
+
+ else:
+ print "No source is present in your circuit"
+
+
+
+ self.obj_track.sourcelisttrack["ITEMS"] = sourcelisttrack
+ self.obj_track.entry_var["ITEMS"] = self.entry_var
+ self.show()
+
+
+
- #Read NetList
- self.kicadNetlist = self.obj_proc.readNetlist(kicadfile)
- print "My Net List ",self.kicadNetlist
diff --git a/src/kicadtoNgspice/TrackWidget.py b/src/kicadtoNgspice/TrackWidget.py
new file mode 100644
index 00000000..37785a0a
--- /dev/null
+++ b/src/kicadtoNgspice/TrackWidget.py
@@ -0,0 +1,7 @@
+class TrackWidget:
+ """
+ This Class track the widget of Kicad to NgSpice converter
+ module in the form of list
+ """
+ sourcelisttrack = {"ITEMS":"None"}
+ entry_var = {"ITEMS":"None"} \ No newline at end of file