tux-droid-svn Mailing List for Tux Droid CE (Page 215)
Status: Beta
Brought to you by:
ks156
You can subscribe to this list here.
2007 |
Jan
|
Feb
(32) |
Mar
(108) |
Apr
(71) |
May
(38) |
Jun
(128) |
Jul
(1) |
Aug
(14) |
Sep
(77) |
Oct
(104) |
Nov
(90) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(81) |
Feb
(18) |
Mar
(40) |
Apr
(102) |
May
(151) |
Jun
(74) |
Jul
(151) |
Aug
(257) |
Sep
(447) |
Oct
(379) |
Nov
(404) |
Dec
(430) |
2009 |
Jan
(173) |
Feb
(236) |
Mar
(519) |
Apr
(300) |
May
(112) |
Jun
(232) |
Jul
(314) |
Aug
(58) |
Sep
(203) |
Oct
(293) |
Nov
(26) |
Dec
(109) |
2010 |
Jan
(19) |
Feb
(25) |
Mar
(33) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Paul_R <c2m...@c2...> - 2007-10-31 15:27:36
|
Author: Paul_R Date: 2007-10-31 16:27:35 +0100 (Wed, 31 Oct 2007) New Revision: 655 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.pyp software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml Log: * Changed the gadget to not notify if the battery is full when the manager start Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py 2007-10-31 15:09:23 UTC (rev 654) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py 2007-10-31 15:27:35 UTC (rev 655) @@ -264,9 +264,12 @@ # To prevent notifications at startup if self.start_flag == True or self.disable_event == True: + self.start_flag = False self.test_tab[0][7] = False self.disable_event = False self.start_flag = False + self.low_threshold_flag = False + self.high_threshold_flag = False for i in range (len(self.event_tab)): self.event_tab[i][7] = False @@ -289,34 +292,36 @@ # ########################################################### def absolute_threshold_low(self, value, value_off): + if self.absolute_threshold_low_flag == False: val = self.convert_value([0, 1, 0, value]) val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE - if val_prev >= val and val_act < val: + if val_act < val: self.absolute_threshold_low_flag = True return True else: val = self.convert_value([0, 1, 0, value_off]) val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE - if val_prev <= val and val_act > val: + if val_act > val: self.absolute_threshold_low_flag = False return False def absolute_threshold_high(self, value, value_off): + print self.absolute_threshold_high_flag if self.absolute_threshold_high_flag == False: val = self.convert_value([0, 1, 0, value]) val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE - if val_prev <= val and val_act > val: + if val_act > val: self.absolute_threshold_high_flag = True return True else: val = self.convert_value([0, 1, 0, value_off]) val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE - if val_prev >= val and val_act < val: + if val_act < val: self.absolute_threshold_high_flag = False return False Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.pyp 2007-10-31 15:09:23 UTC (rev 654) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.pyp 2007-10-31 15:27:35 UTC (rev 655) @@ -410,6 +410,9 @@ self.measure.high_threshold = float(self.get_widget('txtHighThreshold').get_text()) _me.set_param('high_threshold', self.measure.high_threshold) + + self.measure.absolute_threshold_high_flag = False + self.measure.absolute_threshold_low_flag = False Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-31 15:09:23 UTC (rev 654) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-31 15:27:35 UTC (rev 655) @@ -11,7 +11,7 @@ <widget_lblControl type='str'>Contrôle</widget_lblControl> <Increase type='str'>Le niveau de la batterie est passé en dessus du seuil</Increase> <full type='str'>Les batteries sont pleines</full> - <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> <lblLowThreshold type='str'>Limite inférieure</lblLowThreshold> <help_text type='str'>-- Les évènements : Deux grands types d'évènements peuvent avoir lieu, contenant chacun diverses options : @@ -73,7 +73,7 @@ <MainBehavior type='str'>Comportement principal</MainBehavior> <speaker_name type='str'>Bruno8k</speaker_name> <conf_lblSample type='str'>Points</conf_lblSample> - <charging type='str'>En charge</charging> + <conf_lblType type='str'>Type</conf_lblType> <Change type='str'>Le niveau de la batterie a changé</Change> <Both type='str'>Le niveau de la batterie a passé le seuil</Both> <conf_btnModify type='str'>Modifier</conf_btnModify> @@ -102,18 +102,18 @@ <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Changement</widget_lblChange> <name_to_read type='str'>Moniteur de batteries</name_to_read> - <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> <Drop type='str'>Le niveau de la batterie a chuté</Drop> <conf_lblDrop type='str'>Chute</conf_lblDrop> - <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> <Raise type='str'>Le niveau de la batterie a augmenté</Raise> - <conf_lblType type='str'>Type</conf_lblType> + <charging type='str'>En charge</charging> <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> <Decrease type='str'>Le niveau de la batterie est passé en dessous du seuil</Decrease> <conf_lblValue type='str'>Valeur (V)</conf_lblValue> <conf_lblRate type='str'>Rafraichissement</conf_lblRate> <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> - <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> + <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> <conf_lblControl type='str'>Contrôle</conf_lblControl> <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-31 15:09:23 UTC (rev 654) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-31 15:27:35 UTC (rev 655) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_description type='str'>Battery monitor for tux droid</gadget_description> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_name type='str'>battery_monitor</gadget_name> <gadget_version type='str'>0.0.1</gadget_version> - <gadget_name type='str'>battery_monitor</gadget_name> - <gadget_description type='str'>Battery monitor for tux droid</gadget_description> </about> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-31 15:09:23 UTC (rev 654) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-31 15:27:35 UTC (rev 655) @@ -1,11 +1,11 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <Sample type='float'>600.0</Sample> + <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> + <chkMotors type='bool'>True</chkMotors> <low_threshold type='float'>4.8</low_threshold> - <chkMotors type='bool'>True</chkMotors> <MainScript type='str'>None</MainScript> - <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> + <Sample type='float'>600.0</Sample> <Rate type='float'>1.0</Rate> <high_threshold type='float'>6.0</high_threshold> <config type='list'>[]</config> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-31 15:09:23 UTC (rev 654) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-31 15:27:35 UTC (rev 655) @@ -3,15 +3,20 @@ <conf_lblIncrease type='str'>Increase</conf_lblIncrease> <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> + <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <battery type='str'>On battery</battery> + <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <conf_lblRaise type='str'>Raise</conf_lblRaise> + <widget_lblTest type='str'>Notifications</widget_lblTest> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> <Increase type='str'>The battery level exceeded the threshold</Increase> - <full type='str'>The level of the batteries is full</full> + <conf_btnModify type='str'>Modify</conf_btnModify> <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> - <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <lblLowThreshold type='str'>Lower limit</lblLowThreshold> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <lblMotors type='str'>Disable measurement when the motors are running</lblMotors> <help_text type='str'>--The events: Two main types of events can take place, each containing various options: @@ -47,41 +52,38 @@ When this window is displayed, the events stored in the settings window are not notified. This window makes it possible to try various configurations and to add them in the settings table.</help_text> <end_of_charge type='str'>The load of the battery is finished</end_of_charge> - <conf_btnRemove type='str'>Remove</conf_btnRemove> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> <widget_lblChangeU type='str'>Raise and drop</widget_lblChangeU> <widget_lblNotified type='str'>Notified</widget_lblNotified> + <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Update</gui_conf_update_title> <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <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> <absolute_threshold_high type='str'>The batteries are full</absolute_threshold_high> - <conf_lblType type='str'>Type</conf_lblType> <mainscript type='str'>I've found the light !</mainscript> - <MainBehavior type='str'>Main behavior</MainBehavior> - <lblLowThreshold type='str'>Lower limit</lblLowThreshold> + <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <plugged type='str'>Plugged</plugged> - <ChangeU type='str'>The battery level raised and dropped</ChangeU> <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> <charge type='str'>and the batteries are recharging</charge> <gui_conf_about_title type='str'>About</gui_conf_about_title> <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> <low type='str'>The level of the batteries is weak</low> - <speaker_name type='str'>Ryan8k</speaker_name> + <conf_btnAdd type='str'>Add</conf_btnAdd> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <conf_lblSample type='str'>Samples</conf_lblSample> - <charging type='str'>Charging</charging> + <conf_lblType type='str'>Type</conf_lblType> <Change type='str'>The battery level changed</Change> + <conf_lblValue type='str'>Value (V)</conf_lblValue> <Both type='str'>The battery level reached the threshold</Both> - <conf_btnModify type='str'>Modify</conf_btnModify> + <full type='str'>The level of the batteries is full</full> <widget_lblEvent type='str'>Event</widget_lblEvent> <normal type='str'>The level of the batteries is good</normal> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <widget_lblRaise type='str'>Raise</widget_lblRaise> - <conf_btnAdd type='str'>Add</conf_btnAdd> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <on_battery type='str'>and I'm powered by the battery</on_battery> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> @@ -89,33 +91,31 @@ <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> - <ChangeD type='str'>The battery level dropped and raised</ChangeD> - <absolute_threshold type='str'>Weak batteries </absolute_threshold> - <lblMotors type='str'>Disable measurement when the motors are running</lblMotors> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> - <lblHighThreshold type='str'>Upper limit</lblHighThreshold> <widget_lblValue type='str'>Value (V)</widget_lblValue> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <speaker_name type='str'>Ryan8k</speaker_name> <plug type='str'>and the power supply is plugged</plug> - <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <absolute_threshold type='str'>Weak batteries </absolute_threshold> <widget_lblChange type='str'>Change</widget_lblChange> <name_to_read type='str'>Battery monitor</name_to_read> + <lblHighThreshold type='str'>Upper limit</lblHighThreshold> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> <Drop type='str'>The battery level dropped</Drop> <conf_lblDrop type='str'>Drop</conf_lblDrop> - <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> + <ChangeD type='str'>The battery level dropped and raised</ChangeD> <Raise type='str'>The battery level raised</Raise> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <charging type='str'>Charging</charging> <widget_lblSet type='str'>Add to config</widget_lblSet> <Decrease type='str'>The battery level passed below the threshold</Decrease> - <conf_lblValue type='str'>Value (V)</conf_lblValue> + <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> <conf_lblRate type='str'>Refresh rate</conf_lblRate> <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> - <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> - <conf_lblTime type='str'>Time (sec.)</conf_lblTime> + <MainBehavior type='str'>Main behavior</MainBehavior> + <ChangeU type='str'>The battery level raised and dropped</ChangeU> <conf_lblControl type='str'>Control</conf_lblControl> - <widget_lblTest type='str'>Notifications</widget_lblTest> + <conf_btnRemove type='str'>Remove</conf_btnRemove> <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> </strings> |
From: remi <c2m...@c2...> - 2007-10-31 15:09:48
|
Author: remi Date: 2007-10-31 16:09:23 +0100 (Wed, 31 Oct 2007) New Revision: 654 Removed: software/tux_framework/trunk/SDK/gadget_maker/config.pyc software/tux_framework/trunk/version.pyc Log: ADD: tux_framework : remove pyc files Deleted: software/tux_framework/trunk/SDK/gadget_maker/config.pyc =================================================================== (Binary files differ) Deleted: software/tux_framework/trunk/version.pyc =================================================================== (Binary files differ) |
From: remi <c2m...@c2...> - 2007-10-31 15:08:20
|
Author: remi Date: 2007-10-31 16:07:58 +0100 (Wed, 31 Oct 2007) New Revision: 653 Added: software/tux_framework/ software/tux_framework/branches/ software/tux_framework/tags/ software/tux_framework/trunk/ software/tux_framework/trunk/SDK/ software/tux_framework/trunk/SDK/doc/ software/tux_framework/trunk/SDK/doc/GdgDebug_doc.pdf software/tux_framework/trunk/SDK/doc/GdgObject_doc.pdf software/tux_framework/trunk/SDK/doc/GdgScenario_doc.pdf software/tux_framework/trunk/SDK/doc/GdgSceneContainer_doc.pdf software/tux_framework/trunk/SDK/doc/GdgScene_doc.pdf software/tux_framework/trunk/SDK/doc/PythonApi.pdf software/tux_framework/trunk/SDK/doc/TGF Specifications.pdf software/tux_framework/trunk/SDK/doc/TGFParser.pdf software/tux_framework/trunk/SDK/gadget_maker/ software/tux_framework/trunk/SDK/gadget_maker/Template.tgf software/tux_framework/trunk/SDK/gadget_maker/config.py software/tux_framework/trunk/SDK/gadget_maker/config.pyc software/tux_framework/trunk/SDK/gadget_maker/maker.png software/tux_framework/trunk/SDK/gadget_maker/tuxgagdetmaker.glade software/tux_framework/trunk/SDK/gadget_maker/tuxgagdetmaker.py software/tux_framework/trunk/TFW.py software/tux_framework/trunk/libs/ software/tux_framework/trunk/libs/C2MEDoc.py software/tux_framework/trunk/libs/FWObject.py software/tux_framework/trunk/libs/GdgDebug.py software/tux_framework/trunk/libs/GdgDownload.py software/tux_framework/trunk/libs/GdgGuiUpdate.py software/tux_framework/trunk/libs/GdgObject.py software/tux_framework/trunk/libs/GdgThreads.py software/tux_framework/trunk/libs/GoogleTranslate.py software/tux_framework/trunk/libs/Languages.py software/tux_framework/trunk/libs/SimpleGladeApp.py software/tux_framework/trunk/libs/TGFCanvas.py software/tux_framework/trunk/libs/TGFParser.py software/tux_framework/trunk/libs/TGFXml.py software/tux_framework/trunk/libs/TGFormat.py software/tux_framework/trunk/libs/TextFilters.py software/tux_framework/trunk/libs/behavior_cb.py software/tux_framework/trunk/libs/keyboard.py software/tux_framework/trunk/libs/language_guesser.bay software/tux_framework/trunk/libs/menu.py software/tux_framework/trunk/libs/t9.py software/tux_framework/trunk/libs/tdrss.py software/tux_framework/trunk/libs/thomas.py software/tux_framework/trunk/libs/voice_cb.py software/tux_framework/trunk/version.py software/tux_framework/trunk/version.pyc Log: ADD: tux_framework head Added: software/tux_framework/trunk/SDK/doc/GdgDebug_doc.pdf =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/SDK/doc/GdgDebug_doc.pdf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/SDK/doc/GdgObject_doc.pdf =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/SDK/doc/GdgObject_doc.pdf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/SDK/doc/GdgScenario_doc.pdf =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/SDK/doc/GdgScenario_doc.pdf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/SDK/doc/GdgSceneContainer_doc.pdf =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/SDK/doc/GdgSceneContainer_doc.pdf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/SDK/doc/GdgScene_doc.pdf =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/SDK/doc/GdgScene_doc.pdf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/SDK/doc/PythonApi.pdf =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/SDK/doc/PythonApi.pdf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/SDK/doc/TGF Specifications.pdf =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/SDK/doc/TGF Specifications.pdf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/SDK/doc/TGFParser.pdf =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/SDK/doc/TGFParser.pdf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/SDK/gadget_maker/Template.tgf =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/SDK/gadget_maker/Template.tgf ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/SDK/gadget_maker/config.py =================================================================== --- software/tux_framework/trunk/SDK/gadget_maker/config.py (rev 0) +++ software/tux_framework/trunk/SDK/gadget_maker/config.py 2007-10-31 15:07:58 UTC (rev 653) @@ -0,0 +1,3 @@ +# editor command +# %s will be replaced by the filename +editor = "gedit %s" Added: software/tux_framework/trunk/SDK/gadget_maker/config.pyc =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/SDK/gadget_maker/config.pyc ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/SDK/gadget_maker/maker.png =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/SDK/gadget_maker/maker.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/SDK/gadget_maker/tuxgagdetmaker.glade =================================================================== --- software/tux_framework/trunk/SDK/gadget_maker/tuxgagdetmaker.glade (rev 0) +++ software/tux_framework/trunk/SDK/gadget_maker/tuxgagdetmaker.glade 2007-10-31 15:07:58 UTC (rev 653) @@ -0,0 +1,2369 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="height_request">540</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Tux Gadget Maker</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="icon">maker.png</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + <signal name="destroy" handler="on_window1_destroy" last_modification_time="Sun, 23 Sep 2007 18:12:12 GMT"/> + + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkMenuBar" id="menubar1"> + <property name="visible">True</property> + <property name="pack_direction">GTK_PACK_DIRECTION_LTR</property> + <property name="child_pack_direction">GTK_PACK_DIRECTION_LTR</property> + + <child> + <widget class="GtkMenuItem" id="menuitem4"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Files</property> + <property name="use_underline">True</property> + + <child> + <widget class="GtkMenu" id="menuitem4_menu"> + + <child> + <widget class="GtkImageMenuItem" id="nouveau1"> + <property name="visible">True</property> + <property name="label" translatable="yes">New TGF file</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_nouveau1_activate" last_modification_time="Mon, 10 Sep 2007 05:47:06 GMT"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image50"> + <property name="visible">True</property> + <property name="stock">gtk-new</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkImageMenuItem" id="ouvrir1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Open a TGF file</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_ouvrir1_activate" last_modification_time="Mon, 10 Sep 2007 05:37:09 GMT"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image51"> + <property name="visible">True</property> + <property name="stock">gtk-open</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkImageMenuItem" id="ouvrir2"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Open a TGF directory</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_ouvrir2_activate" last_modification_time="Mon, 10 Sep 2007 05:48:51 GMT"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image52"> + <property name="visible">True</property> + <property name="stock">gtk-open</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkImageMenuItem" id="enregistrer1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Save as TGF file</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_enregistrer1_activate" last_modification_time="Sun, 23 Sep 2007 16:44:55 GMT"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image53"> + <property name="visible">True</property> + <property name="stock">gtk-save</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkImageMenuItem" id="enregistrer2"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Save as TGF directory</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_enregistrer2_activate" last_modification_time="Mon, 10 Sep 2007 05:51:51 GMT"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image54"> + <property name="visible">True</property> + <property name="stock">gtk-save</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkSeparatorMenuItem" id="separatormenuitem1"> + <property name="visible">True</property> + </widget> + </child> + + <child> + <widget class="GtkImageMenuItem" id="execute1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Execute</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_execute1_activate" last_modification_time="Sun, 23 Sep 2007 18:09:15 GMT"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image55"> + <property name="visible">True</property> + <property name="stock">gtk-execute</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkImageMenuItem" id="stop1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Stop</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_stop1_activate" last_modification_time="Mon, 15 Oct 2007 08:43:14 GMT"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image56"> + <property name="visible">True</property> + <property name="stock">gtk-stop</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkSeparatorMenuItem" id="séparateur1"> + <property name="visible">True</property> + </widget> + </child> + + <child> + <widget class="GtkImageMenuItem" id="quitter1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Quit</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_quitter1_activate" last_modification_time="Sun, 23 Sep 2007 16:44:55 GMT"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image57"> + <property name="visible">True</property> + <property name="stock">gtk-quit</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkMenuItem" id="about"> + <property name="visible">True</property> + <property name="label" translatable="yes">About</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_about_activate" last_modification_time="Mon, 10 Sep 2007 05:57:08 GMT"/> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkNotebook" id="notebook1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="show_tabs">True</property> + <property name="show_border">True</property> + <property name="tab_pos">GTK_POS_TOP</property> + <property name="scrollable">False</property> + <property name="enable_popup">False</property> + + <child> + <widget class="GtkVBox" id="vbox5"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="frame3"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed3"> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="about_name_entry"> + <property name="width_request">304</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">24</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label25"> + <property name="width_request">160</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Author :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">56</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="about_author_entry"> + <property name="width_request">304</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">72</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label26"> + <property name="width_request">160</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Version :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">104</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="about_version_entry"> + <property name="width_request">304</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">120</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label27"> + <property name="width_request">160</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Description :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">152</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label24"> + <property name="width_request">160</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Name :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="about_modify_button"> + <property name="width_request">80</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Modify</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_about_modify_button_clicked" last_modification_time="Sun, 23 Sep 2007 18:10:10 GMT"/> + </widget> + <packing> + <property name="x">104</property> + <property name="y">336</property> + </packing> + </child> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow3"> + <property name="width_request">304</property> + <property name="height_request">160</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> + <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <widget class="GtkTextView" id="about_description_textview"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="overwrite">False</property> + <property name="accepts_tab">True</property> + <property name="justification">GTK_JUSTIFY_LEFT</property> + <property name="wrap_mode">GTK_WRAP_NONE</property> + <property name="cursor_visible">True</property> + <property name="pixels_above_lines">0</property> + <property name="pixels_below_lines">0</property> + <property name="pixels_inside_wrap">0</property> + <property name="left_margin">0</property> + <property name="right_margin">0</property> + <property name="indent">0</property> + <property name="text" translatable="yes"></property> + </widget> + </child> + </widget> + <packing> + <property name="x">0</property> + <property name="y">168</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label23"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>About</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">About</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkVBox" id="vbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="frame1"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="width_request">500</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed1"> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="general_name_entry"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">16</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="general_value_entry"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">64</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label19"> + <property name="width_request">160</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Name :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label20"> + <property name="width_request">160</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Value :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">48</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="general_modify_button"> + <property name="width_request">160</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Modify</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_general_modify_button_clicked" last_modification_time="Sun, 23 Sep 2007 18:09:31 GMT"/> + </widget> + <packing> + <property name="x">8</property> + <property name="y">96</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label15"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>General</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame2"> + <property name="border_width">2</property> + <property name="height_request">150</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox4"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow2"> + <property name="width_request">500</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed2"> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="params_name_entry"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">16</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="params_value_entry"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">64</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label21"> + <property name="width_request">160</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Name :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label22"> + <property name="width_request">160</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Value :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">48</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="params_modify_button"> + <property name="width_request">160</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Modify</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_params_modify_button_clicked" last_modification_time="Sun, 23 Sep 2007 18:09:42 GMT"/> + </widget> + <packing> + <property name="x">8</property> + <property name="y">96</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="params_add_button"> + <property name="width_request">160</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Add</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_params_add_button_clicked" last_modification_time="Sun, 23 Sep 2007 18:09:48 GMT"/> + </widget> + <packing> + <property name="x">8</property> + <property name="y">128</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="params_delete_button"> + <property name="width_request">160</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Delete</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_params_delete_button_clicked" last_modification_time="Sun, 23 Sep 2007 18:09:55 GMT"/> + </widget> + <packing> + <property name="x">8</property> + <property name="y">160</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label16"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Parameters</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + <packing> + <property name="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes">Settings</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> + + <child> + <widget class="GtkVBox" id="vbox6"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="frame5"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox5"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow4"> + <property name="width_request">500</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed5"> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="strings_lg_add_button"> + <property name="width_request">160</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Add</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_strings_lg_add_button_clicked" last_modification_time="Sun, 23 Sep 2007 18:10:20 GMT"/> + </widget> + <packing> + <property name="x">8</property> + <property name="y">48</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="strings_lg_delete_button"> + <property name="width_request">160</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Delete</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_strings_lg_delete_button_clicked" last_modification_time="Sun, 23 Sep 2007 18:10:25 GMT"/> + </widget> + <packing> + <property name="x">8</property> + <property name="y">80</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label31"> + <property name="width_request">160</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Lang list :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkComboBoxEntry" id="strings_lang_comboboxentry"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="items" translatable="yes"><ar_ALL> Arabian +<da_ALL> Danish +<nl_BE> Dutch Belgian +<nl_NL> Dutch Netherland +<en_GB> English Great Britain +<en_US> English United States +<fr_ALL> French +<de_ALL> German +<it_ALL> Italian +<no_ALL> Norwegian +<pt_ALL> Portuguese +<es_ALL> Spanish +<sv_ALL> Swedish</property> + <property name="add_tearoffs">False</property> + <property name="has_frame">True</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">16</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label29"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Languages</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame6"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment6"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox6"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow5"> + <property name="width_request">500</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed6"> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="strings_st_name_entry"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">16</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label32"> + <property name="width_request">160</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Name :</property> + <property name="use_underline">False</... [truncated message content] |
From: remi <c2m...@c2...> - 2007-10-31 15:06:35
|
Author: remi Date: 2007-10-31 16:06:28 +0100 (Wed, 31 Oct 2007) New Revision: 652 Removed: software/tux_framework/ Log: DELETE |
From: Paul_R <c2m...@c2...> - 2007-10-31 14:14:54
|
Author: Paul_R Date: 2007-10-31 15:14:54 +0100 (Wed, 31 Oct 2007) New Revision: 651 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp software/gadgets/light_monitor/trunk/Light_monitor/about.xml Log: * Corrected a bug in the init function. Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp 2007-10-31 10:39:38 UTC (rev 650) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp 2007-10-31 14:14:54 UTC (rev 651) @@ -33,7 +33,7 @@ if _me.get_param('Sample') != (0 or None or '' or '1') and float(_me.get_param('Sample')) != measure.sample: measure.val_table = [0] * int(_me.get_param('Sample')) measure.sample = float(_me.get_param('Sample')) -#measure.disable_light = _me.get_param('disable') +measure.disable_light = _me.get_param('disable') measure.threshold_behavior = _me.get_param('behavior_file_threshold') measure.change_behavior = _me.get_param('behavior_file_change') measure.event_tab = _me.get_param('config') Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-31 10:39:38 UTC (rev 650) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-31 14:14:54 UTC (rev 651) @@ -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_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.tgf =================================================================== (Binary files differ) |
From: remi <c2m...@c2...> - 2007-10-31 10:39:39
|
Author: remi Date: 2007-10-31 11:39:38 +0100 (Wed, 31 Oct 2007) New Revision: 650 Modified: api/python/trunk/tuxapi_class.py Log: ADD: wav.destroy method Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2007-10-30 15:52:35 UTC (rev 649) +++ api/python/trunk/tuxapi_class.py 2007-10-31 10:39:38 UTC (rev 650) @@ -212,6 +212,7 @@ self.daemon._tcp_threads_join() self.tts._tcp_threads_join() self.micro.destroy() + self.wav.destroy() self.exit_flag=True for main_thread in self.main_thread_list: if self.print_debug_thread: @@ -4275,6 +4276,7 @@ def destroy(self): self.on_wav_raw.destroy() + self.stop() def speaking_stack_add(self, speaking_conf): self.speaking_stack_mutex.acquire() @@ -5065,6 +5067,9 @@ self.parent = parent self.__wav_path = "" self.__wav_length = 0 + + def destroy(self): + self.stop() def __load(self, wav_path): if os.path.isfile(wav_path): |
From: Paul_R <c2m...@c2...> - 2007-10-30 15:52:46
|
Author: Paul_R Date: 2007-10-30 16:52:35 +0100 (Tue, 30 Oct 2007) New Revision: 649 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 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: * Added a check box to disable measurement when the eyes are closed Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade =================================================================== (Binary files differ) 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-30 15:00:42 UTC (rev 648) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-30 15:52:35 UTC (rev 649) @@ -132,6 +132,7 @@ self.get_widget('cbb_conf_event').set_active(0) path = _me.get_path('data')+'/Data' self.get_widget('conf_behavior').set_filename(path) + self.get_widget('chkDisable').set_active(_me.get_param('disable')) for i in range(len(self.measure.event_tab)): @@ -158,6 +159,8 @@ self.get_widget("lbl_conf_rate").set_text(_me.string('conf_lblRate')) self.get_widget("lblControlFrame").set_text(_me.string('conf_lblControl')) self.get_widget("lblScript").set_text(_me.string('MainBehavior')) + + self.get_widget('chkDisable').set_label(_me.string('disable')) ########################################################### @@ -389,6 +392,9 @@ _me.set_var('notify_delay', int(self.get_widget("delay_spinbutton").get_value())) + _me.set_param('disable', self.get_widget('chkDisable').get_active()) + self.measure.disable_light = self.get_widget('chkDisable').get_active() + self.get_widget("window1").destroy() Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp 2007-10-30 15:00:42 UTC (rev 648) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/init.pyp 2007-10-30 15:52:35 UTC (rev 649) @@ -33,7 +33,7 @@ if _me.get_param('Sample') != (0 or None or '' or '1') and float(_me.get_param('Sample')) != measure.sample: measure.val_table = [0] * int(_me.get_param('Sample')) measure.sample = float(_me.get_param('Sample')) - +#measure.disable_light = _me.get_param('disable') measure.threshold_behavior = _me.get_param('behavior_file_threshold') measure.change_behavior = _me.get_param('behavior_file_change') measure.event_tab = _me.get_param('config') 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-30 15:00:42 UTC (rev 648) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-30 15:52:35 UTC (rev 649) @@ -177,6 +177,9 @@ self.txtsearch = ' ' self.search_event = [] self.__fault = False + self.light_backup = 0 + self.disable_light = False + self.timeout = 0 self.GUI_on = False self.start_flag = True @@ -396,9 +399,24 @@ if self.rate_backup != self.rate and self.search_light_flag == False: self.rate_has_changed() - + + if self.timeout: + self.timeout -= 1 + + val = (args[0] * 256) + args[1] if self.tick <= time.time(): self.tick = time.time() + self.rate + + + if self.disable_light == True: + if tux.status.eyes_closed() == 0: + val = self.light_backup + self.timeout = 5 + elif self.timeout == 0: + self.light_backup = val + else: + val = self.light_backup + if self.event != 0 and self.event_flag == True: self.val_table_event.append(self.event) else: @@ -406,7 +424,7 @@ self.val_table_event.pop(0) self.event = 0 - val = (args[0] * 256) + args[1] + self.val_table.append(val) self.val_table.pop(0) if self.GUI_on: 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-30 15:00:42 UTC (rev 648) +++ software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-30 15:52:35 UTC (rev 649) @@ -1,17 +1,9 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> - <conf_lblIncrease type='str'>Augmente</conf_lblIncrease> - <conf_lblThreshold type='str'>Seuil</conf_lblThreshold> <gui_conf_remote_title type='str'>Contrôle</gui_conf_remote_title> <conf_lblRaise type='str'>Accroissement</conf_lblRaise> - <widget_lblTest type='str'>Notifications</widget_lblTest> - <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <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 : Deux grands types d'évènements peuvent avoir lieu, contenant chacun diverses options : @@ -48,76 +40,85 @@ Une zone de test comportant deux boutons permettent à Tux de rechercher la direction la plus lumineuse, ou la plus sombre. Deux scripts de bases se trpouvent dans /tmp/Light_monitor/Data</help_text> + <conf_lblSample type='str'>Points</conf_lblSample> + <widget_lblLight type='str'>Trouver lumière</widget_lblLight> + <conf_lblNotifiedBehavior type='str'>Notifié</conf_lblNotifiedBehavior> + <Change type='str'>La lumière a changé</Change> + <Both type='str'>La lumière a passé le seuil</Both> + <widget_lblRaise type='str'>Augmentation</widget_lblRaise> + <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> + <conf_lblBehavior type='str'>Comportement</conf_lblBehavior> + <name_to_read type='str'>Moniteur de lumière</name_to_read> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> + <conf_lblValue type='str'>Valeur (%)</conf_lblValue> + <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> + <widget_lblTest type='str'>Notifications</widget_lblTest> + <conf_lblThreshold type='str'>Seuil</conf_lblThreshold> + <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <power_supply type='str'>Vous devez deconnecter l'alimentation</power_supply> + <widget_lblNotified type='str'>Notifé</widget_lblNotified> + <conf_btnBehavior type='str'>Supprimer</conf_btnBehavior> + <conf_lblType type='str'>Type</conf_lblType> + <Drop type='str'>La lumière a chuté</Drop> + <widget_lblEvent type='str'>Evènement</widget_lblEvent> + <dark4 type='str'>C'est l'endroit le plus sombre !</dark4> + <widget_lblBoth type='str'>Deux directions</widget_lblBoth> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <search type='str'>Je cherche ...</search> + <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> + <ChangeD type='str'>La lumière a chuté puis augmenté</ChangeD> + <widget_lblThreshold type='str'>Seuil</widget_lblThreshold> + <light2 type='str'>J'en vois encore plus ici !</light2> + <light3 type='str'>ou ici ?</light3> + <light1 type='str'>Je vois de la lumière ici...</light1> + <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> <ChangeU type='str'>La lumière a augmenté puis chuté</ChangeU> - <conf_lblChange type='str'>Changement</conf_lblChange> + <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <widget_lblDark type='str'>Trouver ombre</widget_lblDark> + <Increase type='str'>La lumière est passée en dessus du seuil</Increase> <conf_lblBoth type='str'>Deux directions</conf_lblBoth> - <widget_lblBtnApply type='str'>Appliquer</widget_lblBtnApply> - <widget_lblChangeU type='str'>Changement sup.</widget_lblChangeU> <conf_lblDecrease type='str'>Diminue</conf_lblDecrease> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> - <conf_lblChangeU type='str'>Augmente et chute</conf_lblChangeU> + <widget_lblValue type='str'>Valeur (%)</widget_lblValue> <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> - <MainBehavior type='str'>Comportement principal</MainBehavior> - <gui_conf_rate_lb type='str'>Taux de rafraichissement :</gui_conf_rate_lb> <mainscript type='str'>J'ai trouvé la lumière !</mainscript> + <widget_lblDrop type='str'>Chute</widget_lblDrop> + <widget_lblIncrease type='str'>Accroissement</widget_lblIncrease> + <conf_btnAdd type='str'>Ajouter</conf_btnAdd> + <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> + <conf_lblDrop type='str'>Chute</conf_lblDrop> + <Raise type='str'>La lumière a augmenté</Raise> + <Decrease type='str'>La lumière est passée en dessous du seuil</Decrease> + <widget_lblDisplayThreshold type='str'>Afficher le seuil sur le graph.</widget_lblDisplayThreshold> + <conf_lblRate type='str'>Taux de rafraichissement</conf_lblRate> + <conf_lblControl type='str'>Contrôle</conf_lblControl> <conf_btnRemove type='str'>Enlever</conf_btnRemove> + <conf_lblIncrease type='str'>Augmente</conf_lblIncrease> + <widget_lblChangeU type='str'>Changement sup.</widget_lblChangeU> + <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> + <conf_lblChange type='str'>Changement</conf_lblChange> + <widget_lblBtnApply type='str'>Appliquer</widget_lblBtnApply> + <gui_conf_rate_lb type='str'>Taux de rafraichissement :</gui_conf_rate_lb> + <conf_lblChangeU type='str'>Augmente et chute</conf_lblChangeU> <gui_conf_delay_lb type='str'>Délai (sec)</gui_conf_delay_lb> - <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> - <widget_lblValue type='str'>Valeur (%)</widget_lblValue> - <power_supply type='str'>Vous devez deconnecter l'alimentation</power_supply> - <conf_lblSample type='str'>Points</conf_lblSample> - <conf_lblType type='str'>Type</conf_lblType> - <Change type='str'>La lumière a changé</Change> - <Both type='str'>La lumière a passé le seuil</Both> + <widget_lblChange type='str'>Changement</widget_lblChange> <conf_btnModify type='str'>Modifier</conf_btnModify> - <widget_lblDrop type='str'>Chute</widget_lblDrop> - <widget_lblNotified type='str'>Notifé</widget_lblNotified> <dark1 type='str'>Il fait sombre ici !</dark1> - <widget_lblIncrease type='str'>Accroissement</widget_lblIncrease> <dark3 type='str'>hmm, il fait toujours plus sombre ...</dark3> - <conf_btnAdd type='str'>Ajouter</conf_btnAdd> + <dark2 type='str'>Et encore plus là !</dark2> <dark5 type='str'>Je ne peux pas trouver l'endroit le plus sombre ...</dark5> - <dark4 type='str'>C'est l'endroit le plus sombre !</dark4> + <widget_lblDecrease type='str'>Decroissance</widget_lblDecrease> <gui_conf_sample_lb type='str'>Nombre de points :</gui_conf_sample_lb> - <widget_lblDecrease type='str'>Decroissance</widget_lblDecrease> - <widget_lblEvent type='str'>Evènement</widget_lblEvent> - <conf_lblNotifiedBehavior type='str'>Notifié</conf_lblNotifiedBehavior> - <light2 type='str'>J'en vois encore plus ici !</light2> - <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> - <widget_lblRaise type='str'>Augmentation</widget_lblRaise> - <ChangeD type='str'>La lumière a chuté puis augmenté</ChangeD> - <widget_lblBoth type='str'>Deux directions</widget_lblBoth> - <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> + <disable type='str'>Interdire les mesures quand les yeux sont fermés</disable> <conf_lblDefaultBehavior type='str'>Comportement pas défaut</conf_lblDefaultBehavior> - <widget_lblDisplayThreshold type='str'>Afficher le seuil sur le graph.</widget_lblDisplayThreshold> - <conf_lblBehavior type='str'>Comportement</conf_lblBehavior> - <dark2 type='str'>Et encore plus là !</dark2> - <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> - <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> - <Raise type='str'>La lumière a augmenté</Raise> + <speaker_name type='str'>Bruno8k</speaker_name> + <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> - <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> - <light3 type='str'>ou ici ?</light3> - <light1 type='str'>Je vois de la lumière ici...</light1> - <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> - <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> - <conf_lblControl type='str'>Contrôle</conf_lblControl> - <widget_lblDark type='str'>Trouver ombre</widget_lblDark> - <widget_lblThreshold type='str'>Seuil</widget_lblThreshold> + <MainBehavior type='str'>Comportement principal</MainBehavior> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-30 15:00:42 UTC (rev 648) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-30 15:52:35 UTC (rev 649) @@ -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_name type='str'>light_monitor</gadget_name> - <gadget_description type='str'>Light monitor for tux droid</gadget_description> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-30 15:00:42 UTC (rev 648) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-30 15:52:35 UTC (rev 649) @@ -10,22 +10,23 @@ <changeD_rad type='bool'>False</changeD_rad> <threshold type='float'>50.0</threshold> <decrease_rad type='bool'>False</decrease_rad> - <Sample type='float'>500.0</Sample> + <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='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> <drop_time type='float'>1.0</drop_time> + <disable type='bool'>False</disable> <changeU type='float'>10.0</changeU> <raise_time type='float'>1.0</raise_time> <drop type='float'>10.0</drop> + <drop_rad type='bool'>True</drop_rad> <MainScript type='str'> </MainScript> - <behavior_file_threshold type='NoneType'>None</behavior_file_threshold> + <Sample type='float'>500.0</Sample> <threshold_chk type='bool'>False</threshold_chk> <Rate type='float'>0.1</Rate> <changeD_time type='float'>1.0</changeD_time> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-30 15:00:42 UTC (rev 648) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-30 15:52:35 UTC (rev 649) @@ -1,16 +1,9 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> - <conf_lblIncrease type='str'>Increase</conf_lblIncrease> - <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> <conf_lblRaise type='str'>Raise</conf_lblRaise> - <power_supply type='str'>You must disconnect the power supply</power_supply> - <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> - <Increase type='str'>The light level exceeded the threshold</Increase> - <conf_btnRemove type='str'>Remove</conf_btnRemove> - <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <help_text type='str'>-- The events: Two main types of events can take place, each containing various options: @@ -47,77 +40,85 @@ In the test part with two buttons you can make Tux search for the light source or darkest spot. Two example scripts can be found in /tmp/Light_monitor/Data.</help_text> + <conf_lblSample type='str'>Samples</conf_lblSample> + <widget_lblLight type='str'>Search light</widget_lblLight> + <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> + <Change type='str'>The light level changed</Change> + <Both type='str'>The light level reached the threshold</Both> + <widget_lblRaise type='str'>Raise</widget_lblRaise> + <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <name_to_read type='str'>Light monitor</name_to_read> + <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <widget_lblSet type='str'>Add to config</widget_lblSet> + <conf_lblValue type='str'>Value (%)</conf_lblValue> + <conf_lblTime type='str'>Time (sec.)</conf_lblTime> + <widget_lblTest type='str'>Notifications</widget_lblTest> + <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> + <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> + <power_supply type='str'>You must disconnect the power supply</power_supply> + <widget_lblNotified type='str'>Notified</widget_lblNotified> + <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> + <conf_lblType type='str'>Type</conf_lblType> + <Drop type='str'>The light level dropped</Drop> + <widget_lblEvent type='str'>Event</widget_lblEvent> + <dark4 type='str'>This is the darkest spot.</dark4> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <search type='str'>I seek ...</search> + <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> + <ChangeD type='str'>The light level dropped and raised</ChangeD> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <light2 type='str'>ow wait, even lighter here.</light2> + <light3 type='str'>or here ...</light3> + <light1 type='str'>Seeing more light over here.</light1> + <light4 type='str'>I think the light is coming from this direction.</light4> + <light5 type='str'>I can't find the direction of the light.</light5> <ChangeU type='str'>The light level raised and dropped</ChangeU> - <conf_lblChange type='str'>Change</conf_lblChange> + <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> + <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <widget_lblDark type='str'>Search darkness</widget_lblDark> + <Increase type='str'>The light level exceeded the threshold</Increase> <conf_lblBoth type='str'>Both</conf_lblBoth> - <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> - <widget_lblChangeU type='str'>Raise and drop</widget_lblChangeU> <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <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> - <MainBehavior type='str'>Main behavior</MainBehavior> + <mainscript type='str'>I've found the light !</mainscript> + <widget_lblDrop type='str'>Drop</widget_lblDrop> + <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> + <conf_btnAdd type='str'>Add</conf_btnAdd> + <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> + <conf_lblDrop type='str'>Drop</conf_lblDrop> + <Raise type='str'>The light level raised</Raise> + <Decrease type='str'>The light level passed below the threshold</Decrease> + <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> + <conf_lblRate type='str'>Refresh rate</conf_lblRate> + <conf_lblControl type='str'>Control</conf_lblControl> + <conf_btnRemove type='str'>Remove</conf_btnRemove> + <conf_lblIncrease type='str'>Increase</conf_lblIncrease> + <widget_lblChangeU type='str'>Raise and drop</widget_lblChangeU> + <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> + <conf_lblChange type='str'>Change</conf_lblChange> + <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> - <mainscript type='str'>I've found the light !</mainscript> - <light2 type='str'>ow wait, even lighter here.</light2> + <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <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> - <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> - <Change type='str'>The light level changed</Change> - <widget_lblDark type='str'>Search darkness</widget_lblDark> - <Both type='str'>The light level reached the threshold</Both> + <widget_lblChange type='str'>Change</widget_lblChange> <conf_btnModify type='str'>Modify</conf_btnModify> - <widget_lblDrop type='str'>Drop</widget_lblDrop> - <widget_lblNotified type='str'>Notified</widget_lblNotified> <dark1 type='str'>It's pretty dark here.</dark1> - <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <dark3 type='str'>hmm, but it's even more dark over here!</dark3> - <conf_btnAdd type='str'>Add</conf_btnAdd> + <dark2 type='str'>And darker here.</dark2> <dark5 type='str'>I can't find the darkest spot...</dark5> - <dark4 type='str'>This is the darkest spot.</dark4> + <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> - <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> - <widget_lblEvent type='str'>Event</widget_lblEvent> - <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> - <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> - <widget_lblRaise type='str'>Raise</widget_lblRaise> - <ChangeD type='str'>The light level dropped and raised</ChangeD> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> - <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> + <disable type='str'>Disable measurement when the eyes are closed</disable> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> - <dark2 type='str'>And darker here.</dark2> - <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> + <speaker_name type='str'>Ryan8k</speaker_name> <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> - <Raise type='str'>The light level raised</Raise> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> - <widget_lblSet type='str'>Add to config</widget_lblSet> - <light3 type='str'>or here ...</light3> - <light1 type='str'>Seeing more light over here.</light1> - <Decrease type='str'>The light level passed below the threshold</Decrease> - <conf_lblValue type='str'>Value (%)</conf_lblValue> - <light4 type='str'>I think the light is coming from this direction.</light4> - <conf_lblRate type='str'>Refresh rate</conf_lblRate> <Threshold type='str'>The light reached the threshold</Threshold> - <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> - <conf_lblTime type='str'>Time (sec.)</conf_lblTime> - <conf_lblControl type='str'>Control</conf_lblControl> - <widget_lblTest type='str'>Notifications</widget_lblTest> - <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> + <MainBehavior type='str'>Main behavior</MainBehavior> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2007-10-30 15:00:45
|
Author: Paul_R Date: 2007-10-30 16:00:42 +0100 (Tue, 30 Oct 2007) New Revision: 648 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 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: * Change the help file Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade =================================================================== (Binary files differ) 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-30 09:02:42 UTC (rev 647) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-30 15:00:42 UTC (rev 648) @@ -243,6 +243,9 @@ for i in range(len(self.measure.event_tab)): self.add_row(i) + path = _me.get_path('data')+'/Data' + self.get_widget('conf_behavior').set_filename(path) + ########################################################### # # On row deleted @@ -258,6 +261,9 @@ for i in range(len(self.measure.event_tab)): self.add_row(i) + path = _me.get_path('data')+'/Data' + self.get_widget('conf_behavior').set_filename(path) + ########################################################### # # On row added @@ -286,6 +292,9 @@ self.value_list.clear() for i in range(len(self.measure.event_tab)): self.add_row(i) + if self.measure.GUI_on == False: + path = _me.get_path('data')+'/Data' + self.get_widget('conf_behavior').set_filename(path) def verify_tab(self, tab): 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-30 09:02:42 UTC (rev 647) +++ software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-30 15:00:42 UTC (rev 648) @@ -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 : @@ -44,7 +45,9 @@ Lorsque cette fenêtre est affichée, les évènements enregistrés dans la fenêtre de configuration ne sont plus notifiés. Cette fenêtre permet de tester diverses configurations et de les ajouter dans le tableau de configuration. -Une zone de test comportant deux boutons permettent à Tux de rechercher la direction la plus lumineuse, ou la plus sombre.</help_text> +Une zone de test comportant deux boutons permettent à Tux de rechercher la direction la plus lumineuse, ou la plus sombre. + +Deux scripts de bases se trpouvent dans /tmp/Light_monitor/Data</help_text> <ChangeU type='str'>La lumière a augmenté puis chuté</ChangeU> <conf_lblChange type='str'>Changement</conf_lblChange> <conf_lblBoth type='str'>Deux directions</conf_lblBoth> @@ -60,7 +63,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 +71,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 +98,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 +113,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/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-30 09:02:42 UTC (rev 647) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-30 15:00:42 UTC (rev 648) @@ -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_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> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-30 09:02:42 UTC (rev 647) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-30 15:00:42 UTC (rev 648) @@ -10,22 +10,22 @@ <changeD_rad type='bool'>False</changeD_rad> <threshold type='float'>50.0</threshold> <decrease_rad type='bool'>False</decrease_rad> - <behavior_file_threshold type='NoneType'>None</behavior_file_threshold> + <Sample type='float'>500.0</Sample> <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='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> <drop_time type='float'>1.0</drop_time> <changeU type='float'>10.0</changeU> <raise_time type='float'>1.0</raise_time> <drop type='float'>10.0</drop> - <drop_rad type='bool'>True</drop_rad> <MainScript type='str'> </MainScript> - <Sample type='float'>500.0</Sample> + <behavior_file_threshold type='NoneType'>None</behavior_file_threshold> <threshold_chk type='bool'>False</threshold_chk> <Rate type='float'>0.1</Rate> <changeD_time type='float'>1.0</changeD_time> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-30 09:02:42 UTC (rev 647) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-30 15:00:42 UTC (rev 648) @@ -3,16 +3,14 @@ <conf_lblIncrease type='str'>Increase</conf_lblIncrease> <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> - <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblRaise type='str'>Raise</conf_lblRaise> - <widget_lblSet type='str'>Add to config</widget_lblSet> + <power_supply type='str'>You must disconnect the power supply</power_supply> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <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> - <speaker_name type='str'>Ryan8k</speaker_name> <help_text type='str'>-- The events: Two main types of events can take place, each containing various options: @@ -46,8 +44,10 @@ When this window is displayed, the events stored in the settings window are not notified. This window makes it possible to try various configurations and to add them in the settings table. -In the test part with two buttons you can make Tux search for the light source or darkest spot.</help_text> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> +In the test part with two buttons you can make Tux search for the light source or darkest spot. + +Two example scripts can be found in /tmp/Light_monitor/Data.</help_text> + <ChangeU type='str'>The light level raised and dropped</ChangeU> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> @@ -57,21 +57,23 @@ <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> + <MainBehavior type='str'>Main behavior</MainBehavior> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <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> - <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> - <power_supply type='str'>You must disconnect the power supply</power_supply> + <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> <Change type='str'>The light level changed</Change> - <conf_lblValue type='str'>Value (%)</conf_lblValue> + <widget_lblDark type='str'>Search darkness</widget_lblDark> <Both type='str'>The light level reached the threshold</Both> <conf_btnModify type='str'>Modify</conf_btnModify> - <widget_lblTest type='str'>Notifications</widget_lblTest> <widget_lblDrop type='str'>Drop</widget_lblDrop> <widget_lblNotified type='str'>Notified</widget_lblNotified> <dark1 type='str'>It's pretty dark here.</dark1> @@ -86,36 +88,36 @@ <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <widget_lblRaise type='str'>Raise</widget_lblRaise> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> <ChangeD type='str'>The light level dropped and raised</ChangeD> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> + <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <dark2 type='str'>And darker here.</dark2> <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> - <widget_lblDark type='str'>Search darkness</widget_lblDark> - <light2 type='str'>ow wait, even lighter here.</light2> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <widget_lblSet type='str'>Add to config</widget_lblSet> <light3 type='str'>or here ...</light3> <light1 type='str'>Seeing more light over here.</light1> <Decrease type='str'>The light level passed below the threshold</Decrease> - <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> + <conf_lblValue type='str'>Value (%)</conf_lblValue> <light4 type='str'>I think the light is coming from this direction.</light4> <conf_lblRate type='str'>Refresh rate</conf_lblRate> <Threshold type='str'>The light reached the threshold</Threshold> - <MainBehavior type='str'>Main behavior</MainBehavior> - <ChangeU type='str'>The light level raised and dropped</ChangeU> + <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> - <light5 type='str'>I can't find the direction of the light.</light5> + <widget_lblTest type='str'>Notifications</widget_lblTest> + <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: remi <c2m...@c2...> - 2007-10-30 09:02:44
|
Author: remi Date: 2007-10-30 10:02:42 +0100 (Tue, 30 Oct 2007) New Revision: 647 Modified: api/python/trunk/tuxapi_class.py Log: A Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2007-10-29 15:55:44 UTC (rev 646) +++ api/python/trunk/tuxapi_class.py 2007-10-30 09:02:42 UTC (rev 647) @@ -5193,6 +5193,7 @@ tux.micro.on tux.micro.off tux.micro.capture_start + tux.micro.capture_start_free tux.micro.capture_stop """ @@ -5210,6 +5211,7 @@ self.__capture_length = 0 self.__capture_buffer = [] self.__capture_idx = 0 + self.__capture_mutex = threading.Lock() def destroy(self): self.off() @@ -5219,14 +5221,18 @@ self.__thread.join() def __on_capture_buffer(self, buffer): + self.__capture_mutex.acquire() if not self.__capturing: + self.__capture_mutex.release() return for val in buffer: self.__capture_buffer.append(val) if self.__capture_length != 0: if (self.__capture_length * 8000) <= len(self.__capture_buffer): + self.__capture_mutex.release() self.capture_stop() return + self.__capture_mutex.release() def capture_start(self, out_path, length = 0): """ @@ -5243,6 +5249,25 @@ >>> tux.micro.capture_start('/home/remi/Desktop/test.wav', 10.0) >>> tux.micro.capture_start('/home/remi/Desktop/test.wav') """ + self.capture_start_free(out_path, length) + while self.__capturing: + time.sleep(0.05) + + def capture_start_free(self, out_path, length = 0): + """ + Write the stream in a wav file. + + Parameters: + "out_path" as string : path of the wave file + "length" as float : duration of the capture in seconds + When this parameters is omitted, the length + is infinite. You must stop the recording + with 'tux.micro.capture_stop()' + + Examples: + >>> tux.micro.capture_start_free('/home/remi/Desktop/test.wav', 10.0) + >>> tux.micro.capture_start_free('/home/remi/Desktop/test.wav') + """ if self.__capturing: return False if not self.__state: @@ -5260,9 +5285,11 @@ """ if not self.__capturing: return + self.__capture_mutex.acquire() self.__capturing = False self.on_buffer.disconnect(self.__capture_idx) time.sleep(0.2) + self.__capture_mutex.release() self.__write_capture() self.on_capture_stop.notify() @@ -5270,16 +5297,18 @@ try: import wave except: - print "ERROR : import wave" return freqech = 8000 sound_str = "" for val in self.__capture_buffer: sound_str += chr(val) - wavfile = wave.open(self.__capture_path, 'w') - wavfile.setparams((1, 1, freqech , len(self.__capture_buffer), 'NONE', 'not compressed')) - wavfile.writeframes(sound_str) - wavfile.close() + try: + wavfile = wave.open(self.__capture_path, 'w') + wavfile.setparams((1, 1, freqech , len(self.__capture_buffer), 'NONE', 'not compressed')) + wavfile.writeframes(sound_str) + wavfile.close() + except: + pass def on(self): """ @@ -5333,15 +5362,15 @@ def __send_energy_monitoring(self, buffer): def log_value(value): - return int(math.log(value) / math.log(255) * 255) + if value == 0: + return 0 + return int(math.log(value) / math.log(128) * 128) try: e_total = 0 for val in buffer: e_total += abs(val - 127) - e_total /= 200 - if e_total > 255: - e_total = 255 + e_total /= 800 e_total = log_value(e_total) e_table = [] @@ -5351,9 +5380,7 @@ i_e = i_b + 200 for j in range(i_b, i_e): e_m += abs(buffer[j] - 127) - e_m /= 50 - if e_m > 255: - e_m = 255 + e_m /= 200 e_m = log_value(e_m) e_table.append(e_m) except: |
From: Paul_R <c2m...@c2...> - 2007-10-29 15:55:46
|
Author: Paul_R Date: 2007-10-29 16:55:44 +0100 (Mon, 29 Oct 2007) New Revision: 646 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml Log: * Changed some TTS messages Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-29 15:51:15 UTC (rev 645) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-29 15:55:44 UTC (rev 646) @@ -11,7 +11,7 @@ <widget_lblControl type='str'>Contrôle</widget_lblControl> <Increase type='str'>Le niveau de la batterie est passé en dessus du seuil</Increase> <full type='str'>Les batteries sont pleines</full> - <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> + <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <lblLowThreshold type='str'>Limite inférieure</lblLowThreshold> <help_text type='str'>-- Les évènements : Deux grands types d'évènements peuvent avoir lieu, contenant chacun diverses options : @@ -73,7 +73,7 @@ <MainBehavior type='str'>Comportement principal</MainBehavior> <speaker_name type='str'>Bruno8k</speaker_name> <conf_lblSample type='str'>Points</conf_lblSample> - <conf_lblType type='str'>Type</conf_lblType> + <charging type='str'>En charge</charging> <Change type='str'>Le niveau de la batterie a changé</Change> <Both type='str'>Le niveau de la batterie a passé le seuil</Both> <conf_btnModify type='str'>Modifier</conf_btnModify> @@ -82,7 +82,7 @@ <widget_lblIncrease type='str'>Accroissement</widget_lblIncrease> <widget_lblRaise type='str'>Augmentation</widget_lblRaise> <conf_btnAdd type='str'>Ajouter</conf_btnAdd> - <on_battery type='str'>et alimenté par les batteries</on_battery> + <on_battery type='str'>et je suis alimenté par les batteries</on_battery> <widget_lblDecrease type='str'>Decroissance</widget_lblDecrease> <gui_conf_sample_lb type='str'>Nombre de points :</gui_conf_sample_lb> <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> @@ -102,18 +102,18 @@ <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Changement</widget_lblChange> <name_to_read type='str'>Moniteur de batteries</name_to_read> - <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> <Drop type='str'>Le niveau de la batterie a chuté</Drop> <conf_lblDrop type='str'>Chute</conf_lblDrop> - <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> <Raise type='str'>Le niveau de la batterie a augmenté</Raise> - <charging type='str'>En charge</charging> + <conf_lblType type='str'>Type</conf_lblType> <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> <Decrease type='str'>Le niveau de la batterie est passé en dessous du seuil</Decrease> <conf_lblValue type='str'>Valeur (V)</conf_lblValue> <conf_lblRate type='str'>Rafraichissement</conf_lblRate> <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> - <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> <conf_lblControl type='str'>Contrôle</conf_lblControl> <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-29 15:51:15 UTC (rev 645) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-29 15:55:44 UTC (rev 646) @@ -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_name type='str'>battery_monitor</gadget_name> - <gadget_author type='str'>Paul Rathgeb</gadget_author> <gadget_description type='str'>Battery monitor for tux droid</gadget_description> - <gadget_version type='str'>0.0.1</gadget_version> </about> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-29 15:51:15 UTC (rev 645) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-29 15:55:44 UTC (rev 646) @@ -1,11 +1,11 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> + <Sample type='float'>600.0</Sample> + <low_threshold type='float'>4.8</low_threshold> <chkMotors type='bool'>True</chkMotors> - <low_threshold type='float'>4.8</low_threshold> <MainScript type='str'>None</MainScript> - <Sample type='float'>600.0</Sample> + <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> <Rate type='float'>1.0</Rate> <high_threshold type='float'>6.0</high_threshold> <config type='list'>[]</config> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-29 15:51:15 UTC (rev 645) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-29 15:55:44 UTC (rev 646) @@ -1,22 +1,17 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> <conf_lblIncrease type='str'>Increase</conf_lblIncrease> - <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> - <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <battery type='str'>On battery</battery> <conf_lblRaise type='str'>Raise</conf_lblRaise> - <widget_lblTest type='str'>Notifications</widget_lblTest> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> <Increase type='str'>The battery level exceeded the threshold</Increase> - <conf_btnModify type='str'>Modify</conf_btnModify> - <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> - <lblLowThreshold type='str'>Lower limit</lblLowThreshold> - <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> - <lblMotors type='str'>Disable measure when the motors are running</lblMotors> + <full type='str'>The level of the batteries is full</full> + <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> + <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <help_text type='str'>--The events: Two main types of events can take place, each containing various options: @@ -52,6 +47,7 @@ When this window is displayed, the events stored in the settings window are not notified. This window makes it possible to try various configurations and to add them in the settings table.</help_text> <end_of_charge type='str'>The load of the battery is finished</end_of_charge> + <conf_btnRemove type='str'>Remove</conf_btnRemove> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> @@ -61,61 +57,65 @@ <gui_conf_update_title type='str'>Update</gui_conf_update_title> <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <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> <absolute_threshold_high type='str'>The batteries are full</absolute_threshold_high> + <conf_lblType type='str'>Type</conf_lblType> <mainscript type='str'>I've found the light !</mainscript> - <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <MainBehavior type='str'>Main behavior</MainBehavior> + <lblLowThreshold type='str'>Lower limit</lblLowThreshold> <plugged type='str'>Plugged</plugged> + <ChangeU type='str'>The battery level raised and dropped</ChangeU> <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> - <charge type='str'>and the batteries are being charged</charge> + <charge type='str'>and the batteries are recharging</charge> <gui_conf_about_title type='str'>About</gui_conf_about_title> <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> <low type='str'>The level of the batteries is weak</low> - <conf_btnAdd type='str'>Add</conf_btnAdd> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <speaker_name type='str'>Ryan8k</speaker_name> <conf_lblSample type='str'>Samples</conf_lblSample> <charging type='str'>Charging</charging> <Change type='str'>The battery level changed</Change> - <conf_lblValue type='str'>Value (V)</conf_lblValue> <Both type='str'>The battery level reached the threshold</Both> - <full type='str'>The level of the batteries is full</full> + <conf_btnModify type='str'>Modify</conf_btnModify> <widget_lblEvent type='str'>Event</widget_lblEvent> <normal type='str'>The level of the batteries is good</normal> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <widget_lblRaise type='str'>Raise</widget_lblRaise> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> - <on_battery type='str'>and tux is fed by the batteries</on_battery> + <conf_btnAdd type='str'>Add</conf_btnAdd> + <on_battery type='str'>and I'm powered by the battery</on_battery> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> <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_window_title type='str'>Parameters</gui_conf_window_title> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> + <ChangeD type='str'>The battery level dropped and raised</ChangeD> + <absolute_threshold type='str'>Weak batteries </absolute_threshold> + <lblMotors type='str'>Disable measurement when the motors are running</lblMotors> <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> + <lblHighThreshold type='str'>Upper limit</lblHighThreshold> <widget_lblValue type='str'>Value (V)</widget_lblValue> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <speaker_name type='str'>Ryan8k</speaker_name> + <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <plug type='str'>and the power supply is plugged</plug> - <absolute_threshold type='str'>Weak batteries </absolute_threshold> + <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'>Battery monitor</name_to_read> - <lblHighThreshold type='str'>Higher limit</lblHighThreshold> - <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> + <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> <Drop type='str'>The battery level dropped</Drop> <conf_lblDrop type='str'>Drop</conf_lblDrop> - <ChangeD type='str'>The battery level dropped and raised</ChangeD> + <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <Raise type='str'>The battery level raised</Raise> - <conf_lblType type='str'>Type</conf_lblType> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> <widget_lblSet type='str'>Add to config</widget_lblSet> <Decrease type='str'>The battery level passed below the threshold</Decrease> - <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> + <conf_lblValue type='str'>Value (V)</conf_lblValue> <conf_lblRate type='str'>Refresh rate</conf_lblRate> <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> - <MainBehavior type='str'>Main behavior</MainBehavior> - <ChangeU type='str'>The battery level raised and dropped</ChangeU> + <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> + <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblControl type='str'>Control</conf_lblControl> - <conf_btnRemove type='str'>Remove</conf_btnRemove> + <widget_lblTest type='str'>Notifications</widget_lblTest> <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> </strings> |
From: Paul_R <c2m...@c2...> - 2007-10-29 15:51:28
|
Author: Paul_R Date: 2007-10-29 16:51:15 +0100 (Mon, 29 Oct 2007) New Revision: 645 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/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: * Resolved a bug in the main function * Added two scripts 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-29 10:22:14 UTC (rev 644) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-29 15:51:15 UTC (rev 645) @@ -130,6 +130,9 @@ self.get_widget('cbb_conf_event').append_text(_me.string('conf_lblChange')) self.get_widget('cbb_conf_event').append_text(_me.string('conf_lblThreshold')) self.get_widget('cbb_conf_event').set_active(0) + path = _me.get_path('data')+'/Data' + self.get_widget('conf_behavior').set_filename(path) + for i in range(len(self.measure.event_tab)): self.add_row(i) 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-29 10:22:14 UTC (rev 644) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-29 15:51:15 UTC (rev 645) @@ -216,7 +216,7 @@ else: self.event_tab = self.__tab - if self.GUI_on and self.search_light_flag: + if self.search_light_flag: self.search_light(self.light_search) # To prevent notifications at startup @@ -445,31 +445,33 @@ # ########################################################### def search_light(self, light): - self.count += 1 - self.__fault = False - detect = False - if self.light_search_state == 0 and tux.status.spin_counter() == 0 and self.count > 2: - self.light_search_state = 1 - if light == True: - self.light_value = max(self.val_table[len(self.val_table) - self.count: len(self.val_table)]) - self.light_value -= 10 - else: - self.light_value = min(self.val_table[len(self.val_table) - self.count: len(self.val_table)]) - self.light_value += 10 - self.timer = 10 - self.count = 0 + try: + self.count += 1 + self.__fault = False + detect = False + if self.light_search_state == 0 and tux.status.spin_counter() == 0 and self.count > 2: + self.light_search_state = 1 + if light == True: + self.light_value = max(self.val_table[len(self.val_table) - self.count: len(self.val_table)]) + self.light_value -= 10 + else: + self.light_value = min(self.val_table[len(self.val_table) - self.count: len(self.val_table)]) + self.light_value += 10 + print 'done' + self.timer = 10 + self.count = 0 - elif self.light_search_state == 1: - self.timer_control() - if light: - if self.val_table[len(self.val_table)-1] >= (self.light_value): - thread.start_new_thread(tux.cmd.spinl_off, ()) - detect = True - else: - if self.val_table[len(self.val_table)-1] <= (self.light_value): - thread.start_new_thread(tux.cmd.spinl_off, ()) - detect = True - + elif self.light_search_state == 1: + self.timer_control() + if light: + if self.val_table[len(self.val_table)-1] >= (self.light_value): + thread.start_new_thread(tux.cmd.spinl_off, ()) + detect = True + else: + if self.val_table[len(self.val_table)-1] <= (self.light_value): + thread.start_new_thread(tux.cmd.spinl_off, ()) + detect = True + if detect: self.test_default_behavior(self.search_event[3]) self.search_light_flag = False @@ -479,10 +481,14 @@ self.test_default_behavior(self.search_event[4]) self.search_light_flag = False self.light_search_state = 0 + except: + print sys.exc_info() + + def timer_control(self): self.timer -= 1 - self.count += 1 + print self.count if self.count == 10: self.test_default_behavior(self.search_event[0]) 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-29 10:22:14 UTC (rev 644) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-29 15:51:15 UTC (rev 645) @@ -51,7 +51,7 @@ path = event[i][6] path = path.replace('%20', ' ') if os.path.isfile(path) and os.path.exists(path): - path = "'%s'" % path + path = "python '%s'" % path tux.sys.shell(path) event[i][7] = False else: Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-29 10:22:14 UTC (rev 644) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-29 15:51:15 UTC (rev 645) @@ -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_name type='str'>light_monitor</gadget_name> - <gadget_description type='str'>Light monitor for tux droid</gadget_description> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-29 10:22:14 UTC (rev 644) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-29 15:51:15 UTC (rev 645) @@ -10,22 +10,22 @@ <changeD_rad type='bool'>False</changeD_rad> <threshold type='float'>50.0</threshold> <decrease_rad type='bool'>False</decrease_rad> - <Sample type='float'>500.0</Sample> + <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='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> <drop_time type='float'>1.0</drop_time> <changeU type='float'>10.0</changeU> <raise_time type='float'>1.0</raise_time> <drop type='float'>10.0</drop> + <drop_rad type='bool'>True</drop_rad> <MainScript type='str'> </MainScript> - <behavior_file_threshold type='NoneType'>None</behavior_file_threshold> + <Sample type='float'>500.0</Sample> <threshold_chk type='bool'>False</threshold_chk> <Rate type='float'>0.1</Rate> <changeD_time type='float'>1.0</changeD_time> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-29 10:22:14 UTC (rev 644) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-29 15:51:15 UTC (rev 645) @@ -3,15 +3,16 @@ <conf_lblIncrease type='str'>Increase</conf_lblIncrease> <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> + <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblRaise type='str'>Raise</conf_lblRaise> - <power_supply type='str'>You must disconnect the power supply</power_supply> + <widget_lblSet type='str'>Add to config</widget_lblSet> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <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> + <speaker_name type='str'>Ryan8k</speaker_name> <help_text type='str'>-- The events: Two main types of events can take place, each containing various options: @@ -38,7 +39,7 @@ Additional custom events with a notification can also be stored here. If no external script is specified, a default behavior will be used. -The events can be modified or removed, simply by selection the event line in the table and selecting the required button. +The events can be modified or removed, simply by selecting the event line in the table and selecting the required button. - The gadget window: This window displays the light graph. @@ -46,7 +47,7 @@ This window makes it possible to try various configurations and to add them in the settings table. In the test part with two buttons you can make Tux search for the light source or darkest spot.</help_text> - <ChangeU type='str'>The light level raised and dropped</ChangeU> + <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> @@ -56,22 +57,21 @@ <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> - <MainBehavior type='str'>Main behavior</MainBehavior> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <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_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> + <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> + <power_supply type='str'>You must disconnect the power supply</power_supply> <conf_lblSample type='str'>Samples</conf_lblSample> <conf_lblType type='str'>Type</conf_lblType> <Change type='str'>The light level changed</Change> - <widget_lblDark type='str'>Search darkness</widget_lblDark> + <conf_lblValue type='str'>Value (%)</conf_lblValue> <Both type='str'>The light level reached the threshold</Both> <conf_btnModify type='str'>Modify</conf_btnModify> + <widget_lblTest type='str'>Notifications</widget_lblTest> <widget_lblDrop type='str'>Drop</widget_lblDrop> <widget_lblNotified type='str'>Notified</widget_lblNotified> <dark1 type='str'>It's pretty dark here.</dark1> @@ -86,12 +86,12 @@ <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <widget_lblRaise type='str'>Raise</widget_lblRaise> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> <ChangeD type='str'>The light level dropped and raised</ChangeD> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <dark2 type='str'>And darker here.</dark2> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <search type='str'>I seek ...</search> @@ -104,18 +104,18 @@ <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <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> + <widget_lblDark type='str'>Search darkness</widget_lblDark> + <light2 type='str'>ow wait, even lighter here.</light2> <light3 type='str'>or here ...</light3> <light1 type='str'>Seeing more light over here.</light1> <Decrease type='str'>The light level passed below the threshold</Decrease> - <conf_lblValue type='str'>Value (%)</conf_lblValue> + <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> <light4 type='str'>I think the light is coming from this direction.</light4> <conf_lblRate type='str'>Refresh rate</conf_lblRate> <Threshold type='str'>The light reached the threshold</Threshold> - <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> - <conf_lblTime type='str'>Time (sec.)</conf_lblTime> + <MainBehavior type='str'>Main behavior</MainBehavior> + <ChangeU type='str'>The light level raised and dropped</ChangeU> <conf_lblControl type='str'>Control</conf_lblControl> - <widget_lblTest type='str'>Notifications</widget_lblTest> + <conf_btnRemove type='str'>Remove</conf_btnRemove> <light5 type='str'>I can't find the direction of the light.</light5> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: remi <c2m...@c2...> - 2007-10-29 10:22:24
|
Author: remi Date: 2007-10-29 11:22:14 +0100 (Mon, 29 Oct 2007) New Revision: 644 Modified: api/python/trunk/tuxapi_class.py Log: ADD: Capture of the micro stream. Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2007-10-26 10:05:00 UTC (rev 643) +++ api/python/trunk/tuxapi_class.py 2007-10-29 10:22:14 UTC (rev 644) @@ -52,41 +52,41 @@ self.__fifo_list = [] self.__list_mutex = threading.Lock() self.__threads_list = [] - + def destroy(self): for my_thread in self.__threads_list: if my_thread.isAlive(): my_thread.join() - + def connect(self, funct_ptr): self.__list_mutex.acquire() idx = len(self.__funct_ptr_list) self.__funct_ptr_list.append(funct_ptr) self.__list_mutex.release() return idx - + def push(self): self.__list_mutex.acquire() self.__fifo_list.append(self.__funct_ptr_list) self.__list_mutex.release() self.clear() - + def pop(self): if len(self.__fifo_list) > 0: self.__list_mutex.acquire() self.__funct_ptr_list = self.__fifo_list.pop() self.__list_mutex.release() - + def clear(self): self.__list_mutex.acquire() self.__funct_ptr_list = [] self.__list_mutex.release() - + def disconnect(self, idx): self.__list_mutex.acquire() self.__funct_ptr_list[idx] = None self.__list_mutex.release() - + def __run(self, funct_ptr, idx, fargs): try: funct_ptr(*fargs) @@ -94,7 +94,7 @@ self.__list_mutex.acquire() self.__funct_ptr_list[idx] == None self.__list_mutex.release() - + def notify(self, *fargs): self.__list_mutex.acquire() if len(self.__funct_ptr_list) == 0: @@ -186,9 +186,9 @@ self.monitoring = TUXmonitoring(self) self.wav = TUXwav(self) self.micro = TUXmicro(self) - + self.head_switch = TuxSwitch(self, STATUS_HEAD_PUSH_SWITCH) - + self.connected=False #deprecated t=threading.Thread(target=self.daemon._loop_auto_connect) t.setName('daemon._loop_auto_connect') @@ -541,7 +541,7 @@ self.event.on_status(data) #on monitoring self.monitoring.check_events(data) - + self.head_switch._notify(ord(data[4]), ord(data[5])) @@ -948,14 +948,14 @@ self.__time_event_mutex.acquire() self.events_list=[[0,'NONE',9999,99,99,99,99,99]] self.__time_event_mutex.release() - + #-------------------------------------------------------------------------- # Delete a time event from the time event handler #-------------------------------------------------------------------------- def delete_time_event(self, cmd_type,cmd,year,month,day,hour,minute,second): """ Delete a time event from the time event handler - + Parameters: "cmd_type" as number : Command type (CT_SHELL|CT_FUNCTION) "cmd" as string : Command to execute @@ -1070,14 +1070,14 @@ t.setName('sys.temporized_function') t.start() self.parent.main_thread_list.append(t) - + #============================================================================== # TUXTCPCommunicator - monitoring - class #============================================================================== class TUXmonitoring(object): """ Class which manages the monitoring - + Status constants list: (STATUS_WINGS_MOTOR_BACKWARD, STATUS_SPIN_MOTOR_BACKWARD, STATUS_SPIN_MOTOR_FORWARD, STATUS_MOUTH_OPEN_POSITION, @@ -1099,7 +1099,7 @@ STATUS_SOUND_COUNT, STATUS_PONG, STATUS_BATTERY, STATUS_MICRO_ENERGY, ) - + Functions list: tux.monitoring.insert tux.monitoring.remove @@ -1109,53 +1109,53 @@ self.parent = parent self._event_mutex = threading.Lock() self._event_list = [] - + def insert(self, status, function): """ Insert a monitoring event. - + Parameters: "status" as integer : Status index (See status contants list) "function" as pointer of function : Function to bind - + Returns: The index of your event in the monitoring manager. You must save this index if you want removing your event. - + Exemple: - >>> monitor_idx = tux.monitoring.insert(STATUS_LIGHT_LEVEL, my_function) + >>> monitor_idx = tux.monitoring.insert(STATUS_LIGHT_LEVEL, my_function) """ self._event_mutex.acquire() self._event_list.append([status, function]) self._event_mutex.release() return len(self._event_list) - 1 - + def remove(self, event_id): """ Remove a monitoring event. - + Parameters: "event_id" as integer : Index of the event. - + Exemple: >>> tux.monitoring.remove(monitor_idx) """ self._event_mutex.acquire() self._event_list[event_id][1] = None self._event_mutex.release() - + def check_events(self, frame): self._event_mutex.acquire() events = self._event_list self._event_mutex.release() - + def __load_funct_async(idx, funct, args): try: funct(args) except: self.remove(idx) - + for i, event in enumerate(events): if event[1] != None: if event[0] == ord(frame[4]): @@ -1165,8 +1165,8 @@ ord_frame.append(ord(val)) args = tuple(ord_frame) thread.start_new_thread(__load_funct_async, (i, event[1], args)) - + #============================================================================== # TUXTCPCommunicator - event - class #============================================================================== @@ -3365,12 +3365,12 @@ return 0 #-------------------------------------------------------------------------- - # Get the last state of sound status + # Get the last state of sound status #-------------------------------------------------------------------------- def flash_status(self): """ Get the last sound flash status - + Return a tupple with the audio flash status: (play state, record state, sound number) play state : Return the sound number or 0 if no sound is played @@ -4272,21 +4272,21 @@ self.voice_loaded = False self.speaking_stack = [] self.speaking_stack_mutex = threading.Lock() - + def destroy(self): self.on_wav_raw.destroy() - + def speaking_stack_add(self, speaking_conf): self.speaking_stack_mutex.acquire() self.speaking_stack.append(speaking_conf) self.speaking_stack_mutex.release() - + def speaking_stack_get_size(self): self.speaking_stack_mutex.acquire() val = len(self.speaking_stack) self.speaking_stack_mutex.release() return val - + def speaking_stack_loop(self): while self.connected: if self.speaking_stack_get_size() > 0: @@ -4320,7 +4320,7 @@ curr_speaking_conf[3].notify() curr_speaking_conf[3].release() self.speaking_stack_mutex.release() - + def speak(self, text): """ Speak a text with the acapela text to speech engine @@ -4346,7 +4346,7 @@ my_lock.acquire() my_lock.wait() my_lock.release() - + def speak_free(self, text): """ Speak a text with the acapela text to speech engine in free mode @@ -4372,7 +4372,7 @@ my_lock.acquire() my_lock.wait() my_lock.release() - + def _wav(self, wav_path, begin, end): if not os.path.isfile(wav_path): return @@ -4391,7 +4391,7 @@ my_lock.acquire() my_lock.wait() my_lock.release() - + def _wav_free(self, wav_path, begin, end): if not os.path.isfile(wav_path): return @@ -4519,17 +4519,17 @@ t.setName('tts._loop_tux_data_dispatching') t.start() self.con_thread_list.append(t) - + t=threading.Thread(target=self._loop_tcp_tts_msg) t.setName('tts._loop_tcp_tts_msg') t.start() self.con_thread_list.append(t) - + t=threading.Thread(target=self.speaking_stack_loop) t.setName('tts.speaking_stack_loop') t.start() self.con_thread_list.append(t) - + self.get_sound_state() return True @@ -4877,7 +4877,7 @@ self.parent.cmd.audio_channel_general() self.tts_mutex.release() return True - + #-------------------------------------------------------------------------- # Play a wav with tuxttsd #-------------------------------------------------------------------------- @@ -4936,7 +4936,7 @@ t.start() self.parent.daemon.free_thread_list.append(t) return True - + #-------------------------------------------------------------------------- # Play a wav with tuxttsd in free mode #-------------------------------------------------------------------------- @@ -5041,7 +5041,7 @@ >>> tux.tts.kill_daemon() """ self.send_command_to_tts(CMD_TYPE_DAEMON,CMD_DAEMON_KILL,0,0,0,0) - + #============================================================================== # TUXTCPCommunicator - wav - class #============================================================================== @@ -5065,7 +5065,7 @@ self.parent = parent self.__wav_path = "" self.__wav_length = 0 - + def __load(self, wav_path): if os.path.isfile(wav_path): try: @@ -5077,7 +5077,7 @@ return True else: return False - + def _set_begin_end(self, begin = 0., end = 0.): begin_100m = (int)(round(begin * 10)) end_100m = (int)(round(end * 10)) @@ -5086,23 +5086,23 @@ end_lower = end_100m & 0x000000FF end_upper = (end_100m & 0x0000FF00) >> 8 self.parent.tts.send_command_to_tts( - CMD_TYPE_WAV, + CMD_TYPE_WAV, CMD_WAV_BEGIN_END, begin_lower, begin_upper, end_lower, end_upper) - + def get_duration(self, wav_path): """ Get the duration of a wave file. - + Parameters: "wav_path" as string : Path of the wave file - + Returns: The time duration in seconds as float. - + Exemple: >>> print tux.wav.get_duration('/home/tux/test.wav') """ @@ -5111,78 +5111,78 @@ return self.__wav_length else: return 0. - + def play(self, wav_path, begin = 0., end = 0.): """ Play a wave file with tuxttsd daemon. - + Parameters: "wav_path" as string : Path of the wave file "begin" as float : Starting index in seconds(Optional) "end" as float : Ending index in seconds(Optional) - + Exemple: >>> tux.wav.play('/home/tux/test.wav') >>> tux.wav.play('/home/tux/test.wav', 0., 5.5) """ if self.__load(wav_path): self.parent.tts._wav(self.__wav_path, begin, end) - + def play_free(self, wav_path, begin = 0., end = 0.): """ Play a wave file with tuxttsd daemon in free mode. - + Parameters: "wav_path" as string : Path of the wave file "begin" as float : Starting index in seconds(Optional) "end" as float : Ending index in seconds(Optional) - + Exemple: >>> tux.wav.play_free('/home/tux/test.wav') >>> tux.wav.play_free('/home/tux/test.wav', 0., 5.5) """ if self.__load(wav_path): self.parent.tts._wav_free(self.__wav_path, begin, end) - + def stop(self): """ Stop the current played wave file. - + Exemple: >>> tux.wav.stop() """ self.parent.tts.stop() - + def pause(self): """ Pause the current played wave file. - + Exemple: >>> tux.wav.pause() """ self.parent.tts.pause() - + def _continue(self): """ Continue the playing of a paused wave file. - + Exemple: >>> tux.wav._continue() """ self.parent.tts.play() - + #============================================================================== # TUXTCPCommunicator - micro - class #============================================================================== class TUXmicro(object): """ Class which manages the microphone functions. - + Global variables of this class: "on_buffer" as EventControl : Event on new buffer from micro - + Example of associating a function to 'on_buffer' event: - + >>> def new_buffer(values): >>> ... print values >>> ... @@ -5192,23 +5192,99 @@ Functions list for the users: tux.micro.on tux.micro.off + tux.micro.capture_start + tux.micro.capture_stop """ - + def __init__(self,parent): self.parent = parent self.__state = False self.__process = None self.__process_mutex = threading.Lock() + self.__thread = None self.on_buffer = EventControl() - + self.on_capture_stop = EventControl() + self.on_capture_start = EventControl() + self.__capturing = False + self.__capture_path = "" + self.__capture_length = 0 + self.__capture_buffer = [] + self.__capture_idx = 0 + def destroy(self): self.off() self.on_buffer.destroy() - + if self.__thread != None: + if self.__thread.isAlive(): + self.__thread.join() + + def __on_capture_buffer(self, buffer): + if not self.__capturing: + return + for val in buffer: + self.__capture_buffer.append(val) + if self.__capture_length != 0: + if (self.__capture_length * 8000) <= len(self.__capture_buffer): + self.capture_stop() + return + + def capture_start(self, out_path, length = 0): + """ + Write the stream in a wav file. + + Parameters: + "out_path" as string : path of the wave file + "length" as float : duration of the capture in seconds + When this parameters is omitted, the length + is infinite. You must stop the recording + with 'tux.micro.capture_stop()' + + Examples: + >>> tux.micro.capture_start('/home/remi/Desktop/test.wav', 10.0) + >>> tux.micro.capture_start('/home/remi/Desktop/test.wav') + """ + if self.__capturing: + return False + if not self.__state: + return False + self.__capture_path = out_path + self.__capture_buffer = [] + self.__capture_length = length + self.__capturing = True + self.on_capture_start.notify() + self.__capture_idx = self.on_buffer.connect(self.__on_capture_buffer) + + def capture_stop(self): + """ + Stop the capture of the stream. + """ + if not self.__capturing: + return + self.__capturing = False + self.on_buffer.disconnect(self.__capture_idx) + time.sleep(0.2) + self.__write_capture() + self.on_capture_stop.notify() + + def __write_capture(self): + try: + import wave + except: + print "ERROR : import wave" + return + freqech = 8000 + sound_str = "" + for val in self.__capture_buffer: + sound_str += chr(val) + wavfile = wave.open(self.__capture_path, 'w') + wavfile.setparams((1, 1, freqech , len(self.__capture_buffer), 'NONE', 'not compressed')) + wavfile.writeframes(sound_str) + wavfile.close() + def on(self): """ Function to turn on the micro capture. - + Example: >>> tux.micro.on() """ @@ -5227,13 +5303,15 @@ self.__process_mutex.release() time.sleep(0.01) self.__state = False - - thread.start_new_thread(get_micro_data, ()) - + + self.__thread = threading.Thread(target=get_micro_data) + self.__thread.setName('micro.on') + self.__thread.start() + def off(self): """ Function to turn off the micro capture. - + Example: >>> tux.micro.off() """ @@ -5243,7 +5321,8 @@ os.kill(self.__process.pid, signal.SIGKILL) os.waitpid(-1, os.WNOHANG) self.__process_mutex.release() - + self.capture_stop() + def __on_new_buffer(self, buffer): i_buffer = [] for c in buffer: @@ -5251,11 +5330,11 @@ if self.__state: self.__send_energy_monitoring(i_buffer) self.on_buffer.notify(i_buffer) - + def __send_energy_monitoring(self, buffer): def log_value(value): return int(math.log(value) / math.log(255) * 255) - + try: e_total = 0 for val in buffer: @@ -5264,7 +5343,7 @@ if e_total > 255: e_total = 255 e_total = log_value(e_total) - + e_table = [] for i in range(4): e_m = 0 @@ -5279,7 +5358,7 @@ e_table.append(e_m) except: return - + tmp_tcp_data = [chr(0)] * 16 tmp_tcp_data[0] = chr(SOURCE_TUX) tmp_tcp_data[1] = chr(0) @@ -5446,14 +5525,14 @@ print "---------------------------------------------------------------" print "TUXDROID PYTHON API %s"%(api_version) print "---------------------------------------------------------------" - + def simulate_tcpip_frame(self, frame): """ To simulate the receiving of a frame Parameters: "frame" as list of 16 char : fake frame - + Example: >>> tux.misc.simulate_tcpip_frame(<list of 16 chars>) """ @@ -5484,7 +5563,7 @@ tmp_tcp_data[4] = chr(DATAS_STATUS_IR_CODE) tmp_tcp_data[5] = chr(key) self.simulate_tcpip_frame(tmp_tcp_data) - + #============================================================================== # TUXTCPCommunicator - switch - class #============================================================================== @@ -5495,29 +5574,29 @@ self.__status = status self.on_press = EventControl() self.on_release = EventControl() - + def _store_events(self): self.on_press.push() self.on_release.push() - + def _restore_events(self): self.on_press.pop() self.on_release.pop() - + def _clear_events(self): self.on_press.clear() self.on_release.clear() - + def _notify(self, status, value): if status == self.__status: if value == 0: self.on_release.notify() else: self.on_press.notify() - + def simulate(self, value): self._notify(self.__status, value) - + def get_status(self): return self.parent.status.get_one_status(self.__status) |
From: remi <c2m...@c2...> - 2007-10-26 10:05:07
|
Author: remi Date: 2007-10-26 12:05:00 +0200 (Fri, 26 Oct 2007) New Revision: 643 Modified: api/python/trunk/tuxapi_class.py api/python/trunk/tuxapi_const.py Log: ADD: Micro class, EventControl class UP: Documentation, status on tuxapi_const Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2007-10-24 11:26:09 UTC (rev 642) +++ api/python/trunk/tuxapi_class.py 2007-10-26 10:05:00 UTC (rev 643) @@ -30,6 +30,8 @@ import threading import string import signal +import subprocess +import math from tuxapi_const import * from copy import deepcopy @@ -41,6 +43,77 @@ TCPIP_FRAME_LENGTH = 16 #============================================================================== +# EventControl - class +#============================================================================== +class EventControl(object): + + def __init__(self): + self.__funct_ptr_list = [] + self.__fifo_list = [] + self.__list_mutex = threading.Lock() + self.__threads_list = [] + + def destroy(self): + for my_thread in self.__threads_list: + if my_thread.isAlive(): + my_thread.join() + + def connect(self, funct_ptr): + self.__list_mutex.acquire() + idx = len(self.__funct_ptr_list) + self.__funct_ptr_list.append(funct_ptr) + self.__list_mutex.release() + return idx + + def push(self): + self.__list_mutex.acquire() + self.__fifo_list.append(self.__funct_ptr_list) + self.__list_mutex.release() + self.clear() + + def pop(self): + if len(self.__fifo_list) > 0: + self.__list_mutex.acquire() + self.__funct_ptr_list = self.__fifo_list.pop() + self.__list_mutex.release() + + def clear(self): + self.__list_mutex.acquire() + self.__funct_ptr_list = [] + self.__list_mutex.release() + + def disconnect(self, idx): + self.__list_mutex.acquire() + self.__funct_ptr_list[idx] = None + self.__list_mutex.release() + + def __run(self, funct_ptr, idx, fargs): + try: + funct_ptr(*fargs) + except: + self.__list_mutex.acquire() + self.__funct_ptr_list[idx] == None + self.__list_mutex.release() + + def notify(self, *fargs): + self.__list_mutex.acquire() + if len(self.__funct_ptr_list) == 0: + self.__list_mutex.release() + return + try: + funct_ptr_list = self.__funct_ptr_list + except: + self.__list_mutex.release() + return + self.__list_mutex.release() + for idx, funct_ptr in enumerate(funct_ptr_list): + if funct_ptr != None: + t=threading.Thread(target=self.__run, args=(funct_ptr, idx, fargs)) + t.setName('EventControl') + t.start() + self.__threads_list.append(t) + +#============================================================================== # TUXTCPCommunicator class #============================================================================== class TUXTCPCommunicator(object): @@ -53,6 +126,7 @@ "daemon" as class : Class which manages the daemon commands "event" as class : Class which manages the events "hw" as class : Class which manages the tux hardware + "micro" as class : Class which manages the microphone functions "misc" as class : Class which manages the miscellaneous functions "monitoring" as class : Class which manages the monitoring @@ -111,6 +185,10 @@ self.misc=TUXmisc(self) self.monitoring = TUXmonitoring(self) self.wav = TUXwav(self) + self.micro = TUXmicro(self) + + self.head_switch = TuxSwitch(self, STATUS_HEAD_PUSH_SWITCH) + self.connected=False #deprecated t=threading.Thread(target=self.daemon._loop_auto_connect) t.setName('daemon._loop_auto_connect') @@ -130,8 +208,10 @@ self.tts.auto_connect(False) self.daemon.disconnect() self.tts.disconnect() + self.tts.destroy() self.daemon._tcp_threads_join() self.tts._tcp_threads_join() + self.micro.destroy() self.exit_flag=True for main_thread in self.main_thread_list: if self.print_debug_thread: @@ -461,6 +541,8 @@ self.event.on_status(data) #on monitoring self.monitoring.check_events(data) + + self.head_switch._notify(ord(data[4]), ord(data[5])) #-------------------------------------------------------------------------- @@ -1014,7 +1096,8 @@ STATUS_MOUTH_POSITION_COUNTER, STATUS_WINGS_POSITION_COUNTER, STATUS_SPIN_POSITION_COUNTER, STATUS_RIGHT_BLUE_LED, STATUS_RF_CONNECTED, STATUS_IR_CODE, - STATUS_SOUND_COUNT, STATUS_PONG + STATUS_SOUND_COUNT, STATUS_PONG, + STATUS_BATTERY, STATUS_MICRO_ENERGY, ) Functions list: @@ -4154,15 +4237,6 @@ tux.tts.pause tux.tts.play tux.tts.select_voice - tux.tts.select_voice_fr_female - tux.tts.select_voice_fr_female_tuxed - tux.tts.select_voice_fr_male - tux.tts.select_voice_fr_male_tuxed - tux.tts.select_voice_us_female - tux.tts.select_voice_us_female_tuxed - tux.tts.select_voice_us_male - tux.tts.select_voice_us_male_tuxed - tux.tts.send_command_to_tts tux.tts.speak tux.tts.speak_free tux.tts.stop @@ -4186,7 +4260,7 @@ self.on_connected = None self.on_disconnected = None self.on_voice_list = None - self.on_wav_raw = None + self.on_wav_raw = EventControl() self.__last_wav_raw = [0] * 1024; self.sound_on=False self.my_pitch=100 @@ -4199,6 +4273,9 @@ self.speaking_stack = [] self.speaking_stack_mutex = threading.Lock() + def destroy(self): + self.on_wav_raw.destroy() + def speaking_stack_add(self, speaking_conf): self.speaking_stack_mutex.acquire() self.speaking_stack.append(speaking_conf) @@ -4584,7 +4661,7 @@ self.__last_wav_raw[spectre_idx + i] = ord(data[i + 2]) if self.on_wav_raw != None: tmp_raw = deepcopy(self.__last_wav_raw) - thread.start_new_thread(self.on_wav_raw, (tmp_raw,)) + self.on_wav_raw.notify(tmp_raw) #-------------------------------------------------------------------------- # Send command to tuxttsd @@ -5093,8 +5170,128 @@ >>> tux.wav._continue() """ self.parent.tts.play() + +#============================================================================== +# TUXTCPCommunicator - micro - class +#============================================================================== +class TUXmicro(object): + """ + Class which manages the microphone functions. + + Global variables of this class: + "on_buffer" as EventControl : Event on new buffer from micro + Example of associating a function to 'on_buffer' event: + + >>> def new_buffer(values): + >>> ... print values + >>> ... + >>> tux.micro.on_buffer.connect(new_buffer) + >>> tux.micro.on() + + Functions list for the users: + tux.micro.on + tux.micro.off + """ + def __init__(self,parent): + self.parent = parent + self.__state = False + self.__process = None + self.__process_mutex = threading.Lock() + self.on_buffer = EventControl() + + def destroy(self): + self.off() + self.on_buffer.destroy() + + def on(self): + """ + Function to turn on the micro capture. + + Example: + >>> tux.micro.on() + """ + if self.__state: + return + def get_micro_data(): + device = self.parent.hw.alsa_device + cmd = ["arecord", "-D", device, "-t", "raw"] + self.__process = subprocess.Popen(cmd, stdout = subprocess.PIPE,\ + stderr = subprocess.PIPE) + self.__state = True + while self.__process.poll() == None: + self.__process_mutex.acquire() + buff = self.__process.stdout.read(800) + self.__on_new_buffer(buff) + self.__process_mutex.release() + time.sleep(0.01) + self.__state = False + + thread.start_new_thread(get_micro_data, ()) + + def off(self): + """ + Function to turn off the micro capture. + + Example: + >>> tux.micro.off() + """ + if not self.__state: + return + self.__process_mutex.acquire() + os.kill(self.__process.pid, signal.SIGKILL) + os.waitpid(-1, os.WNOHANG) + self.__process_mutex.release() + + def __on_new_buffer(self, buffer): + i_buffer = [] + for c in buffer: + i_buffer.append(ord(c)) + if self.__state: + self.__send_energy_monitoring(i_buffer) + self.on_buffer.notify(i_buffer) + + def __send_energy_monitoring(self, buffer): + def log_value(value): + return int(math.log(value) / math.log(255) * 255) + + try: + e_total = 0 + for val in buffer: + e_total += abs(val - 127) + e_total /= 200 + if e_total > 255: + e_total = 255 + e_total = log_value(e_total) + + e_table = [] + for i in range(4): + e_m = 0 + i_b = i * 200 + i_e = i_b + 200 + for j in range(i_b, i_e): + e_m += abs(buffer[j] - 127) + e_m /= 50 + if e_m > 255: + e_m = 255 + e_m = log_value(e_m) + e_table.append(e_m) + except: + return + + tmp_tcp_data = [chr(0)] * 16 + tmp_tcp_data[0] = chr(SOURCE_TUX) + tmp_tcp_data[1] = chr(0) + tmp_tcp_data[2] = chr(DATA_TP_RSP) + tmp_tcp_data[3] = chr(SUBDATA_TP_STATUS) + tmp_tcp_data[4] = chr(STATUS_MICRO_ENERGY) + tmp_tcp_data[5] = chr(e_total) + tmp_tcp_data[6] = chr(e_table[0]) + tmp_tcp_data[7] = chr(e_table[1]) + tmp_tcp_data[8] = chr(e_table[2]) + tmp_tcp_data[9] = chr(e_table[3]) + self.parent.misc.simulate_tcpip_frame(tmp_tcp_data) #============================================================================== # TUXTCPCommunicator - misc - class @@ -5108,10 +5305,9 @@ tux.misc.build_documentation tux.misc.print_api_version tux.misc.simulate_remote_key + tux.misc.simulate_tcpip_frame """ - #-------------------------------------------------------------------------- - # Constructor of class - #-------------------------------------------------------------------------- + def __init__(self,parent): """ Constructor of this class @@ -5125,9 +5321,6 @@ self.h_funct_b='<b><u><i><font size="2">' self.h_funct_e='</font></i></u></b>' - #-------------------------------------------------------------------------- - # Print the docstring of a element of tux api - #-------------------------------------------------------------------------- def doc(self,element): """ Print the docstring of an element of tux api @@ -5145,9 +5338,6 @@ print element.__doc__ print c_header - #-------------------------------------------------------------------------- - # Not a user function - #-------------------------------------------------------------------------- def parse_class(self,class_num,class_obj,class_name,class_str,indent): """ Not a user function @@ -5194,9 +5384,6 @@ getattr(class_obj,line).__doc__,indent+' ') return my_doc - #-------------------------------------------------------------------------- - # Not a user function - #-------------------------------------------------------------------------- def parse_function(self,funct_num,funct_name,funct_str,indent): """ Not a user function @@ -5214,9 +5401,6 @@ my_doc=my_doc+indent+line[4:]+'<br>' return my_doc - #-------------------------------------------------------------------------- - # Build the documentation of this api - #-------------------------------------------------------------------------- def build_documentation(self,doc_path): """ Build the documentation of this api @@ -5252,9 +5436,6 @@ f.write(documentation) f.close() - #-------------------------------------------------------------------------- - # To print the version of the API - #-------------------------------------------------------------------------- def print_api_version(self): """ To print the version of the API @@ -5265,12 +5446,28 @@ print "---------------------------------------------------------------" print "TUXDROID PYTHON API %s"%(api_version) print "---------------------------------------------------------------" + + def simulate_tcpip_frame(self, frame): + """ + To simulate the receiving of a frame - #-------------------------------------------------------------------------- - # To simulate the receiving of a remote key - #-------------------------------------------------------------------------- - def simulate_remote_key(self,key): + Parameters: + "frame" as list of 16 char : fake frame + + Example: + >>> tux.misc.simulate_tcpip_frame(<list of 16 chars>) """ + self.parent.tcp_data_fifo_lock_mutex.acquire() + self.parent.tcp_data_fifo_lock.append(frame) + self.parent.tcp_data_fifo_lock_mutex.release() + self.parent.tcp_data_fifo_event_mutex.acquire() + self.parent.tcp_data_fifo_event.append(frame) + self.parent.tcp_data_fifo_event_mutex.release() + if not self.parent.daemon.connected: + self.parent._dispatch_data_main(frame) + + def simulate_remote_key(self, key): + """ To simulate the receiving of a remote key Parameters: @@ -5279,14 +5476,48 @@ Example: >>> tux.misc.simulate_remote_key(K_OK) """ - tmp_tcp_data = (chr(SOURCE_TUX),chr(0),chr(DATA_TP_RSP), \ - chr(SUBDATA_TP_STATUS),chr(DATAS_STATUS_IR_CODE), \ - chr(key),chr(0),chr(0),chr(0),chr(0),chr(0),chr(0), \ - chr(0),chr(0),chr(0),chr(0)) + tmp_tcp_data = [chr(0)] * 16 + tmp_tcp_data[0] = chr(SOURCE_TUX) + tmp_tcp_data[1] = chr(0) + tmp_tcp_data[2] = chr(DATA_TP_RSP) + tmp_tcp_data[3] = chr(SUBDATA_TP_STATUS) + tmp_tcp_data[4] = chr(DATAS_STATUS_IR_CODE) + tmp_tcp_data[5] = chr(key) + self.simulate_tcpip_frame(tmp_tcp_data) + +#============================================================================== +# TUXTCPCommunicator - switch - class +#============================================================================== +class TuxSwitch(object): - self.parent.tcp_data_fifo_lock_mutex.acquire() - self.parent.tcp_data_fifo_lock.append(tmp_tcp_data) - self.parent.tcp_data_fifo_lock_mutex.release() - self.parent.tcp_data_fifo_event_mutex.acquire() - self.parent.tcp_data_fifo_event.append(tmp_tcp_data) - self.parent.tcp_data_fifo_event_mutex.release() + def __init__(self, parent, status): + self.parent = parent + self.__status = status + self.on_press = EventControl() + self.on_release = EventControl() + + def _store_events(self): + self.on_press.push() + self.on_release.push() + + def _restore_events(self): + self.on_press.pop() + self.on_release.pop() + + def _clear_events(self): + self.on_press.clear() + self.on_release.clear() + + def _notify(self, status, value): + if status == self.__status: + if value == 0: + self.on_release.notify() + else: + self.on_press.notify() + + def simulate(self, value): + self._notify(self.__status, value) + + def get_status(self): + return self.parent.status.get_one_status(self.__status) + Modified: api/python/trunk/tuxapi_const.py =================================================================== --- api/python/trunk/tuxapi_const.py 2007-10-24 11:26:09 UTC (rev 642) +++ api/python/trunk/tuxapi_const.py 2007-10-26 10:05:00 UTC (rev 643) @@ -157,6 +157,7 @@ DATAS_STATUS_SOUND_COUNT = 0x23 DATAS_STATUS_PONG = 0x24 DATAS_STATUS_BATTERY = 0x25 +DATAS_STATUS_MICRO_ENERGY = 0xF0 DATAS_STATUS_AUDIO = 0x26 STATUS_WINGS_MOTOR_BACKWARD = 0x01 @@ -195,6 +196,9 @@ STATUS_IR_CODE = 0x22 STATUS_SOUND_COUNT = 0x23 STATUS_PONG = 0x24 +STATUS_BATTERY = 0x25 +STATUS_AUDIO = 0x26 +STATUS_MICRO_ENERGY = 0xF0 # Tux connection commands TUX_CONNECTION_DISCONNECT = 1 |
From: Paul_R <c2m...@c2...> - 2007-10-24 11:26:12
|
Author: Paul_R Date: 2007-10-24 13:26:09 +0200 (Wed, 24 Oct 2007) New Revision: 642 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml software/gadgets/light_monitor/trunk/Light_monitor/about.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Corrected the help files of the battery and the light monitor gadgets Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-24 10:19:49 UTC (rev 641) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-24 11:26:09 UTC (rev 642) @@ -11,7 +11,7 @@ <widget_lblControl type='str'>Contrôle</widget_lblControl> <Increase type='str'>Le niveau de la batterie est passé en dessus du seuil</Increase> <full type='str'>Les batteries sont pleines</full> - <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> <lblLowThreshold type='str'>Limite inférieure</lblLowThreshold> <help_text type='str'>-- Les évènements : Deux grands types d'évènements peuvent avoir lieu, contenant chacun diverses options : @@ -41,7 +41,7 @@ Si aucun script externe n'est spécifié, un comportement de base se déclenchera. Les évènements peuvent à tout moment être modifiés ou supprimés, par simple sélection de la ligne dans le tableau. -Une option permet de rejeté les mesures lorsque les moteurs fonctionnent. +Une option permet de rejeter les mesures lorsque les moteurs fonctionnent. - La fenêtre du gadget : Cette fenêtre affiche le graphique de la batterie. @@ -73,7 +73,7 @@ <MainBehavior type='str'>Comportement principal</MainBehavior> <speaker_name type='str'>Bruno8k</speaker_name> <conf_lblSample type='str'>Points</conf_lblSample> - <charging type='str'>En charge</charging> + <conf_lblType type='str'>Type</conf_lblType> <Change type='str'>Le niveau de la batterie a changé</Change> <Both type='str'>Le niveau de la batterie a passé le seuil</Both> <conf_btnModify type='str'>Modifier</conf_btnModify> @@ -102,18 +102,18 @@ <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Changement</widget_lblChange> <name_to_read type='str'>Moniteur de batteries</name_to_read> - <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> <Drop type='str'>Le niveau de la batterie a chuté</Drop> <conf_lblDrop type='str'>Chute</conf_lblDrop> - <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> <Raise type='str'>Le niveau de la batterie a augmenté</Raise> - <conf_lblType type='str'>Type</conf_lblType> + <charging type='str'>En charge</charging> <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> <Decrease type='str'>Le niveau de la batterie est passé en dessous du seuil</Decrease> <conf_lblValue type='str'>Valeur (V)</conf_lblValue> <conf_lblRate type='str'>Rafraichissement</conf_lblRate> <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> - <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> + <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> <conf_lblControl type='str'>Contrôle</conf_lblControl> <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-24 10:19:49 UTC (rev 641) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-24 11:26:09 UTC (rev 642) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_name type='str'>battery_monitor</gadget_name> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_description type='str'>Battery monitor for tux droid</gadget_description> <gadget_version type='str'>0.0.1</gadget_version> - <gadget_description type='str'>Battery monitor for tux droid</gadget_description> - <gadget_name type='str'>battery_monitor</gadget_name> </about> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-24 10:19:49 UTC (rev 641) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-24 11:26:09 UTC (rev 642) @@ -1,11 +1,11 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <Sample type='float'>600.0</Sample> + <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> + <chkMotors type='bool'>True</chkMotors> <low_threshold type='float'>4.8</low_threshold> - <chkMotors type='bool'>True</chkMotors> <MainScript type='str'>None</MainScript> - <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> + <Sample type='float'>600.0</Sample> <Rate type='float'>1.0</Rate> <high_threshold type='float'>6.0</high_threshold> <config type='list'>[]</config> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-24 10:19:49 UTC (rev 641) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-24 11:26:09 UTC (rev 642) @@ -1,54 +1,57 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> <conf_lblIncrease type='str'>Increase</conf_lblIncrease> + <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> + <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <battery type='str'>On battery</battery> <conf_lblRaise type='str'>Raise</conf_lblRaise> + <widget_lblTest type='str'>Notifications</widget_lblTest> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> <Increase type='str'>The battery level exceeded the threshold</Increase> - <full type='str'>The level of the batteries is full</full> + <conf_btnModify type='str'>Modify</conf_btnModify> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> - <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> - <help_text type='str'>-- The events: -Two main types of events can take place, containing each one various options: + <lblLowThreshold type='str'>Lower limit</lblLowThreshold> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <lblMotors type='str'>Disable measure when the motors are running</lblMotors> + <help_text type='str'>--The events: +Two main types of events can take place, each containing various options: -The changes: +The changes: The changes are events which occur in a given time. The four types of changes are: - Drop - Raise -- a followed drop of an increase -- an followed increase of a drop +- a drop followed by an increase +- an increase followed by a drop For example, an event can take place if the battery level decreases by 0.1V in a time of ten seconds. The thresholds: -The thresholds events starts when the battery voltage reached a specified level. -The passage of the threshold can be done: -- by an increase (passage beyond of the threshold) -- by a reduction (passage below the threshold) -- in the both directions. +The threshold events start when the battery voltage reaches a specified level. +Passing the threshold can be done: +- by an increase (moving above the threshold) +- by a decrease (moving below the threshold) +- in both directions. -- The windows: - The settings window: -This window contains all the options of configuration of the gadget, in particular the refresh rate and the number of points displayed on the graph. +This window contains all configuration options of the gadget, in particular the refresh rate and the number of points displayed on the graph. -Some events, being able to involve a notification, can also be recorded. -If no external script is specified, a standard behavior will start. -The events can constantly be modified or removed, simply by selection of the line in the table. +Additional custom events with a notification, can also be stored here. If no external script is specified, a default behavior will be used. +The events can be modified or removed, simply by selecting the event line in the table and clicking the required button. -A checkbox allow to enable / disable the measure when the motors are running. +A checkbox allows to enable / disable the measurement when the motors are running. - The gadget window: -This window display the battery voltage graph. -When this window is showed, the events recorded in the settings window are not notified. +This window displays the battery voltage graph. +When this window is displayed, the events stored in the settings window are not notified. This window makes it possible to try various configurations and to add them in the settings table.</help_text> <end_of_charge type='str'>The load of the battery is finished</end_of_charge> - <conf_btnRemove type='str'>Remove</conf_btnRemove> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> @@ -58,31 +61,28 @@ <gui_conf_update_title type='str'>Update</gui_conf_update_title> <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <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> <absolute_threshold_high type='str'>The batteries are full</absolute_threshold_high> <mainscript type='str'>I've found the light !</mainscript> - <MainBehavior type='str'>Main behavior</MainBehavior> - <lblLowThreshold type='str'>Lower limit</lblLowThreshold> + <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <plugged type='str'>Plugged</plugged> - <ChangeU type='str'>The battery level raised and dropped</ChangeU> <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> <charge type='str'>and the batteries are being charged</charge> <gui_conf_about_title type='str'>About</gui_conf_about_title> <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> <low type='str'>The level of the batteries is weak</low> - <charging type='str'>Charging</charging> - <speaker_name type='str'>Ryan8k</speaker_name> + <conf_btnAdd type='str'>Add</conf_btnAdd> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <conf_lblSample type='str'>Samples</conf_lblSample> - <conf_lblType type='str'>Type</conf_lblType> + <charging type='str'>Charging</charging> <Change type='str'>The battery level changed</Change> + <conf_lblValue type='str'>Value (V)</conf_lblValue> <Both type='str'>The battery level reached the threshold</Both> - <conf_btnModify type='str'>Modify</conf_btnModify> + <full type='str'>The level of the batteries is full</full> <widget_lblEvent type='str'>Event</widget_lblEvent> <normal type='str'>The level of the batteries is good</normal> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <widget_lblRaise type='str'>Raise</widget_lblRaise> - <conf_btnAdd type='str'>Add</conf_btnAdd> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <on_battery type='str'>and tux is fed by the batteries</on_battery> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> @@ -90,33 +90,32 @@ <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> - <ChangeD type='str'>The battery level dropped and raised</ChangeD> - <absolute_threshold type='str'>Weak batteries </absolute_threshold> - <lblMotors type='str'>Disable measure when the motors are running</lblMotors> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> - <lblHighThreshold type='str'>Higher limit</lblHighThreshold> <widget_lblValue type='str'>Value (V)</widget_lblValue> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <speaker_name type='str'>Ryan8k</speaker_name> <plug type='str'>and the power supply is plugged</plug> - <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <absolute_threshold type='str'>Weak batteries </absolute_threshold> <widget_lblChange type='str'>Change</widget_lblChange> <name_to_read type='str'>Battery monitor</name_to_read> + <lblHighThreshold type='str'>Higher limit</lblHighThreshold> <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <Drop type='str'>The battery level dropped</Drop> <conf_lblDrop type='str'>Drop</conf_lblDrop> - <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <ChangeD type='str'>The battery level dropped and raised</ChangeD> <Raise type='str'>The battery level raised</Raise> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <conf_lblType type='str'>Type</conf_lblType> <widget_lblSet type='str'>Add to config</widget_lblSet> <Decrease type='str'>The battery level passed below the threshold</Decrease> - <conf_lblValue type='str'>Value (V)</conf_lblValue> + <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> <conf_lblRate type='str'>Refresh rate</conf_lblRate> <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> - <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> - <conf_lblTime type='str'>Time (sec.)</conf_lblTime> + <MainBehavior type='str'>Main behavior</MainBehavior> + <ChangeU type='str'>The battery level raised and dropped</ChangeU> <conf_lblControl type='str'>Control</conf_lblControl> - <widget_lblTest type='str'>Notifications</widget_lblTest> + <conf_btnRemove type='str'>Remove</conf_btnRemove> <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> </strings> 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-24 10:19:49 UTC (rev 641) +++ software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-24 11:26:09 UTC (rev 642) @@ -9,7 +9,6 @@ <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 : @@ -61,6 +60,7 @@ <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,6 +69,7 @@ <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> @@ -96,13 +97,12 @@ <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> - <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> + <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> <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> - <conf_lblRate type='str'>Taux de rafraichissement</conf_lblRate> + <light5 type='str'>Je ne peux pas trouver d'où vient la lumière...</light5> <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/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-24 10:19:49 UTC (rev 641) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-24 11:26:09 UTC (rev 642) @@ -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/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-24 10:19:49 UTC (rev 641) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-24 11:26:09 UTC (rev 642) @@ -9,42 +9,43 @@ <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: -Two main types of events can take place, containing each one various options: +Two main types of events can take place, each containing various options: The changes: The changes are events which occur in a given time. The four types of changes are: - Drop - Raise -- a followed drop of an increase -- an followed increase of a drop +- a drop followed by an increase +- an increase followed by a drop For example, an event can take place if the light level decreases by 10% in a time of two seconds. The thresholds: -The thresholds events starts when the light reached a specified level. -The passage of the threshold can be done: -- by an increase (passage beyond of the threshold) -- by a reduction (passage below the threshold) -- in the both directions. +The threshold events start when the light reaches a specified level. +Passing the threshold can be done: +- by an increase (moving above the threshold) +- by a decrease (moving below the threshold) +- in both directions. -- The windows: - The settings window: -This window contains all the options of configuration of the gadget, in particular the refresh rate and the number of points displayed on the graph. +This window contains all the configuration options of the gadget, in particular the refresh rate and the number of points displayed on the graph. -Some events, being able to involve a notification, can also be recorded. -If no external script is specified, a standard behavior will start. -The events can constantly be modified or removed, simply by selection of the line in the table. +Additional custom events with a notification can also be stored here. +If no external script is specified, a default behavior will be used. +The events can be modified or removed, simply by selection the event line in the table and selecting the required button. - The gadget window: -This window display the light graph. -When this window is showed, the events recorded in the settings window are not notified. +This window displays the light graph. +When this window is displayed, the events stored in the settings window are not notified. This window makes it possible to try various configurations and to add them in the settings table. -A test area comprising two buttons make it possible Tux to seek the most luminous direction, or darkest.</help_text> +In the test part with two buttons you can make Tux search for the light source or darkest spot.</help_text> <ChangeU type='str'>The light level raised and dropped</ChangeU> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> @@ -60,7 +61,6 @@ <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> - <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> + <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <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> - <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> + <light5 type='str'>I can't find the direction of the light.</light5> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2007-10-24 10:19:49
|
Author: Paul_R Date: 2007-10-24 12:19:49 +0200 (Wed, 24 Oct 2007) New Revision: 641 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml Log: * Little change in a label Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-24 10:07:29 UTC (rev 640) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-24 10:19:49 UTC (rev 641) @@ -11,7 +11,7 @@ <widget_lblControl type='str'>Contrôle</widget_lblControl> <Increase type='str'>Le niveau de la batterie est passé en dessus du seuil</Increase> <full type='str'>Les batteries sont pleines</full> - <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> + <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <lblLowThreshold type='str'>Limite inférieure</lblLowThreshold> <help_text type='str'>-- Les évènements : Deux grands types d'évènements peuvent avoir lieu, contenant chacun diverses options : @@ -58,7 +58,7 @@ <conf_lblChangeU type='str'>Augmente et chute</conf_lblChangeU> <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> <widget_lblBoth type='str'>Deux directions</widget_lblBoth> - <gui_conf_rate_lb type='str'>Taux de rafraichissement :</gui_conf_rate_lb> + <gui_conf_rate_lb type='str'>Rafraichissement :</gui_conf_rate_lb> <absolute_threshold_high type='str'>Batteries pleines</absolute_threshold_high> <mainscript type='str'>J'ai trouvé la lumière !</mainscript> <conf_btnRemove type='str'>Enlever</conf_btnRemove> @@ -73,7 +73,7 @@ <MainBehavior type='str'>Comportement principal</MainBehavior> <speaker_name type='str'>Bruno8k</speaker_name> <conf_lblSample type='str'>Points</conf_lblSample> - <conf_lblType type='str'>Type</conf_lblType> + <charging type='str'>En charge</charging> <Change type='str'>Le niveau de la batterie a changé</Change> <Both type='str'>Le niveau de la batterie a passé le seuil</Both> <conf_btnModify type='str'>Modifier</conf_btnModify> @@ -82,7 +82,7 @@ <widget_lblIncrease type='str'>Accroissement</widget_lblIncrease> <widget_lblRaise type='str'>Augmentation</widget_lblRaise> <conf_btnAdd type='str'>Ajouter</conf_btnAdd> - <on_battery type='str'>et tux est alimenté par les batteries</on_battery> + <on_battery type='str'>et alimenté par les batteries</on_battery> <widget_lblDecrease type='str'>Decroissance</widget_lblDecrease> <gui_conf_sample_lb type='str'>Nombre de points :</gui_conf_sample_lb> <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> @@ -102,18 +102,18 @@ <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Changement</widget_lblChange> <name_to_read type='str'>Moniteur de batteries</name_to_read> - <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> <Drop type='str'>Le niveau de la batterie a chuté</Drop> <conf_lblDrop type='str'>Chute</conf_lblDrop> - <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> <Raise type='str'>Le niveau de la batterie a augmenté</Raise> - <charging type='str'>En charge</charging> + <conf_lblType type='str'>Type</conf_lblType> <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> <Decrease type='str'>Le niveau de la batterie est passé en dessous du seuil</Decrease> <conf_lblValue type='str'>Valeur (V)</conf_lblValue> - <conf_lblRate type='str'>Taux de rafraichissement</conf_lblRate> + <conf_lblRate type='str'>Rafraichissement</conf_lblRate> <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> - <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> <conf_lblControl type='str'>Contrôle</conf_lblControl> <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-24 10:07:29 UTC (rev 640) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-24 10:19:49 UTC (rev 641) @@ -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'>Battery monitor for tux droid</gadget_description> - <gadget_author type='str'>Paul Rathgeb</gadget_author> <gadget_name type='str'>battery_monitor</gadget_name> - <gadget_version type='str'>0.0.1</gadget_version> </about> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-24 10:07:29 UTC (rev 640) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-24 10:19:49 UTC (rev 641) @@ -1,11 +1,11 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> + <Sample type='float'>600.0</Sample> + <low_threshold type='float'>4.8</low_threshold> <chkMotors type='bool'>True</chkMotors> - <low_threshold type='float'>4.8</low_threshold> <MainScript type='str'>None</MainScript> - <Sample type='float'>600.0</Sample> + <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> <Rate type='float'>1.0</Rate> <high_threshold type='float'>6.0</high_threshold> <config type='list'>[]</config> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-24 10:07:29 UTC (rev 640) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-24 10:19:49 UTC (rev 641) @@ -3,20 +3,15 @@ <conf_lblIncrease type='str'>Increase</conf_lblIncrease> <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> - <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <battery type='str'>On battery</battery> - <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <conf_lblRaise type='str'>Raise</conf_lblRaise> - <widget_lblTest type='str'>Notifications</widget_lblTest> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> <Increase type='str'>The battery level exceeded the threshold</Increase> - <conf_btnModify type='str'>Modify</conf_btnModify> - <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> - <lblLowThreshold type='str'>Lower limit</lblLowThreshold> - <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> - <lblMotors type='str'>Disable measure when the motors are running</lblMotors> + <full type='str'>The level of the batteries is full</full> + <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> + <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <help_text type='str'>-- The events: Two main types of events can take place, containing each one various options: @@ -53,38 +48,41 @@ When this window is showed, the events recorded in the settings window are not notified. This window makes it possible to try various configurations and to add them in the settings table.</help_text> <end_of_charge type='str'>The load of the battery is finished</end_of_charge> + <conf_btnRemove type='str'>Remove</conf_btnRemove> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> <widget_lblChangeU type='str'>Raise and drop</widget_lblChangeU> <widget_lblNotified type='str'>Notified</widget_lblNotified> - <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Update</gui_conf_update_title> <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <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> <absolute_threshold_high type='str'>The batteries are full</absolute_threshold_high> <mainscript type='str'>I've found the light !</mainscript> - <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <MainBehavior type='str'>Main behavior</MainBehavior> + <lblLowThreshold type='str'>Lower limit</lblLowThreshold> <plugged type='str'>Plugged</plugged> + <ChangeU type='str'>The battery level raised and dropped</ChangeU> <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> <charge type='str'>and the batteries are being charged</charge> <gui_conf_about_title type='str'>About</gui_conf_about_title> <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> <low type='str'>The level of the batteries is weak</low> - <conf_btnAdd type='str'>Add</conf_btnAdd> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <charging type='str'>Charging</charging> + <speaker_name type='str'>Ryan8k</speaker_name> <conf_lblSample type='str'>Samples</conf_lblSample> <conf_lblType type='str'>Type</conf_lblType> <Change type='str'>The battery level changed</Change> - <conf_lblValue type='str'>Value (V)</conf_lblValue> <Both type='str'>The battery level reached the threshold</Both> - <full type='str'>The level of the batteries is full</full> + <conf_btnModify type='str'>Modify</conf_btnModify> <widget_lblEvent type='str'>Event</widget_lblEvent> <normal type='str'>The level of the batteries is good</normal> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <widget_lblRaise type='str'>Raise</widget_lblRaise> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> + <conf_btnAdd type='str'>Add</conf_btnAdd> <on_battery type='str'>and tux is fed by the batteries</on_battery> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> @@ -92,31 +90,33 @@ <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> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> + <ChangeD type='str'>The battery level dropped and raised</ChangeD> + <absolute_threshold type='str'>Weak batteries </absolute_threshold> + <lblMotors type='str'>Disable measure when the motors are running</lblMotors> <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> + <lblHighThreshold type='str'>Higher limit</lblHighThreshold> <widget_lblValue type='str'>Value (V)</widget_lblValue> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <speaker_name type='str'>Ryan8k</speaker_name> + <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <plug type='str'>and the power supply is plugged</plug> - <absolute_threshold type='str'>Weak batteries </absolute_threshold> + <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'>Battery monitor</name_to_read> - <lblHighThreshold type='str'>Higher limit</lblHighThreshold> - <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <Drop type='str'>The battery level dropped</Drop> <conf_lblDrop type='str'>Drop</conf_lblDrop> - <ChangeD type='str'>The battery level dropped and raised</ChangeD> + <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> <Raise type='str'>The battery level raised</Raise> - <charging type='str'>Charging</charging> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> <widget_lblSet type='str'>Add to config</widget_lblSet> <Decrease type='str'>The battery level passed below the threshold</Decrease> - <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> + <conf_lblValue type='str'>Value (V)</conf_lblValue> <conf_lblRate type='str'>Refresh rate</conf_lblRate> <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> - <MainBehavior type='str'>Main behavior</MainBehavior> - <ChangeU type='str'>The battery level raised and dropped</ChangeU> + <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> + <widget_lblTest type='str'>Notifications</widget_lblTest> <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> </strings> |
From: Paul_R <c2m...@c2...> - 2007-10-24 10:07:34
|
Author: Paul_R Date: 2007-10-24 12:07:29 +0200 (Wed, 24 Oct 2007) New Revision: 640 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.glade software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.pyp software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/init.pyp software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/main.pyp software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/notify.pyp software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml Log: Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py 2007-10-22 15:14:24 UTC (rev 639) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py 2007-10-24 10:07:29 UTC (rev 640) @@ -97,7 +97,7 @@ def draw_threshold(self): coeff_y = float(self.rect.height / self.measure_graph.RANGE) - y = self.measure_graph.convert_value([0, 1, 0, 4.75]) + y = self.measure_graph.convert_value([0, 1, 0, self.measure_graph.low_threshold]) y = (y * 3.4) self.context.set_source_rgb(0.8, 0, 0) @@ -107,7 +107,7 @@ self.context.line_to(0, self.rect.height - y * coeff_y) self.context.stroke() - y = self.measure_graph.convert_value([0, 1, 0, 6.25]) + y = self.measure_graph.convert_value([0, 1, 0, self.measure_graph.high_threshold]) y = (y * 3.4) self.context.set_source_rgb(0, 0.8, 0) self.context.set_line_width(1) @@ -215,9 +215,13 @@ self.val_table_event = [-1] * int(self.sample) self.charger_event_backup = 3 self.test_tab = [0] - self.absolute_threshold_flag = False - self.threshold_flag = False + self.absolute_threshold_low_flag = False + self.absolute_threshold_high_flag = False + self.low_threshold_flag = False + self.high_threshold_flag = False + self.end_of_charge_flag = False self.chkMotors = False + self.disable_event = False self.tick = time.time() + 1 @@ -227,6 +231,8 @@ self.start_flag = True self.wait = time.time() + 2.0 self.RANGE = 340.0 + self.low_threshold = 5.0 + self.high_threshold = 6.0 self.__on_battery_mutex = threading.Lock() self.__timeout_mutex = threading.Lock() @@ -253,19 +259,13 @@ else: self.event_tab = self.__tab - self.threshold_flag = self.absolute_threshold() - - - if self.GUI_on: - #goto test notification every sec. - if self.wait <= time.time(): - self.wait = time.time() + 2.0 - self.test_notification() - - + self.low_threshold_flag = self.absolute_threshold_low(self.low_threshold, self.low_threshold + 0.1) + self.high_threshold_flag = self.absolute_threshold_high(self.high_threshold, self.high_threshold - 0.1) + # To prevent notifications at startup - if self.start_flag == True: + if self.start_flag == True or self.disable_event == True: self.test_tab[0][7] = False + self.disable_event = False self.start_flag = False for i in range (len(self.event_tab)): self.event_tab[i][7] = False @@ -288,25 +288,37 @@ # Absolute threshold control # ########################################################### - def absolute_threshold(self): - - if self.absolute_threshold_flag == False: - val = self.convert_value([0, 1, 0, 4.75]) - print ((val* self.RANGE) / 100) + def absolute_threshold_low(self, value, value_off): + if self.absolute_threshold_low_flag == False: + val = self.convert_value([0, 1, 0, value]) val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE if val_prev >= val and val_act < val: - self.absolute_threshold_flag = True + self.absolute_threshold_low_flag = True return True else: - val = self.convert_value([0, 1, 0, 4.9]) + val = self.convert_value([0, 1, 0, value_off]) val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE if val_prev <= val and val_act > val: - self.absolute_threshold_flag = False + self.absolute_threshold_low_flag = False return False - + def absolute_threshold_high(self, value, value_off): + if self.absolute_threshold_high_flag == False: + val = self.convert_value([0, 1, 0, value]) + val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE + val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE + if val_prev <= val and val_act > val: + self.absolute_threshold_high_flag = True + return True + else: + val = self.convert_value([0, 1, 0, value_off]) + val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE + val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE + if val_prev >= val and val_act < val: + self.absolute_threshold_high_flag = False + return False ########################################################### @@ -470,6 +482,8 @@ if not (self.chkMotors == True and args[2] == 1): self.average += (args[0] * 256) + args[1] self.count += 1 + else: + self.disable_event = True # Refresh the sample and rate value if self.sample_backup != self.sample: @@ -492,7 +506,6 @@ else: val = self.average / self.count val = val - 530 - print val charger_event = -1 #Event control @@ -504,6 +517,9 @@ charger_event = 0 if self.charger_event_backup != charger_event: + # End of the charge cycle + if self.charger_event_backup == 2 and charger_event == 1: + self.end_of_charge_flag = True self.charger_event_backup = charger_event else: charger_event = -1 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.glade =================================================================== (Binary files differ) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.pyp 2007-10-22 15:14:24 UTC (rev 639) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/conf/other.pyp 2007-10-24 10:07:29 UTC (rev 640) @@ -60,6 +60,8 @@ self.get_widget('txt_conf_rate').set_text(str(_me.get_param('Rate'))) self.get_widget('txt_conf_sample').set_text(str(_me.get_param('Sample'))) + self.get_widget('txtLowThreshold').set_text(str(_me.get_param('low_threshold'))) + self.get_widget('txtHighThreshold').set_text(str(_me.get_param('high_threshold'))) ########################################################### @@ -159,6 +161,8 @@ self.get_widget("lbl_conf_rate").set_text(_me.string('conf_lblRate')) self.get_widget("lblControlFrame").set_text(_me.string('conf_lblControl')) self.get_widget("lblScript").set_text(_me.string('MainBehavior')) + self.get_widget("lblHighThreshold").set_label(_me.string('lblHighThreshold')) + self.get_widget("lblLowThreshold").set_label(_me.string('lblLowThreshold')) ########################################################### @@ -168,6 +172,7 @@ ########################################################### def on_row_selected(self, obj): path = obj.get_selected_rows() + print path self.__iter = self.value_list.get_iter(path[1][0]) index = self.value_list.get_value(self.__iter, 0) event = self.value_list.get_value(self.__iter, 1) @@ -380,7 +385,34 @@ self.measure.chkMotors = self.get_widget('chkMotors').get_active() self.measure.rate_backup = _me.get_param('Rate') self.measure.sample_backup = _me.get_param('Sample') + + try: + float(self.get_widget('txtLowThreshold').get_text()) + except: + self.get_widget('txtLowThreshold').set_text('4.8') + + if float(self.get_widget('txtLowThreshold').get_text()) < 4.0: + self.get_widget('txtLowThreshold').set_text('4.0') + if float(self.get_widget('txtLowThreshold').get_text()) > 6.3: + self.get_widget('txtLowThreshold').set_text('6.3') + self.measure.low_threshold = float(self.get_widget('txtLowThreshold').get_text()) + _me.set_param('low_threshold', self.measure.low_threshold) + + try: + float(self.get_widget('txtHighThreshold').get_text()) + except: + self.get_widget('txtHighThreshold').set_text('4.8') + + if float(self.get_widget('txtHighThreshold').get_text()) < self.measure.low_threshold: + self.get_widget('txtHighThreshold').set_text(str(self.measure.low_threshold + 0.1)) + if float(self.get_widget('txtHighThreshold').get_text()) > 6.4: + self.get_widget('txtHighThreshold').set_text('6.4') + + self.measure.high_threshold = float(self.get_widget('txtHighThreshold').get_text()) + _me.set_param('high_threshold', self.measure.high_threshold) + + _me.set_var('notify_delay', int(self.get_widget("delay_spinbutton").get_value())) self.get_widget("window1").destroy() Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/init.pyp =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/init.pyp 2007-10-22 15:14:24 UTC (rev 639) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/init.pyp 2007-10-24 10:07:29 UTC (rev 640) @@ -10,6 +10,8 @@ measure.rate_backup = measure.rate measure.sample = float(_me.get_param('Sample')) measure.sample_backup = measure.sample +measure.low_threshold = _me.get_param('low_threshold') +measure.high_threshold = _me.get_param('high_threshold') measure.chkMotors = _me.get_param('chkMotors') measure.event_tab = _me.get_param('config') Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/main.pyp =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/main.pyp 2007-10-22 15:14:24 UTC (rev 639) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/main.pyp 2007-10-24 10:07:29 UTC (rev 640) @@ -4,22 +4,33 @@ def battery_level(): measure = _me.get_param('measure') val = measure.val_table[len(measure.val_table)-1] - - if val <= 102: - tux.cmd.mouth_open() + max_val = measure.convert_value([0, 1, 0, measure.high_threshold]) + max_val = max_val * 3.4 + min_val = measure.convert_value([0, 1, 0, measure.low_threshold]) + min_val = min_val * 3.4 + + txt = '' + if val <= min_val: txt = _me.string('low') - tux.tts.speak(str(txt)) - tux.cmd.mouth_close() + #tux.tts.speak(str(txt)) - elif val >= 306: - tux.cmd.mouth_open() + elif val >= max_val: txt = _me.string('full') - tux.tts.speak(str(txt)) - tux.cmd.mouth_close() + #tux.tts.speak(str(txt)) else: - tux.cmd.mouth_open() txt = _me.string('normal') - tux.tts.speak(str(txt)) - tux.cmd.mouth_close() + #tux.tts.speak(str(txt)) + txt = txt + ', ' + + if tux.status.charger_state(): + txt = txt + _me.string('charge') + elif tux.status.power_plug(): + txt = txt + _me.string('plug') + else: + txt = txt + _me.string('on_battery') + print txt + tux.cmd.mouth_open() + tux.tts.speak(str(txt)) + tux.cmd.mouth_close() battery_level() Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/notify.pyp 2007-10-22 15:14:24 UTC (rev 639) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/notify.pyp 2007-10-24 10:07:29 UTC (rev 640) @@ -1,45 +1,73 @@ def notify_checker(): measure = _me.get_param('measure') - if measure.threshold_flag == True: + if measure.low_threshold_flag == True or measure.high_threshold_flag == True: return True + + if measure.end_of_charge_flag == True: + return True + if measure.GUI_on == False: for i in range(len(measure.event_tab)): temp = measure.event_tab[i][7] if temp == True: return True return False + elif measure.GUI_on == True: + 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 - if _me.get_param('measure').threshold_flag == True: - _me.get_param('measure').threshold_flag = False + measure = _me.get_param('measure') + #event = _me.get_param('measure').event_tab + if _me.get_param('measure').low_threshold_flag == True: + _me.get_param('measure').low_threshold_flag = False tux.cmd.mouth_open() tux.tts.speak(_me.string('absolute_threshold')) tux.cmd.mouth_close() + + if _me.get_param('measure').high_threshold_flag == True: + _me.get_param('measure').high_threshold_flag = False + tux.cmd.mouth_open() + tux.tts.speak(_me.string('absolute_threshold_high')) + tux.cmd.mouth_close() + + if measure.end_of_charge_flag == True: + measure.end_of_charge_flag = False + tux.cmd.mouth_open() + tux.tts.speak(_me.string('end_of_charge')) + tux.cmd.mouth_close() - else: + else: + if measure.GUI_on: + event = measure.test_tab + else: + event = measure.event_tab + for i in range(len(event)): #create text to speach for the default notification if event[i][1] == 0: if event[i][2] == 0: - text = _me.string('conf_lblDrop') + text = _me.string('Drop') elif event[i][2] == 1: - text = _me.string('conf_lblRaise') + text = _me.string('Raise') elif event[i][2] == 2: - text = _me.string('conf_lblChangeD') + text = _me.string('ChangeD') elif event[i][2] == 3: - text = _me.string('conf_lblChangeU') + text = _me.string('ChangeU') else: if event[i][2] == 0: - text = _me.string('conf_lblIncrease') + text = _me.string('Increase') elif event[i][2] == 1: - text = _me.string('conf_lblDecrease') + text = _me.string('Decrease') elif event[i][2] == 2: - text = _me.string('conf_lblBoth') + text = _me.string('Both') if event[i][7]: if event[i][5]: @@ -47,7 +75,7 @@ path = path.replace('%20', ' ') if os.path.isfile(path) and os.path.exists(path): path = "'%s'" % path - tux.sys.shell_free(path) + tux.sys.shell(path) event[i][7] = False else: tux.cmd.mouth_open() Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-22 15:14:24 UTC (rev 639) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-24 10:07:29 UTC (rev 640) @@ -9,8 +9,10 @@ <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <conf_lblEvent type='str'>Evènement</conf_lblEvent> <widget_lblControl type='str'>Contrôle</widget_lblControl> + <Increase type='str'>Le niveau de la batterie est passé en dessus du seuil</Increase> <full type='str'>Les batteries sont pleines</full> - <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> + <lblLowThreshold type='str'>Limite inférieure</lblLowThreshold> <help_text type='str'>-- Les évènements : Deux grands types d'évènements peuvent avoir lieu, contenant chacun diverses options : @@ -45,6 +47,7 @@ Cette fenêtre affiche le graphique de la batterie. Lorsque cette fenêtre est affichée, les évènements enregistrés dans la fenêtre de configuration ne sont plus notifiés. Cette fenêtre permet de tester diverses configurations et de les ajouter dans le tableau de configuration.</help_text> + <end_of_charge type='str'>La charge de la batterie est terminée</end_of_charge> <conf_lblChange type='str'>Changement</conf_lblChange> <conf_lblBoth type='str'>Deux directions</conf_lblBoth> <widget_lblBtnApply type='str'>Appliquer</widget_lblBtnApply> @@ -56,49 +59,61 @@ <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> <widget_lblBoth type='str'>Deux directions</widget_lblBoth> <gui_conf_rate_lb type='str'>Taux de rafraichissement :</gui_conf_rate_lb> - <widget_lblValue type='str'>Valeur (V)</widget_lblValue> + <absolute_threshold_high type='str'>Batteries pleines</absolute_threshold_high> <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> <plugged type='str'>Connecté</plugged> + <ChangeU type='str'>Le niveau de la batterie a augmenté puis chuté</ChangeU> <conf_btnBehavior type='str'>Supprimer</conf_btnBehavior> + <charge type='str'>et les batteries sont en train d'être rechargée</charge> <gui_conf_about_title type='str'>A propos</gui_conf_about_title> <conf_lblChangeD type='str'>Chute et augmente</conf_lblChangeD> <low type='str'>Le niveau des batteries est faible</low> + <MainBehavior type='str'>Comportement principal</MainBehavior> <speaker_name type='str'>Bruno8k</speaker_name> <conf_lblSample type='str'>Points</conf_lblSample> <conf_lblType type='str'>Type</conf_lblType> - <widget_lblDisplayThreshold type='str'>Afficher le seuil sur le graph.</widget_lblDisplayThreshold> + <Change type='str'>Le niveau de la batterie a changé</Change> + <Both type='str'>Le niveau de la batterie a passé le seuil</Both> <conf_btnModify type='str'>Modifier</conf_btnModify> <widget_lblEvent type='str'>Evènement</widget_lblEvent> <normal type='str'>Le niveau des batteries est bon</normal> <widget_lblIncrease type='str'>Accroissement</widget_lblIncrease> <widget_lblRaise type='str'>Augmentation</widget_lblRaise> <conf_btnAdd type='str'>Ajouter</conf_btnAdd> + <on_battery type='str'>et tux est alimenté par les batteries</on_battery> <widget_lblDecrease type='str'>Decroissance</widget_lblDecrease> <gui_conf_sample_lb type='str'>Nombre de points :</gui_conf_sample_lb> <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> <conf_lblNotifiedBehavior type='str'>Notifié</conf_lblNotifiedBehavior> <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> <widget_lblDrop type='str'>Chute</widget_lblDrop> - <MainBehavior type='str'>Comportement principal</MainBehavior> + <ChangeD type='str'>Le niveau de la batterie a chuté puis augmenté</ChangeD> <absolute_threshold type='str'>Batteries faibles</absolute_threshold> <lblMotors type='str'>Rejeter les mesures lorsque les moteurs fonctionnent</lblMotors> <conf_lblDecrease type='str'>Diminue</conf_lblDecrease> + <lblHighThreshold type='str'>Limite supérieure</lblHighThreshold> + <widget_lblValue type='str'>Valeur (V)</widget_lblValue> <conf_lblDefaultBehavior type='str'>Comportement pas défaut</conf_lblDefaultBehavior> + <widget_lblDisplayThreshold type='str'>Afficher le seuil sur le graph.</widget_lblDisplayThreshold> <conf_lblBehavior type='str'>Comportement</conf_lblBehavior> + <plug type='str'>et l'alimentation est connectée</plug> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Changement</widget_lblChange> <name_to_read type='str'>Moniteur de batteries</name_to_read> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <Drop type='str'>Le niveau de la batterie a chuté</Drop> + <conf_lblDrop type='str'>Chute</conf_lblDrop> <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> - <conf_lblDrop type='str'>Chute</conf_lblDrop> - <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <Raise type='str'>Le niveau de la batterie a augmenté</Raise> <charging type='str'>En charge</charging> <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> + <Decrease type='str'>Le niveau de la batterie est passé en dessous du seuil</Decrease> <conf_lblValue type='str'>Valeur (V)</conf_lblValue> <conf_lblRate type='str'>Taux de rafraichissement</conf_lblRate> <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> - <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> + <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> <conf_lblControl type='str'>Contrôle</conf_lblControl> <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-22 15:14:24 UTC (rev 639) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-24 10:07:29 UTC (rev 640) @@ -3,22 +3,22 @@ <parameters> <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> <chkMotors type='bool'>True</chkMotors> + <low_threshold type='float'>4.8</low_threshold> <MainScript type='str'>None</MainScript> <Sample type='float'>600.0</Sample> - <Rate type='float'>10.0</Rate> + <Rate type='float'>1.0</Rate> + <high_threshold type='float'>6.0</high_threshold> <config type='list'>[]</config> </parameters> <general> <gui_state> <widget> - <y type='int'>336</y> + <y type='int'>362</y> <visible type='bool'>True</visible> - <x type='int'>506</x> + <x type='int'>133</x> </widget> <conf> - <y type='int'>49</y> - <visible type='bool'>True</visible> - <x type='int'>0</x> + <visible type='bool'>False</visible> </conf> </gui_state> <language type='str'>en_US</language> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-22 15:14:24 UTC (rev 639) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-24 10:07:29 UTC (rev 640) @@ -3,14 +3,18 @@ <conf_lblIncrease type='str'>Increase</conf_lblIncrease> <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> + <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <battery type='str'>On battery</battery> + <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <conf_lblRaise type='str'>Raise</conf_lblRaise> <widget_lblTest type='str'>Notifications</widget_lblTest> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> + <Increase type='str'>The battery level exceeded the threshold</Increase> <conf_btnModify type='str'>Modify</conf_btnModify> - <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> + <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> + <lblLowThreshold type='str'>Lower limit</lblLowThreshold> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <lblMotors type='str'>Disable measure when the motors are running</lblMotors> <help_text type='str'>-- The events: @@ -48,35 +52,40 @@ This window display the battery voltage graph. When this window is showed, the events recorded in the settings window are not notified. This window makes it possible to try various configurations and to add them in the settings table.</help_text> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <end_of_charge type='str'>The load of the battery is finished</end_of_charge> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> <widget_lblChangeU type='str'>Raise and drop</widget_lblChangeU> <widget_lblNotified type='str'>Notified</widget_lblNotified> + <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Update</gui_conf_update_title> - <widget_lblValue type='str'>Value (V)</widget_lblValue> + <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> + <absolute_threshold_high type='str'>The batteries are full</absolute_threshold_high> <mainscript type='str'>I've found the light !</mainscript> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <plugged type='str'>Plugged</plugged> <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> + <charge type='str'>and the batteries are being charged</charge> <gui_conf_about_title type='str'>About</gui_conf_about_title> <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> <low type='str'>The level of the batteries is weak</low> <conf_btnAdd type='str'>Add</conf_btnAdd> - <speaker_name type='str'>Ryan8k</speaker_name> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <conf_lblSample type='str'>Samples</conf_lblSample> <conf_lblType type='str'>Type</conf_lblType> - <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> - <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> + <Change type='str'>The battery level changed</Change> + <conf_lblValue type='str'>Value (V)</conf_lblValue> + <Both type='str'>The battery level reached the threshold</Both> <full type='str'>The level of the batteries is full</full> <widget_lblEvent type='str'>Event</widget_lblEvent> <normal type='str'>The level of the batteries is good</normal> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <widget_lblRaise type='str'>Raise</widget_lblRaise> <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> + <on_battery type='str'>and tux is fed by the batteries</on_battery> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> @@ -86,21 +95,27 @@ <conf_lblNotified type='str'>Notified ?</conf_lblNotified> <widget_lblBoth type='str'>Both direction</widget_lblBoth> <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> + <widget_lblValue type='str'>Value (V)</widget_lblValue> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> + <speaker_name type='str'>Ryan8k</speaker_name> + <plug type='str'>and the power supply is plugged</plug> <absolute_threshold type='str'>Weak batteries </absolute_threshold> <widget_lblChange type='str'>Change</widget_lblChange> <name_to_read type='str'>Battery monitor</name_to_read> - <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> + <lblHighThreshold type='str'>Higher limit</lblHighThreshold> + <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <Drop type='str'>The battery level dropped</Drop> <conf_lblDrop type='str'>Drop</conf_lblDrop> - <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <ChangeD type='str'>The battery level dropped and raised</ChangeD> + <Raise type='str'>The battery level raised</Raise> <charging type='str'>Charging</charging> <widget_lblSet type='str'>Add to config</widget_lblSet> - <conf_lblValue type='str'>Value (V)</conf_lblValue> + <Decrease type='str'>The battery level passed below the threshold</Decrease> + <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> <conf_lblRate type='str'>Refresh rate</conf_lblRate> <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> <MainBehavior type='str'>Main behavior</MainBehavior> - <conf_lblTime type='str'>Time (sec.)</conf_lblTime> + <ChangeU type='str'>The battery level raised and dropped</ChangeU> <conf_lblControl type='str'>Control</conf_lblControl> <conf_btnRemove type='str'>Remove</conf_btnRemove> <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> |
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) |
Author: Paul_R Date: 2007-10-19 16:54:45 +0200 (Fri, 19 Oct 2007) New Revision: 638 Added: software/gadgets/tux_controller/ software/gadgets/tux_controller/branches/ software/gadgets/tux_controller/tags/ software/gadgets/tux_controller/trunk/ software/gadgets/tux_controller/trunk/TuxDroidController.tgf software/gadgets/tux_controller/trunk/TuxDroidController/ software/gadgets/tux_controller/trunk/TuxDroidController/Pictures/ software/gadgets/tux_controller/trunk/TuxDroidController/Pictures/Icons/ software/gadgets/tux_controller/trunk/TuxDroidController/Pictures/Icons/gadget.png software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/ software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/ software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/ software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/cmd/ software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/cmd/other.glade software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/cmd/other.pyp software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/conf/ software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/conf/other.glade software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/conf/other.pyp software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/control/ software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/control/other.glade software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/control/other.pyp software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/widget/ software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/widget/other.glade software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/widget/other.pyp software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/init.pyp software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/main.pyp software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/notify.pyp software/gadgets/tux_controller/trunk/TuxDroidController/Strings/ software/gadgets/tux_controller/trunk/TuxDroidController/Strings/fr_ALL.xml software/gadgets/tux_controller/trunk/TuxDroidController/about.xml software/gadgets/tux_controller/trunk/TuxDroidController/parts.xml software/gadgets/tux_controller/trunk/TuxDroidController/settings.xml software/gadgets/tux_controller/trunk/TuxDroidController/strings.xml Log: * Added the tux controller gadget (R?\195?\169mi version) Added: software/gadgets/tux_controller/trunk/TuxDroidController/Pictures/Icons/gadget.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxDroidController/Pictures/Icons/gadget.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/cmd/other.glade =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/cmd/other.glade ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/cmd/other.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/cmd/other.pyp (rev 0) +++ software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/cmd/other.pyp 2007-10-19 14:54:45 UTC (rev 638) @@ -0,0 +1,34 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.get_path('root') + '/Scripts/Python/GUI/cmd/other.glade', + root="window1", + domain="params", **kwargs): + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + self.get_widget("window1").set_title(_me.string('name_to_read')) + thread.start_new_thread(self.update, ()) + + def update(self): + _me.update_informations() + + #-------------------------------------------------------------------------- + # On "Send command" button clicked + #-------------------------------------------------------------------------- + def on_button1_clicked(self, widget, *args): + commandst=self.get_widget("entry1").get_text() + commands=commandst.split(" ") + if len(commands)<4: + return + else: + commandp=[0,0,0,0] + for i in range(len(commands)): + if commands[i].find("0x")!=-1: + commandp[i]=int(commands[i][2:],16) + else: + commandp[i]=int(commands[i]) + tux.cmd.raw(int(commandp[0]),int(commandp[1]),int(commandp[2]), + int(commandp[3])) Added: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/conf/other.glade =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/conf/other.glade ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Name: svn:mime_type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/conf/other.pyp (rev 0) +++ software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/conf/other.pyp 2007-10-19 14:54:45 UTC (rev 638) @@ -0,0 +1,91 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.get_path('root') + '/Scripts/Python/GUI/conf/other.glade', + root="window1", + domain="params", **kwargs): + """ + Constructor + """ + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + """ + On new window + """ + self.updates_commons() + self.updates_specifics() + + def updates_commons(self): + """ + Updates common widgets + """ + # Window title + txt = "%s : %s" % (_me.string('name_to_read'), + _me.string('gui_conf_window_title')) + self.get_widget("window1").set_title(txt) + + # About labels + txt = _me.string('gui_conf_about_title') + self.get_widget("label7").set_text(txt) + + txt = "%s : %s" % (_me.string('gui_conf_description_lb'), + _me.get_description()) + self.get_widget("label_description").set_text(txt) + + txt = "%s : %s" % (_me.string('gui_conf_author_lb'), + _me.get_author()) + self.get_widget("label_author").set_text(txt) + + txt = "%s : %s" % (_me.string('gui_conf_version_lb'), + _me.get_version()) + self.get_widget("label_version").set_text(txt) + + # Remote Frame + txt = _me.string('gui_conf_remote_title') + self.get_widget("label11").set_text(txt) + + txt = "%s : None" % _me.string('gui_conf_current_bind_lb') + self.get_widget("label_remote").set_text(txt) + + txt = _me.string('gui_conf_remote_set_bt') + self.get_widget("button_remote").set_label(txt) + + # Bottom buttons + txt = _me.string('gui_conf_cancel_bt') + self.get_widget("label6").set_text(txt) + + txt = _me.string('gui_conf_accept_bt') + self.get_widget("label5").set_text(txt) + + def updates_specifics(self): + """ + Updates specific widgets + """ + pass + + def on_button_remote_clicked(self, widget, *args): + """ + On button 'set' remote clicked + """ + def remote_set_caption(): + tux.sys.wait(0.1) + gadgets['Manager'].gui('remote').window.set_captions(gadgets[_me.get_name()]) + if gadgets.has_key('Manager'): + if not gadgets['Manager'].gui('remote').showed(): + gadgets['Manager'].gui('remote').show() + thread.start_new_thread(remote_set_caption, ()) + + def on_accept_clicked(self, widget, *args): + """ + On button 'accept' clicked + """ + self.get_widget("window1").destroy() + + def on_cancel_clicked(self, widget, *args): + """ + On button 'cancel' clicked + """ + self.get_widget("window1").destroy() Added: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/control/other.glade =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/control/other.glade ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/control/other.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/control/other.pyp (rev 0) +++ software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/control/other.pyp 2007-10-19 14:54:45 UTC (rev 638) @@ -0,0 +1,262 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.get_path('root') + '/Scripts/Python/GUI/control/other.glade', + root="window1", + domain="params", **kwargs): + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + import gobject + + self.get_widget("window1").set_title(_me.string('name_to_read')) + self.toggled_by_event = False + self.onpause = False + self.onplay = False + self.status_list_st = [] + self.status_list_changed = False + self.bind_events() + self.xterm_cmd = self.get_terminal() + tux.status.lled() + tux.status.rled() + tux.cmd.leds_blink(2, 20) + self.on_mouth_stop() + self.on_eyes_stop() + thread.start_new_thread(self.status_viewer_thread, ()) + + def on_window1_destroy(self, widget, *args): + _me.exit_main_loop() + + def bind_events(self): + tux.event.on_left_blue_led_on = self.on_left_blue_led_on + tux.event.on_left_blue_led_off = self.on_left_blue_led_off + tux.event.on_right_blue_led_on = self.on_right_blue_led_on + tux.event.on_right_blue_led_off = self.on_right_blue_led_off + tux.event.on_mouth_stop = self.on_mouth_stop + tux.event.on_eyes_stop = self.on_eyes_stop + tux.event.on_status = self.on_status + + def unbind_events(self): + tux.event.on_left_blue_led_on = None + tux.event.on_left_blue_led_off = None + tux.event.on_right_blue_led_on = None + tux.event.on_right_blue_led_off = None + tux.event.on_mouth_stop = None + tux.event.on_eyes_stop = None + tux.event.on_status = None + + def get_terminal(self): + terminal_shells = [ + ('gnome-terminal', '-x'), # gnome + ('konsole', '-e'), # kde + ('Terminal', '-x'), # xfce + ('xfce4-terminal', '-x'), # xfce + ('xterm', '-e'), # X + ] + if not os.popen('type ipython').close(): + py_cmd = 'ipython' + else: + py_cmd = 'python' + for term in terminal_shells: + if not os.popen('type %s'%term[0]).close(): + xterm_cmd = '%s %s %s -i /opt/tuxdroid/api/python/tux.py' \ + % (term[0], term[1], py_cmd) + return xterm_cmd + + #========================================================================== + # Leds functions + #========================================================================== + + #--------- + # Left led + #--------- + def on_ledl_toggled(self, widget, *args): + if self.toggled_by_event: return + if widget.get_active(): + tux.cmd.ledr_on() + else: + tux.cmd.ledr_off() + + def on_left_blue_led_on(self): + self.toggled_by_event = True + self.get_widget("checkbutton1").set_active(True) + self.toggled_by_event = False + + def on_left_blue_led_off(self): + self.toggled_by_event = True + self.get_widget("checkbutton1").set_active(False) + self.toggled_by_event = False + + def on_ledr_toggled(self, widget, *args): + if self.toggled_by_event: return + if widget.get_active(): + tux.cmd.ledl_on() + else: + tux.cmd.ledl_off() + + def on_right_blue_led_on(self): + self.toggled_by_event = True + self.get_widget("checkbutton2").set_active(True) + self.toggled_by_event = False + + def on_right_blue_led_off(self): + self.toggled_by_event = True + self.get_widget("checkbutton2").set_active(False) + self.toggled_by_event = False + + def on_flash_bt_clicked(self, widget, *args): + def _funct(): + num_sb = self.get_widget("spinbutton1") + tux.cmd.leds_blink(int(num_sb.get_value()), 15) + + thread.start_new_thread(_funct, ()) + + #========================================================================== + # Mouth functions + #========================================================================== + + def on_mouth_stop(self): + self.toggled_by_event=True + if tux.status.get_mouth_open_position() == 0: + self.get_widget("radiobutton3").set_active(True) + else: + self.get_widget("radiobutton4").set_active(True) + self.toggled_by_event = False + + def on_beak_open_toggled(self, widget, *args): + if self.toggled_by_event: return + if widget.get_active(): + tux.cmd.mouth_open() + + def on_rbeak_close_toggled(self, widget, *args): + if self.toggled_by_event: return + if widget.get_active(): + tux.cmd.mouth_close() + + def on_beak_talk_bt_clicked(self, widget, *args): + num_sb = self.get_widget("spinbutton3") + tux.cmd.mouth_on_free(int(num_sb.get_value())) + + #========================================================================== + # Eyes functions + #========================================================================== + + def on_eyes_stop(self): + self.toggled_by_event=True + if tux.status.get_eyes_closed_position_switch() == 1: + self.get_widget("radiobutton1").set_active(True) + else: + self.get_widget("radiobutton2").set_active(True) + self.toggled_by_event=False + + def on_eyes_open_toggled(self, widget, *args): + if self.toggled_by_event: return + if widget.get_active(): + tux.cmd.eyes_open() + + def on_eyes_close_toggled(self, widget, *args): + if self.toggled_by_event: return + if widget.get_active(): + tux.cmd.eyes_close() + + def on_eyes_blink_bt_clicked(self, widget, *args): + num_sb = self.get_widget("spinbutton2") + tux.cmd.eyes_on_free(int(num_sb.get_value())) + + #-------------------------------------------------------------------------- + # Event on status + #-------------------------------------------------------------------------- + def on_status(self,frame): + explicite_status = tux.explicit_status(frame) + if explicite_status.find("RF connected->") != -1: + return + if explicite_status.find("Light level->") != -1: + return + if explicite_status.find("RF connected->") != 0: + self.status_list_changed = True + self.status_list_st.append(explicite_status) + if len(self.status_list_st) == 50: + for i in range(1): + self.status_list_st.pop(0) + + #-------------------------------------------------------------------------- + # Status viewer refreshing thread + #-------------------------------------------------------------------------- + def status_viewer_thread(self): + while _me.gui('control').showed(): + if self.status_list_changed: + self.status_list_changed = False + statusview_b=self.get_widget("textview1").get_buffer() + statusview_b.set_text("") + startiter = statusview_b.get_start_iter() + string="" + if self.get_widget("checkbutton3").get_active(): + for i in range(len(self.status_list_st)): + string = self.status_list_st[i] + "\n" + string + else: + string = self.status_list_st[len(self.status_list_st)-1] + "\n" + statusview_b.insert(startiter, string) + + tux.sys.wait(0.5) + + #-------------------------------------------------------------------------- + # On flippers up radiobutton toggled + #-------------------------------------------------------------------------- + def on_flippers_up_toggled(self, widget, *args): + def _funct(): + if self.toggled_by_event: return + if widget.get_active(): + tux.cmd.raw(0x31,0,0,0) + tux.event.wait_status(DATAS_STATUS_WINGS_POSITION_COUNTER,0,5) + tux.cmd.wings_on(1) + + thread.start_new_thread(_funct,()) + + #-------------------------------------------------------------------------- + # On flippers down radiobutton toggled + #-------------------------------------------------------------------------- + def on_flippers_down_toggled(self, widget, *args): + def _funct(): + if self.toggled_by_event: return + if widget.get_active(): + tux.cmd.raw(0x31,0,0,0) + tux.event.wait_status(DATAS_STATUS_WINGS_POSITION_COUNTER,0,5) + + thread.start_new_thread(_funct,()) + + #-------------------------------------------------------------------------- + # On flippers flap button clicked + #-------------------------------------------------------------------------- + def on_flippers_flap_bt_clicked(self, widget, *args): + num_sb = self.get_widget("spinbutton4") + tux.cmd.wings_on_free(int(num_sb.get_value())) + + #-------------------------------------------------------------------------- + # On rotation button clicked + #-------------------------------------------------------------------------- + def on_rotation_spin_bt_clicked(self, widget, *args): + num_sb = self.get_widget("spinbutton5") + if self.get_widget("radiobutton7").get_active(): + tux.cmd.spinl_on_free(int(num_sb.get_value())) + else: + tux.cmd.spinr_on_free(int(num_sb.get_value())) + + #-------------------------------------------------------------------------- + # On "Tux Droid shell" button clicked + #-------------------------------------------------------------------------- + def on_tdshell_bt_clicked(self, widget, *args): + tux.sys.shell_free(self.xterm_cmd) + + #-------------------------------------------------------------------------- + # On "Tux Droid shell" button clicked + #-------------------------------------------------------------------------- + def on_scommand_bt_clicked(self, widget, *args): + _me.gui('cmd').show_from_main() + + #-------------------------------------------------------------------------- + # On "Ping" button clicked + #-------------------------------------------------------------------------- + def on_ping_bt_clicked(self, widget, *args): + thread.start_new_thread(tux.cmd.ping, (200,)) Added: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/widget/other.glade =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/widget/other.glade ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Name: svn:mime_type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/widget/other.pyp (rev 0) +++ software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/GUI/widget/other.pyp 2007-10-19 14:54:45 UTC (rev 638) @@ -0,0 +1,16 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.get_path('root') + '/Scripts/Python/GUI/widget/other.glade', + root="window1", + domain="params", **kwargs): + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + self.get_widget("window1").set_title(_me.string('name_to_read')) + thread.start_new_thread(self.update, ()) + + def update(self): + _me.update_informations() Added: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/init.pyp =================================================================== Added: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/main.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/main.pyp (rev 0) +++ software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/main.pyp 2007-10-19 14:54:45 UTC (rev 638) @@ -0,0 +1,14 @@ +def update_informations(): + pass + +def on_standby(): + if _me.gui('control').showed(): + _me.gui('control').window.unbind_events() + tux.event.on_remote_bt[K_STANDBY] = None + _me.gui('control').hide_from_main() + _me.exit_main_loop() + + +tux.event.on_remote_bt[K_STANDBY] = on_standby +_me.gui('control').show_from_main() +_me.run_main_loop() Added: software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/notify.pyp (rev 0) +++ software/gadgets/tux_controller/trunk/TuxDroidController/Scripts/Python/notify.pyp 2007-10-19 14:54:45 UTC (rev 638) @@ -0,0 +1,5 @@ +def notify_checker(): + return False + +def notify_actuator(): + pass Added: software/gadgets/tux_controller/trunk/TuxDroidController/Strings/fr_ALL.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxDroidController/Strings/fr_ALL.xml (rev 0) +++ software/gadgets/tux_controller/trunk/TuxDroidController/Strings/fr_ALL.xml 2007-10-19 14:54:45 UTC (rev 638) @@ -0,0 +1,19 @@ +<?xml version='1.0' encoding='UTF-8'?> +<strings> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <gui_conf_about_title type='str'>A propos</gui_conf_about_title> + <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> + <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> + <gui_conf_remote_title type='str'>Télécommande</gui_conf_remote_title> + <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <gui_conf_delay_lb type='str'>Délai (sec)</gui_conf_delay_lb> + <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> + <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> + <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <name_to_read type='str'>Commander le robot</name_to_read> + <help_text type='str'> + </help_text> + <speaker_name type='str'>Bruno8k</speaker_name> +</strings> Added: software/gadgets/tux_controller/trunk/TuxDroidController/about.xml =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxDroidController/about.xml ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Name: svn:mime_type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxDroidController/parts.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxDroidController/parts.xml (rev 0) +++ software/gadgets/tux_controller/trunk/TuxDroidController/parts.xml 2007-10-19 14:54:45 UTC (rev 638) @@ -0,0 +1,6 @@ +<?xml version='1.0' encoding='UTF-8'?> +<parts> + <notifications type='bool'>True</notifications> + <parameters_GUI type='bool'>True</parameters_GUI> + <widget_GUI type='bool'>True</widget_GUI> +</parts> Added: software/gadgets/tux_controller/trunk/TuxDroidController/settings.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxDroidController/settings.xml (rev 0) +++ software/gadgets/tux_controller/trunk/TuxDroidController/settings.xml 2007-10-19 14:54:45 UTC (rev 638) @@ -0,0 +1,26 @@ +<?xml version='1.0' encoding='UTF-8'?> +<settings> + <parameters/> + <general> + <gui_state> + <control> + <visible type='bool'>False</visible> + </control> + <widget> + <visible type='bool'>False</visible> + </widget> + <cmd> + <visible type='bool'>False</visible> + </cmd> + <conf> + <visible type='bool'>False</visible> + </conf> + </gui_state> + <language type='str'>en_US</language> + <notified type='bool'>True</notified> + <notify_delay type='int'>60</notify_delay> + <menu_active type='bool'>True</menu_active> + <speaker type='int'>4</speaker> + <pitch type='int'>100</pitch> + </general> +</settings> Added: software/gadgets/tux_controller/trunk/TuxDroidController/strings.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxDroidController/strings.xml (rev 0) +++ software/gadgets/tux_controller/trunk/TuxDroidController/strings.xml 2007-10-19 14:54:45 UTC (rev 638) @@ -0,0 +1,19 @@ +<?xml version='1.0' encoding='UTF-8'?> +<strings> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> + <gui_conf_update_title type='str'>Update</gui_conf_update_title> + <gui_conf_remote_title type='str'>Remote</gui_conf_remote_title> + <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> + <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> + <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> + <gui_conf_about_title type='str'>About</gui_conf_about_title> + <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> + <name_to_read type='str'>Control the droid</name_to_read> + <help_text type='str'> + </help_text> + <speaker_name type='str'>Ryan8k</speaker_name> +</strings> Added: software/gadgets/tux_controller/trunk/TuxDroidController.tgf =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxDroidController.tgf ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream |
From: Paul_R <c2m...@c2...> - 2007-10-19 08:48:53
|
Author: Paul_R Date: 2007-10-19 10:48:25 +0200 (Fri, 19 Oct 2007) New Revision: 637 Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 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: * Added help file 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 08:47:18 UTC (rev 636) +++ software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-19 08:48:25 UTC (rev 637) @@ -11,8 +11,40 @@ <Increase type='str'>La lumière est passée en dessus du seuil</Increase> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <speaker_name type='str'>Bruno8k</speaker_name> - <help_text type='str'> - </help_text> + <help_text type='str'>-- Les évènements : +Deux grands types d'évènements peuvent avoir lieu, contenant chacun diverses options : + +Les changements : +Les changements sont de évènements qui se produisent dans un laps de temps donné. +Les quatre types de changements sont : +- Chute +- Augmentation +- Une chute suivie d'une augmentation +- Une augmentation suivie d'une chute + +Par exemple, un évènement peut avoir lieu si le niveau lumineux diminue de 10% dans un laps de temps de deux secondes. + +Les seuils : +Les évènements de seuils se déclenche lorsque la lumière atteint un certain niveau. +Le passage du seuil peut se faire : +- par une augmentation (dépassement du seuil) +- par une diminution (passage en dessous du seuil) +- dans les deux directions. + +-- Les fenêtres : +- La fenêtre de configuration : +Cette fenêtre reprend toutes les options de configuration du gadget, notamment le taux de rafraichissement ainsi que le nombre de points affichés sur le graphique peut être configuré. + +Des évènements, pouvant entraîner une notification, peuvent également être enregistrés. +Si aucun script externe n'est spécifié, un comportement de base se déclenchera. +Les évènements peuvent à tout moment être modifiés ou supprimés, par simple sélection de la ligne dans le tableau. + +- La fenêtre du gadget : +Cette fenêtre affiche le graphique de lumière. +Lorsque cette fenêtre est affichée, les évènements enregistrés dans la fenêtre de configuration ne sont plus notifiés. +Cette fenêtre permet de tester diverses configurations et de les ajouter dans le tableau de configuration. + +Une zone de test comportant deux boutons permettent à Tux de rechercher la direction la plus lumineuse, ou la plus sombre.</help_text> <ChangeU type='str'>La lumière a augmenté puis chuté</ChangeU> <conf_lblChange type='str'>Changement</conf_lblChange> <conf_lblBoth type='str'>Deux directions</conf_lblBoth> @@ -25,10 +57,10 @@ <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> <MainBehavior type='str'>Comportement principal</MainBehavior> <gui_conf_rate_lb type='str'>Taux de rafraichissement :</gui_conf_rate_lb> - <Threshold type='str'>La lumière a atteint le seuil</Threshold> <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> @@ -37,6 +69,7 @@ <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> @@ -54,7 +87,7 @@ <light2 type='str'>J'en vois encore plus ici !</light2> <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> <widget_lblRaise type='str'>Augmentation</widget_lblRaise> - <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <ChangeD type='str'>La lumière a chuté puis augmenté</ChangeD> <widget_lblBoth type='str'>Deux directions</widget_lblBoth> <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> <conf_lblDefaultBehavior type='str'>Comportement pas défaut</conf_lblDefaultBehavior> @@ -66,12 +99,11 @@ <widget_lblChange type='str'>Changement</widget_lblChange> <widget_lblLight type='str'>Trouver lumière</widget_lblLight> <name_to_read type='str'>Moniteur de lumière</name_to_read> - <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> + <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> - <ChangeD type='str'>La lumière a chuté puis augmenté</ChangeD> + <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> <Raise type='str'>La lumière a augmenté</Raise> - <widget_lblThreshold type='str'>Seuil</widget_lblThreshold> <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> <light3 type='str'>ou ici ?</light3> @@ -79,11 +111,11 @@ <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> - <conf_lblRate type='str'>Taux de rafraichissement</conf_lblRate> - <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> + <light5 type='str'>Je ne peux pas trouver d'où vient la lumière...</light5> + <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> <conf_lblControl type='str'>Contrôle</conf_lblControl> <widget_lblDark type='str'>Trouver ombre</widget_lblDark> - <light5 type='str'>Je ne peux pas trouver d'où vient la lumière...</light5> + <widget_lblThreshold type='str'>Seuil</widget_lblThreshold> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-19 08:47:18 UTC (rev 636) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-19 08:48:25 UTC (rev 637) @@ -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-19 08:47:18 UTC (rev 636) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-19 08:48:25 UTC (rev 637) @@ -10,22 +10,22 @@ <changeD_rad type='bool'>False</changeD_rad> <threshold type='float'>50.0</threshold> <decrease_rad type='bool'>False</decrease_rad> - <behavior_file_threshold type='NoneType'>None</behavior_file_threshold> + <Sample type='float'>500.0</Sample> <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='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> <drop_time type='float'>1.0</drop_time> <changeU type='float'>10.0</changeU> <raise_time type='float'>1.0</raise_time> <drop type='float'>10.0</drop> - <drop_rad type='bool'>True</drop_rad> <MainScript type='str'> </MainScript> - <Sample type='float'>500.0</Sample> + <behavior_file_threshold type='NoneType'>None</behavior_file_threshold> <threshold_chk type='bool'>False</threshold_chk> <Rate type='float'>0.1</Rate> <changeD_time type='float'>1.0</changeD_time> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-19 08:47:18 UTC (rev 636) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-19 08:48:25 UTC (rev 637) @@ -3,46 +3,76 @@ <conf_lblIncrease type='str'>Increase</conf_lblIncrease> <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> - <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblRaise type='str'>Raise</conf_lblRaise> - <widget_lblSet type='str'>Add to config</widget_lblSet> + <power_supply type='str'>You must disconnect the power supply</power_supply> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <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> - <speaker_name type='str'>Ryan8k</speaker_name> - <help_text type='str'> - </help_text> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <help_text type='str'>-- The events: +Two main types of events can take place, containing each one various options: + +The changes: +The changes are events which occur in a given time. +The four types of changes are: +- Drop +- Raise +- a followed drop of an increase +- an followed increase of a drop + +For example, an event can take place if the light level decreases by 10% in a time of two seconds. + +The thresholds: +The thresholds events starts when the light reached a specified level. +The passage of the threshold can be done: +- by an increase (passage beyond of the threshold) +- by a reduction (passage below the threshold) +- in the both directions. + +-- The windows: +- The settings window: +This window contains all the options of configuration of the gadget, in particular the refresh rate and the number of points displayed on the graph. + +Some events, being able to involve a notification, can also be recorded. +If no external script is specified, a standard behavior will start. +The events can constantly be modified or removed, simply by selection of the line in the table. + +- The gadget window: +This window display the light graph. +When this window is showed, the events recorded in the settings window are not notified. +This window makes it possible to try various configurations and to add them in the settings table. + +A test area comprising two buttons make it possible Tux to seek the most luminous direction, or darkest.</help_text> + <ChangeU type='str'>The light level raised and dropped</ChangeU> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> - <conf_lblRate type='str'>Refresh rate</conf_lblRate> <widget_lblChangeU type='str'>Raise and drop</widget_lblChangeU> <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <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> - <Threshold type='str'>The light reached the threshold</Threshold> + <MainBehavior type='str'>Main behavior</MainBehavior> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <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> - <widget_lblDrop type='str'>Drop</widget_lblDrop> <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> - <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> - <power_supply type='str'>You must disconnect the power supply</power_supply> + <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> <Change type='str'>The light level changed</Change> - <conf_lblValue type='str'>Value (%)</conf_lblValue> + <widget_lblDark type='str'>Search darkness</widget_lblDark> <Both type='str'>The light level reached the threshold</Both> <conf_btnModify type='str'>Modify</conf_btnModify> - <widget_lblTest type='str'>Notifications</widget_lblTest> - <widget_lblEvent type='str'>Event</widget_lblEvent> + <widget_lblDrop type='str'>Drop</widget_lblDrop> <widget_lblNotified type='str'>Notified</widget_lblNotified> <dark1 type='str'>It's pretty dark here.</dark1> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> @@ -52,38 +82,40 @@ <dark4 type='str'>This is the darkest spot.</dark4> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> + <widget_lblEvent type='str'>Event</widget_lblEvent> <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <widget_lblRaise type='str'>Raise</widget_lblRaise> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> - <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> + <ChangeD type='str'>The light level dropped and raised</ChangeD> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> + <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <dark2 type='str'>And darker here.</dark2> <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> <widget_lblLight type='str'>Search light</widget_lblLight> <name_to_read type='str'>Light monitor</name_to_read> - <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> + <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> - <ChangeD type='str'>The light level dropped and raised</ChangeD> + <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <Raise type='str'>The light level raised</Raise> - <widget_lblDark type='str'>Search darkness</widget_lblDark> - <light2 type='str'>ow wait, even lighter here.</light2> + <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> <light1 type='str'>Seeing more light over here.</light1> <Decrease type='str'>The light level passed below the threshold</Decrease> - <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> + <conf_lblValue type='str'>Value (%)</conf_lblValue> <light4 type='str'>I think the light is coming from this direction.</light4> + <conf_lblRate type='str'>Refresh rate</conf_lblRate> + <Threshold type='str'>The light reached the threshold</Threshold> + <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> + <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_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> - <MainBehavior type='str'>Main behavior</MainBehavior> - <ChangeU type='str'>The light level raised and dropped</ChangeU> - <conf_lblControl type='str'>Control</conf_lblControl> - <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) |
From: Paul_R <c2m...@c2...> - 2007-10-19 08:47:23
|
Author: Paul_R Date: 2007-10-19 10:47:18 +0200 (Fri, 19 Oct 2007) New Revision: 636 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml Log: * Added the help file Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-18 14:44:01 UTC (rev 635) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-19 08:47:18 UTC (rev 636) @@ -11,8 +11,40 @@ <widget_lblControl type='str'>Contrôle</widget_lblControl> <full type='str'>Les batteries sont pleines</full> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> - <help_text type='str'> - </help_text> + <help_text type='str'>-- Les évènements : +Deux grands types d'évènements peuvent avoir lieu, contenant chacun diverses options : + +Les changements : +Les changements sont de évènements qui se produisent dans un laps de temps donné. +Les quatre types de changements sont : +- Chute +- Augmentation +- Une chute suivie d'une augmentation +- Une augmentation suivie d'une chute + +Par exemple, un évènement peut avoir lieu si le niveau de la batterie diminue de 0.1V dans un laps de temps de dix secondes. + +Les seuils : +Les évènements de seuils se déclenche lorsque le niveau de batterie atteint un certain niveau. +Le passage du seuil peut se faire : +- par une augmentation (dépassement du seuil) +- par une diminution (passage en dessous du seuil) +- dans les deux directions. + +-- Les fenêtres : +- La fenêtre de configuration : +Cette fenêtre reprend toutes les options de configuration du gadget, notamment le taux de rafraichissement ainsi que le nombre de points affichés sur le graphique peut être configuré. + +Des évènements, pouvant entraîner une notification, peuvent également être enregistrés. +Si aucun script externe n'est spécifié, un comportement de base se déclenchera. +Les évènements peuvent à tout moment être modifiés ou supprimés, par simple sélection de la ligne dans le tableau. + +Une option permet de rejeté les mesures lorsque les moteurs fonctionnent. + +- La fenêtre du gadget : +Cette fenêtre affiche le graphique de la batterie. +Lorsque cette fenêtre est affichée, les évènements enregistrés dans la fenêtre de configuration ne sont plus notifiés. +Cette fenêtre permet de tester diverses configurations et de les ajouter dans le tableau de configuration.</help_text> <conf_lblChange type='str'>Changement</conf_lblChange> <conf_lblBoth type='str'>Deux directions</conf_lblBoth> <widget_lblBtnApply type='str'>Appliquer</widget_lblBtnApply> @@ -35,7 +67,7 @@ <low type='str'>Le niveau des batteries est faible</low> <speaker_name type='str'>Bruno8k</speaker_name> <conf_lblSample type='str'>Points</conf_lblSample> - <charging type='str'>En charge</charging> + <conf_lblType type='str'>Type</conf_lblType> <widget_lblDisplayThreshold type='str'>Afficher le seuil sur le graph.</widget_lblDisplayThreshold> <conf_btnModify type='str'>Modifier</conf_btnModify> <widget_lblEvent type='str'>Evènement</widget_lblEvent> @@ -61,7 +93,7 @@ <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> <conf_lblDrop type='str'>Chute</conf_lblDrop> <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> - <conf_lblType type='str'>Type</conf_lblType> + <charging type='str'>En charge</charging> <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> <conf_lblValue type='str'>Valeur (V)</conf_lblValue> <conf_lblRate type='str'>Taux de rafraichissement</conf_lblRate> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-18 14:44:01 UTC (rev 635) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-19 08:47:18 UTC (rev 636) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_description type='str'>Battery monitor for tux droid</gadget_description> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_name type='str'>battery_monitor</gadget_name> <gadget_version type='str'>0.0.1</gadget_version> - <gadget_name type='str'>battery_monitor</gadget_name> - <gadget_description type='str'>Battery monitor for tux droid</gadget_description> </about> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-18 14:44:01 UTC (rev 635) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-19 08:47:18 UTC (rev 636) @@ -1,10 +1,10 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <Sample type='float'>600.0</Sample> + <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> <chkMotors type='bool'>True</chkMotors> <MainScript type='str'>None</MainScript> - <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> + <Sample type='float'>600.0</Sample> <Rate type='float'>10.0</Rate> <config type='list'>[]</config> </parameters> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-18 14:44:01 UTC (rev 635) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-19 08:47:18 UTC (rev 636) @@ -5,14 +5,50 @@ <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> <battery type='str'>On battery</battery> <conf_lblRaise type='str'>Raise</conf_lblRaise> + <widget_lblTest type='str'>Notifications</widget_lblTest> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> - <full type='str'>The level of the batteries is full</full> + <conf_btnModify type='str'>Modify</conf_btnModify> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> - <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> - <help_text type='str'> - </help_text> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <lblMotors type='str'>Disable measure when the motors are running</lblMotors> + <help_text type='str'>-- The events: +Two main types of events can take place, containing each one various options: + +The changes: +The changes are events which occur in a given time. +The four types of changes are: +- Drop +- Raise +- a followed drop of an increase +- an followed increase of a drop + +For example, an event can take place if the battery level decreases by 0.1V in a time of ten seconds. + +The thresholds: +The thresholds events starts when the battery voltage reached a specified level. +The passage of the threshold can be done: +- by an increase (passage beyond of the threshold) +- by a reduction (passage below the threshold) +- in the both directions. + + +-- The windows: +- The settings window: +This window contains all the options of configuration of the gadget, in particular the refresh rate and the number of points displayed on the graph. + +Some events, being able to involve a notification, can also be recorded. +If no external script is specified, a standard behavior will start. +The events can constantly be modified or removed, simply by selection of the line in the table. + +A checkbox allow to enable / disable the measure when the motors are running. + +- The gadget window: +This window display the battery voltage graph. +When this window is showed, the events recorded in the settings window are not notified. +This window makes it possible to try various configurations and to add them in the settings table.</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> @@ -22,53 +58,50 @@ <gui_conf_update_title type='str'>Update</gui_conf_update_title> <widget_lblValue type='str'>Value (V)</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_lblType type='str'>Type</conf_lblType> <mainscript type='str'>I've found the light !</mainscript> - <conf_btnRemove type='str'>Remove</conf_btnRemove> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <plugged type='str'>Plugged</plugged> <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> <low type='str'>The level of the batteries is weak</low> + <conf_btnAdd type='str'>Add</conf_btnAdd> <speaker_name type='str'>Ryan8k</speaker_name> <conf_lblSample type='str'>Samples</conf_lblSample> - <charging type='str'>Charging</charging> + <conf_lblType type='str'>Type</conf_lblType> <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> - <conf_btnModify type='str'>Modify</conf_btnModify> + <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> + <full type='str'>The level of the batteries is full</full> <widget_lblEvent type='str'>Event</widget_lblEvent> <normal type='str'>The level of the batteries is good</normal> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <widget_lblRaise type='str'>Raise</widget_lblRaise> - <conf_btnAdd type='str'>Add</conf_btnAdd> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> <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> - <MainBehavior type='str'>Main behavior</MainBehavior> - <absolute_threshold type='str'>Weak batteries </absolute_threshold> - <lblMotors type='str'>Disable measure when the motors are running</lblMotors> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> - <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> + <absolute_threshold type='str'>Weak batteries </absolute_threshold> <widget_lblChange type='str'>Change</widget_lblChange> <name_to_read type='str'>Battery monitor</name_to_read> <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <conf_lblDrop type='str'>Drop</conf_lblDrop> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <charging type='str'>Charging</charging> <widget_lblSet type='str'>Add to config</widget_lblSet> <conf_lblValue type='str'>Value (V)</conf_lblValue> <conf_lblRate type='str'>Refresh rate</conf_lblRate> <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> - <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> + <MainBehavior type='str'>Main behavior</MainBehavior> <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblControl type='str'>Control</conf_lblControl> - <widget_lblTest type='str'>Notifications</widget_lblTest> + <conf_btnRemove type='str'>Remove</conf_btnRemove> <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> </strings> |
From: Paul_R <c2m...@c2...> - 2007-10-18 14:44:31
|
Author: Paul_R Date: 2007-10-18 16:44:01 +0200 (Thu, 18 Oct 2007) New Revision: 635 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml Log: * Compatibility with python < 2.5 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py 2007-10-18 14:41:03 UTC (rev 634) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py 2007-10-18 14:44:01 UTC (rev 635) @@ -205,7 +205,7 @@ self.context.fill() -class Measure(): +class Measure(object): def __init__(self, sample, rate): self.rate = rate self.rate_backup = self.rate Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-18 14:41:03 UTC (rev 634) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-18 14:44:01 UTC (rev 635) @@ -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'>battery_monitor</gadget_name> <gadget_description type='str'>Battery monitor for tux droid</gadget_description> - <gadget_name type='str'>battery_monitor</gadget_name> </about> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-18 14:41:03 UTC (rev 634) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-18 14:44:01 UTC (rev 635) @@ -16,7 +16,9 @@ <x type='int'>506</x> </widget> <conf> - <visible type='bool'>False</visible> + <y type='int'>49</y> + <visible type='bool'>True</visible> + <x type='int'>0</x> </conf> </gui_state> <language type='str'>en_US</language> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-18 14:41:03 UTC (rev 634) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-18 14:44:01 UTC (rev 635) @@ -24,7 +24,7 @@ <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> - <normal type='str'>The level of the batteries is good</normal> + <conf_lblType type='str'>Type</conf_lblType> <mainscript type='str'>I've found the light !</mainscript> <conf_btnRemove type='str'>Remove</conf_btnRemove> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> @@ -39,20 +39,20 @@ <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> <conf_btnModify type='str'>Modify</conf_btnModify> <widget_lblEvent type='str'>Event</widget_lblEvent> - <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> + <normal type='str'>The level of the batteries is good</normal> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <widget_lblRaise type='str'>Raise</widget_lblRaise> <conf_btnAdd type='str'>Add</conf_btnAdd> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> - <conf_lblType type='str'>Type</conf_lblType> <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> <MainBehavior type='str'>Main behavior</MainBehavior> <absolute_threshold type='str'>Weak batteries </absolute_threshold> <lblMotors type='str'>Disable measure when the motors are running</lblMotors> + <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> |
From: Paul_R <c2m...@c2...> - 2007-10-18 14:41:04
|
Author: Paul_R Date: 2007-10-18 16:41:03 +0200 (Thu, 18 Oct 2007) New Revision: 634 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/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/main.pyp software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml software/gadgets/light_monitor/trunk/Light_monitor/about.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Fix a bug which crash the gadget with python < 2.5: 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-18 13:50:51 UTC (rev 633) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-10-18 14:41:03 UTC (rev 634) @@ -1,6 +1,9 @@ bindtextdomain("params", "") -sys.path.append(_me.get_path('root') + '/Scripts/Python') -from lightGraph_class import lightGraph +try: + sys.path.append(_me.get_path('root') + '/Scripts/Python') + from lightGraph_class import lightGraph +except: + print sys.exc_info() class Window(SimpleGladeApp): @@ -108,7 +111,7 @@ self.light_measure.val_table = [0] * int(self.light_measure.sample+1) self.light_measure.light_search = True self.light_measure.light_value = 3000 - self.light_measure.search_event = [_me.string('light1'), _me.string('light2'), _me.string('light3'),_me.string('light4')] + self.light_measure.search_event = [_me.string('light1'), _me.string('light2'), _me.string('light3'),_me.string('light4'), _me.string('light5')] print self.light_measure.search_event self.config_light_search() @@ -117,7 +120,7 @@ self.light_measure.val_table = [-1] * int(self.light_measure.sample+1) self.light_measure.light_search = False self.light_measure.light_value = 0 - self.light_measure.search_event = [_me.string('dark1'), _me.string('dark2'), _me.string('dark3'),_me.string('dark4')] + self.light_measure.search_event = [_me.string('dark1'), _me.string('dark2'), _me.string('dark3'),_me.string('dark4'), _me.string('dark5')] self.config_light_search() def config_light_search(self): 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-18 13:50:51 UTC (rev 633) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-18 14:41:03 UTC (rev 634) @@ -1,11 +1,15 @@ -import gtk import sys -import time -import os -import threading -import thread -sys.path.append('/opt/tuxdroid/api/python') -from tux import * +try: + import cairo + import gtk + import time + import os + import threading + import thread + sys.path.append('/opt/tuxdroid/api/python') + from tux import * +except: + print sys.exc_info() class lightGraph(gtk.DrawingArea): def __init__(self): @@ -157,7 +161,7 @@ self.context.move_to(x, y) self.context.set_source_rgb(1, 0, 0) -class lightMeasure(): +class lightMeasure(object): def __init__(self): #Initial value self.sample = 500.0 @@ -172,7 +176,7 @@ self.event = 0 self.txtsearch = ' ' self.search_event = [] - + self.__fault = False self.GUI_on = False self.start_flag = True @@ -465,6 +469,7 @@ ########################################################### def search_light(self, light): self.count += 1 + self.__fault = False detect = False if self.light_search_state == 0 and tux.status.spin_counter() == 0 and self.count > 2: self.light_search_state = 1 @@ -492,6 +497,11 @@ self.test_default_behavior(self.search_event[3]) self.search_light_flag = False self.light_search_state = 0 + + if self.__fault: + self.test_default_behavior(self.search_event[4]) + self.search_light_flag = False + self.light_search_state = 0 def timer_control(self): self.timer -= 1 @@ -503,8 +513,10 @@ self.test_default_behavior(self.search_event[1]) if self.count == 70: self.test_default_behavior(self.search_event[2]) + if self.count == 600: + self.__fault = True + - if self.timer > 2: return True Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/main.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/main.pyp 2007-10-18 13:50:51 UTC (rev 633) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/main.pyp 2007-10-18 14:41:03 UTC (rev 634) @@ -17,7 +17,7 @@ measure.light_search_state = 0 measure.timer = 0 measure.count = 0 - measure.search_event = [_me.string('light1'), _me.string('light2'), _me.string('light3'),_me.string('light4')] + measure.search_event = [_me.string('light1'), _me.string('light2'), _me.string('light3'),_me.string('light4'),_me.string('light5')] tux.cmd.spinl_on_free(8, 1) count = 0 while measure.search_light_flag: 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-18 13:50:51 UTC (rev 633) +++ software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-18 14:41:03 UTC (rev 634) @@ -3,7 +3,6 @@ <conf_lblIncrease type='str'>Augmente</conf_lblIncrease> <conf_lblThreshold type='str'>Seuil</conf_lblThreshold> <gui_conf_remote_title type='str'>Contrôle</gui_conf_remote_title> - <dark3 type='str'>hmm, il fait toujours plus sombre ...</dark3> <conf_lblRaise type='str'>Accroissement</conf_lblRaise> <widget_lblTest type='str'>Notifications</widget_lblTest> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> @@ -18,7 +17,6 @@ <conf_lblChange type='str'>Changement</conf_lblChange> <conf_lblBoth type='str'>Deux directions</conf_lblBoth> <widget_lblBtnApply type='str'>Appliquer</widget_lblBtnApply> - <dark4 type='str'>C'est l'endroit le plus sombre !</dark4> <widget_lblChangeU type='str'>Changement sup.</widget_lblChangeU> <conf_lblDecrease type='str'>Diminue</conf_lblDecrease> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> @@ -27,10 +25,10 @@ <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> <MainBehavior type='str'>Comportement principal</MainBehavior> <gui_conf_rate_lb type='str'>Taux de rafraichissement :</gui_conf_rate_lb> + <Threshold type='str'>La lumière a atteint le seuil</Threshold> <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> @@ -41,21 +39,24 @@ <Change type='str'>La lumière a changé</Change> <Both type='str'>La lumière a passé le seuil</Both> <conf_btnModify type='str'>Modifier</conf_btnModify> - <widget_lblEvent type='str'>Evènement</widget_lblEvent> + <widget_lblDrop type='str'>Chute</widget_lblDrop> <widget_lblNotified type='str'>Notifé</widget_lblNotified> <dark1 type='str'>Il fait sombre ici !</dark1> <widget_lblIncrease type='str'>Accroissement</widget_lblIncrease> - <widget_lblRaise type='str'>Augmentation</widget_lblRaise> + <dark3 type='str'>hmm, il fait toujours plus sombre ...</dark3> <conf_btnAdd type='str'>Ajouter</conf_btnAdd> + <dark5 type='str'>Je ne peux pas trouver l'endroit le plus sombre ...</dark5> + <dark4 type='str'>C'est l'endroit le plus sombre !</dark4> + <gui_conf_sample_lb type='str'>Nombre de points :</gui_conf_sample_lb> <widget_lblDecrease type='str'>Decroissance</widget_lblDecrease> - <gui_conf_sample_lb type='str'>Nombre de points :</gui_conf_sample_lb> - <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> + <widget_lblEvent type='str'>Evènement</widget_lblEvent> <conf_lblNotifiedBehavior type='str'>Notifié</conf_lblNotifiedBehavior> <light2 type='str'>J'en vois encore plus ici !</light2> <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> - <widget_lblDrop type='str'>Chute</widget_lblDrop> - <ChangeD type='str'>La lumière a chuté puis augmenté</ChangeD> + <widget_lblRaise type='str'>Augmentation</widget_lblRaise> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> <widget_lblBoth type='str'>Deux directions</widget_lblBoth> + <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> <conf_lblDefaultBehavior type='str'>Comportement pas défaut</conf_lblDefaultBehavior> <widget_lblDisplayThreshold type='str'>Afficher le seuil sur le graph.</widget_lblDisplayThreshold> <conf_lblBehavior type='str'>Comportement</conf_lblBehavior> @@ -65,11 +66,12 @@ <widget_lblChange type='str'>Changement</widget_lblChange> <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> + <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> <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> + <ChangeD type='str'>La lumière a chuté puis augmenté</ChangeD> <Raise type='str'>La lumière a augmenté</Raise> + <widget_lblThreshold type='str'>Seuil</widget_lblThreshold> <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> <light3 type='str'>ou ici ?</light3> @@ -78,10 +80,10 @@ <conf_lblValue type='str'>Valeur (%)</conf_lblValue> <light4 type='str'>Je pense que la lumière vient de cette direction</light4> <conf_lblRate type='str'>Taux de rafraichissement</conf_lblRate> - <Threshold type='str'>La lumière a atteint le seuil</Threshold> + <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> <conf_lblControl type='str'>Contrôle</conf_lblControl> <widget_lblDark type='str'>Trouver ombre</widget_lblDark> - <widget_lblThreshold type='str'>Seuil</widget_lblThreshold> + <light5 type='str'>Je ne peux pas trouver d'où vient la lumière...</light5> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-18 13:50:51 UTC (rev 633) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-18 14:41:03 UTC (rev 634) @@ -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_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> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-18 13:50:51 UTC (rev 633) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-18 14:41:03 UTC (rev 634) @@ -18,7 +18,7 @@ <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> - <dark4 type='str'>This is the darkest spot.</dark4> + <conf_lblRate type='str'>Refresh rate</conf_lblRate> <widget_lblChangeU type='str'>Raise and drop</widget_lblChangeU> <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> @@ -26,9 +26,10 @@ <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> + <Threshold type='str'>The light reached the threshold</Threshold> <mainscript type='str'>I've found the light !</mainscript> - <dark3 type='str'>hmm, but it's even more dark over here!</dark3> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <widget_lblDrop type='str'>Drop</widget_lblDrop> <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> @@ -45,18 +46,19 @@ <widget_lblNotified type='str'>Notified</widget_lblNotified> <dark1 type='str'>It's pretty dark here.</dark1> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> - <widget_lblRaise type='str'>Raise</widget_lblRaise> + <dark3 type='str'>hmm, but it's even more dark over here!</dark3> <conf_btnAdd type='str'>Add</conf_btnAdd> + <dark5 type='str'>I can't find the darkest spot...</dark5> + <dark4 type='str'>This is the darkest spot.</dark4> + <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> - <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> - <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> - <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> <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_lblRaise type='str'>Raise</widget_lblRaise> <conf_lblNotified type='str'>Notified ?</conf_lblNotified> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> + <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <dark2 type='str'>And darker here.</dark2> @@ -77,8 +79,8 @@ <Decrease type='str'>The light level passed below the threshold</Decrease> <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> <light4 type='str'>I think the light is coming from this direction.</light4> - <conf_lblRate type='str'>Refresh rate</conf_lblRate> - <Threshold type='str'>The light reached the threshold</Threshold> + <light5 type='str'>I can't find the direction of the light.</light5> + <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> <MainBehavior type='str'>Main behavior</MainBehavior> <ChangeU type='str'>The light level raised and dropped</ChangeU> <conf_lblControl type='str'>Control</conf_lblControl> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: jaguarondi <c2m...@c2...> - 2007-10-18 13:50:51
|
Author: jaguarondi Date: 2007-10-18 15:50:51 +0200 (Thu, 18 Oct 2007) New Revision: 633 Modified: daemon/trunk/libs/USBDaemon_command_tux.c Log: * BUG in the wireless channel selection, the wrong command was sent. Modified: daemon/trunk/libs/USBDaemon_command_tux.c =================================================================== --- daemon/trunk/libs/USBDaemon_command_tux.c 2007-10-18 12:21:48 UTC (rev 632) +++ daemon/trunk/libs/USBDaemon_command_tux.c 2007-10-18 13:50:51 UTC (rev 633) @@ -885,7 +885,8 @@ return -1; if (send_usb_dongle_cmd(USB_TUX_CONNECTION_CMD, - USB_TUX_CONNECTION_CHANGE_ID, lower_ATR_channel[wifi_channel], + USB_TUX_CONNECTION_WIRELESS_CHANNEL, + lower_ATR_channel[wifi_channel], higher_ATR_channel[wifi_channel]) == USB_FRAME_SIZE) return 0; else |
From: Paul_R <c2m...@c2...> - 2007-10-18 12:29:13
|
Author: Paul_R Date: 2007-10-18 14:21:48 +0200 (Thu, 18 Oct 2007) New Revision: 632 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/Scripts/Python/lightGraph_class.py software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/main.pyp 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/about.xml software/gadgets/light_monitor/trunk/Light_monitor/settings.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Added the threshold line in the graph * Added some tts event on the search light/dark function * Uncheck by default the notifications in the gadget window 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-17 13:54:44 UTC (rev 631) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-10-18 12:21:48 UTC (rev 632) @@ -55,8 +55,8 @@ ########################################################### def update_value(self): - self.light_measure.changetext = _me.string('conf_lblChange') - self.light_measure.thresholdtext = _me.string('conf_lblThreshold') + self.light_measure.changetext = _me.string('Change') + self.light_measure.thresholdtext = _me.string('Threshold') ########################################################### # @@ -108,6 +108,8 @@ self.light_measure.val_table = [0] * int(self.light_measure.sample+1) self.light_measure.light_search = True self.light_measure.light_value = 3000 + self.light_measure.search_event = [_me.string('light1'), _me.string('light2'), _me.string('light3'),_me.string('light4')] + print self.light_measure.search_event self.config_light_search() def on_btnDark_clicked(self, widget, *args): @@ -115,6 +117,7 @@ self.light_measure.val_table = [-1] * int(self.light_measure.sample+1) self.light_measure.light_search = False self.light_measure.light_value = 0 + self.light_measure.search_event = [_me.string('dark1'), _me.string('dark2'), _me.string('dark3'),_me.string('dark4')] self.config_light_search() def config_light_search(self): @@ -124,6 +127,7 @@ tux.cmd.mouth_close() else: self.light_measure.rate_backup = self.light_measure.rate + self.light_measure.val_table_event = [-1] * int(self.light_measure.sample+1) self.light_measure.rate = 0.1 self.light_measure.search_light_flag = True self.light_measure.light_search_state = 0 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-17 13:54:44 UTC (rev 631) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-18 12:21:48 UTC (rev 632) @@ -87,6 +87,15 @@ context.show_text("samples = "+str(self.light_measure_graph.sample)) context.stroke() + #Draw the threshold line + if self.light_measure_graph.GUI_on and self.light_measure_graph.test_tab[0][1] == 1: + context.set_source_rgb(0.7, 0, 0) + context.set_line_width(0.8) + context.move_to(0, self.rect.height - (self.rect.height * self.light_measure_graph.test_tab[0][3])/100) + context.line_to(self.rect.width, self.rect.height - (self.rect.height * self.light_measure_graph.test_tab[0][3])/100) + context.stroke() + + #determine the coefficients to adjust the curve in the window space coeff_y = float(self.rect.height / 1124.00) coeff_x = float(self.rect.width / (self.light_measure_graph.sample - 1)) @@ -113,7 +122,7 @@ if self.light_measure_graph.val_table_event[i] == 1: self.draw_square(self.rect.x + ((i) * coeff_x), self.rect.height - (val * coeff_y), [0.7, 0.2, 0.2]) if self.light_measure_graph.val_table_event[i] == 2: - self.draw_triangle(self.rect.x + ((i) * coeff_x), self.rect.height - (val * coeff_y), [0.7, 0.2, 0.2]) + self.draw_triangle(self.rect.x + ((i) * coeff_x), self.rect.height - (val * coeff_y), [0.7, 0.2, 0.2]) context.line_to(self.rect.x + ((i) * coeff_x), self.rect.height + 5) context.stroke() @@ -162,6 +171,7 @@ self.event_flag = False self.event = 0 self.txtsearch = ' ' + self.search_event = [] self.GUI_on = False @@ -373,6 +383,7 @@ 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): @@ -414,7 +425,6 @@ self.val_table_event.pop(0) self.event = 0 - val = (args[0] * 256) + args[1] self.val_table.append(val) self.val_table.pop(0) @@ -465,6 +475,7 @@ self.light_value = min(self.val_table[len(self.val_table) - self.count: len(self.val_table)]) self.light_value += 10 self.timer = 10 + self.count = 0 elif self.light_search_state == 1: self.timer_control() @@ -478,11 +489,22 @@ detect = True if detect: + self.test_default_behavior(self.search_event[3]) self.search_light_flag = False self.light_search_state = 0 def timer_control(self): self.timer -= 1 + self.count += 1 + + if self.count == 10: + self.test_default_behavior(self.search_event[0]) + if self.count == 40: + self.test_default_behavior(self.search_event[1]) + if self.count == 70: + self.test_default_behavior(self.search_event[2]) + + if self.timer > 2: return True Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/main.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/main.pyp 2007-10-17 13:54:44 UTC (rev 631) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/main.pyp 2007-10-18 12:21:48 UTC (rev 632) @@ -17,6 +17,7 @@ measure.light_search_state = 0 measure.timer = 0 measure.count = 0 + measure.search_event = [_me.string('light1'), _me.string('light2'), _me.string('light3'),_me.string('light4')] tux.cmd.spinl_on_free(8, 1) count = 0 while measure.search_light_flag: 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-17 13:54:44 UTC (rev 631) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-18 12:21:48 UTC (rev 632) @@ -19,20 +19,20 @@ #create text to speach for the default notification if event[i][1] == 0: if event[i][2] == 0: - text = _me.string('conf_lblDrop') + text = _me.string('Drop') elif event[i][2] == 1: - text = _me.string('conf_lblRaise') + text = _me.string('Raise') elif event[i][2] == 2: - text = _me.string('conf_lblChangeD') + text = _me.string('ChangeD') elif event[i][2] == 3: - text = _me.string('conf_lblChangeU') + text = _me.string('ChangeU') else: if event[i][2] == 0: - text = _me.string('conf_lblIncrease') + text = _me.string('Increase') elif event[i][2] == 1: - text = _me.string('conf_lblDecrease') + text = _me.string('Decrease') elif event[i][2] == 2: - text = _me.string('conf_lblBoth') + text = _me.string('Both') if event[i][7]: if event[i][5]: 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-17 13:54:44 UTC (rev 631) +++ software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-18 12:21:48 UTC (rev 632) @@ -3,28 +3,34 @@ <conf_lblIncrease type='str'>Augmente</conf_lblIncrease> <conf_lblThreshold type='str'>Seuil</conf_lblThreshold> <gui_conf_remote_title type='str'>Contrôle</gui_conf_remote_title> + <dark3 type='str'>hmm, il fait toujours plus sombre ...</dark3> <conf_lblRaise type='str'>Accroissement</conf_lblRaise> <widget_lblTest type='str'>Notifications</widget_lblTest> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <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> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <speaker_name type='str'>Bruno8k</speaker_name> <help_text type='str'> </help_text> + <ChangeU type='str'>La lumière a augmenté puis chuté</ChangeU> <conf_lblChange type='str'>Changement</conf_lblChange> <conf_lblBoth type='str'>Deux directions</conf_lblBoth> <widget_lblBtnApply type='str'>Appliquer</widget_lblBtnApply> + <dark4 type='str'>C'est l'endroit le plus sombre !</dark4> <widget_lblChangeU type='str'>Changement sup.</widget_lblChangeU> <conf_lblDecrease type='str'>Diminue</conf_lblDecrease> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> <conf_lblChangeU type='str'>Augmente et chute</conf_lblChangeU> <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> + <MainBehavior type='str'>Comportement principal</MainBehavior> <gui_conf_rate_lb type='str'>Taux de rafraichissement :</gui_conf_rate_lb> <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> @@ -32,10 +38,12 @@ <power_supply type='str'>Vous devez deconnecter l'alimentation</power_supply> <conf_lblSample type='str'>Points</conf_lblSample> <conf_lblType type='str'>Type</conf_lblType> - <widget_lblDisplayThreshold type='str'>Afficher le seuil sur le graph.</widget_lblDisplayThreshold> + <Change type='str'>La lumière a changé</Change> + <Both type='str'>La lumière a passé le seuil</Both> <conf_btnModify type='str'>Modifier</conf_btnModify> <widget_lblEvent type='str'>Evènement</widget_lblEvent> <widget_lblNotified type='str'>Notifé</widget_lblNotified> + <dark1 type='str'>Il fait sombre ici !</dark1> <widget_lblIncrease type='str'>Accroissement</widget_lblIncrease> <widget_lblRaise type='str'>Augmentation</widget_lblRaise> <conf_btnAdd type='str'>Ajouter</conf_btnAdd> @@ -43,25 +51,34 @@ <gui_conf_sample_lb type='str'>Nombre de points :</gui_conf_sample_lb> <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> <conf_lblNotifiedBehavior type='str'>Notifié</conf_lblNotifiedBehavior> + <light2 type='str'>J'en vois encore plus ici !</light2> <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> <widget_lblDrop type='str'>Chute</widget_lblDrop> - <MainBehavior type='str'>Comportement principal</MainBehavior> + <ChangeD type='str'>La lumière a chuté puis augmenté</ChangeD> <widget_lblBoth type='str'>Deux directions</widget_lblBoth> <conf_lblDefaultBehavior type='str'>Comportement pas défaut</conf_lblDefaultBehavior> + <widget_lblDisplayThreshold type='str'>Afficher le seuil sur le graph.</widget_lblDisplayThreshold> <conf_lblBehavior type='str'>Comportement</conf_lblBehavior> + <dark2 type='str'>Et encore plus là !</dark2> <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> <widget_lblLight type='str'>Trouver lumière</widget_lblLight> <name_to_read type='str'>Moniteur de lumière</name_to_read> - <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> + <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> - <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> + <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> + <light3 type='str'>ou ici ?</light3> + <light1 type='str'>Je vois de la lumière ici...</light1> + <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> <conf_lblRate type='str'>Taux de rafraichissement</conf_lblRate> - <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> + <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> <conf_lblControl type='str'>Contrôle</conf_lblControl> Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-17 13:54:44 UTC (rev 631) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-10-18 12:21:48 UTC (rev 632) @@ -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_name type='str'>light_monitor</gadget_name> - <gadget_description type='str'>Light monitor for tux droid</gadget_description> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-17 13:54:44 UTC (rev 631) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-10-18 12:21:48 UTC (rev 632) @@ -6,26 +6,26 @@ <increase_rad type='bool'>True</increase_rad> <chk_ChangeBehavior type='bool'>False</chk_ChangeBehavior> <changeU_time type='float'>1.0</changeU_time> - <test_tab type='list'>[[1, 0, 0, 10.0, 2.0, True, 'None', False, 0]]</test_tab> + <test_tab type='list'>[[1, 0, 0, 10.0, 2.0, False, 'None', False, 0]]</test_tab> <changeD_rad type='bool'>False</changeD_rad> <threshold type='float'>50.0</threshold> <decrease_rad type='bool'>False</decrease_rad> - <Sample type='float'>500.0</Sample> + <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='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> <drop_time type='float'>1.0</drop_time> <changeU type='float'>10.0</changeU> <raise_time type='float'>1.0</raise_time> <drop type='float'>10.0</drop> + <drop_rad type='bool'>True</drop_rad> <MainScript type='str'> </MainScript> - <behavior_file_threshold type='NoneType'>None</behavior_file_threshold> + <Sample type='float'>500.0</Sample> <threshold_chk type='bool'>False</threshold_chk> <Rate type='float'>0.1</Rate> <changeD_time type='float'>1.0</changeD_time> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-17 13:54:44 UTC (rev 631) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-10-18 12:21:48 UTC (rev 632) @@ -3,68 +3,85 @@ <conf_lblIncrease type='str'>Increase</conf_lblIncrease> <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> + <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <conf_lblRaise type='str'>Raise</conf_lblRaise> - <power_supply type='str'>You must disconnect the power supply</power_supply> + <widget_lblSet type='str'>Add to config</widget_lblSet> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> + <Increase type='str'>The light level exceeded the threshold</Increase> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> + <speaker_name type='str'>Ryan8k</speaker_name> <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> + <dark4 type='str'>This is the darkest spot.</dark4> <widget_lblChangeU type='str'>Raise and drop</widget_lblChangeU> <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <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> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <mainscript type='str'>I've found the light !</mainscript> - <conf_btnRemove type='str'>Remove</conf_btnRemove> + <dark3 type='str'>hmm, but it's even more dark over here!</dark3> <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> + <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> + <power_supply type='str'>You must disconnect the power supply</power_supply> <conf_lblSample type='str'>Samples</conf_lblSample> <conf_lblType type='str'>Type</conf_lblType> - <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> - <widget_lblDark type='str'>Search darkness</widget_lblDark> + <Change type='str'>The light level changed</Change> + <conf_lblValue type='str'>Value (%)</conf_lblValue> + <Both type='str'>The light level reached the threshold</Both> <conf_btnModify type='str'>Modify</conf_btnModify> + <widget_lblTest type='str'>Notifications</widget_lblTest> <widget_lblEvent type='str'>Event</widget_lblEvent> <widget_lblNotified type='str'>Notified</widget_lblNotified> + <dark1 type='str'>It's pretty dark here.</dark1> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <widget_lblRaise type='str'>Raise</widget_lblRaise> <conf_btnAdd type='str'>Add</conf_btnAdd> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> + <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> <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> - <MainBehavior type='str'>Main behavior</MainBehavior> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <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> + <dark2 type='str'>And darker here.</dark2> <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> <widget_lblLight type='str'>Search light</widget_lblLight> <name_to_read type='str'>Light monitor</name_to_read> <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> + <Drop type='str'>The light level dropped</Drop> <conf_lblDrop type='str'>Drop</conf_lblDrop> - <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> - <widget_lblSet type='str'>Add to config</widget_lblSet> - <conf_lblValue type='str'>Value (%)</conf_lblValue> + <ChangeD type='str'>The light level dropped and raised</ChangeD> + <Raise type='str'>The light level raised</Raise> + <widget_lblDark type='str'>Search darkness</widget_lblDark> + <light2 type='str'>ow wait, even lighter here.</light2> + <light3 type='str'>or here ...</light3> + <light1 type='str'>Seeing more light over here.</light1> + <Decrease type='str'>The light level passed below the threshold</Decrease> + <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> + <light4 type='str'>I think the light is coming from this direction.</light4> <conf_lblRate type='str'>Refresh rate</conf_lblRate> - <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> - <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> - <conf_lblTime type='str'>Time (sec.)</conf_lblTime> + <Threshold type='str'>The light reached the threshold</Threshold> + <MainBehavior type='str'>Main behavior</MainBehavior> + <ChangeU type='str'>The light level raised and dropped</ChangeU> <conf_lblControl type='str'>Control</conf_lblControl> - <widget_lblTest type='str'>Notifications</widget_lblTest> + <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) |
From: Paul_R <c2m...@c2...> - 2007-10-17 13:54:46
|
Author: Paul_R Date: 2007-10-17 15:54:44 +0200 (Wed, 17 Oct 2007) New Revision: 631 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/main.pyp software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml Log: * Added a main script which is executed when the 'OK' button is pressed. This script indicate the battery level (low, OK, full) * I've changed the absolute threshold from 4.6V to 4.75V Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py 2007-10-17 13:07:03 UTC (rev 630) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/Battery_class.py 2007-10-17 13:54:44 UTC (rev 631) @@ -97,7 +97,7 @@ def draw_threshold(self): coeff_y = float(self.rect.height / self.measure_graph.RANGE) - y = self.measure_graph.convert_value([0, 1, 0, 4.625]) + y = self.measure_graph.convert_value([0, 1, 0, 4.75]) y = (y * 3.4) self.context.set_source_rgb(0.8, 0, 0) @@ -291,14 +291,15 @@ def absolute_threshold(self): if self.absolute_threshold_flag == False: - val = self.convert_value([0, 1, 0, 4.625]) + val = self.convert_value([0, 1, 0, 4.75]) + print ((val* self.RANGE) / 100) val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE if val_prev >= val and val_act < val: self.absolute_threshold_flag = True return True else: - val = self.convert_value([0, 1, 0, 4.7]) + val = self.convert_value([0, 1, 0, 4.9]) val_act = (self.val_table[len(self.val_table)-1]*100) / self.RANGE val_prev = (self.val_table[len(self.val_table)-2]*100) / self.RANGE if val_prev <= val and val_act > val: Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/main.pyp =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/main.pyp 2007-10-17 13:07:03 UTC (rev 630) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/main.pyp 2007-10-17 13:54:44 UTC (rev 631) @@ -1,3 +1,25 @@ def update_informations(): pass +def battery_level(): + measure = _me.get_param('measure') + val = measure.val_table[len(measure.val_table)-1] + + if val <= 102: + tux.cmd.mouth_open() + txt = _me.string('low') + tux.tts.speak(str(txt)) + tux.cmd.mouth_close() + + elif val >= 306: + tux.cmd.mouth_open() + txt = _me.string('full') + tux.tts.speak(str(txt)) + tux.cmd.mouth_close() + else: + tux.cmd.mouth_open() + txt = _me.string('normal') + tux.tts.speak(str(txt)) + tux.cmd.mouth_close() + +battery_level() Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-17 13:07:03 UTC (rev 630) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-10-17 13:54:44 UTC (rev 631) @@ -9,6 +9,7 @@ <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <conf_lblEvent type='str'>Evènement</conf_lblEvent> <widget_lblControl type='str'>Contrôle</widget_lblControl> + <full type='str'>Les batteries sont pleines</full> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <help_text type='str'> </help_text> @@ -16,13 +17,14 @@ <conf_lblBoth type='str'>Deux directions</conf_lblBoth> <widget_lblBtnApply type='str'>Appliquer</widget_lblBtnApply> <widget_lblChangeU type='str'>Changement sup.</widget_lblChangeU> - <conf_lblDecrease type='str'>Diminue</conf_lblDecrease> + <widget_lblNotified type='str'>Notifé</widget_lblNotified> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> <conf_lblChangeU type='str'>Augmente et chute</conf_lblChangeU> <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> <widget_lblBoth type='str'>Deux directions</widget_lblBoth> <gui_conf_rate_lb type='str'>Taux de rafraichissement :</gui_conf_rate_lb> + <widget_lblValue type='str'>Valeur (V)</widget_lblValue> <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> @@ -30,14 +32,14 @@ <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> - <widget_lblValue type='str'>Valeur (V)</widget_lblValue> + <low type='str'>Le niveau des batteries est faible</low> <speaker_name type='str'>Bruno8k</speaker_name> <conf_lblSample type='str'>Points</conf_lblSample> - <conf_lblType type='str'>Type</conf_lblType> + <charging type='str'>En charge</charging> <widget_lblDisplayThreshold type='str'>Afficher le seuil sur le graph.</widget_lblDisplayThreshold> <conf_btnModify type='str'>Modifier</conf_btnModify> <widget_lblEvent type='str'>Evènement</widget_lblEvent> - <widget_lblNotified type='str'>Notifé</widget_lblNotified> + <normal type='str'>Le niveau des batteries est bon</normal> <widget_lblIncrease type='str'>Accroissement</widget_lblIncrease> <widget_lblRaise type='str'>Augmentation</widget_lblRaise> <conf_btnAdd type='str'>Ajouter</conf_btnAdd> @@ -50,6 +52,7 @@ <MainBehavior type='str'>Comportement principal</MainBehavior> <absolute_threshold type='str'>Batteries faibles</absolute_threshold> <lblMotors type='str'>Rejeter les mesures lorsque les moteurs fonctionnent</lblMotors> + <conf_lblDecrease type='str'>Diminue</conf_lblDecrease> <conf_lblDefaultBehavior type='str'>Comportement pas défaut</conf_lblDefaultBehavior> <conf_lblBehavior type='str'>Comportement</conf_lblBehavior> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> @@ -58,7 +61,7 @@ <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> <conf_lblDrop type='str'>Chute</conf_lblDrop> <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> - <charging type='str'>En charge</charging> + <conf_lblType type='str'>Type</conf_lblType> <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> <conf_lblValue type='str'>Valeur (V)</conf_lblValue> <conf_lblRate type='str'>Taux de rafraichissement</conf_lblRate> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-17 13:07:03 UTC (rev 630) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-10-17 13:54:44 UTC (rev 631) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> - <gadget_name type='str'>battery_monitor</gadget_name> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_version type='str'>0.0.1</gadget_version> <gadget_description type='str'>Battery monitor for tux droid</gadget_description> - <gadget_version type='str'>0.0.1</gadget_version> + <gadget_name type='str'>battery_monitor</gadget_name> </about> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-17 13:07:03 UTC (rev 630) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-10-17 13:54:44 UTC (rev 631) @@ -1,10 +1,10 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> + <Sample type='float'>600.0</Sample> <chkMotors type='bool'>True</chkMotors> <MainScript type='str'>None</MainScript> - <Sample type='float'>600.0</Sample> + <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> <Rate type='float'>10.0</Rate> <config type='list'>[]</config> </parameters> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-17 13:07:03 UTC (rev 630) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-10-17 13:54:44 UTC (rev 631) @@ -5,67 +5,70 @@ <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> <battery type='str'>On battery</battery> <conf_lblRaise type='str'>Raise</conf_lblRaise> - <widget_lblTest type='str'>Notifications</widget_lblTest> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> + <full type='str'>The level of the batteries is full</full> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> - <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> - <lblMotors type='str'>Disable measure when the motors are running</lblMotors> + <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <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> <widget_lblChangeU type='str'>Raise and drop</widget_lblChangeU> - <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> + <widget_lblNotified type='str'>Notified</widget_lblNotified> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Update</gui_conf_update_title> <widget_lblValue type='str'>Value (V)</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> + <normal type='str'>The level of the batteries is good</normal> <mainscript type='str'>I've found the light !</mainscript> + <conf_btnRemove type='str'>Remove</conf_btnRemove> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <plugged type='str'>Plugged</plugged> <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> - <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> + <low type='str'>The level of the batteries is weak</low> <speaker_name type='str'>Ryan8k</speaker_name> <conf_lblSample type='str'>Samples</conf_lblSample> - <conf_lblType type='str'>Type</conf_lblType> + <charging type='str'>Charging</charging> <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> <conf_btnModify type='str'>Modify</conf_btnModify> <widget_lblEvent type='str'>Event</widget_lblEvent> - <widget_lblNotified type='str'>Notified</widget_lblNotified> + <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <widget_lblRaise type='str'>Raise</widget_lblRaise> <conf_btnAdd type='str'>Add</conf_btnAdd> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> + <conf_lblType type='str'>Type</conf_lblType> <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> + <MainBehavior type='str'>Main behavior</MainBehavior> + <absolute_threshold type='str'>Weak batteries </absolute_threshold> + <lblMotors type='str'>Disable measure when the motors are running</lblMotors> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> - <absolute_threshold type='str'>Weak batteries </absolute_threshold> + <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'>Battery monitor</name_to_read> <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <conf_lblDrop type='str'>Drop</conf_lblDrop> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> - <charging type='str'>Charging</charging> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> <widget_lblSet type='str'>Add to config</widget_lblSet> <conf_lblValue type='str'>Value (V)</conf_lblValue> <conf_lblRate type='str'>Refresh rate</conf_lblRate> <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> - <MainBehavior type='str'>Main behavior</MainBehavior> + <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> + <widget_lblTest type='str'>Notifications</widget_lblTest> <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> </strings> |