From 7487165277160685f2f3dc1f27bfe4bac4c9df68 Mon Sep 17 00:00:00 2001 From: PSR0001 Date: Fri, 16 Jun 2023 23:42:28 +0530 Subject: Update KiCad symbol template --- src/Appconfig.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Appconfig.py b/src/Appconfig.py index d03dcc3..a53fee5 100644 --- a/src/Appconfig.py +++ b/src/Appconfig.py @@ -23,16 +23,18 @@ class Appconfig: parser_nghdl = ConfigParser() parser_nghdl.read(os.path.join(home, os.path.join('.nghdl', 'config.ini'))) - kicad_lib_template = { - "start_def": "DEF comp_name U 0 40 Y Y 1 F N", - "U_field": "F0 \"U\" 2850 1800 60 H V C CNN", - "comp_name_field": "F1 \"comp_name\" 2850 2000 60 H V C CNN", - "blank_field": ["F2 blank_quotes 2850 1950 60 H V C CNN", - "F3 blank_quotes 2850 1950 60 H V C CNN"], - "start_draw": "DRAW", - "draw_pos": "S 2550 2100 3150 1800 0 1 0 N", - "input_port": "X in 1 2350 2000 200 R 50 50 1 1 I", - "output_port": "X out 2 3350 2000 200 L 50 50 1 1 O", - "end_draw": "ENDDRAW", - "end_def": "ENDDEF" + # KiCad V6 Symbol Template + kicad_sym_template = { + "start_def": "(symbol \"comp_name\" (pin_names (offset 1.016)) (in_bom yes) (on_board yes)", + "U_field":"(property \"Reference\" \"U\" (id 0) (at 6 7 0)(effects (font (size 1.524 1.524))))", + "comp_name_field":"(property \"Value\" \"comp_name\" (id 1) (at 8 10 0)(effects (font (size 1.524 1.524))))", + "blank_field": [ + "(property \"Footprint\" blank_quotes (id 2) (at 72.39 49.53 0)(effects (font (size 1.524 1.524))))", + "(property \"Datasheet\" blank_quotes (id 3) (at 72.39 49.53 0)(effects (font (size 1.524 1.524))))" + ], + "draw_pos": "(symbol \"comp_name\"(rectangle (start 0 0 ) (end 15.25 2 )(stroke (width 0) (type default) (color 0 0 0 0))(fill (type none))))", + "start_draw":"(symbol", + "input_port":"(pin input line(at -5.15 0.54 0 )(length 5.08 )(name \"in\" (effects(font(size 1.27 1.27))))(number \"1\" (effects (font (size 1.27 1.27)))))", + "output_port": "(pin output line(at 20.38 0.54 180 )(length 5.08 )(name \"out\" (effects(font(size 1.27 1.27))))(number \"2\" (effects (font (size 1.27 1.27)))))", + "end_draw":"))" } -- cgit From f54e0867d3cb568510c222e1045fe78d8bc5bf18 Mon Sep 17 00:00:00 2001 From: PSR0001 Date: Fri, 16 Jun 2023 23:43:14 +0530 Subject: Porting kicad v4 to v6 & Coordinate issue solved --- src/createKicadLibrary.py | 93 ++++++++++++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 37 deletions(-) diff --git a/src/createKicadLibrary.py b/src/createKicadLibrary.py index ae44c03..911659e 100644 --- a/src/createKicadLibrary.py +++ b/src/createKicadLibrary.py @@ -11,16 +11,16 @@ class AutoSchematic(QtWidgets.QWidget): QtWidgets.QWidget.__init__(self) self.parent = parent self.modelname = modelname.split('.')[0] - self.template = Appconfig.kicad_lib_template.copy() + self.template = Appconfig.kicad_sym_template.copy() self.xml_loc = Appconfig.xml_loc self.lib_loc = Appconfig.lib_loc if os.name == 'nt': eSim_src = Appconfig.src_home inst_dir = eSim_src.replace('\\eSim', '') self.kicad_nghdl_lib = \ - inst_dir + '/KiCad/share/kicad/library/eSim_Nghdl.lib' + inst_dir + '/KiCad/share/kicad/symbols/eSim_Nghdl.kicad_sym' else: - self.kicad_nghdl_lib = '/usr/share/kicad/library/eSim_Nghdl.lib' + self.kicad_nghdl_lib = '/usr/share/kicad/symbols/eSim_Nghdl.kicad_sym' self.parser = Appconfig.parser_nghdl def createKicadLibrary(self): @@ -62,12 +62,14 @@ class AutoSchematic(QtWidgets.QWidget): # quit() + # getting the port information here def getPortInformation(self): portInformation = PortInfo(self) portInformation.getPortInfo() self.portInfo = portInformation.bit_list self.input_length = portInformation.input_len + # creating the XML files in eSim /library/modelParamXML/Nghdl def createXML(self): cwd = os.getcwd() xmlDestination = os.path.join(self.xml_loc, 'Nghdl') @@ -110,7 +112,8 @@ class AutoSchematic(QtWidgets.QWidget): def char_sum(self, ls): return sum([int(x) for x in ls]) - + + # removing the old library def removeOldLibrary(self): cwd = os.getcwd() os.chdir(self.lib_loc) @@ -123,44 +126,53 @@ class AutoSchematic(QtWidgets.QWidget): line_reading_flag = False for line in lines: - if line.startswith("DEF"): - if line.split()[1] == self.modelname: + if line.startswith("(symbol"): # Eeschema Template start + if line.split()[1] == f"\"{self.modelname}\"": line_reading_flag = True if not line_reading_flag: output.append(line) - if line.startswith("ENDDEF"): + if line.startswith("))"): # Eeschema Template end line_reading_flag = False f = open(self.kicad_nghdl_lib, 'w') for line in output: f.write(line) - + f.close() os.chdir(cwd) print("Leaving directory, ", self.lib_loc) def createLib(self): - self.dist_port = 100 # Distance between two ports - self.inc_size = 100 # Increment size of a block + self.dist_port = 2.54 # Distance between two ports(mil) + self.inc_size = 2.54 # Increment size of a block(mil) cwd = os.getcwd() os.chdir(self.lib_loc) print("Changing directory to ", self.lib_loc) + # Removeing ")" from "eSim_Ngveri.kicad_sym" + file = open(self.kicad_nghdl_lib,"r") + content_file = file.read() + new_content_file=content_file[:-1] + file.close() + file = open(self.kicad_nghdl_lib,"w") + file.write(new_content_file) + file.close() + + # Appending New Schematic 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] 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") - # lib_file.write("#encoding utf-8"+ "\n"+ "#"+ "\n" + - # "#test_compo" + "\n"+ "#"+ "\n") + lib_file.write("(kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor)" + "\n\n") # Eeschema startar code + lib_file.write( self.template["start_def"] + "\n" + self.template["U_field"]+"\n" ) line3 = self.template["comp_name_field"] line3 = line3.split() - line3 = [w.replace('comp_name', self.modelname) for w in line3] + line3 = [w.replace('comp_name', self.modelname) for w in line3] self.template["comp_name_field"] = ' '.join(line3) lib_file.write(self.template["comp_name_field"] + "\n") @@ -176,19 +188,22 @@ class AutoSchematic(QtWidgets.QWidget): line4[1] = ' '.join(line4_2) self.template["blank_qoutes"] = line4 - lib_file.write( - line4[0] + "\n" + line4[1] + "\n" + - self.template["start_draw"] + "\n" - ) + lib_file.write(line4[0] + "\n" + line4[1] + "\n") draw_pos = self.template["draw_pos"] draw_pos = draw_pos.split() - draw_pos[4] = str( - int(draw_pos[4]) - self.findBlockSize() * self.inc_size) - self.template["draw_pos"] = ' '.join(draw_pos) + + draw_pos= [w.replace('comp_name', f"{self.modelname}_0_1") for w in draw_pos] + draw_pos[8] = str(float(draw_pos[8]) + float(self.findBlockSize() * self.inc_size)) + draw_pos_rec= draw_pos[8] - lib_file.write(self.template["draw_pos"]+"\n") + self.template["draw_pos"] = ' '.join(draw_pos) + lib_file.write( + self.template["draw_pos"] + "\n"+ + self.template["start_draw"] + " \""+ f"{self.modelname}_1_1\""+ "\n" + ) + input_port = self.template["input_port"] input_port = input_port.split() output_port = self.template["output_port"] @@ -196,9 +211,9 @@ class AutoSchematic(QtWidgets.QWidget): inputs = self.portInfo[0: self.input_length] outputs = self.portInfo[self.input_length:] - print("INPUTS AND OUTPUTS ") - print(inputs) - print(outputs) + #print("INPUTS AND OUTPUTS ") + #print(inputs) + #print(outputs) inputs = self.char_sum(inputs) outputs = self.char_sum(outputs) @@ -206,39 +221,43 @@ class AutoSchematic(QtWidgets.QWidget): total = inputs+outputs port_list = [] - + + # Set input & output port + input_port[4] = draw_pos_rec + output_port[4] =draw_pos_rec + for i in range(total): if (i < inputs): - input_port[1] = "in" + str(i + 1) - input_port[2] = str(i + 1) - input_port[4] = str(int(input_port[4]) - self.dist_port) + input_port[9] = f"\"in{str(i + 1)}\"" + input_port[13] = f"\"{str(i + 1)}\"" + input_port[4] = str(float(input_port[4]) - float(self.dist_port)) input_list = ' '.join(input_port) port_list.append(input_list) else: - output_port[1] = "out" + str(i - inputs + 1) - output_port[2] = str(i + 1) - output_port[4] = str(int(output_port[4]) - self.dist_port) + output_port[9] = f"\"out{str(i - inputs + 1)}\"" + output_port[13] = f"\"{str(i + 1)}\"" + output_port[4] = str(float(output_port[4]) - float(self.dist_port)) output_list = ' '.join(output_port) port_list.append(output_list) for ports in port_list: lib_file.write(ports+"\n") lib_file.write( - self.template["end_draw"] + "\n" + - self.template["end_def"] + "\n\n\n" + self.template["end_draw"] + "\n\n"+")" ) - + lib_file.close() os.chdir(cwd) + print('Leaving directory, ', self.lib_loc) QtWidgets.QMessageBox.information( self.parent, "Library added", '''Library details for this model is added to the ''' + - '''eSim_Nghdl.lib in the KiCad shared directory''', + '''eSim_Nghdl.kicad_sym in the KiCad shared directory''', QtWidgets.QMessageBox.Ok ) - +# beginning the PortInfo Class containing Port Information class PortInfo: def __init__(self, model): self.modelname = model.modelname -- cgit From 8a9b02d77e76a547ed807c305853a153f481df06 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Thu, 29 Jun 2023 18:50:40 +0530 Subject: refactored names with kicad6 conventions --- src/Appconfig.py | 33 +++++++---- src/createKicadLibrary.py | 141 ++++++++++++++++++++++++++-------------------- src/ngspice_ghdl.py | 2 +- 3 files changed, 102 insertions(+), 74 deletions(-) diff --git a/src/Appconfig.py b/src/Appconfig.py index a53fee5..dee57a8 100644 --- a/src/Appconfig.py +++ b/src/Appconfig.py @@ -25,16 +25,27 @@ class Appconfig: # KiCad V6 Symbol Template kicad_sym_template = { - "start_def": "(symbol \"comp_name\" (pin_names (offset 1.016)) (in_bom yes) (on_board yes)", - "U_field":"(property \"Reference\" \"U\" (id 0) (at 6 7 0)(effects (font (size 1.524 1.524))))", - "comp_name_field":"(property \"Value\" \"comp_name\" (id 1) (at 8 10 0)(effects (font (size 1.524 1.524))))", + "start_def": "(symbol \"comp_name\" (pin_names (offset 1.016)) " + + "(in_bom yes) (on_board yes)", + "U_field": "(property \"Reference\" \"U\" (id 0) (at 6 7 0)" + + "(effects (font (size 1.524 1.524))))", + "comp_name_field": "(property \"Value\" \"comp_name\" (id 1) " + + "(at 8 10 0)(effects (font (size 1.524 1.524))))", "blank_field": [ - "(property \"Footprint\" blank_quotes (id 2) (at 72.39 49.53 0)(effects (font (size 1.524 1.524))))", - "(property \"Datasheet\" blank_quotes (id 3) (at 72.39 49.53 0)(effects (font (size 1.524 1.524))))" - ], - "draw_pos": "(symbol \"comp_name\"(rectangle (start 0 0 ) (end 15.25 2 )(stroke (width 0) (type default) (color 0 0 0 0))(fill (type none))))", - "start_draw":"(symbol", - "input_port":"(pin input line(at -5.15 0.54 0 )(length 5.08 )(name \"in\" (effects(font(size 1.27 1.27))))(number \"1\" (effects (font (size 1.27 1.27)))))", - "output_port": "(pin output line(at 20.38 0.54 180 )(length 5.08 )(name \"out\" (effects(font(size 1.27 1.27))))(number \"2\" (effects (font (size 1.27 1.27)))))", - "end_draw":"))" + "(property \"Footprint\" blank_quotes (id 2) " + + "(at 72.39 49.53 0)(effects (font (size 1.524 1.524))))", + "(property \"Datasheet\" blank_quotes (id 3) " + + "(at 72.39 49.53 0)(effects (font (size 1.524 1.524))))" + ], + "draw_pos": "(symbol \"comp_name\"(rectangle (start 0 0 ) " + + "(end 15.25 2 )(stroke (width 0) (type default) " + + "(color 0 0 0 0))(fill (type none))))", + "start_draw": "(symbol", + "input_port": "(pin input line(at -5.15 0.54 0 )(length 5.08 )" + + "(name \"in\" (effects(font(size 1.27 1.27))))" + + "(number \"1\" (effects (font (size 1.27 1.27)))))", + "output_port": "(pin output line(at 20.38 0.54 180 )(length 5.08 )" + + "(name \"out\" (effects(font(size 1.27 1.27))))" + + "(number \"2\" (effects (font (size 1.27 1.27)))))", + "end_draw": "))" } diff --git a/src/createKicadLibrary.py b/src/createKicadLibrary.py index 911659e..7bbb8c5 100644 --- a/src/createKicadLibrary.py +++ b/src/createKicadLibrary.py @@ -17,13 +17,14 @@ class AutoSchematic(QtWidgets.QWidget): if os.name == 'nt': eSim_src = Appconfig.src_home inst_dir = eSim_src.replace('\\eSim', '') - self.kicad_nghdl_lib = \ + self.kicad_nghdl_sym = \ inst_dir + '/KiCad/share/kicad/symbols/eSim_Nghdl.kicad_sym' else: - self.kicad_nghdl_lib = '/usr/share/kicad/symbols/eSim_Nghdl.kicad_sym' + self.kicad_nghdl_sym = \ + '/usr/share/kicad/symbols/eSim_Nghdl.kicad_sym' self.parser = Appconfig.parser_nghdl - def createKicadLibrary(self): + def createKicadSymbol(self): xmlFound = None for root, dirs, files in os.walk(self.xml_loc): if (str(self.modelname) + '.xml') in files: @@ -32,7 +33,7 @@ class AutoSchematic(QtWidgets.QWidget): if xmlFound is None: self.getPortInformation() self.createXML() - self.createLib() + self.createSym() elif (xmlFound == os.path.join(self.xml_loc, 'Nghdl')): print('Library already exists...') ret = QtWidgets.QMessageBox.warning( @@ -46,8 +47,8 @@ class AutoSchematic(QtWidgets.QWidget): print("Overwriting existing libraries") self.getPortInformation() self.createXML() - self.removeOldLibrary() # Removes the exisitng library - self.createLib() + self.removeOldLibrary() # Removes the existng library + self.createSym() else: print("Exiting Nghdl") quit() @@ -56,21 +57,25 @@ class AutoSchematic(QtWidgets.QWidget): ret = QtWidgets.QMessageBox.critical( self.parent, "Error", '''A standard library already ''' + '''exists with this name.
Please change the ''' + - '''name of your vhdl file and upload it again''', + '''name of your vhdl file and upload it again.''', QtWidgets.QMessageBox.Ok ) # quit() - # getting the port information here def getPortInformation(self): + ''' + getting the port information here + ''' portInformation = PortInfo(self) portInformation.getPortInfo() self.portInfo = portInformation.bit_list self.input_length = portInformation.input_len - # creating the XML files in eSim /library/modelParamXML/Nghdl def createXML(self): + ''' + creating the XML files in eSim /library/modelParamXML/Nghdl + ''' cwd = os.getcwd() xmlDestination = os.path.join(self.xml_loc, 'Nghdl') self.splitText = "" @@ -102,8 +107,10 @@ class AutoSchematic(QtWidgets.QWidget): print("Leaving the directory ", xmlDestination) os.chdir(cwd) - # Calculates the maximum between input and output ports def findBlockSize(self): + ''' + Calculates the maximum between input and output ports + ''' ind = self.input_length return max( self.char_sum(self.portInfo[:ind]), @@ -112,70 +119,76 @@ class AutoSchematic(QtWidgets.QWidget): def char_sum(self, ls): return sum([int(x) for x in ls]) - - # removing the old library + def removeOldLibrary(self): + ''' + removing the old library + ''' cwd = os.getcwd() os.chdir(self.lib_loc) print("Changing directory to ", self.lib_loc) - f = open(self.kicad_nghdl_lib) - lines = f.readlines() - f.close() + sym_file = open(self.kicad_nghdl_sym) + lines = sym_file.readlines() + sym_file.close() output = [] line_reading_flag = False for line in lines: - if line.startswith("(symbol"): # Eeschema Template start + if line.startswith("(symbol"): # Eeschema template start if line.split()[1] == f"\"{self.modelname}\"": line_reading_flag = True if not line_reading_flag: output.append(line) - if line.startswith("))"): # Eeschema Template end + if line.startswith("))"): # Eeschema template end line_reading_flag = False - f = open(self.kicad_nghdl_lib, 'w') + sym_file = open(self.kicad_nghdl_sym, 'w') for line in output: - f.write(line) - f.close() + sym_file.write(line) + sym_file.close() os.chdir(cwd) print("Leaving directory, ", self.lib_loc) - def createLib(self): - self.dist_port = 2.54 # Distance between two ports(mil) - self.inc_size = 2.54 # Increment size of a block(mil) + def createSym(self): + self.dist_port = 2.54 # Distance between two ports (mil) + self.inc_size = 2.54 # Increment size of a block (mil) cwd = os.getcwd() os.chdir(self.lib_loc) print("Changing directory to ", self.lib_loc) - # Removeing ")" from "eSim_Ngveri.kicad_sym" - file = open(self.kicad_nghdl_lib,"r") + # Removing ")" from "eSim_Nghdl.kicad_sym" + file = open(self.kicad_nghdl_sym, "r") content_file = file.read() - new_content_file=content_file[:-1] + new_content_file = content_file[:-1] file.close() - file = open(self.kicad_nghdl_lib,"w") + file = open(self.kicad_nghdl_sym, "w") file.write(new_content_file) file.close() - # Appending New Schematic - lib_file = open(self.kicad_nghdl_lib, "a") + # Appending new schematic block + sym_file = open(self.kicad_nghdl_sym, "a") line1 = self.template["start_def"] line1 = line1.split() 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("(kicad_symbol_lib (version 20211014) (generator kicad_symbol_editor)" + "\n\n") # Eeschema startar code - lib_file.write( - self.template["start_def"] + "\n" + self.template["U_field"]+"\n" + if os.stat(self.kicad_nghdl_sym).st_size == 0: + sym_file.write( + "(kicad_symbol_lib (version 20211014) " + + "(generator kicad_symbol_editor)" + "\n\n" + ) # Eeschema starter code + + sym_file.write( + self.template["start_def"] + "\n" + self.template["U_field"] + "\n" ) line3 = self.template["comp_name_field"] line3 = line3.split() - line3 = [w.replace('comp_name', self.modelname) for w in line3] + line3 = [w.replace('comp_name', self.modelname) for w in line3] self.template["comp_name_field"] = ' '.join(line3) - lib_file.write(self.template["comp_name_field"] + "\n") + sym_file.write(self.template["comp_name_field"] + "\n") line4 = self.template["blank_field"] line4_1 = line4[0] @@ -188,22 +201,25 @@ class AutoSchematic(QtWidgets.QWidget): line4[1] = ' '.join(line4_2) self.template["blank_qoutes"] = line4 - lib_file.write(line4[0] + "\n" + line4[1] + "\n") + sym_file.write(line4[0] + "\n" + line4[1] + "\n") draw_pos = self.template["draw_pos"] draw_pos = draw_pos.split() - - draw_pos= [w.replace('comp_name', f"{self.modelname}_0_1") for w in draw_pos] - draw_pos[8] = str(float(draw_pos[8]) + float(self.findBlockSize() * self.inc_size)) - draw_pos_rec= draw_pos[8] + + draw_pos = \ + [w.replace('comp_name', f"{self.modelname}_0_1") for w in draw_pos] + draw_pos[8] = str( + float(draw_pos[8]) + float(self.findBlockSize() * self.inc_size) + ) + draw_pos_rec = draw_pos[8] self.template["draw_pos"] = ' '.join(draw_pos) - lib_file.write( - self.template["draw_pos"] + "\n"+ - self.template["start_draw"] + " \""+ f"{self.modelname}_1_1\""+ "\n" + sym_file.write( + self.template["draw_pos"] + "\n" + self.template["start_draw"] + + " \"" + f"{self.modelname}_1_1\"" + "\n" ) - + input_port = self.template["input_port"] input_port = input_port.split() output_port = self.template["output_port"] @@ -211,54 +227,55 @@ class AutoSchematic(QtWidgets.QWidget): 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 + total = inputs + outputs port_list = [] - + # Set input & output port input_port[4] = draw_pos_rec - output_port[4] =draw_pos_rec - + output_port[4] = draw_pos_rec + for i in range(total): if (i < inputs): input_port[9] = f"\"in{str(i + 1)}\"" input_port[13] = f"\"{str(i + 1)}\"" - input_port[4] = str(float(input_port[4]) - float(self.dist_port)) + input_port[4] = \ + str(float(input_port[4]) - float(self.dist_port)) input_list = ' '.join(input_port) port_list.append(input_list) else: output_port[9] = f"\"out{str(i - inputs + 1)}\"" output_port[13] = f"\"{str(i + 1)}\"" - output_port[4] = str(float(output_port[4]) - float(self.dist_port)) + output_port[4] = \ + str(float(output_port[4]) - float(self.dist_port)) output_list = ' '.join(output_port) port_list.append(output_list) for ports in port_list: - lib_file.write(ports+"\n") - lib_file.write( - self.template["end_draw"] + "\n\n"+")" + sym_file.write(ports + "\n") + sym_file.write( + self.template["end_draw"] + "\n\n" + ")" ) - lib_file.close() + sym_file.close() os.chdir(cwd) print('Leaving directory, ', self.lib_loc) QtWidgets.QMessageBox.information( - self.parent, "Library added", - '''Library details for this model is added to the ''' + - '''eSim_Nghdl.kicad_sym in the KiCad shared directory''', + self.parent, "Symbol Added", + '''Symbol details for this model is added to the \'''' + + '''eSim_Nghdl.kicad_sym\' in the KiCad shared directory.''', QtWidgets.QMessageBox.Ok ) -# beginning the PortInfo Class containing Port Information + class PortInfo: + ''' + The class contains port information + ''' def __init__(self, model): self.modelname = model.modelname self.model_loc = os.path.join( diff --git a/src/ngspice_ghdl.py b/src/ngspice_ghdl.py index e358706..663c491 100755 --- a/src/ngspice_ghdl.py +++ b/src/ngspice_ghdl.py @@ -320,7 +320,7 @@ class Mainwindow(QtWidgets.QWidget): if not self.errorFlag: print('Creating library files................................') schematicLib = AutoSchematic(self, self.modelname) - schematicLib.createKicadLibrary() + schematicLib.createKicadSymbol() else: QtWidgets.QMessageBox.critical( self, 'Error', '''Cannot create Schematic Library of ''' + -- cgit