projects
/
Biblio-RFID.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
display whole hex result from error messages
[Biblio-RFID.git]
/
scripts
/
print.pl
diff --git
a/scripts/print.pl
b/scripts/print.pl
index
476a64e
..
0c5d3f8
100755
(executable)
--- a/
scripts/print.pl
+++ b/
scripts/print.pl
@@
-54,11
+54,11
@@
while(<>) {
chomp;
my @a = split(/\t/,$_);
die "invalid: @a in line $_" if $a[0] !~ m/\d{12}/ && $a[1] !~ m/\@/;
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
}
# sort by card number
-@queue = sort { $
a->[0] <=> $b
->[0] } @queue;
+@queue = sort { $
b->[0] <=> $a
->[0] } @queue;
print "# queue ", dump @queue;
print "# queue ", dump @queue;
@@
-71,7
+71,7
@@
sub tag {
, " AFI: "
, uc unpack('H2', $rfid->afi($tag))
, " "
, " AFI: "
, uc unpack('H2', $rfid->afi($tag))
, " "
- , dump(
Biblio::RFID::RFID501->to_hash( $rfid->blocks($tag)
) )
+ , dump(
$rfid->to_hash( $tag
) )
, $/
;
}
, $/
;
}
@@
-156,9
+156,14
@@
sub render_card {
my @data = @{$queue[0]};
my $nr = $data[0];
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";
print "RENDER @data\n";
- system "$evolis_dir/scripts/inkscape-render.pl", "$evolis_dir/card/ffzg-201
0
.svg", @data;
+ system "$evolis_dir/scripts/inkscape-render.pl", "$evolis_dir/card/ffzg-201
1
.svg", @data;
}
}
}
}