[tuxdroid-svn] r593 - in software/gadgets/light_monitor/trunk: . Light_monitor Light_monitor/Script
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2007-10-09 14:35:24
|
Author: Paul_R Date: 2007-10-09 16:34:47 +0200 (Tue, 09 Oct 2007) New Revision: 593 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/about.xml Log: * Fill the graph Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-09 12:46:31 UTC (rev 592) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-09 14:34:47 UTC (rev 593) @@ -34,7 +34,7 @@ context.rectangle(rect.x, rect.y, rect.width, rect.height) #set a white background context.set_source_rgb(1, 1, 1) - context.fill_preserve() + context.fill() #draw a black border context.set_source_rgb(0, 0, 0) context.set_line_width(1) @@ -98,11 +98,25 @@ coeff_y = float(rect.height / 1124.00) coeff_x = float(rect.width / (self.light_measure_graph.sample - 1)) - #trace the curve - context.move_to(rect.x, rect.height) - context.set_source_rgb(1.0, 0, 0) + context.set_line_width(2.0) + context.set_source_rgb(0, 0, 1) + context.move_to(rect.x - 2, rect.height + 2) + context.line_to(rect.x, rect.height - (self.light_measure_graph.val_table[0] * coeff_y)) for i, val in enumerate(self.light_measure_graph.val_table): context.line_to(rect.x + ((i) * coeff_x), rect.height - (val * coeff_y)) + context.line_to(rect.x + ((i) * coeff_x), rect.height + 5) + context.close_path() + context.set_source_rgba(1.0, 0, 0, 0.2) + + context.fill() + + context.set_line_width(1.0) + context.set_source_rgb(1, 0, 0) + context.move_to(rect.x - 2, rect.height + 2) + context.line_to(rect.x, rect.height - (self.light_measure_graph.val_table[0] * coeff_y)) + for i, val in enumerate(self.light_measure_graph.val_table): + context.line_to(rect.x + ((i) * coeff_x), rect.height - (val * coeff_y)) + context.line_to(rect.x + ((i) * coeff_x), rect.height + 5) context.stroke() class lightMeasure(): Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-09 12:46:31 UTC (rev 592) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-09 14:34:47 UTC (rev 593) @@ -2,6 +2,6 @@ <about> <gadget_author type='str'>Paul Rathgeb</gadget_author> <gadget_version type='str'>0.0.1</gadget_version> + <gadget_name type='str'>light_monitor</gadget_name> <gadget_description type='str'>Light monitor for tux droid</gadget_description> - <gadget_name type='str'>light_monitor</gadget_name> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |