changeset 504:028cf9bc3ee8

improved layering of sensor lines
author Matt Johnston <matt@ucc.asn.au>
date Thu, 26 Jun 2014 22:58:25 +0800
parents d96042bce9d3
children ad846b9bdd10
files web/log.py
diffstat 1 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/web/log.py	Mon Apr 21 21:41:44 2014 +0800
+++ b/web/log.py	Thu Jun 26 22:58:25 2014 +0800
@@ -125,22 +125,23 @@
         elif legend == 'Fridge':
             fridge_sensor = vname
 
-    sensor_lines.sort(key = lambda (legend, line): "Wort" in legend)
-
-    graph_args += (line for (legend, line) in sensor_lines)
-
-    print>>sys.stderr, '\n'.join(graph_args)
-
     # calculated bits
     colour = '000000'
     print_legend = 'Heat'
     graph_args.append('CDEF:wortdel=%(wort_sensor)s,PREV(%(wort_sensor)s),-' % locals())
     graph_args.append('CDEF:tempdel=%(wort_sensor)s,%(fridge_sensor)s,-' % locals())
     graph_args.append('CDEF:fermheat=wortdel,80,*,tempdel,0.9,*,+' % locals())
-    graph_args.append('CDEF:trendfermheat=fermheat,10800,TRENDNAN' % locals())
+    graph_args.append('CDEF:trendfermheat=fermheat,7200,TRENDNAN' % locals())
     graph_args.append('CDEF:limitfermheat=trendfermheat,5,+,11,MIN,2,MAX' % locals())
     graph_args.append('LINE0.5:limitfermheat#%(colour)s:%(print_legend)s' % locals())
 
+    # lines are done afterwards so they can be layered
+    sensor_lines.sort(key = lambda (legend, line): "Wort" in legend)
+    graph_args += (line for (legend, line) in sensor_lines)
+
+    print>>sys.stderr, '\n'.join(graph_args)
+
+
     end = int(start+length)
     start = int(start)