bugfix: removed Strongest Selection from Archive chart

This commit is contained in:
AE6XE 2016-01-09 20:55:53 -08:00
parent bb10ca7faf
commit c21b4f7b35
2 changed files with 9 additions and 10 deletions

View File

@ -165,22 +165,21 @@ EOF
my @files = `ls -1A /tmp/snrlog`;
$parms{device}="" if(!/$parms{device}/ ~~ @files);
# default to "Strongest Signal"
if($parms{device}) {
$page = $page . "<option value='strongest'>Strongest Signal</option>";
} else {
# default to "Strongest Signal" for Realtime
if(! $parms{device} and $parms{realtime}) {
$page = $page . "<option selected value='strongest'>Strongest Signal</option>";
}
}
$firstSel=1;
# iterate over each file
foreach $logfile (@files)
{
chomp($logfile);
next if($logfile eq 'strongest');
my ($dmac, $dname) = $logfile =~ /^(.*?)\-(.*)/;
$dname=$logfile if($dname eq '');
if($parms{device} eq $logfile) {
$dname=$dmac if($dname eq '');
if($parms{device} eq $logfile or (!$parms{realtime} and $firstSel)) {
$page = $page . "<option selected value='$logfile'>$dname</option>\n";
$firstSel=0;
} else {
$page = $page . "<option value='$logfile'>$dname</option>\n";
}

View File

@ -67,7 +67,7 @@ if($parms{"realtime"}) {
} else {
# ==== ARCHIVE DATA =====
# --- Load the snr data into an array
if($parms{device} eq '') { $parms{device}="strongest"; }
if($parms{device} eq '') { chomp ($parms{device}=`ls -1A $dirname | head -1`); }
$filename=$dirname . "/" . $parms{device};
open my $fh, '<', $filename or die "Could not open file '$filename' $!";
@ -123,4 +123,4 @@ sub get_realtime_signal()
}
($junk, $n) = get_wifi_signal(get_interface("wifi"));
return ($s, $n);
}
}