added new 'limit' functionality to 'nfsc' graph

This commit is contained in:
Jordi Sanfeliu 2014-06-20 10:25:09 +02:00
parent a4f972455e
commit 70d3dc3f80
1 changed files with 8 additions and 67 deletions

View File

@ -219,8 +219,8 @@ sub nfsc_cgi {
my ($package, $config, $cgi) = @_;
my $nfsc = $config->{nfsc};
my @rigid = split(',', $nfsc->{rigid});
my @limit = split(',', $nfsc->{limit});
my @rigid = split(',', ($nfsc->{rigid} || ""));
my @limit = split(',', ($nfsc->{limit} || ""));
my $tf = $cgi->{tf};
my $colors = $cgi->{colors};
my $graph = $cgi->{graph};
@ -388,14 +388,7 @@ sub nfsc_cgi {
if($title) {
main::graph_header($title, 2);
}
if(trim($rigid[0]) eq 1) {
push(@riglim, "--upper-limit=" . trim($limit[0]));
} else {
if(trim($rigid[0]) eq 2) {
push(@riglim, "--upper-limit=" . trim($limit[0]));
push(@riglim, "--rigid");
}
}
@riglim = @{setup_riglim($rigid[0], $limit[0])};
if($title) {
print(" <tr>\n");
print(" <td valign='top' bgcolor='$colors->{title_bg_color}'>\n");
@ -440,7 +433,6 @@ sub nfsc_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
$zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
@ -460,7 +452,6 @@ sub nfsc_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
@{$cgi->{version12}},
@{$colors->{graph_colors}},
@DEF,
@ -482,15 +473,7 @@ sub nfsc_cgi {
}
}
undef(@riglim);
if(trim($rigid[1]) eq 1) {
push(@riglim, "--upper-limit=" . trim($limit[1]));
} else {
if(trim($rigid[1]) eq 2) {
push(@riglim, "--upper-limit=" . trim($limit[1]));
push(@riglim, "--rigid");
}
}
@riglim = @{setup_riglim($rigid[1], $limit[1])};
undef(@tmp);
undef(@tmpz);
undef(@DEF);
@ -537,7 +520,6 @@ sub nfsc_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
$zoom,
@{$cgi->{version12}},
@{$colors->{graph_colors}},
@ -556,7 +538,6 @@ sub nfsc_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
@{$cgi->{version12}},
@{$colors->{graph_colors}},
@DEF,
@ -582,15 +563,7 @@ sub nfsc_cgi {
print(" </td>\n");
print(" <td valign='top' bgcolor='" . $colors->{title_bg_color} . "'>\n");
}
undef(@riglim);
if(trim($rigid[2]) eq 1) {
push(@riglim, "--upper-limit=" . trim($limit[2]));
} else {
if(trim($rigid[2]) eq 2) {
push(@riglim, "--upper-limit=" . trim($limit[2]));
push(@riglim, "--rigid");
}
}
@riglim = @{setup_riglim($rigid[2], $limit[2])};
undef(@tmp);
undef(@tmpz);
undef(@tmp1);
@ -643,7 +616,6 @@ sub nfsc_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@ -663,7 +635,6 @@ sub nfsc_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
@ -686,15 +657,7 @@ sub nfsc_cgi {
}
}
undef(@riglim);
if(trim($rigid[3]) eq 1) {
push(@riglim, "--upper-limit=" . trim($limit[3]));
} else {
if(trim($rigid[3]) eq 2) {
push(@riglim, "--upper-limit=" . trim($limit[3]));
push(@riglim, "--rigid");
}
}
@riglim = @{setup_riglim($rigid[3], $limit[3])};
undef(@tmp);
undef(@tmpz);
undef(@tmp1);
@ -747,7 +710,6 @@ sub nfsc_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@ -767,7 +729,6 @@ sub nfsc_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
@ -790,15 +751,7 @@ sub nfsc_cgi {
}
}
undef(@riglim);
if(trim($rigid[4]) eq 1) {
push(@riglim, "--upper-limit=" . trim($limit[4]));
} else {
if(trim($rigid[4]) eq 2) {
push(@riglim, "--upper-limit=" . trim($limit[4]));
push(@riglim, "--rigid");
}
}
@riglim = @{setup_riglim($rigid[4], $limit[4])};
undef(@tmp);
undef(@tmpz);
undef(@tmp1);
@ -851,7 +804,6 @@ sub nfsc_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@ -871,7 +823,6 @@ sub nfsc_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},
@ -894,15 +845,7 @@ sub nfsc_cgi {
}
}
undef(@riglim);
if(trim($rigid[5]) eq 1) {
push(@riglim, "--upper-limit=" . trim($limit[5]));
} else {
if(trim($rigid[5]) eq 2) {
push(@riglim, "--upper-limit=" . trim($limit[5]));
push(@riglim, "--rigid");
}
}
@riglim = @{setup_riglim($rigid[5], $limit[5])};
undef(@tmp);
undef(@tmpz);
undef(@CDEF);
@ -943,7 +886,6 @@ sub nfsc_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
$zoom,
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@ -966,7 +908,6 @@ sub nfsc_cgi {
"--width=$width",
"--height=$height",
@riglim,
"--lower-limit=0",
@{$cgi->{version12}},
@{$cgi->{version12_small}},
@{$colors->{graph_colors}},