chomp;
my @a = split(/\t/,$_);
die "invalid: @a in line $_" if $a[0] !~ m/\d{12}/ && $a[1] !~ m/\@/;
- push @queue, [ @a ] if ! $numbers->{ $a[0] };
+ push @queue, [ @a ] if ! $numbers->{ $a[0] } || $ENV{REPRINT};
}
# sort by card number
-@queue = sort { $a->[0] <=> $b->[0] } @queue;
+@queue = sort { $b->[0] <=> $a->[0] } @queue;
print "# queue ", dump @queue;
, " AFI: "
, uc unpack('H2', $rfid->afi($tag))
, " "
- , dump( Biblio::RFID::RFID501->to_hash( $rfid->blocks($tag) ) )
+ , dump( $rfid->to_hash( $tag ) )
, $/
;
}
sub write_log {
my ( $tag, $number ) = @_;
- open(my $log, '>', $log_path) || die "$log_path: $!";
+ open(my $log, '>>', $log_path) || die "$log_path: $!";
my $date = iso_date;
print $log "$date,$tag,$number\n";
close($log);
my @data = @{$queue[0]};
my $nr = $data[0];
- if ( ! ( -e "out/$nr.front.pbm" && -e "out/$nr.front.pbm" ) ) {
+ if ( $ENV{REPRINT} ) {
+ unlink $_ foreach glob("out/$nr.*");
+ warn "REPRINT: $nr";
+ }
+
+ if ( ! ( -e "out/$nr.front.pbm" && -e "out/$nr.back.pbm" ) ) {
print "RENDER @data\n";
- system "$evolis_dir/scripts/inkscape-render.pl", "$evolis_dir/card/ffzg-2010.svg", @data;
+ system "$evolis_dir/scripts/inkscape-render.pl", "$evolis_dir/card/ffzg-2011.svg", @data;
}
}