# HG changeset patch # User Matt Johnston # Date 1341675122 -28800 # Node ID abe8c530812e3243c36baf243d5debd4a6957749 # Parent a032051475fec3941d0223896df360038164ffdd ui tweaks diff -r a032051475fe -r abe8c530812e web/config.py --- a/web/config.py Wed Jul 04 22:36:52 2012 +0800 +++ b/web/config.py Sat Jul 07 23:32:02 2012 +0800 @@ -5,20 +5,22 @@ UPDATE_URL = 'https://evil.ucc.asn.au/~matt/templog/update' -GRAPH_WIDTH = 800 -GRAPH_HEIGHT = 400 -ZOOM = 1.5 +GRAPH_WIDTH = 1200 +GRAPH_HEIGHT = 600 +ZOOM = 1 LINE_WIDTH = 2 SENSOR_NAMES = {'sensor_28 CE B2 1A 03 00 00 99': "Wort", - 'sensor_28 CC C1 1A 03 00 00 D4': "Lid", + 'sensor_28 CC C1 1A 03 00 00 D4': "Ambient", + 'sensor_28 49 BC 1A 03 00 00 54': "Other", 'sensor_voltage': 'Voltage', } SENSOR_COLOURS = {'Wort': 'e49222', - 'Lid': '028b3d', + 'Ambient': '028b3d', 'Voltage': '7db5d3aa', + 'Other': '78000c', } diff -r a032051475fe -r abe8c530812e web/log.py --- a/web/log.py Wed Jul 04 22:36:52 2012 +0800 +++ b/web/log.py Sat Jul 07 23:32:02 2012 +0800 @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- #:vim:et:ts=4:sts=4:sw=4: import rrdtool import os @@ -65,14 +66,20 @@ have_volts = True vname = 'scalevolts' graph_args.append('DEF:%(vname)s=%(rrdfile)s:temp:AVERAGE:step=3600' % locals()) + unit = 'V' else: vname = 'temp%d' % n graph_args.append('DEF:raw%(vname)s=%(rrdfile)s:temp:AVERAGE' % locals()) graph_args.append('CDEF:%(vname)s=raw%(vname)s,0.1,*,2,+' % locals()) + unit = 'ยบC' + + last_value = float(rrdtool.info(rrdfile)['ds[temp].last_ds']) width = config.LINE_WIDTH legend = config.SENSOR_NAMES.get(sensor, sensor) colour = config.SENSOR_COLOURS.get(legend, colour_from_string(sensor)) - graph_args.append('LINE%(width)f:%(vname)s#%(colour)s:%(legend)s' % locals()) + format_last_value = ('%f' % last_value).rstrip('0') + unit + print_legend = '%s (%s)' % (legend, format_last_value) + graph_args.append('LINE%(width)f:%(vname)s#%(colour)s:%(print_legend)s' % locals()) end = int(start+length) start = int(start) @@ -101,6 +108,7 @@ '--color', 'MGRID#aaaaaa', '--color', 'BACK#ffffff', '--disable-rrdtool-tag', + '--pango-markup', '--watermark', watermark, '--imgformat', 'PNG'] \ + graph_args diff -r a032051475fe -r abe8c530812e web/views/top.tpl --- a/web/views/top.tpl Wed Jul 04 22:36:52 2012 +0800 +++ b/web/views/top.tpl Sat Jul 07 23:32:02 2012 +0800 @@ -16,7 +16,7 @@
- +