mirror of
git://projects.qi-hardware.com/wernermisc.git
synced 2024-11-21 20:56:15 +02:00
hacks/brdclw: change (silk screen) line width in a component
This commit is contained in:
parent
3d61f78fe7
commit
c481702b70
29
hacks/brdclw
Executable file
29
hacks/brdclw
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
#
|
||||||
|
# brdclw - Change line width in a specific module in a KiCAD .brd file
|
||||||
|
#
|
||||||
|
|
||||||
|
sub usage
|
||||||
|
{
|
||||||
|
print STDERR "usage: $0 module from to in-file\n";
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
&usage unless @ARGV == 4;
|
||||||
|
|
||||||
|
$mod = shift(@ARGV);
|
||||||
|
$from = shift(@ARGV);
|
||||||
|
$to = shift(@ARGV);
|
||||||
|
|
||||||
|
while (<>) {
|
||||||
|
$this = $1 eq $mod if /^\$MODULE\s+(\S+)/;
|
||||||
|
$this = 0 if /^\$EndMODULE/;
|
||||||
|
if ($this && /^DS\s/) {
|
||||||
|
@ds = split(/\s+/);
|
||||||
|
if ($ds[5] == $from) {
|
||||||
|
$ds[5] = $to;
|
||||||
|
$_ = join(" ", @ds)."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print || die;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user