# Suppresses all processing for all parts matching the
# glob.
#
+# count <count> <iteratable>
+# include <circuit> ) use only one of
+# exclude <circuit> ) include and exclude
+#
# end
# Ends the file. Optional.
# $pkinddesc{'a b c'} => 'y' after `a b c ? = y'
our(%parts);
-# $parts{"$circuit\n$sper"}[]{Part} or item
-# $parts{"$circuit\n$sper"}[]{Qty}
-# $parts{"$circuit\n$sper"}[]{Use}
-# $parts{"$circuit\n$sper"}[]{FileLine}
+# $parts{"$circuit\n$iteratable"}[]{Part} or item
+# $parts{"$circuit\n$iteratable"}[]{Qty}
+# $parts{"$circuit\n$iteratable"}[]{Use}
+# $parts{"$circuit\n$iteratable"}[]{FileLine}
our(%partdef);
# $partdef{"part name"}= $item;
our(%count);
-# $count{"$sper"} is number of times sper is instantiated
+# $count{"$iteratable"} is number of times iteratable is instantiated
# (no syntax for specifying this atm)
our(%iteminstances);
our(%suppress_item);
our(@suppress_partre);
+our($incexc); # 'include' or 'exclude'
+our(%incexc); # $incexc{$circuit}= 1; for those mentioned
+
our(@sorthow);
# list of desc price avail
$& eq '?' ? '.' :
"\\$&") /ge;
push @suppress_partre, $_;
+ } elsif (m/^count\s+(\d+)\s+([A-Z].*)$/) {
+ $count{$2}= $1;
+ } elsif (m/^(include|exclude)\s+([A-Z].*)$/) {
+ die "both include and exclude\n" if
+ defined $incexc && $incexc ne $1;
+ $incexc= $1;
+ $incexc{$2}= 1;
} else {
die "$_ ?";
}
if ($ql =~ s/\D\d+$//) { $qr= $&; }
if ($ql =~ s,(\d+)/[a-z]+$,,) { $qr= "$1/"; }
if ($ql =~ s/\=//) { $qr .= $&; }
- return sprintf("%*s %5s%-2s %s\n",
+ return sprintf("%*s %5s%-2s %s%s\n",
(4+1+4),'',
$ql,$qr,
+ $ii->{Mult} != 1 ? "(x$ii->{Mult}) " : '',
$ii->{Use});
}
$sp =~ m/\n/ or die "$sp ?";
$circuit= $`;
$iteratable= $';
+ next if
+ (defined $incexc && $incexc eq 'include')
+ xor exists $incexc{$circuit};
if (exists $count{$iteratable}) {
$count= $count{$iteratable};
} else {
$bi= $iteminfo{$item};
next unless $bi;
($toorder,$notechar)= calcorder($totalqty, $bi);
+ next unless $toorder > 0;
$price= $toorder * $bi->{Price};
$avail= $bi->{Avail};
$avail{$avail}= 1;
$total)
or die $!;
print "\n" or die $!;
- dump_warnerrs();
if (keys %suppress) {
print "---------- suppressed ----------\n" or die $!;
foreach $item (sort { itemsortmap($a) cmp itemsortmap($b); }
print $ii or die $!;
}
}
+ print "\n" or die $!;
}
+ dump_warnerrs();
hrule();
}
$totalqty->{Inexact}= 1;
}
$denom=1 if !defined $denom;
+ $numer *= $m2;
if (defined $uniq) {
die if exists $totalqty->{Uniques}{$uniq};
$totalqty->{Uniques}{$uniq}{Numer}= $numer;
$need += calcneed($totalqty->{Uniques}{$uniq}, undef);
}
$need += calcneed($totalqty, \$notechar) if exists $totalqty->{Numer};
- $need++ if !$exact;
+ $need++ if $need && !$exact;
if ($need % $bi->{Multiple}) {
$need= floor(($need + $bi->{Multiple} - 1) / $bi->{Multiple})
* $bi->{Multiple};
$notechar= '*';
}
- if ($need < $bi->{MinOrder}) {
+ if ($need && $need < $bi->{MinOrder}) {
$need= $bi->{MinOrder};
$notechar= '>';
}