[tuxdroid-svn] r639 - 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-22 15:15:01
|
Author: Paul_R Date: 2007-10-22 17:14:24 +0200 (Mon, 22 Oct 2007) New Revision: 639 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade 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/Strings/fr_ALL.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Change the position of the search light/dark buttons. * Change the way to notify the events of the gadget window. Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.glade =================================================================== (Binary files differ) 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-19 14:54:45 UTC (rev 638) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-22 15:14:24 UTC (rev 639) @@ -216,15 +216,8 @@ else: self.event_tab = self.__tab - if self.GUI_on: - if self.search_light_flag: - self.search_light(self.light_search) - else: - #goto test notification every sec. - if self.wait <= time.time(): - self.wait = time.time() + 2.0 - self.test_notification() - self.event_flag = False + if self.GUI_on and self.search_light_flag: + self.search_light(self.light_search) # To prevent notifications at startup if self.start_flag == True: @@ -383,22 +376,6 @@ # Test functions # ########################################################### - def test_notification(self): - if self.test_tab[0][7] == True: - self.test_tab[0][7] = False - if self.test_tab[0][5] == True: - self.event_flag = False - path = self.test_tab[0][6] - path = path.replace('%20', ' ') - if os.path.isfile(path) and os.path.exists(path): - path = self.test_tab[0][6] - path = "'%s'" % path - tux.sys.shell_free(path) - elif self.test_tab[0][1] == 0: - thread.start_new_thread(self.test_default_behavior, (self.changetext,)) - elif self.test_tab[0][1] == 1: - thread.start_new_thread(self.test_default_behavior, (self.thresholdtext,)) - def test_default_behavior(self, txt): tux.cmd.mouth_open() tux.tts.speak(txt) 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-19 14:54:45 UTC (rev 638) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-22 15:14:24 UTC (rev 639) @@ -7,13 +7,25 @@ if temp == True: return True return False + + elif measure.GUI_on == True and measure.search_light_flag == False: + for i in range(len(measure.test_tab)): + temp = measure.test_tab[i][7] + if temp == True: + return True + return False + else: - return False - + return False def notify_actuator(): - event = _me.get_param('measure').event_tab + measure = _me.get_param('measure') + if measure.GUI_on == False: + event = measure.event_tab + else: + event = measure.test_tab + for i in range(len(event)): _me.get_param('measure').event_flag = False #create text to speach for the default notification @@ -40,8 +52,8 @@ path = path.replace('%20', ' ') if os.path.isfile(path) and os.path.exists(path): path = "'%s'" % path - tux.sys.shell_free(path) - event[i][7] = False + tux.sys.shell(path) + event[i][7] = False else: tux.cmd.mouth_open() tux.tts.speak(text) Modified: software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-19 14:54:45 UTC (rev 638) +++ software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-22 15:14:24 UTC (rev 639) @@ -9,6 +9,7 @@ <conf_lblEvent type='str'>Evènement</conf_lblEvent> <widget_lblControl type='str'>Contrôle</widget_lblControl> <Increase type='str'>La lumière est passée en dessus du seuil</Increase> + <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <speaker_name type='str'>Bruno8k</speaker_name> <help_text type='str'>-- Les évènements : @@ -60,7 +61,6 @@ <mainscript type='str'>J'ai trouvé la lumière !</mainscript> <conf_btnRemove type='str'>Enlever</conf_btnRemove> <gui_conf_delay_lb type='str'>Délai (sec)</gui_conf_delay_lb> - <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> <conf_btnBehavior type='str'>Supprimer</conf_btnBehavior> <gui_conf_about_title type='str'>A propos</gui_conf_about_title> <conf_lblChangeD type='str'>Chute et augmente</conf_lblChangeD> @@ -69,7 +69,6 @@ <conf_lblSample type='str'>Points</conf_lblSample> <conf_lblType type='str'>Type</conf_lblType> <Change type='str'>La lumière a changé</Change> - <conf_lblRate type='str'>Taux de rafraichissement</conf_lblRate> <Both type='str'>La lumière a passé le seuil</Both> <conf_btnModify type='str'>Modifier</conf_btnModify> <widget_lblDrop type='str'>Chute</widget_lblDrop> @@ -97,12 +96,13 @@ <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <search type='str'>Je cherche ...</search> <widget_lblChange type='str'>Changement</widget_lblChange> + <light5 type='str'>Je ne peux pas trouver d'où vient la lumière...</light5> <widget_lblLight type='str'>Trouver lumière</widget_lblLight> <name_to_read type='str'>Moniteur de lumière</name_to_read> <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> <Drop type='str'>La lumière a chuté</Drop> <conf_lblDrop type='str'>Chute</conf_lblDrop> - <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> + <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> <Raise type='str'>La lumière a augmenté</Raise> <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> @@ -111,7 +111,7 @@ <Decrease type='str'>La lumière est passée en dessous du seuil</Decrease> <conf_lblValue type='str'>Valeur (%)</conf_lblValue> <light4 type='str'>Je pense que la lumière vient de cette direction</light4> - <light5 type='str'>Je ne peux pas trouver d'où vient la lumière...</light5> + <conf_lblRate type='str'>Taux de rafraichissement</conf_lblRate> <Threshold type='str'>La lumière a atteint le seuil</Threshold> <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-19 14:54:45 UTC (rev 638) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-22 15:14:24 UTC (rev 639) @@ -9,7 +9,6 @@ <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> <Increase type='str'>The light level exceeded the threshold</Increase> - <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> <conf_btnRemove type='str'>Remove</conf_btnRemove> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <help_text type='str'>-- The events: @@ -61,6 +60,7 @@ <mainscript type='str'>I've found the light !</mainscript> <light2 type='str'>ow wait, even lighter here.</light2> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <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> @@ -96,14 +96,14 @@ <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <search type='str'>I seek ...</search> <widget_lblChange type='str'>Change</widget_lblChange> + <light5 type='str'>I can't find the direction of the light.</light5> <widget_lblLight type='str'>Search light</widget_lblLight> <name_to_read type='str'>Light monitor</name_to_read> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> <Drop type='str'>The light level dropped</Drop> <conf_lblDrop type='str'>Drop</conf_lblDrop> - <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> + <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> <Raise type='str'>The light level raised</Raise> - <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> <conf_lblNotified type='str'>Notified ?</conf_lblNotified> <widget_lblSet type='str'>Add to config</widget_lblSet> <light3 type='str'>or here ...</light3> @@ -117,5 +117,5 @@ <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblControl type='str'>Control</conf_lblControl> <widget_lblTest type='str'>Notifications</widget_lblTest> - <light5 type='str'>I can't find the direction of the light.</light5> + <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |