forked from halfakop/eagle-lbr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
olimex_drill_standards_in_all_libraries.ulp
56 lines (49 loc) · 2.27 KB
/
olimex_drill_standards_in_all_libraries.ulp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#usage "<b>Round all drills in all libraries in a directory</b>\n"
"<p>"
"Aftewards drills will be increased to Olimex standards, to fit plating of dualsided boards"
"<p>"
"Do not apply multiple to same libraries, as drills would increase every time"
"<p>"
"To make backup of libraries is strictly recommended"
"<p>"
"Edited by Siegfried Schwemmer"
"<p>"
"Load any library from a library directory and execute this ULP."
"<p>"
"A report file 'report.txt' will be generated in the library directory"
"<p>"
"<author>Original example Author: support@cadsoft.de</author>"
"<author>Adapted by Rindert Nauta</author>"
// THIS PROGRAM IS PROVIDED AS IS AND WITHOUT WARRANTY OF ANY KIND, EXPRESSED OR IMPLIED
string a[], par, lbr_path, report_file, cmd = "", s, progname,automatic_mode;
int lbrpnt, x;
//-------- main program --------------------------------------------------
progname = filesetext(filename(argv[0]), "");
library(L) {
lbr_path = filedir(L.name);
}
report_file = lbr_path+"report.txt";
lbrpnt = strtod(argv[1]);
automatic_mode = argv[2];
int choise;
int n = fileglob(a, lbr_path+"*.lbr");
if (n) {
if (lbrpnt==0 ) { // First run
automatic_mode = "0";
choise= dlgMessageBox("<nobr> Rounding all drills to Olimex standards multiple <br>"+
"In all libraries in<br><b>"+lbr_path+"</b><br>"
,"Automatic","Manual","Cancel");
if (choise==0) automatic_mode = "1"; // automatic --> call drill_0.1_in_current_library.ulp in silent mode
if (choise==2) exit(0); //cancel button
output(report_file,"wt") printf("Report for rounding drills in all libraries in "+lbr_path+"\n");
}
else library(L){
// output(report_file, "at") printf("Processing %s\n",L.name); //
}
lbrpnt++;
sprintf(par, "%d", lbrpnt);
if (lbrpnt > n) exit(0);
exit("OPEN '"+lbr_path+filename(a[lbrpnt-1])+"';\n"+ //open lib
"RUN 'olimex_drill_standards_in_current_library'"+automatic_mode+";\n"+ //run round drills
"RUN '"+progname+"' "+par+" "+automatic_mode+"\n"); //return to this program (recursive)
}