summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/createKicadLibrary.py8
-rwxr-xr-xsrc/ngspice_ghdl.py20
2 files changed, 16 insertions, 12 deletions
diff --git a/src/createKicadLibrary.py b/src/createKicadLibrary.py
index 662f702..b66d487 100644
--- a/src/createKicadLibrary.py
+++ b/src/createKicadLibrary.py
@@ -10,7 +10,7 @@ class AutoSchematic(QtGui.QWidget):
def __init__(self, modelname):
QtGui.QWidget.__init__(self)
self.modelname = modelname.split('.')[0]
- self.template = Appconfig.kicad_lib_template
+ self.template = Appconfig.kicad_lib_template.copy()
self.xml_loc = Appconfig.xml_loc
self.lib_loc = Appconfig.lib_loc
self.kicad_nghdl_lib = '/usr/share/kicad/library/eSim_Nghdl.lib'
@@ -125,7 +125,7 @@ class AutoSchematic(QtGui.QWidget):
lib_file = open(self.kicad_nghdl_lib,"a")
line1 = self.template["start_def"]
line1 = line1.split()
- line1 = [w.replace('comp_name', self.modelname) for w in line1]
+ line1 = [w.replace('comp_name', self.modelname) for w in line1]
self.template["start_def"] = ' '.join(line1)
if os.stat(self.kicad_nghdl_lib).st_size == 0:
lib_file.write("EESchema-LIBRARY Version 2.3"+ "\n\n")
@@ -198,7 +198,7 @@ class AutoSchematic(QtGui.QWidget):
os.chdir(cwd)
print 'Leaving directory, ', self.lib_loc
- QtGui.QMessageBox.information(self, "Library added", '''Library details for this model is added to the <b>eSim-kicad.lib</b> in the home directory''', QtGui.QMessageBox.Ok)
+ QtGui.QMessageBox.information(self, "Library added", '''Library details for this model is added to the <b>eSim_Nghdl.lib</b> in the KiCad shared directory''', QtGui.QMessageBox.Ok)
class PortInfo:
@@ -232,5 +232,3 @@ class PortInfo:
self.input_len = len(self.bit_list)
for out_list in output_list:
self.bit_list.append(out_list[2])
-
-
diff --git a/src/ngspice_ghdl.py b/src/ngspice_ghdl.py
index 0bb15a4..a4c3637 100755
--- a/src/ngspice_ghdl.py
+++ b/src/ngspice_ghdl.py
@@ -31,6 +31,7 @@ class Mainwindow(QtGui.QWidget):
#Printing LICENCE file on terminal
fileopen = open(self.licensefile, 'r')
print fileopen.read()
+ fileopen.close()
self.file_list = [] #to keep the supporting files
self.initUI()
@@ -75,7 +76,6 @@ class Mainwindow(QtGui.QWidget):
self.show()
-
def closeWindow(self):
try:
self.process.close()
@@ -84,12 +84,14 @@ class Mainwindow(QtGui.QWidget):
print "Close button clicked"
quit()
+
def browseFile(self):
print "Browse button clicked"
self.filename = QtGui.QFileDialog.getOpenFileName(self, 'Open File', '.')
self.ledit.setText(self.filename)
print "Vhdl file uploaded to process :", self.filename
+
def addFiles(self):
print "Starts adding supporting files"
title = self.addbtn.text()
@@ -137,13 +139,11 @@ class Mainwindow(QtGui.QWidget):
else:
print "Exiting application"
quit()
-
-
-
else:
print "Creating model "+self.modelname+" directory"
os.mkdir(self.modelname)
+
def addingModelInModpath(self):
print "Adding Model "+self.modelname+" in Modpath file "+self.digital_home
#Adding name of model in the modpath file
@@ -222,6 +222,7 @@ class Mainwindow(QtGui.QWidget):
cmd = " make"
print "Running Make command in "+self.release_home
path = os.getcwd()
+ self.process = QtCore.QProcess(self)
self.process.start(cmd)
self.process.setProcessChannelMode(QtCore.QProcess.MergedChannels)
QtCore.QObject.connect(self.process, QtCore.SIGNAL("readyReadStandardOutput()"), self, QtCore.SLOT("readStdOutput()"))
@@ -231,6 +232,7 @@ class Mainwindow(QtGui.QWidget):
print "There is error in 'make' "
quit()
+
def runMakeInstall(self):
print "run Make Install Called"
try:
@@ -241,8 +243,10 @@ class Mainwindow(QtGui.QWidget):
self.process.close()
except:
pass
- self.process.finished.connect(self.createSchematicLib)
+
+ self.process = QtCore.QProcess(self)
self.process.start(cmd)
+ self.process.finished.connect(self.createSchematicLib)
self.process.setProcessChannelMode(QtCore.QProcess.MergedChannels)
QtCore.QObject.connect(self.process, QtCore.SIGNAL("readyReadStandardOutput()"), self, QtCore.SLOT("readStdOutput()"))
os.chdir(self.cur_dir)
@@ -251,11 +255,13 @@ class Mainwindow(QtGui.QWidget):
print "There is error during in 'make install' "
quit()
+
def createSchematicLib(self):
if Appconfig.esimFlag == 1:
print 'Creating library files.................................'
- self.schematicLib = AutoSchematic(self.modelname)
- self.schematicLib.createKicadLibrary()
+ schematicLib = AutoSchematic(self.modelname)
+ schematicLib.createKicadLibrary()
+
def uploadModle(self):
print "Upload button clicked"