neingeist
/
arduinisten
Archived
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

44 lines
1.1 KiB
Plaintext

#usage "<b>Rename SIGNALSs in a board with Suffix</b><p>"
"RUN rename-signals [suffix]<br>"
"<author>Author: support@cadsoft.de</author>";
// THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND,
// EXPRESSED OR IMPLIED.
string Version = "Version 1.1"; // check if schematic editor window open
string fileName;
string suffix = argv[1];
// ### Functions ###
if (project.schematic) {
dlgMessageBox(argv[0]+ "\n" + Version + "\nFirst close the schematic editor!", "OK");
exit(-1);
}
// ** MAIN **
if (board) {
board(B) {
fileName = filesetext(B.name, "rename-signal-suffix~~~.scr");
int cntsig = 0;
output(fileName, "wtD") {
printf("# 'This file is generated by %s, exported from;\n", Version);
printf("# '%s at %s;\n", fileName, t2string(time()));
printf("# '%s;\n\n", EAGLE_SIGNATURE);
B.signals(S) {
S.contactrefs(C) {
printf("SIGNAL 'S$S_0%d%s' %s %s;\n", cntsig, suffix, C.element.name, C.contact.name);
cntsig++;
break;
}
}
}
exit ("SCRIPT '" + fileName + "';");
}
}
else dlgMessageBox("Start this ULP in Board!", "OK");