summaryrefslogtreecommitdiff
path: root/src/kicadtoNgspice
diff options
context:
space:
mode:
authorfahim2015-06-02 12:49:38 +0530
committerfahim2015-06-02 12:49:38 +0530
commit5bd663b93d1cf9aa96ecf7a35a46c0a2e22d7572 (patch)
tree6ab592c6793f9964ddaf492513585091f035df6b /src/kicadtoNgspice
parent5357a0cebc493f1fd5e6c232af77269b9b03abd8 (diff)
downloadeSim-5bd663b93d1cf9aa96ecf7a35a46c0a2e22d7572.tar.gz
eSim-5bd663b93d1cf9aa96ecf7a35a46c0a2e22d7572.tar.bz2
eSim-5bd663b93d1cf9aa96ecf7a35a46c0a2e22d7572.zip
Subject: CSS changes for Source Widget
Description:CSS changes for Source Widget
Diffstat (limited to 'src/kicadtoNgspice')
-rw-r--r--src/kicadtoNgspice/Source.py115
1 files changed, 85 insertions, 30 deletions
diff --git a/src/kicadtoNgspice/Source.py b/src/kicadtoNgspice/Source.py
index 678a30c5..3ff7c975 100644
--- a/src/kicadtoNgspice/Source.py
+++ b/src/kicadtoNgspice/Source.py
@@ -40,104 +40,159 @@ class Source(QtGui.QWidget):
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
+ acbox=QtGui.QGroupBox()
+ acbox.setTitle(line[3])
+ acgrid=QtGui.QGridLayout()
self.start=self.count
label=QtGui.QLabel(line[4])
- self.grid.addWidget(label,self.row,0)
+ acgrid.addWidget(label,self.row,0)
self.entry_var[self.count]=QtGui.QLineEdit()
self.entry_var[self.count].setMaximumWidth(150)
- self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ acgrid.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
+ acbox.setLayout(acgrid)
+
+ #CSS
+ acbox.setStyleSheet(" \
+ QGroupBox { border: 1px solid gray; border-radius: 9px; margin-top: 0.5em; } \
+ QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; } \
+ ")
+
+ self.grid.addWidget(acbox)
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
+ dcbox=QtGui.QGroupBox()
+ dcbox.setTitle(line[3])
+ dcgrid=QtGui.QGridLayout()
self.start=self.count
label=QtGui.QLabel(line[4])
- self.grid.addWidget(label,self.row,0)
+ dcgrid.addWidget(label,self.row,0)
self.entry_var[self.count]=QtGui.QLineEdit()
self.entry_var[self.count].setMaximumWidth(150)
- self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ dcgrid.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
+ dcbox.setLayout(dcgrid)
+
+ #CSS
+ dcbox.setStyleSheet(" \
+ QGroupBox { border: 1px solid gray; border-radius: 9px; margin-top: 0.5em; } \
+ QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; } \
+ ")
+
+ self.grid.addWidget(dcbox)
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
+ sinebox=QtGui.QGroupBox()
+ sinebox.setTitle(line[3])
+ sinegrid=QtGui.QGridLayout()
self.start=self.count
for it in range(4,9):
label=QtGui.QLabel(line[it])
- self.grid.addWidget(label,self.row,0)
+ sinegrid.addWidget(label,self.row,0)
self.entry_var[self.count]=QtGui.QLineEdit()
self.entry_var[self.count].setMaximumWidth(150)
- self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ sinegrid.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
+ sinebox.setLayout(sinegrid)
+
+ #CSS
+ sinebox.setStyleSheet(" \
+ QGroupBox { border: 1px solid gray; border-radius: 9px; margin-top: 0.5em; } \
+ QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; } \
+ ")
+
+ self.grid.addWidget(sinebox)
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
+ pulsebox=QtGui.QGroupBox()
+ pulsebox.setTitle(line[3])
+ pulsegrid=QtGui.QGridLayout()
self.start=self.count
for it in range(4,11):
label=QtGui.QLabel(line[it])
- self.grid.addWidget(label,self.row,0)
+ pulsegrid.addWidget(label,self.row,0)
self.entry_var[self.count]=QtGui.QLineEdit()
self.entry_var[self.count].setMaximumWidth(150)
- self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ pulsegrid.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
+ pulsebox.setLayout(pulsegrid)
+
+ #CSS
+ pulsebox.setStyleSheet(" \
+ QGroupBox { border: 1px solid gray; border-radius: 9px; margin-top: 0.5em; } \
+ QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; } \
+ ")
+
+ self.grid.addWidget(pulsebox)
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
+ pwlbox=QtGui.QGroupBox()
+ pwlbox.setTitle(line[3])
+ pwlgrid=QtGui.QGridLayout()
self.start=self.count
label=QtGui.QLabel(line[4])
- self.grid.addWidget(label,self.row,0)
+ pwlgrid.addWidget(label,self.row,0)
self.entry_var[self.count]=QtGui.QLineEdit()
self.entry_var[self.count].setMaximumWidth(150)
- self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ pwlgrid.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
+ pwlbox.setLayout(pwlgrid)
+
+ #CSS
+ pwlbox.setStyleSheet(" \
+ QGroupBox { border: 1px solid gray; border-radius: 9px; margin-top: 0.5em; } \
+ QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; } \
+ ")
+
+ self.grid.addWidget(pwlbox)
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
+ expbox=QtGui.QGroupBox()
+ expbox.setTitle(line[3])
+ expgrid=QtGui.QGridLayout()
self.start=self.count
for it in range(4,10):
label=QtGui.QLabel(line[it])
- self.grid.addWidget(label,self.row,0)
+ expgrid.addWidget(label,self.row,0)
self.entry_var[self.count]=QtGui.QLineEdit()
self.entry_var[self.count].setMaximumWidth(150)
- self.grid.addWidget(self.entry_var[self.count],self.row,1)
+ expgrid.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
+ print "End",self.end
+ expbox.setLayout(expgrid)
+
+ #CSS
+ expbox.setStyleSheet(" \
+ QGroupBox { border: 1px solid gray; border-radius: 9px; margin-top: 0.5em; } \
+ QGroupBox::title { subcontrol-origin: margin; left: 10px; padding: 0 3px 0 3px; } \
+ ")
+
+ self.grid.addWidget(expbox)
sourcelisttrack.append([track_id,'exp',self.start,self.end])