From 2d779819896f56e15336bc3516a291f3e2edbe57 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 28 Mar 2020 17:07:56 +0000 Subject: [PATCH] quacks-ingredients: better counting reports Signed-off-by: Ian Jackson --- quacks-ingredients-counts | 6 +++-- quacks-ingredients-counts.scad | 42 ++++++++++++++++---------------- quacks-ingredients-update-levels | 2 ++ 3 files changed, 27 insertions(+), 23 deletions(-) diff --git a/quacks-ingredients-counts b/quacks-ingredients-counts index 1016295..e9f6acf 100755 --- a/quacks-ingredients-counts +++ b/quacks-ingredients-counts @@ -38,6 +38,7 @@ s{^}{// }mg; our $name; our $total_count; +our $total_real_count; our $max_nrows=0; our $max_rowsz=0; @@ -48,10 +49,11 @@ sub wrtoplevel () { my $rowsz = ceil(sqrt($total)); my $nrows = ceil($total / $rowsz); $total_count += $total; + $total_real_count += $total if $name =~ m/^[A-Z][a-z]+$/; $max_nrows = $nrows if $nrows > $max_nrows; $max_rowsz = $rowsz if $rowsz > $max_rowsz; my $ix = 0; - print "// total=$total, rowsz=$rowsz, nrows=$nrows\n"; + print "// $name: total=$total, rowsz=$rowsz, nrows=$nrows\n"; foreach my $nspots (sort keys %$cs) { my $c = $cs->{$nspots}; print <>$f.tmp mv -f $f.tmp $f + +egrep '^//' $f | sort -- 2.30.2