|
|
@ -339,17 +339,11 @@ sub showbox($) |
|
|
|
my ($bn) = @_; |
|
|
|
my ($bn) = @_; |
|
|
|
|
|
|
|
|
|
|
|
my ($mu, %ms) = readbox($bn); |
|
|
|
my ($mu, %ms) = readbox($bn); |
|
|
|
print " [ $mu,\n "; |
|
|
|
my @MS = ($mu); |
|
|
|
my $frst = 1; |
|
|
|
|
|
|
|
for my $num (sort { $a <=> $b } keys %ms) { |
|
|
|
for my $num (sort { $a <=> $b } keys %ms) { |
|
|
|
if ($frst) { |
|
|
|
push @MS, $num, $ms{$num}[0], $ms{$num}[1]; |
|
|
|
$frst = 0; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
print ", "; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
print "$num, $ms{$num}[0], \"$ms{$num}[1]\""; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
print " ],\n"; |
|
|
|
printbox($bn, @MS); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# $filename |
|
|
|
# $filename |
|
|
@ -382,22 +376,14 @@ sub showstate($) |
|
|
|
close FILE; |
|
|
|
close FILE; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
print " [ ".($hdr{'MaxPulledUid'} // "missing").", ". |
|
|
|
my @T = ($hdr{'MaxPulledUid'} // "missing", |
|
|
|
($hdr{'MaxExpiredSlaveUid'} // "0").", ".($hdr{'MaxPushedUid'} // "missing").",\n "; |
|
|
|
$hdr{'MaxExpiredSlaveUid'} // "0", |
|
|
|
my $frst = 1; |
|
|
|
$hdr{'MaxPushedUid'} // "missing"); |
|
|
|
for (@ls) { |
|
|
|
for (@ls) { |
|
|
|
if ($frst) { |
|
|
|
/^(-?\d+) (-?\d+) (.*)$/; |
|
|
|
$frst = 0; |
|
|
|
push @T, $1, $2, $3; |
|
|
|
} else { |
|
|
|
|
|
|
|
print ", "; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
if (!/^(-?\d+) (-?\d+) (.*)$/) { |
|
|
|
printstate(@T); |
|
|
|
print "??, ??, \"??\""; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
print "$1, $2, \"$3\""; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
print " ],\n"; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# $filename |
|
|
|
# $filename |
|
|
@ -604,7 +590,7 @@ sub printstate(@) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
print ", "; |
|
|
|
print ", "; |
|
|
|
} |
|
|
|
} |
|
|
|
print shift(@t).", ".shift(@t).", \"".shift(@t)."\""; |
|
|
|
print((shift(@t) // "??").", ".(shift(@t) // "??").", \"".(shift(@t) // "??")."\""); |
|
|
|
} |
|
|
|
} |
|
|
|
print " ],\n"; |
|
|
|
print " ],\n"; |
|
|
|
} |
|
|
|
} |
|
|
|