[tuxdroid-svn] r582 - 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-05 08:27:47
|
Author: Paul_R Date: 2007-10-05 10:27:46 +0200 (Fri, 05 Oct 2007) New Revision: 582 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade 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: * Set the test expander of the test window not expanded by default * Change the param of test behavior and test change scripts * Add a new function to refresh the treeview Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-04 16:23:15 UTC (rev 581) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-05 08:27:46 UTC (rev 582) @@ -1,15 +1,16 @@ bindtextdomain("params", "") class Window(SimpleGladeApp): - def __init__(self, path=_me.get_path('root') + '/Scripts/Python/GUI/conf/other.glade', root="window1", domain="params", **kwargs): SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + def new(self): self.measure = _me.get_param('measure') + _me.insert_funct('refresh_tree', self.refresh_tree) self.updates_commons() self.make_viewtree() self.update_labels() @@ -265,7 +266,10 @@ 0] self.measure.event_tab = _me.get_param('config') self.measure.event_tab.append(value) - + self.refresh_tree() + + def refresh_tree(self): + print 'refresh tree =========================================================' _me.set_param('config', self.measure.event_tab) self.value_list.clear() for i in range(len(self.measure.event_tab)): @@ -305,7 +309,7 @@ if self.measure.event_tab[i][5]: Notify = _me.string('conf_lblNotifiedBehavior') - if self.measure.event_tab[i][6] == None: + if self.measure.event_tab[i][6] ==None: Behavior = _me.string('conf_lblDefaultBehavior') else: Behavior = str(self.measure.event_tab[i][6]) @@ -403,3 +407,9 @@ self.get_widget('txt_conf_value').set_text('1') if float(self.get_widget('txt_conf_value').get_text()) > 100: self.get_widget('txt_conf_value').set_text('100') +''' + try: + _me.insert_funct('refresh_tree', refresh_tree) + except: + print sys.exc_info() +''' Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade 2007-10-04 16:23:15 UTC (rev 581) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade 2007-10-05 08:27:46 UTC (rev 582) @@ -839,7 +839,7 @@ <widget class="GtkExpander" id="expander3"> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="expanded">True</property> + <property name="expanded">False</property> <property name="spacing">0</property> <child> 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-04 16:23:15 UTC (rev 581) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-10-05 08:27:46 UTC (rev 582) @@ -157,14 +157,26 @@ _me.get_param('measure').GUI_on = False self.light_measure.GUI_on = False + def on_btnSet_clicked(self, widget, *args): + + if self.light_measure.threshold_behavior_chk: + threshold_script = self.light_measure.threshold_behavior + else: + threshold_script = None + + if self.light_measure.change_behavior_chk: + change_script = self.light_measure.change_behavior + else: + change_script = None + if self.get_widget('cbbConfig').get_active() == 0: val = [len(self.light_measure.event_tab)+1, 0, 0, self.light_measure.val_drop, self.light_measure.val_drop_time, self.light_measure.change_notified, - self.light_measure.change_behavior, + change_script, False, 0] elif self.get_widget('cbbConfig').get_active() == 1: @@ -172,7 +184,7 @@ self.light_measure.val_raise, self.light_measure.val_raise_time, self.light_measure.change_notified, - self.light_measure.change_behavior, + change_script, False, 0] elif self.get_widget('cbbConfig').get_active() == 2: @@ -180,7 +192,7 @@ self.light_measure.val_changeD, self.light_measure.val_changeD_time, self.light_measure.change_notified, - self.light_measure.change_behavior, + change_script, False, 0] elif self.get_widget('cbbConfig').get_active() == 3: @@ -188,39 +200,41 @@ self.light_measure.val_changeU, self.light_measure.val_changeU_time, self.light_measure.change_notified, - self.light_measure.change_behavior, + change_script, False, 0] elif self.get_widget('cbbConfig').get_active() == 4: val = [len(self.light_measure.event_tab)+1, 1, 0, - self.light_measure.val_increase, + self.light_measure.val_threshold, 0, self.light_measure.threshold_notified, - self.light_measure.threshold_behavior, + threshold_script, False, 0] elif self.get_widget('cbbConfig').get_active() == 5: val = [len(self.light_measure.event_tab)+1, 1, 1, - self.light_measure.val_decrease, + self.light_measure.val_threshold, 0, self.light_measure.threshold_notified, - self.light_measure.threshold_behavior, + threshold_script, False, 0] elif self.get_widget('cbbConfig').get_active() == 6: val = [len(self.light_measure.event_tab)+1, 1, 2, - self.light_measure.val_both, + self.light_measure.val_threshold, 0, self.light_measure.threshold_notified, - self.light_measure.threshold_behavior, + threshold_script, False, 0] self.light_measure.event_tab.append(val) - print self.light_measure.event_tab - #_me.gui('conf').hide() + #_me.gui('conf').hide_from_main() #_me.gui('conf').show() + print ' '+str(_me.get_funct('refresh_tree')) + refresh_tree = _me.get_funct('refresh_tree') + + refresh_tree() - def on_btnApply_clicked(self, widget, *args): #Store the new radio buttons status _me.set_param('drop_rad', self.get_widget('radDrop').get_active()) Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-04 16:23:15 UTC (rev 581) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-05 08:27:46 UTC (rev 582) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_name type='str'>light_monitor</gadget_name> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_description type='str'>Light monitor for tux droid</gadget_description> <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-04 16:23:15 UTC (rev 581) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-05 08:27:46 UTC (rev 582) @@ -9,12 +9,12 @@ <changeD_rad type='bool'>False</changeD_rad> <threshold type='float'>50.0</threshold> <decrease_rad type='bool'>False</decrease_rad> - <behavior_file_threshold type='str'>/home/</behavior_file_threshold> + <behavior_file_threshold type='NoneType'>None</behavior_file_threshold> <raise type='float'>10.0</raise> <changeU_rad type='bool'>False</changeU_rad> <threshold_notified type='bool'>False</threshold_notified> <config type='list'>[]</config> - <behavior_file_change type='str'>/home/</behavior_file_change> + <behavior_file_change type='NoneType'>None</behavior_file_change> <drop_rad type='bool'>True</drop_rad> <raise_rad type='bool'>False</raise_rad> <changeD type='float'>10.0</changeD> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-04 16:23:15 UTC (rev 581) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-05 08:27:46 UTC (rev 582) @@ -10,6 +10,7 @@ <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <help_text type='str'> </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,13 +20,11 @@ <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> <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> <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> @@ -42,9 +41,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> <widget_lblLight type='str'>Search light</widget_lblLight> @@ -60,6 +60,6 @@ <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> <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |