projects
/
vrDialog
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
436d317
)
break down register by boiler model
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 13 Dec 2014 16:08:58 +0000
(17:08 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sat, 13 Dec 2014 16:08:58 +0000
(17:08 +0100)
db3-dump.pl
patch
|
blob
|
history
diff --git
a/db3-dump.pl
b/db3-dump.pl
index
c6ec14e
..
fdaa541
100755
(executable)
--- a/
db3-dump.pl
+++ b/
db3-dump.pl
@@
-18,7
+18,9
@@
sub lookup {
$sth->execute;
while( my $row = $sth->fetchrow_arrayref ) {
$sth->execute;
while( my $row = $sth->fetchrow_arrayref ) {
- $data->{ $row->[0] } = $row->[1];
+ my @r = @$row;
+ my $id = shift @r;
+ $data->{ $row->[0] } = $#$row == 1 ? $row->[1] : join('', @r);
}
return $data;
}
return $data;
@@
-42,20
+44,27
@@
my $units = lookup( qq{
select Id, TexteEN from "UnitNames"
});
select Id, TexteEN from "UnitNames"
});
+my $diags = lookup( qq{
+select Id,x0136,x0142,x0144,x0147,x0151,x0152,x0153,x0158,x0160,x0161 from "DiagnoseDaten"
+});
+warn "# diags = ",dump($diags);
+
my $sth = $dbh->prepare( qq{
select * from "ComuInfos"
order by adresse
});
my $sth = $dbh->prepare( qq{
select * from "ComuInfos"
order by adresse
});
+
$sth->execute;
while( my $row = $sth->fetchrow_hashref ) {
my $hint = $hints->{ $row->{texteid} };
$hint =~ s/[\r\n]+/ | /gs;
$sth->execute;
while( my $row = $sth->fetchrow_hashref ) {
my $hint = $hints->{ $row->{texteid} };
$hint =~ s/[\r\n]+/ | /gs;
- printf "%-3d %02x %-27s %-15s %s %s [ %s ]\n",
+ printf "%-3d %02x %-27s %-15s
|%s|
%s %s [ %s ]\n",
$row->{adresse},
$row->{adresse},
$types->{ $row->{typid} },
$units->{ $row->{id} },
$row->{adresse},
$row->{adresse},
$types->{ $row->{typid} },
$units->{ $row->{id} },
+ $diags->{ $row->{id} } || ' ',
$row->{symbolname},
$names->{ $row->{texteid} } || $row->{symbolname},
$hint,
$row->{symbolname},
$names->{ $row->{texteid} } || $row->{symbolname},
$hint,