delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/05/13/13:34:41

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
Date: Wed, 13 May 2015 13:34:33 -0400
Message-Id: <201505131734.t4DHYXa7031201@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: geda-user AT delorie DOT com
In-reply-to: <55537E57.8050200@dbtgroup.com> (geda-user@delorie.com)
Subject: Re: [geda-user] Using gerbv for assisting manual placement tasks
References: <1431386490 DOT 2980 DOT 28 DOT camel AT cam DOT ac DOT uk> <CAC4O8c9p2qhrc+1J53C7Apu=h+Jd2b_v+tdF7m70-ABng=GLfQ AT mail DOT gmail DOT com> <201505130159 DOT t4D1xkkd031338 AT envy DOT delorie DOT com> <55537E57 DOT 8050200 AT dbtgroup DOT com>
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> > I use a script that greps the BOM and highlights all matches in PCB...
> 
> would you mind sharing this with us?  i'd like to see it.

The way it works is I type "go 587-1299-1" or something on the command
line (which also tells me how many to place), then hit 'g' in the PCB
window (which highlights them).

My pcb-menu.res has this somewhere:

    {"grep" a={"G" "<Key>g"} ExecuteFile(/tmp/pcb.grep)}

And I use this script in the working directory (my "go" runs it, call
it what you want):

#!/usr/bin/perl
# -*- perl -*-

$reg = shift;
open(B, "board.bom");

$first = 1;

open(G, ">/tmp/pcb.grep");
print G "Unselect(All)\n";

while (<B>) {
    chomp;
    ($refdes, $value, $footprint, $device, $voltage, $manufacturer, $manufacturer_part_number, $vendor, $vendor_part_number, $qty) = split(':', $_);
    
    if ($first || /$reg/i) {
	print "\033[34m" if $first;
	printf("%-7s %-24s %-18s %s\n", $value, $manufacturer_part_number, $vendor_part_number, $refdes);
	print "\033[0m" if $first;
	if (!$first) {
	    for $r (split(',', $refdes)) {
		print G "Select(ElementByName,$r)\n";
		$count ++;
	    }
	}
    $first = 0;
    }
}

print "\n\033[32m$count parts\033[0m\n";

close G;

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019