1
0
Fork 0
This repository has been archived on 2019-12-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
arduinisten/eagle-5.7.0/ulp/rename-signal.ulp
Eve Entropia 157fd6f1a1 eagle
2010-03-30 20:14:34 +02:00

43 lines
1.1 KiB
Text

#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");