sub
parse_connrow_vals
{
my
$self
=
shift
;
my
$str
=
shift
;
croak
"No HTML stashed"
unless
$self
->{conn_html};
my
@row
=
grep
/^var
$str
= /, @{
$self
->{conn_html}};
croak
"Bad row results for '$str'"
unless
@row
== 1;
my
(
$sval
) = (
$row
[0] =~ /
"([^"
]+)";/);
my
@flds
=
split
/\|/,
$sval
;
return
\
@flds
;
}
sub
parse_conn_stats
{
my
$self
=
shift
;
$self
->fetch_connection
unless
$self
->{conn_html};
croak
"No HTML stashed"
unless
$self
->{conn_html};
my
%dbits
= (
freq
=>
'CmDownstreamFrequencyBase'
,
mod
=>
'CmDownstreamQamBase'
,
power
=>
'CmDownstreamChannelPowerdBmVBase'
,
snr
=>
'CmDownstreamSnrBase'
,
);
my
%ubits
= (
chanid
=>
'CmUpstreamChannelIdBase'
,
freq
=>
'CmUpstreamFrequencyBase'
,
bw
=>
'CmUpstreamBwBase'
,
power
=>
'CmUpstreamChannelPowerBase'
,
);
$self
->{conn_stats}{down}{
$_
} =
$self
->parse_connrow_vals(
$dbits
{
$_
})
for
keys
%dbits
;
$self
->{conn_stats}{up}{
$_
} =
$self
->parse_connrow_vals(
$ubits
{
$_
})
for
keys
%ubits
;
my
$ds
=
$self
->{conn_stats}{down};
for
my
$i
(0..$
{
unless
(
$ds
->{freq}[
$i
] > 0)
{
undef
(
$ds
->{
$_
}[
$i
])
for
keys
%dbits
}
}
my
$us
=
$self
->{conn_stats}{up};
for
my
$i
(0..$
{
unless
(
$us
->{chanid}[
$i
] > 0)
{
undef
(
$us
->{
$_
}[
$i
])
for
keys
%ubits
}
}
return
;
}
1;