From df814f8d81cd6080824744cbf593b4d8ba5023ea Mon Sep 17 00:00:00 2001 From: Nick Dajda Date: Thu, 13 Feb 2014 20:36:57 +0000 Subject: [PATCH] skin.conf gauge settings fixed --- bin/user/gaugeengine.py | 13 +++++++++---- skins/Bootstrap/skin.conf | 12 ++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/bin/user/gaugeengine.py b/bin/user/gaugeengine.py index 34cb62d..3a4d803 100644 --- a/bin/user/gaugeengine.py +++ b/bin/user/gaugeengine.py @@ -431,11 +431,16 @@ def histogram(self, gaugeName, fieldName, unitType, numBins): "histogram: %s = %f is lower than minvalue (%f)" % (fieldName, histValue, minVal)) else: bucketNum = int((histValue - minVal) / bucketSpan) - buckets[bucketNum] += 1.0 - numPoints += 1 - if buckets[bucketNum] > roof: - roof = buckets[bucketNum] + if bucketNum >= numBins: + syslog.syslog(syslog.LOG_INFO, "histogram: value %f gives bucket higher than numBins (%d)" + % (histValue, numBins)) + else: + buckets[bucketNum] += 1.0 + numPoints += 1 + + if buckets[bucketNum] > roof: + roof = buckets[bucketNum] buckets = [i / roof for i in buckets] diff --git a/skins/Bootstrap/skin.conf b/skins/Bootstrap/skin.conf index bdf2ca0..91d6dd8 100644 --- a/skins/Bootstrap/skin.conf +++ b/skins/Bootstrap/skin.conf @@ -345,7 +345,7 @@ needle_color = 0xb48242 text_color = 0xb48242 - [[Temperature]] + [[outTemp]] minvalue = -20 maxvalue = 40 majorstep = 10 @@ -354,35 +354,35 @@ history = 24 bins = 120 - [[Pressure]] + [[barometer]] minvalue = 970 maxvalue = 1050 majorstep = 20 minorstep = 10 labelfontsize = 12 - [[Humidity]] + [[outHumidity]] minvalue = 0 maxvalue = 100 majorstep = 20 minorstep = 10 labelfontsize = 13 - [[WindSpeed]] + [[windSpeed]] minvalue = 0 maxvalue = 40 majorstep = 10 minorstep = 2 labelfontsize = 15 - [[WindGust]] + [[windGust]] minvalue = 0 maxvalue = 40 majorstep = 10 minorstep = 2 labelfontsize = 15 - [[WindDirection]] + [[windDir]] labelfontsize = 12 # By default, needle points towards direction of wind source. Use invert to