tux-droid-svn Mailing List for Tux Droid CE (Page 210)
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-12-12 10:35:10
|
Author: Paul_R Date: 2007-12-12 11:35:05 +0100 (Wed, 12 Dec 2007) New Revision: 780 Modified: software/gadgets/sound_monitor/trunk/audio_monitor.tgf software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.glade software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.pyp software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/main.pyp software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/notify.pyp software/gadgets/sound_monitor/trunk/audio_monitor/about.xml software/gadgets/sound_monitor/trunk/audio_monitor/settings.xml Log: * Added two color lines on the widget GUI to indicate the events diplayed on the graph. * Fix some bugs with the external behavior file chooser. On my desktop, I've a little bug : When the file is on the Desktop, the file chooser button don't display the file, but the script is correctly executed when a notification occurs. Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/conf/other.pyp 2007-12-11 16:20:06 UTC (rev 779) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/conf/other.pyp 2007-12-12 10:35:05 UTC (rev 780) @@ -31,7 +31,6 @@ path = widget.get_current_folder() path = path.replace('%20', ' ') _me.set_param('Path', path) - print path def on_spinSample_changed(self, widget, *args): _me.set_param('Sample', float(widget.get_text())) Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.glade =================================================================== (Binary files differ) Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.pyp 2007-12-11 16:20:06 UTC (rev 779) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.pyp 2007-12-12 10:35:05 UTC (rev 780) @@ -22,6 +22,14 @@ # ########################################################### def new(self): + if _me.get_param('dogBehavior') != None: + self.get_widget('fileDogBehavior').select_filename(_me.get_param('dogBehavior')) + self.get_widget('fileDogBehavior').show() + orange = gtk.gdk.Color(65535, 45874, 0, 1) + self.get_widget('draw1').modify_bg(gtk.STATE_NORMAL, orange) + pink = gtk.gdk.Color(65535, 0, 45874, 1) + self.get_widget('draw2').modify_bg(gtk.STATE_NORMAL, pink) + self.get_widget("window1").set_title(_me.string('name_to_read')) if _me.get_param('Startup') == False: _me.set_param('string', _me.string('Startup')) @@ -52,15 +60,10 @@ self.get_widget('chkDogDefault').set_label(_me.string('at_gui_widget_chkDogDefault')) self.get_widget('chkDogDefault').set_active(_me.get_param('chkDogDefault')) - self.get_widget('spinDog').set_value(_me.get_param('Threshold')) - print _me.get_param('dogBehavior') - try: - if os.path.exists(_me.get_param('dogBehavior')): - print _me.get_param('dogBehavior') - self.get_widget('fileDogBehavior').set_filename(_me.get_param('dogBehavior')) - except: - pass + + #self.get_widget('fileDogBehavior').set_title(str(_me.get_param('dogBehavior'))) + self.get_widget('chkSpy').set_label(_me.string('at_gui_widget_chkSpy')) self.get_widget('chkSpy').set_active(_me.get_param('chkSpy')) @@ -121,7 +124,10 @@ user = commands.getoutput('echo $USER') self.measure.capture_path = '/home/%s'%user _me.set_param('Path', 'home/%s'%user) + + + self.monitor_id = tux.monitoring.insert(0xF0, self.measure.on_sound_level) tux.micro.on() self.update_value() @@ -194,6 +200,7 @@ _me.set_param('chkSpy', widget.get_active()) self.measure.spy_enabled = widget.get_active() + def on_chkDog_toggled(self, widget, *args): _me.set_param('chkDog', widget.get_active()) self.measure.dog_enabled = widget.get_active() @@ -201,10 +208,9 @@ def on_chkDogDefault_toggled(self, widget, *args): _me.set_param('chkDogDefault', widget.get_active()) - def on_fileDogBehavior_selection_changed(self, widget, *args): - print widget.get_filename() - _me.set_param('dogBehavior', widget.get_filename()) - print _me.get_param('dogBehavior') + def on_fileDogBehavior_current_folder_changed(self, widget, *args): + if widget.get_filename() != None: + _me.set_param('dogBehavior', widget.get_filename()) class Sound_Graph(gtk.DrawingArea): def __init__(self): Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/main.pyp =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/main.pyp 2007-12-11 16:20:06 UTC (rev 779) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/main.pyp 2007-12-12 10:35:05 UTC (rev 780) @@ -2,7 +2,6 @@ import time def on_standby(): - print 'standby function' _me.set_param('stdby', True) _me.set_param('string', _me.string('Standby')) _me.set_param('check', _me.string('Show')) @@ -15,15 +14,12 @@ tux.sys.wait(1) while _me.gui('dialog').showed(): - print 'while' tux.sys.wait(0.5) if _me.get_param('return') == False: - print 'return = False' _me.set_param('stdby', False) return - #start_gadget() else: gdg_dict = _me.get_param('dict') for keys in gdg_dict: Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/notify.pyp 2007-12-11 16:20:06 UTC (rev 779) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/notify.pyp 2007-12-12 10:35:05 UTC (rev 780) @@ -19,6 +19,7 @@ tux.sys.wait(0.5) else: path = _me.get_param('dogBehavior') + path = path.replace('%20', ' ') if os.path.exists(path) and os.path.isfile(path): tux.sys.shell(path) Modified: software/gadgets/sound_monitor/trunk/audio_monitor/about.xml =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/about.xml 2007-12-11 16:20:06 UTC (rev 779) +++ software/gadgets/sound_monitor/trunk/audio_monitor/about.xml 2007-12-12 10:35:05 UTC (rev 780) @@ -1,8 +1,8 @@ <?xml version='1.0' encoding='UTF-8'?> <about> - <gadget_name type='str'>sound_monitor</gadget_name> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_version type='str'>0.0.1</gadget_version> <gadget_description type='str'> </gadget_description> - <gadget_version type='str'>0.0.1</gadget_version> + <gadget_name type='str'>sound_monitor</gadget_name> </about> Modified: software/gadgets/sound_monitor/trunk/audio_monitor/settings.xml =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/settings.xml 2007-12-11 16:20:06 UTC (rev 779) +++ software/gadgets/sound_monitor/trunk/audio_monitor/settings.xml 2007-12-12 10:35:05 UTC (rev 780) @@ -1,21 +1,23 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <chkDog type='bool'>True</chkDog> + <dogBehavior type='str'> + </dogBehavior> + <Sample type='float'>400.0</Sample> <chkDogBehavior type='bool'>False</chkDogBehavior> - <BehaviorPath type='NoneType'>None</BehaviorPath> <SpyThreshold type='int'>30</SpyThreshold> <Standby type='bool'>False</Standby> + <MainScript type='str'>None</MainScript> <chkSpy type='bool'>False</chkSpy> - <MainScript type='str'>None</MainScript> - <Sample type='float'>400.0</Sample> + <chkDog type='bool'>True</chkDog> + <Threshold type='float'>30.0</Threshold> + <chkSpyRecord type='bool'>False</chkSpyRecord> <chkDogDefault type='bool'>False</chkDogDefault> - <chkSpyRecord type='bool'>False</chkSpyRecord> - <Threshold type='float'>30.0</Threshold> <Path type='str'>/tmp</Path> <DogThreshold type='int'>30</DogThreshold> <Startup type='bool'>False</Startup> - <dogBehavior type='NoneType'>None</dogBehavior> + <BehaviorPath type='str'> + </BehaviorPath> </parameters> <general> <have_settings_part type='bool'>True</have_settings_part> @@ -28,7 +30,7 @@ </conf> </gui_state> <language type='str'>en_US</language> - <notified type='bool'>True</notified> + <notified type='bool'>False</notified> <notify_delay type='int'>1</notify_delay> <framework_version type='str'>0.0.0</framework_version> <menu_active type='bool'>True</menu_active> Modified: software/gadgets/sound_monitor/trunk/audio_monitor.tgf =================================================================== (Binary files differ) |
Author: Paul_R Date: 2007-12-11 17:20:06 +0100 (Tue, 11 Dec 2007) New Revision: 779 Modified: software/gadgets/sound_monitor/trunk/audio_monitor.tgf software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/conf/other.glade software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.glade software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.pyp software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.glade software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.pyp software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/main.pyp software/gadgets/sound_monitor/trunk/audio_monitor/Strings/fr_ALL.xml software/gadgets/sound_monitor/trunk/audio_monitor/about.xml software/gadgets/sound_monitor/trunk/audio_monitor/settings.xml software/gadgets/sound_monitor/trunk/audio_monitor/strings.xml Log: * Settings GUI : - Changed the alignment and some labels * Dialog GUI : - Reduced the size of the window. - Added a button 'No' * Widget GUI : - Resolved a bug in the graph (two lines were visible on graph window) * Added a popup to notify the user that this gadget had an exclusive priority. If the user wants to keep the GUI open, He can. The gadget can't be closed with the 'cross' button's on the top of the window. M trunk/audio_monitor.tgf M trunk/audio_monitor/settings.xml M trunk/audio_monitor/Scripts/Python/GUI/dialog/other.pyp M trunk/audio_monitor/Scripts/Python/GUI/dialog/other.glade M trunk/audio_monitor/Scripts/Python/GUI/widget/other.pyp M trunk/audio_monitor/Scripts/Python/GUI/widget/other.glade M trunk/audio_monitor/Scripts/Python/GUI/conf/other.pyp M trunk/audio_monitor/Scripts/Python/GUI/conf/other.glade M trunk/audio_monitor/Scripts/Python/main.pyp M trunk/audio_monitor/strings.xml M trunk/audio_monitor/Strings/fr_ALL.xml M trunk/audio_monitor/about.xml Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/conf/other.glade =================================================================== (Binary files differ) Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/conf/other.pyp 2007-12-11 15:09:41 UTC (rev 778) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/conf/other.pyp 2007-12-11 16:20:06 UTC (rev 779) @@ -17,6 +17,7 @@ txt = "%s : %s" % (_me.string('name_to_read'), _me.string('gui_conf_window_title')) self.get_widget("window1").set_title(txt) self.get_widget('lblLocation').set_label(_me.string('Location')) + self.get_widget('lblFiles').set_label(_me.string('Settings')) self.get_widget('spinSample').set_value(_me.get_param('Sample')) self.get_widget('lblSample').set_label(_me.string('lblSample')) if os.path.exists(_me.get_param('Path')): Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.glade =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.glade 2007-12-11 15:09:41 UTC (rev 778) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.glade 2007-12-11 16:20:06 UTC (rev 779) @@ -3,9 +3,9 @@ <glade-interface> -<widget class="GtkDialog" id="window1"> +<widget class="GtkWindow" id="window1"> <property name="visible">True</property> - <property name="title" translatable="yes">dialog1</property> + <property name="title" translatable="yes">window1</property> <property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="window_position">GTK_WIN_POS_NONE</property> <property name="modal">False</property> @@ -14,102 +14,222 @@ <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_DIALOG</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> - <property name="has_separator">True</property> - <signal name="destroy" handler="on_window1_destroy" last_modification_time="Mon, 10 Dec 2007 10:54:18 GMT"/> - <child internal-child="vbox"> - <widget class="GtkVBox" id="dialog-vbox1"> + <child> + <widget class="GtkFixed" id="fixed1"> + <property name="width_request">294</property> + <property name="height_request">200</property> <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">0</property> - <child internal-child="action_area"> - <widget class="GtkHButtonBox" id="dialog-action_area1"> + <child> + <widget class="GtkButton" id="btnNo"> + <property name="width_request">102</property> + <property name="height_request">29</property> <property name="visible">True</property> - <property name="layout_style">GTK_BUTTONBOX_END</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_btnNo_clicked" last_modification_time="Tue, 11 Dec 2007 14:56:24 GMT"/> <child> - <widget class="GtkButton" id="okbutton1"> + <widget class="GtkAlignment" id="alignment2"> <property name="visible">True</property> - <property name="can_default">True</property> - <property name="can_focus">True</property> - <property name="label">gtk-ok</property> - <property name="use_stock">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="response_id">-5</property> - <signal name="clicked" handler="on_okbutton1_clicked" last_modification_time="Mon, 10 Dec 2007 11:12:39 GMT"/> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image2"> + <property name="visible">True</property> + <property name="stock">gtk-cancel</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lblNo"> + <property name="visible">True</property> + <property name="label" translatable="yes">button2</property> + <property name="use_underline">True</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="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> </widget> </child> </widget> <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">GTK_PACK_END</property> + <property name="x">72</property> + <property name="y">160</property> </packing> </child> <child> - <widget class="GtkFixed" id="fixed1"> + <widget class="GtkButton" id="btnYes"> + <property name="width_request">102</property> + <property name="height_request">29</property> <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_btnYes_clicked" last_modification_time="Tue, 11 Dec 2007 14:56:28 GMT"/> <child> - <widget class="GtkCheckButton" id="checkbutton1"> - <property name="width_request">272</property> - <property name="height_request">24</property> + <widget class="GtkAlignment" id="alignment1"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">checkbutton1</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="x">16</property> - <property name="y">176</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label1"> - <property name="width_request">280</property> - <property name="height_request">168</property> - <property name="visible">True</property> - <property name="label" translatable="yes"></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> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="stock">gtk-apply</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lblOK"> + <property name="visible">True</property> + <property name="label" translatable="yes">button1</property> + <property name="use_underline">True</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="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> </widget> - <packing> - <property name="x">8</property> - <property name="y">8</property> - </packing> </child> </widget> <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> + <property name="x">184</property> + <property name="y">160</property> </packing> </child> + + <child> + <widget class="GtkCheckButton" id="checkbutton1"> + <property name="width_request">272</property> + <property name="height_request">21</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">checkbutton1</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">136</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="width_request">280</property> + <property name="height_request">120</property> + <property name="visible">True</property> + <property name="label" translatable="yes"></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">8</property> + </packing> + </child> </widget> </child> </widget> Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.pyp =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.pyp 2007-12-11 15:09:41 UTC (rev 778) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.pyp 2007-12-11 16:20:06 UTC (rev 779) @@ -11,8 +11,24 @@ def new(self): self.get_widget("window1").set_title(_me.string('name_to_read')) self.get_widget('label1').set_label(_me.get_param('string')) - self.get_widget('checkbutton1').set_label(_me.get_param('check')) + self.get_widget('lblOK').set_label(_me.get_param('btnYes')) + if _me.get_param('btnNo') != False: + self.get_widget('lblNo').set_label(_me.get_param('btnNo')) + else: + self.get_widget('btnNo').hide() + if _me.get_param('chkHide') == True: + self.get_widget('checkbutton1').hide() + else: + self.get_widget('checkbutton1').set_label(_me.get_param('check')) - def on_okbutton1_clicked(self, widget, *args): + def on_btnYes_clicked(self, widget, *args): + _me.set_param('chkHide', False) _me.set_param(_me.get_param('param'), self.get_widget('checkbutton1').get_active()) + _me.set_param('return', True) self.get_widget('window1').destroy() + + def on_btnNo_clicked(self, widget, *args): + _me.set_param('chkHide', False) + _me.set_param(_me.get_param('param'), self.get_widget('checkbutton1').get_active()) + _me.set_param('return', False) + self.get_widget('window1').destroy() Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.glade =================================================================== (Binary files differ) Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.pyp 2007-12-11 15:09:41 UTC (rev 778) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.pyp 2007-12-11 16:20:06 UTC (rev 779) @@ -27,6 +27,8 @@ _me.set_param('string', _me.string('Startup')) _me.set_param('check', _me.string('Show')) _me.set_param('param', 'Startup') + _me.set_param('btnNo', False) + _me.set_param('btnYes', 'OK') _me.gui('dialog').show_from_main() thread.start_new_thread(self.update, ()) @@ -52,9 +54,12 @@ self.get_widget('spinDog').set_value(_me.get_param('Threshold')) print _me.get_param('dogBehavior') - if os.path.exists(_me.get_param('dogBehavior')): - print _me.get_param('dogBehavior') - self.get_widget('fileDogBehavior').set_filename(_me.get_param('dogBehavior')) + try: + if os.path.exists(_me.get_param('dogBehavior')): + print _me.get_param('dogBehavior') + self.get_widget('fileDogBehavior').set_filename(_me.get_param('dogBehavior')) + except: + pass self.get_widget('chkSpy').set_label(_me.string('at_gui_widget_chkSpy')) self.get_widget('chkSpy').set_active(_me.get_param('chkSpy')) @@ -109,12 +114,13 @@ self.measure.refresh_treeview = self.refresh_treeview self.graph.measure = self.measure - if os.path.exists(_me.get_param('Path')): - self.measure.capture_path = _me.get_param('Path') - else: - user = commands.getoutput('echo $USER') - self.measure.capture_path = '/home/%s'%user - _me.set_param('Path', 'home/%s'%user) + if _me.get_param('Path') != None: + if os.path.exists(_me.get_param('Path')): + self.measure.capture_path = _me.get_param('Path') + else: + user = commands.getoutput('echo $USER') + self.measure.capture_path = '/home/%s'%user + _me.set_param('Path', 'home/%s'%user) self.monitor_id = tux.monitoring.insert(0xF0, self.measure.on_sound_level) tux.micro.on() @@ -163,12 +169,8 @@ # Event functions # ########################################################### - def on_window1_destroy(self, widget, *args): - if _me.get_param('Standby') == False: - _me.set_param('string', _me.string('Standby')) - _me.set_param('check', _me.string('Show')) - _me.set_param('param', 'Standby') - _me.gui('dialog').show_from_main() + def on_window1_delete_event(self, widget, *args): + return True def on_cbbType_changed(self, widget, *args): if self.get_widget('cbbType').get_active() == 0: @@ -316,17 +318,17 @@ #and trace the curce self.context.set_line_width(0.6) self.context.set_source_rgb(0.9, 0.6,0) - self.context.move_to(self.rect.x - 2, self.rect.height / 2) - self.context.line_to(self.rect.x, self.rect.height - (self.measure.val_table_pos[0] * coeff_y)) + self.context.move_to(self.rect.x - 10, self.rect.height / 2) + self.context.line_to(self.rect.x, self.rect.height/2 - (self.measure.val_table_pos[0] * coeff_y)) for i, val in enumerate(self.measure.val_table_pos): self.context.line_to(self.rect.x + ((i) * coeff_x), self.rect.height - ((self.measure.RANGE/2 + val) * coeff_y)) - self.context.line_to(self.rect.x + ((i) * coeff_x), self.rect.height + 5) + self.context.line_to(self.rect.x + ((i) * coeff_x), self.rect.height/2 ) - self.context.move_to(self.rect.x - 2, self.rect.height / 2) - self.context.line_to(self.rect.x, self.rect.height - (self.measure.val_table_pos[0] * coeff_y)) + self.context.move_to(self.rect.x - 10, self.rect.height / 2) + self.context.line_to(self.rect.x, self.rect.height/2 - (self.measure.val_table_pos[0] * coeff_y)) for i, val in enumerate(self.measure.val_table_pos): self.context.line_to(self.rect.x + ((i) * coeff_x), self.rect.height - ((self.measure.RANGE/2 - val) * coeff_y)) - self.context.line_to(self.rect.x + ((i) * coeff_x), self.rect.height + 5) + self.context.line_to(self.rect.x + ((i) * coeff_x), self.rect.height/2) self.context.stroke() self.draw_events(coeff_x, coeff_y) @@ -348,7 +350,7 @@ def fill(self, coeff_x, coeff_y): #determine the coefficients to adjust the curve in the window space - self.context.move_to(self.rect.x - 2, self.rect.height / 2) + self.context.move_to(self.rect.x - 10, self.rect.height / 2) for i, val in enumerate(self.measure.val_table_pos): self.context.line_to(self.rect.x + ((i) * coeff_x), self.rect.height - ((self.measure.RANGE/2 + val) * coeff_y)) self.context.line_to(self.rect.x + ((i) * coeff_x), self.rect.height/2) @@ -356,7 +358,7 @@ self.context.set_source_rgba(0.9, 0.6, 0, 0.2) self.context.fill() - self.context.move_to(self.rect.x - 2, self.rect.height / 2) + self.context.move_to(self.rect.x - 10, self.rect.height / 2) for i, val in enumerate(self.measure.val_table_pos): self.context.line_to(self.rect.x + ((i) * coeff_x), self.rect.height - ((self.measure.RANGE/2 - val) * coeff_y)) self.context.line_to(self.rect.x + ((i) * coeff_x), self.rect.height/2) Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/main.pyp =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/main.pyp 2007-12-11 15:09:41 UTC (rev 778) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/main.pyp 2007-12-11 16:20:06 UTC (rev 779) @@ -2,23 +2,41 @@ import time def on_standby(): - gdg_dict = _me.get_param('dict') - for keys in gdg_dict: - gadgets[keys].notify.set_active(gdg_dict[keys]) - - gadgets['sound_monitor'].notify.set_active(False) - tux.micro.off() - tux.cmd.mouth_close() - tux.event.on_remote_bt[K_STANDBY] = None - tux.monitoring.remove(_me.get_param('monitor_id')) - tux.micro.on_buffer.disconnect(_me.get_param('buffer_idx')) + print 'standby function' + _me.set_param('stdby', True) + _me.set_param('string', _me.string('Standby')) + _me.set_param('check', _me.string('Show')) + _me.set_param('btnYes', _me.string('Yes')) + _me.set_param('btnNo', _me.string('No')) + _me.set_param('chkHide', True) + _me.set_param('param', 'Standby') + _me.gui('dialog').show_from_main() + + tux.sys.wait(1) + while _me.gui('dialog').showed(): + print 'while' tux.sys.wait(0.5) - - _me.gui('widget').hide_from_main() - _me.exit_main_loop() + if _me.get_param('return') == False: + print 'return = False' + _me.set_param('stdby', False) + return + #start_gadget() + else: + gdg_dict = _me.get_param('dict') + for keys in gdg_dict: + gadgets[keys].notify.set_active(gdg_dict[keys]) + + gadgets['sound_monitor'].notify.set_active(False) + tux.micro.off() + tux.cmd.mouth_close() + tux.event.on_remote_bt[K_STANDBY] = None + tux.monitoring.remove(_me.get_param('monitor_id')) + tux.micro.on_buffer.disconnect(_me.get_param('buffer_idx')) + _me.gui('widget').hide_from_main() + _me.exit_main_loop() def start_gadget(): gdg_dict = {} @@ -28,12 +46,14 @@ gadgets[Gdgname].notify.set_active(False) gadgets['sound_monitor'].notify.set_active(True) - + _me.set_param('stdby', False) tux.cmd.mouth_open() _me.set_param('dict', gdg_dict) tux.event.on_remote_bt[K_STANDBY] = on_standby _me.gui('widget').show_from_main() _me.run_main_loop() + +_me.insert_funct('on_standby', on_standby) start_gadget() Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Strings/fr_ALL.xml =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Strings/fr_ALL.xml 2007-12-11 15:09:41 UTC (rev 778) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Strings/fr_ALL.xml 2007-12-11 16:20:06 UTC (rev 779) @@ -1,6 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> <at_gui_widget_lblSpyLevel type='str'>Niveau</at_gui_widget_lblSpyLevel> + <No type='str'>Non</No> <at_gui_widget_chkDog type='str'>Activer le mode chien de garde</at_gui_widget_chkDog> <at_gui_conf_label13 type='str'>Delay (sec) :</at_gui_conf_label13> <at_gui_conf_label12 type='str'>Configuration</at_gui_conf_label12> @@ -11,8 +12,10 @@ <at_gui_widget_cbbDog type='str'>Chien de garde</at_gui_widget_cbbDog> <at_gui_conf_label6 type='str'>Cancel</at_gui_conf_label6> <at_gui_conf_label5 type='str'>Accept</at_gui_conf_label5> + <Settings type='str'>Configuration</Settings> <Standby type='str'>Ceci va mettre fin à l'exécution de ce gadget. Toutes les autres notifications vont être réactivées. -Plus aucun événement relatif au son seront notifiés.</Standby> +Plus aucun événement relatif au son seront notifiés. +Continuer ?</Standby> <at_gui_widget_chkDogDefault type='str'>Utiliser un script :</at_gui_widget_chkDogDefault> <at_gui_widget_lblDogLevel type='str'>Niveau</at_gui_widget_lblDogLevel> <Time type='str'>Heure</Time> @@ -20,11 +23,12 @@ <speaker_name type='str'>Bruno8k</speaker_name> <at_gui_widget_cbbRecord type='str'>Sons enregistrés</at_gui_widget_cbbRecord> <name_to_read type='str'>Moniteur de son</name_to_read> - <Show type='str'>Don't show this message again</Show> + <Show type='str'>Ne plus afficher ce message</Show> <Startup type='str'>Ce gadget a un système de notification exclusif. Tant que la fenêtre de ce gadget est ouverte, toutes les autres notifications sont désactivées.</Startup> <File type='str'>Fichier</File> <at_gui_widget_chkSpy type='str'>Activer le mode espion</at_gui_widget_chkSpy> <Duration type='str'>Durée</Duration> <lblSample type='str'>Nombre de points : </lblSample> + <Yes type='str'>Oui</Yes> <Location type='str'>Selectionner ou les sons doivent être sauvés.</Location> </strings> Modified: software/gadgets/sound_monitor/trunk/audio_monitor/about.xml =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/about.xml 2007-12-11 15:09:41 UTC (rev 778) +++ software/gadgets/sound_monitor/trunk/audio_monitor/about.xml 2007-12-11 16:20:06 UTC (rev 779) @@ -1,8 +1,8 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_name type='str'>sound_monitor</gadget_name> <gadget_author type='str'>Paul Rathgeb</gadget_author> - <gadget_version type='str'>0.0.1</gadget_version> - <gadget_name type='str'>sound_monitor</gadget_name> <gadget_description type='str'> </gadget_description> + <gadget_version type='str'>0.0.1</gadget_version> </about> Modified: software/gadgets/sound_monitor/trunk/audio_monitor/settings.xml =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/settings.xml 2007-12-11 15:09:41 UTC (rev 778) +++ software/gadgets/sound_monitor/trunk/audio_monitor/settings.xml 2007-12-11 16:20:06 UTC (rev 779) @@ -1,24 +1,21 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <dogBehavior type='str'> - </dogBehavior> - <Sample type='float'>400.0</Sample> + <chkDog type='bool'>True</chkDog> <chkDogBehavior type='bool'>False</chkDogBehavior> + <BehaviorPath type='NoneType'>None</BehaviorPath> <SpyThreshold type='int'>30</SpyThreshold> <Standby type='bool'>False</Standby> - <MainScript type='str'>None</MainScript> <chkSpy type='bool'>False</chkSpy> - <chkDog type='bool'>True</chkDog> - <Threshold type='float'>30.0</Threshold> - <chkSpyRecord type='bool'>False</chkSpyRecord> + <MainScript type='str'>None</MainScript> + <Sample type='float'>400.0</Sample> <chkDogDefault type='bool'>False</chkDogDefault> - <Path type='str'> - </Path> + <chkSpyRecord type='bool'>False</chkSpyRecord> + <Threshold type='float'>30.0</Threshold> + <Path type='str'>/tmp</Path> <DogThreshold type='int'>30</DogThreshold> <Startup type='bool'>False</Startup> - <BehaviorPath type='str'> - </BehaviorPath> + <dogBehavior type='NoneType'>None</dogBehavior> </parameters> <general> <have_settings_part type='bool'>True</have_settings_part> Modified: software/gadgets/sound_monitor/trunk/audio_monitor/strings.xml =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/strings.xml 2007-12-11 15:09:41 UTC (rev 778) +++ software/gadgets/sound_monitor/trunk/audio_monitor/strings.xml 2007-12-11 16:20:06 UTC (rev 779) @@ -1,6 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> <at_gui_widget_lblSpyLevel type='str'>Threshold level</at_gui_widget_lblSpyLevel> + <No type='str'>No</No> <at_gui_widget_chkDog type='str'>Enable guard dog mode</at_gui_widget_chkDog> <at_gui_conf_label13 type='str'>Delay (sec) :</at_gui_conf_label13> <at_gui_conf_label12 type='str'>Settings</at_gui_conf_label12> @@ -11,8 +12,10 @@ <at_gui_widget_cbbDog type='str'>Guard dog mode</at_gui_widget_cbbDog> <at_gui_conf_label6 type='str'>Cancel</at_gui_conf_label6> <at_gui_conf_label5 type='str'>Accept</at_gui_conf_label5> + <Settings type='str'>Settings</Settings> <Standby type='str'>This will stop the gadget execution, and restart all the other notifications. -No more sound events will be notified.</Standby> +No more sound events will be notified. +Proceed ?</Standby> <at_gui_widget_chkDogDefault type='str'>Use an external script</at_gui_widget_chkDogDefault> <at_gui_widget_lblDogLevel type='str'>Threshold level</at_gui_widget_lblDogLevel> <Time type='str'>Time</Time> @@ -26,5 +29,6 @@ <at_gui_widget_chkSpy type='str'>Enable spy mode</at_gui_widget_chkSpy> <Duration type='str'>Duration</Duration> <lblSample type='str'>Sample rate : </lblSample> + <Yes type='str'>Yes</Yes> <Location type='str'>Save recorded files to :</Location> </strings> Modified: software/gadgets/sound_monitor/trunk/audio_monitor.tgf =================================================================== (Binary files differ) |
From: jerome <c2m...@c2...> - 2007-12-11 15:09:42
|
Author: jerome Date: 2007-12-11 16:09:41 +0100 (Tue, 11 Dec 2007) New Revision: 778 Added: software/gadgets/rss_feeder/ software/gadgets/rss_feeder/branches/ software/gadgets/rss_feeder/tags/ software/gadgets/rss_feeder/trunk/ software/gadgets/rss_feeder/trunk/rss_feeder.tgf software/gadgets/rss_feeder/trunk/rss_feeder/ Log: * Non finished version of the RSS feeder. Added: software/gadgets/rss_feeder/trunk/rss_feeder.tgf =================================================================== (Binary files differ) Property changes on: software/gadgets/rss_feeder/trunk/rss_feeder.tgf ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream |
Author: Paul_R Date: 2007-12-11 15:31:54 +0100 (Tue, 11 Dec 2007) New Revision: 777 Modified: software/gadgets/tux_controller/trunk/TuxController.tgf software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.glade software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.pyp software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/main.pyp software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml software/gadgets/tux_controller/trunk/TuxController/about.xml software/gadgets/tux_controller/trunk/TuxController/settings.xml software/gadgets/tux_controller/trunk/TuxController/strings.xml Log: * Conf GUI : - Removed the notification part * Widget GUI : - Added tooltips (only in french for now ...) - Added the TTS config Modified: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.glade =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.glade 2007-12-11 10:02:08 UTC (rev 776) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.glade 2007-12-11 14:31:54 UTC (rev 777) @@ -4,7 +4,7 @@ <glade-interface> <widget class="GtkWindow" id="window1"> - <property name="height_request">159</property> + <property name="height_request">102</property> <property name="visible">True</property> <property name="title" translatable="yes">Parameters</property> <property name="type">GTK_WINDOW_TOPLEVEL</property> @@ -129,110 +129,6 @@ </child> <child> - <widget class="GtkFrame" id="frame5"> - <property name="border_width">5</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="alignment8"> - <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="fixed6"> - <property name="visible">True</property> - - <child> - <widget class="GtkSpinButton" id="delay_spinbutton"> - <property name="width_request">120</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">False</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">1 1 3600 1 10 10</property> - </widget> - <packing> - <property name="x">88</property> - <property name="y">0</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label13"> - <property name="width_request">336</property> - <property name="height_request">16</property> - <property name="visible">True</property> - <property name="label" translatable="yes">Delay (sec) :</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">0</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> - - <child> - <widget class="GtkLabel" id="label12"> - <property name="visible">True</property> - <property name="label" translatable="yes"><b>Updates</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="GtkFixed" id="fixed3"> <property name="visible">True</property> Modified: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.pyp 2007-12-11 10:02:08 UTC (rev 776) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.pyp 2007-12-11 14:31:54 UTC (rev 777) @@ -37,16 +37,6 @@ txt = _me.string('gui_conf_remote_set_bt') self.get_widget("button_remote").set_label(txt) - # Update Frame - txt = _me.string('gui_conf_update_title') - self.get_widget("label12").set_text(txt) - - txt = "%s : " % _me.string('gui_conf_delay_lb') - self.get_widget("label13").set_text(txt) - - value = _me.get_var('notify_delay') - self.get_widget("delay_spinbutton").set_value(value) - # Bottom buttons txt = _me.string('gui_conf_cancel_bt') self.get_widget("label6").set_text(txt) @@ -76,7 +66,6 @@ """ On button 'accept' clicked """ - _me.set_var('notify_delay', int(self.get_widget("delay_spinbutton").get_value())) self.get_widget("window1").destroy() def on_cancel_clicked(self, widget, *args): Modified: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade 2007-12-11 10:02:08 UTC (rev 776) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade 2007-12-11 14:31:54 UTC (rev 777) @@ -53,7 +53,7 @@ <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">checkbutton1</property> + <property name="label" translatable="yes"> </property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">False</property> @@ -176,7 +176,7 @@ </child> </widget> <packing> - <property name="x">4</property> + <property name="x">0</property> <property name="y">24</property> </packing> </child> @@ -260,7 +260,7 @@ </child> </widget> <packing> - <property name="x">37</property> + <property name="x">26</property> <property name="y">24</property> </packing> </child> @@ -706,32 +706,6 @@ </child> <child> - <widget class="GtkLabel" id="lblLED"> - <property name="width_request">16</property> - <property name="height_request">51</property> - <property name="visible">True</property> - <property name="label" translatable="yes">label20</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</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">True</property> - <property name="angle">90</property> - </widget> - <packing> - <property name="x">9</property> - <property name="y">3</property> - </packing> - </child> - - <child> <widget class="GtkButton" id="btnLEDRun"> <property name="width_request">36</property> <property name="height_request">36</property> @@ -845,6 +819,32 @@ <property name="y">4</property> </packing> </child> + + <child> + <widget class="GtkLabel" id="lblLED"> + <property name="width_request">16</property> + <property name="height_request">51</property> + <property name="visible">True</property> + <property name="label" translatable="yes"> </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</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">True</property> + <property name="angle">90</property> + </widget> + <packing> + <property name="x">9</property> + <property name="y">3</property> + </packing> + </child> </widget> <packing> <property name="left_attach">1</property> @@ -905,32 +905,6 @@ </child> <child> - <widget class="GtkLabel" id="lblEyes"> - <property name="width_request">16</property> - <property name="height_request">73</property> - <property name="visible">True</property> - <property name="label" translatable="yes">label20</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</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">True</property> - <property name="angle">90</property> - </widget> - <packing> - <property name="x">9</property> - <property name="y">3</property> - </packing> - </child> - - <child> <widget class="GtkButton" id="btnEyesRun"> <property name="width_request">36</property> <property name="height_request">36</property> @@ -1012,6 +986,32 @@ <property name="y">22</property> </packing> </child> + + <child> + <widget class="GtkLabel" id="lblEyes"> + <property name="width_request">16</property> + <property name="height_request">73</property> + <property name="visible">True</property> + <property name="label" translatable="yes"> </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</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">True</property> + <property name="angle">90</property> + </widget> + <packing> + <property name="x">9</property> + <property name="y">3</property> + </packing> + </child> </widget> <packing> <property name="left_attach">1</property> @@ -1160,7 +1160,7 @@ <property name="width_request">16</property> <property name="height_request">56</property> <property name="visible">True</property> - <property name="label" translatable="yes">label20</property> + <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_CENTER</property> @@ -1348,7 +1348,7 @@ <property name="width_request">16</property> <property name="height_request">135</property> <property name="visible">True</property> - <property name="label" translatable="yes">label20</property> + <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_CENTER</property> @@ -1508,47 +1508,6 @@ </child> <child> - <widget class="GtkRadioButton" id="radSpinDirRight"> - <property name="width_request">136</property> - <property name="height_request">22</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">radiobutton2</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="x">204</property> - <property name="y">58</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radSpinDirLeft"> - <property name="width_request">136</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">radiobutton1</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <property name="group">radSpinDirRight</property> - </widget> - <packing> - <property name="x">60</property> - <property name="y">58</property> - </packing> - </child> - - <child> <widget class="GtkVSeparator" id="vseparator17"> <property name="width_request">16</property> <property name="height_request">77</property> @@ -1577,7 +1536,7 @@ <property name="width_request">16</property> <property name="height_request">77</property> <property name="visible">True</property> - <property name="label" translatable="yes">label20</property> + <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_CENTER</property> @@ -1597,6 +1556,47 @@ <property name="y">3</property> </packing> </child> + + <child> + <widget class="GtkRadioButton" id="radSpinDirLeft"> + <property name="width_request">136</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes"> </property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">60</property> + <property name="y">58</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radSpinDirRight"> + <property name="width_request">136</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes"> </property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radSpinDirLeft</property> + </widget> + <packing> + <property name="x">204</property> + <property name="y">58</property> + </packing> + </child> </widget> <packing> <property name="left_attach">1</property> @@ -2050,24 +2050,60 @@ <child> <widget class="GtkExpander" id="expander1"> <property name="visible">True</property> - <property name="can_focus">True</property> <property name="expanded">False</property> <property name="spacing">0</property> <child> <widget class="GtkFixed" id="fixednotuse6"> - <property name="height_request">139</property> + <property name="height_request">140</property> <property name="visible">True</property> <child> + <widget class="GtkButton" id="btnTTSClear"> + <property name="width_request">90</property> + <property name="height_request">28</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">button2</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_btnTTSClear_clicked" last_modification_time="Thu, 06 Dec 2007 15:25:30 GMT"/> + </widget> + <packing> + <property name="x">128</property> + <property name="y">109</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnTTS"> + <property name="width_request">90</property> + <property name="height_request">28</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">button1</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_btnTTS_clicked" last_modification_time="Thu, 06 Dec 2007 15:12:18 GMT"/> + </widget> + <packing> + <property name="x">24</property> + <property name="y">109</property> + </packing> + </child> + + <child> <widget class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="border_width">2</property> <property name="width_request">376</property> <property name="height_request">104</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="shadow_type">GTK_SHADOW_ETCHED_IN</property> <property name="window_placement">GTK_CORNER_TOP_LEFT</property> <child> @@ -2097,49 +2133,13 @@ <property name="y">0</property> </packing> </child> - - <child> - <widget class="GtkButton" id="btnTTSClear"> - <property name="width_request">90</property> - <property name="height_request">28</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">button2</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_btnTTSClear_clicked" last_modification_time="Thu, 06 Dec 2007 15:25:30 GMT"/> - </widget> - <packing> - <property name="x">128</property> - <property name="y">109</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="btnTTS"> - <property name="width_request">90</property> - <property name="height_request">28</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">button1</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_btnTTS_clicked" last_modification_time="Thu, 06 Dec 2007 15:12:18 GMT"/> - </widget> - <packing> - <property name="x">24</property> - <property name="y">109</property> - </packing> - </child> </widget> </child> <child> <widget class="GtkLabel" id="lblTTS"> <property name="visible">True</property> - <property name="label" translatable="yes">label17</property> + <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -2173,6 +2173,82 @@ <property name="visible">True</property> <child> + <widget class="GtkVSeparator" id="vseparator20"> + <property name="width_request">16</property> + <property name="height_request">94</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">3</property> + </packing> + </child> + + <child> + <widget class="GtkVSeparator" id="vseparator21"> + <property name="width_request">16</property> + <property name="height_request">94</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">20</property> + <property name="y">3</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lblConf"> + <property name="width_request">16</property> + <property name="height_request">94</property> + <property name="visible">True</property> + <property name="label" translatable="yes"> </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</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">True</property> + <property name="angle">90</property> + </widget> + <packing> + <property name="x">9</property> + <property name="y">3</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lblStop"> + <property name="width_request">233</property> + <property name="height_request">21</property> + <property name="visible">True</property> + <property name="label" translatable="yes"> </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">75</property> + <property name="y">40</property> + </packing> + </child> + + <child> <widget class="GtkButton" id="btnStopAll"> <property name="width_request">36</property> <property name="height_request">36</property> @@ -2254,66 +2330,92 @@ <property name="y">32</property> </packing> </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + <child> + <widget class="GtkFixed" id="fix7"> + <property name="visible">True</property> + <child> - <widget class="GtkLabel" id="lblStop"> - <property name="width_request">233</property> - <property name="height_request">21</property> + <widget class="GtkVSeparator" id="vseparator22"> + <property name="width_request">16</property> + <property name="height_request">134</property> <property name="visible">True</property> - <property name="label" translatable="yes">label19</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">75</property> - <property name="y">40</property> + <property name="x">0</property> + <property name="y">23</property> </packing> </child> <child> - <widget class="GtkVSeparator" id="vseparator20"> + <widget class="GtkVSeparator" id="vseparator23"> <property name="width_request">16</property> - <property name="height_request">94</property> + <property name="height_request">134</property> <property name="visible">True</property> </widget> <packing> - <property name="x">0</property> - <property name="y">3</property> + <property name="x">20</property> + <property name="y">23</property> </packing> </child> <child> - <widget class="GtkVSeparator" id="vseparator21"> - <property name="width_request">16</property> - <property name="height_request">94</property> + <widget class="GtkSpinButton" id="spinPitch"> + <property name="width_request">55</property> + <property name="height_request">27</property> <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">100 100 330 1 10 10</property> + <signal name="changed" handler="on_spinPitch_changed" last_modification_time="Tue, 11 Dec 2007 12:18:41 GMT"/> </widget> <packing> - <property name="x">20</property> - <property name="y">3</property> + <property name="x">216</property> + <property name="y">103</property> </packing> </child> <child> - <widget class="GtkLabel" id="lblConf"> + <widget class="GtkComboBoxEntry" id="comboboxentry1"> + <property name="width_request">216</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="items" translatable="yes"> </property> + <property name="add_tearoffs">False</property> + <property name="has_frame">True</property> + <property name="focus_on_click">True</property> + <signal name="changed" handler="on_comboboxentry1_changed" last_modification_time="Tue, 11 Dec 2007 12:01:54 GMT"/> + </widget> + <packing> + <property name="x">56</property> + <property name="y">59</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lblTTSConf"> <property name="width_request">16</property> - <property name="height_request">94</property> + <property name="height_request">134</property> <property name="visible">True</property> - <property name="label" translatable="yes">label20</property> + <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> <property name="wrap">False</property> <property name="selectable">False</property> <property name="xalign">0.5</property> @@ -2327,15 +2429,41 @@ </widget> <packing> <property name="x">9</property> - <property name="y">3</property> + <property name="y">23</property> </packing> </child> + + <child> + <widget class="GtkLabel" id="lblPitch"> + <property name="width_request">152</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="label" translatable="yes"> </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">56</property> + <property name="y">103</property> + </packing> + </child> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">5</property> - <property name="bottom_attach">6</property> + <property name="top_attach">6</property> + <property name="bottom_attach">7</property> <property name="x_options">fill</property> <property name="y_options">fill</property> </packing> Modified: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp 2007-12-11 10:02:08 UTC (rev 776) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp 2007-12-11 14:31:54 UTC (rev 777) @@ -1,7 +1,12 @@ bindtextdomain("params", "") +try: + import voice_cb +except: + print sys.exc_info() + __led_toggled_by_event = False -__led_restart = False + class Window(SimpleGladeApp): def __init__(self, @@ -17,17 +22,15 @@ #################################################################### def new(self): - self.get_widget("window1").set_title(_me.string('name_to_read')) - thread.start_new_thread(self.update, ()) global __led_toggled_by_event - __led_toggled_by_event = False + __led_toggled_by_event = False + + self.get_widget("window1").set_title(_me.string('name_to_read')) + self.create_tooltips() + thread.start_new_thread(self.update,()) + self.average = 0 self.count = 0 - self.__lled = tux.status.rled - self.__rled = tux.status.lled - self.__eyes_mutex = threading.Lock() - self.__mouth_mutex = threading.Lock() - self.__wings_mutex = threading.Lock() rules = [ [['none', 'none', 'Eyes'], self.on_btnEyesRun_clicked, (None,)], @@ -41,15 +44,28 @@ _me.voice_recognition.set_rules(rules) def update(self): + _me.set_var('pitch', _me.get_param('pitch')) + _me.set_var('speaker', _me.get_param('speaker')) + + self.cb_voice = voice_cb.VoiceComboBoxAdd(tux, self.get_widget("comboboxentry1")) + self.cb_voice.set_spk(_me.get_var('speaker')) + self.get_widget('spinPitch').set_value(_me.get_param('pitch')) + + self.cb_voice.update() + self.cb_voice.set_spk(_me.get_param('speaker')) + self.update_labels() self.update_pix() + + + tux.cmd.raw(0x31, 0, 0, 0) self.update_status() self.binding() + tux.sys.wait(1) - #self.status_table() def on_window1_destroy(self, widget, *args): ''' @@ -107,9 +123,9 @@ tux.event.on_remote_bt[K_STOP] = self.StopAll + self.battery_idx = tux.monitoring.insert(0x25, self.on_battery_level) + self.light_idx = tux.monitoring.insert(0x1B, self.on_light_level) - self.light_idx = tux.monitoring.insert(0x1B, self.on_light_level) - self.battery_idx = tux.monitoring.insert(0x25, self.on_battery_level) tux.micro.on() self.sound_idx = tux.monitoring.insert(0xF0, self.on_microphone_energy) tux.sys.wait(0.1) @@ -133,40 +149,14 @@ __led_toggled_by_event = False def update_pix(self): - ''' - It's necessary to update the pictures. - The first step is to determine the path where the pictures are stored. - To do this, the instruction _me.get_path('pictures') return the path - of the 'picture' folder of the TGF. - ''' self.path = _me.get_path('pictures')+'/Icons/' - ### Update the buttons icons self.get_widget('chkShow').set_active(True) self.get_widget('chkShow').set_label(_me.string('chkShow')) - self.get_widget('imgLEDRun').set_from_file(self.path+'run.png') - #self.get_widget('imgLEDRun').set_tooltip_text('test 123') - self.get_widget('imgEyesOpen').set_from_file(self.path+'up.png') - self.get_widget('imgEyesClose').set_from_file(self.path+'down.png') - self.get_widget('imgEyesRun').set_from_file(self.path+'run.png') - - self.get_widget('imgMouthClose').set_from_file(self.path+'up.png') - self.get_widget('imgMouthOpen').set_from_file(self.path+'down.png') - self.get_widget('imgMouthRun').set_from_file(self.path+'run.png') - - self.get_widget('imgWingsUp').set_from_file(self.path+'up.png') - self.get_widget('imgWingsDown').set_from_file(self.path+'down.png') - self.get_widget('imgWingsRun').set_from_file(self.path+'run.png') - - self.get_widget('imgSpinLeft').set_from_file(self.path+'left.png') - self.get_widget('imgSpinRight').set_from_file(self.path+'right.png') - self.get_widget('imgSpinRun').set_from_file(self.path+'run.png') - self.get_widget('imgLight').set_from_file(self.path+'light.png') self.get_widget('imgBattery').set_from_file(self.path+'battery.png') self.get_widget('imgSound').set_from_file(self.path+'microphone.png') - ### Load image in pixbufs self.led_on = gtk.gdk.pixbuf_new_from_file(self.path+'led_on.png') self.led_off = gtk.gdk.pixbuf_new_from_file(self.path+'led_off.png') self.eyes_close = gtk.gdk.pixbuf_new_from_file(self.path+'eye_closed.png') @@ -177,17 +167,36 @@ self.spin_off = gtk.gdk.pixbuf_new_from_file(self.path+'spin_off.png') self.beak_open = gtk.gdk.pixbuf_new_from_file(self.path+'beak_open.png') self.beak_closed = gtk.gdk.pixbuf_new_from_file(self.path+'beak_closed.png') + self.up = gtk.gdk.pixbuf_new_from_file(self.path+'up.png') + self.down = gtk.gdk.pixbuf_new_from_file(self.path+'down.png') + self.right = gtk.gdk.pixbuf_new_from_file(self.path+'right.png') + self.left = gtk.gdk.pixbuf_new_from_file(self.path+'left.png') + self.run = gtk.gdk.pixbuf_new_from_file(self.path+'run.png') + self.get_widget('imgLEDRun').set_from_pixbuf(self.run) + + self.get_widget('imgEyesOpen').set_from_pixbuf(self.up) + self.get_widget('imgEyesClose').set_from_pixbuf(self.down) + self.get_widget('imgEyesRun').set_from_pixbuf(self.run) + + self.get_widget('imgMouthClose').set_from_pixbuf(self.up) + self.get_widget('imgMouthOpen').set_from_pixbuf(self.down) + self.get_widget('imgMouthRun').set_from_pixbuf(self.run) + + self.get_widget('imgWingsUp').set_from_pixbuf(self.up) + self.get_widget('imgWingsDown').set_from_pixbuf(self.down) + self.get_widget('imgWingsRun').set_from_pixbuf(self.run) + + self.get_widget('imgSpinLeft').set_from_pixbuf(self.left) + self.get_widget('imgSpinRight').set_from_pixbuf(self.right) + self.get_widget('imgSpinRun').set_from_pixbuf(self.run) self.show_tab() - ### Update the Tux pictures if tux.status.rled(): self.get_widget('imgLed').set_from_pixbuf(self.led_on) else: self.get_widget('imgLed').set_from_pixbuf(self.led_off) - - if tux.status.eyes_closed() == 0: self.get_widget('imgLed').set_from_pixbuf(self.eyes_close) @@ -200,13 +209,58 @@ self.get_widget('imgSpin').set_from_pixbuf(self.spin_off) - - def on_chkShow_toggled(self, widget, *args): - if widget.get_active(): - self.show_tab() - else: - self.hide_tab() - + def create_tooltips(self): + self.get_widget('imgLEDRun').set_tooltip_text(_me.string('toolLEDRun')) + self.get_widget('slideLED').set_tooltip_text(_me.string('toolLEDslide')) + self.get_widget('spinLED').set_tooltip_text(_me.string('toolLEDspin')) + + self.get_widget('imgEyesRun').set_tooltip_text(_me.string('toolEyesRun')) + self.get_widget('spinEyes').set_tooltip_text(_me.string('toolMove')) + + self.get_widget('imgMouthRun').set_tooltip_text(_me.string('toolMouthRun')) + self.get_widget('spinMouth').set_tooltip_text(_me.string('toolMove')) + + self.get_widget('imgWingsRun').set_tooltip_text(_me.string('toolWingsRun')) + self.get_widget('spinWings').set_tooltip_text(_me.string('toolMove')) + self.get_widget('slideWings').set_tooltip_text(_me.string('toolPWM')) + + self.get_widget('imgSpinRun').set_tooltip_text(_me.string('toolSpinRun')) + self.get_widget('spinSpin').set_tooltip_text(_me.string('toolMove')) + self.get_widget('slideSpin').set_tooltip_text(_me.string('toolPWM')) + self.get_widget('radSpinDirLeft').set_tooltip_text(_me.string('toolSpinDir')) + self.get_widget('radSpinDirRight').set_tooltip_text(_me.string('toolSpinDir')) + + self.get_widget('imgStopAll').set_tooltip_text(_me.string('toolStopAll')) + + self.get_widget('chkShow').set_tooltip_text(_me.string('toolAdvanced')) + + self.get_widget('chkLEDRight').set_tooltip_text(_me.string('toolLEDRight')) + self.get_widget('chkLEDLeft').set_tooltip_text(_me.string('toolLEDLeft')) + + self.get_widget('btnEyesOpen').set_tooltip_text(_me.string('toolEyesOpen')) + self.get_widget('btnEyesClose').set_tooltip_text(_me.string('toolEyesClose')) + + self.get_widget('btnMouthOpen').set_tooltip_text(_me.string('toolMouthOpen')) + self.get_widget('btnMouthClose').set_tooltip_text(_me.string('toolMouthClose')) + + self.get_widget('btnWingsUp').set_tooltip_text(_me.string('toolWingsUp')) + self.get_widget('btnWingsDown').set_tooltip_text(_me.string('toolWingsDown')) + + self.get_widget('btnSpinRight').set_tooltip_text(_me.string('toolSpinRight')) + self.get_widget('btnSpinLeft').set_tooltip_text(_me.string('toolSpinLeft')) + + self.get_widget('imgLight').set_tooltip_text(_me.string('toolLight')) + self.get_widget('imgBattery').set_tooltip_text(_me.string('toolBattery')) + self.get_widget('imgSound').set_tooltip_text(_me.string('toolSound')) + + self.get_widget('comboboxentry1').set_tooltip_text(_me.string('toolLang')) + self.get_widget('spinPitch').set_tooltip_text(_me.string('toolPitch')) + + self.get_widget('btnTTS').set_tooltip_text(_me.string('toolTTS')) + self.get_widget('btnTTSClear').set_tooltip_text(_me.string('toolTTSClear')) + self.get_widget('scrolledwindow1').set_tooltip_text(_me.string('toolTTSText')) + + def hide_tab(self): self.get_widget('fix1').hide() self.get_widget('fix1').set_size_request(2,0) @@ -220,6 +274,8 @@ self.get_widget('fix5').set_size_request(2,0) self.get_widget('fix6').hide() self.get_widget('fix6').set_size_request(2,0) + self.get_widget('fix7').hide() + self.get_widget('fix7').set_size_request(2,0) def show_tab(self): self.get_widget('fix1').show() @@ -234,18 +290,12 @@ self.get_widget('fix5').set_size_request(330,0) self.get_widget('fix6').show() self.get_widget('fix6').set_size_request(330,0) + self.get_widget('fix7').show() + self.get_widget('fix7').set_size_request(330,0) + def update_labels(self): - ''' - Update the GUI labels. - - To enable the gadget to be translated, all the strings are configured on the - Tux Gadget Maker strings section. - - To load a string, just use _me.get_string('my_string') - ''' - ## Update the radio button labels self.get_widget('btnTTS').set_label(_me.string('TTS')) self.get_widget('btnTTSClear').set_label(_me.string('TTSClear')) @@ -259,15 +309,14 @@ self.get_widget('lblWings').set_label(_me.string('lblWings')) self.get_widget('lblSpin').set_label(_me.string('lblSpin')) self.get_widget('lblConf').set_label(_me.string('lblConf')) + self.get_widget('lblTTSConf').set_label(_me.string('lblTTSConf')) + self.get_widget('lblPitch').set_label(_me.string('lblPitch')) self.get_widget('radSpinDirLeft').set_label(_me.string('radSpinDirLeft')) self.get_widget('radSpinDirRight').set_label(_me.string('radSpinDirRight')) - - #self.get_widget('lblBatteryL').set_text(_me.string('lblBatteryL')) - #self.get_widget('lblSoundL').set_text(_me.string('lblSoundL')) - #self.get_widget('lblLightL').set_text(_me.string('lblLightL')) + #################################################################### # # Widget items events @@ -276,26 +325,65 @@ # signals. # #################################################################### + def set_spk(self, speaker): + self.cb_voice.set_spk(speaker) + + def on_comboboxentry1_changed(self, widget, *args): + + spk_id, skp_lang = self.cb_voice.get_current_spk_conf() + tux.tts.select_voice(spk_id, self.get_widget('spinPitch').get_value()) + _me.set_param('speaker', spk_id) + _me.set_param('pitch', self.get_widget('spinPitch').get_value()) + _me.set_var('speaker', spk_id) + _me.set_var('pitch', self.get_widget('spinPitch').get_value()) + + + def on_spinPitch_changed(self, widget, *args): + + spk_id, skp_lang = self.cb_voice.get_current_spk_conf() + tux.tts.select_voice(spk_id, widget.get_value()) + _me.set_param('speaker', spk_id) + _me.set_param('pitch', widget.get_value()) + _me.set_var('speaker', spk_id) + _me.set_var('pitch', self.get_widget('spinPitch').get_value()) + + def StopAll(self): - self.on_btnStopAll_clicked(None) + thread.start_new_thread(self.__stop_all, ()) - def on_btnStopAll_clicked(self, widget, *args): - tux.cmd.eyes_off() - tux.cmd.mouth_off() - tux.cmd.wings_off() + def on_chkShow_toggled(self, widget, *args): + if widget.get_active(): + self.show_tab() + else: + self.hide_tab() + + def __stop_all(self): + if tux.status.eyes_motor(): + tux.cmd.eyes_off() + tux.sys.wait(0.2) + tux.cmd.eyes_close() + tux.cmd.eyes_open() + + if tux.status.mouth_motor(): + tux.cmd.mouth_off() + tux.cmd.mouth_open() + tux.sys.wait(0.2) + tux.cmd.mouth_close() + + if tux.status.wings_motor(): + tux.cmd.wings_off() + tux.sys.wait(0.2) + tux.cmd.raw(0x31, 0, 0, 0) + self.get_widget('imgWings').set_from_pixbuf(self.wings_down) + tux.cmd.spinl_off() tux.cmd.spinr_off() - tux.sys.wait(0.2) - tux.cmd.eyes_close() - tux.cmd.raw(0x3A, 0, 0, 0) - tux.cmd.mouth_close() - tux.cmd.eyes_open() + def on_btnStopAll_clicked(self, widget, *args): + thread.start_new_thread(self.__stop_all, ()) - - ## btnLEDrun def on_btnLEDRun_clicked(self, widget, *args): freq = self.get_widget('slideLED').get_value() Modified: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/main.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/main.pyp 2007-12-11 10:02:08 UTC (rev 776) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/main.pyp 2007-12-11 14:31:54 UTC (rev 777) @@ -5,6 +5,12 @@ import time def on_standby(): + tux.cmd.eyes_close() + tux.cmd.raw(0x31, 0, 0, 0) + tux.cmd.eyes_open() + tux.cmd.mouth_close() + + tux.event.on_remote_bt[K_STANDBY] = None _me.gui('widget').hide_from_main() _me.exit_main_loop() Modified: software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml 2007-12-11 10:02:08 UTC (rev 776) +++ software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml 2007-12-11 14:31:54 UTC (rev 777) @@ -1,9 +1,11 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> - <vr_Panel type='str'>Panneau</vr_Panel> - <gui_conf_remote_title type='str'>Télécommande</gui_conf_remote_title> + <toolWingsUp type='str'>Lever les ailes</toolWingsUp> + <toolMove type='str'>Nombre de mouvements</toolMove> <chkShow type='str'>Commandes avancées</chkShow> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <toolTTSText type='str'>Entrer le texte ici</toolTTSText> + <lblPitch type='str'>Hauteur du son : </lblPitch> <lblStop type='str'>Arrêter tous les mouvements</lblStop> <radSpinDirRight type='str'>A droite</radSpinDirRight> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> @@ -13,37 +15,73 @@ <vr_Wings type='str'>Ailes</vr_Wings> <tabControl type='str'>Contrôle</tabControl> <vr_Show type='str'>Afficher</vr_Show> + <lblTTSConf type='str'>Configuration TTS</lblTTSConf> + <toolLEDspin type='str'>Réglage du nombre de clignotement.</toolLEDspin> + <gui_conf_remote_title type='str'>Télécommande</gui_conf_remote_title> + <toolTTSClear type='str'>Effacer la zone de texte</toolTTSClear> + <toolLEDRight type='str'>Allumer/Eteindre la LED droite</toolLEDRight> + <toolMouthRun type='str'>Ce bouton actionne le bec +en utilisant les paramètres définis.</toolMouthRun> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> + <lblConf type='str'>Divers</lblConf> <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> - <lblConf type='str'>Divers</lblConf> + <vr_Panel type='str'>Panneau</vr_Panel> <TTS type='str'>Lire</TTS> + <toolEyesClose type='str'>Fermer les yeux</toolEyesClose> + <toolLEDLeft type='str'>Allumer/Eteindre la LED gauche</toolLEDLeft> <gui_conf_delay_lb type='str'>Délai (sec)</gui_conf_delay_lb> <lblTTS type='str'>TTS</lblTTS> <gui_conf_about_title type='str'>A propos</gui_conf_about_title> <lblBatteryL type='str'>Niveau des batteries</lblBatteryL> + <toolTTS type='str'>Dire la phrase</toolTTS> <radSpinDirLeft type='str'>A gauche</radSpinDirLeft> - <tabStatus type='str'>Statuts</tabStatus> - <lblMouth type='str'>Bec</lblMouth> + <toolStopAll type='str'>Ce bouton arrête tous les mouvements.</toolStopAll> + <lblWings type='str'>Ailes</lblWings> + <toolMouthClose type='str'>Fermer le bec</toolMouthClose> <Count type='str'>mouv.</Count> <vr_Flash type='str'>Flash</vr_Flash> + <TTSClear type='str'>Effacer</TTSClear> + <toolWingsDown type='str'>Baisser les ailes</toolWingsDown> + <toolLEDslide type='str'>Vous pouvez régler ici la fréquence de +clignotement des LEDs</toolLEDslide> + <toolSpinRun type='str'>Ce bouton fait tourner Tux en +utilisant les paramètres définis.</toolSpinRun> + <toolPWM type='str'>Réglage de la vitesse</toolPWM> <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> <lblSoundL type='str'>Niveau de son</lblSoundL> + <toolLEDRun type='str'>Ce bouton fait clignoter les LEDs +en utilisant les paramêtres définis.</toolLEDRun> + <toolWingsRun type='str'>Ce bouton fait bouger les ailes +en utilisant les paramètres définis.</toolWingsRun> <colValue type='str'>Valeur</colValue> <lblSpin type='str'>Rotation</lblSpin> - <lblWings type='str'>Ailes</lblWings> + <tabStatus type='str'>Statuts</tabStatus> + <toolMouthOpen type='str'>Ouvrir le bec</toolMouthOpen> <speaker_name type='str'>Bruno8k</speaker_name> <vr_Hide type='str'>Cacher</vr_Hide> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <toolSound type='str'>Niveau sonore</toolSound> + <toolLight type='str'>Niveau de lumière</toolLight> <vr_Eyes type='str'>Yeux</vr_Eyes> - <name_to_read type='str'>Commande de Tux</name_to_read> + <name_to_read type='str'>Commande du robot</name_to_read> <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> - <TTSClear type='str'>Effacer</TTSClear> + <toolEyesOpen type='str'>Ouvrir les yeux</toolEyesOpen> + <toolBattery type='str'>Niveau de la batterie</toolBattery> <lblLightL type='str'>Niveau de lumière</lblLightL> + <toolSpinRight type='str'>Tourner vers la droite</toolSpinRight> <lblEyes type='str'>Yeux</lblEyes> + <lblMouth type='str'>Bec</lblMouth> <Second type='str'>sec.</Second> <vr_Mouth type='str'>Bouche</vr_Mouth> <colStatus type='str'>Statut</colStatus> <vr_Leds type='str'>Leds</vr_Leds> + <toolSpinLeft type='str'>Tourner vers la gauche</toolSpinLeft> + <toolSpinDir type='str'>Choix du sens de rotation</toolSpinDir> + <toolEyesRun type='str'>Ce bouton fait actionne les yeux +en utilisant les paramêtres définis.</toolEyesRun> + <toolPitch type='str'>Configurer la hauteur du son</toolPitch> + <toolAdvanced type='str'>Monter/Cacher les propriété avancées</toolAdvanced> + <toolLang type='str'>Configurer la langue TTS</toolLang> </strings> Modified: software/gadgets/tux_controller/trunk/TuxController/about.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/about.xml 2007-12-11 10:02:08 UTC (rev 776) +++ software/gadgets/tux_controller/trunk/TuxController/about.xml 2007-12-11 14:31:54 UTC (rev 777) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> - <gadget_name type='str'>tux_controller</gadget_name> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_version type='str'>0.0.1</gadget_version> <gadget_description type='str'>Empty gadget for Tux Droid.</gadget_description> - <gadget_version type='str'>0.0.1</gadget_version> + <gadget_name type='str'>tux_controller</gadget_name> </about> Modified: software/gadgets/tux_controller/trunk/TuxController/settings.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/settings.xml 2007-12-11 10:02:08 UTC (rev 776) +++ software/gadgets/tux_controller/trunk/TuxController/settings.xml 2007-12-11 14:31:54 UTC (rev 777) @@ -2,6 +2,8 @@ <settings> <parameters> <hidden_in_manager type='bool'>False</hidden_in_manager> + <speaker type='int'>3</speaker> + <pitch type='int'>100</pitch> </parameters> <general> <have_settings_part type='bool'>True</have_settings_part> @@ -21,7 +23,7 @@ <framework_version type='str'>0.0.0</framework_version> <menu_active type='bool'>True</menu_active> <have_widget_part type='bool'>False</have_widget_part> - <speaker type='int'>4</speaker> + <speaker type='int'>3</speaker> <pitch type='int'>100</pitch> <have_main_part type='bool'>True</have_main_part> <main_priority type='int'>4</main_priority> Modified: software/gadgets/tux_controller/trunk/TuxController/strings.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/strings.xml 2007-12-11 10:02:08 UTC (rev 776) +++ software/gadgets/tux_controller/trunk/TuxController/strings.xml 2007-12-11 14:31:54 UTC (rev 777) @@ -1,9 +1,11 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> - <lblLightL type='str'>Light level</lblLightL> - <gui_conf_remote_title type='str'>Remote</gui_conf_remote_title> + <toolWingsUp type='str'>Lever les ailes</toolWingsUp> + <toolMove type='str'>Nombre de mouvements</toolMove> <chkShow type='str'>Advanced view</chkShow> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <toolTTSText type='str'>Entrer le texte ici</toolTTSText> + <lblPitch type='str'>Pitch : </lblPitch> <lblStop type='str'>Stop all movements</lblStop> <radSpinDirRight type='str'>Spin right</radSpinDirRight> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> @@ -13,37 +15,73 @@ <vr_Wings type='str'>Wings</vr_Wings> <tabControl type='str'>Control</tabControl> <vr_Show type='str'>Show</vr_Show> + <lblTTSConf type='str'>TTS configuration</lblTTSConf> + <toolLEDspin type='str'>Réglage du nombre de clignotement.</toolLEDspin> + <gui_conf_remote_title type='str'>Remote</gui_conf_remote_title> + <toolTTSClear type='str'>Effacer la zone de texte</toolTTSClear> + <toolLEDRight type='str'>Allumer/Eteindre la LED droite</toolLEDRight> + <toolMouthRun type='str'>Ce bouton actionne le bec +en utilisant les paramètres définis.</toolMouthRun> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Update</gui_conf_update_title> - <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> <lblConf type='str'>Misc</lblConf> + <vr_Eyes type='str'>Eyes</vr_Eyes> + <vr_Panel type='str'>Panel</vr_Panel> <TTS type='str'>Play</TTS> + <toolEyesClose type='str'>Fermer les yeux</toolEyesClose> + <toolLEDLeft type='str'>Allumer/Eteindre la LED gauche</toolLEDLeft> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <lblTTS type='str'>TTS</lblTTS> <gui_conf_about_title type='str'>About</gui_conf_about_title> <lblBatteryL type='str'>Battery level</lblBatteryL> + <toolTTS type='str'>Dire la phrase</toolTTS> <radSpinDirLeft type='str'>Spin left</radSpinDirLeft> - <tabStatus type='str'>Status</tabStatus> - <speaker_name type='str'>Ryan8k</speaker_name> + <toolStopAll type='str'>Ce bouton arrête tous les mouvements.</toolStopAll> + <lblWings type='str'>WIngs</lblWings> + <toolMouthClose type='str'>Fermer le bec</toolMouthClose> + <toolBattery type='str'>Niveau de la batterie</toolBattery> <Count type='str'>count</Count> <vr_Flash type='str'>Flash</vr_Flash> - <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <toolWingsDown type='str'>Baisser les ailes</toolWingsDown> + <toolLEDslide type='str'>Vous pouvez régler ici la fréquence de +clignotement des LEDs</toolLEDslide> + <toolSpinRun type='str'>Ce bouton fait tourner Tux en +utilisant les paramètres définis.</toolSpinRun> + <toolPWM type='str'>Réglage de la vitesse</toolPWM> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> <gui_conf_author_lb type='str'>Author</gui_conf_aut... [truncated message content] |
From: Paul_R <c2m...@c2...> - 2007-12-11 10:02:18
|
Author: Paul_R Date: 2007-12-11 11:02:08 +0100 (Tue, 11 Dec 2007) New Revision: 776 Added: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/battery.png software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/eye_closed.png software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/light.png software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/microphone.png Modified: software/gadgets/tux_controller/trunk/TuxController.tgf software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml software/gadgets/tux_controller/trunk/TuxController/about.xml software/gadgets/tux_controller/trunk/TuxController/settings.xml software/gadgets/tux_controller/trunk/TuxController/strings.xml Log: * Changed the GUI : - Changed the arrow buttons position - Added labels in the advanced section - Moved the TTS part - Added battery, light and sound icons Added: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/battery.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/battery.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/eye_closed.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/eye_closed.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/light.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/light.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/microphone.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/microphone.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade 2007-12-11 08:34:02 UTC (rev 775) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade 2007-12-11 10:02:08 UTC (rev 776) @@ -36,7 +36,7 @@ <widget class="GtkTable" id="table1"> <property name="border_width">2</property> <property name="visible">True</property> - <property name="n_rows">6</property> + <property name="n_rows">7</property> <property name="n_columns">2</property> <property name="homogeneous">False</property> <property name="row_spacing">0</property> @@ -64,7 +64,7 @@ </widget> <packing> <property name="x">8</property> - <property name="y">27</property> + <property name="y">15</property> </packing> </child> </widget> @@ -92,161 +92,24 @@ <property name="ypad">0</property> </widget> <packing> - <property name="x">0</property> + <property name="x">40</property> <property name="y">0</property> </packing> </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">4</property> - <property name="bottom_attach">5</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - <child> - <widget class="GtkFixed" id="fixed24"> - <property name="visible">True</property> - <child> - <widget class="GtkImage" id="imgWings"> - <property name="width_request">367</property> - <property name="height_request">142</property> + <widget class="GtkButton" id="btnSpinLeft"> + <property name="width_request">34</property> + <property name="height_request">34</property> <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">0</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed23"> - <property name="visible">True</property> - - <child> - <widget class="GtkImage" id="imgMouth"> - <property name="width_request">367</property> - <property name="height_request">62</property> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">0</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fixed22"> - <property name="visible">True</property> - - <child> - <widget class="GtkImage" id="imgEyes"> - <property name="width_request">367</property> - <property name="height_request">79</property> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="x">0</property> - <property name="y">16</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fix1"> - <property name="height_request">21</property> - <property name="visible">True</property> - - <child> - <widget class="GtkSpinButton" id="spinLED"> - <property name="width_request">70</property> - <property name="height_request">27</property> - <property name="visible">True</property> <property name="can_focus">True</property> - <property name="has_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">False</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">1 0 255 1 10 10</property> - </widget> - <packing> - <property name="x">120</property> - <property name="y">20</property> - </packing> - </child> - - <child> - <widget class="GtkVSeparator" id="vseparator19"> - <property name="width_request">16</property> - <property name="height_request">50</property> - <property name="visible">True</property> - </widget> - <packing> - <property name="x">68</property> - <property name="y">4</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="btnLEDRun"> - <property name="width_request">36</property> - <property name="height_request">36</property> - <property name="visible">True</property> - <property name="can_focus">True</property> <property name="relief">GTK_RELIEF_NONE</property> <property name="focus_on_click">False</property> - <signal name="clicked" handler="on_btnLEDRun_clicked" last_modification_time="Thu, 15 Nov 2007 10:50:39 GMT"/> + <signal name="pressed" handler="on_btnSpinLeft_pressed" last_modification_time="Wed, 14 Nov 2007 15:46:35 GMT"/> + <signal name="released" handler="on_btnSpinLeft_released" last_modification_time="Wed, 14 Nov 2007 15:46:38 GMT"/> <child> - <widget class="GtkAlignment" id="alignment16"> + <widget class="GtkAlignment" id="alignment9"> <property name="visible">True</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -258,17 +121,17 @@ <property name="right_padding">0</property> <child> - <widget class="GtkHBox" id="hbox16"> + <widget class="GtkHBox" id="hbox9"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">2</property> <child> - <widget class="GtkImage" id="imgLEDRun"> + <widget class="GtkImage" id="imgSpinLeft"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-refresh</property> + <property name="stock">gtk-go-back</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -283,7 +146,7 @@ </child> <child> - <widget class="GtkLabel" id="label16"> + <widget class="GtkLabel" id="label9"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> @@ -313,142 +176,24 @@ </child> </widget> <packing> - <property name="x">80</property> - <property name="y">16</property> + <property name="x">4</property> + <property name="y">24</property> </packing> </child> <child> - <widget class="GtkVSeparator" id="vseparator18"> - <property name="width_request">16</property> - <property name="height_request">50</property> + <widget class="GtkButton" id="btnSpinRight"> + <property name="width_request">34</property> + <property name="height_request">34</property> <property name="visible">True</property> - </widget> - <packing> - <property name="x">65</property> - <property name="y">4</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chkLEDRight"> - <property name="width_request">20</property> - <property name="height_request">20</property> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">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> - <signal name="toggled" handler="on_chkLEDRight_toggled" last_modification_time="Thu, 15 Nov 2007 10:15:35 GMT"/> - </widget> - <packing> - <property name="x">8</property> - <property name="y">25</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chkLEDLeft"> - <property name="width_request">20</property> - <property name="height_request">20</property> - <property name="visible">True</property> - <property name="label" translatable="yes"> -</property> - <property name="use_underline">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> - <signal name="toggled" handler="on_chkLEDLeft_toggled" last_modification_time="Thu, 15 Nov 2007 10:15:58 GMT"/> - </widget> - <packing> - <property name="x">40</property> - <property name="y">25</property> - </packing> - </child> - - <child> - <widget class="GtkHScale" id="slideLED"> - <property name="width_request">160</property> - <property name="height_request">32</property> - <property name="visible">True</property> <property name="can_focus">True</property> - <property name="draw_value">True</property> - <property name="value_pos">GTK_POS_RIGHT</property> - <property name="digits">0</property> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="inverted">False</property> - <property name="adjustment">150 1 255 1 0 0</property> - <signal name="value_changed" handler="on_slideLED_value_changed" last_modification_time="Thu, 15 Nov 2007 08:37:21 GMT"/> - </widget> - <packing> - <property name="x">208</property> - <property name="y">17</property> - </packing> - </child> - </widget> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">0</property> - <property name="bottom_attach">1</property> - <property name="y_options">fill</property> - </packing> - </child> - - <child> - <widget class="GtkFixed" id="fix2"> - <property name="height_request">79</property> - <property name="visible">True</property> - - <child> - <widget class="GtkSpinButton" id="spinEyes"> - <property name="width_request">70</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">False</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">1 0 255 1 10 10</property> - </widget> - <packing> - <property name="x">120</property> - <property name="y">38</property> - </packing> - </child> - - <child> - <widget class="GtkVSeparator" id="vseparator10"> - <property name="width_request">16</property> - <property name="height_request">82</property> - <property name="visible">True</property> - </widget> - <packing> - <property name="x">65</property> - <property name="y">6</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="btnEyesRun"> - <property name="width_request">36</property> - <property name="height_request">36</property> - <property name="visible">True</property> - <property name="can_focus">True</property> <property name="relief">GTK_RELIEF_NONE</property> <property name="focus_on_click">False</property> - <signal name="clicked" handler="on_btnEyesRun_clicked" last_modification_time="Thu, 15 Nov 2007 08:32:08 GMT"/> + <signal name="pressed" handler="on_btnSpinRight_pressed" last_modification_time="Wed, 14 Nov 2007 15:46:46 GMT"/> + <signal name="released" handler="on_btnSpinRight_released" last_modification_time="Wed, 14 Nov 2007 15:46:50 GMT"/> <child> - <widget class="GtkAlignment" id="alignment11"> + <widget class="GtkAlignment" id="alignment8"> <property name="visible">True</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -460,17 +205,17 @@ <property name="right_padding">0</property> <child> - <widget class="GtkHBox" id="hbox11"> + <widget class="GtkHBox" id="hbox8"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">2</property> <child> - <widget class="GtkImage" id="imgEyesRun"> + <widget class="GtkImage" id="imgSpinRight"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-refresh</property> + <property name="stock">gtk-go-forward</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -485,7 +230,7 @@ </child> <child> - <widget class="GtkLabel" id="label11"> + <widget class="GtkLabel" id="label8"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> @@ -515,35 +260,37 @@ </child> </widget> <packing> - <property name="x">80</property> - <property name="y">34</property> + <property name="x">37</property> + <property name="y">24</property> </packing> </child> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> - <child> - <widget class="GtkVSeparator" id="vseparator11"> - <property name="width_request">16</property> - <property name="height_request">82</property> - <property name="visible">True</property> - </widget> - <packing> - <property name="x">68</property> - <property name="y">6</property> - </packing> - </child> + <child> + <widget class="GtkFixed" id="fixed24"> + <property name="visible">True</property> <child> - <widget class="GtkButton" id="btnEyesOpen"> + <widget class="GtkButton" id="btnWingsDown"> <property name="width_request">34</property> <property name="height_request">34</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="relief">GTK_RELIEF_NONE</property> <property name="focus_on_click">False</property> - <signal name="clicked" handler="on_btnEyesOpen_released" last_modification_time="Thu, 06 Dec 2007 14:42:38 GMT"/> + <signal name="clicked" handler="on_btnWingsDown_released" last_modification_time="Thu, 06 Dec 2007 14:43:04 GMT"/> <child> - <widget class="GtkAlignment" id="alignment1"> + <widget class="GtkAlignment" id="alignment7"> <property name="visible">True</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -555,17 +302,17 @@ <property name="right_padding">0</property> <child> - <widget class="GtkHBox" id="hbox1"> + <widget class="GtkHBox" id="hbox7"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">2</property> <child> - <widget class="GtkImage" id="imgEyesOpen"> + <widget class="GtkImage" id="imgWingsDown"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-up</property> + <property name="stock">gtk-go-down</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -580,7 +327,7 @@ </child> <child> - <widget class="GtkLabel" id="label1"> + <widget class="GtkLabel" id="label7"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> @@ -611,22 +358,22 @@ </widget> <packing> <property name="x">16</property> - <property name="y">18</property> + <property name="y">56</property> </packing> </child> <child> - <widget class="GtkButton" id="btnEyesClose"> + <widget class="GtkButton" id="btnWingsUp"> <property name="width_request">34</property> <property name="height_request">34</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="relief">GTK_RELIEF_NONE</property> <property name="focus_on_click">False</property> - <signal name="clicked" handler="on_btnEyesClose_released" last_modification_time="Thu, 06 Dec 2007 14:29:18 GMT"/> + <signal name="clicked" handler="on_btnWingsUp_released" last_modification_time="Thu, 06 Dec 2007 14:42:55 GMT"/> <child> - <widget class="GtkAlignment" id="alignment3"> + <widget class="GtkAlignment" id="alignment6"> <property name="visible">True</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -638,17 +385,17 @@ <property name="right_padding">0</property> <child> - <widget class="GtkHBox" id="hbox3"> + <widget class="GtkHBox" id="hbox6"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">2</property> <child> - <widget class="GtkImage" id="imgEyesClose"> + <widget class="GtkImage" id="imgWingsUp"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-down</property> + <property name="stock">gtk-go-up</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -663,7 +410,7 @@ </child> <child> - <widget class="GtkLabel" id="label3"> + <widget class="GtkLabel" id="label6"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> @@ -694,81 +441,52 @@ </widget> <packing> <property name="x">16</property> - <property name="y">51</property> + <property name="y">24</property> </packing> </child> + + <child> + <widget class="GtkImage" id="imgWings"> + <property name="width_request">367</property> + <property name="height_request">142</property> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="x">40</property> + <property name="y">0</property> + </packing> + </child> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> <property name="x_options">fill</property> <property name="y_options">fill</property> </packing> </child> <child> - <widget class="GtkFixed" id="fix3"> - <property name="height_request">62</property> + <widget class="GtkFixed" id="fixed23"> <property name="visible">True</property> <child> - <widget class="GtkSpinButton" id="spinMouth"> - <property name="width_request">70</property> - <property name="height_request">27</property> + <widget class="GtkButton" id="btnMouthOpen"> + <property name="width_request">34</property> + <property name="height_request">34</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">False</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">False</property> - <property name="adjustment">1 0 255 1 10 10</property> - </widget> - <packing> - <property name="x">120</property> - <property name="y">12</property> - </packing> - </child> - - <child> - <widget class="GtkVSeparator" id="vseparator12"> - <property name="width_request">16</property> - <property name="height_request">50</property> - <property name="visible">True</property> - </widget> - <packing> - <property name="x">65</property> - <property name="y">3</property> - </packing> - </child> - - <child> - <widget class="GtkVSeparator" id="vseparator13"> - <property name="width_request">16</property> - <property name="height_request">50</property> - <property name="visible">True</property> - </widget> - <packing> - <property name="x">68</property> - <property name="y">3</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="btnMouthRun"> - <property name="width_request">36</property> - <property name="height_request">36</property> - <property name="visible">True</property> - <property name="can_focus">True</property> <property name="relief">GTK_RELIEF_NONE</property> <property name="focus_on_click">False</property> - <signal name="clicked" handler="on_btnMouthRun_clicked" last_modification_time="Thu, 15 Nov 2007 08:32:13 GMT"/> + <signal name="clicked" handler="on_btnMouthOpen_released" last_modification_time="Thu, 06 Dec 2007 14:29:34 GMT"/> <child> - <widget class="GtkAlignment" id="alignment13"> + <widget class="GtkAlignment" id="alignment5"> <property name="visible">True</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -780,17 +498,17 @@ <property name="right_padding">0</property> <child> - <widget class="GtkHBox" id="hbox13"> + <widget class="GtkHBox" id="hbox5"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">2</property> <child> - <widget class="GtkImage" id="imgMouthRun"> + <widget class="GtkImage" id="imgMouthOpen"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-refresh</property> + <property name="stock">gtk-go-down</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -805,7 +523,7 @@ </child> <child> - <widget class="GtkLabel" id="label13"> + <widget class="GtkLabel" id="label5"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> @@ -835,8 +553,8 @@ </child> </widget> <packing> - <property name="x">80</property> - <property name="y">10</property> + <property name="x">16</property> + <property name="y">28</property> </packing> </child> @@ -924,91 +642,24 @@ </child> <child> - <widget class="GtkButton" id="btnMouthOpen"> - <property name="width_request">34</property> - <property name="height_request">34</property> + <widget class="GtkImage" id="imgMouth"> + <property name="width_request">367</property> + <property name="height_request">62</property> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NONE</property> - <property name="focus_on_click">False</property> - <signal name="clicked" handler="on_btnMouthOpen_released" last_modification_time="Thu, 06 Dec 2007 14:29:34 GMT"/> - - <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">0</property> - <property name="yscale">0</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</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">2</property> - - <child> - <widget class="GtkImage" id="imgMouthOpen"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_focus">True</property> - <property name="stock">gtk-go-down</property> - <property name="icon_size">4</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label5"> - <property name="visible">True</property> - <property name="label" translatable="yes"> -</property> - <property name="use_underline">True</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="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> - </widget> - </child> - </widget> - </child> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> </widget> <packing> - <property name="x">16</property> - <property name="y">31</property> + <property name="x">40</property> + <property name="y">0</property> </packing> </child> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> + <property name="left_attach">0</property> + <property name="right_attach">1</property> <property name="top_attach">2</property> <property name="bottom_attach">3</property> <property name="x_options">fill</property> @@ -1017,16 +668,17 @@ </child> <child> - <widget class="GtkFixed" id="fix4"> - <property name="height_request">142</property> + <widget class="GtkFixed" id="fix1"> + <property name="height_request">21</property> <property name="visible">True</property> <child> - <widget class="GtkSpinButton" id="spinWings"> + <widget class="GtkSpinButton" id="spinLED"> <property name="width_request">70</property> <property name="height_request">27</property> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="has_focus">True</property> <property name="climb_rate">1</property> <property name="digits">0</property> <property name="numeric">False</property> @@ -1036,23 +688,61 @@ <property name="adjustment">1 0 255 1 10 10</property> </widget> <packing> - <property name="x">120</property> - <property name="y">56</property> + <property name="x">70</property> + <property name="y">16</property> </packing> </child> <child> - <widget class="GtkButton" id="btnWingsRun"> + <widget class="GtkVSeparator" id="vseparator19"> + <property name="width_request">16</property> + <property name="height_request">50</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">20</property> + <property name="y">4</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lblLED"> + <property name="width_request">16</property> + <property name="height_request">51</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label20</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</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">True</property> + <property name="angle">90</property> + </widget> + <packing> + <property name="x">9</property> + <property name="y">3</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnLEDRun"> <property name="width_request">36</property> <property name="height_request">36</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="relief">GTK_RELIEF_NONE</property> <property name="focus_on_click">False</property> - <signal name="clicked" handler="on_btnWingsRun_clicked" last_modification_time="Thu, 15 Nov 2007 08:32:18 GMT"/> + <signal name="clicked" handler="on_btnLEDRun_clicked" last_modification_time="Thu, 15 Nov 2007 10:50:39 GMT"/> <child> - <widget class="GtkAlignment" id="alignment14"> + <widget class="GtkAlignment" id="alignment16"> <property name="visible">True</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -1064,13 +754,13 @@ <property name="right_padding">0</property> <child> - <widget class="GtkHBox" id="hbox14"> + <widget class="GtkHBox" id="hbox16"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">2</property> <child> - <widget class="GtkImage" id="imgWingsRun"> + <widget class="GtkImage" id="imgLEDRun"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> @@ -1089,7 +779,7 @@ </child> <child> - <widget class="GtkLabel" id="label14"> + <widget class="GtkLabel" id="label16"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> @@ -1119,13 +809,13 @@ </child> </widget> <packing> - <property name="x">80</property> - <property name="y">54</property> + <property name="x">30</property> + <property name="y">12</property> </packing> </child> <child> - <widget class="GtkHScale" id="slideWings"> + <widget class="GtkHScale" id="slideLED"> <property name="width_request">160</property> <property name="height_request">32</property> <property name="visible">True</property> @@ -1135,51 +825,123 @@ <property name="digits">0</property> <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> <property name="inverted">False</property> - <property name="adjustment">5 1 5 1 0 0</property> - <signal name="value_changed" handler="on_slideWings_value_changed" last_modification_time="Thu, 15 Nov 2007 08:42:15 GMT"/> + <property name="adjustment">150 1 255 1 0 0</property> + <signal name="value_changed" handler="on_slideLED_value_changed" last_modification_time="Thu, 15 Nov 2007 08:37:21 GMT"/> </widget> <packing> - <property name="x">208</property> - <property name="y">53</property> + <property name="x">160</property> + <property name="y">13</property> </packing> </child> <child> - <widget class="GtkVSeparator" id="vseparator14"> + <widget class="GtkVSeparator" id="vseparator18"> <property name="width_request">16</property> - <property name="height_request">131</property> + <property name="height_request">50</property> <property name="visible">True</property> </widget> <packing> - <property name="x">65</property> - <property name="y">7</property> + <property name="x">0</property> + <property name="y">4</property> </packing> </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options">fill</property> + </packing> + </child> + <child> + <widget class="GtkFixed" id="fix2"> + <property name="height_request">79</property> + <property name="visible">True</property> + <child> - <widget class="GtkVSeparator" id="vseparator15"> + <widget class="GtkSpinButton" id="spinEyes"> + <property name="width_request">70</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">1 0 255 1 10 10</property> + </widget> + <packing> + <property name="x">72</property> + <property name="y">26</property> + </packing> + </child> + + <child> + <widget class="GtkVSeparator" id="vseparator11"> <property name="width_request">16</property> - <property name="height_request">131</property> + <property name="height_request">73</property> <property name="visible">True</property> </widget> <packing> - <property name="x">68</property> - <property name="y">7</property> + <property name="x">20</property> + <property name="y">3</property> </packing> </child> <child> - <widget class="GtkButton" id="btnWingsUp"> - <property name="width_request">34</property> - <property name="height_request">34</property> + <widget class="GtkVSeparator" id="vseparator10"> + <property name="width_request">16</property> + <property name="height_request">73</property> <property name="visible">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">3</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lblEyes"> + <property name="width_request">16</property> + <property name="height_request">73</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label20</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</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">True</property> + <property name="angle">90</property> + </widget> + <packing> + <property name="x">9</property> + <property name="y">3</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnEyesRun"> + <property name="width_request">36</property> + <property name="height_request">36</property> + <property name="visible">True</property> <property name="can_focus">True</property> <property name="relief">GTK_RELIEF_NONE</property> <property name="focus_on_click">False</property> - <signal name="clicked" handler="on_btnWingsUp_released" last_modification_time="Thu, 06 Dec 2007 14:42:55 GMT"/> + <signal name="clicked" handler="on_btnEyesRun_clicked" last_modification_time="Thu, 15 Nov 2007 08:32:08 GMT"/> <child> - <widget class="GtkAlignment" id="alignment6"> + <widget class="GtkAlignment" id="alignment11"> <property name="visible">True</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -1191,17 +953,17 @@ <property name="right_padding">0</property> <child> - <widget class="GtkHBox" id="hbox6"> + <widget class="GtkHBox" id="hbox11"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">2</property> <child> - <widget class="GtkImage" id="imgWingsUp"> + <widget class="GtkImage" id="imgEyesRun"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-up</property> + <property name="stock">gtk-refresh</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -1216,7 +978,7 @@ </child> <child> - <widget class="GtkLabel" id="label6"> + <widget class="GtkLabel" id="label11"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> @@ -1246,23 +1008,58 @@ </child> </widget> <packing> - <property name="x">16</property> - <property name="y">40</property> + <property name="x">30</property> + <property name="y">22</property> </packing> </child> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + <child> + <widget class="GtkFixed" id="fix3"> + <property name="height_request">62</property> + <property name="visible">True</property> + <child> - <widget class="GtkButton" id="btnWingsDown"> - <property name="width_request">34</property> - <property name="height_request">34</property> + <widget class="GtkSpinButton" id="spinMouth"> + <property name="width_request">70</property> + <property name="height_request">27</property> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">1 0 255 1 10 10</property> + </widget> + <packing> + <property name="x">70</property> + <property name="y">18</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnMouthRun"> + <property name="width_request">36</property> + <property name="height_request">36</property> + <property name="visible">True</property> + <property name="can_focus">True</property> <property name="relief">GTK_RELIEF_NONE</property> <property name="focus_on_click">False</property> - <signal name="clicked" handler="on_btnWingsDown_released" last_modification_time="Thu, 06 Dec 2007 14:43:04 GMT"/> + <signal name="clicked" handler="on_btnMouthRun_clicked" last_modification_time="Thu, 15 Nov 2007 08:32:13 GMT"/> <child> - <widget class="GtkAlignment" id="alignment7"> + <widget class="GtkAlignment" id="alignment13"> <property name="visible">True</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -1274,17 +1071,17 @@ <property name="right_padding">0</property> <child> - <widget class="GtkHBox" id="hbox7"> + <widget class="GtkHBox" id="hbox13"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">2</property> <child> - <widget class="GtkImage" id="imgWingsDown"> + <widget class="GtkImage" id="imgMouthRun"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-down</property> + <property name="stock">gtk-refresh</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -1299,7 +1096,7 @@ </child> <child> - <widget class="GtkLabel" id="label7"> + <widget class="GtkLabel" id="label13"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> @@ -1329,28 +1126,78 @@ </child> </widget> <packing> - <property name="x">16</property> - <property name="y">72</property> + <property name="x">30</property> + <property name="y">13</property> </packing> </child> + + <child> + <widget class="GtkVSeparator" id="vseparator12"> + <property name="width_request">16</property> + <property name="height_request">56</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">3</property> + </packing> + </child> + + <child> + <widget class="GtkVSeparator" id="vseparator13"> + <property name="width_request">16</property> + <property name="height_request">56</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">20</property> + <property name="y">3</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lblMouth"> + <property name="width_request">16</property> + <property name="height_request">56</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label20</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</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">True</property> + <property name="angle">90</property> + </widget> + <packing> + <property name="x">9</property> + <property name="y">3</property> + </packing> + </child> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> <property name="x_options">fill</property> <property name="y_options">fill</property> </packing> </child> <child> - <widget class="GtkFixed" id="fix5"> - <property name="height_request">83</property> + <widget class="GtkFixed" id="fix4"> + <property name="height_request">142</property> <property name="visible">True</property> <child> - <widget class="GtkSpinButton" id="spinSpin"> + <widget class="GtkSpinButton" id="spinWings"> <property name="width_request">70</property> <property name="height_request">27</property> <property name="visible">True</property> @@ -1364,56 +1211,23 @@ <property name="adjustment">1 0 255 1 10 10</property> </widget> <packing> - <property name="x">120</property> - <property name="y">18</property> + <property name="x">70</property> + <property name="y">58</property> </packing> </child> <child> - <widget class="GtkVSeparator" id="vseparator16"> - <property name="width_request">16</property> - <property name="height_request">70</property> + <widget class="GtkButton" id="btnWingsRun"> + <property name="width_request">36</property> + <property name="height_request">36</property> <property name="visible">True</property> - </widget> - <packing> - <property name="x">65</property> - <property name="y">7</property> - </packing> - </child> - - <child> - <widget class="GtkRadioButton" id="radSpinDirLeft"> - <property name="width_request">136</property> - <property name="height_request">24</property> - <property name="visible">True</property> <property name="can_focus">True</property> - <property name="label" translatable="yes">radiobutton1</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="x">120</property> - <property name="y">56</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="btnSpinLeft"> - <property name="width_request">34</property> - <property name="height_request">34</property> - <property name="visible">True</property> - <property name="can_focus">True</property> <property name="relief">GTK_RELIEF_NONE</property> <property name="focus_on_click">False</property> - <signal name="pressed" handler="on_btnSpinLeft_pressed" last_modification_time="Wed, 14 Nov 2007 15:46:35 GMT"/> - <signal name="released" handler="on_btnSpinLeft_released" last_modification_time="Wed, 14 Nov 2007 15:46:38 GMT"/> + <signal name="clicked" handler="on_btnWingsRun_clicked" last_modification_time="Thu, 15 Nov 2007 08:32:18 GMT"/> <child> - <widget class="GtkAlignment" id="alignment9"> + <widget class="GtkAlignment" id="alignment14"> <property name="visible">True</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -1425,17 +1239,17 @@ <property name="right_padding">0</property> <child> - <widget class="GtkHBox" id="hbox9"> + <widget class="GtkHBox" id="hbox14"> <property name="visible">True</property> <property name="homogeneous">False</property> <property name="spacing">2</property> <child> - <widget class="GtkImage" id="imgSpinLeft"> + <widget class="GtkImage" id="imgWingsRun"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-back</property> + <property name="stock">gtk-refresh</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -1450,7 +1264,7 @@ </child> <child> - <widget class="GtkLabel" id="label9"> + <widget class="GtkLabel" id="label14"> <property name="visible">True</property> <property name="label" translatable="yes"> </property> @@ -1480,92 +1294,113 @@ </child> </widget> <packing> - <property name="x">0</property> - <property name="y">27</property> + <property name="x">30</property> + <property name="y">54</property> </packing> </child> <child> - <widget class="GtkButton" id="btnSpinRight"> - <property name="width_request">34</property> - <property name="height_request">34</property> + <widget class="GtkHScale" id="slideWings"> + <property name="width_request">160</property> + <property name="height_request">32</property> <property name="visible">True</property> <property name="can_focus">True</property> - <property name="relief">GTK_RELIEF_NONE</property> - <property name="focus_on_click">False</property> - <signal name="pressed" handler="on_btnSpinRight_pressed" last_modification_time="Wed, 14 Nov 2007 15:46:46 GMT"/> - <signal name="released" handler="on_btnSpinRight_released" last_modification_time="Wed, 14 Nov 2007 15:46:50 GMT"/> + <property name="draw_value">True</property> + <property name="value_pos">GTK_POS_RIGHT</property> + <property name="digits">0</property> + <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> + <property name="inverted">False</property> + <property name="adjustment">5 1 5 1 0 0</property> + <signal name="value_changed" handler="on_slideWings_value_changed" last_modification_time="Thu, 15 Nov 2007 08:42:15 GMT"/> + </widget> + <packing> + <property name="x">160</property> + <property name="y">55</property> + </packing> + </child> - <child> - <widget class="GtkAlignment" id="alignment8"> - <property name="visible">True</property> - <property name="xalign">0.5</property> - <property name="yalign">0.5</property> - <property name="xscale">0</property> - <property name="yscale">0</property> - <property name="top_padding">0</property> - <property name="bottom_padding">0</property> - <property name="left_padding">0</property> - <property name="right_padding">0</property> + <child> + <widget class="GtkVSeparator" id="vseparator15"> + <property name="width_request">16</property> + <property name="height_request">136</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">20</property> + <property name="y">3</property> + </packing> + </child> - <child> - <widget class="GtkHBox" id="hbox8"> - <property name="visible">True</property> - <property name="homogeneous">False</property> - <property name="spacing">2</property> + <child> + <widget class="GtkVSeparator" id="vseparator14"> + <property name="width_request">16</property> + <property name="height_request">136</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">3</property> + </packing> + </child> - <child> - <widget class="GtkImage" id="imgSpinRight"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="has_focus">True</property> - <property name="stock">gtk-go-forward</property> - <property name="icon_size">4</property> - <property name="xalign">0</property> - <property name="yalign">0</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - </widget> - <packing> - <property name="padding">0</property> - <property name="expand">False</property> - <property name="fill">False</property> - </packing> - </child> + <child> + <widget class="GtkLabel" id="lblWings"> + <property name="width_request">16</property> + <property name="height_request">135</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label20</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</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">True</property> + <property name="angle">90</property> + </widget> + <packing> + <property name="x">9</property> + <property name="y">3</property> ... [truncated message content] |
From: jerome <c2m...@c2...> - 2007-12-11 08:34:08
|
Author: jerome Date: 2007-12-11 09:34:02 +0100 (Tue, 11 Dec 2007) New Revision: 775 Added: software/gadgets/alarm/trunk/alarm.tgf software/gadgets/alarm/trunk/alarm/ software/gadgets/amarok_player/trunk/amarok_player.tgf software/gadgets/amarok_player/trunk/amarok_player/ software/gadgets/audacious_player/trunk/audacious_player.tgf software/gadgets/audacious_player/trunk/audacious_player/ software/gadgets/calculator/trunk/Calculator.tgf software/gadgets/calculator/trunk/Calculator/ software/gadgets/firmware_updater/trunk/firmware_updater.tgf software/gadgets/firmware_updater/trunk/firmware_updater/ software/gadgets/gmail/trunk/gmail.tgf software/gadgets/gmail/trunk/gmail/ software/gadgets/totem_player/trunk/totem_player.tgf software/gadgets/totem_player/trunk/totem_player/ software/gadgets/xmms_player/trunk/xmms_player.tgf software/gadgets/xmms_player/trunk/xmms_player/ Log: *resolved some bug to be complitly compatible with the beta release Added: software/gadgets/alarm/trunk/alarm.tgf =================================================================== (Binary files differ) Property changes on: software/gadgets/alarm/trunk/alarm.tgf ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/gadgets/amarok_player/trunk/amarok_player.tgf =================================================================== (Binary files differ) Property changes on: software/gadgets/amarok_player/trunk/amarok_player.tgf ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/gadgets/audacious_player/trunk/audacious_player.tgf =================================================================== (Binary files differ) Property changes on: software/gadgets/audacious_player/trunk/audacious_player.tgf ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/gadgets/calculator/trunk/Calculator.tgf =================================================================== (Binary files differ) Property changes on: software/gadgets/calculator/trunk/Calculator.tgf ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/gadgets/firmware_updater/trunk/firmware_updater.tgf =================================================================== (Binary files differ) Property changes on: software/gadgets/firmware_updater/trunk/firmware_updater.tgf ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/gadgets/gmail/trunk/gmail.tgf =================================================================== (Binary files differ) Property changes on: software/gadgets/gmail/trunk/gmail.tgf ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/gadgets/totem_player/trunk/totem_player.tgf =================================================================== (Binary files differ) Property changes on: software/gadgets/totem_player/trunk/totem_player.tgf ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/gadgets/xmms_player/trunk/xmms_player.tgf =================================================================== (Binary files differ) Property changes on: software/gadgets/xmms_player/trunk/xmms_player.tgf ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream |
From: Paul_R <c2m...@c2...> - 2007-12-10 14:11:19
|
Author: Paul_R Date: 2007-12-10 15:11:11 +0100 (Mon, 10 Dec 2007) New Revision: 774 Added: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.glade software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.pyp Modified: software/gadgets/sound_monitor/trunk/audio_monitor.tgf software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/conf/other.glade software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.pyp software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/main.pyp software/gadgets/sound_monitor/trunk/audio_monitor/Strings/fr_ALL.xml software/gadgets/sound_monitor/trunk/audio_monitor/about.xml software/gadgets/sound_monitor/trunk/audio_monitor/settings.xml software/gadgets/sound_monitor/trunk/audio_monitor/strings.xml Log: * Added popup when the gadget start and stop * Changed some strings * Change the graduation in the graph * Minor changes in the conf GUI Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/conf/other.glade =================================================================== (Binary files differ) Added: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.glade =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.glade (rev 0) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.glade 2007-12-10 14:11:11 UTC (rev 774) @@ -0,0 +1,117 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkDialog" id="window1"> + <property name="visible">True</property> + <property name="title" translatable="yes">dialog1</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="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_DIALOG</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + <property name="has_separator">True</property> + <signal name="destroy" handler="on_window1_destroy" last_modification_time="Mon, 10 Dec 2007 10:54:18 GMT"/> + + <child internal-child="vbox"> + <widget class="GtkVBox" id="dialog-vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child internal-child="action_area"> + <widget class="GtkHButtonBox" id="dialog-action_area1"> + <property name="visible">True</property> + <property name="layout_style">GTK_BUTTONBOX_END</property> + + <child> + <widget class="GtkButton" id="okbutton1"> + <property name="visible">True</property> + <property name="can_default">True</property> + <property name="can_focus">True</property> + <property name="label">gtk-ok</property> + <property name="use_stock">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="response_id">-5</property> + <signal name="clicked" handler="on_okbutton1_clicked" last_modification_time="Mon, 10 Dec 2007 11:12:39 GMT"/> + </widget> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">GTK_PACK_END</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed1"> + <property name="visible">True</property> + + <child> + <widget class="GtkCheckButton" id="checkbutton1"> + <property name="width_request">272</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">checkbutton1</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">16</property> + <property name="y">176</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="width_request">280</property> + <property name="height_request">168</property> + <property name="visible">True</property> + <property name="label" translatable="yes"></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">8</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> + +</glade-interface> Added: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.pyp =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.pyp (rev 0) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/dialog/other.pyp 2007-12-10 14:11:11 UTC (rev 774) @@ -0,0 +1,18 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.get_path('root') + '/Scripts/Python/GUI/dialog/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')) + self.get_widget('label1').set_label(_me.get_param('string')) + self.get_widget('checkbutton1').set_label(_me.get_param('check')) + + def on_okbutton1_clicked(self, widget, *args): + _me.set_param(_me.get_param('param'), self.get_widget('checkbutton1').get_active()) + self.get_widget('window1').destroy() Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.pyp 2007-12-10 09:02:04 UTC (rev 773) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/GUI/widget/other.pyp 2007-12-10 14:11:11 UTC (rev 774) @@ -23,6 +23,11 @@ ########################################################### def new(self): self.get_widget("window1").set_title(_me.string('name_to_read')) + if _me.get_param('Startup') == False: + _me.set_param('string', _me.string('Startup')) + _me.set_param('check', _me.string('Show')) + _me.set_param('param', 'Startup') + _me.gui('dialog').show_from_main() thread.start_new_thread(self.update, ()) @@ -45,12 +50,16 @@ self.get_widget('chkDogDefault').set_label(_me.string('at_gui_widget_chkDogDefault')) self.get_widget('chkDogDefault').set_active(_me.get_param('chkDogDefault')) - self.get_widget('spinDog').set_value(_me.get_param('DogThreshold')) + self.get_widget('spinDog').set_value(_me.get_param('Threshold')) + print _me.get_param('dogBehavior') + if os.path.exists(_me.get_param('dogBehavior')): + print _me.get_param('dogBehavior') + self.get_widget('fileDogBehavior').set_filename(_me.get_param('dogBehavior')) self.get_widget('chkSpy').set_label(_me.string('at_gui_widget_chkSpy')) self.get_widget('chkSpy').set_active(_me.get_param('chkSpy')) - self.get_widget('spinSpy').set_value(_me.get_param('SpyThreshold')) + self.get_widget('spinSpy').set_value(_me.get_param('Threshold')) self.get_widget('lblDogLevel').set_text(_me.string('at_gui_widget_lblDogLevel')) self.get_widget('lblSpyLevel').set_text(_me.string('at_gui_widget_lblSpyLevel')) @@ -155,7 +164,11 @@ # ########################################################### def on_window1_destroy(self, widget, *args): - pass + if _me.get_param('Standby') == False: + _me.set_param('string', _me.string('Standby')) + _me.set_param('check', _me.string('Show')) + _me.set_param('param', 'Standby') + _me.gui('dialog').show_from_main() def on_cbbType_changed(self, widget, *args): if self.get_widget('cbbType').get_active() == 0: @@ -166,12 +179,14 @@ self.get_widget('notebook').set_current_page(2) def on_spinbutton1_changed(self, widget, *args): - self.measure.dog_threshold = float(widget.get_text()) - _me.set_param('DogThreshold', float(widget.get_text())) + self.get_widget('spinSpy').set_value(float(widget.get_text())) + self.measure.threshold = float(widget.get_text()) + _me.set_param('Threshold', float(widget.get_text())) def on_spinbutton2_changed(self, widget, *args): - self.measure.spy_threshold = float(widget.get_text()) - _me.set_param('SpyThreshold', float(widget.get_text())) + self.get_widget('spinDog').set_value(float(widget.get_text())) + self.measure.threshold = float(widget.get_text()) + _me.set_param('Threshold', float(widget.get_text())) def on_chkSpy_toggled(self, widget, *args): _me.set_param('chkSpy', widget.get_active()) @@ -185,8 +200,9 @@ _me.set_param('chkDogDefault', widget.get_active()) def on_fileDogBehavior_selection_changed(self, widget, *args): - + print widget.get_filename() _me.set_param('dogBehavior', widget.get_filename()) + print _me.get_param('dogBehavior') class Sound_Graph(gtk.DrawingArea): def __init__(self): @@ -213,10 +229,8 @@ self.draw_space() self.draw_hor_div() self.draw_ver_div() - if self.measure.dog_enabled: - self.draw_threshold(self.measure.dog_threshold, 1) - if self.measure.spy_enabled: - self.draw_threshold(self.measure.spy_threshold, 2) + if self.measure.dog_enabled or self.measure.spy_enabled: + self.draw_threshold(self.measure.threshold, 1) self.draw_curve() def draw_space(self): @@ -250,9 +264,9 @@ self.context.line_to(0, y) self.context.set_source_rgb(0.15, 0.15, 0.15) if i > 10: - self.context.show_text('-'+str((i - 10.0)/10.0)) + self.context.show_text(str((i - 10.0)*10.0)) elif i < 10: - self.context.show_text(str((10.0 - i)/10.0)) + self.context.show_text(str((10.0 - i)*10.0)) else: self.context.show_text('0') self.context.stroke() @@ -359,11 +373,12 @@ self.val_table_pos = [0] * int(self.sample) self.event_table = [-1] * int(self.sample) - self.dog_threshold = 0 - self.spy_threshold = 0 + self.threshold = 0 self.dog_enabled = False self.spy_enabled = False self.RANGE = 1024.0 + self.__notify = False + self.__timer = time.time() self.notify = False self.actuator = False @@ -376,6 +391,7 @@ self.__start_delay = time.time() + 2 self.__capture_start = False self.__stop = False + self.__dog_stop = False self.__delay_to_stop = time.time() self.__write_mutex = threading.Lock() self.__capture_mutex = threading.Lock() @@ -390,15 +406,27 @@ # ########################################################### def event_control(self): - if self.spy_enabled and self.__capture_start == False and self.actuator == False: - if self.Increase_control(self.spy_threshold): - self.record_sound() + if self.__capture_start == False and self.actuator == False: + if self.Increase_control(self.threshold): + if self.spy_enabled: + self.record_sound() + if self.dog_enabled: + self.__timer = time.time() + 0.5 + self.__notify = True + self.actuator = True - if self.dog_enabled and self.actuator == False and self.__start_timeout == False: - if self.Increase_control(self.dog_threshold): + if self.__notify: + val_act = ((self.val_table_pos[len(self.val_table_pos)-1])*100) / (self.RANGE/2) + if val_act < self.threshold and self.__dog_stop == False: + self.__timer = time.time() + 0.1 + self.__dog_stop = True + elif val_act > self.threshold and self.__dog_stop == True: + self.__dog_stop = False + + if self.__timer <= time.time() and self.__dog_stop: + self.__notify = False self.notify = True - self.actuator = True - + if self.__start_timeout: if self.__start_delay < time.time(): self.__start_timeout = False @@ -429,7 +457,7 @@ if self.__capture_start: self.event_table.append(1) - elif self.actuator: + elif self.actuator and not self.__notify: self.event_table.append(2) else: self.event_table.append(-1) @@ -467,10 +495,10 @@ self.__capture_buffer.append(val) val_act = ((self.val_table_pos[len(self.val_table_pos)-1])*100) / (self.RANGE/2) - if val_act < self.spy_threshold and self.__stop == False: - self.__delay_to_stop = time.time() + 0.2 + if val_act < self.threshold and self.__stop == False: + self.__delay_to_stop = time.time() + 0.1 self.__stop = True - elif val_act > self.spy_threshold and self.__stop: + elif val_act > self.threshold and self.__stop: self.__stop = False if (time.time() >= self.__delay_to_stop) and self.__stop: Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/main.pyp =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/main.pyp 2007-12-10 09:02:04 UTC (rev 773) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Scripts/Python/main.pyp 2007-12-10 14:11:11 UTC (rev 774) @@ -12,7 +12,9 @@ tux.event.on_remote_bt[K_STANDBY] = None tux.monitoring.remove(_me.get_param('monitor_id')) tux.micro.on_buffer.disconnect(_me.get_param('buffer_idx')) - + while _me.gui('dialog').showed(): + tux.sys.wait(0.5) + _me.gui('widget').hide_from_main() _me.exit_main_loop() @@ -24,9 +26,9 @@ if Gdgname != 'sound_monitor' and Gdgname != 'Manager': gdg_dict[Gdgname] = gadgets[Gdgname].get_var('notified') gadgets[Gdgname].notify.set_active(False) - + gadgets['sound_monitor'].notify.set_active(True) - + tux.cmd.mouth_open() _me.set_param('dict', gdg_dict) tux.event.on_remote_bt[K_STANDBY] = on_standby Modified: software/gadgets/sound_monitor/trunk/audio_monitor/Strings/fr_ALL.xml =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/Strings/fr_ALL.xml 2007-12-10 09:02:04 UTC (rev 773) +++ software/gadgets/sound_monitor/trunk/audio_monitor/Strings/fr_ALL.xml 2007-12-10 14:11:11 UTC (rev 774) @@ -3,7 +3,7 @@ <at_gui_widget_lblSpyLevel type='str'>Niveau</at_gui_widget_lblSpyLevel> <at_gui_widget_chkDog type='str'>Activer le mode chien de garde</at_gui_widget_chkDog> <at_gui_conf_label13 type='str'>Delay (sec) :</at_gui_conf_label13> - <at_gui_conf_label12 type='str'>Updates</at_gui_conf_label12> + <at_gui_conf_label12 type='str'>Configuration</at_gui_conf_label12> <help_text type='str'> </help_text> <vr_Sound type='str'>Sound</vr_Sound> @@ -11,6 +11,8 @@ <at_gui_widget_cbbDog type='str'>Chien de garde</at_gui_widget_cbbDog> <at_gui_conf_label6 type='str'>Cancel</at_gui_conf_label6> <at_gui_conf_label5 type='str'>Accept</at_gui_conf_label5> + <Standby type='str'>Ceci va mettre fin à l'exécution de ce gadget. Toutes les autres notifications vont être réactivées. +Plus aucun événement relatif au son seront notifiés.</Standby> <at_gui_widget_chkDogDefault type='str'>Utiliser un script :</at_gui_widget_chkDogDefault> <at_gui_widget_lblDogLevel type='str'>Niveau</at_gui_widget_lblDogLevel> <Time type='str'>Heure</Time> @@ -18,6 +20,8 @@ <speaker_name type='str'>Bruno8k</speaker_name> <at_gui_widget_cbbRecord type='str'>Sons enregistrés</at_gui_widget_cbbRecord> <name_to_read type='str'>Moniteur de son</name_to_read> + <Show type='str'>Don't show this message again</Show> + <Startup type='str'>Ce gadget a un système de notification exclusif. Tant que la fenêtre de ce gadget est ouverte, toutes les autres notifications sont désactivées.</Startup> <File type='str'>Fichier</File> <at_gui_widget_chkSpy type='str'>Activer le mode espion</at_gui_widget_chkSpy> <Duration type='str'>Durée</Duration> Modified: software/gadgets/sound_monitor/trunk/audio_monitor/about.xml =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/about.xml 2007-12-10 09:02:04 UTC (rev 773) +++ software/gadgets/sound_monitor/trunk/audio_monitor/about.xml 2007-12-10 14:11:11 UTC (rev 774) @@ -2,7 +2,7 @@ <about> <gadget_author type='str'>Paul Rathgeb</gadget_author> <gadget_version type='str'>0.0.1</gadget_version> + <gadget_name type='str'>sound_monitor</gadget_name> <gadget_description type='str'> </gadget_description> - <gadget_name type='str'>sound_monitor</gadget_name> </about> Modified: software/gadgets/sound_monitor/trunk/audio_monitor/settings.xml =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/settings.xml 2007-12-10 09:02:04 UTC (rev 773) +++ software/gadgets/sound_monitor/trunk/audio_monitor/settings.xml 2007-12-10 14:11:11 UTC (rev 774) @@ -1,24 +1,30 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> + <dogBehavior type='str'> + </dogBehavior> <Sample type='float'>400.0</Sample> <chkDogBehavior type='bool'>False</chkDogBehavior> <SpyThreshold type='int'>30</SpyThreshold> + <Standby type='bool'>False</Standby> <MainScript type='str'>None</MainScript> <chkSpy type='bool'>False</chkSpy> <chkDog type='bool'>True</chkDog> + <Threshold type='float'>30.0</Threshold> <chkSpyRecord type='bool'>False</chkSpyRecord> <chkDogDefault type='bool'>False</chkDogDefault> - <Path type='str'>None</Path> + <Path type='str'> + </Path> <DogThreshold type='int'>30</DogThreshold> + <Startup type='bool'>False</Startup> + <BehaviorPath type='str'> + </BehaviorPath> </parameters> <general> <have_settings_part type='bool'>True</have_settings_part> <gui_state> <widget> - <y type='int'>25</y> <visible type='bool'>True</visible> - <x type='int'>0</x> </widget> <conf> <visible type='bool'>False</visible> Modified: software/gadgets/sound_monitor/trunk/audio_monitor/strings.xml =================================================================== --- software/gadgets/sound_monitor/trunk/audio_monitor/strings.xml 2007-12-10 09:02:04 UTC (rev 773) +++ software/gadgets/sound_monitor/trunk/audio_monitor/strings.xml 2007-12-10 14:11:11 UTC (rev 774) @@ -1,9 +1,9 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> - <at_gui_widget_lblSpyLevel type='str'>Level</at_gui_widget_lblSpyLevel> - <at_gui_widget_chkDog type='str'>Enable the guard dog mode</at_gui_widget_chkDog> + <at_gui_widget_lblSpyLevel type='str'>Threshold level</at_gui_widget_lblSpyLevel> + <at_gui_widget_chkDog type='str'>Enable guard dog mode</at_gui_widget_chkDog> <at_gui_conf_label13 type='str'>Delay (sec) :</at_gui_conf_label13> - <at_gui_conf_label12 type='str'>Updates</at_gui_conf_label12> + <at_gui_conf_label12 type='str'>Settings</at_gui_conf_label12> <help_text type='str'> </help_text> <vr_Sound type='str'>Sound</vr_Sound> @@ -11,16 +11,20 @@ <at_gui_widget_cbbDog type='str'>Guard dog mode</at_gui_widget_cbbDog> <at_gui_conf_label6 type='str'>Cancel</at_gui_conf_label6> <at_gui_conf_label5 type='str'>Accept</at_gui_conf_label5> + <Standby type='str'>This will stop the gadget execution, and restart all the other notifications. +No more sound events will be notified.</Standby> <at_gui_widget_chkDogDefault type='str'>Use an external script</at_gui_widget_chkDogDefault> - <at_gui_widget_lblDogLevel type='str'>Level</at_gui_widget_lblDogLevel> - <Time type='str'>Hour</Time> + <at_gui_widget_lblDogLevel type='str'>Threshold level</at_gui_widget_lblDogLevel> + <Time type='str'>Time</Time> <at_gui_widget_cbbSpy type='str'>Spy mode</at_gui_widget_cbbSpy> <speaker_name type='str'>Ryan8k</speaker_name> <at_gui_widget_cbbRecord type='str'>Recorded files</at_gui_widget_cbbRecord> <name_to_read type='str'>Audio monitor</name_to_read> + <Show type='str'>Don't show this message again.</Show> + <Startup type='str'>This gadget has an exclusive priority, and all notifications are bypassed when the GUI is open.</Startup> <File type='str'>File</File> - <at_gui_widget_chkSpy type='str'>Enable the spy mode</at_gui_widget_chkSpy> + <at_gui_widget_chkSpy type='str'>Enable spy mode</at_gui_widget_chkSpy> <Duration type='str'>Duration</Duration> - <lblSample type='str'>Sample : </lblSample> - <Location type='str'>Select where the file must be stored.</Location> + <lblSample type='str'>Sample rate : </lblSample> + <Location type='str'>Save recorded files to :</Location> </strings> Modified: software/gadgets/sound_monitor/trunk/audio_monitor.tgf =================================================================== (Binary files differ) |
From: jerome <c2m...@c2...> - 2007-12-10 09:02:05
|
Author: jerome Date: 2007-12-10 10:02:04 +0100 (Mon, 10 Dec 2007) New Revision: 773 Added: software/gadgets/totem_player/ software/gadgets/totem_player/branches/ software/gadgets/totem_player/tags/ software/gadgets/totem_player/trunk/ software/gadgets/xmms_player/ software/gadgets/xmms_player/branches/ software/gadgets/xmms_player/tags/ software/gadgets/xmms_player/trunk/ Log: *added the xmms and totem gadgets |
From: jerome <c2m...@c2...> - 2007-12-10 08:58:56
|
Author: jerome Date: 2007-12-10 09:58:49 +0100 (Mon, 10 Dec 2007) New Revision: 772 Added: software/gadgets/calculator/ software/gadgets/calculator/branches/ software/gadgets/calculator/tags/ software/gadgets/calculator/trunk/ software/gadgets/gmail/ software/gadgets/gmail/branches/ software/gadgets/gmail/tags/ software/gadgets/gmail/trunk/ Log: *added the calculator and gmail gadgets that was not on svn |
From: jerome <c2m...@c2...> - 2007-12-10 08:55:36
|
Author: jerome Date: 2007-12-10 09:55:38 +0100 (Mon, 10 Dec 2007) New Revision: 771 Added: software/gadgets/audacious_player/ software/gadgets/audacious_player/branches/ software/gadgets/audacious_player/tags/ software/gadgets/audacious_player/trunk/ Log: *added the audacious player gadget that was not on svn |
From: jerome <c2m...@c2...> - 2007-12-10 08:52:20
|
Author: jerome Date: 2007-12-10 09:52:21 +0100 (Mon, 10 Dec 2007) New Revision: 770 Added: software/gadgets/amarok_player/ software/gadgets/amarok_player/branches/ software/gadgets/amarok_player/tags/ software/gadgets/amarok_player/trunk/ Log: *added the amarok player gadget that was not on svn |
From: jerome <c2m...@c2...> - 2007-12-10 08:49:17
|
Author: jerome Date: 2007-12-10 09:49:15 +0100 (Mon, 10 Dec 2007) New Revision: 769 Added: software/gadgets/alarm/ software/gadgets/alarm/branches/ software/gadgets/alarm/tags/ software/gadgets/alarm/trunk/ Log: *added the alarm gadget that was not on svn |
From: jerome <c2m...@c2...> - 2007-12-10 08:46:17
|
Author: jerome Date: 2007-12-10 09:46:17 +0100 (Mon, 10 Dec 2007) New Revision: 768 Added: software/gadgets/firmware_updater/ software/gadgets/firmware_updater/branches/ software/gadgets/firmware_updater/tags/ software/gadgets/firmware_updater/trunk/ Log: *added the firmware updater gadget that was not on svn |
From: jerome <c2m...@c2...> - 2007-12-10 08:39:15
|
Author: jerome Date: 2007-12-10 09:39:07 +0100 (Mon, 10 Dec 2007) New Revision: 767 Modified: software/gadgets/PC_monitor/trunk/pc_monitor.tgf software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/init.pyp software/gadgets/PC_monitor/trunk/pc_monitor/about.xml software/gadgets/PC_monitor/trunk/pc_monitor/settings.xml software/gadgets/PC_monitor/trunk/pc_monitor/strings.xml Log: *resolved some bug to be complitly compatible with the beta release Modified: software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/init.pyp =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/init.pyp 2007-12-07 14:54:01 UTC (rev 766) +++ software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/init.pyp 2007-12-10 08:39:07 UTC (rev 767) @@ -42,7 +42,7 @@ _me.set_param('cpu_tag', notify[0]) _me.set_param('ram_tag', notify[1]) - + return notify[0] or notify[1] else: Modified: software/gadgets/PC_monitor/trunk/pc_monitor/about.xml =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/about.xml 2007-12-07 14:54:01 UTC (rev 766) +++ software/gadgets/PC_monitor/trunk/pc_monitor/about.xml 2007-12-10 08:39:07 UTC (rev 767) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_description type='str'>PC monitor gadget for tux droid.</gadget_description> <gadget_author type='str'>jer...@ky...</gadget_author> + <gadget_name type='str'>pc_monitor</gadget_name> <gadget_version type='str'>0.0.2</gadget_version> - <gadget_description type='str'>PC monitor gadget for tux droid.</gadget_description> - <gadget_name type='str'>pc_monitor</gadget_name> </about> Modified: software/gadgets/PC_monitor/trunk/pc_monitor/settings.xml =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/settings.xml 2007-12-07 14:54:01 UTC (rev 766) +++ software/gadgets/PC_monitor/trunk/pc_monitor/settings.xml 2007-12-10 08:39:07 UTC (rev 767) @@ -1,41 +1,43 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <cpu_tag type='bool'>True</cpu_tag> - <first_ram type='bool'>False</first_ram> + <spin_ram_seuil type='int'>95</spin_ram_seuil> + <first_ram type='bool'>True</first_ram> <ram_tag type='bool'>False</ram_tag> - <ram_load type='str'>53.0815109344</ram_load> + <ram_load type='str'>00</ram_load> <tts_ram_active type='bool'>True</tts_ram_active> + <timer_busy type='bool'>False</timer_busy> <ram_tts_message type='str'>Memory is up!</ram_tts_message> - <spin_ram_seuil type='int'>95</spin_ram_seuil> - <cpu_load type='str'>100.0</cpu_load> + <cpu_tag type='bool'>False</cpu_tag> <values type='list'>[]</values> <spin_notif type='int'>6</spin_notif> <spin_cpu_seuil type='int'>95</spin_cpu_seuil> <cpu_tts_message type='str'>CPU overload!</cpu_tts_message> - <cpu_behavior_file type='str'>/tmp/pc_monitor/Data/cpu_behavior.py</cpu_behavior_file> - <ram_behavior_file type='str'>/tmp/pc_monitor/Data/ram_behavior.py</ram_behavior_file> - <first_cpu type='bool'>False</first_cpu> + <cpu_behavior_file type='str'>empty</cpu_behavior_file> + <ram_behavior_file type='str'>empty</ram_behavior_file> + <first_cpu type='bool'>True</first_cpu> <tts_active type='bool'>True</tts_active> - <timer_busy type='bool'>False</timer_busy> + <cpu_load type='str'>00</cpu_load> </parameters> <general> <have_settings_part type='bool'>True</have_settings_part> <gui_state> <widget> - <visible type='bool'>False</visible> + <y type='int'>512</y> + <visible type='bool'>True</visible> + <x type='int'>32</x> </widget> <conf> <visible type='bool'>False</visible> </conf> </gui_state> - <language type='str'>fr_ALL</language> + <language type='str'>en_US</language> <notified type='bool'>True</notified> <notify_delay type='int'>6</notify_delay> <framework_version type='str'>0.0.0</framework_version> <menu_active type='bool'>True</menu_active> <have_widget_part type='bool'>False</have_widget_part> - <speaker type='int'>1</speaker> + <speaker type='int'>3</speaker> <pitch type='int'>100</pitch> <have_main_part type='bool'>True</have_main_part> <main_priority type='int'>4</main_priority> Modified: software/gadgets/PC_monitor/trunk/pc_monitor/strings.xml =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/strings.xml 2007-12-07 14:54:01 UTC (rev 766) +++ software/gadgets/PC_monitor/trunk/pc_monitor/strings.xml 2007-12-10 08:39:07 UTC (rev 767) @@ -11,8 +11,8 @@ <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> <gui_conf_delay_lb type='str'>Update interval (sec) :</gui_conf_delay_lb> <gui_conf_about_title type='str'>About</gui_conf_about_title> + <gui_conf_rb_behavior type='str'>Behavior :</gui_conf_rb_behavior> <gui_conf_ram_frame_label type='str'>Physical RAM</gui_conf_ram_frame_label> - <gui_conf_rb_behavior type='str'>Behavior :</gui_conf_rb_behavior> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <gui_conf_notification_label type='str'>Notification after (sec) :</gui_conf_notification_label> Modified: software/gadgets/PC_monitor/trunk/pc_monitor.tgf =================================================================== (Binary files differ) |
Author: Paul_R Date: 2007-12-07 15:54:01 +0100 (Fri, 07 Dec 2007) New Revision: 766 Added: software/gadgets/PC_monitor/ software/gadgets/PC_monitor/branches/ software/gadgets/PC_monitor/tags/ software/gadgets/PC_monitor/trunk/ software/gadgets/PC_monitor/trunk/pc_monitor.tgf software/gadgets/PC_monitor/trunk/pc_monitor/ software/gadgets/PC_monitor/trunk/pc_monitor/Data/ software/gadgets/PC_monitor/trunk/pc_monitor/Data/cpu_behavior.py software/gadgets/PC_monitor/trunk/pc_monitor/Data/ram_behavior.py software/gadgets/PC_monitor/trunk/pc_monitor/Pictures/ software/gadgets/PC_monitor/trunk/pc_monitor/Pictures/Icons/ software/gadgets/PC_monitor/trunk/pc_monitor/Pictures/Icons/gadget.png software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/ software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/ software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/ software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/conf/ software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/conf/other.glade software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/conf/other.pyp software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/widget/ software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/widget/other.glade software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/widget/other.pyp software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/init.pyp software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/main.pyp software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/notify.pyp software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/tags software/gadgets/PC_monitor/trunk/pc_monitor/Strings/ software/gadgets/PC_monitor/trunk/pc_monitor/Strings/fr_ALL.xml software/gadgets/PC_monitor/trunk/pc_monitor/about.xml software/gadgets/PC_monitor/trunk/pc_monitor/parts.xml software/gadgets/PC_monitor/trunk/pc_monitor/settings.xml software/gadgets/PC_monitor/trunk/pc_monitor/strings.xml Log: * Added the PC_monitor on SVN to correct a bug : The notify actuator was always activated. I've added a test to run the actuator only when an event occurs. Added: software/gadgets/PC_monitor/trunk/pc_monitor/Data/cpu_behavior.py =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/Data/cpu_behavior.py (rev 0) +++ software/gadgets/PC_monitor/trunk/pc_monitor/Data/cpu_behavior.py 2007-12-07 14:54:01 UTC (rev 766) @@ -0,0 +1,18 @@ +#!/usr/bin/python +# -*- coding: latin-1 -*- +import sys +sys.path.append('/opt/tuxdroid/api/python') +from tux import * +# ----------------------------------------------------------------------------- +# Object "tux" is created by tux.py +# Your script begins here +# ----------------------------------------------------------------------------- +tux.cmd.wings_on(8, 5) +tux.cmd.mouth_on_free() +tux.tts.speak("c p u overload") +tux.sys.wait(1.0) +tux.cmd.mouth_on_free() +# ----------------------------------------------------------------------------- +# End of your script +# ----------------------------------------------------------------------------- +tux.destroy() Added: software/gadgets/PC_monitor/trunk/pc_monitor/Data/ram_behavior.py =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/Data/ram_behavior.py (rev 0) +++ software/gadgets/PC_monitor/trunk/pc_monitor/Data/ram_behavior.py 2007-12-07 14:54:01 UTC (rev 766) @@ -0,0 +1,18 @@ +#!/usr/bin/python +# -*- coding: latin-1 -*- +import sys +sys.path.append('/opt/tuxdroid/api/python') +from tux import * +# ----------------------------------------------------------------------------- +# Object "tux" is created by tux.py +# Your script begins here +# ----------------------------------------------------------------------------- +tux.cmd.wings_on(8, 5) +tux.cmd.mouth_on_free() +tux.tts.speak("Memory is up") +tux.sys.wait(1.0) +tux.cmd.mouth_on_free() +# ----------------------------------------------------------------------------- +# End of your script +# ----------------------------------------------------------------------------- +tux.destroy() Added: software/gadgets/PC_monitor/trunk/pc_monitor/Pictures/Icons/gadget.png =================================================================== (Binary files differ) Property changes on: software/gadgets/PC_monitor/trunk/pc_monitor/Pictures/Icons/gadget.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/conf/other.glade =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/conf/other.glade (rev 0) +++ software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/conf/other.glade 2007-12-07 14:54:01 UTC (rev 766) @@ -0,0 +1,915 @@ +<?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">538</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Parameters</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="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> + + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="frame4"> + <property name="border_width">5</property> + <property name="height_request">64</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_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment7"> + <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="fixed5"> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="button_remote"> + <property name="width_request">62</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Set</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_button_remote_clicked" last_modification_time="Sat, 22 Sep 2007 00:55:36 GMT"/> + </widget> + <packing> + <property name="x">256</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label_remote"> + <property name="width_request">336</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Current : None</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">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Remote</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="frame5"> + <property name="border_width">5</property> + <property name="height_request">87</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_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment8"> + <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="fixed6"> + <property name="visible">True</property> + + <child> + <widget class="GtkSpinButton" id="spin_update"> + <property name="width_request">48</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">1 1 60 1 10 10</property> + </widget> + <packing> + <property name="x">184</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="spin_notification"> + <property name="width_request">48</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">1 1 60 1 10 10</property> + </widget> + <packing> + <property name="x">184</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label_notification"> + <property name="width_request">328</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Notification after (sec) :</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">40</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="update_interval_label"> + <property name="width_request">336</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Update interval (sec) :</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> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Monitoring</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">5</property> + <property name="height_request">170</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_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment9"> + <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="fixed7"> + <property name="visible">True</property> + + <child> + <widget class="GtkSpinButton" id="cpu_spin_threshold"> + <property name="width_request">64</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">1 1 100 1 10 10</property> + </widget> + <packing> + <property name="x">144</property> + <property name="y">4</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="cpu_tts_message"> + <property name="width_request">176</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">coucou</property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">144</property> + <property name="y">40</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label19"> + <property name="width_request">46</property> + <property name="height_request">17</property> + <property name="visible">True</property> + <property name="label" translatable="yes">%</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">216</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cpu_behavior_rb"> + <property name="width_request">192</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Behavior</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">True</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">72</property> + </packing> + </child> + + <child> + <widget class="GtkFileChooserButton" id="cpu_behavior_chooser"> + <property name="width_request">184</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Sélectionner un fichier</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> + <signal name="selection_changed" handler="on_cpu_behavior_chooser_selection_changed" last_modification_time="Tue, 09 Oct 2007 09:07:39 GMT"/> + </widget> + <packing> + <property name="x">144</property> + <property name="y">68</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="cpu_test_notification"> + <property name="width_request">112</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Test notification</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_cpu_test_notification_clicked" last_modification_time="Mon, 05 Nov 2007 03:25:12 GMT"/> + </widget> + <packing> + <property name="x">112</property> + <property name="y">111</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="cpu_tts_rb"> + <property name="width_request">160</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">TTS Notification</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">True</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">cpu_behavior_rb</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">40</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="cpu_threshold_label"> + <property name="width_request">336</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Set threshold :</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> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label15"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>CPU</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="frame7"> + <property name="border_width">5</property> + <property name="height_request">170</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_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment10"> + <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="fixed8"> + <property name="visible">True</property> + + <child> + <widget class="GtkSpinButton" id="ram_spin_threshold"> + <property name="width_request">64</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">1 1 100 1 10 10</property> + </widget> + <packing> + <property name="x">144</property> + <property name="y">4</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label21"> + <property name="width_request">46</property> + <property name="height_request">17</property> + <property name="visible">True</property> + <property name="label" translatable="yes">%</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">216</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="ram_tts_message"> + <property name="width_request">176</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">Memory is up!</property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">144</property> + <property name="y">38</property> + </packing> + </child> + + <child> + <widget class="GtkFileChooserButton" id="ram_behavior_chooser"> + <property name="width_request">176</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Sélectionner un fichier</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> + <signal name="selection_changed" handler="on_ram_behavior_chooser_selection_changed" last_modification_time="Tue, 09 Oct 2007 09:08:34 GMT"/> + </widget> + <packing> + <property name="x">144</property> + <property name="y">68</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="ram_threshold_label"> + <property name="width_request">336</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Set threshold :</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="ram_test_notification"> + <property name="width_request">112</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Test notification</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_ram_test_notification_clicked" last_modification_time="Mon, 05 Nov 2007 03:27:31 GMT"/> + </widget> + <packing> + <property name="x">112</property> + <property name="y">111</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="ram_tts_rb"> + <property name="width_request">168</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">TTS Notification</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">40</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="ram_behavior_rb"> + <property name="width_request">184</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Behavior</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">ram_tts_rb</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">72</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label17"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Physical RAM</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="GtkFixed" id="fixed3"> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="button2"> + <property name="width_request">96</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_accept_clicked" last_modification_time="Wed, 11 Jul 2007 19:53:32 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image2"> + <property name="visible">True</property> + <property name="stock">gtk-apply</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes">Accept</property> + <property name="use_underline">True</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="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">256</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button3"> + <property name="width_request">96</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_cancel_clicked" last_modification_time="Thu, 09 Aug 2007 13:50:03 GMT"/> + + <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">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</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">2</property> + + <child> + <widget class="GtkImage" id="image3"> + <property name="visible">True</property> + <property name="stock">gtk-cancel</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes">Cancel</property> + <property name="use_underline">True</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="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">152</property> + <property name="y">0</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> + +</glade-interface> Added: software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/conf/other.pyp (rev 0) +++ software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/conf/other.pyp 2007-12-07 14:54:01 UTC (rev 766) @@ -0,0 +1,243 @@ +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 on_cpu_behavior_chooser_selection_changed(self, widget, *args): + if not _me.get_param('first_cpu'): + filename = widget.get_filename() + if filename != "": + filename = str(filename).replace('%20', ' ') + _me.set_param('cpu_behavior_file', filename) + else: + _me.set_param('first_cpu', False) + + + def on_ram_behavior_chooser_selection_changed(self, widget, *args): + if not _me.get_param('first_ram'): + filename = widget.get_filename() + if filename != "": + filename = str(filename).replace('%20', ' ') + _me.set_param('ram_behavior_file', filename) + else: + _me.set_param('first_ram', False) + + + + 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) + + # 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) + + # Monitoring Frame + txt = _me.string('gui_conf_update_title') + self.get_widget("label12").set_text(txt) + + txt = "%s" % _me.string('gui_conf_delay_lb') + self.get_widget("update_interval_label").set_text(txt) + + value = _me.get_var('notify_delay') + self.get_widget("spin_update").set_value(value) + + txt = _me.string('gui_conf_notification_label') + self.get_widget('label_notification').set_text(txt) + + value = _me.get_param('spin_notif') + self.get_widget('spin_notification').set_value(value) + + # 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 + """ + #CPU Frame + self.get_widget('label15').set_text('CPU') + + txt = _me.string('gui_conf_threshold_label') + self.get_widget('cpu_threshold_label').set_text(txt) + + value = _me.get_param('spin_cpu_seuil') + self.get_widget('cpu_spin_threshold').set_value(value) + + txt = _me.string('gui_conf_rb_tts') + self.get_widget('cpu_tts_rb').set_label(txt) + + if _me.get_param('tts_active'): + self.get_widget('cpu_tts_rb').set_active(True) + else: + self.get_widget('cpu_behavior_rb').set_active(True) + + txt = _me.get_param('cpu_tts_message') + self.get_widget('cpu_tts_message').set_text(txt) + + txt = _me.string('gui_conf_rb_behavior') + self.get_widget('cpu_behavior_rb').set_label(txt) + + txt = _me.get_param('cpu_behavior_file') + if os.path.isfile(txt): + self.get_widget('cpu_behavior_chooser').set_filename(txt) + else: + txt = _me.get_path('data') + '/cpu_behavior.py' + self.get_widget('cpu_behavior_chooser').set_filename(txt) + + #Ram Frame + + txt = _me.string('gui_conf_ram_frame_label') + self.get_widget('label17').set_text(txt) + + txt = _me.string('gui_conf_rb_tts') + self.get_widget('ram_tts_rb').set_label(txt) + + if _me.get_param('tts_ram_active'): + self.get_widget('ram_tts_rb').set_active(True) + else: + self.get_widget('ram_behavior_rb').set_active(True) + + txt = _me.get_param('ram_tts_message') + self.get_widget('ram_tts_message').set_text(txt) + + txt = _me.string('gui_conf_rb_behavior') + self.get_widget('ram_behavior_rb').set_label(txt) + + txt = _me.string('gui_conf_threshold_label') + self.get_widget('ram_threshold_label').set_text(txt) + + value = _me.get_param('spin_ram_seuil') + self.get_widget('ram_spin_threshold').set_value(value) + + txt = _me.get_param('ram_behavior_file') + if os.path.isfile(txt): + self.get_widget('ram_behavior_chooser').set_filename(txt) + else: + txt = _me.get_path('data') + '/ram_behavior.py' + self.get_widget('ram_behavior_chooser').set_filename(txt) + + + + 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 + """ + #sav tts messages. + txt = self.get_widget('cpu_tts_message').get_text() + _me.set_param('cpu_tts_message', txt) + + txt = self.get_widget('ram_tts_message').get_text() + _me.set_param('ram_tts_message', txt) + + #sav spins val + + value = self.get_widget('spin_notification').get_value() + _me.set_param('spin_notif', int(value)) + value2 = self.get_widget('spin_update').get_value() + if value < value2: + _me.set_var('notify_delay', int(value)) + else: + _me.set_var('notify_delay', int(value2)) + + + value = self.get_widget('cpu_spin_threshold').get_value() + _me.set_param('spin_cpu_seuil', int(value)) + + value = self.get_widget('ram_spin_threshold').get_value() + _me.set_param('spin_ram_seuil', int(value)) + + if self.get_widget('cpu_tts_rb').get_active(): + _me.set_param('tts_active', True) + else: + _me.set_param('tts_active', False) + + if self.get_widget('ram_tts_rb').get_active(): + _me.set_param('tts_ram_active', True) + else: + _me.set_param('tts_ram_active', False) + + self.on_cpu_behavior_chooser_selection_changed(self.get_widget('cpu_behavior_chooser')) + self.on_ram_behavior_chooser_selection_changed(self.get_widget('ram_behavior_chooser')) + + self.get_widget("window1").destroy() + + + def on_cancel_clicked(self, widget, *args): + """ + On button 'cancel' clicked + """ + self.get_widget("window1").destroy() + + + def on_cpu_test_notification_clicked(self, widget, *args): + """ + Event attached to the cpu test notification button. + """ + if self.get_widget('cpu_tts_rb').get_active(): + txt = self.get_widget('cpu_tts_message').get_text() + tux.tts.speak_free(txt) + else: + path = _me.get_param('cpu_behavior_file') + if os.path.isfile(path): + tux.sys.shell("chmod +x '%s'" % path) + tux.sys.shell_free("'%s'" % path) + + + def on_ram_test_notification_clicked(self, widget, *args): + """ + Event attached to the ram test notification button. + """ + if self.get_widget('ram_tts_rb').get_active(): + txt = self.get_widget('ram_tts_message').get_text() + tux.tts.speak_free(txt) + else: + path = _me.get_param('ram_behavior_file') + if os.path.isfile(path): + tux.sys.shell("chmod +x '%s'" % path) + tux.sys.shell_free("'%s'" % path) + Added: software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/widget/other.glade (rev 0) +++ software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/widget/other.glade 2007-12-07 14:54:01 UTC (rev 766) @@ -0,0 +1,101 @@ +<?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="visible">True</property> + <property name="title" translatable="yes">Widget</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">False</property> + <property name="destroy_with_parent">False</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> + + <child> + <widget class="GtkFrame" id="frame1"> + <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="GtkFixed" id="fixed1"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="width_request">192</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">...</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> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b></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> + </child> +</widget> + +</glade-interface> Added: software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/widget/other.pyp (rev 0) +++ software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/GUI/widget/other.pyp 2007-12-07 14:54:01 UTC (rev 766) @@ -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/PC_monitor/trunk/pc_monitor/Scripts/Python/init.pyp =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/init.pyp (rev 0) +++ software/gadgets/PC_monitor/trunk/pc_monitor/Scripts/Python/init.pyp 2007-12-07 14:54:01 UTC (rev 766) @@ -0,0 +1,145 @@ +import sys +import commands +import subprocess +import threading + +def check_changes(): + """ + #Check all changes and add to buffer. + """ + values = _me.update_informations() + liste = _me.get_param('values') + liste.append(values) + _me.set_param('values', liste) + x = _me.get_var('notify_delay') + y = _me.get_param('spin_notif') + v = int(y / x) + if v == 0: + v = 1 + verite_cpu = [] + verite_ram = [] + notify = [False, False] + if len(_me.get_param('values')) == v: + for i in _me.get_param('values'): + if i[0] > _me.get_param('spin_cpu_seuil'): + verite_cpu.append(True) + else: + verite_cpu.append(False) + + if i[1] > _me.get_param('spin_ram_seuil'): + verite_ram.append(True) + else: + verite_ram.append(False) + _me.get_funct('delete_buffer')() + + for i in verite_cpu: + if i != False: + notify[0] = True + + for i in verite_ram: + if i != False: + notify[1] = True + + _me.set_param('cpu_tag', notify[0]) + _me.set_param('ram_tag', notify[1]) + + return notify[0] or notify[1] + + else: + return False + + +def get_mem_charge(): + """ + Function to get the memory load. + """ + def get_freemem(): + """ + Get free memory + """ + cached = commands.getoutput("""cat /proc/meminfo | grep Cached | awk 'BEGIN {FS=":"} {print $2}' | awk '{print $1, $9}'""") + buffers = commands.getoutput("""cat /proc/meminfo | grep Buffers | awk 'BEGIN {FS=":"} {print $2}' | awk '{print $1, $9}'""") + free = commands.getoutput("""cat /proc/meminfo | grep MemFree | awk 'BEGIN {FS=":"} {print $2}' | awk '{print $1, $9}'""") + return str(int(cached.split()[0])/1024 + int(buffers)/1024 + int(free)/1024) + + def get_usedmem(): + """ + Get used memory + """ + total = commands.getoutput("""cat /proc/meminfo | grep MemTotal | awk 'BEGIN {FS=":"} {print $2}' | awk '{print $1, $9}'""") + cached = commands.getoutput("""cat /proc/meminfo | grep Cached | awk 'BEGIN {FS=":"} {print $2}' | awk '{print $1, $9}'""") + buffers = commands.getoutput("""cat /proc/meminfo | grep Buffers | awk 'BEGIN {FS=":"} {print $2}' | awk '{print $1, $9}'""") + free = commands.getoutput("""cat /proc/meminfo | grep MemFree | awk 'BEGIN {FS=":"} {print $2}' | awk '{print $1, $9}'""") + return str(int(total)/1024 - int(cached.split()[0])/1024 - int(buffers)/1024 - int(free)/1024) + + + free = get_freemem() + used = get_usedmem() + + return str(float((float(used) / (float(used) + float(free))) * 100.0)) + + +def get_cpu_charge(): + """ + Function to get the cpu load. + """ + data = commands.getoutput("cat /proc/stat") + u1 = float( data.split()[1] ) + n1 = float( data.split()[2] ) + s1 = float( data.split()[3] ) + i1 = float( data.split()[4] ) + time.sleep(1) + datas = commands.getoutput("cat /proc/stat") + u2 = float( datas.split()[1] ) + n2 = float( datas.split()[2] ) + s2 = float( datas.split()[3] ) + i2 = float( datas.split()[4] ) + usage = (u2-u1) + (n2 - n1) + (s2 - s1) + total = (u2-u1) + (n2 - n1) + (s2 - s1) + (i2 -i1) + lo = (usage/total)* 100 + + return str(lo) + +def tell(): + """ + Tux notify the cpu and ram load is treshold is passed. + """ + if _me.get_param('cpu_tag'): + v = _me.get_param('cpu_load') + x = int(round(float(v))) + y = _me.get_param('spin_cpu_seuil') + + if x >= y: + if _me.get_param('tts_active'): + tux.tts.speak_free(_me.get_param('cpu_tts_message')) + else: + tux.sys.shell("chmod +x '%s'" % ... [truncated message content] |
From: Paul_R <c2m...@c2...> - 2007-12-07 12:54:17
|
Author: Paul_R Date: 2007-12-07 13:54:13 +0100 (Fri, 07 Dec 2007) New Revision: 765 Modified: software/gadgets/tux_controller/trunk/TuxController.tgf software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/main.pyp software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml software/gadgets/tux_controller/trunk/TuxController/about.xml software/gadgets/tux_controller/trunk/TuxController/strings.xml Log: * Added the remote control functions and the voice recognition. Modified: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade 2007-12-07 10:55:13 UTC (rev 764) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade 2007-12-07 12:54:13 UTC (rev 765) @@ -56,7 +56,7 @@ <property name="label" translatable="yes">checkbutton1</property> <property name="use_underline">True</property> <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> + <property name="focus_on_click">False</property> <property name="active">False</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> @@ -109,8 +109,6 @@ <child> <widget class="GtkFixed" id="fixed24"> - <property name="width_request">372</property> - <property name="height_request">0</property> <property name="visible">True</property> <child> @@ -238,67 +236,6 @@ </child> <child> - <widget class="GtkCheckButton" id="chkLEDRight"> - <property name="width_request">20</property> - <property name="height_request">20</property> - <property name="visible">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_chkLEDRight_toggled" last_modification_time="Thu, 15 Nov 2007 10:15:35 GMT"/> - </widget> - <packing> - <property name="x">8</property> - <property name="y">25</property> - </packing> - </child> - - <child> - <widget class="GtkCheckButton" id="chkLEDLeft"> - <property name="width_request">20</property> - <property name="height_request">20</property> - <property name="visible">True</property> - <property name="label" translatable="yes"> -</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_chkLEDLeft_toggled" last_modification_time="Thu, 15 Nov 2007 10:15:58 GMT"/> - </widget> - <packing> - <property name="x">40</property> - <property name="y">25</property> - </packing> - </child> - - <child> - <widget class="GtkHScale" id="slideLED"> - <property name="width_request">160</property> - <property name="height_request">32</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="draw_value">True</property> - <property name="value_pos">GTK_POS_RIGHT</property> - <property name="digits">0</property> - <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> - <property name="inverted">False</property> - <property name="adjustment">150 1 255 1 0 0</property> - <signal name="value_changed" handler="on_slideLED_value_changed" last_modification_time="Thu, 15 Nov 2007 08:37:21 GMT"/> - </widget> - <packing> - <property name="x">208</property> - <property name="y">17</property> - </packing> - </child> - - <child> <widget class="GtkButton" id="btnLEDRun"> <property name="width_request">36</property> <property name="height_request">36</property> @@ -331,7 +268,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-up</property> + <property name="stock">gtk-refresh</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -392,6 +329,67 @@ <property name="y">4</property> </packing> </child> + + <child> + <widget class="GtkCheckButton" id="chkLEDRight"> + <property name="width_request">20</property> + <property name="height_request">20</property> + <property name="visible">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">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> + <signal name="toggled" handler="on_chkLEDRight_toggled" last_modification_time="Thu, 15 Nov 2007 10:15:35 GMT"/> + </widget> + <packing> + <property name="x">8</property> + <property name="y">25</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="chkLEDLeft"> + <property name="width_request">20</property> + <property name="height_request">20</property> + <property name="visible">True</property> + <property name="label" translatable="yes"> +</property> + <property name="use_underline">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> + <signal name="toggled" handler="on_chkLEDLeft_toggled" last_modification_time="Thu, 15 Nov 2007 10:15:58 GMT"/> + </widget> + <packing> + <property name="x">40</property> + <property name="y">25</property> + </packing> + </child> + + <child> + <widget class="GtkHScale" id="slideLED"> + <property name="width_request">160</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="draw_value">True</property> + <property name="value_pos">GTK_POS_RIGHT</property> + <property name="digits">0</property> + <property name="update_policy">GTK_UPDATE_CONTINUOUS</property> + <property name="inverted">False</property> + <property name="adjustment">150 1 255 1 0 0</property> + <signal name="value_changed" handler="on_slideLED_value_changed" last_modification_time="Thu, 15 Nov 2007 08:37:21 GMT"/> + </widget> + <packing> + <property name="x">208</property> + <property name="y">17</property> + </packing> + </child> </widget> <packing> <property name="left_attach">1</property> @@ -472,7 +470,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-up</property> + <property name="stock">gtk-refresh</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -650,7 +648,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-up</property> + <property name="stock">gtk-go-down</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -792,7 +790,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-up</property> + <property name="stock">gtk-refresh</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -958,7 +956,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-up</property> + <property name="stock">gtk-go-down</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -1076,7 +1074,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-up</property> + <property name="stock">gtk-refresh</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -1286,7 +1284,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-up</property> + <property name="stock">gtk-go-down</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -1384,26 +1382,6 @@ </child> <child> - <widget class="GtkRadioButton" id="radSpinDirRight"> - <property name="width_request">136</property> - <property name="height_request">22</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">radiobutton2</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - </widget> - <packing> - <property name="x">264</property> - <property name="y">56</property> - </packing> - </child> - - <child> <widget class="GtkRadioButton" id="radSpinDirLeft"> <property name="width_request">136</property> <property name="height_request">24</property> @@ -1416,7 +1394,6 @@ <property name="active">False</property> <property name="inconsistent">False</property> <property name="draw_indicator">True</property> - <property name="group">radSpinDirRight</property> </widget> <packing> <property name="x">120</property> @@ -1458,7 +1435,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-up</property> + <property name="stock">gtk-go-back</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -1542,7 +1519,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-up</property> + <property name="stock">gtk-go-forward</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -1625,7 +1602,7 @@ <property name="visible">True</property> <property name="can_focus">True</property> <property name="has_focus">True</property> - <property name="stock">gtk-go-up</property> + <property name="stock">gtk-refresh</property> <property name="icon_size">4</property> <property name="xalign">0</property> <property name="yalign">0</property> @@ -1706,6 +1683,27 @@ <property name="y">7</property> </packing> </child> + + <child> + <widget class="GtkRadioButton" id="radSpinDirRight"> + <property name="width_request">136</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">radiobutton2</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radSpinDirLeft</property> + </widget> + <packing> + <property name="x">264</property> + <property name="y">56</property> + </packing> + </child> </widget> <packing> <property name="left_attach">1</property> @@ -1719,6 +1717,7 @@ <child> <widget class="GtkFixed" id="fixed32"> + <property name="width_request">310</property> <property name="visible">True</property> <child> @@ -1796,15 +1795,15 @@ </child> <child> - <widget class="GtkLabel" id="lblSound"> - <property name="width_request">46</property> - <property name="height_request">17</property> + <widget class="GtkLabel" id="lblBatteryL"> + <property name="width_request">138</property> + <property name="height_request">16</property> <property name="visible">True</property> <property name="label" translatable="yes"> </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="justify">GTK_JUSTIFY_RIGHT</property> + <property name="wrap">True</property> <property name="selectable">False</property> <property name="xalign">0.5</property> <property name="yalign">0.5</property> @@ -1816,13 +1815,13 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">312</property> - <property name="y">56</property> + <property name="x">0</property> + <property name="y">32</property> </packing> </child> <child> - <widget class="GtkLabel" id="lblBatteryL"> + <widget class="GtkLabel" id="lblSoundL"> <property name="width_request">138</property> <property name="height_request">16</property> <property name="visible">True</property> @@ -1843,12 +1842,12 @@ </widget> <packing> <property name="x">0</property> - <property name="y">32</property> + <property name="y">56</property> </packing> </child> <child> - <widget class="GtkLabel" id="lblSoundL"> + <widget class="GtkLabel" id="lblLightL"> <property name="width_request">138</property> <property name="height_request">16</property> <property name="visible">True</property> @@ -1869,20 +1868,20 @@ </widget> <packing> <property name="x">0</property> - <property name="y">56</property> + <property name="y">8</property> </packing> </child> <child> - <widget class="GtkLabel" id="lblLightL"> - <property name="width_request">138</property> - <property name="height_request">16</property> + <widget class="GtkLabel" id="lblSound"> + <property name="width_request">46</property> + <property name="height_request">17</property> <property name="visible">True</property> <property name="label" translatable="yes"> </property> <property name="use_underline">False</property> <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_RIGHT</property> - <property name="wrap">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> @@ -1894,8 +1893,8 @@ <property name="angle">0</property> </widget> <packing> - <property name="x">0</property> - <property name="y">8</property> + <property name="x">312</property> + <property name="y">56</property> </packing> </child> @@ -1967,7 +1966,6 @@ <child> <widget class="GtkTextView" id="txtTTS"> - <property name="border_width">2</property> <property name="width_request">348</property> <property name="height_request">62</property> <property name="visible">True</property> Modified: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp 2007-12-07 10:55:13 UTC (rev 764) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp 2007-12-07 12:54:13 UTC (rev 765) @@ -25,6 +25,17 @@ self.__eyes_mutex = threading.Lock() self.__mouth_mutex = threading.Lock() self.__wings_mutex = threading.Lock() + + rules = [ + [['none', 'none', 'Eyes'], self.on_btnEyesRun_clicked, (None,)], + [['none', 'none', 'Mouth'], self.on_btnMouthRun_clicked, (None,)], + [['none', 'none', 'Wings'], self.on_btnWingsRun_clicked, (None,)], + [['none', 'none', 'Leds'], self.on_btnLEDRun_clicked, (None,)], + [['none', 'none', 'Flash'], tux.cmd.sound_play, (4,)], + [['none', 'Hide', 'Panel'], self.hide_tab, ()], + [['none', 'Show', 'Panel'], self.show_tab, ()], + ] + _me.voice_recognition.set_rules(rules) def update(self): tux.cmd.raw(0x31, 0, 0, 0) @@ -50,6 +61,15 @@ tux.event.on_mouth_open = None tux.event.on_mouth_close = None tux.event.on_spin_stop = None + tux.event.on_remote_bt[K_UP] = None + tux.event.on_remote_bt[K_DOWN] = None + tux.event.on_remote_bt[K_OK] = None + tux.event.on_remote_bt[K_LEFT] = None + tux.event.on_remote_bt[K_RIGHT] = None + tux.event.on_remote_bt[K_RED] = None + tux.event.on_remote_bt[K_GREEN] = None + tux.event.on_remote_bt[K_BLUE] = None + tux.event.on_remote_bt[K_YELLOW] = None def binding(self): ''' @@ -58,16 +78,29 @@ The light, battery and audio monitoring are also initialized here. ''' - tux.event.on_left_blue_led_on = self.on_left_led_on - tux.event.on_left_blue_led_off = self.on_left_led_off - tux.event.on_right_blue_led_on = self.on_right_led_on - tux.event.on_right_blue_led_off = self.on_right_led_off + ### Correct the leds inversion on the next daemon + tux.event.on_left_blue_led_on = self.on_right_led_on + tux.event.on_left_blue_led_off = self.on_right_led_off + tux.event.on_right_blue_led_on = self.on_left_led_on + tux.event.on_right_blue_led_off = self.on_left_led_off tux.event.on_eyes_open = self.on_eyes_open tux.event.on_eyes_close = self.on_eyes_close tux.event.on_mouth_open = self.on_mouth_open tux.event.on_mouth_close = self.on_mouth_close tux.event.on_spin_stop = self.on_spin_stop + tux.event.on_remote_bt[K_UP] = self.on_key_up #eyes + tux.event.on_remote_bt[K_DOWN] = self.on_key_down #wings + tux.event.on_remote_bt[K_OK] = self.on_key_ok #mouth + tux.event.on_remote_bt[K_LEFT] = self.on_key_left #spin right + tux.event.on_remote_bt[K_RIGHT] = self.on_key_right #spin left + tux.event.on_remote_bt[K_RED] = self.on_key_red #Run eyes + tux.event.on_remote_bt[K_GREEN] = self.on_key_green #Run mouth + tux.event.on_remote_bt[K_BLUE] = self.on_key_blue #Run wings + tux.event.on_remote_bt[K_YELLOW] = self.on_key_yellow #Run spinning + + + self.light_idx = tux.monitoring.insert(0x1B, self.on_light_level) self.battery_idx = tux.monitoring.insert(0x25, self.on_battery_level) tux.micro.on() @@ -260,21 +293,30 @@ tux.cmd.wings_on_free(int(value), int(freq)) def on_btnSpinLeft_pressed(self, widget, *args): + if tux.status.charger_state(): + return + self.get_widget('imgSpin').set_from_pixbuf(self.spin_left) tux.cmd.spinl_on_free(0) - self.get_widget('imgSpin').set_from_pixbuf(self.spin_left) - def on_btnSpinLeft_released(self, widget, *args): + if tux.status.charger_state(): + return tux.cmd.spinl_on_free(1) def on_btnSpinRight_pressed(self, widget, *args): + if tux.status.charger_state(): + return + self.get_widget('imgSpin').set_from_file(self.path+'spin_right.png') tux.cmd.spinr_on_free(0) - self.get_widget('imgSpin').set_from_file(self.path+'spin_right.png') def on_btnSpinRight_released(self, widget, *args): + if tux.status.charger_state(): + return tux.cmd.spinr_on_free(1) def on_btnSpinRun_clicked(self, widget, *args): + if tux.status.charger_state(): + return value = self.get_widget('spinSpin').get_value() freq = self.get_widget('slideSpin').get_value() if self.get_widget('radSpinDirLeft').get_active(): @@ -296,7 +338,8 @@ LED has been toggled by an event, and not by the user. ''' global __led_toggled_by_event - if __led_toggled_by_event: return + if __led_toggled_by_event: + return if widget.get_active(): tux.cmd.ledr_on() else: @@ -305,14 +348,14 @@ ## chkLEDLeft def on_chkLEDLeft_toggled(self, widget, *args): global __led_toggled_by_event - if __led_toggled_by_event: return + if __led_toggled_by_event: + return + if widget.get_active(): tux.cmd.ledl_on() else: tux.cmd.ledl_off() - def on_chkLEDRight_clicked(self, widget, *args): - print 'clicked' def on_btnTTS_clicked(self, widget, *args): textedit=self.get_widget('txtTTS') @@ -324,6 +367,8 @@ textedit=self.get_widget('txtTTS') buffer=textedit.get_buffer() buffer.set_text("") + + #################################################################### # # Tux events functions @@ -332,7 +377,6 @@ # All of these functions are declared in the 'binding' function. # #################################################################### - def on_right_led_on(self): global __led_toggled_by_event __led_toggled_by_event = True @@ -378,6 +422,39 @@ def on_spin_stop(self): self.get_widget('imgSpin').set_from_pixbuf(self.spin_off) + + +#-------------------------------- +# Remote events +#-------------------------------- + def on_key_up(self): + tux.cmd.eyes_on(2) + + def on_key_down(self): + tux.cmd.wings_on(2, 5) + + def on_key_ok(self): + tux.cmd.mouth_on(2) + + def on_key_left(self): + self.get_widget('imgSpin').set_from_pixbuf(self.spin_right) + tux.cmd.spinr_on(4) + + def on_key_right(self): + self.get_widget('imgSpin').set_from_pixbuf(self.spin_left) + tux.cmd.spinl_on(4) + + def on_key_red(self): + self.on_btnEyesRun_clicked(None) + + def on_key_green(self): + self.on_btnMouthRun_clicked(None) + + def on_key_blue(self): + self.on_btnWingsRun_clicked(None) + + def on_key_yellow(self): + self.on_btnSpinRun_clicked(None) def on_light_level(self, args): level = args[0]*256 + args[1] Modified: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/main.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/main.pyp 2007-12-07 10:55:13 UTC (rev 764) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/main.pyp 2007-12-07 12:54:13 UTC (rev 765) @@ -11,9 +11,19 @@ -def start_gadget(): +def start_gadget(): + tux.event.on_remote_bt[K_STANDBY] = on_standby _me.gui('widget').show_from_main() _me.run_main_loop() - + + +rules = [ + [['none', 'none', 'Eyes'], tux.cmd.eyes_on, (2,)], + [['none', 'none', 'Mouth'], tux.cmd.mouth_on, (2,)], + [['none', 'none', 'Wings'], tux.cmd.wings_on, (2,)], + [['none', 'none', 'Leds'], tux.cmd.leds_blink, (100,20)], + [['none', 'none', 'Flash'], tux.cmd.sound_play, (2,)], +] +_me.voice_recognition.set_rules(rules) start_gadget() Modified: software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml 2007-12-07 10:55:13 UTC (rev 764) +++ software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml 2007-12-07 12:54:13 UTC (rev 765) @@ -7,10 +7,13 @@ <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <help_text type='str'> </help_text> + <vr_Wings type='str'>Ailes</vr_Wings> <tabControl type='str'>Contrôle</tabControl> + <vr_Show type='str'>Afficher</vr_Show> <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_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> + <vr_Panel type='str'>Panneau</vr_Panel> <TTS type='str'>Lire</TTS> <gui_conf_delay_lb type='str'>Délai (sec)</gui_conf_delay_lb> <gui_conf_about_title type='str'>A propos</gui_conf_about_title> @@ -18,16 +21,21 @@ <radSpinDirLeft type='str'>A gauche</radSpinDirLeft> <tabStatus type='str'>Statuts</tabStatus> <Count type='str'>mouv.</Count> + <vr_Flash type='str'>Flash</vr_Flash> <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> <lblSoundL type='str'>Niveau de son</lblSoundL> <colValue type='str'>Valeur</colValue> <speaker_name type='str'>Bruno8k</speaker_name> + <vr_Hide type='str'>Cacher</vr_Hide> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <vr_Eyes type='str'>Yeux</vr_Eyes> <name_to_read type='str'>Commande de Tux Droid</name_to_read> <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> <TTSClear type='str'>Effacer</TTSClear> <lblLightL type='str'>Niveau de lumière</lblLightL> <Second type='str'>sec.</Second> + <vr_Mouth type='str'>Bouche</vr_Mouth> <colStatus type='str'>Statut</colStatus> + <vr_Leds type='str'>Leds</vr_Leds> </strings> Modified: software/gadgets/tux_controller/trunk/TuxController/about.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/about.xml 2007-12-07 10:55:13 UTC (rev 764) +++ software/gadgets/tux_controller/trunk/TuxController/about.xml 2007-12-07 12:54:13 UTC (rev 765) @@ -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'>tux_controller</gadget_name> - <gadget_author type='str'>Paul Rathgeb</gadget_author> <gadget_description type='str'>Empty gadget for Tux Droid.</gadget_description> - <gadget_version type='str'>0.0.1</gadget_version> </about> Modified: software/gadgets/tux_controller/trunk/TuxController/strings.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/strings.xml 2007-12-07 10:55:13 UTC (rev 764) +++ software/gadgets/tux_controller/trunk/TuxController/strings.xml 2007-12-07 12:54:13 UTC (rev 765) @@ -7,10 +7,13 @@ <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <help_text type='str'> </help_text> + <vr_Wings type='str'>Wings</vr_Wings> <tabControl type='str'>Control</tabControl> + <vr_Show type='str'>Show</vr_Show> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Update</gui_conf_update_title> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> + <vr_Panel type='str'>Panel</vr_Panel> <TTS type='str'>Play</TTS> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <gui_conf_about_title type='str'>About</gui_conf_about_title> @@ -18,16 +21,21 @@ <radSpinDirLeft type='str'>Spin left</radSpinDirLeft> <tabStatus type='str'>Status</tabStatus> <Count type='str'>count</Count> + <vr_Flash type='str'>Flash</vr_Flash> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <lblSoundL type='str'>Sound level</lblSoundL> <colValue type='str'>Value</colValue> <speaker_name type='str'>Ryan8k</speaker_name> + <vr_Hide type='str'>Hide</vr_Hide> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <vr_Eyes type='str'>Eyes</vr_Eyes> <name_to_read type='str'>Tux Droid Controler</name_to_read> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> <TTSClear type='str'>Clear</TTSClear> <lblLightL type='str'>Light level</lblLightL> <Second type='str'>sec.</Second> + <vr_Mouth type='str'>Mouth</vr_Mouth> <colStatus type='str'>Status</colStatus> + <vr_Leds type='str'>Leds</vr_Leds> </strings> Modified: software/gadgets/tux_controller/trunk/TuxController.tgf =================================================================== (Binary files differ) |
From: jaguarondi <c2m...@c2...> - 2007-12-07 10:55:13
|
Author: jaguarondi Date: 2007-12-07 11:55:13 +0100 (Fri, 07 Dec 2007) New Revision: 764 Modified: firmware/tuxaudio/trunk/bootloader.c Log: * Bootloader I2C addresses moved. Modified: firmware/tuxaudio/trunk/bootloader.c =================================================================== --- firmware/tuxaudio/trunk/bootloader.c 2007-12-07 10:51:23 UTC (rev 763) +++ firmware/tuxaudio/trunk/bootloader.c 2007-12-07 10:55:13 UTC (rev 764) @@ -24,7 +24,7 @@ #include <avr/pgmspace.h> #include <util/twi.h> #include <avr/eeprom.h> -#include "common/commands.h" +#include "common/defines.h" typedef union { |
From: jaguarondi <c2m...@c2...> - 2007-12-07 10:51:21
|
Author: jaguarondi Date: 2007-12-07 11:51:23 +0100 (Fri, 07 Dec 2007) New Revision: 763 Modified: firmware/tuxcore/trunk/Makefile Log: * Flashing the bootloader first avoids avrdude reporting a mismatch error. Modified: firmware/tuxcore/trunk/Makefile =================================================================== --- firmware/tuxcore/trunk/Makefile 2007-12-07 10:04:27 UTC (rev 762) +++ firmware/tuxcore/trunk/Makefile 2007-12-07 10:51:23 UTC (rev 763) @@ -214,13 +214,13 @@ progisp_bl: $(PROJECT).hex $(PROJECT).eep $(PROJECT)_bl.hex $(AVRDUDE) -p $(MCU) -c jtag2isp -P usb -B 10 -e \ - -U flash:w:$(PROJECT).hex -U eeprom:w:$(PROJECT).eep -D \ - -U flash:w:$(PROJECT)_bl.hex + -U flash:w:$(PROJECT)_bl.hex -U eeprom:w:$(PROJECT).eep -D \ + -U flash:w:$(PROJECT).hex progstk: $(PROJECT).hex $(PROJECT).eep $(AVRDUDE) -p $(MCU) -c stk500v2 -e -U flash:w:$(PROJECT).hex \ -U eeprom:w:$(PROJECT).eep progstk_bl: $(PROJECT).hex $(PROJECT).eep $(PROJECT)_bl.hex - $(AVRDUDE) -p $(MCU) -c stk500v2 -e -U flash:w:$(PROJECT).hex \ - -U eeprom:w:$(PROJECT).eep -D -U flash:w:$(PROJECT)_bl.hex + $(AVRDUDE) -p $(MCU) -c stk500v2 -e -U flash:w:$(PROJECT)_bl.hex \ + -U eeprom:w:$(PROJECT).eep -D -U flash:w:$(PROJECT).hex |
From: Paul_R <c2m...@c2...> - 2007-12-07 10:04:26
|
Author: Paul_R Date: 2007-12-07 11:04:27 +0100 (Fri, 07 Dec 2007) New Revision: 762 Modified: firmware/tuxcore/trunk/motors.c Log: * Added a check when the spin direction is changing, to not increment the counter when an infinite movement is required. Modified: firmware/tuxcore/trunk/motors.c =================================================================== --- firmware/tuxcore/trunk/motors.c 2007-12-06 17:37:00 UTC (rev 761) +++ firmware/tuxcore/trunk/motors.c 2007-12-07 10:04:27 UTC (rev 762) @@ -682,7 +682,8 @@ * value to prevent counting the first switch detection that will happen as * soon as the rotation starts. */ if ((spin_direction == RIGHT) && (PSW_SPIN_PIN & PSW_SPIN_MK)) - spin_move_counter++; + if (spin_move_counter) + spin_move_counter++; spin_direction = LEFT; spin_PWM = pwm; spin_PWM_mask &= ~MOT_SPIN_R_MK; @@ -704,7 +705,8 @@ * value to prevent counting the first switch detection that will happen as * soon as the rotation starts. */ if ((spin_direction == LEFT) && (PSW_SPIN_PIN & PSW_SPIN_MK)) - spin_move_counter++; + if (spin_move_counter) + spin_move_counter++; spin_direction = RIGHT; spin_PWM = pwm; spin_PWM_mask &= ~MOT_SPIN_L_MK; |
From: jaguarondi <c2m...@c2...> - 2007-12-06 17:37:01
|
Author: jaguarondi Date: 2007-12-06 18:37:00 +0100 (Thu, 06 Dec 2007) New Revision: 761 Modified: firmware/tuxdefs/api.h firmware/tuxdefs/commands.h firmware/tuxdefs/config.h firmware/tuxdefs/defines.h Log: * And here are the defines that should go with the previous commit. Enjoy. Modified: firmware/tuxdefs/api.h =================================================================== --- firmware/tuxdefs/api.h 2007-12-06 17:32:44 UTC (rev 760) +++ firmware/tuxdefs/api.h 2007-12-06 17:37:00 UTC (rev 761) @@ -188,6 +188,70 @@ */ #define SOUND_VAR_CMD 0xCB +/*! @} */ + +/** + * \name LEDs + * The blue LEDs located inside tux's eyes can be controlled individually by + * changing their intensity from 0 (OFF) to 255 (ON). + * @{ */ + +/** + * Set the rate and step which determine the speed of the fading effect. + * + * The fading increases or decreases the intensity by 'step' each 'rate' times + * 4ms. + * + * Parameters: + * - 1 - LEDs affected by the command, either left, right or both. + * The values are defined in LEDS_t. + * - 2 - rate of the fading effect, the time base is 4ms. + * A value from 1 to 255 will change the rate, + * 0 will leave it unaffected. + * - 3 - step of the fading effect. + * A value from 1 to 255 will change the step, + * 0 will leave it unaffected. + */ +#define LED_FADE_SPEED_CMD 0xD0 + +/** + * Set both LEDs to a given intensity with a fading effect controlled by + * 'rate' and 'step'. + * + * Parameters: + * - 1 - Which LEDs. + * - 2 - Intensity that the LEDs should be set to. Fading may be applied if + * set. + */ +#define LED_SET_CMD 0xD1 + +/** + * Set the intensity boundaries for the blink command. + * + * Parameters: + * - 1 - Which LEDs. + * - 2 - Maximum intensity. + * - 3 - Minimum intensity. + */ +#define LED_BLINK_RANGE_CMD 0xD2 + +/** + * Blink LEDs 'number' times with a frequency determined by 'pulse_width'. + * + * Parameters: + * - 1 - Which LEDs + * - 2 - Number of toggles the LED should do. + * - 3 - Pulse width of the blinking effect. Affected by the fading effect. + * + * The pulse width won't be shorter than what is set for the fading effect, + * even if you set a low value here. + */ +#define LED_BLINK_CMD 0xD3 + +/*! @} */ + +/*! @} */ + /** States of the audio recording (flash programming) process */ typedef enum audiorec_status { @@ -200,8 +264,5 @@ NO_SOUND, } audiorec_status_t; -/*! @} */ - -/*! @} */ #endif /* _API_H_ */ Modified: firmware/tuxdefs/commands.h =================================================================== --- firmware/tuxdefs/commands.h 2007-12-06 17:32:44 UTC (rev 760) +++ firmware/tuxdefs/commands.h 2007-12-06 17:37:00 UTC (rev 761) @@ -87,7 +87,6 @@ #define LED_L_OFF_CMD 0x1D /* Turn left LED off */ #define LED_R_ON_CMD 0x1E /* Turn right LED on */ #define LED_R_OFF_CMD 0x1F /* Turn right LED off */ -#define LED_BLINK_CMD 0x9A /* Blink both LEDs multiple time */ /* 1st parameter: number of LED toggles */ /* 2nd parameter: delay between each LED toggle, in multiple of 4ms */ @@ -105,7 +104,7 @@ /* 1st parameter: 1 to write the sound * 0 to not write the sound*/ -#define ERASE_FLASH_CMD 0xD0 /* get indexes of the flash sound bank [1] */ +#define ERASE_FLASH_CMD 0x54 /* get indexes of the flash sound bank [1] */ #define TEST_SOUND_CMD 0x10 /* test the audio input and output [1] */ #define MUTE_CMD 0x92 /* mute/unmute the audio amplifier */ Modified: firmware/tuxdefs/config.h =================================================================== --- firmware/tuxdefs/config.h 2007-12-06 17:32:44 UTC (rev 760) +++ firmware/tuxdefs/config.h 2007-12-06 17:37:00 UTC (rev 761) @@ -26,6 +26,7 @@ #include "commands.h" #include "api.h" +#include "defines.h" /* * Standalone events @@ -48,26 +49,29 @@ /* Head button event */ #define HEAD_E_SEQ {\ - 0, LED_BLINK_CMD, 2, 30, 0, /* blink led's once */\ + 0, LED_FADE_SPEED_CMD, 3, 1, 10, \ + 0, LED_BLINK_CMD, 3, 2, 30, /* blink led's once */\ END_OF_ACTIONS\ } /* Left flipper button event */ #define LEFT_FLIP_E_SEQ {\ - 0, LED_BLINK_CMD, 2, 30, 0, /* blink led's once */\ + 0, LED_FADE_SPEED_CMD, 3, 1, 10, \ + 0, LED_BLINK_CMD, 3, 2, 30, /* blink led's once */\ END_OF_ACTIONS\ } /* Right flipper event */ #define RIGHT_FLIP_E_SEQ {\ - 0, LED_BLINK_CMD, 2, 30, 0, /* blink led's once */\ + 0, LED_FADE_SPEED_CMD, 3, 1, 10, \ + 0, LED_BLINK_CMD, 3, 2, 30, /* blink led's once */\ END_OF_ACTIONS\ } /* Start charging event */ #define CHARGER_START_E_SEQ {\ 0, MOVE_MOUTH_CMD, 2, 0, 0, /* move the mouth */\ - 0, LED_BLINK_CMD, 4, 50, 0, /* blink led's twice */\ + 0, LED_BLINK_CMD, 3, 4, 50, /* blink led's twice */\ 0, PLAY_SOUND_CMD, 3, 0, 0, /* play a sound */\ END_OF_ACTIONS\ } @@ -82,8 +86,8 @@ /* Entering sleep event */ #define SLEEP_ENTER_E_SEQ {\ 10, CLOSE_EYES_CMD, PLAY_SOUND_CMD, 1, 0, /* */\ - /* the delay (first byte) is necessary for the movement to complete before - * sleep is entered */\ + /* the delay (first byte set to 10) is necessary for the movement \ + * to complete before sleep is entered */ \ END_OF_ACTIONS\ } @@ -95,13 +99,13 @@ /* RF connection event */ #define RF_CONN_E_SEQ {\ - 0, LED_ON_CMD, 0, 0, 0, /* tun on the leds */\ + 0, LED_SET_CMD, LED_BOTH, 0xFF, 0, /* turn on the leds */\ END_OF_ACTIONS\ } /* RF disconnection event */ #define RF_DISCONN_E_SEQ {\ - 0, LED_OFF_CMD, 0, 0, 0, /* tun off the leds */\ + 0, LED_SET_CMD, LED_BOTH, 0, 0, /* turn off the leds */\ END_OF_ACTIONS\ } Modified: firmware/tuxdefs/defines.h =================================================================== --- firmware/tuxdefs/defines.h 2007-12-06 17:32:44 UTC (rev 760) +++ firmware/tuxdefs/defines.h 2007-12-06 17:37:00 UTC (rev 761) @@ -164,6 +164,24 @@ /*! @} */ /** + * \name LEDs + */ +/*! @{ */ +/** + * Type indicating which led should be affected by the command. + * The left LED is affected to bit0 and the right LED is at bit1. This + * simplifies comparisons. + */ +typedef enum +{ + LED_LEFT = 0x01, + LED_RIGHT = 0x02, + LED_BOTH = 0x03, +} LEDS_t; + +/*! @} */ + +/** * \name Movements */ /*! @{ */ |
From: jaguarondi <c2m...@c2...> - 2007-12-06 17:33:37
|
Author: jaguarondi Date: 2007-12-06 18:32:44 +0100 (Thu, 06 Dec 2007) New Revision: 760 Modified: firmware/tuxcore/trunk/adc.c firmware/tuxcore/trunk/led.c firmware/tuxcore/trunk/led.h firmware/tuxcore/trunk/main.c firmware/tuxcore/trunk/parser.c firmware/tuxcore/trunk/standalone.c Log: * Complete rework of the led module to add intensity control and fading effects. This is major change which was not so trivial so expect bugs. The code is not always neat, some further optimizations have to be done but I want to try it out first. All in all it's a pretty nice effect which gives tux a much better impression. Modified: firmware/tuxcore/trunk/adc.c =================================================================== --- firmware/tuxcore/trunk/adc.c 2007-12-06 17:18:59 UTC (rev 759) +++ firmware/tuxcore/trunk/adc.c 2007-12-06 17:32:44 UTC (rev 760) @@ -29,7 +29,7 @@ #include "adc.h" -/** Union between 16 bits variables and the two 8 bits registers they're made +/* Union between 16 bits variables and the two 8 bits registers they're made * of. */ typedef union { Modified: firmware/tuxcore/trunk/led.c =================================================================== --- firmware/tuxcore/trunk/led.c 2007-12-06 17:18:59 UTC (rev 759) +++ firmware/tuxcore/trunk/led.c 2007-12-06 17:32:44 UTC (rev 760) @@ -24,72 +24,381 @@ \ingroup led */ +#include <stdbool.h> +#include <avr/interrupt.h> + #include "led.h" -/** Buffer the LEDs values before being applied on the I/O port. - * \ingroup led */ +/** Buffer the LEDs values before being applied on the I/O port. */ uint8_t leds_buffer = 0; -/** Counter for the delay between 2 toggles of the LEDs. */ -static uint8_t led_delay; -/** Delay between 2 toggles of the LEDs when blinking them. */ -static uint8_t led_blinking_pw; -/** Number of times the LEDs should be toggled when blinking. */ -static uint8_t led_blinking_cnt; +/** Left LED status structure. */ +led_t left_led = +{ + .command.step=2, + .command.rate=1, + .blink.max_intensity = 0xFF, +}; + +/** Right LED status structure. */ +led_t right_led = +{ + .command.step=2, + .command.rate=1, + .blink.max_intensity = 0xFF, +}; + /** - \brief Blink LEDs - \ingroup led - \param cnt Number of blinks - \param pulse_width Blinking pulse width + \brief Turn left LED on. + */ +#define turn_left_led_on() \ + do {leds_buffer |= LED_L_MK; \ + TIMSK1 |= _BV(OCIE1A); \ + } while(0) - The LEDs will be toggled 'cnt' times. The pulse width can be used to change - the toggle frequency. -*/ -void blink_leds(uint8_t cnt, uint8_t pulse_width) +/** + \brief Turn right LED on. + */ +#define turn_right_led_on() \ + do {leds_buffer |= LED_R_MK; \ + TIMSK1 |= _BV(OCIE1B); \ + } while(0) + +/** + \brief Turn left LED off. + */ +#define turn_left_led_off() \ + do {leds_buffer &= ~LED_L_MK; \ + TIMSK1 &= ~_BV(OCIE1A); \ + LED_PT &= ~LED_L_MK; \ + } while(0) + +/** + \brief Turn right LED off. + */ +#define turn_right_led_off() \ + do {leds_buffer &= ~LED_R_MK; \ + TIMSK1 &= ~_BV(OCIE1B); \ + LED_PT &= ~LED_R_MK; \ + } while(0) + +/** + * Timer1 initialization, used for applying PWM on the LEDs in order to change + * their intensity and have some fading effects. + * \ingroup led + * + * Settings: + * - Fast PWM, 8-bit mode. + * - CLK/8 = 1MHz + * + * Timer is clocked at 1MHz (CLK/8) as this frequency doesn't seem to disturb + * the IR receiver too much. Slower frequencies does. + * Output Compare A and B are used for toggling LEDs left and right so they can + * be controlled separately. + */ +void led_init(void) { - if (led_delay) /* cancel the blink if one is already happening */ - return; - if (!cnt) - return; - cnt--; /* the first toggle occurs here */ - toggle_leds(); - if (!cnt) /* if one toggle, nothing more to do */ - return; - led_delay = pulse_width; - led_blinking_pw = pulse_width; - led_blinking_cnt = cnt; + TCCR1A = _BV(WGM10); + TCCR1B = _BV(WGM12) | _BV(CS11); + TIMSK1 = _BV(TOIE1); } /** + * Shutting down the LEDs for power saving. + * \ingroup led + */ +void led_shutdown(void) +{ + TCCR1B = 0; + turn_left_led_off(); + turn_right_led_off(); +} + +/** \brief Refresh the LEDs I/O with the buffer value. - \ingroup led */ -void refresh_leds(void) +static inline void refresh_leds(void) { /* We should avoid glitches on the LEDs otherwise the IR receiver goes * crazy. So we can't simply set the output pins to 0 then set them with * leds_buffer. Only the pin that should be 0 has to be set to 0. */ - LED_PT &= ~(leds_buffer ^ LED_MK); + /* Commented until a better solution is found for driving the leds */ + //LED_PT &= ~(leds_buffer ^ LED_MK); // done in the 4ms loop for now LED_PT |= leds_buffer; } /** - \brief Periodic routine that controls the LEDs. + * Timer1 overflow interrupt, sets the LEDs for the PWM. + */ +ISR(SIG_OVERFLOW1) +{ + refresh_leds(); +} + +/** + * Timer1 compare A interrupt, clear the left LED for the PWM. + */ +ISR(SIG_OUTPUT_COMPARE1A) +{ + LED_PT &= ~LED_L_MK; +} + +/** + * Timer1 compare B interrupt, clear the right LED for the PWM. + */ +ISR(SIG_OUTPUT_COMPARE1B) +{ + LED_PT &= ~LED_R_MK; +} + +/** + \brief Blink LEDs \ingroup led + \param leds Which LEDs are affected by the command + \param cnt Number of blinks. 0 is ignored, 255 (0xFF) means infinite. + \param pulse_width Blinking pulse width. 0 is ignored. - This function should be called regularly as it controls the blinking. The - period this function is called will be the unit period of the led blinking. + The LEDs will be toggled 'cnt' times. The pulse width can be used to change + the toggle frequency. + If 'cnt' or 'pulse_width' are set to 0, the register is not updated so the + old value is kept. + 'cnt' can be set to 255 to trigger an infinite blinking effect. +*/ +void led_blink(LEDS_t leds, uint8_t const cnt, uint8_t const pulse_width) +{ + /* XXX we should really find a way to optimize this loop for the 2 leds. + * We don't want to add a new function call, bu don't want to have the code + * written twice. Maybe an inline function can do it with compiler + * optimizations. */ + led_t *led = &left_led; + + while (leds & LED_BOTH) + { + if (leds & LED_LEFT) + { + leds &= ~LED_LEFT; + /* Here, we should already have led = &left_led;*/ + } + else if (leds & LED_RIGHT) + { + leds &= ~LED_RIGHT; + led = &right_led; + } + led->status.blinking = true; + led->blink.pulse_width = pulse_width; + if (cnt) + { + led->blink.count = cnt; + /* We can't simply set the flag here otherwise we alter the ongoing + * blinking. So we need to check for blinking first. */ + if (!led->var.blink_tmr) + led->var.blink_flag = true; + } + } +} + +/** + \brief Set the intensity boundaries for the blink command. + \ingroup led + \param leds Which LEDs are affected by the command + \param max Maximum intensity + \param min Minimum intensity +*/ +void led_blink_range(LEDS_t leds, uint8_t const max, uint8_t const min) +{ + led_t *led = &left_led; + + while (leds & LED_BOTH) + { + if (leds & LED_LEFT) + { + leds &= ~LED_LEFT; + /* Here, we should already have led = &left_led;*/ + } + else if (leds & LED_RIGHT) + { + leds &= ~LED_RIGHT; + led = &right_led; + } + led->blink.max_intensity = max; + led->blink.min_intensity = min; + } +} + +/** + \brief Set the rate and step which determine the speed of the fading effect. + \ingroup led + \param leds Which LEDs are affected by the command + \param rate Rate at which the intensity is changed. See struct led_comand. + \param step Intenisty step applied when fading. */ -void led_control(void) +void led_set_fade_speed(LEDS_t leds, uint8_t const rate, uint8_t const step) { - if (led_delay) + led_t *led = &left_led; + + while (leds & LED_BOTH) { - led_delay--; - if (!led_delay) + if (leds & LED_LEFT) { - toggle_leds(); - if (--led_blinking_cnt) - led_delay = led_blinking_pw; + leds &= ~LED_LEFT; + /* Here, we should already have led = &left_led;*/ } + else if (leds & LED_RIGHT) + { + leds &= ~LED_RIGHT; + led = &right_led; + } + if (rate) + led->command.rate = rate; + if (step) + led->command.step = step; } } + +/** + \brief Set LEDs intensity with fading effect. + \ingroup led + \param leds Set left, right or both leds. + \param intensity 8 bits PWM value the led should be set to. + */ +void led_set_intensity(LEDS_t leds, uint8_t const intensity) +{ + led_t *led = &left_led; + + while (leds & LED_BOTH) + { + if (leds & LED_LEFT) + { + leds &= ~LED_LEFT; + /* Here, we should already have led = &left_led;*/ + } + else if (leds & LED_RIGHT) + { + leds &= ~LED_RIGHT; + led = &right_led; + } + led->command.setpoint = intensity; + led->status.fading = true; + } +} + +/** + \brief Handles intensity fading. + \param led Pointer to the led structure + + Set the new intensity and set the fading flag to false when fading is + completed. + */ +static void fading(led_t *led) +{ + if (!led->var.rate_cnt) + { + if (led->command.setpoint > led->status.intensity) + { + if (led->status.intensity + led->command.step + >= led->command.setpoint) + { + led->status.intensity = led->command.setpoint; + led->status.fading = false; + return; + } + else + led->status.intensity += led->command.step; + } + else + /* led->command.setpoint < led->status.intensity here */ + { + if (led->status.intensity - led->command.step + <= led->command.setpoint) + { + led->status.intensity = led->command.setpoint; + led->status.fading = false; + return; + } + else + led->status.intensity -= led->command.step; + } + led->var.rate_cnt = led->command.rate; + } + /* we decrease in all cases, i.e. if rate == 1, cnt will be set to 0 when + * leaving the function and so will only loop one time */ + led->var.rate_cnt--; +} + +/** + \brief Handles the blinking effect. + \param led Pointer to the led structure + + Set the new fading settings if more blinking has to be done. + */ +static void blinking(led_t *led) +{ + /* Infinite blinking or next blink. */ + if ((led->blink.count == 0xFF) || --led->blink.count) + led->var.blink_tmr = led->blink.pulse_width; + else + led->status.blinking = false; + if (led->status.intensity <= led->blink.min_intensity) + led->command.setpoint = led->blink.max_intensity; + else + (led->command.setpoint = led->blink.min_intensity); + led->status.fading = true; + /* Add the intermediate delay between 2 fades. */ + led->var.rate_cnt = led->command.rate; +} + +static inline void control_call(led_t *led) +{ + /* Do we need fading? */ + if (led->status.fading) + fading(led); + + /* Check the blinking pulse width. */ + if (led->var.blink_tmr) + { + led->var.blink_tmr--; + if (!led->var.blink_tmr) + led->var.blink_flag = true; + } + if (!led->status.fading) + /* When fading is done, check if we need to blink again. */ + if (led->var.blink_flag) + { + blinking(led); + led->var.blink_flag = false; + } +} + +/** + \brief Periodic routine that controls the LEDs. + \ingroup led + \param mask If set, masking is applied on the LEDs so they don't light. Used + when the eyes are closed, it's neater. + + This function should be called regularly as it controls the blinking. The + period this function is called will be the unit period of the led blinking. + */ +void led_control(bool mask) +{ + control_call(&left_led); + control_call(&right_led); + + /* This circumvent the bug we have when the OCR values are too low (<5 it + * seems), interrupt priority of the comparisons is higher than the + * overflow so when 2 interrupts occurs nearly simultaneously, the compare + * is done before the overflow which is not what we want. The result is + * that the led is ON instead of OFF with low values. XXX should find a way + * to fix that. */ + if (left_led.status.intensity <= 5 || mask) + turn_left_led_off(); + else + turn_left_led_on(); + if (right_led.status.intensity <= 5 || mask) + turn_right_led_off(); + else + turn_right_led_on(); + + /* Update the PWM registers. */ + OCR1AL = left_led.status.intensity; + OCR1BL = right_led.status.intensity; +} Modified: firmware/tuxcore/trunk/led.h =================================================================== --- firmware/tuxcore/trunk/led.h 2007-12-06 17:18:59 UTC (rev 759) +++ firmware/tuxcore/trunk/led.h 2007-12-06 17:32:44 UTC (rev 760) @@ -24,89 +24,64 @@ \ingroup led */ -/** \defgroup led Leds - The led module contains the functions that drive the eye LEDs. +/** \defgroup led LEDs + The LED module contains the functions that drive the eye LEDs. */ #ifndef _LED_H_ #define _LED_H_ +#include <stdbool.h> #include "hardware.h" +#include "common/defines.h" -extern uint8_t leds_buffer; - /** - \brief Turn both LEDs on. \ingroup led + LED status structure holding all information necessary to handle intensity, + fading and blinking effects. */ -#define turn_leds_on() (leds_buffer |= LED_MK) +typedef struct led_t +{ + struct led_status + { + uint8_t intensity; + bool fading; + bool blinking; + } status; + struct led_command + { + uint8_t setpoint; + uint8_t rate; + uint8_t step; + } command; + struct led_blink + { + uint8_t min_intensity; + uint8_t max_intensity; + /** Number of times the LEDs should be toggled when blinking. */ + uint8_t count; + /** Delay between 2 toggles of the LEDs when blinking them. */ + uint8_t pulse_width; + } blink; + struct led_var + { + uint8_t rate_cnt; + /** Timer for the delay between 2 toggles of the LEDs. */ + uint8_t blink_tmr; + bool blink_flag; + } var; +} led_t; -/** - \brief Turn both LEDs off. - \ingroup led - */ -#define turn_leds_off() (leds_buffer &= ~LED_MK) +extern led_t left_led; +extern led_t right_led; -/** - \brief Turn left led on. - \ingroup led - */ -#define turn_left_led_on() (leds_buffer |= LED_L_MK) +void led_init(void); +void led_shutdown(void); +void led_set_fade_speed(LEDS_t leds, uint8_t const rate, uint8_t const step); +void led_set_intensity(LEDS_t leds, uint8_t const intensity); +void led_blink_range(LEDS_t leds, uint8_t const max, uint8_t const min); +void blink_led(led_t *const led, uint8_t const cnt, uint8_t const pulse_width); +void led_blink(LEDS_t led, uint8_t const cnt, uint8_t const pulse_width); +void led_control(bool mask); -/** - \brief Turn right led on. - \ingroup led - */ -#define turn_right_led_on() (leds_buffer |= LED_R_MK) - -/** - \brief Turn left led off. - \ingroup led - */ -#define turn_left_led_off() (leds_buffer &= ~LED_L_MK) - -/** - \brief Turn right led off. - \ingroup led - */ -#define turn_right_led_off() (leds_buffer &= ~LED_R_MK) - -/** - \brief Read the value of the LEDs. - \ingroup led - */ -#define read_leds() (leds_buffer) - -/** - \brief Toggle LEDs. - \ingroup led - */ -#define toggle_leds() (leds_buffer ^= LED_MK) - -/** - \brief Toggle left led. - \ingroup led - */ -#define toggle_left_led() (leds_buffer ^= LED_L_MK) - -/** - \brief Toggle right led. - \ingroup led - */ -#define toggle_right_led() (leds_buffer ^= LED_R_MK) - -/** - \brief Turn both LEDs off directly on the I/O port. - \ingroup led - - This function is used to switch off the LEDs when the eyes are closed. - You shouldn't use this function elsewhere as the I/O port will be refreshed - immediately with the leds_buffer value. - */ -#define mask_leds() (LED_PT &= ~LED_MK) - -extern void blink_leds(uint8_t cnt, uint8_t pulse_width); -extern void refresh_leds(void); -extern void led_control(void); - #endif /* _LED_H_ */ Modified: firmware/tuxcore/trunk/main.c =================================================================== --- firmware/tuxcore/trunk/main.c 2007-12-06 17:18:59 UTC (rev 759) +++ firmware/tuxcore/trunk/main.c 2007-12-06 17:32:44 UTC (rev 760) @@ -140,6 +140,7 @@ initIO(); sensors_init(); config_init(); + led_init(); /* I2C communication initialization */ i2cCommunicationInit(); @@ -168,14 +169,10 @@ ir_delay--; /* Led blinking. */ - led_control(); + led_control(cond_flags.eyes_closed); /* Refresh the leds. When the eyes are closed, the leds are * switched off. They'll be refreshed again with the buffered value * when the eyes will reopen. */ - if (cond_flags.eyes_closed) - mask_leds(); - else - refresh_leds(); } if (t100ms_flag) { @@ -254,7 +251,7 @@ PCICR = 0; EIMSK = 0; ADCSRA = 0; - turn_leds_off(); + led_shutdown(); turnIrOff(); } Modified: firmware/tuxcore/trunk/parser.c =================================================================== --- firmware/tuxcore/trunk/parser.c 2007-12-06 17:18:59 UTC (rev 759) +++ firmware/tuxcore/trunk/parser.c 2007-12-06 17:32:44 UTC (rev 760) @@ -132,36 +132,23 @@ { stop_spinning(); } - /* Leds */ - else if (command[0] == LED_ON_CMD) + else if (command[0] == LED_BLINK_RANGE_CMD) { - turn_leds_on(); + led_blink_range(command[1], command[2], command[3]); } - else if (command[0] == LED_OFF_CMD) + else if (command[0] == LED_BLINK_CMD) { - turn_leds_off(); + led_blink(command[1], command[2], command[3]); } - else if (command[0] == LED_L_ON_CMD) + else if (command[0] == LED_FADE_SPEED_CMD) { - turn_left_led_on(); + led_set_fade_speed(command[1], command[2], command[3]); } - else if (command[0] == LED_L_OFF_CMD) + else if (command[0] == LED_SET_CMD) { - turn_left_led_off(); + led_set_intensity(command[1], command[2]); } - else if (command[0] == LED_R_ON_CMD) - { - turn_right_led_on(); - } - else if (command[0] == LED_R_OFF_CMD) - { - turn_right_led_off(); - } - else if (command[0] == LED_BLINK_CMD) - { - blink_leds(command[1], command[2]); - } else if (command[0] == IR_SEND_RC5_CMD) { irSendRC5(command[1], command[2]); @@ -220,6 +207,36 @@ return; } + /* Deprecated functions, may be removed in firmware v0.5. */ + else if (command[0] == LED_ON_CMD) + { + led_set_intensity(LED_BOTH, 0xFF); + } + else if (command[0] == LED_OFF_CMD) + { + led_set_intensity(LED_BOTH, 0x0); + } + else if (command[0] == LED_L_ON_CMD) + { + led_set_intensity(LED_LEFT, 0xFF); + } + else if (command[0] == LED_L_OFF_CMD) + { + led_set_intensity(LED_LEFT, 0x0); + } + else if (command[0] == LED_R_ON_CMD) + { + led_set_intensity(LED_RIGHT, 0xFF); + } + else if (command[0] == LED_R_OFF_CMD) + { + led_set_intensity(LED_RIGHT, 0x0); + } + else if (command[0] == 0x9A) /* old blink function */ + { + led_blink(3, command[1], command[2]); + } + /* Undefined commands */ else return; /* simply drop it */ Modified: firmware/tuxcore/trunk/standalone.c =================================================================== --- firmware/tuxcore/trunk/standalone.c 2007-12-06 17:18:59 UTC (rev 759) +++ firmware/tuxcore/trunk/standalone.c 2007-12-06 17:32:44 UTC (rev 760) @@ -212,13 +212,13 @@ if (gStatus. sw & (GSTATUS_LEFTWINGBTN_MK | GSTATUS_RIGHTWINGBTN_MK | GSTATUS_HEADBTN_MK)) - turn_left_led_on(); + led_set_intensity(LED_LEFT, 0xFF); else - turn_left_led_on(); + led_set_intensity(LED_LEFT, 0); if ((gStatus.sw & GSTATUS_POWERPLUGSW_MK)) - turn_right_led_on(); + led_set_intensity(LED_RIGHT, 0xFF); else - turn_right_led_off(); + led_set_intensity(LED_RIGHT, 0); } /* IR signal processing */ @@ -231,7 +231,7 @@ /* IR feedback signal */ if (tux_config.ir_feedback) - blink_leds(2, 4); + led_blink(LED_BOTH, 2, 4); /* ALT KEYS */ if (alt_mode) @@ -296,10 +296,10 @@ tux_config.ir_feedback = !tux_config.ir_feedback; break; case K_CHANNELPLUS: - toggle_right_led(); + led_blink(LED_RIGHT, 1, 0); break; case K_VOLUMEPLUS: - toggle_left_led(); + led_blink(LED_LEFT, 1, 0); break; case K_FASTREWIND: if (spin_PWM) |
From: jaguarondi <c2m...@c2...> - 2007-12-06 17:18:58
|
Author: jaguarondi Date: 2007-12-06 18:18:59 +0100 (Thu, 06 Dec 2007) New Revision: 759 Modified: firmware/tuxcore/trunk/sensors.c Log: * Minor changes. Modified: firmware/tuxcore/trunk/sensors.c =================================================================== --- firmware/tuxcore/trunk/sensors.c 2007-12-06 17:17:52 UTC (rev 758) +++ firmware/tuxcore/trunk/sensors.c 2007-12-06 17:18:59 UTC (rev 759) @@ -65,7 +65,7 @@ else if (sensorsControlState == 1) { light_control(ADC_read()); - if (gStatus.mot != 0) + if (gStatus.mot) motorsStatus = 1; ADC_start(BATTERY_ADMUX); // XXX arg : ADMUX @@ -73,7 +73,7 @@ } else if (sensorsControlState == 2) { - if (gStatus.mot != 0) + if (gStatus.mot) motorsStatus = 1; battery_control(ADC_read()); sensorsControlState = 0; @@ -114,7 +114,9 @@ \param light_val The light level This function control the light level. - The light sensor has 2 different values of pull-up resistors (1M and 10k) to increase the range. It's necessary to switch from one to the other resistor depending on the light level. This is done here. + The light sensor has 2 different values of pull-up resistors (1M and 10k) to + increase the range. It's necessary to switch from one to the other resistor + depending on the light level. This is done here. */ void static light_control(uint16_t light_val) @@ -146,10 +148,10 @@ /** \brief Battery control function. - \param battery_val The battery level + \param battery_val Battery level - The battery level is just store in gStatus, to be sent to the PC - */ + The battery level is just stored in gStatus to be sent to the computer. + */ void static battery_control(uint16_t battery_val) { |
From: jaguarondi <c2m...@c2...> - 2007-12-06 17:17:51
|
Author: jaguarondi Date: 2007-12-06 18:17:52 +0100 (Thu, 06 Dec 2007) New Revision: 758 Modified: firmware/tuxcore/trunk/motors.c firmware/tuxdefs/defines.h Log: * Minor changes. Modified: firmware/tuxcore/trunk/motors.c =================================================================== --- firmware/tuxcore/trunk/motors.c 2007-12-06 17:07:22 UTC (rev 757) +++ firmware/tuxcore/trunk/motors.c 2007-12-06 17:17:52 UTC (rev 758) @@ -29,6 +29,7 @@ #include "global.h" #include "motors.h" +#include "common/defines.h" /** * \name Braking delays @@ -54,10 +55,6 @@ /** Minimum difference required between the period the flippers are moving from * up to down and from down to up. */ #define FLIPPERS_RESETTIMER_HYST 0x10 -/** Mouth final state */ -#define MOUTH_UDEF 0 -#define MOUTH_OPEN 1 -#define MOUTH_CLOSE 2 /** Number of periods remaining before stopping the eyes. * Normally used when braking, to stop the motor after a short period of @@ -75,7 +72,7 @@ * Normally used when braking, to stop the motor after a short period of * inversion. */ static uint8_t flippers_stop_delay; -/** A flag which indicate the final wanted state for the mouth */ +/** State variable indicating the final requested state for the mouth */ static uint8_t mouth_final_state; /** Number of movements remaining before stopping the flippers. */ uint8_t flippers_move_counter; @@ -393,7 +390,7 @@ if (!(PSW_MOUTH_PIN & PSW_MOUTH_C_MK)) move_mouth(1); if (MOT_MOUTH_PT |= MOT_MOUTH_MK) - mouth_final_state = MOUTH_OPEN; + mouth_final_state = MOUTH_OPENED; move_mouth(2); } @@ -408,7 +405,7 @@ if (!(PSW_MOUTH_PIN & PSW_MOUTH_O_MK)) move_mouth(1); if (MOT_MOUTH_PT |= MOT_MOUTH_MK) - mouth_final_state = MOUTH_CLOSE; + mouth_final_state = MOUTH_CLOSED; move_mouth(2); } @@ -436,16 +433,16 @@ if (mouth_move_counter) { mouth_move_counter--; - if (mouth_final_state != MOUTH_UDEF) + if (mouth_final_state != MOUTH_UNKNOWN) { - if ((mouth_final_state == MOUTH_OPEN) && !(PSW_MOUTH_PIN & PSW_MOUTH_O_MK)) + if ((mouth_final_state == MOUTH_OPENED) && !(PSW_MOUTH_PIN & PSW_MOUTH_O_MK)) mouth_move_counter = 0; - else if ((mouth_final_state == MOUTH_CLOSE) && !(PSW_MOUTH_PIN & PSW_MOUTH_C_MK)) + else if ((mouth_final_state == MOUTH_CLOSED) && !(PSW_MOUTH_PIN & PSW_MOUTH_C_MK)) mouth_move_counter = 0; } if (!mouth_move_counter) { - mouth_final_state = MOUTH_UDEF; + mouth_final_state = MOUTH_UNKNOWN; stop_mouth_motor(); invert_mouth_motor(); mouth_stop_delay = MOUTH_BRAKING_DLY; Modified: firmware/tuxdefs/defines.h =================================================================== --- firmware/tuxdefs/defines.h 2007-12-06 17:07:22 UTC (rev 757) +++ firmware/tuxdefs/defines.h 2007-12-06 17:17:52 UTC (rev 758) @@ -163,7 +163,24 @@ /*! @} */ +/** + * \name Movements + */ +/*! @{ */ + +/** + * Type indicating the mouth position. + */ +typedef enum +{ + MOUTH_UNKNOWN, + MOUTH_OPENED, + MOUTH_CLOSED, +} MOUTH_POSITION_t; + /*! @} */ +/*! @} */ + #endif /* _DEFINES_H_ */ |
From: jaguarondi <c2m...@c2...> - 2007-12-06 17:07:21
|
Author: jaguarondi Date: 2007-12-06 18:07:22 +0100 (Thu, 06 Dec 2007) New Revision: 757 Modified: firmware/tuxcore/trunk/bootloader.c Log: * bootloader.c: defines moved from commands.h to defines.h. Modified: firmware/tuxcore/trunk/bootloader.c =================================================================== --- firmware/tuxcore/trunk/bootloader.c 2007-12-06 17:06:24 UTC (rev 756) +++ firmware/tuxcore/trunk/bootloader.c 2007-12-06 17:07:22 UTC (rev 757) @@ -25,7 +25,7 @@ #include <util/twi.h> #include <avr/eeprom.h> #include "hardware.h" -#include "common/commands.h" +#include "common/defines.h" typedef union { |
From: jaguarondi <c2m...@c2...> - 2007-12-06 17:06:30
|
Author: jaguarondi Date: 2007-12-06 18:06:24 +0100 (Thu, 06 Dec 2007) New Revision: 756 Modified: firmware/tuxcore/trunk/ir.c Log: * Disabling the greeting function completely now has the led fading effects seems to trigger it. Modified: firmware/tuxcore/trunk/ir.c =================================================================== --- firmware/tuxcore/trunk/ir.c 2007-12-06 15:58:49 UTC (rev 755) +++ firmware/tuxcore/trunk/ir.c 2007-12-06 17:06:24 UTC (rev 756) @@ -145,25 +145,25 @@ irStatus &= ~IRSTATUS_RECEIVING; irPulses = SILENCE_PULSES; /* If in end mode, reset timer to wait for silence before receiving next data */ /* XXX IR command and address need to be sent to the computer */ - if ((irReceivedCode & 0x07C0) == 0x0100) /* Tux detected */ + /*if ((irReceivedCode & 0x07C0) == 0x0100) [> Tux detected <]*/ + /*{*/ + /*if (last_tux_seen != (uint8_t) irReceivedCode)*/ + /*cond_flags.tux_recog = 0xF0;*/ + /*last_tux_seen = irReceivedCode;*/ + /*}*/ + /*else if ((irReceivedCode & 0x07C0) == 0x0200) [> The other tux replied <]*/ + /*{*/ + /*if (last_tux_seen != (uint8_t) irReceivedCode)*/ + /*cond_flags.tux_recog = 0xE0; [> greeting detected <]*/ + /*last_tux_seen = irReceivedCode;*/ + /*}*/ + /*else if ((irReceivedCode & 0x07C0) == 0x0300) [> The other tux replied <]*/ + /*{*/ + /*if (cond_flags.tux_recog == 0xF1)*/ + /*cond_flags.tux_recog = 0xD0; [> reply to a greeting detected <]*/ + /*}*/ + /*else*/ { - if (last_tux_seen != (uint8_t) irReceivedCode) - cond_flags.tux_recog = 0xF0; - last_tux_seen = irReceivedCode; - } - else if ((irReceivedCode & 0x07C0) == 0x0200) /* The other tux replied */ - { - if (last_tux_seen != (uint8_t) irReceivedCode) - cond_flags.tux_recog = 0xE0; /* greeting detected */ - last_tux_seen = irReceivedCode; - } - else if ((irReceivedCode & 0x07C0) == 0x0300) /* The other tux replied */ - { - if (cond_flags.tux_recog == 0xF1) - cond_flags.tux_recog = 0xD0; /* reply to a greeting detected */ - } - else - { /* Update global status */ gStatus.ir = ((uint8_t)irReceivedCode & 0x3F); /* Check if the code comes from our remote control. */ |