(fileName, cirTitle, language="SLiCAP")
| 212 | print("Error: could not open: '{}'.".format(fileName)) |
| 213 | |
| 214 | def _kicadNetlist(fileName, cirTitle, language="SLiCAP"): |
| 215 | if ini.kicad == "": |
| 216 | print("Please install KiCad, delete '~/SLiCAP.ini', and run this script again.") |
| 217 | elif os.path.isfile(fileName): |
| 218 | print("Creating netlist of {} using KiCAD".format(fileName)) |
| 219 | kicadnetlist = fileName.split('.')[0] + '.net' |
| 220 | subprocess.run([ini.kicad, 'sch', 'export', 'netlist', '-o', kicadnetlist, fileName]) |
| 221 | f = open(kicadnetlist, "r") |
| 222 | lines = f.readlines() |
| 223 | f.close() |
| 224 | netlist, subckt, subckt_lib = _parseKiCADnetlistlines(lines, cirTitle, language=language) |
| 225 | if subckt: |
| 226 | f = open(ini.user_lib_path + subckt + ".lib", "w") |
| 227 | f.write(netlist) |
| 228 | f.close() |
| 229 | else: |
| 230 | cirName = fileName.split('/')[-1].split('.')[0]+ ".cir" |
| 231 | cirFile = ini.cir_path + cirName |
| 232 | f = open(cirFile, 'w') |
| 233 | f.write(netlist) |
| 234 | f.close() |
| 235 | KiCADsch2svg(fileName) |
| 236 | else: |
| 237 | print("Error: could not open: '{}'.".format(fileName)) |
| 238 | return netlist, subckt |
| 239 | |
| 240 | def backAnnotateSchematic(sch, opinfo): |
| 241 | """ |
no test coverage detected