chiark / gitweb /
quacks-ingredients: better counting reports
[reprap-play.git] / quacks-ingredients-counts
index 101629598d265555c2e578f3344c11061ccf72c9..e9f6acf1fde58562a48736930c091853e559579f 100755 (executable)
@@ -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 <<END;
@@ -78,7 +80,7 @@ foreach $name (sort keys %count) {
 }
 
 print <<END;
-// total_count=$total_count
+// total_count=$total_count total_real_count=$total_real_count
 // max_rowsz=$max_rowsz max_nrows=$max_nrows
 END