From 055431e4bee9a273bd5cff72b4f600033d0d09fb Mon Sep 17 00:00:00 2001 From: Rahul Paknikar Date: Tue, 25 Jun 2019 09:40:43 +0530 Subject: Add files via upload --- src/createKicadLibrary.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/createKicadLibrary.py') diff --git a/src/createKicadLibrary.py b/src/createKicadLibrary.py index bf520d1..d229066 100644 --- a/src/createKicadLibrary.py +++ b/src/createKicadLibrary.py @@ -21,11 +21,12 @@ class AutoSchematic(QtGui.QWidget): for root, dirs, files in os.walk(self.xml_loc): if (str(self.modelname) + '.xml') in files: xmlFound = root + print(xmlFound) if (xmlFound == None): self.getPortInformation() self.createXML() self.createLib() - elif (xmlFound == self.xml_loc + 'Nghdl'): + elif (xmlFound == self.xml_loc + '/Nghdl'): print 'Library already exists...' ret = QtGui.QMessageBox.critical(self, "Critical",'''<b>The Libraries of this model already exist.Do you want to overwrite it?</b><br/> <b>If yes press ok else cancel it and change the name of your vhdl file</b>''', QtGui.QMessageBox.Ok, QtGui.QMessageBox.Cancel) @@ -43,7 +44,7 @@ class AutoSchematic(QtGui.QWidget): ret = QtGui.QMessageBox.critical(self, "Error",'''<b>A standard library already exists in this name.</b><br/> <b>Please change the name of your vhdl file and upload it again</b>''', QtGui.QMessageBox.Ok) - quit() + # quit() def getPortInformation(self): portInformation = PortInfo(self) @@ -164,8 +165,14 @@ class AutoSchematic(QtGui.QWidget): output_port = output_port.split() inputs = self.portInfo[0: self.input_length] outputs = self.portInfo[self.input_length:] + + print "INPUTS AND OUTPUTS " + print inputs + print outputs + inputs = self.char_sum(inputs) outputs= self.char_sum(outputs) + total = inputs+outputs port_list = [] -- cgit From 87ef6248be39816df8a0ef9327c91a4196236330 Mon Sep 17 00:00:00 2001 From: rahul Date: Thu, 24 Oct 2019 10:37:01 +0530 Subject: changed library name and path --- src/createKicadLibrary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/createKicadLibrary.py') diff --git a/src/createKicadLibrary.py b/src/createKicadLibrary.py index d229066..662f702 100644 --- a/src/createKicadLibrary.py +++ b/src/createKicadLibrary.py @@ -13,7 +13,7 @@ class AutoSchematic(QtGui.QWidget): self.template = Appconfig.kicad_lib_template self.xml_loc = Appconfig.xml_loc self.lib_loc = Appconfig.lib_loc - self.kicad_nghdl_lib = 'eSim_kicad.lib' + self.kicad_nghdl_lib = '/usr/share/kicad/library/eSim_Nghdl.lib' self.parser = Appconfig.parser_nghdl def createKicadLibrary(self): @@ -29,7 +29,7 @@ class AutoSchematic(QtGui.QWidget): elif (xmlFound == self.xml_loc + '/Nghdl'): print 'Library already exists...' ret = QtGui.QMessageBox.critical(self, "Critical",'''<b>The Libraries of this model already exist.Do you want to overwrite it?</b><br/> - <b>If yes press ok else cancel it and change the name of your vhdl file</b>''', QtGui.QMessageBox.Ok, QtGui.QMessageBox.Cancel) + <b>If yes, press ok else cancel it and change the name of your vhdl file</b>''', QtGui.QMessageBox.Ok, QtGui.QMessageBox.Cancel) if ret == QtGui.QMessageBox.Ok: print "Overwriting existing libraries" self.getPortInformation() -- cgit From 6e12269c0681dcfb0d1ec927670fb9d69464af9c Mon Sep 17 00:00:00 2001 From: rahul Date: Wed, 13 Nov 2019 15:40:15 +0530 Subject: enabled successive uploads --- src/createKicadLibrary.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/createKicadLibrary.py') 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]) - - -- cgit