diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/kicadtoNgspice/Convert.py | 3 | ||||
-rw-r--r-- | src/kicadtoNgspice/KicadtoNgspice.py | 2 | ||||
-rw-r--r-- | src/kicadtoNgspice/Processing.py | 3 | ||||
-rw-r--r-- | src/kicadtoNgspice/Source.py | 17 |
4 files changed, 18 insertions, 7 deletions
diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py index 2b10f83d..d4ce21f7 100644 --- a/src/kicadtoNgspice/Convert.py +++ b/src/kicadtoNgspice/Convert.py @@ -79,8 +79,9 @@ class Convert: 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' + ph_val=str(self.entry_var[self.start+1].text()) if len(str(self.entry_var[self.start+1].text())) > 0 else '0' self.addline = ' '.join(self.addline.split()) - self.addline = self.addline.partition('ac')[0] +" "+'ac'+" "+ va_val + self.addline = self.addline.partition('ac')[0] +" "+'ac'+" "+ va_val+" "+ph_val self.sourcelistvalue.append([self.index,self.addline]) except: print "Caught an exception in ac voltage source ",self.addline diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py index 87616a3d..7351138e 100644 --- a/src/kicadtoNgspice/KicadtoNgspice.py +++ b/src/kicadtoNgspice/KicadtoNgspice.py @@ -308,6 +308,8 @@ class MainWindow(QtGui.QWidget): if words[len(words)-1]=="ac": #attr_ac=ET.SubElement(attr_var,"ac") ET.SubElement(attr_var,"field1",name="Amplitude").text=str(obj_source.entry_var[count].text()) + count=count+1 + ET.SubElement(attr_var, "field2", name = "Phase").text = str(obj_source.entry_var[count].text()) count=count+2 elif words[len(words)-1]=="dc": #attr_dc=ET.SubElement(attr_var,"dc") diff --git a/src/kicadtoNgspice/Processing.py b/src/kicadtoNgspice/Processing.py index 67e7dc9d..0745fd5b 100644 --- a/src/kicadtoNgspice/Processing.py +++ b/src/kicadtoNgspice/Processing.py @@ -119,7 +119,8 @@ class PrcocessNetlist: 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]) + p_a =' Enter Phase Shift: ' + sourcelist.append([index,compline,words[3],Title,v_a,p_a]) elif words[3]=="exp": Title="Add parameters for exponential source "+compName diff --git a/src/kicadtoNgspice/Source.py b/src/kicadtoNgspice/Source.py index 4841ab07..c2750732 100644 --- a/src/kicadtoNgspice/Source.py +++ b/src/kicadtoNgspice/Source.py @@ -69,13 +69,18 @@ class Source(QtGui.QWidget): acbox.setTitle(line[3]) acgrid=QtGui.QGridLayout() self.start=self.count - label=QtGui.QLabel(line[4]) - acgrid.addWidget(label,self.row,0) + label1=QtGui.QLabel(line[4]) + label2 = QtGui.QLabel(line[5]) + acgrid.addWidget(label1,self.row,0) + acgrid.addWidget(label2, self.row+1, 0) self.entry_var[self.count]=QtGui.QLineEdit() self.entry_var[self.count].setMaximumWidth(150) acgrid.addWidget(self.entry_var[self.count],self.row,1) - #Value Need to check previuouse value + self.entry_var[self.count+1]=QtGui.QLineEdit() + self.entry_var[self.count+1].setMaximumWidth(150) + acgrid.addWidget(self.entry_var[self.count+1],self.row+1,1) self.entry_var[self.count].setText("") + self.entry_var[self.count+1].setText("") try: for child in root: templist1=line[1] @@ -83,12 +88,13 @@ class Source(QtGui.QWidget): if child.tag==templist2[0] and child.text==line[2]: self.entry_var[self.count].setText(child[0].text) + self.entry_var[self.count+1].setText(child[1].text) except: pass #Value Need to check previuouse value #self.entry_var[self.count].setText("") self.row=self.row+1 - self.end=self.count + self.end=self.count+1 self.count=self.count+1 acbox.setLayout(acgrid) @@ -100,7 +106,8 @@ class Source(QtGui.QWidget): self.grid.addWidget(acbox) sourcelisttrack.append([track_id,'ac',self.start,self.end]) - + + elif line[2]=='dc': dcbox=QtGui.QGroupBox() dcbox.setTitle(line[3]) |