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