Mercurial > templog
changeset 466:8cc78243af71
merge
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 18 Feb 2013 23:32:19 +0800 |
parents | f2cca8062128 (current diff) a40f30fad8f6 (diff) |
children | fa79666fb375 |
files | |
diffstat | 2 files changed, 22 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/web/config.py Mon Feb 18 23:31:32 2013 +0800 +++ b/web/config.py Mon Feb 18 23:32:19 2013 +0800 @@ -16,12 +16,16 @@ LINE_WIDTH = 2 -SENSOR_NAMES = {'sensor_28 CE B2 1A 03 00 00 99': "Fridge", - 'sensor_28 CC C1 1A 03 00 00 D4': "Ambient", - 'sensor_28 49 BC 1A 03 00 00 54': "Wort", +SENSOR_NAMES = {'sensor_28 CE B2 1A 03 00 00 99': "Old Fridge", + 'sensor_28 CC C1 1A 03 00 00 D4': "Old Ambient", + 'sensor_28 49 BC 1A 03 00 00 54': "Old Wort", 'sensor_voltage': 'Voltage', 'sensor_fridge_setpoint': 'Setpoint', 'sensor_fridge_on': 'Cool', + 'sensor_28-0000042cf4dd': "Wort", + 'sensor_28-0000042cccc4': "Fridge", + 'sensor_28-0000042c6dbb': "Ambient", + 'sensor_internal': "Processor", } SENSOR_COLOURS = {'Wort': 'e49222', @@ -30,6 +34,7 @@ 'Fridge': '4c40c8', 'Setpoint': '39c662', 'Cool': 'd7cedd', + 'Processor': 'bf7a69', }
--- a/web/log.py Mon Feb 18 23:31:32 2013 +0800 +++ b/web/log.py Mon Feb 18 23:32:19 2013 +0800 @@ -69,6 +69,15 @@ graph_args = [] have_volts = False + + ## volts = temp * volts_div + volts_shift + #volts_div = 10 + #volts_shift = 2 + volts_div = 1 + volts_shift = 0 + + volts_mult = 1.0/volts_div + for n, (rrdfile, sensor) in enumerate(rrds): unit = None if 'avrtemp' in sensor: @@ -86,7 +95,7 @@ vname = 'temp%d' % n graph_args.append('DEF:raw%(vname)s=%(rrdfile)s:temp:AVERAGE' % locals()) # limit max temp to 50 - graph_args.append('CDEF:%(vname)s=raw%(vname)s,35,GT,UNKN,raw%(vname)s,0.1,*,2,+,IF' % locals()) + graph_args.append('CDEF:%(vname)s=raw%(vname)s,38,GT,UNKN,raw%(vname)s,%(volts_mult)f,*,%(volts_shift)f,+,IF' % locals()) unit = '<span face="Liberation Serif">ยบ</span>C' format_last_value = None @@ -124,7 +133,7 @@ '--slope-mode', '--border', '0', # '--vertical-label', 'Voltage', - '--y-grid', '0.1:1', + '--y-grid', '%(volts_mult)f:1' % locals(), '--dynamic-labels', '--grid-dash', '1:0', '--zoom', str(config.ZOOM), @@ -139,8 +148,9 @@ args += ['--font', 'DEFAULT:12:%s' % config.GRAPH_FONT] args += ['--font', 'WATERMARK:10:%s' % config.GRAPH_FONT] if have_volts: - args += ['--right-axis', '10:-20', # matches the scalevolts CDEF above - '--right-axis-format', '%.0lf', + volts_shift_div = volts_div * volts_shift + args += ['--right-axis', '%(volts_div)f:-%(volts_shift_div)f' % locals(), +# '--right-axis-format', '%.0lf', # '--right-axis-label', 'Temperature' ]