Simplify temp scale code.

This commit is contained in:
Andreas Bachlechner 2021-10-13 00:55:31 +02:00
parent 5db98e37bf
commit ca575e5dba
1 changed files with 1 additions and 6 deletions

View File

@ -333,7 +333,6 @@ sub nvme_cgi {
my @riglim; my @riglim;
my @IMG; my @IMG;
my @IMGz; my @IMGz;
my $temp_scale = "Celsius";
my @tmp; my @tmp;
my @tmpz; my @tmpz;
my @CDEF; my @CDEF;
@ -365,10 +364,6 @@ sub nvme_cgi {
} }
$title = !$silent ? $title : ""; $title = !$silent ? $title : "";
if(lc($config->{temperature_scale}) eq "f") {
$temp_scale = "Fahrenheit";
}
my $gap_on_all_nan = lc($nvme->{gap_on_all_nan} || "") eq "y" ? 1 : 0; my $gap_on_all_nan = lc($nvme->{gap_on_all_nan} || "") eq "y" ? 1 : 0;
# text mode # text mode
@ -464,7 +459,7 @@ sub nvme_cgi {
} }
# Plot settings # Plot settings
my @y_axis_titles = ($temp_scale, "Percent (%)", "Percent (%)", "bytes", "Errors", "Counts"); my @y_axis_titles = ((lc($config->{temperature_scale}) eq "f" ? "Fahrenheit" : "Celsius"), "Percent (%)", "Percent (%)", "bytes", "Errors", "Counts");
my @value_transformations = ((lc($config->{temperature_scale}) eq "f" ? ",9,*,5,/,32,+" : ""), "", "", ",512000,*", "", ""); my @value_transformations = ((lc($config->{temperature_scale}) eq "f" ? ",9,*,5,/,32,+" : ""), "", "", ",512000,*", "", "");
my @legend_labels = ("%2.0lf", "%4.0lf%%", "%4.0lf%%", "%7.3lf%s", "%4.0lf%s", "%4.0lf%s"); my @legend_labels = ("%2.0lf", "%4.0lf%%", "%4.0lf%%", "%7.3lf%s", "%4.0lf%s", "%4.0lf%s");
my @plot_order = (0, 3, 1, 2, 4, 5); # To rearange the plots my @plot_order = (0, 3, 1, 2, 4, 5); # To rearange the plots