summaryrefslogtreecommitdiff
path: root/src/kicadtoNgspice
diff options
context:
space:
mode:
authorfahim2015-05-15 17:51:50 +0530
committerfahim2015-05-15 17:51:50 +0530
commita341c872157b497306e964c4407b012774cc0597 (patch)
tree22ade101e6e0e40109ba3dfc6dba8c4ae21ecb3e /src/kicadtoNgspice
parentb02da14912ca9bf756db0828d6d94d1d732d8476 (diff)
downloadeSim-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.pycbin11759 -> 11738 bytes
-rw-r--r--src/kicadtoNgspice/Convert.pycbin11437 -> 11395 bytes
-rw-r--r--src/kicadtoNgspice/DeviceModel.pycbin4836 -> 4832 bytes
-rw-r--r--src/kicadtoNgspice/KicadtoNgspice.py69
-rw-r--r--src/kicadtoNgspice/Model.pycbin1948 -> 1945 bytes
-rw-r--r--src/kicadtoNgspice/Processing.pycbin8494 -> 8485 bytes
-rw-r--r--src/kicadtoNgspice/Source.pycbin4004 -> 4000 bytes
-rw-r--r--src/kicadtoNgspice/TrackWidget.pycbin889 -> 887 bytes
8 files changed, 37 insertions, 32 deletions
diff --git a/src/kicadtoNgspice/Analysis.pyc b/src/kicadtoNgspice/Analysis.pyc
index 31c7d222..ccbb0cc3 100644
--- a/src/kicadtoNgspice/Analysis.pyc
+++ b/src/kicadtoNgspice/Analysis.pyc
Binary files differ
diff --git a/src/kicadtoNgspice/Convert.pyc b/src/kicadtoNgspice/Convert.pyc
index bb1cffde..cb17c4cd 100644
--- a/src/kicadtoNgspice/Convert.pyc
+++ b/src/kicadtoNgspice/Convert.pyc
Binary files differ
diff --git a/src/kicadtoNgspice/DeviceModel.pyc b/src/kicadtoNgspice/DeviceModel.pyc
index 94e4054e..934c694f 100644
--- a/src/kicadtoNgspice/DeviceModel.pyc
+++ b/src/kicadtoNgspice/DeviceModel.pyc
Binary files differ
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
index 4ed30220..39ddfc27 100644
--- a/src/kicadtoNgspice/Model.pyc
+++ b/src/kicadtoNgspice/Model.pyc
Binary files differ
diff --git a/src/kicadtoNgspice/Processing.pyc b/src/kicadtoNgspice/Processing.pyc
index 1542143d..2b8c5301 100644
--- a/src/kicadtoNgspice/Processing.pyc
+++ b/src/kicadtoNgspice/Processing.pyc
Binary files differ
diff --git a/src/kicadtoNgspice/Source.pyc b/src/kicadtoNgspice/Source.pyc
index a3eb39eb..a634f8ad 100644
--- a/src/kicadtoNgspice/Source.pyc
+++ b/src/kicadtoNgspice/Source.pyc
Binary files differ
diff --git a/src/kicadtoNgspice/TrackWidget.pyc b/src/kicadtoNgspice/TrackWidget.pyc
index e23bacc4..7f819d81 100644
--- a/src/kicadtoNgspice/TrackWidget.pyc
+++ b/src/kicadtoNgspice/TrackWidget.pyc
Binary files differ