[tuxdroid-svn] r562 - in software/gadgets/light_monitor/trunk: . Light_monitor Light_monitor/Script
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2007-10-01 12:51:18
|
Author: Paul_R Date: 2007-10-01 14:51:16 +0200 (Mon, 01 Oct 2007) New Revision: 562 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.glade.bak 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/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 notifications for all the possible events. Three options are possible : - Enable / disable the notification - Use the default notification. Tux say the event type. - Use an external behavior python script. Modified: 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.glade 2007-10-01 12:02:54 UTC (rev 561) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade 2007-10-01 12:51:16 UTC (rev 562) @@ -243,11 +243,11 @@ </child> <child> - <widget class="GtkLabel" id="lbl_conf_event"> + <widget class="GtkLabel" id="lbl_conf_type"> <property name="width_request">88</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Event</property> + <property name="label" translatable="yes">Type</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -263,17 +263,17 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">16</property> + <property name="x">112</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_type"> - <property name="width_request">88</property> + <widget class="GtkLabel" id="lbl_conf_time"> + <property name="width_request">80</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Type</property> + <property name="label" translatable="yes">Time</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -289,17 +289,50 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">112</property> + <property name="x">296</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_value"> - <property name="width_request">80</property> + <widget class="GtkFileChooserButton" id="conf_behavior"> + <property name="width_request">144</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Select A File</property> + <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> + <property name="local_only">True</property> + <property name="show_hidden">False</property> + <property name="do_overwrite_confirmation">False</property> + <property name="width_chars">-1</property> + </widget> + <packing> + <property name="x">480</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkComboBox" id="cbb_conf_type"> + <property name="width_request">88</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="items" translatable="yes"></property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="x">112</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_event"> + <property name="width_request">88</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Value</property> + <property name="label" translatable="yes">Event</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -315,17 +348,17 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">208</property> + <property name="x">16</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_time"> + <widget class="GtkLabel" id="lbl_conf_value"> <property name="width_request">80</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Time</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> @@ -341,21 +374,21 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">296</property> + <property name="x">208</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_notified"> - <property name="width_request">96</property> + <widget class="GtkLabel" id="lbl_conf_behavior"> + <property name="width_request">144</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Notified?</property> + <property name="label" translatable="yes">Behavior script</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="wrap">True</property> <property name="selectable">False</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -367,21 +400,21 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">376</property> + <property name="x">480</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_behavior"> - <property name="width_request">144</property> + <widget class="GtkLabel" id="lbl_conf_notified"> + <property name="width_request">96</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Behavior script</property> + <property name="label" translatable="yes">Notified?</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="wrap">False</property> <property name="selectable">False</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -393,25 +426,23 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">480</property> + <property name="x">376</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkFileChooserButton" id="conf_behavior"> - <property name="width_request">144</property> + <widget class="GtkComboBox" id="cbb_conf_event"> + <property name="width_request">88</property> <property name="height_request">30</property> <property name="visible">True</property> - <property name="title" translatable="yes">Select A File</property> - <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> - <property name="local_only">True</property> - <property name="show_hidden">False</property> - <property name="do_overwrite_confirmation">False</property> - <property name="width_chars">-1</property> + <property name="items" translatable="yes"></property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> + <signal name="changed" handler="on_cbb_conf_event_changed" last_modification_time="Thu, 27 Sep 2007 16:15:13 GMT"/> </widget> <packing> - <property name="x">480</property> + <property name="x">16</property> <property name="y">32</property> </packing> </child> @@ -437,38 +468,6 @@ <property name="y">32</property> </packing> </child> - - <child> - <widget class="GtkComboBox" id="cbb_conf_type"> - <property name="width_request">88</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="items" translatable="yes"></property> - <property name="add_tearoffs">False</property> - <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="x">112</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkComboBox" id="cbb_conf_event"> - <property name="width_request">88</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="items" translatable="yes">Change -Threshold</property> - <property name="add_tearoffs">False</property> - <property name="focus_on_click">True</property> - <signal name="changed" handler="on_cbb_conf_event_changed" last_modification_time="Thu, 27 Sep 2007 16:15:13 GMT"/> - </widget> - <packing> - <property name="x">16</property> - <property name="y">32</property> - </packing> - </child> </widget> <packing> <property name="padding">0</property> @@ -483,44 +482,44 @@ <property name="visible">True</property> <child> - <widget class="GtkButton" id="btn_conf_remove"> - <property name="width_request">62</property> + <widget class="GtkButton" id="btn_conf_add"> + <property name="width_request">88</property> <property name="height_request">29</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Remove</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_btn_conf_remove_clicked"/> + <signal name="clicked" handler="on_btn_conf_add_clicked"/> </widget> <packing> - <property name="x">96</property> + <property name="x">16</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkButton" id="btn_conf_add"> - <property name="width_request">62</property> + <widget class="GtkButton" id="btn_conf_remove"> + <property name="width_request">88</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="label" translatable="yes">Remove</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_btn_conf_add_clicked"/> + <signal name="clicked" handler="on_btn_conf_remove_clicked"/> </widget> <packing> - <property name="x">16</property> + <property name="x">112</property> <property name="y">8</property> </packing> </child> <child> <widget class="GtkButton" id="btn_conf_modify"> - <property name="width_request">62</property> + <property name="width_request">88</property> <property name="height_request">29</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -531,7 +530,7 @@ <signal name="clicked" handler="on_btn_conf_modify_clicked" last_modification_time="Fri, 28 Sep 2007 09:09:13 GMT"/> </widget> <packing> - <property name="x">176</property> + <property name="x">208</property> <property name="y">8</property> </packing> </child> @@ -549,34 +548,8 @@ <property name="visible">True</property> <child> - <widget class="GtkLabel" id="lbl_conf_sample"> - <property name="width_request">100</property> - <property name="height_request">20</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Sample :</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">24</property> - <property name="y">16</property> - </packing> - </child> - - <child> <widget class="GtkEntry" id="txt_conf_sample"> - <property name="width_request">72</property> + <property name="width_request">80</property> <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -589,14 +562,14 @@ <property name="activates_default">False</property> </widget> <packing> - <property name="x">136</property> - <property name="y">14</property> + <property name="x">208</property> + <property name="y">0</property> </packing> </child> <child> <widget class="GtkEntry" id="txt_conf_rate"> - <property name="width_request">72</property> + <property name="width_request">80</property> <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -609,15 +582,41 @@ <property name="activates_default">False</property> </widget> <packing> - <property name="x">318</property> - <property name="y">14</property> + <property name="x">208</property> + <property name="y">24</property> </packing> </child> <child> + <widget class="GtkLabel" id="lbl_conf_sample"> + <property name="width_request">192</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Sample :</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">16</property> + <property name="y">0</property> + </packing> + </child> + + <child> <widget class="GtkLabel" id="lbl_conf_rate"> - <property name="width_request">100</property> - <property name="height_request">20</property> + <property name="width_request">192</property> + <property name="height_request">24</property> <property name="visible">True</property> <property name="label" translatable="yes">Rate :</property> <property name="use_underline">False</property> @@ -635,8 +634,8 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">232</property> - <property name="y">16</property> + <property name="x">16</property> + <property name="y">24</property> </packing> </child> </widget> Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak 2007-10-01 12:02:54 UTC (rev 561) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.glade.bak 2007-10-01 12:51:16 UTC (rev 562) @@ -243,11 +243,11 @@ </child> <child> - <widget class="GtkLabel" id="lbl_conf_event"> + <widget class="GtkLabel" id="lbl_conf_type"> <property name="width_request">88</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Event</property> + <property name="label" translatable="yes">Type</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -263,17 +263,17 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">16</property> + <property name="x">112</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_type"> - <property name="width_request">88</property> + <widget class="GtkLabel" id="lbl_conf_time"> + <property name="width_request">80</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Type</property> + <property name="label" translatable="yes">Time</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -289,17 +289,72 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">112</property> + <property name="x">296</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_value"> - <property name="width_request">80</property> + <widget class="GtkFileChooserButton" id="conf_behavior"> + <property name="width_request">144</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Select A File</property> + <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> + <property name="local_only">True</property> + <property name="show_hidden">False</property> + <property name="do_overwrite_confirmation">False</property> + <property name="width_chars">-1</property> + </widget> + <packing> + <property name="x">480</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="chk_conf_notified"> + <property name="width_request">24</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">False</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="x">416</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkComboBox" id="cbb_conf_type"> + <property name="width_request">88</property> + <property name="height_request">30</property> + <property name="visible">True</property> + <property name="items" translatable="yes"></property> + <property name="add_tearoffs">False</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="x">112</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_event"> + <property name="width_request">88</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Value</property> + <property name="label" translatable="yes">Event</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -315,17 +370,17 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">208</property> + <property name="x">16</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_time"> + <widget class="GtkLabel" id="lbl_conf_value"> <property name="width_request">80</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Time</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> @@ -341,21 +396,21 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">296</property> + <property name="x">208</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_notified"> - <property name="width_request">96</property> + <widget class="GtkLabel" id="lbl_conf_behavior"> + <property name="width_request">144</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Notified?</property> + <property name="label" translatable="yes">Behavior script</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="wrap">True</property> <property name="selectable">False</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -367,21 +422,21 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">376</property> + <property name="x">480</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lbl_conf_behavior"> - <property name="width_request">144</property> + <widget class="GtkLabel" id="lbl_conf_notified"> + <property name="width_request">96</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">Behavior script</property> + <property name="label" translatable="yes">Notified?</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="wrap">False</property> <property name="selectable">False</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -393,75 +448,19 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">480</property> + <property name="x">376</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkFileChooserButton" id="conf_behavior"> - <property name="width_request">144</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="title" translatable="yes">Select A File</property> - <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property> - <property name="local_only">True</property> - <property name="show_hidden">False</property> - <property name="do_overwrite_confirmation">False</property> - <property name="width_chars">-1</property> - </widget> - <packing> - <property name="x">480</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chk_conf_notified"> - <property name="width_request">24</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">False</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="x">416</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkComboBox" id="cbb_conf_type"> + <widget class="GtkComboBox" id="cbb_conf_event"> <property name="width_request">88</property> <property name="height_request">30</property> <property name="visible">True</property> <property name="items" translatable="yes"></property> <property name="add_tearoffs">False</property> <property name="focus_on_click">True</property> - </widget> - <packing> - <property name="x">112</property> - <property name="y">32</property> - </packing> - </child> - - <child> - <widget class="GtkComboBox" id="cbb_conf_event"> - <property name="width_request">88</property> - <property name="height_request">30</property> - <property name="visible">True</property> - <property name="items" translatable="yes">Change -Threshold</property> - <property name="add_tearoffs">False</property> - <property name="focus_on_click">True</property> <signal name="changed" handler="on_cbb_conf_event_changed" last_modification_time="Thu, 27 Sep 2007 16:15:13 GMT"/> </widget> <packing> @@ -483,37 +482,37 @@ <property name="visible">True</property> <child> - <widget class="GtkButton" id="btn_conf_remove"> + <widget class="GtkButton" id="btn_conf_add"> <property name="width_request">62</property> <property name="height_request">29</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">Remove</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_btn_conf_remove_clicked"/> + <signal name="clicked" handler="on_btn_conf_add_clicked"/> </widget> <packing> - <property name="x">96</property> + <property name="x">16</property> <property name="y">8</property> </packing> </child> <child> - <widget class="GtkButton" id="btn_conf_add"> + <widget class="GtkButton" id="btn_conf_remove"> <property name="width_request">62</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="label" translatable="yes">Remove</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_btn_conf_add_clicked"/> + <signal name="clicked" handler="on_btn_conf_remove_clicked"/> </widget> <packing> - <property name="x">16</property> + <property name="x">96</property> <property name="y">8</property> </packing> </child> @@ -542,6 +541,110 @@ <property name="fill">True</property> </packing> </child> + + <child> + <widget class="GtkFixed" id="fixed9"> + <property name="height_request">60</property> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="txt_conf_sample"> + <property name="width_request">72</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">136</property> + <property name="y">14</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="txt_conf_rate"> + <property name="width_request">72</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">318</property> + <property name="y">14</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_rate"> + <property name="width_request">100</property> + <property name="height_request">20</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Rate :</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">232</property> + <property name="y">16</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lbl_conf_sample"> + <property name="width_request">100</property> + <property name="height_request">20</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Sample :</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">24</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> 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-01 12:02:54 UTC (rev 561) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/conf/other.pyp 2007-10-01 12:51:16 UTC (rev 562) @@ -84,37 +84,37 @@ self.index_column.pack_start(self.index_cell, True) self.index_column.add_attribute(self.index_cell, 'text', 0) - self.event_column = gtk.TreeViewColumn('Event') + self.event_column = gtk.TreeViewColumn(_me.string('conf_lblEvent')) self.event_column.set_min_width(100) self.event_cell = gtk.CellRendererText() self.event_column.pack_start(self.event_cell, True) self.event_column.add_attribute(self.event_cell, 'text', 1) - self.type_column = gtk.TreeViewColumn('Type') + self.type_column = gtk.TreeViewColumn(_me.string('conf_lblType')) self.type_column.set_min_width(100) self.type_cell = gtk.CellRendererText() self.type_column.pack_start(self.type_cell, True) self.type_column.add_attribute(self.type_cell, 'text', 2) - self.value_column = gtk.TreeViewColumn('Value') + self.value_column = gtk.TreeViewColumn(_me.string('conf_lblValue')) self.value_column.set_min_width(100) self.value_cell = gtk.CellRendererText() self.value_column.pack_start(self.value_cell, True) self.value_column.add_attribute(self.value_cell, 'text', 3) - self.time_column = gtk.TreeViewColumn('Time') + self.time_column = gtk.TreeViewColumn(_me.string('conf_lblTime')) self.time_column.set_min_width(100) self.time_cell = gtk.CellRendererText() self.time_column.pack_start(self.time_cell, True) self.time_column.add_attribute(self.time_cell, 'text', 4) - self.notified_column = gtk.TreeViewColumn('Notified') + self.notified_column = gtk.TreeViewColumn(_me.string('conf_lblNotified')) self.notified_column.set_min_width(100) self.notified_cell = gtk.CellRendererText() self.notified_column.pack_start(self.notified_cell, True) self.notified_column.add_attribute(self.notified_cell, 'text', 5) - self.behavior_column = gtk.TreeViewColumn('Behavior') + self.behavior_column = gtk.TreeViewColumn(_me.string('conf_lblBehavior')) self.behavior_cell = gtk.CellRendererText() self.behavior_column.pack_start(self.behavior_cell, True) self.behavior_column.add_attribute(self.behavior_cell, 'text', 6) @@ -137,47 +137,64 @@ self.get_widget('txt_conf_time').set_text('0.1') self.gadget_viewer.connect("row_activated", self.on_row_selected) self.measure.event_tab = _me.get_param('config') + 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) + for i in range(len(self.measure.event_tab)): self.add_row(i) + self.get_widget("lbl_conf_event").set_text(_me.string('conf_lblEvent')) + self.get_widget("lbl_conf_type").set_text(_me.string('conf_lblType')) + self.get_widget("lbl_conf_value").set_text(_me.string('conf_lblValue')) + self.get_widget("lbl_conf_time").set_text(_me.string('conf_lblTime')) + self.get_widget("lbl_conf_notified").set_text(_me.string('conf_lblNotified')) + self.get_widget("lbl_conf_behavior").set_text(_me.string('conf_lblBehavior')) + self.get_widget("btn_conf_add").set_label(_me.string('conf_btnAdd')) + self.get_widget("btn_conf_remove").set_label(_me.string('conf_btnRemove')) + self.get_widget("btn_conf_modify").set_label(_me.string('conf_btnModify')) + self.get_widget("lbl_conf_sample").set_text(_me.string('conf_lblSample')) + self.get_widget("lbl_conf_rate").set_text(_me.string('conf_lblRate')) + self.get_widget("lblControlFrame").set_text(_me.string('conf_lblControl')) + def on_row_selected(self, treeview, path, view_column): self.iter = self.value_list.get_iter(path) index = self.value_list.get_value(self.iter, 0) event = self.value_list.get_value(self.iter, 1) - type = self.value_list.get_value(self.iter, 2) + typet = self.value_list.get_value(self.iter, 2) value = self.value_list.get_value(self.iter, 3) time = self.value_list.get_value(self.iter, 4) notify = self.value_list.get_value(self.iter, 5) behavior = self.value_list.get_value(self.iter, 6) - if event == 'Change': + if event == _me.string('conf_lblChange'): self.get_widget('cbb_conf_event').set_active(0) - if type == 'Drop': + if typet == _me.string('conf_lblDrop'): self.get_widget('cbb_conf_type').set_active(0) - if type == 'Raise': + if typet == _me.string('conf_lblRaise'): self.get_widget('cbb_conf_type').set_active(1) - if type == 'Drop and raise': + if typet == _me.string('conf_lblChangeD'): self.get_widget('cbb_conf_type').set_active(2) - if type == 'Raise and drop': + if typet == _me.string('conf_lblChangeU'): self.get_widget('cbb_conf_type').set_active(3) self.get_widget('txt_conf_value').set_text(value) self.get_widget('txt_conf_time').set_text(time) else: self.get_widget('cbb_conf_event').set_active(1) - if type == 'Increase': + if typet == _me.string('conf_lblIncrease'): self.get_widget('cbb_conf_type').set_active(0) - if type == 'Decrease': + if typet == _me.string('conf_lblDecrease'): self.get_widget('cbb_conf_type').set_active(1) - if type == 'Both direction': + if typet == _me.string('conf_lblBoth'): self.get_widget('cbb_conf_type').set_active(2) self.get_widget('txt_conf_value').set_text(value) self.get_widget('txt_conf_time').set_text('') - if notify == 'Notified': + if notify == _me.string('conf_lblNotifiedBehavior'): self.get_widget('chk_conf_notified').set_active(True) else: self.get_widget('chk_conf_notified').set_active(False) @@ -192,20 +209,21 @@ self.measure.event_tab = _me.get_param('config') length = len(_me.get_param('config')) - if self.get_widget('cbb_conf_type').get_active() == 0 and self.get_widget('txt_conf_time').get_text() in ('','0' ,'0.0' ,'None'): + if self.get_widget('txt_conf_time').get_text() in ('','0' ,'0.0' ,'None'): self.get_widget('txt_conf_time').set_text('0.1') if self.get_widget('txt_conf_value').get_text() in ('', '0', '0.0', 'None'): self.get_widget('txt_conf_value').set_text('1.0') value = [] - value = [(length + 1), + value = [int(index), self.get_widget('cbb_conf_event').get_active(), self.get_widget('cbb_conf_type').get_active(), float(self.get_widget('txt_conf_value').get_text()), float(self.get_widget('txt_conf_time').get_text()), self.get_widget('chk_conf_notified').get_active(), - self.get_widget('conf_behavior').get_filename(), - False] + str(self.get_widget('conf_behavior').get_filename()), + False, + 0] self.measure.event_tab = _me.get_param('config') self.measure.event_tab[int(index)-1] = value _me.set_param('config', self.measure.event_tab) @@ -239,8 +257,9 @@ float(self.get_widget('txt_conf_value').get_text()), float(self.get_widget('txt_conf_time').get_text()), self.get_widget('chk_conf_notified').get_active(), - self.get_widget('conf_behavior').get_filename(), - False] + str(self.get_widget('conf_behavior').get_filename()), + False, + 0] self.measure.event_tab = _me.get_param('config') self.measure.event_tab.append(value) @@ -255,36 +274,37 @@ i = tab_index if self.measure.event_tab[i][1] == 0: - Event = 'Change' + Event = _me.string('conf_lblChange') if self.measure.event_tab[i][2] == 0: - Type = 'Drop' + Type = _me.string('conf_lblDrop') elif self.measure.event_tab[i][2] == 1: - Type = 'Raise' + Type = _me.string('conf_lblRaise') elif self.measure.event_tab[i][2] == 2: - Type = 'Drop and raise' + Type = _me.string('conf_lblChangeD') elif self.measure.event_tab[i][2] == 3: - Type = 'Raise and drop' + Type = _me.string('conf_lblChangeU') Value = str(self.measure.event_tab[i][3]) Time = str(self.measure.event_tab[i][4]) else: - Event = 'Threshold' + Event = _me.string('conf_lblThreshold') if self.measure.event_tab[i][2] == 0: - Type = 'Increase' + Type = _me.string('conf_lblIncrease') elif self.measure.event_tab[i][2] == 1: - Type = 'Decrease' + Type = _me.string('conf_lblDecrease') elif self.measure.event_tab[i][2] == 2: - Type = 'Both direction' + print ' tick' + Type = _me.string('conf_lblBoth') Value = str(self.measure.event_tab[i][3]) Time = 'N.A.' if self.measure.event_tab[i][5]: - Notify = 'Notified' + Notify = _me.string('conf_lblNotifiedBehavior') if self.measure.event_tab[i][6] == None: - Behavior = 'Default behavior' + Behavior = _me.string('conf_lblDefaultBehavior') else: Behavior = str(self.measure.event_tab[i][6]) else: - Notify = 'Not notified' + Notify = _me.string('conf_lblNotNotified') Behavior = 'N.A.' self.value_list.append(None,[str(i+1), Event, Type, Value, Time, Notify, Behavior]) @@ -294,23 +314,19 @@ if self.get_widget('cbb_conf_event').get_active() == 0: for i in range (4): self.get_widget('cbb_conf_type').remove_text(0) - self.get_widget('cbb_conf_type').append_text('Drop') - self.get_widget('cbb_conf_type').append_text('Raise') - self.get_widget('cbb_conf_type').append_text('Drop and raise') - self.get_widget('cbb_conf_type').append_text('Raise and drop') + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblDrop')) + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblRaise')) + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblChangeD')) + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblChangeU')) self.get_widget('cbb_conf_type').set_active(0) else: for i in range (4): self.get_widget('cbb_conf_type').remove_text(0) - self.get_widget('cbb_conf_type').append_text('Increase') - self.get_widget('cbb_conf_type').append_text('Decrease') - self.get_widget('cbb_conf_type').append_text('Both direction') + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblIncrease')) + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblDecrease')) + self.get_widget('cbb_conf_type').append_text(_me.string('conf_lblBoth')) self.get_widget('cbb_conf_type').set_active(0) - - - - def on_accept_clicked(self, widget, *args): """ On button 'accept' clicked 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-01 12:02:54 UTC (rev 561) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/lightGraph_class.py 2007-10-01 12:51:16 UTC (rev 562) @@ -157,25 +157,27 @@ self.event_tab[i][7] = True #Changements control - else: - if self.event_tab[i][7] != True: + else: + pts_per_sec = self.sample / (self.rate * self.sample) + time = int(self.event_tab[i][4] * pts_per_sec) + if self.event_tab[i][7] == False: # Drop change part : - if self.event_tab[i][2] == 0: - if self.Drop_control(self.event_tab[i][3], self.event_tab[i][4]) == True: + if self.event_tab[i][2] == 0: + if self.Drop_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: self.event_tab[i][7] = True # Raise change part if self.event_tab[i][2] == 1: - if self.Raise_control(self.event_tab[i][3], self.event_tab[i][4]) == True: + if self.Raise_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: self.event_tab[i][7] = True # Drop and Raise change if self.event_tab[i][2] == 2: - if self.ChangeD_control(self.event_tab[i][3], self.event_tab[i][4]) == True: + if self.ChangeD_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: self.event_tab[i][7] = True # Raise and Drop change if self.event_tab[i][2] == 3: - if self.ChangeU_control(self.event_tab[i][3], self.event_tab[i][4]) == True: + if self.ChangeU_control(time, self.event_tab[i][3], self.event_tab[i][8], i) == True: self.event_tab[i][7] = True - + ''' #Gadget or test notifications if self.GUI_on: #Decrease threshold control @@ -187,7 +189,7 @@ #Both direction theshold control if self.both: self.threshold_event = self.Both_control(self.val_threshold) - + #Changements control if self.change_event == False: # Drop change part : @@ -207,21 +209,23 @@ self.notify = False #goto test notification self.test_notification() + else: #enable gadget notifications self.notify = True - + ''' # To prevent notifications at startup if self.start_flag == True: self.change_event = False self.threshold_event = False self.start_flag = False - def change_control(self): # Determine how many point must be checked for changes events + + pts_per_sec = self.sample / (self.rate * self.sample) self.timeout = 0 if self.val_drop_time >= 0.1 and self.val_drop > 0: @@ -236,7 +240,7 @@ if self.val_changeU_time >= 0.1 and self.val_changeU > 0: self.val_changeU_time = self.val_changeU_time * pts_per_sec self.timeout = int(self.val_changeU_time) - + ########################################################### # @@ -268,47 +272,48 @@ # Changes control # ########################################################### - def Drop_control(self, time, val): - if self.timeout != 0: - self.timeout -= 1 - init_val = len(self.val_table) - 1 - int(time) + self.timeout + def Drop_control(self, time, val, timeout, index): + #timeout control : to prevent multiple notifications with the same event + if timeout != 0: + timeout -= 1 + init_val = len(self.val_table) - 1 - int(time) + timeout maximum = max(self.val_table[init_val:len(self.val_table)-1]) if maximum >= self.val_table[len(self.val_table)-1] + ((val/100)*1124): - self.timeout = int(time) + self.event_tab[index][8] = int(time) return True - - def Raise_control(self, time, val): - if self.timeout != 0: - self.timeout -= 1 - init_val = len(self.val_table) - 1 - int(time) + self.timeout + def Raise_control(self, time, val, timeout, index): + if timeout != 0: + timeout -= 1 + init_val = len(self.val_table) - 1 - int(time) + timeout minimum = min(self.val_table[init_val:(len(self.val_table)-1)]) if minimum <= self.val_table[len(self.val_table)-1] - ((val/100)*1124): - self.timeout = int(time) + self.event_tab[index][8] = int(time) return True - def ChangeD_control(self, time, val): - if self.timeout != 0: - self.timeout -= 1 - init_val = len(self.val_table) - 1 - int(time) + self.timeout + def ChangeD_control(self, time, val, timeout, index): + if timeout != 0: + timeout -= 1 + + init_val = len(self.val_table) - 1 - int(time) + timeout for i in range(int(time - self.timeout)): if self.val_table[int(len(self.val_table)-1-i)] <= self.val_table[len(self.val_table) - 1] - ((val/100)*1124): maximum = max(self.val_table[init_val:len(self.val_table) - i]) if maximum >= self.val_table[len(self.val_table) - 1 - i] + val: - self.timeout = int(time) + self.event_tab[index][8] = int(time) return True break - def ChangeU_control(self, time, val): - if self.timeout != 0: - self.timeout -= 1 - init_val = len(self.val_table) - 1 - int(time) + self.timeout + def ChangeU_control(self, time, val, timeout, index): + if timeout != 0: + timeout -= 1 + init_val = len(self.val_table) - 1 - int(time) + timeout for i in range(int(time - self.timeout)): if self.val_table[int(len(self.val_table)-1-i)] >= self.val_table[len(self.val_table) - 1] + ((val/100)*1124): minimum = min(self.val_table[init_val:len(self.val_table)-i]) if minimum <= self.val_table[len(self.val_table) - 1 - i] - val: - self.timeout = int(time) + self.event_tab[index][8] = int(time) return True break @@ -317,7 +322,7 @@ # Test notifications # ########################################################### - + ''' def test_notification(self): if self.wait != 0: self.wait -= 1 @@ -344,7 +349,7 @@ tux.cmd.mouth_open() tux.cmd.mouth_close() - +''' ########################################################### # # Acquire @@ -352,6 +357,7 @@ ########################################################### def on_light_level(self, args): self.tick -= 1 + print self.tick if self.tick == 0: val = (args[0] * 256) + args[1] self.val_table.append(val) 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-01 12:02:54 UTC (rev 561) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/notify.pyp 2007-10-01 12:51:16 UTC (rev 562) @@ -1,32 +1,46 @@ def notify_checker(): - if _me.get_param('measure').threshold_event == True: - return True - - elif _me.get_param('measure').change_event == True: - return True + event = _me.get_param('measure').event_tab + print event + for i in range(len(event)): + temp = event[i][7] + if temp == True: + return True + + - else: - return False - -def notify_actuator(): - if _me.get_param('measure').threshold_event == True: - if os.path.isfile(_me.get_param('behavior_file_threshold')): - tux.sys.shell_free(_me.get_param('behavior_file_threshold')) - _me.get_param('measure').threshold_event = False +def notify_actuator(): + event = _me.get_param('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') + elif event[i][2] == 1: + text = _me.string('conf_lblRaise') + elif event[i][2] == 2: + text = _me.string('conf_lblChangeD') + elif event[i][2] == 3: + text = _me.string('conf_lblChangeU') else: - tux.cmd.wings_on(2) - _me.get_param('measure').threshold_event = False - + if event[i][2] == 0: + text = _me.string('conf_lblIncrease') + elif event[i][2] == 1: + text = _me.string('conf_lblDecrease') + elif event[i][2] == 2: + text = _me.string('conf_lblBoth') - elif _me.get_param('measure').change_event == True: - if os.path.isfile(_me.get_param('behavior_file_change')): - tux.sys.shell_free(_me.get_param('behavior_file_change')) - _me.get_param('measure').change_event = False - else: - tux.cmd.mouth_open() - tux.cmd.mouth_close() - _me.get_param('measure').change_event = False + if event[i][7]: + if event[i][5]: + if os.path.exists(str(event[i][6])): + tux.sys.shell_free(event[i][6]) + event[i][7] = False + else: + tux.cmd.mouth_open() + tux.tts.speak(text) + tux.cmd.mouth_close() + event[i][7] = False + else: + event[i][7] = False + break - - 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-01 12:02:54 UTC (rev 561) +++ software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2007-10-01 12:51:16 UTC (rev 562) @@ -1,37 +1,61 @@ <?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> <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> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> - <speaker_name type='str'>Bruno8k</speaker_name> <help_text type='str'>Bla bla bla bla</help_text> + <conf_lblChange type='str'>Changement</conf_lblChange> + <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>... [truncated message content] |