diff --git a/mainwindow.py b/mainwindow.py index 551f2c0d..79e57b16 100644 --- a/mainwindow.py +++ b/mainwindow.py @@ -624,6 +624,7 @@ def populate_footprint_list(self, *_): part["type"] = details["type"] part["stock"] = details["stock"] part["description"] = details["description"] + # First check if the part name matches for regex, correction in corrections: if re.search(regex, str(part["reference"])): part["rotation"] = str(correction) diff --git a/schematicexport.py b/schematicexport.py index cc390698..e7063180 100644 --- a/schematicexport.py +++ b/schematicexport.py @@ -200,6 +200,7 @@ def _update_schematic8(self, path): lastLcsc = "" newLcsc = "" lastRef = "" + property_name = self.parent.settings.get("schematic", {}).get("property_name", "LCSC") lines = [] newlines = [] @@ -254,7 +255,7 @@ def _update_schematic8(self, path): if m3 and partSection: if lastLcsc == "" and newLcsc != "" and lastLoc != "": self.logger.info("added %s to %s", newLcsc, lastRef) - newTxt = f'\t\t(property "LCSC" "{newLcsc}"\n\t\t\t(at {lastLoc} 0)' + newTxt = f'\t\t(property "{property_name}" "{newLcsc}"\n\t\t\t(at {lastLoc} 0)' newlines.append(newTxt) newlines.append( "\t\t\t(effects\n\t\t\t\t(font\n\t\t\t\t\t(size 1.27 1.27)\n\t\t\t\t)\n\t\t\t\t(hide yes)" @@ -273,4 +274,4 @@ def _update_schematic8(self, path): with open(path, "w", encoding="utf-8") as f: for line in newlines: f.write(line + "\n") - self.logger.info("Added LCSC's to %s (maybe?)", path) + self.logger.info("Added \"%s\"'s to %s (maybe?)", property_name, path)