[tuxdroid-svn] r566 - 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 10:33:31
|
Author: Paul_R Date: 2007-10-02 12:33:05 +0200 (Tue, 02 Oct 2007) New Revision: 566 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.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: * Resolved a bug in the widget window : When the apply button was active, the time values were false. Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-10-02 10:08:22 UTC (rev 565) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-10-02 10:33:05 UTC (rev 566) @@ -77,11 +77,12 @@ _me.set_param('Sample', self.light_measure.sample) self.get_widget("txtSample").set_text(str(_me.get_param('Sample'))) - self.light_measure.change_control() - #Drop + + #Drop _me.set_param('drop', self.light_measure.val_drop) self.get_widget("valDrop_percent").set_text(str(_me.get_param('drop'))) + print self.light_measure.val_drop_time _me.set_param('drop_time', self.light_measure.val_drop_time) self.get_widget("valDrop_time").set_text(str(_me.get_param('drop_time'))) @@ -121,7 +122,7 @@ self.light_measure.thresholdtext = _me.string('conf_lblThreshold') # '' the check boxes self.light_measure.threshold_chk = _me.get_param('threshold_chk') - + self.light_measure.change_control() @@ -146,16 +147,16 @@ _me.set_param('both_rad', self.get_widget('radBoth').get_active()) _me.set_param('threshold_chk', self.get_widget('chkThreshold').get_active()) + temp_rate = self.check_float_value(self.get_widget('txtRate').get_text(), 0.1, 36000) + temp_sample = self.check_float_value(self.get_widget('txtSample').get_text(), 1, 100000) #sample and rate param - if self.check_float_value(self.get_widget('txtRate').get_text(), 0.1, 36000) != self.light_measure.rate or self.check_float_value(self.get_widget('txtSample').get_text(), 1, 100000) != self.light_measure.sample: - + if temp_rate != self.light_measure.rate or temp_sample != self.light_measure.sample: self.light_measure.tick = 1 - self.light_measure.rate = self.check_float_value(self.get_widget('txtRate').get_text(), 0.1, 36000) - self.light_measure.sample = self.check_float_value(self.get_widget('txtSample').get_text(), 1, 100000) + self.light_measure.rate = temp_rate + self.light_measure.sample = temp_sample self.light_measure.val_table = [0] * (int(self.light_measure.sample)+1) - max_time = self.light_measure.rate * self.light_measure.sample self.light_measure.val_drop = self.check_float_value(self.get_widget('valDrop_percent').get_text(), 1, 100) @@ -167,13 +168,13 @@ self.light_measure.val_changeU = self.check_float_value(self.get_widget('valChangeU_percent').get_text(), 1, 100) self.light_measure.val_changeU_time = self.check_float_value(self.get_widget('valChangeU_time').get_text(), self.light_measure.rate, max_time) self.light_measure.val_threshold = self.check_float_value(self.get_widget('valThreshold').get_text(), 0, 100) + print self.light_measure.val_changeD_time #Update values self.update_value() def on_threshold_selection_changed(self, widget, *args): filename = widget.get_filename() - print filename _me.set_param('behavior_file_threshold', filename) _me.get_param('measure').threshold_behavior = _me.get_param('behavior_file_threshold') @@ -190,15 +191,16 @@ ########################################################### def check_float_value(self, value, minimum, maximum): try: - print value value = float(value) except: - print 'value error' + print '0' value = float(minimum) if value < float(minimum): + print '1' value = float(minimum) elif value > float(maximum): + print '2' value = float(maximum) return value Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 10:08:22 UTC (rev 565) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-02 10:33:05 UTC (rev 566) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_version type='str'>0.0.1</gadget_version> <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> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 10:08:22 UTC (rev 565) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-02 10:33:05 UTC (rev 566) @@ -1,27 +1,27 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <drop type='float'>10.0</drop> + <drop_rad type='bool'>True</drop_rad> <increase_rad type='bool'>True</increase_rad> - <changeU_time type='float'>1.0</changeU_time> + <changeU_time type='str'>1.0</changeU_time> <changeD_rad type='bool'>False</changeD_rad> - <threshold type='float'>50.0</threshold> + <threshold type='str'>50.0</threshold> <decrease_rad type='bool'>False</decrease_rad> <behavior_file_threshold type='str'>/home/</behavior_file_threshold> - <raise type='float'>10.0</raise> + <raise type='str'>10.0</raise> <changeU_rad type='bool'>False</changeU_rad> <config type='list'>[]</config> <behavior_file_change type='str'>/home/</behavior_file_change> <raise_rad type='bool'>False</raise_rad> - <changeD type='float'>10.0</changeD> - <drop_time type='float'>1.0</drop_time> - <changeU type='float'>10.0</changeU> - <raise_time type='float'>1.0</raise_time> - <drop_rad type='bool'>True</drop_rad> + <changeD type='str'>10.0</changeD> + <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> <Sample type='str'>500.0</Sample> <threshold_chk type='bool'>False</threshold_chk> <Rate type='str'>0.1</Rate> - <changeD_time type='float'>1.0</changeD_time> + <changeD_time type='str'>1.0</changeD_time> <both_rad type='bool'>False</both_rad> </parameters> <general> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-02 10:08:22 UTC (rev 565) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-02 10:33:05 UTC (rev 566) @@ -9,7 +9,6 @@ <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> @@ -19,10 +18,12 @@ <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> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> + <conf_btnRemove type='str'>Remove</conf_btnRemove> <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> @@ -38,10 +39,9 @@ <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> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <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_btnRemove type='str'>Remove</conf_btnRemove> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |