r5819 - in trunk/gta02-core/bom: . fic

werner at docs.openmoko.org werner at docs.openmoko.org
Sat Feb 6 07:09:13 CET 2010


Author: werner
Date: 2010-02-06 07:09:13 +0100 (Sat, 06 Feb 2010)
New Revision: 5819

Added:
   trunk/gta02-core/bom/misc.pl
Modified:
   trunk/gta02-core/bom/Makefile
   trunk/gta02-core/bom/README
   trunk/gta02-core/bom/avx.chr
   trunk/gta02-core/bom/bom2part
   trunk/gta02-core/bom/fic/equ2equ
   trunk/gta02-core/bom/fic/missing.inv
   trunk/gta02-core/bom/part2order
   trunk/gta02-core/bom/prettyord
Log:
Assorted cleanup and corrections.

- bom/part2order: sort list of missing parts by number missing, not by rank 
  (too confusing)
- bom/part2order, Makefile: group missing part if equivalent. For this, 
  part2order now also reads the equivalences.
- bom/part2order (rank): don't boost rank of "gratis" parts if they're not 
  available
- bom/avx.chr: corrected part number of CM316X5R476M06AT
- bom/README: decribed virtual inventory
- bom/missing.inv: added missing RTT0242R2FTH, PLL322512F2R2K, CC7V-T1A, and 
  HT-210UD/NB
- bom/Makefile: added target "xpdf" to show the workflow
- bom/misc.pl (eq), bom/bom2part (issue): turned "issue" into new helper 
  function to find all equivalent parts 
- bom/prettyord: search also equivalent parts for descriptions



Modified: trunk/gta02-core/bom/Makefile
===================================================================
--- trunk/gta02-core/bom/Makefile	2010-02-05 21:03:12 UTC (rev 5818)
+++ trunk/gta02-core/bom/Makefile	2010-02-06 06:09:13 UTC (rev 5819)
@@ -6,15 +6,16 @@
 INV=fic/fic.inv gta02-core.inv dummy.inv fic/missing.inv digi-key.inv
 CHR=darfon.chr ralec.chr avx.chr acx.chr misc.chr
 
-.PHONY:		all spotless upload show-missing
+.PHONY:		all spotless upload show-missing show-dk
+# mark them as phony since we have incomplete dependencies in this Makefile
+.PHONY:		fic/fic.equ fic/fic.inv fic/missing.equ
 
-
 all:		gta02-core.ord
 
 gta02-core.ord:	part2order parser.pl \
-		  gta02-core.par $(INV)
+		  gta02-core.par $(INV) $(EQU)
 		perl part2order $(KITS) \
-		  $(INV) gta02-core.par >$@ || \
+		  $(INV) $(EQU) gta02-core.par >$@ || \
 		  { rm -rf $@; exit 1; }
 	
 gta02-core.par:	bom2part parser.pl match.pl \
@@ -37,9 +38,18 @@
 fic/fic.inv:
 		$(MAKE) -C fic fic.inv
 
+fic/fic.dsc:
+		$(MAKE) -C fic fic.dsc
+
+fic/missing.equ:
+		$(MAKE) -C fic missing.equ
+
 workflow.pdf:	workflow.fig
 		fig2dev -L pdf $< >$@ || { rm -f $@; exit 1; }
 
+xpdf:		workflow.pdf
+		xpdf workflow.pdf
+
 upload:		workflow.pdf
 		$(COPY) workflow.pdf $(UPLOAD)/bom-workflow.pdf
 
@@ -47,5 +57,10 @@
 		$(MAKE) -C fic spotless
 		rm -f gta02-core.par gta02-core.ord darfon.chr ralec.chr
 
-show-missing:
-		(echo '#ORD'; grep MISSING gta02-core.ord ; ) | ./prettyord -
+show-missing:	$(EQU) fic/fic.dsc
+		(echo '#ORD'; grep MISSING gta02-core.ord ; ) | \
+		  ./prettyord - $(EQU) fic/fic.dsc
+
+show-dk:
+		(echo '#ORD'; grep DIGI-KEY gta02-core.ord ; ) | \
+		  ./prettyord - digi-key.dsc

Modified: trunk/gta02-core/bom/README
===================================================================
--- trunk/gta02-core/bom/README	2010-02-05 21:03:12 UTC (rev 5818)
+++ trunk/gta02-core/bom/README	2010-02-06 06:09:13 UTC (rev 5819)
@@ -211,7 +211,13 @@
 
 Blank lines and comments (#) are ignored.
 
+The number of items in stock and the pricing data can be omitted. We
+call this "virtual inventory". In this case, the numer of items in
+stock and the price default to large numbers (e.g., 999999). Virtual
+inventory is used to suppress warnings for parts that have not been
+sourced yet, but where sourcing is in progress.
 
+
 Description (.dsc)
 ------------------
 

Modified: trunk/gta02-core/bom/avx.chr
===================================================================
--- trunk/gta02-core/bom/avx.chr	2010-02-05 21:03:12 UTC (rev 5818)
+++ trunk/gta02-core/bom/avx.chr	2010-02-06 06:09:13 UTC (rev 5819)
@@ -10,7 +10,7 @@
 AVX CM21Y5V106Z10AT	T=C	C=10uF	V=10V	TOL=80/20% FP=0805 M=Y5V
 AVX CM316X5R106K25AT	T=C	C=10uF	V=25V	TOL=10%	FP=1206	M=X5R
 AVX CV21X5R226M06AT 	T=C	C=22uF	V=6.3V	TOL=20%	FP=0805	M=X5R
-AVX C1005Y5V474ZCT	T=C	C=47uF	V=6.3V	TOL=20%	FP=1206	M=X5R
+AVX CM316X5R476M06AT	T=C	C=47uF	V=6.3V	TOL=20%	FP=1206	M=X5R
 AVX CM105X5R475K06AT	T=C	C=4.7uF	V=6.3V	TOL=10%	FP=0603	M=X5R
 AVX TLJA107M006R0500	T=C	C=100uF	V=6.3V	TOL=20%	FP=3216	M=TANT ESR=0.5R
 AVX TLJT107M010R0900	T=C	C=100uF	V=10V	TOL=20%	FP=3528	M=TANT ESR=0.9R

Modified: trunk/gta02-core/bom/bom2part
===================================================================
--- trunk/gta02-core/bom/bom2part	2010-02-05 21:03:12 UTC (rev 5818)
+++ trunk/gta02-core/bom/bom2part	2010-02-06 06:09:13 UTC (rev 5819)
@@ -2,24 +2,12 @@
 
 require "parser.pl";
 require "match.pl";
+require "misc.pl";
 
 
 sub issue
 {
-    my %seen;
-    print shift(@_);
-    my @p = @_;
-
-    # we determine all equivalent parts
-
-    while (@p) {
-	my $p = shift @p;
-	next if $seen{$p};
-	$seen{$p} = 1;
-	print " $p";
-	push(@p, @{ $eq{$p} });
-    }
-    print "\n";
+    print shift(@_), " ", join(" ", @_, &eq(@_)), "\n";
 }
 
 

Modified: trunk/gta02-core/bom/fic/equ2equ
===================================================================
--- trunk/gta02-core/bom/fic/equ2equ	2010-02-05 21:03:12 UTC (rev 5818)
+++ trunk/gta02-core/bom/fic/equ2equ	2010-02-06 06:09:13 UTC (rev 5819)
@@ -6,7 +6,7 @@
 
 print "#EQU\n";
 for my $id (keys %inv) {
-print STDERR "--> $id\n";
+#print STDERR "--> $id\n";
     my @f = split(" ", $id);
     die "can't find $f[1]" unless defined $id{$f[1]};
     print "$id $id{$f[1]}\n";

Modified: trunk/gta02-core/bom/fic/missing.inv
===================================================================
--- trunk/gta02-core/bom/fic/missing.inv	2010-02-05 21:03:12 UTC (rev 5818)
+++ trunk/gta02-core/bom/fic/missing.inv	2010-02-06 06:09:13 UTC (rev 5819)
@@ -48,9 +48,11 @@
 MISSING RTT02221JTH
 MISSING RTT02473JTH
 MISSING RTT021242FTH
+MISSING RTT0242R2FTH
 MISSING EXC24CB102U
 MISSING HI1608-1C3N9SNT
 MISSING LQP15MN6N2B02
+MISSING PLL322512F2R2K
 MISSING HCI-1005F-27NJ-M
 MISSING PLL201212F2R2K
 MISSING PLL201212F4R7K
@@ -66,4 +68,6 @@
 MISSING B7820
 MISSING B7821
 MISSING B7825
+MISSING CC7V-T1A
+MISSING HT-210UD/NB
 MISSING TD028TTEC1

Added: trunk/gta02-core/bom/misc.pl
===================================================================
--- trunk/gta02-core/bom/misc.pl	                        (rev 0)
+++ trunk/gta02-core/bom/misc.pl	2010-02-06 06:09:13 UTC (rev 5819)
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+
+#
+# determine the equivalent parts, taking into account that %eq is transitive
+#
+
+sub eq
+{
+    my %seen;
+    my @p = @_;	# parts to consider
+    my @r = ();	# new equivalences we've found
+    my $skip = @p;
+
+    while (@p) {
+	my $p = shift @p;
+	next if $seen{$p};
+	$seen{$p} = 1;
+	push(@r, $p) if $skip-- <= 0;
+	push(@p, @{ $eq{$p} });
+    }
+    return @r;
+}
+
+
+return 1;


Property changes on: trunk/gta02-core/bom/misc.pl
___________________________________________________________________
Name: svn:executable
   + *

Modified: trunk/gta02-core/bom/part2order
===================================================================
--- trunk/gta02-core/bom/part2order	2010-02-05 21:03:12 UTC (rev 5818)
+++ trunk/gta02-core/bom/part2order	2010-02-06 06:09:13 UTC (rev 5819)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 require "parser.pl";
+require "misc.pl";
 
 $mult = shift(@ARGV);
 &parse;
@@ -36,14 +37,14 @@
 {
     local ($a, $b) = @_;
 
-    my $na = &number($a);
+    my $na = &number($a);	# min(number wanted, available)
     my $nb = &number($b);
-    my $pa = $inv{$a}[3];
+    my $pa = $inv{$a}[3];	# per unit price for smallest quantum
     my $pb = $inv{$b}[3];
 
 #print STDERR "a=$a b=$b na=$na nb=$nb pa=$pa pb=$pb\n";
-    return 1 if !$pa && $pb;
-    return -1 if $pa && !$pb;
+    return 1 if $na && !$pa && $pb;
+    return -1 if $nb && $pa && !$pb;
     return $na <=> $nb if $na != $nb;
     return $pb <=> $pa;
 }
@@ -117,7 +118,16 @@
     print "\n";
 }
 
-# experimental
-for (sort { &rank($b, $a) } keys %want) {
-    print STDERR "$_: $want{$_}\n" if $want{$_};
+for my $id (sort { $want{$b} <=> $want{$a} } keys %want) {
+    next unless $want{$id};
+    print STDERR "$id";
+    for (&eq($id)) {
+#	next unless $want{$_};
+	die "\n$_ ($want{$_}) vs. $id want ($want{$id})"
+	  unless $want{$_} == $want{$id};
+	print STDERR " $_";
+	$want{$_} = 0;
+    }
+    print STDERR ": want $want{$id}\n";
+    $want{$id} = 0;
 }

Modified: trunk/gta02-core/bom/prettyord
===================================================================
--- trunk/gta02-core/bom/prettyord	2010-02-05 21:03:12 UTC (rev 5818)
+++ trunk/gta02-core/bom/prettyord	2010-02-06 06:09:13 UTC (rev 5819)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 require "parser.pl";
+require "misc.pl";
 
 &parse;
 
@@ -17,7 +18,15 @@
     @f = split(/\s+/, $_);
     push(@{ $out[2] }, $f[1]);
     print STDERR "$_: no description\n" unless defined $dsc{$_};
-    push(@{ $out[3] }, defined $dsc{$_} ? $dsc{$_} : "???");
+    my $dsc = $dsc{$_};
+    if (!defined $dsc) {
+print STDERR "$_ -> ", join(" ", &eq($_)), "\n";
+	for (&eq($_)) {
+	    $dsc = $dsc{$_};
+	    last if defined $dsc;
+	}
+    }
+    push(@{ $out[3] }, defined $dsc ? $dsc : "???");
     push(@{ $out[4] }, $order{$_}[1]);
     push(@{ $out[5] }, sprintf("%.2f", $order{$_}[2]));
 }




More information about the commitlog mailing list