[tuxdroid-svn] r567 - 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-02 11:37:44
|
Author: Paul_R Date: 2007-10-02 13:37:40 +0200 (Tue, 02 Oct 2007) New Revision: 567 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/Scripts/Python/notify.pyp software/gadgets/light_monitor/trunk/Light_monitor/about.xml software/gadgets/light_monitor/trunk/Light_monitor/settings.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Fix a bug in 'raise & drop' and 'drop & raise' events. After the first event, the gadget was blocked 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-02 10:33:05 UTC (rev 566) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-02 11:37:40 UTC (rev 567) @@ -276,10 +276,9 @@ def ChangeD_control(self, time, val, timeout, index): if timeout != 0: - timeout -= 1 - + timeout -= 1 init_val = len(self.val_table) - 1 - int(time) + timeout - for i in range(int(time - self.timeout)): + for i in range(int(time) - timeout): if self.val_table[int(len(self.val_table)-1-i)] <= self.val_table[len(self.val_table) - 1] - ((val/100)*1124): maximum = max(self.val_table[init_val:len(self.val_table) - i]) if maximum >= self.val_table[len(self.val_table) - 1 - i] + val: @@ -290,12 +289,15 @@ return True if self.GUI_on: self.timeout = timeout + else: + self.event_tab[index][8] = timeout + return False def ChangeU_control(self, time, val, timeout, index): if timeout != 0: timeout -= 1 init_val = len(self.val_table) - 1 - int(time) + timeout - for i in range(int(time - self.timeout)): + for i in range(int(time) - timeout): if self.val_table[int(len(self.val_table)-1-i)] >= self.val_table[len(self.val_table) - 1] + ((val/100)*1124): minimum = min(self.val_table[init_val:len(self.val_table)-i]) if minimum <= self.val_table[len(self.val_table) - 1 - i] - val: @@ -306,6 +308,9 @@ return True if self.GUI_on: self.timeout = timeout + else: + self.event_tab[index][8] = timeout + return False ########################################################### # Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-02 10:33:05 UTC (rev 566) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-02 11:37:40 UTC (rev 567) @@ -5,8 +5,9 @@ temp = measure.event_tab[i][7] if temp == True: return True - else: - return False + return False + else: + return False Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 10:33:05 UTC (rev 566) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 11:37:40 UTC (rev 567) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_description type='str'>Light monitor for tux droid</gadget_description> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_name type='str'>light_monitor</gadget_name> <gadget_version type='str'>0.0.1</gadget_version> - <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/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 10:33:05 UTC (rev 566) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 11:37:40 UTC (rev 567) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <drop_rad type='bool'>True</drop_rad> + <drop type='str'>10.0</drop> <increase_rad type='bool'>True</increase_rad> <changeU_time type='str'>1.0</changeU_time> <changeD_rad type='bool'>False</changeD_rad> @@ -17,7 +17,7 @@ <drop_time type='str'>1.0</drop_time> <changeU type='str'>10.0</changeU> <raise_time type='str'>1.0</raise_time> - <drop type='str'>10.0</drop> + <drop_rad type='bool'>True</drop_rad> <Sample type='str'>500.0</Sample> <threshold_chk type='bool'>False</threshold_chk> <Rate type='str'>0.1</Rate> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-02 10:33:05 UTC (rev 566) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-02 11:37:40 UTC (rev 567) @@ -9,6 +9,7 @@ <widget_lblControl type='str'>Control</widget_lblControl> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <help_text type='str'>Bla bla bla bla</help_text> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> @@ -18,12 +19,10 @@ <gui_conf_update_title type='str'>Update</gui_conf_update_title> <widget_lblValue type='str'>Value (%)</widget_lblValue> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> - <conf_btnRemove type='str'>Remove</conf_btnRemove> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <gui_conf_about_title type='str'>About</gui_conf_about_title> <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> - <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <speaker_name type='str'>Ryan8k</speaker_name> <conf_lblSample type='str'>Samples</conf_lblSample> <conf_lblType type='str'>Type</conf_lblType> @@ -39,9 +38,10 @@ <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <widget_lblDrop type='str'>Drop</widget_lblDrop> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Change</widget_lblChange> <name_to_read type='str'>Light monitor</name_to_read> @@ -55,5 +55,5 @@ <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblControl type='str'>Control</conf_lblControl> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <conf_btnRemove type='str'>Remove</conf_btnRemove> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |