diff options
author | fahim | 2015-05-15 17:51:50 +0530 |
---|---|---|
committer | fahim | 2015-05-15 17:51:50 +0530 |
commit | a341c872157b497306e964c4407b012774cc0597 (patch) | |
tree | 22ade101e6e0e40109ba3dfc6dba8c4ae21ecb3e /src/kicadtoNgspice | |
parent | b02da14912ca9bf756db0828d6d94d1d732d8476 (diff) | |
download | eSim-a341c872157b497306e964c4407b012774cc0597.tar.gz eSim-a341c872157b497306e964c4407b012774cc0597.tar.bz2 eSim-a341c872157b497306e964c4407b012774cc0597.zip |
Subject: Update KicadToNgSpice Converter file
Description: Added proper GUI for error message in case of unknown model
used in schematic or multiple model is available in modelParamXML
directory.
Diffstat (limited to 'src/kicadtoNgspice')
-rw-r--r-- | src/kicadtoNgspice/Analysis.pyc | bin | 11759 -> 11738 bytes | |||
-rw-r--r-- | src/kicadtoNgspice/Convert.pyc | bin | 11437 -> 11395 bytes | |||
-rw-r--r-- | src/kicadtoNgspice/DeviceModel.pyc | bin | 4836 -> 4832 bytes | |||
-rw-r--r-- | src/kicadtoNgspice/KicadtoNgspice.py | 69 | ||||
-rw-r--r-- | src/kicadtoNgspice/Model.pyc | bin | 1948 -> 1945 bytes | |||
-rw-r--r-- | src/kicadtoNgspice/Processing.pyc | bin | 8494 -> 8485 bytes | |||
-rw-r--r-- | src/kicadtoNgspice/Source.pyc | bin | 4004 -> 4000 bytes | |||
-rw-r--r-- | src/kicadtoNgspice/TrackWidget.pyc | bin | 889 -> 887 bytes |
8 files changed, 37 insertions, 32 deletions
diff --git a/src/kicadtoNgspice/Analysis.pyc b/src/kicadtoNgspice/Analysis.pyc Binary files differindex 31c7d222..ccbb0cc3 100644 --- a/src/kicadtoNgspice/Analysis.pyc +++ b/src/kicadtoNgspice/Analysis.pyc diff --git a/src/kicadtoNgspice/Convert.pyc b/src/kicadtoNgspice/Convert.pyc Binary files differindex bb1cffde..cb17c4cd 100644 --- a/src/kicadtoNgspice/Convert.pyc +++ b/src/kicadtoNgspice/Convert.pyc diff --git a/src/kicadtoNgspice/DeviceModel.pyc b/src/kicadtoNgspice/DeviceModel.pyc Binary files differindex 94e4054e..934c694f 100644 --- a/src/kicadtoNgspice/DeviceModel.pyc +++ b/src/kicadtoNgspice/DeviceModel.pyc diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py index a320e1b2..dbb39ddc 100644 --- a/src/kicadtoNgspice/KicadtoNgspice.py +++ b/src/kicadtoNgspice/KicadtoNgspice.py @@ -30,19 +30,42 @@ import TrackWidget class MainWindow(QtGui.QWidget): """ - This class craete KicadtoNgspice window. - And Call Convert function if convert button is pressed. + This class create KicadtoNgspice window. + And Call Convert function if convert button is pressed. + The convert function takes all the value entered by user and create a final netlist "*.cir.out". + This final netlist is compatible with NgSpice. """ def __init__(self): QtGui.QWidget.__init__(self) #Create object of track widget self.obj_track = TrackWidget.TrackWidget() - - print "Init Kicad to Ngspice" - #print "Current Project",sys.argv[1] - + """ + Checking if any unknown model is used in schematic which is not recognized by NgSpice. + Also if the two model of same name is present under modelParamXML directory + """ + if unknownModelList: + print "Unknown Model List is : ",unknownModelList + self.msg = QtGui.QErrorMessage() + self.content = "Your schematic contain unknown model "+', '.join(unknownModelList) + self.msg.showMessage(self.content) + self.msg.setWindowTitle("Unknown Models") - #Creating GUI for kicadtoNgspice window + elif multipleModelList: + print "Multiple Model List is : ",multipleModelList + self.msg = QtGui.QErrorMessage() + self.mcontent = "Look like you have duplicate model in modelParamXML directory "+', '.join(multipleModelList[0]) + self.msg.showMessage(self.mcontent) + self.msg.setWindowTitle("Multiple Models") + + else: + self.createMainWindow() + + + def createMainWindow(self): + """ + This function create main window of Kicad to Ngspice converter + """ + self.grid = QtGui.QGridLayout(self) self.convertbtn = QtGui.QPushButton("Convert") self.convertbtn.clicked.connect(self.callConvert) @@ -51,11 +74,11 @@ class MainWindow(QtGui.QWidget): self.grid.addWidget(self.createcreateConvertWidget(),0,0) self.grid.addWidget(self.convertbtn,1,1) self.grid.addWidget(self.cancelbtn,1,2) - #self.setGeometry(800, 800, 1000, 1000) self.setWindowState(QtCore.Qt.WindowMaximized) self.setLayout(self.grid) + self.setWindowTitle("Kicad To NgSpice Converter") self.show() - + def createcreateConvertWidget(self): @@ -237,8 +260,7 @@ class MainWindow(QtGui.QWidget): out.close() - - + #Main Function @@ -248,7 +270,6 @@ def main(args): print "==================================" global kicadFile,kicadNetlist,schematicInfo global infoline,optionInfo - #kicadFile = "/home/fahim/eSim-Workspace/BJT_amplifier/BJT_amplifier.cir" kicadFile = sys.argv[1] #Object of Processing @@ -283,7 +304,8 @@ def main(args): print "SCHEMATICINFO",schematicInfo #List storing model detail - global modelList,outputOption + global modelList,outputOption,unknownModelList,multipleModelList + modelList = [] outputOption = [] schematicInfo,outputOption,modelList,unknownModelList,multipleModelList = obj_proc.convertICintoBasicBlocks(schematicInfo,outputOption,modelList) @@ -291,27 +313,10 @@ def main(args): print "Multiple Model List",multipleModelList print "Model List",modelList - - - #Checking for unknown Model List and Multiple Model List - if unknownModelList: - print "ErrorMessage : These Models are not available.Please check it",unknownModelList - sys.exit(2) - else: - if multipleModelList: - print "ErrorMessage: There are multiple model of same name. Please check it",multipleModelList - sys.exit(2) - else: - pass - - - - + app = QtGui.QApplication(args) - #app.setApplicationName("KicadToNgspice") - #app.setQuitOnLastWindowClosed(True) kingWindow = MainWindow() - kingWindow.show() + #kingWindow.show() #No need to call show as we are doing it in createMainWindow sys.exit(app.exec_()) diff --git a/src/kicadtoNgspice/Model.pyc b/src/kicadtoNgspice/Model.pyc Binary files differindex 4ed30220..39ddfc27 100644 --- a/src/kicadtoNgspice/Model.pyc +++ b/src/kicadtoNgspice/Model.pyc diff --git a/src/kicadtoNgspice/Processing.pyc b/src/kicadtoNgspice/Processing.pyc Binary files differindex 1542143d..2b8c5301 100644 --- a/src/kicadtoNgspice/Processing.pyc +++ b/src/kicadtoNgspice/Processing.pyc diff --git a/src/kicadtoNgspice/Source.pyc b/src/kicadtoNgspice/Source.pyc Binary files differindex a3eb39eb..a634f8ad 100644 --- a/src/kicadtoNgspice/Source.pyc +++ b/src/kicadtoNgspice/Source.pyc diff --git a/src/kicadtoNgspice/TrackWidget.pyc b/src/kicadtoNgspice/TrackWidget.pyc Binary files differindex e23bacc4..7f819d81 100644 --- a/src/kicadtoNgspice/TrackWidget.pyc +++ b/src/kicadtoNgspice/TrackWidget.pyc |