diff options
-rw-r--r-- | src/kicadtoNgspice/Analysis.py | 105 | ||||
-rw-r--r-- | src/kicadtoNgspice/Analysis.pyc | bin | 2965 -> 4527 bytes | |||
-rw-r--r-- | src/kicadtoNgspice/KicadtoNgspice.py | 32 | ||||
-rw-r--r-- | src/kicadtoNgspice/KicadtoNgspice.pyc | bin | 3090 -> 2655 bytes | |||
-rw-r--r-- | src/projManagement/Kicad.py | 8 | ||||
-rw-r--r-- | src/projManagement/Kicad.pyc | bin | 3853 -> 4113 bytes |
6 files changed, 104 insertions, 41 deletions
diff --git a/src/kicadtoNgspice/Analysis.py b/src/kicadtoNgspice/Analysis.py index 84c279c6..baccb669 100644 --- a/src/kicadtoNgspice/Analysis.py +++ b/src/kicadtoNgspice/Analysis.py @@ -5,28 +5,21 @@ from PyQt4 import QtGui,QtCore class Analysis(QtGui.QWidget): def __init__(self): QtGui.QWidget.__init__(self) + self.createAnalysisWidget() + + + + def createAnalysisWidget(self): - ''' - self.scrolllayout = QtGui.QVBoxLayout() - self.scrollwidget = QtGui.QWidget() - self.scrollwidget.setLayout(self.scrolllayout) - - self.scroll = QtGui.QScrollArea() - self.scroll.setWidgetResizable(True) # Set to make the inner widget resize with scroll area - self.scroll.setWidget(self.scrollwidget) - - self.hlayout = QtGui.QHBoxLayout() - self.hlayout.addWidget(self.scroll) - self.hlayout.addWidget(self.createACgroup()) - self.hlayout.addWidget(self.createDCgroup()) - self.hlayout.addWidget(self.createTRANgroup()) - self.setLayout(self.hlayout) - ''' - self.grid = QtGui.QGridLayout() - self.grid.addWidget(self.createACgroup(),0,0) - self.grid.addWidget(self.createDCgroup(),1,0) - self.grid.addWidget(self.createTRANgroup(),2,0) + + + self.grid.addWidget(self.createCheckBobx(),0,0) + self.grid.addWidget(self.createACgroup(),1,0) + self.grid.addWidget(self.createDCgroup(),2,0) + self.grid.addWidget(self.createTRANgroup(),3,0) + + ''' self.grid.addWidget(self.createTRANgroup(),3,0) @@ -52,6 +45,54 @@ class Analysis(QtGui.QWidget): self.setLayout(self.grid) self.show() + + def createCheckBobx(self): + self.checkbox = QtGui.QGroupBox() + self.checkbox.setTitle("Select Analysis Type") + self.checkgrid = QtGui.QGridLayout() + + self.checkgroupbtn = QtGui.QButtonGroup() + self.checkAC = QtGui.QCheckBox("AC") + self.checkDC = QtGui.QCheckBox("DC") + self.checkTRAN = QtGui.QCheckBox("TRANSIENT") + self.checkgroupbtn.addButton(self.checkAC) + self.checkgroupbtn.addButton(self.checkDC) + self.checkgroupbtn.addButton(self.checkTRAN) + self.checkgroupbtn.setExclusive(True) + self.checkgroupbtn.buttonClicked.connect(self.enableBox) + + 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) + + + #CSS + ''' + self.checkbox.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; } \ + ") + ''' + + return self.checkbox + #return self.checkgroupbtn + + def enableBox(self): + if self.checkAC.isChecked(): + self.acbox.setDisabled(False) + self.dcbox.setDisabled(True) + self.trbox.setDisabled(True) + elif self.checkDC.isChecked(): + self.dcbox.setDisabled(False) + self.acbox.setDisabled(True) + self.trbox.setDisabled(True) + + elif self.checkTRAN.isChecked(): + self.trbox.setDisabled(False) + self.acbox.setDisabled(True) + self.dcbox.setDisabled(True) def createACgroup(self): @@ -63,17 +104,15 @@ class Analysis(QtGui.QWidget): self.btn2 = QtGui.QRadioButton("Radio button 2") self.acgrid.addWidget(self.btn1,0,0) self.acgrid.addWidget(self.btn2,0,1) - - + self.acbox.setDisabled(True) + self.acbox.setLayout(self.acgrid) + + #CSS self.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.acbox.setLayout(self.acgrid) - + return self.acbox def createDCgroup(self): @@ -85,13 +124,15 @@ class Analysis(QtGui.QWidget): self.btn4 = QtGui.QRadioButton("Radio button 4") self.dcgrid.addWidget(self.btn3,0,0) self.dcgrid.addWidget(self.btn4,0,1) + self.dcbox.setDisabled(True) + self.dcbox.setLayout(self.dcgrid) + #CSS self.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.dcbox.setLayout(self.dcgrid) + return self.dcbox @@ -104,12 +145,14 @@ class Analysis(QtGui.QWidget): self.btn6 = QtGui.QRadioButton("Radio button 6") self.trgrid.addWidget(self.btn5,0,0) self.trgrid.addWidget(self.btn6,0,1) + self.trbox.setDisabled(True) + self.trbox.setLayout(self.trgrid) + #CSS self.trbox.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.trbox.setLayout(self.trgrid) + return self.trbox
\ No newline at end of file diff --git a/src/kicadtoNgspice/Analysis.pyc b/src/kicadtoNgspice/Analysis.pyc Binary files differindex 38e29695..3d962e13 100644 --- a/src/kicadtoNgspice/Analysis.pyc +++ b/src/kicadtoNgspice/Analysis.pyc diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py index aeae1210..935f5bb2 100644 --- a/src/kicadtoNgspice/KicadtoNgspice.py +++ b/src/kicadtoNgspice/KicadtoNgspice.py @@ -20,20 +20,27 @@ from PyQt4 import QtGui import Analysis class MainWindow(QtGui.QWidget): + netList = [] def __init__(self): QtGui.QWidget.__init__(self) print "Init Kicad to Ngspice" + #Creating Objects for Analysis,Source and model + + #self.obj_analysis = Analysis.Analysis() + + #Creating GUI for kicadtoNgspice window self.grid = QtGui.QGridLayout(self) self.convertbtn = QtGui.QPushButton("Convert") 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.setLayout(self.grid) self.show() - + def createcreateConvertWidget(self): self.convertWindow = QtGui.QWidget() @@ -66,24 +73,29 @@ class MainWindow(QtGui.QWidget): return self.convertWindow + + -def main(): +def main(args): print "==================================" print "Kicad to Ngspice netlist converter " print "==================================" - #kicadNetlist = sys.argv[1] - - + #print "The passed netlist file is ",sys.argv[1] -if __name__ == '__main__': app = QtGui.QApplication(sys.argv) - app.setApplicationName("KicadToNgspice") - app.setQuitOnLastWindowClosed(True) - window = MainWindow() - main() + #app.setApplicationName("KicadToNgspice") + #app.setQuitOnLastWindowClosed(True) + kingWindow = MainWindow() + kingWindow.show() sys.exit(app.exec_()) +if __name__ == '__main__': + main(sys.argv) + + + +
\ No newline at end of file diff --git a/src/kicadtoNgspice/KicadtoNgspice.pyc b/src/kicadtoNgspice/KicadtoNgspice.pyc Binary files differindex a5f370c5..f0da8737 100644 --- a/src/kicadtoNgspice/KicadtoNgspice.pyc +++ b/src/kicadtoNgspice/KicadtoNgspice.pyc diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py index ec2932a0..47a65c73 100644 --- a/src/projManagement/Kicad.py +++ b/src/projManagement/Kicad.py @@ -101,6 +101,14 @@ class Kicad: #Cheking if project has .cir file or not if self.obj_validation.validateCir(self.projDir): print "CIR file present" + self.projName = os.path.basename(self.projDir) + self.project = os.path.join(self.projDir,self.projName) + + #Creating a command to run + self.cmd = "python /home/fahim/Workspace/eSim/src/kicadtoNgspice/KicadtoNgspice.py "+self.project+".cir " + self.obj_workThread = Worker.WorkerThread(self.cmd) + self.obj_workThread.start() + else: self.msg = QtGui.QErrorMessage(None) self.msg.showMessage('Your project do not contain any Kicad netlist file for conversion') diff --git a/src/projManagement/Kicad.pyc b/src/projManagement/Kicad.pyc Binary files differindex 5b498b30..64f17fea 100644 --- a/src/projManagement/Kicad.pyc +++ b/src/projManagement/Kicad.pyc |