tux-droid-svn Mailing List for Tux Droid CE (Page 213)
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-11-15 16:07:24
|
Author: Paul_R Date: 2007-11-15 17:07:07 +0100 (Thu, 15 Nov 2007) New Revision: 705 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/widget/other.pyp software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp software/gadgets/light_monitor/trunk/Light_monitor/about.xml software/gadgets/light_monitor/trunk/Light_monitor/settings.xml software/gadgets/light_monitor/trunk/Light_monitor/strings.xml Log: * Fixed a bug which display a critical error : 'libgnomevfs-CRITICAL **: gnome_vfs_get_uri_from_local_path: assertion `g_path_is_absolute (local_full_path)' failed' Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/widget/other.pyp 2007-11-15 15:03:51 UTC (rev 704) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/GUI/widget/other.pyp 2007-11-15 16:07:07 UTC (rev 705) @@ -42,7 +42,8 @@ self.get_widget('txtValue').set_text(str(tab[0][3])) self.get_widget('txtTime').set_text(str(tab[0][4])) self.get_widget('chkNotify').set_active(tab[0][5]) - self.get_widget('Behavior').set_filename(tab[0][6]) + if tab[0][6] != None: + self.get_widget('Behavior').set_filename(str(tab[0][6])) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-11-15 15:03:51 UTC (rev 704) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2007-11-15 16:07:07 UTC (rev 705) @@ -11,7 +11,7 @@ <widget_lblControl type='str'>Contrôle</widget_lblControl> <Increase type='str'>Le niveau de la batterie est passé en dessus du seuil</Increase> <full type='str'>Les batteries sont pleines</full> - <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> <lblLowThreshold type='str'>Limite inférieure</lblLowThreshold> <help_text type='str'>-- Les évènements : Deux grands types d'évènements peuvent avoir lieu, contenant chacun diverses options : @@ -73,7 +73,7 @@ <MainBehavior type='str'>Comportement principal</MainBehavior> <speaker_name type='str'>Bruno8k</speaker_name> <conf_lblSample type='str'>Points</conf_lblSample> - <charging type='str'>En charge</charging> + <conf_lblType type='str'>Type</conf_lblType> <Change type='str'>Le niveau de la batterie a changé</Change> <Both type='str'>Le niveau de la batterie a passé le seuil</Both> <conf_btnModify type='str'>Modifier</conf_btnModify> @@ -102,18 +102,18 @@ <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <widget_lblChange type='str'>Changement</widget_lblChange> <name_to_read type='str'>Moniteur de batteries</name_to_read> - <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> <Drop type='str'>Le niveau de la batterie a chuté</Drop> <conf_lblDrop type='str'>Chute</conf_lblDrop> - <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> <Raise type='str'>Le niveau de la batterie a augmenté</Raise> - <conf_lblType type='str'>Type</conf_lblType> + <charging type='str'>En charge</charging> <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> <Decrease type='str'>Le niveau de la batterie est passé en dessous du seuil</Decrease> <conf_lblValue type='str'>Valeur (V)</conf_lblValue> <conf_lblRate type='str'>Rafraichissement</conf_lblRate> <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> - <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> + <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> <conf_lblControl type='str'>Contrôle</conf_lblControl> <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-11-15 15:03:51 UTC (rev 704) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2007-11-15 16:07:07 UTC (rev 705) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_name type='str'>battery_monitor</gadget_name> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_description type='str'>Battery monitor for tux droid</gadget_description> <gadget_version type='str'>0.0.1</gadget_version> - <gadget_name type='str'>battery_monitor</gadget_name> - <gadget_description type='str'>Battery monitor for tux droid</gadget_description> </about> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-11-15 15:03:51 UTC (rev 704) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2007-11-15 16:07:07 UTC (rev 705) @@ -1,36 +1,35 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> <parameters> - <Sample type='float'>600.0</Sample> - <low_threshold type='float'>4.8</low_threshold> + <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, None, False, 0]]</test_tab> <chkMotors type='bool'>True</chkMotors> + <low_threshold type='float'>4.8</low_threshold> <MainScript type='str'>None</MainScript> - <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, 'None', False, 0]]</test_tab> + <Sample type='float'>600.0</Sample> <Rate type='float'>1.0</Rate> <high_threshold type='float'>6.0</high_threshold> - <config type='list'>[]</config> + <config type='list'>[[1, 0, 0, 1.0, 1.0, False, 'None', False, 0], [2, 1, 0, 4.0, 1.0, False, 'None', False, 0]]</config> </parameters> <general> + <have_settings_part type='bool'>True</have_settings_part> <gui_state> <widget> - <y type='int'>362</y> - <visible type='bool'>True</visible> - <x type='int'>133</x> + <visible type='bool'>False</visible> </widget> <conf> - <y type='int'>27</y> - <visible type='bool'>True</visible> - <x type='int'>0</x> + <visible type='bool'>False</visible> </conf> </gui_state> <language type='str'>en_US</language> <notified type='bool'>True</notified> + <have_widget_part type='bool'>True</have_widget_part> <notify_delay type='int'>1</notify_delay> <framework_version type='str'>0.0.0</framework_version> <menu_active type='bool'>True</menu_active> <main_priority type='int'>4</main_priority> <speaker type='int'>3</speaker> <pitch type='int'>100</pitch> + <have_main_part type='bool'>True</have_main_part> <notify_priority type='int'>4</notify_priority> </general> </settings> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-11-15 15:03:51 UTC (rev 704) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2007-11-15 16:07:07 UTC (rev 705) @@ -1,17 +1,22 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> <conf_lblIncrease type='str'>Increase</conf_lblIncrease> + <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> + <conf_lblTime type='str'>Time (sec.)</conf_lblTime> <battery type='str'>On battery</battery> <conf_lblRaise type='str'>Raise</conf_lblRaise> + <widget_lblTest type='str'>Notifications</widget_lblTest> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> <Increase type='str'>The battery level exceeded the threshold</Increase> - <full type='str'>The level of the batteries is full</full> - <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> - <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <conf_btnModify type='str'>Modify</conf_btnModify> + <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> + <lblLowThreshold type='str'>Lower limit</lblLowThreshold> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <lblMotors type='str'>Disable measurement when the motors are running</lblMotors> <help_text type='str'>--The events: Two main types of events can take place, each containing various options: @@ -47,7 +52,6 @@ When this window is displayed, the events stored in the settings window are not notified. This window makes it possible to try various configurations and to add them in the settings table.</help_text> <end_of_charge type='str'>The load of the battery is finished</end_of_charge> - <conf_btnRemove type='str'>Remove</conf_btnRemove> <conf_lblChange type='str'>Change</conf_lblChange> <conf_lblBoth type='str'>Both</conf_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> @@ -57,31 +61,28 @@ <gui_conf_update_title type='str'>Update</gui_conf_update_title> <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <absolute_threshold_high type='str'>The batteries are full</absolute_threshold_high> - <conf_lblType type='str'>Type</conf_lblType> <mainscript type='str'>I've found the light !</mainscript> - <MainBehavior type='str'>Main behavior</MainBehavior> - <lblLowThreshold type='str'>Lower limit</lblLowThreshold> + <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <plugged type='str'>Plugged</plugged> - <ChangeU type='str'>The battery level raised and dropped</ChangeU> <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> <charge type='str'>and the batteries are recharging</charge> <gui_conf_about_title type='str'>About</gui_conf_about_title> <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> <low type='str'>The level of the batteries is weak</low> - <speaker_name type='str'>Ryan8k</speaker_name> + <conf_btnAdd type='str'>Add</conf_btnAdd> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> <conf_lblSample type='str'>Samples</conf_lblSample> <charging type='str'>Charging</charging> <Change type='str'>The battery level changed</Change> + <conf_lblValue type='str'>Value (V)</conf_lblValue> <Both type='str'>The battery level reached the threshold</Both> - <conf_btnModify type='str'>Modify</conf_btnModify> + <full type='str'>The level of the batteries is full</full> <widget_lblEvent type='str'>Event</widget_lblEvent> <normal type='str'>The level of the batteries is good</normal> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <widget_lblRaise type='str'>Raise</widget_lblRaise> - <conf_btnAdd type='str'>Add</conf_btnAdd> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <on_battery type='str'>and I'm powered by the battery</on_battery> <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> @@ -89,33 +90,32 @@ <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <widget_lblDrop type='str'>Drop</widget_lblDrop> - <ChangeD type='str'>The battery level dropped and raised</ChangeD> - <absolute_threshold type='str'>Weak batteries </absolute_threshold> - <lblMotors type='str'>Disable measurement when the motors are running</lblMotors> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> - <lblHighThreshold type='str'>Upper limit</lblHighThreshold> <widget_lblValue type='str'>Value (V)</widget_lblValue> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <speaker_name type='str'>Ryan8k</speaker_name> <plug type='str'>and the power supply is plugged</plug> - <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <absolute_threshold type='str'>Weak batteries </absolute_threshold> <widget_lblChange type='str'>Change</widget_lblChange> <name_to_read type='str'>Battery monitor</name_to_read> - <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <lblHighThreshold type='str'>Upper limit</lblHighThreshold> + <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <Drop type='str'>The battery level dropped</Drop> <conf_lblDrop type='str'>Drop</conf_lblDrop> - <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> + <ChangeD type='str'>The battery level dropped and raised</ChangeD> <Raise type='str'>The battery level raised</Raise> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <conf_lblType type='str'>Type</conf_lblType> <widget_lblSet type='str'>Add to config</widget_lblSet> <Decrease type='str'>The battery level passed below the threshold</Decrease> - <conf_lblValue type='str'>Value (V)</conf_lblValue> + <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> <conf_lblRate type='str'>Refresh rate</conf_lblRate> <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> - <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> - <conf_lblTime type='str'>Time (sec.)</conf_lblTime> + <MainBehavior type='str'>Main behavior</MainBehavior> + <ChangeU type='str'>The battery level raised and dropped</ChangeU> <conf_lblControl type='str'>Control</conf_lblControl> - <widget_lblTest type='str'>Notifications</widget_lblTest> + <conf_btnRemove type='str'>Remove</conf_btnRemove> <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-11-15 15:03:51 UTC (rev 704) +++ software/gadgets/light_monitor/trunk/Light_monitor/Scripts/Python/GUI/widget/other.pyp 2007-11-15 16:07:07 UTC (rev 705) @@ -47,7 +47,8 @@ self.get_widget('txtValue').set_text(str(tab[0][3])) self.get_widget('txtTime').set_text(str(tab[0][4])) self.get_widget('chkNotify').set_active(tab[0][5]) - self.get_widget('Behavior').set_filename(tab[0][6]) + if tab[0][6] != None: + self.get_widget('Behavior').set_filename(str(tab[0][6])) thread.start_new_thread(self.update, ()) Modified: software/gadgets/light_monitor/trunk/Light_monitor/about.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-11-15 15:03:51 UTC (rev 704) +++ software/gadgets/light_monitor/trunk/Light_monitor/about.xml 2007-11-15 16:07:07 UTC (rev 705) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_description type='str'>Light monitor for tux droid</gadget_description> <gadget_author type='str'>Paul Rathgeb</gadget_author> + <gadget_name type='str'>light_monitor</gadget_name> <gadget_version type='str'>0.0.1</gadget_version> - <gadget_name type='str'>light_monitor</gadget_name> - <gadget_description type='str'>Light monitor for tux droid</gadget_description> </about> Modified: software/gadgets/light_monitor/trunk/Light_monitor/settings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-11-15 15:03:51 UTC (rev 704) +++ software/gadgets/light_monitor/trunk/Light_monitor/settings.xml 2007-11-15 16:07:07 UTC (rev 705) @@ -6,17 +6,16 @@ <increase_rad type='bool'>True</increase_rad> <chk_ChangeBehavior type='bool'>False</chk_ChangeBehavior> <changeU_time type='float'>1.0</changeU_time> - <test_tab type='list'>[[1, 0, 0, 10.0, 2.0, False, 'None', False, 0]]</test_tab> + <test_tab type='list'>[[1, 0, 0, 10.0, 2.0, False, None, False, 0]]</test_tab> <changeD_rad type='bool'>False</changeD_rad> <threshold type='float'>50.0</threshold> <decrease_rad type='bool'>False</decrease_rad> - <Sample type='float'>500.0</Sample> + <behavior_file_threshold type='NoneType'>None</behavior_file_threshold> <raise type='float'>10.0</raise> <changeU_rad type='bool'>False</changeU_rad> <threshold_notified type='bool'>False</threshold_notified> <config type='list'>[]</config> <behavior_file_change type='NoneType'>None</behavior_file_change> - <drop_rad type='bool'>True</drop_rad> <raise_rad type='bool'>False</raise_rad> <changeD type='float'>10.0</changeD> <drop_time type='float'>1.0</drop_time> @@ -24,15 +23,17 @@ <changeU type='float'>10.0</changeU> <raise_time type='float'>1.0</raise_time> <drop type='float'>10.0</drop> + <drop_rad type='bool'>True</drop_rad> <MainScript type='str'> </MainScript> - <behavior_file_threshold type='NoneType'>None</behavior_file_threshold> + <Sample type='float'>500.0</Sample> <threshold_chk type='bool'>False</threshold_chk> <Rate type='float'>0.1</Rate> <changeD_time type='float'>1.0</changeD_time> <both_rad type='bool'>False</both_rad> </parameters> <general> + <have_settings_part type='bool'>True</have_settings_part> <gui_state> <widget> <y type='int'>317</y> @@ -47,12 +48,14 @@ </gui_state> <language type='str'>en_US</language> <notified type='bool'>True</notified> + <have_widget_part type='bool'>True</have_widget_part> <notify_delay type='int'>1</notify_delay> <framework_version type='str'>0.0.0</framework_version> <menu_active type='bool'>True</menu_active> <main_priority type='int'>4</main_priority> <speaker type='int'>3</speaker> <pitch type='int'>100</pitch> + <have_main_part type='bool'>True</have_main_part> <notify_priority type='int'>4</notify_priority> </general> </settings> Modified: software/gadgets/light_monitor/trunk/Light_monitor/strings.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-11-15 15:03:51 UTC (rev 704) +++ software/gadgets/light_monitor/trunk/Light_monitor/strings.xml 2007-11-15 16:07:07 UTC (rev 705) @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> - <conf_lblSample type='str'>Samples</conf_lblSample> + <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> <conf_lblRaise type='str'>Raise</conf_lblRaise> <conf_lblEvent type='str'>Event</conf_lblEvent> <widget_lblControl type='str'>Control</widget_lblControl> @@ -40,7 +40,7 @@ In the test part with two buttons you can make Tux search for the light source or darkest spot. Two example scripts can be found in /tmp/Light_monitor/Data.</help_text> - <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> + <conf_lblSample type='str'>Samples</conf_lblSample> <widget_lblLight type='str'>Search light</widget_lblLight> <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> <Change type='str'>The light level changed</Change> @@ -53,34 +53,36 @@ <widget_lblSet type='str'>Add to config</widget_lblSet> <conf_lblValue type='str'>Value (%)</conf_lblValue> <conf_lblTime type='str'>Time (sec.)</conf_lblTime> - <widget_lblDark type='str'>Search darkness</widget_lblDark> + <widget_lblTest type='str'>Notifications</widget_lblTest> <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <power_supply type='str'>You must disconnect the power supply</power_supply> <widget_lblNotified type='str'>Notified</widget_lblNotified> <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> <conf_lblType type='str'>Type</conf_lblType> - <dark2 type='str'>And darker here.</dark2> + <Drop type='str'>The light level dropped</Drop> <widget_lblEvent type='str'>Event</widget_lblEvent> - <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> - <gui_conf_update_title type='str'>Update</gui_conf_update_title> + <dark4 type='str'>This is the darkest spot.</dark4> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <search type='str'>I seek ...</search> <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> <ChangeD type='str'>The light level dropped and raised</ChangeD> - <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> <light2 type='str'>ow wait, even lighter here.</light2> <light3 type='str'>or here ...</light3> <light1 type='str'>Seeing more light over here.</light1> <light4 type='str'>I think the light is coming from this direction.</light4> <light5 type='str'>I can't find the direction of the light.</light5> <ChangeU type='str'>The light level raised and dropped</ChangeU> + <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <widget_lblDark type='str'>Search darkness</widget_lblDark> <Increase type='str'>The light level exceeded the threshold</Increase> <conf_lblBoth type='str'>Both</conf_lblBoth> <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> + <gui_conf_update_title type='str'>Update</gui_conf_update_title> <widget_lblValue type='str'>Value (%)</widget_lblValue> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> <mainscript type='str'>I've found the light !</mainscript> @@ -88,7 +90,6 @@ <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> <conf_btnAdd type='str'>Add</conf_btnAdd> <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> - <widget_lblTest type='str'>Notifications</widget_lblTest> <conf_lblDrop type='str'>Drop</conf_lblDrop> <Raise type='str'>The light level raised</Raise> <Decrease type='str'>The light level passed below the threshold</Decrease> @@ -110,15 +111,14 @@ <conf_btnModify type='str'>Modify</conf_btnModify> <dark1 type='str'>It's pretty dark here.</dark1> <dark3 type='str'>hmm, but it's even more dark over here!</dark3> - <Drop type='str'>The light level dropped</Drop> + <dark2 type='str'>And darker here.</dark2> <dark5 type='str'>I can't find the darkest spot...</dark5> - <dark4 type='str'>This is the darkest spot.</dark4> + <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> <disable type='str'>Disable measurement when the eyes are closed</disable> <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> <speaker_name type='str'>Ryan8k</speaker_name> <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> <Threshold type='str'>The light reached the threshold</Threshold> <MainBehavior type='str'>Main behavior</MainBehavior> </strings> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2007-11-15 15:03:57
|
Author: Paul_R Date: 2007-11-15 16:03:51 +0100 (Thu, 15 Nov 2007) New Revision: 704 Added: software/gadgets/tux_controller/trunk/TuxController.tgf software/gadgets/tux_controller/trunk/TuxController/ software/gadgets/tux_controller/trunk/TuxController/Pictures/ software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/ software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/down.png software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/gadget.png software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/left.png software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/right.png software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/run.png software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/up.png software/gadgets/tux_controller/trunk/TuxController/Scripts/ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/ 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/ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/.other.glade.swp 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/GUI/widget/pixmaps/ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/pixmaps/Diagram1.png software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/init.pyp software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/main.pyp software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/notify.pyp software/gadgets/tux_controller/trunk/TuxController/Strings/ software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml software/gadgets/tux_controller/trunk/TuxController/about.xml software/gadgets/tux_controller/trunk/TuxController/parts.xml software/gadgets/tux_controller/trunk/TuxController/settings.xml software/gadgets/tux_controller/trunk/TuxController/strings.xml Log: * Added the new Tux controller gadget (TuxController.tgf) Added: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/down.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/down.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/gadget.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/gadget.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/left.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/left.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/right.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/right.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/run.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/run.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/up.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxController/Pictures/Icons/up.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.glade =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.glade (rev 0) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.glade 2007-11-15 15:03:51 UTC (rev 704) @@ -0,0 +1,409 @@ +<?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">159</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">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="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="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="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="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> + + <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> + </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="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> + + <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/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.pyp (rev 0) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/conf/other.pyp 2007-11-15 15:03:51 UTC (rev 704) @@ -0,0 +1,86 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.get_path('root') + '/Scripts/Python/GUI/conf/other.glade', + root="window1", + domain="params", **kwargs): + """ + Constructor + """ + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + """ + On new window + """ + self.updates_commons() + self.updates_specifics() + + def updates_commons(self): + """ + Updates common widgets + """ + # Window title + txt = "%s : %s" % (_me.string('name_to_read'), + _me.string('gui_conf_window_title')) + self.get_widget("window1").set_title(txt) + + # 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) + + # 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) + + txt = _me.string('gui_conf_accept_bt') + self.get_widget("label5").set_text(txt) + + def updates_specifics(self): + """ + Updates specific widgets + """ + pass + + def on_button_remote_clicked(self, widget, *args): + """ + On button 'set' remote clicked + """ + def remote_set_caption(): + tux.sys.wait(0.1) + gadgets['Manager'].gui('remote').window.set_captions(gadgets[_me.get_name()]) + if gadgets.has_key('Manager'): + if not gadgets['Manager'].gui('remote').showed(): + gadgets['Manager'].gui('remote').show() + thread.start_new_thread(remote_set_caption, ()) + + def on_accept_clicked(self, widget, *args): + """ + On button 'accept' clicked + """ + _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): + """ + On button 'cancel' clicked + """ + self.get_widget("window1").destroy() Added: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/.other.glade.swp =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/.other.glade.swp ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade (rev 0) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.glade 2007-11-15 15:03:51 UTC (rev 704) @@ -0,0 +1,2350 @@ +<?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> + <signal name="destroy" handler="on_window1_destroy" last_modification_time="Thu, 15 Nov 2007 14:17:58 GMT"/> + + <child> + <widget class="GtkNotebook" id="notebook1"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="show_tabs">True</property> + <property name="show_border">True</property> + <property name="tab_pos">GTK_POS_TOP</property> + <property name="scrollable">False</property> + <property name="enable_popup">False</property> + + <child> + <widget class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkTable" id="table1"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="n_rows">5</property> + <property name="n_columns">2</property> + <property name="homogeneous">False</property> + <property name="row_spacing">0</property> + <property name="column_spacing">0</property> + + <child> + <widget class="GtkFixed" id="btnLEDRun"> + <property name="width_request">518</property> + <property name="height_request">66</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="GtkRadioButton" id="radLEDcount"> + <property name="width_request">114</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">radiobutton36</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">200</property> + <property name="y">32</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">24</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">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">24</property> + </packing> + </child> + + <child> + <widget class="GtkVSeparator" id="vseparator18"> + <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">7</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">7</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnLEDRun"> + <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_btnLEDRun_clicked" last_modification_time="Thu, 15 Nov 2007 10:50:39 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment16"> + <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="hbox16"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="imgLEDRun"> + <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="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="label16"> + <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> + </widget> + <packing> + <property name="x">80</property> + <property name="y">16</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radLEDsec"> + <property name="width_request">114</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">sec.</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">radLEDcount</property> + </widget> + <packing> + <property name="x">200</property> + <property name="y">8</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">320</property> + <property name="y">16</property> + </packing> + </child> + + <child> + <widget class="GtkHSeparator" id="hseparator16"> + <property name="width_request">518</property> + <property name="height_request">5</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">60</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> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed13"> + <property name="visible">True</property> + + <child> + <widget class="GtkHSeparator" id="hseparator17"> + <property name="width_request">288</property> + <property name="height_request">5</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">60</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</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="fixed22"> + <property name="visible">True</property> + + <child> + <widget class="GtkHSeparator" id="hseparator21"> + <property name="width_request">288</property> + <property name="height_request">5</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">60</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> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed23"> + <property name="visible">True</property> + + <child> + <widget class="GtkHSeparator" id="hseparator22"> + <property name="width_request">288</property> + <property name="height_request">5</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">60</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> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed24"> + <property name="visible">True</property> + + <child> + <widget class="GtkHSeparator" id="hseparator23"> + <property name="width_request">288</property> + <property name="height_request">5</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">60</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> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed25"> + <property name="visible">True</property> + + <child> + <widget class="GtkHSeparator" id="hseparator24"> + <property name="width_request">288</property> + <property name="height_request">5</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">77</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> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed26"> + <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">20</property> + </packing> + </child> + + <child> + <widget class="GtkHSeparator" id="hseparator25"> + <property name="width_request">518</property> + <property name="height_request">5</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">60</property> + </packing> + </child> + + <child> + <widget class="GtkVSeparator" id="vseparator11"> + <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">7</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radEyessec"> + <property name="width_request">114</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">radiobutton37</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">200</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radEyescount"> + <property name="width_request">114</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">radiobutton38</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">radEyessec</property> + </widget> + <packing> + <property name="x">200</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnEyesOpen"> + <property name="width_request">32</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="clicked" handler="on_btnEyesOpen_clicked" last_modification_time="Thu, 15 Nov 2007 08:45:59 GMT"/> + + <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">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="imgEyesOpen"> + <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="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="label1"> + <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> + </widget> + <packing> + <property name="x">16</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnEyesClose"> + <property name="width_request">32</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="clicked" handler="on_btnEyesClose_clicked" last_modification_time="Thu, 15 Nov 2007 08:46:12 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">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="imgEyesClose"> + <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="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="label3"> + <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> + </widget> + <packing> + <property name="x">16</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkVSeparator" id="vseparator10"> + <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">7</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnEyesRun"> + <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_btnEyesRun_clicked" last_modification_time="Thu, 15 Nov 2007 08:32:08 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment11"> + <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="hbox11"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <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="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="label11"> + <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> + </widget> + <packing> + <property name="x">80</property> + <property name="y">16</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="fixed27"> + <property name="visible">True</property> + + <child> + <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">120</property> + <property name="y">20</property> + </packing> + </child> + + <child> + <widget class="GtkHSeparator" id="hseparator26"> + <property name="width_request">518</property> + <property name="height_request">5</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">60</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">8</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">7</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button4"> + <property name="width_request">32</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> + + <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="hbox4"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image4"> + <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="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="label4"> + <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> + </widget> + <packing> + <property name="x">16</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radMouthsec"> + <property name="width_request">114</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">radiobutton39</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">200</property> + <property name="y">8</proper... [truncated message content] |
From: jaguarondi <c2m...@c2...> - 2007-11-15 11:52:07
|
Author: jaguarondi Date: 2007-11-15 12:52:07 +0100 (Thu, 15 Nov 2007) New Revision: 703 Modified: daemon/trunk/Makefile Log: * Removed unnecessary dependencies to glib, libgthread and lipthread. Modified: daemon/trunk/Makefile =================================================================== --- daemon/trunk/Makefile 2007-11-15 11:51:38 UTC (rev 702) +++ daemon/trunk/Makefile 2007-11-15 11:52:07 UTC (rev 703) @@ -16,11 +16,11 @@ OBJ_DIR = Debug OUTPUT_DIR = . TARGET = tuxd - C_INCLUDE_DIRS = -I"/usr/include/glib-2.0" -I"/usr/lib/glib-2.0/include" -I"/usr/local/include" + C_INCLUDE_DIRS = -I"/usr/local/include" C_PREPROC = CFLAGS = -pipe -Wall -Werror -g2 -O0 -DUSB_DEBUG - LIB_DIRS = -L"/usr/include/glib-2.0" -L"/usr/lib/glib-2.0/include" -L"/usr/local/lib" - LIBS = -lglib-2.0 -lgthread-2.0 -lpthread -lusb + LIB_DIRS = -L"/usr/local/lib" + LIBS = -lusb LDFLAGS = -pipe endif @@ -32,7 +32,7 @@ C_PREPROC = CFLAGS = -pipe -Wall -g0 -O2 LIB_DIRS = - LIBS = + LIBS = -lusb LDFLAGS = -pipe -s endif |
From: jaguarondi <c2m...@c2...> - 2007-11-15 11:51:40
|
Author: jaguarondi Date: 2007-11-15 12:51:38 +0100 (Thu, 15 Nov 2007) New Revision: 702 Modified: daemon/trunk/libs/USBDaemon_status_table.c Log: * Forgot to change the bit number sent on tcp-ip. Modified: daemon/trunk/libs/USBDaemon_status_table.c =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.c 2007-11-15 10:27:04 UTC (rev 701) +++ daemon/trunk/libs/USBDaemon_status_table.c 2007-11-15 11:51:38 UTC (rev 702) @@ -461,7 +461,7 @@ if ((portc.Byte & 0x08) != (new_value & 0x08)) { tcp_frame[4] = DATA_STATUS_RIGHT_BLUE_LED; - tcp_frame[5] = !portc.bits.PB2; + tcp_frame[5] = !portc.bits.PB3; log_debug("right blue led %s", tcp_frame[5] ? "on" : "off"); tcp_server_send_raw(tcp_frame); } @@ -470,7 +470,7 @@ if ((portc.Byte & 0x04) != (new_value & 0x04)) { tcp_frame[4] = DATA_STATUS_LEFT_BLUE_LED; - tcp_frame[5] = !portc.bits.PB3; + tcp_frame[5] = !portc.bits.PB2; log_debug("left blue led %s", tcp_frame[5] ? "on" : "off"); tcp_server_send_raw(tcp_frame); } |
From: jaguarondi <c2m...@c2...> - 2007-11-15 10:27:02
|
Author: jaguarondi Date: 2007-11-15 11:27:04 +0100 (Thu, 15 Nov 2007) New Revision: 701 Modified: software/tuxgi/trunk/tuxgi.py Log: * Updated tuxgi with the LEDs status inversion corrected before in the daemon. Modified: software/tuxgi/trunk/tuxgi.py =================================================================== --- software/tuxgi/trunk/tuxgi.py 2007-11-15 10:26:40 UTC (rev 700) +++ software/tuxgi/trunk/tuxgi.py 2007-11-15 10:27:04 UTC (rev 701) @@ -108,10 +108,10 @@ tux.tts.on_sound_off=self.on_sound_off tux.tts.on_voice_list=self.on_voice_list tux.event.on_status=self.on_status - tux.event.on_left_blue_led_on=self.on_right_blue_led_on - tux.event.on_left_blue_led_off=self.on_right_blue_led_off - tux.event.on_right_blue_led_on=self.on_left_blue_led_on - tux.event.on_right_blue_led_off=self.on_left_blue_led_off + tux.event.on_left_blue_led_on=self.on_left_blue_led_on + tux.event.on_left_blue_led_off=self.on_left_blue_led_off + tux.event.on_right_blue_led_on=self.on_right_blue_led_on + tux.event.on_right_blue_led_off=self.on_right_blue_led_off tux.event.on_mouth_stop=self.on_mouth_stop tux.event.on_eyes_stop=self.on_eyes_stop thread.start_new_thread(self.status_viewer_thread,()) @@ -363,9 +363,8 @@ global toggled_by_event if toggled_by_event: return if widget.get_active(): - tux.cmd.raw(0x31,0,0,0) + tux.cmd.raw(0x39,0,0,0) tux.event.wait_status(DATAS_STATUS_WINGS_POSITION_COUNTER,0,5) - tux.cmd.wings_on(1) thread.start_new_thread(_funct,()) @@ -377,7 +376,7 @@ global toggled_by_event if toggled_by_event: return if widget.get_active(): - tux.cmd.raw(0x31,0,0,0) + tux.cmd.raw(0x3A,0,0,0) tux.event.wait_status(DATAS_STATUS_WINGS_POSITION_COUNTER,0,5) thread.start_new_thread(_funct,()) |
From: jaguarondi <c2m...@c2...> - 2007-11-15 10:26:53
|
Author: jaguarondi Date: 2007-11-15 11:26:40 +0100 (Thu, 15 Nov 2007) New Revision: 700 Modified: daemon/trunk/libs/USBDaemon_status_table.c Log: * Right and left LEDs status were inverted. Modified: daemon/trunk/libs/USBDaemon_status_table.c =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.c 2007-11-14 13:26:50 UTC (rev 699) +++ daemon/trunk/libs/USBDaemon_status_table.c 2007-11-15 10:26:40 UTC (rev 700) @@ -458,7 +458,7 @@ } /* right blue led */ - if ((portc.Byte & 0x04) != (new_value & 0x04)) + if ((portc.Byte & 0x08) != (new_value & 0x08)) { tcp_frame[4] = DATA_STATUS_RIGHT_BLUE_LED; tcp_frame[5] = !portc.bits.PB2; @@ -467,7 +467,7 @@ } /* left blue led */ - if ((portc.Byte & 0x08) != (new_value & 0x08)) + if ((portc.Byte & 0x04) != (new_value & 0x04)) { tcp_frame[4] = DATA_STATUS_LEFT_BLUE_LED; tcp_frame[5] = !portc.bits.PB3; |
From: remi <c2m...@c2...> - 2007-11-14 13:26:57
|
Author: remi Date: 2007-11-14 14:26:50 +0100 (Wed, 14 Nov 2007) New Revision: 699 Added: software/tux_framework/trunk/bin/ software/tux_framework/trunk/bin/README software/tux_framework/trunk/bin/frame software/tux_framework/trunk/bin/mgc2mgc software/tux_framework/trunk/bin/mgcep software/tux_framework/trunk/bin/pitch software/tux_framework/trunk/bin/window software/tux_framework/trunk/bin/x2x software/tux_framework/trunk/libs/DTW.py software/tux_framework/trunk/libs/GdgVoiceRec.py software/tux_framework/trunk/libs/_DTW.so Modified: software/tux_framework/trunk/SDK/gadget_maker/Template.tgf software/tux_framework/trunk/SDK/gadget_maker/tuxgagdetmaker.glade software/tux_framework/trunk/SDK/gadget_maker/tuxgagdetmaker.py software/tux_framework/trunk/libs/FWObject.py software/tux_framework/trunk/libs/GdgDebug.py software/tux_framework/trunk/libs/GdgDownload.py software/tux_framework/trunk/libs/GdgGuiUpdate.py software/tux_framework/trunk/libs/GdgObject.py software/tux_framework/trunk/libs/GdgThreads.py software/tux_framework/trunk/libs/GoogleTranslate.py software/tux_framework/trunk/libs/Languages.py software/tux_framework/trunk/libs/TGFCanvas.py software/tux_framework/trunk/libs/TGFParser.py software/tux_framework/trunk/libs/TGFormat.py software/tux_framework/trunk/libs/TextFilters.py software/tux_framework/trunk/libs/menu.py Log: Modified: software/tux_framework/trunk/SDK/gadget_maker/Template.tgf =================================================================== (Binary files differ) Modified: software/tux_framework/trunk/SDK/gadget_maker/tuxgagdetmaker.glade =================================================================== --- software/tux_framework/trunk/SDK/gadget_maker/tuxgagdetmaker.glade 2007-11-14 10:24:38 UTC (rev 698) +++ software/tux_framework/trunk/SDK/gadget_maker/tuxgagdetmaker.glade 2007-11-14 13:26:50 UTC (rev 699) @@ -51,7 +51,7 @@ <signal name="activate" handler="on_nouveau1_activate" last_modification_time="Mon, 10 Sep 2007 05:47:06 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image50"> + <widget class="GtkImage" id="image65"> <property name="visible">True</property> <property name="stock">gtk-new</property> <property name="icon_size">1</property> @@ -72,7 +72,7 @@ <signal name="activate" handler="on_ouvrir1_activate" last_modification_time="Mon, 10 Sep 2007 05:37:09 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image51"> + <widget class="GtkImage" id="image66"> <property name="visible">True</property> <property name="stock">gtk-open</property> <property name="icon_size">1</property> @@ -93,7 +93,7 @@ <signal name="activate" handler="on_ouvrir2_activate" last_modification_time="Mon, 10 Sep 2007 05:48:51 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image52"> + <widget class="GtkImage" id="image67"> <property name="visible">True</property> <property name="stock">gtk-open</property> <property name="icon_size">1</property> @@ -114,7 +114,7 @@ <signal name="activate" handler="on_enregistrer1_activate" last_modification_time="Sun, 23 Sep 2007 16:44:55 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image53"> + <widget class="GtkImage" id="image68"> <property name="visible">True</property> <property name="stock">gtk-save</property> <property name="icon_size">1</property> @@ -135,7 +135,7 @@ <signal name="activate" handler="on_enregistrer2_activate" last_modification_time="Mon, 10 Sep 2007 05:51:51 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image54"> + <widget class="GtkImage" id="image69"> <property name="visible">True</property> <property name="stock">gtk-save</property> <property name="icon_size">1</property> @@ -149,6 +149,27 @@ </child> <child> + <widget class="GtkImageMenuItem" id="recharger1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_Reload the TGF file</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_recharger1_activate" last_modification_time="Fri, 02 Nov 2007 08:31:54 GMT"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image70"> + <property name="visible">True</property> + <property name="stock">gtk-refresh</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + + <child> <widget class="GtkSeparatorMenuItem" id="separatormenuitem1"> <property name="visible">True</property> </widget> @@ -162,7 +183,7 @@ <signal name="activate" handler="on_execute1_activate" last_modification_time="Sun, 23 Sep 2007 18:09:15 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image55"> + <widget class="GtkImage" id="image71"> <property name="visible">True</property> <property name="stock">gtk-execute</property> <property name="icon_size">1</property> @@ -183,7 +204,7 @@ <signal name="activate" handler="on_stop1_activate" last_modification_time="Mon, 15 Oct 2007 08:43:14 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image56"> + <widget class="GtkImage" id="image72"> <property name="visible">True</property> <property name="stock">gtk-stop</property> <property name="icon_size">1</property> @@ -210,7 +231,7 @@ <signal name="activate" handler="on_quitter1_activate" last_modification_time="Sun, 23 Sep 2007 16:44:55 GMT"/> <child internal-child="image"> - <widget class="GtkImage" id="image57"> + <widget class="GtkImage" id="image73"> <property name="visible">True</property> <property name="stock">gtk-quit</property> <property name="icon_size">1</property> @@ -228,11 +249,37 @@ </child> <child> - <widget class="GtkMenuItem" id="about"> + <widget class="GtkMenuItem" id="help1"> <property name="visible">True</property> - <property name="label" translatable="yes">About</property> + <property name="label" translatable="yes">_Help</property> <property name="use_underline">True</property> - <signal name="activate" handler="on_about_activate" last_modification_time="Mon, 10 Sep 2007 05:57:08 GMT"/> + <signal name="activate" handler="on_help1_activate" last_modification_time="Mon, 10 Sep 2007 05:57:08 GMT"/> + + <child> + <widget class="GtkMenu" id="help1_menu"> + + <child> + <widget class="GtkImageMenuItem" id="about1"> + <property name="visible">True</property> + <property name="label" translatable="yes">_About</property> + <property name="use_underline">True</property> + <signal name="activate" handler="on_about1_activate" last_modification_time="Tue, 13 Nov 2007 14:55:24 GMT"/> + + <child internal-child="image"> + <widget class="GtkImage" id="image74"> + <property name="visible">True</property> + <property name="stock">gtk-about</property> + <property name="icon_size">1</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + </child> + </widget> + </child> + </widget> + </child> </widget> </child> </widget> @@ -448,24 +495,6 @@ </child> <child> - <widget class="GtkButton" id="about_modify_button"> - <property name="width_request">80</property> - <property name="height_request">29</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Modify</property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <signal name="clicked" handler="on_about_modify_button_clicked" last_modification_time="Sun, 23 Sep 2007 18:10:10 GMT"/> - </widget> - <packing> - <property name="x">104</property> - <property name="y">336</property> - </packing> - </child> - - <child> <widget class="GtkScrolledWindow" id="scrolledwindow3"> <property name="width_request">304</property> <property name="height_request">160</property> @@ -2343,6 +2372,249 @@ <property name="type">tab</property> </packing> </child> + + <child> + <widget class="GtkFrame" id="frame12"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment12"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox12"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow12"> + <property name="width_request">500</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed12"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="label43"> + <property name="width_request">152</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Word string name:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="vr_word_name_entry"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="sensitive">False</property> + <property name="can_focus">True</property> + <property name="editable">False</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">16</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label44"> + <property name="width_request">160</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Word:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">48</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="vr_word_entry"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">8</property> + <property name="y">64</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="vr_add_button"> + <property name="width_request">160</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Add</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_vr_add_button_clicked" last_modification_time="Fri, 09 Nov 2007 09:13:13 GMT"/> + </widget> + <packing> + <property name="x">8</property> + <property name="y">96</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="vr_delete_button"> + <property name="width_request">160</property> + <property name="height_request">29</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Delete</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_vr_delete_button_clicked" last_modification_time="Fri, 09 Nov 2007 09:14:05 GMT"/> + </widget> + <packing> + <property name="x">8</property> + <property name="y">128</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label42"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Dictionary</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="tab_expand">False</property> + <property name="tab_fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label41"> + <property name="visible">True</property> + <property name="label" translatable="yes">Voice recognition</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">tab</property> + </packing> + </child> </widget> <packing> <property name="padding">0</property> Modified: software/tux_framework/trunk/SDK/gadget_maker/tuxgagdetmaker.py =================================================================== --- software/tux_framework/trunk/SDK/gadget_maker/tuxgagdetmaker.py 2007-11-14 10:24:38 UTC (rev 698) +++ software/tux_framework/trunk/SDK/gadget_maker/tuxgagdetmaker.py 2007-11-14 13:26:50 UTC (rev 699) @@ -1,16 +1,30 @@ -#!/usr/bin/env python -# -*- coding: UTF8 -*- - -# Python module tuxgagdetmaker.py -# Autogenerated from tuxgagdetmaker.glade -# Generated on Sun Sep 23 20:15:21 2007 - -# Warning: Do not modify any context comment such as #-- -# They are required to keep user's code - +#!/usr/bin/python +# -*- coding: latin1 -*- +# ----------------------------------------------------------------------------- +# Tux Droid - Tux Gadget Maker +# Copyright (C) 2007 C2ME Sa <rem...@c2...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# ----------------------------------------------------------------------------- +# $Id: $ +# ----------------------------------------------------------------------------- import subprocess import time import thread +import threading import signal import os import sys @@ -26,12 +40,12 @@ from SimpleGladeApp import SimpleGladeApp from SimpleGladeApp import bindtextdomain -from GdgObject import * +from GdgObject import TGFormat, GdgDialog, GdgDialogQuestion import config app_name = "tuxgagdetmaker" -app_version = "0.0.1" +app_version = "0.1.1" glade_dir = "" locale_dir = "" @@ -74,6 +88,7 @@ self.last_opened_file = '' self.get_widget("codes_editor_entry").set_text(config.editor) self.fw_process = None + self.fw_process_mutex = threading.Lock() self.fw_loaded = False self.get_widget('stop1').set_sensitive(False) @@ -97,6 +112,9 @@ sys.exit(0) def on_nouveau1_activate(self, widget, *args): + if self.fw_process != None: + GdgDialog('Tux Gadget Maker', 'Please stop the execution of the gadget before!') + return # Make the file chooser f_c = gtk.FileChooserDialog('Select a TGF file ...', buttons = ( gtk.STOCK_CANCEL, @@ -118,6 +136,8 @@ if filename.lower().rfind('.tgf') == -1: filename = filename + '.tgf' f_c.destroy() + if filename == '': + return # Create the gadget and load it if not os.path.exists(filename): shutil.copy(TEMPLATE_PATH, filename) @@ -125,6 +145,9 @@ self.load_gadget(filename) def on_ouvrir1_activate(self, widget, *args): + if self.fw_process != None: + GdgDialog('Tux Gadget Maker', 'Please stop the execution of the gadget before!') + return # Make the file chooser f_c = gtk.FileChooserDialog('Select a TGF file ...', buttons = ( gtk.STOCK_CANCEL, @@ -150,6 +173,9 @@ self.load_gadget(filename) def on_ouvrir2_activate(self, widget, *args): + if self.fw_process != None: + GdgDialog('Tux Gadget Maker', 'Please stop the execution of the gadget before!') + return # Make the file chooser f_c = gtk.FileChooserDialog('Select a TGF directory ...', buttons = ( gtk.STOCK_CANCEL, @@ -175,20 +201,24 @@ def on_enregistrer2_activate(self, widget, *args): self.save_gadget_dir() + + def on_recharger1_activate(self, widget, *args): + self.reload_gadget() def on_execute1_activate(self, widget, *args): - if not self.fw_loaded: - self.execute_gadget() + self.execute_gadget() def on_stop1_activate(self, widget, *args): - if self.fw_loaded: - self.kill_gadget() + self.kill_gadget() def on_quitter1_activate(self, widget, *args): + if self.fw_process != None: + GdgDialog('Tux Gadget Maker', 'Please stop the execution of the gadget before!') + return self.get_widget("window1").destroy() - def on_a_propos1_activate(self, widget, *args): - print "on_À_propos1_activate called with self.%s" % widget.get_name() + def on_about1_activate(self, widget, *args): + GdgDialog('Tux Gadget Maker', 'Tux Gadget Maker V%s\n\n(C) 2007 C2ME Sa\nre...@c2...' %app_version, False, True) def on_about_modify_button_clicked(self, widget, *args): name = self.get_widget("about_name_entry").get_text() @@ -210,10 +240,12 @@ self.load_general_settings() def on_params_delete_button_clicked(self, widget, *args): - name = self.get_widget("params_name_entry").get_text() - if name in self.TGF_file.parser.settings.get_parameters_list(): - self.TGF_file.parser.settings.delete_parameter(name) - self.load_params_settings() + def on_yes_action(): + name = self.get_widget("params_name_entry").get_text() + if name in self.TGF_file.parser.settings.get_parameters_list(): + self.TGF_file.parser.settings.delete_parameter(name) + self.load_params_settings() + GdgDialogQuestion('Tux Gadget Maker', 'This action will definitively remove this parameter ! Continue ?', on_yes_action) def on_params_add_button_clicked(self, widget, *args): name = self.get_widget("params_name_entry").get_text() @@ -243,16 +275,19 @@ self.load_languages_strings() def on_strings_lg_delete_button_clicked(self, widget, *args): - model = self.get_widget("strings_lang_comboboxentry").get_model() - i = self.get_widget("strings_lang_comboboxentry").get_active() - lang = model[i][0] - idxb = lang.find('<') + 1 - idxe = lang.find('>') - lang_country = lang[idxb:idxe] - if lang_country in self.TGF_file.parser.i18n.get_languages_list(): - if lang_country != 'en_US': - self.TGF_file.parser.i18n.delete_language(lang_country) - self.load_languages_strings() + def on_yes_action(): + model = self.get_widget("strings_lang_comboboxentry").get_model() + i = self.get_widget("strings_lang_comboboxentry").get_active() + lang = model[i][0] + idxb = lang.find('<') + 1 + idxe = lang.find('>') + lang_country = lang[idxb:idxe] + if lang_country in self.TGF_file.parser.i18n.get_languages_list(): + if lang_country != 'en_US': + self.TGF_file.parser.i18n.delete_language(lang_country) + self.load_languages_strings() + + GdgDialogQuestion('Tux Gadget Maker', 'This action will definitively remove this language ! Continue ?', on_yes_action) def to_legal_string(self, message): if len(message) < 2: @@ -275,10 +310,13 @@ self.load_message_strings(self.current_lang_country) def on_strings_st_delete_button_clicked(self, widget, *args): - name = self.get_widget("strings_st_name_entry").get_text() - if name in self.TGF_file.parser.i18n.get_messages_list(): - self.TGF_file.parser.i18n.delete_message(name) - self.load_message_strings(self.current_lang_country) + def on_yes_action(): + name = self.get_widget("strings_st_name_entry").get_text() + if name in self.TGF_file.parser.i18n.get_messages_list(): + self.TGF_file.parser.i18n.delete_message(name) + self.load_message_strings(self.current_lang_country) + + GdgDialogQuestion('Tux Gadget Maker', 'This action will definitively remove this message ! Continue ?', on_yes_action) def on_strings_st_add_button_clicked(self, widget, *args): name = self.get_widget("strings_st_name_entry").get_text() @@ -311,8 +349,10 @@ self.load_guis_icons() def on_icons_delete_button_clicked(self, widget, *args): - self.TGF_file.parser.icons.remove(self.last_icon) - self.load_guis_icons() + def on_yes_action(): + self.TGF_file.parser.icons.remove(self.last_icon) + self.load_guis_icons() + GdgDialogQuestion('Tux Gadget Maker', 'This action will definitively remove this icon ! Continue ?', on_yes_action) def on_sounds_filechooserbutton_update_preview(self, widget, *args): filename = widget.get_filename() @@ -320,8 +360,10 @@ self.load_guis_sounds() def on_sounds_delete_button_clicked(self, widget, *args): - self.TGF_file.parser.sounds.remove(self.last_sound) - self.load_guis_sounds() + def on_yes_action(): + self.TGF_file.parser.sounds.remove(self.last_sound) + self.load_guis_sounds() + GdgDialogQuestion('Tux Gadget Maker', 'This action will definitively remove this sound ! Continue ?', on_yes_action) def on_codes_c_edit_button_clicked(self, widget, *args): my_path = self.TGF_file.parser.tgf_path + self.last_codes_common @@ -336,8 +378,10 @@ self.load_codes_libs() def on_codes_l_delete_button_clicked(self, widget, *args): - self.TGF_file.parser.libs.remove(self.last_codes_lib) - self.load_codes_libs() + def on_yes_action(): + self.TGF_file.parser.libs.remove(self.last_codes_lib) + self.load_codes_libs() + GdgDialogQuestion('Tux Gadget Maker', 'This action will definitively remove this library ! Continue ?', on_yes_action) def on_codes_l_edit_button_clicked(self, widget, *args): my_path = self.TGF_file.parser.tgf_path + '/Scripts/Python/' + self.last_codes_lib @@ -345,7 +389,23 @@ if os.path.exists(my_path): cmd = edit % my_path thread.start_new_thread(os.system,(cmd,)) + + def on_vr_delete_button_clicked(self, widget, *args): + def on_yes_action(): + name = self.get_widget("vr_word_entry").get_text() + if "vr_%s" % name in self.TGF_file.parser.i18n.get_messages_list(): + self.remove_from_dictionary(name) + self.delete_word_string(name) + self.load_dictionary() + GdgDialogQuestion('Tux Gadget Maker', 'This action will definitively remove this word ! Continue ?', on_yes_action) + def on_vr_add_button_clicked(self, widget, *args): + name = self.get_widget("vr_word_entry").get_text() + if not "vr_%s" % name in self.TGF_file.parser.i18n.get_messages_list(): + self.insert_in_dictionary(name) + self.insert_word_string(name) + self.load_dictionary() + def create_tree_views(self): """ Create the tree viewers @@ -476,6 +536,17 @@ self.codes_libs.set_reorderable(True) self.get_widget("scrolledwindow10").add(self.codes_libs) self.get_widget("scrolledwindow10").show_all() + # Dictionary + word_column = gtk.TreeViewColumn('Word') + word_cell = gtk.CellRendererText() + word_column.pack_start(word_cell, True) + word_column.add_attribute(word_cell, 'text', 0) + self.word_ls = gtk.ListStore(str) + self.word = gtk.TreeView(self.word_ls) + self.word.append_column(word_column) + self.word.set_reorderable(True) + self.get_widget("scrolledwindow12").add(self.word) + self.get_widget("scrolledwindow12").show_all() def load_gadget(self, path): """ @@ -532,6 +603,10 @@ self.load_codes_libs() self.codes_libs.get_selection().connect("changed", self.on_codes_libs_select) + # Load dictionary + self.load_dictionary() + self.word.get_selection().connect("changed", + self.on_word_select) def on_lang_viewer_select(self, obj): path = obj.get_selected_rows() @@ -613,11 +688,24 @@ path = path[1][0][0] name = self.codes_libs_ls[path][0] self.last_codes_lib = name + + def on_word_select(self, obj): + path = obj.get_selected_rows() + if len(path[1]) > 0: + path = path[1][0][0] + name = self.word_ls[path][0] + self.get_widget("vr_word_entry").set_text(name) + self.get_widget("vr_word_name_entry").set_text("vr_%s" % name) def load_general_settings(self): general_lst = self.TGF_file.parser.settings.get_generals_list() self.settings_general_ls.clear() + + sorted_list = [] for general in general_lst: + sorted_list.append(general) + sorted_list.sort() + for general in sorted_list: name = general value = self.TGF_file.parser.settings.get_general_value(general) if str(type(value)) == "<type 'str'>": @@ -711,25 +799,114 @@ if lib_path.lower().find('.py') != -1: if lib_path.lower().find('.pyp') == -1: self.codes_libs_ls.append([lib_path]) + + def insert_word_string(self, word): + name = "vr_%s" % word + value = self.to_legal_string(word) + value = self.__interpret_value(value) + if not name in self.TGF_file.parser.i18n.get_messages_list(): + self.TGF_file.parser.i18n.add_message(name, value) + self.load_message_strings(self.current_lang_country) + + def delete_word_string(self, word): + name = "vr_%s" % word + if name in self.TGF_file.parser.i18n.get_messages_list(): + self.TGF_file.parser.i18n.delete_message(name) + self.load_message_strings(self.current_lang_country) + + def load_dictionary(self): + dict_path = self.TGF_file.parser.tgf_path + '/Data/rc_dict' + self.word_ls.clear() + if os.path.isfile(dict_path): + f = open(dict_path, 'r') + st = f.read() + f.close() + global words + words = [] + exec str(st) in globals() + for word in words: + self.word_ls.append([word[0]]) + self.insert_word_string(word[0]) + + def insert_in_dictionary(self, new_word): + dict_path = self.TGF_file.parser.tgf_path + '/Data/rc_dict' + global words + words = [] + if os.path.isfile(dict_path): + f = open(dict_path, 'r') + st = f.read() + f.close() + exec str(st) in globals() + b = False + for word in words: + if word[0] == new_word: + b = True + break + if not b: + words.append([new_word, []]) + st = 'words=%s' % str(words) + f = open(dict_path, 'w') + f.write(st) + f.close() + + def remove_from_dictionary(self, new_word): + dict_path = self.TGF_file.parser.tgf_path + '/Data/rc_dict' + global words + words = [] + if os.path.isfile(dict_path): + f = open(dict_path, 'r') + st = f.read() + f.close() + exec str(st) in globals() + for i, word in enumerate(words): + if word[0] == new_word: + words.pop(i) + break + st = 'words=%s' % str(words) + f = open(dict_path, 'w') + f.write(st) + f.close() def close_gadget(self): + if self.fw_process != None: + GdgDialog('Tux Gadget Maker', 'Please stop the execution of the gadget before!') + return if self.TGF_file != None: self.TGF_file.mode = 'r' self.TGF_file.close() def save_gadget(self): + if self.fw_process != None: + GdgDialog('Tux Gadget Maker', 'Please stop the execution of the gadget before!') + return if self.TGF_file != None: + self.on_about_modify_button_clicked(None) tgf_path = self.TGF_file.c_path self.TGF_file.mode = 'a' self.TGF_file.close(True) def save_gadget_dir(self): + if self.fw_process != None: + GdgDialog('Tux Gadget Maker', 'Please stop the execution of the gadget before!') + return if self.TGF_file != None: + self.on_about_modify_button_clicked(None) tgf_path = self.TGF_file.d_path self.TGF_file.mode = 'a' self.TGF_file.close(True) + + def reload_gadget(self): + if self.fw_process != None: + GdgDialog('Tux Gadget Maker', 'Please stop the execution of the gadget before!') + return + if self.TGF_file != None: + tgf_path = self.TGF_file.c_path + self.save_gadget() + self.load_gadget(tgf_path) def execute_gadget(self): + if self.fw_process != None: + return def check_fw_active(): while True: try: @@ -741,7 +918,9 @@ time.sleep(0.1) self.get_widget('execute1').set_sensitive(True) self.get_widget('stop1').set_sensitive(False) - self.fw_loaded = False + self.fw_process_mutex.acquire() + self.fw_process = None + self.fw_process_mutex.release() if self.TGF_file != None: self.save_gadget() @@ -754,10 +933,17 @@ thread.start_new_thread(check_fw_active, ()) def kill_gadget(self): - if self.fw_process != None: + self.fw_process_mutex.acquire() + auth = self.fw_process + self.fw_process_mutex.release() + if auth != None: try: os.kill(self.fw_process.pid, signal.SIGKILL) os.waitpid(-1, os.WNOHANG) + time.sleep(0.5) + self.get_widget('execute1').set_sensitive(True) + self.get_widget('stop1').set_sensitive(False) + self.fw_process = None except: pass Added: software/tux_framework/trunk/bin/README =================================================================== --- software/tux_framework/trunk/bin/README (rev 0) +++ software/tux_framework/trunk/bin/README 2007-11-14 13:26:50 UTC (rev 699) @@ -0,0 +1,43 @@ +The following binary list is a part of Speech Signal Processing Toolkit (SPTK): + - frame + - mgc2mgc + - mgcep + - pitch + - window + - x2x + +Original README file of SPTK +---------------------------- + + Speech Signal Processing Toolkit (SPTK) + version 3.1 release October 1, 2007 + +The Speech Signal Processing Toolkit (SPTK) is a suite of speech +signal processing tools for UNIX environments, e.g., LPC +analysis, PARCOR analysis, LSP analysis, PARCOR synthesis +filter, LSP synthesis filter, vector quantization techniques, +and other extended versions of them. + +SPTK was developed and has been used in the research group of +Prof. Satoshi Imai (he has retired) and Prof. Takao Kobayashi +(currently he is with Interdisciplinary Graduate School of +Science and Engineering, Tokyo Institute of Technology) at P&I +laboratory, Tokyo Institute of Technology. A sub-set of tools +is chosen and arranged for distribution by Prof. Keiichi Tokuda +(currently he is with Department of Computer Science and +Engineering, Nagoya Institute of Technology) as a coordinator in +cooperation with Dr. Takashi Masuko (currently he is with +Corporate Research & Development Center, Toshiba Corp.), +Dr. Kazuhito Koishida (currently he is with Microsoft Research), +Dr. Shinji Sako (currently he is a Research Associate, Nagoya +Institute of Technology), Dr. Heiga Zen (currently he is a +PostDoc fellow at Nagoya Institute of Technology), and some +graduate students. + +The original source codes have been written by many people who +took part in activities of the research group. The most +original source codes of this distribution were written by Takao +Kobayashi (graph, data processing, FFT, sampling rate +conversion, etc.), Keiichi Tokuda (speech analysis, speech +synthesis, etc.), and Kazuhito Koishida (LSP, vector +quantization, etc.). Added: software/tux_framework/trunk/bin/frame =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/bin/frame ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/bin/mgc2mgc =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/bin/mgc2mgc ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/bin/mgcep =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/bin/mgcep ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/bin/pitch =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/bin/pitch ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/bin/window =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/bin/window ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/bin/x2x =================================================================== (Binary files differ) Property changes on: software/tux_framework/trunk/bin/x2x ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/tux_framework/trunk/libs/DTW.py =================================================================== --- software/tux_framework/trunk/libs/DTW.py (rev 0) +++ software/tux_framework/trunk/libs/DTW.py 2007-11-14 13:26:50 UTC (rev 699) @@ -0,0 +1,45 @@ +#!/usr/bin/python +# -*- coding: latin1 -*- +# ----------------------------------------------------------------------------- +# Tux Droid - Voice recognition - DTW +# Copyright (C) 2007 C2ME Sa <rem...@c2...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# ----------------------------------------------------------------------------- +# $Id: $ +# ----------------------------------------------------------------------------- +from ctypes import * + +DTW_SO = '/opt/tuxdroid/apps/tux_framework/libs/_DTW.so' +lib = CDLL(DTW_SO) +_DTW = lib.DTW +_DTW.restype = c_float + +class m_patern(Structure): + _fields_ = [("matrix", POINTER(c_float)), + ("matrix_len", c_uint)] + +def list_to_m_patern(float_list): + t_float = tuple(float_list) + p1 = m_patern() + p1.matrix = (c_float * len(t_float))(*t_float) + p1.matrix_len = len(t_float) + return p1 + +def DTW(mcep_coeff1, mcep_coeff2): + v1 = list_to_m_patern(mcep_coeff1) + v2 = list_to_m_patern(mcep_coeff2) + return _DTW(v1, v2) Modified: software/tux_framework/trunk/libs/FWObject.py =================================================================== --- software/tux_framework/trunk/libs/FWObject.py 2007-11-14 10:24:38 UTC (rev 698) +++ software/tux_framework/trunk/libs/FWObject.py 2007-11-14 13:26:50 UTC (rev 699) @@ -29,9 +29,13 @@ import atexit import subprocess import threading +import commands from GdgObject import * +from GdgThreads import gadget_thread import TGFormat +sys.path.append('/opt/tuxdroid/apps/tux_framework') +from version import fw_version def regularize_path(path): path = path.replace('%20', '') @@ -40,6 +44,7 @@ class GdgFramework(object): def __init__(self, gadget_filename): + self.version = fw_version self.gdg_filename = regularize_path(gadget_filename) if not os.path.exists(self.gdg_filename): return @@ -47,6 +52,14 @@ self.__exit_flag = False self.__standby_mutex = threading.Lock() self.__unauthorized_gadgets = [] + self.__gtk_main_thread = None + + def kill(self): + try: + self.__close_gadgets() + os.kill(os.getpid(), 9) + except: + pass def run(self): if not os.path.exists(self.gdg_filename): @@ -55,7 +68,8 @@ self.__check_system_ready() gtk.gdk.threads_init() - thread.start_new_thread(gtk.main, ()) + self.__gtk_main_thread = threading.Thread(target = gtk.main) + self.__gtk_main_thread.start() if not self.__load_gadgets(): return @@ -63,6 +77,8 @@ self.__signal_binding() self._main_stopped = False self.__main() + gadget_thread.join() + self.kill() def exclude_gadget(self, gadget_name): """ @@ -73,7 +89,7 @@ """ self.__unauthorized_gadgets.append(gadget_name) if gadgets.has_key(gadget_name): - thread.start_new_thread(self.__close_gadget, (gadget_name,)) + gadget_thread.start_new_thread(self.__close_gadget, (gadget_name,)) def close_gadget(self, gadget_name): """ @@ -83,7 +99,7 @@ "gadget_name" as string : Name of the gadget to close """ if gadgets.has_key(gadget_name): - thread.start_new_thread(self.__close_gadget, (gadget_name,)) + gadget_thread.start_new_thread(self.__close_gadget, (gadget_name,)) def restart_gadget(self, gadget_name): """ @@ -97,7 +113,7 @@ def async(gadget_name, gadget_path): self.close_gadget(gadget_name) self.start_gadget(gadget_path) - thread.start_new_thread(async, (gadget_name, gadget_path)) + gadget_thread.start_new_thread(async, (gadget_name, gadget_path)) def start_gadget(self, gadget_path): """ @@ -114,6 +130,7 @@ if gadget_name != 'Manager': try: gadget = GdgObject(gadget_path, self) + gadget.notify.start() except: return None gadget.restore_GUI(True) @@ -124,6 +141,7 @@ def async_create(gadget_path): try: gadget = GdgObject(gadget_path, self) + gadget.notify.start() except: return if gadget.get_funct('initialization') != None: @@ -137,7 +155,7 @@ tux.sys.wait(0.1) gadget.get_funct('binds_clean_rules')() gadget.get_funct('make_main_menu')() - thread.start_new_thread(async_create, (gadget_path,)) + gadget_thread.start_new_thread(async_create, (gadget_path,)) return None def __check_tux_resources(self): @@ -179,8 +197,20 @@ t = process.readlines() app_count = int(t[0].replace('\n', '')) - 1 process.close() + if app_count > 1: - return False + my_pid = os.getpid() + st_pid = commands.getoutput("ps -ef | grep %s | grep python" % app_name) + splited = st_pid.split() + ap_list = [] + for i in range(app_count): + pid = splited[i*10:(i+1)*10][1] + if splited[i*10:(i+1)*10][1] != str(my_pid): + try: + os.kill(int(pid), signal.SIGKILL) + except: + pass + return True else: if tux.daemon.connected: tux.daemon.set_my_client_name('tdgagdet') @@ -209,10 +239,6 @@ self._main_stopped = True def __close_gadget(self, gadget_name): - if gadgets[gadget_name].get_funct('finalization') != None: - gadgets[gadget_name].get_funct('finalization')() - if gadget_name == 'Manager': - gadgets[gadget_name].get_funct('tray_destroy')() try: gadgets[gadget_name].destroy() gadgets.pop(gadget_name) @@ -261,21 +287,13 @@ finalize() gtk.main_quit() - + self.__exit_flag = True - - while not self._main_stopped: - time.sleep(0.1) - - # force application to exit - try: - os.kill(os.getpid(), 9) - except: - pass self.__standby_mutex.release() def __on_standby_async(self): - thread.start_new_thread(self.__on_standby, ()) + t = threading.Thread(target = self.__on_standby) + t.start() def __exit(self, signum, frame): """ @@ -315,20 +333,20 @@ manager_gdg = GdgObject(os.path.join(PATH_GADGETS, 'Manager.tgf'), self) manager_gdg.get_funct('show_splash_screen')() + for gdg in gadgets.keys(): + gadgets[gdg].notify.start() manager_gdg.insert_funct('close_application', self.__on_standby_async) manager_gdg.insert_funct('start_daemons', self.__check_tux_resources) - if not manager_gdg.gui('widget').showed(): - manager_gdg.gui('widget').show() - while manager_gdg.gui('widget').window == None: - tux.sys.wait(0.1) manager_gdg.get_funct('binds_clean_rules')() - manager_gdg.get_funct('make_main_menu')() for gdg in gadgets.keys(): - if gadgets[gdg].get_funct('initialization') != None: - gadgets[gdg].get_funct('initialization')() + if gdg != 'Manager': + if gadgets[gdg].get_funct('initialization') != None: + gadgets[gdg].get_funct('initialization')() + manager_gdg.get_funct('initialization')() return True else: gadget = GdgObject(self.gdg_filename, self) + gadget.notify.start() gadget.gui('widget').show() while not gadget.gui('widget').showed(): time.sleep(0.1) Modified: software/tux_framework/trunk/libs/GdgDebug.py =================================================================== --- software/tux_framework/trunk/libs/GdgDebug.py 2007-11-14 10:24:38 UTC (rev 698) +++ software/tux_framework/trunk/libs/GdgDebug.py 2007-11-14 13:26:50 UTC (rev 699) @@ -28,7 +28,7 @@ import syslog # Flag which allow the debug messages on a log file -ALLOW_LOG_FLAG = False +ALLOW_LOG_FLAG = True class GdgDebugger(object): """ Modified: software/tux_framework/trunk/libs/GdgDownload.py =================================================================== --- software/tux_framework/trunk/libs/GdgDownload.py 2007-11-14 10:24:38 UTC (rev 698) +++ software/tux_framework/trunk/libs/GdgDownload.py 2007-11-14 13:26:50 UTC (rev 699) @@ -79,7 +79,7 @@ A tuple(<boolean>, <string>) """ socket.setdefaulttimeout(timeout) - if not rss_server_available(url, timeout): + if not check_server_available(url, timeout): return False, '' req = urllib2.Request(url) try: Modified: software/tux_framework/trunk/libs/GdgGuiUpdate.py =================================================================== --- software/tux_framework/trunk/libs/GdgGuiUpdate.py 2007-11-14 10:24:38 UTC (rev 698) +++ software/tux_framework/trunk/libs/GdgGuiUpdate.py 2007-11-14 13:26:50 UTC (rev 699) @@ -32,14 +32,10 @@ self.__stack_mutex = threading.Lock() self.__stack_update = [] self.__thread = None - self.running = False self.start_loop() def destroy(self): self.stop_loop() - if self.__thread != None: - if self.__thread.isAlive(): - self.__thread.join() def insert(self, gui_op, *args): self.__stack_mutex.acquire() @@ -52,11 +48,13 @@ self.__thread.start() def stop_loop(self): - self.running = False + if self.__thread != None: + if self.__thread.isAlive(): + self.__thread._Thread__stop() + self.__thread.join() def __loop(self): - self.running = True - while self.running: + while True: gui_update = [] self.__stack_mutex.acquire() if len(self.__stack_update) > 0: @@ -64,6 +62,9 @@ self.__stack_mutex.release() if len(gui_update) > 0: gtk.gdk.threads_enter() - gui_update[0](*gui_update[1][0]) + try: + gui_update[0](*gui_update[1][0]) + except: + pass gtk.gdk.threads_leave() time.sleep(0.01) Modified: software/tux_framework/trunk/libs/GdgObject.py =================================================================== --- software/tux_framework/trunk/libs/GdgObject.py 2007-11-14 10:24:38 UTC (rev 698) +++ software/tux_framework/trunk/libs/GdgObject.py 2007-11-14 13:26:50 UTC (rev 699) @@ -33,20 +33,26 @@ from SimpleGladeApp import SimpleGladeApp from SimpleGladeApp import bindtextdomain import zipfile +import copy from TGFormat import * from TGFXml import * +from TGFCanvas import scene_struct from GoogleTranslate import * from Languages import * from TextFilters import * from GdgDebug import GdgDebugger -from GdgThreads import GdgThreads +from GdgThreads import gadget_thread from GdgGuiUpdate import GdgGuiUpdate from GdgDownload import GdgDownload +from tdrss import * +from GdgVoiceRec import VoiceRecParametrize, VoiceRecAcquire, VoiceRecMatching -sys.path.append('/opt/tuxdroid/api/python') +sys.path.append('/opt uxdroid/api/python') from tuxapi_const import * +from tuxapi_class import TuxSwitch from tux import * # This library create a tux object +PATH_APP = os.path.realpath(os.path.dirname(sys.argv[0])) # Container of gadgets gadgets = {} @@ -58,83 +64,170 @@ tts_mutex = threading.Lock() # Flag which allow the debug messages on the terminal debug_on_terminal = False +# Head switch +_tux_head_switch = TuxSwitch(tux, STATUS_HEAD_PUSH_SWITCH) +# Left wing switch +_tux_lwing_switch = TuxSwitch(tux, STATUS_LEFT_WING_PUSH) +# Right wing switch +_tux_rwing_switch = TuxSwitch(tux, STATUS_RIGHT_WING_PUSH) class GdgDialog(object): - def __init__(self, title, message): + def __init__(self, title, message, block = False, center_justify = False): self.message = message self.title = title - thread.start_new_thread(self.__show, ()) + self.__center_justify = center_justify + if block: + self.__show() + else: + gadget_thread.start_new_thread(self.__show_async, ()) + + def __show_async(self): + gtk.gdk.threads_enter() + self.__show() + gtk.gdk.threads_leave() def __show(self): - gtk.gdk.threads_enter() dialogue = gtk.Dialog(self.title, None, gtk.DIALOG_MODAL, ()) dialogue.set_property("width-request", 300) if gadgets.has_key('Manager'): dialogue.set_icon_from_file(gadgets['Manager'].icons['gadget.png']) - gtk.gdk.threads_leave() bt_alone = dialogue.add_button("Ok/Cancel", gtk.RESPONSE_APPLY) def on_click_okcancel(obj): - def async(): - dialogue.destroy() - thread.start_new_thread(async, ()) + dialogue.destroy() - gtk.gdk.threads_enter() bt_alone.connect("clicked", on_click_okcancel) box = gtk.HBox(spacing = 5) box.set_border_width(5) box.show() dialogue.vbox.pack_start(box) - identified_error = gtk.Label(self.message) - identified_error.show() - box.pack_start(identified_error) + txtv = gtk.TextView() + txtv.set_editable(False) + txtv.set_cursor_visible(False) + txtv.set_wrap_mode(gtk.WRAP_WORD) + txtv.set_left_margin(10) + txtv.set_right_margin(10) + txtv.set_property("width-request", 300) + if self.__center_justify: + txtv.set_justification(gtk.JUSTIFY_CENTER) + #txtv.set_property("height-request", 100) + #txtv.modify_base(gtk.STATE_NORMAL, dialogue.get_style().bg[gtk.STATE_PRELIGHT]) + buff = txtv.get_buffer() + buff.set_text(self.message) + txtv.show() + box.pack_start(txtv) dialogue.run() + +class GdgDialogScrolled(object): + + def __init__(self, title, message, gadget, block = False, center_justify = False): + self.message = message + self.title = title + self.__center_justify = center_justify + self.gadget = gadget + if block: + self.__show() + else: + gadget_thread.start_new_thread(self.__show_async, ()) + + def __show_async(self): + gtk.gdk.threads_enter() + self.__show() gtk.gdk.threads_leave() + def __show(self): + dialog = gtk.Dialog(self.title, None, gtk.DIALOG_MODAL, ()) + dialog.set_property("width-request", 300) + if gadgets.has_key('Manager'): + dialog.set_icon_from_file(self.gadget.get_icon('gadget.png')) + bt_alone = dialog.add_button("Ok/Cancel", gtk.RESPONSE_APPLY) + + def on_click_okcancel(obj): + dialog.destroy() + + bt_alone.connect("clicked", on_click_okcancel) + + hbox1 = gtk.HBox(spacing = 5) + hbox1.set_border_width(5) + hbox1.show() + dialog.vbox.pack_start(hbox1) + fd = gtk.ScrolledWindow() + fd.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + fd.set_property("width-request", 400) + fd.set_property("height-request", 300) + hbox1.pack_start(fd) + box = gtk.VBox(spacing=5) + fd.add_with_viewport(box) + txtv = gtk.TextView() + txtv.set_editable(False) + txtv.set_cursor_visible(False) + txtv.set_wrap_mode(gtk.WRAP_WORD) + txtv.set_left_margin(10) + txtv.set_right_margin(10) + #txtv.modify_base(gtk.STATE_NORMAL, my_dialog.get_style().bg[gtk.STATE_PRELIGHT]) + buff = txtv.get_buffer() + buff.set_text(self.message) + box.pack_start(txtv) + txtv.show() + dialog.show_all() + dialog.run() + class GdgDialogQuestion(object): - def __init__(self, title, message, on_yes_event): + def __init__(self, title, message, on_yes_event, block = False): self.message = message self.title = title self.on_yes_event = on_yes_event - thread.start_new_thread(self.__show, ()) + if block: + self.__show() + else: + gadget_thread.start_new_thread(self.__show_async, ()) + + def __show_async(self): + gtk.gdk.threads_enter() + self.__show() + gtk.gdk.threads_leave() def __show(self): - gtk.gdk.threads_enter() dialogue = gtk.Dialog(self.title, None, gtk.DIALOG_MODAL, ()) dialogue.set_property("width-request", 300) if gadgets.has_key('Manager'): dialogue.set_icon_from_file(gadgets['Manager'].icons['gadget.png']) - gtk.gdk.threads_leave() bt_yes = dialogue.add_button(gtk.STOCK_YES, gtk.RESPONSE_YES) bt_no = dialogue.add_button(gtk.STOCK_NO, gtk.RESPONSE_NO) def on_click_yes(obj): def async(): - dialogue.destroy() if self.on_yes_event != None: self.on_yes_event() - thread.start_new_thread(async, ()) + gadget_thread.start_new_thread(async, ()) + dialogue.destroy() def on_click_no(obj): - def async(): - ... [truncated message content] |
From: Paul_R <c2m...@c2...> - 2007-11-14 10:24:50
|
Author: Paul_R Date: 2007-11-14 11:24:38 +0100 (Wed, 14 Nov 2007) New Revision: 698 Modified: software/gadgets/settings/trunk/settings.tgf software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp software/gadgets/settings/trunk/settings/Scripts/Python/notify.pyp software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml software/gadgets/settings/trunk/settings/about.xml software/gadgets/settings/trunk/settings/settings.xml software/gadgets/settings/trunk/settings/strings.xml Log: * Change the Changelog and description window * Added the notify checker part to refresh the wifi channel and control the sleep * Added the link with the firmware updater gadget Modified: software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp 2007-11-13 16:07:09 UTC (rev 697) +++ software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp 2007-11-14 10:24:38 UTC (rev 698) @@ -19,6 +19,8 @@ self.__sound_mutex = threading.Lock() self.__tree_mutex = threading.Lock() self.my_dict = {} + _me.insert_funct('avoidchannel', self.avoidchannel) + _me.insert_funct('searchWifiChannel', self.searchWifiChannel) def new(self): self.widget_window = True @@ -28,6 +30,8 @@ def on_window1_destroy(self, widget, *args): self.widget_window = False + if _me.get_param('dialog') != None: + _me.get_param('dialog').destroy() _me.set_param('widget_window', False) #------------------------------------------------------------ @@ -232,18 +236,18 @@ #------------------------------------------------------------ def searchWifiChannel(self): try: - a = commands.getoutput('iwlist channel') + string = commands.getoutput('iwlist channel') except: thread.start_new_thread(self.popup, (_me.string('Warning'), _me.string('Iwlist'), False)) return - if a.rfind('Current Channel') != -1: + if string.rfind('Current Channel') != -1: self.get_widget('lblUsedChannel').set_text(_me.string('lblNoChannel')) self.get_widget('lblChannel').set_text('') self.channel = -1 - elif a.rfind('Current Frequency') != -1: - channel_idx = a.rfind('(Channel ') + 9 - channel = a[channel_idx:channel_idx + 2] + elif string.rfind('Current Frequency') != -1: + channel_idx = string.rfind('(Channel ') + 9 + channel = string[channel_idx:channel_idx + 2] if channel.find(')') != -1: channel = channel[0:1] self.channel = channel @@ -255,8 +259,12 @@ #------------------------------------------------------------ def on_chkSleepEnable_toggled(self, widget, *args): _me.set_param('EnableSleep', widget.get_active()) + self.enablesleep = widget.get_active() - ## Send the active sleep command + + if self.enablesleep == True: + timeToSleep = time.time() + 60 * float(_me.get_param('SleepDelay')) + _me.set_param('timeToSleep', timeToSleep) #------------------------------------------------------------ # on sleep delay spin button @@ -264,7 +272,12 @@ def on_spinSleepDelay_changed(self, widget, *args): self.sleepdelay = self.get_widget('spinSleepDelay').get_text() _me.set_param('SleepDelay', self.sleepdelay) - ## Send the delay + if self.sleepdelay > 5: + return + + if self.enablesleep == True: + timeToSleep = time.time() + 60 * float(self.sleepdelay) + _me.set_param('timeToSleep', timeToSleep) #------------------------------------------------------------ # on sleep button clicked @@ -512,7 +525,7 @@ message = message + '======= Tux RF =======\n' + xml[9] + '\n \n' message = message + '======= Fux RF =======\n' + xml[10] + '\n \n' message = message + '======= Fux USB =======\n' + xml[11] + '\n \n' - dialog = GdgText(title, message, True) + dialog = GdgText(title, message, False) os.system('rm -rf /tmp/tuxdroid-firmware*') #------------------------------------------------------------ @@ -521,12 +534,11 @@ def flashCPU(self, widget): path = '/opt/tuxdroid/firmware/%s'%self.selectedfile print path - try: - gadgets['firmware_updater'].set_param('setting', True) - gadgets['firmware_updater'].set_param('local_path', path) + if gadgets.has_key('firmware_updater'): + gadgets['firmware_updater'].set_param('foreign_path', path) gadgets['firmware_updater'].main() - except: - dialog = GdgDialog('Error', 'Please install the settings gadget in the Tux Droid Manager.\nBe sure that the firmware updater gadget is correctly installed.') + else: + dialog = GdgDialog(_me.string('Warning'), _me.string('Firmware')) def on_local_version_selected(self, obj): path = obj.get_selected_rows() @@ -1322,19 +1334,16 @@ self.message = message self.title = title self.__center_justify = center_justify - if block: - self.__show() - else: - thread.start_new_thread(self.__show_async, ()) + thread.start_new_thread(self.__show_async, ()) def __show_async(self): - gtk.gdk.threads_enter() self.__show() - gtk.gdk.threads_leave() def __show(self): dialogue = gtk.Dialog(self.title, None, gtk.DIALOG_MODAL, ()) - dialogue.set_property("width-request", 600) + _me.set_param('dialog', dialogue) + + dialogue.set_property("width-request", 650) dialogue.set_property("height-request", 400) if gadgets.has_key('Manager'): dialogue.set_icon_from_file(gadgets['Manager'].icons['gadget.png']) @@ -1342,39 +1351,47 @@ def on_click_close(obj): dialogue.destroy() + _me.set_param('dialog', None) bt_alone.connect("clicked", on_click_close) + text_tree_store = gtk.TreeStore(str) + text_view = gtk.TreeView(text_tree_store) + #text_view.set_sensitive(False) + + text_renderer = gtk.CellRendererText() + text_column = gtk.TreeViewColumn('',text_renderer, text=0) + text_column.add_attribute(text_renderer, 'text', 0) + text_view.append_column(text_column) + + + scroll = gtk.ScrolledWindow() + scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS) + scroll.add(text_view) + scroll.show_all() + box = gtk.HBox(spacing = 5) box.set_border_width(5) box.show() dialogue.vbox.pack_start(box) - scroll = gtk.ScrolledWindow() - scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS) + box.pack_start(scroll) - index_column = gtk.TreeViewColumn('') - index_column.set_min_width(50) - index_column.set_property("clickable", False) - index_cell = gtk.CellRendererText() - index_cell.set_property("editable", False) - index_cell.set_property("background", 'white') - index_column.pack_start(index_cell, True) - index_column.add_attribute(index_cell, 'text', 0) - index_column.set_clickable(False) + def __async(): + time.sleep(0.2) + text_tree_store.append(None, [self.message]) + + gtk.gdk.threads_enter() + thread.start_new_thread(__async, ()) + dialogue.run() + gtk.gdk.threads_leave() - - - text = gtk.ListStore(str) - text_viewer = gtk.TreeView(text) - text_viewer.append_column(index_column) - text_viewer.set_headers_visible(False) - text.append([self.message]) + + + + + + + - scroll.add(text_viewer) - scroll.show_all() - - box.pack_start(scroll) - dialogue.run() - Modified: software/gadgets/settings/trunk/settings/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/settings/trunk/settings/Scripts/Python/notify.pyp 2007-11-13 16:07:09 UTC (rev 697) +++ software/gadgets/settings/trunk/settings/Scripts/Python/notify.pyp 2007-11-14 10:24:38 UTC (rev 698) @@ -5,6 +5,24 @@ 'notify_delay' setting. The setting named 'notify_delay' indicate if the loop can run. """ + + + ## Refresh the channels + print 'test window' + if _me.get_funct('avoidchannel') != None and _me.get_param('widget_window') == True: + print 'avoid channel' + _me.get_funct('avoidchannel')() + _me.get_funct('searchWifiChannel')() + print 'end' + + + # Control the sleep + ## Test if tux is already sleeping + if _me.get_param('EnableSleep') == True and _me.get_param('timeToSleep') != None: + if time.time() >= _me.get_param('timeToSleep'): + #Send the sleep command + print 'go to sleep now' + return False def notify_actuator(): Modified: software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml =================================================================== --- software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml 2007-11-13 16:07:09 UTC (rev 697) +++ software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml 2007-11-14 10:24:38 UTC (rev 698) @@ -41,6 +41,7 @@ <lblSoundMic type='str'>Microphone</lblSoundMic> <lblIDNum type='str'>ID de Tux : </lblIDNum> <Sound type='str'>Avez vous correctement entendu le son ?</Sound> + <Firmware type='str'>Assurer-vous que le gadget 'firmware updater' est correctement installé</Firmware> <itemChangeLog type='str'>Voir les changements</itemChangeLog> <lblSoundLocalSelect type='str'>Selectionner un son :</lblSoundLocalSelect> <lblSoundExternal type='str'>Lire un wave externe</lblSoundExternal> Modified: software/gadgets/settings/trunk/settings/about.xml =================================================================== (Binary files differ) Modified: software/gadgets/settings/trunk/settings/settings.xml =================================================================== --- software/gadgets/settings/trunk/settings/settings.xml 2007-11-13 16:07:09 UTC (rev 697) +++ software/gadgets/settings/trunk/settings/settings.xml 2007-11-14 10:24:38 UTC (rev 698) @@ -10,9 +10,7 @@ <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> @@ -26,8 +24,8 @@ <have_widget_part type='bool'>True</have_widget_part> <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> - <notify_priority type='int'>4</notify_priority> + <have_main_part type='bool'>False</have_main_part> + <main_priority type='int'>0</main_priority> + <notify_priority type='int'>0</notify_priority> </general> </settings> Modified: software/gadgets/settings/trunk/settings/strings.xml =================================================================== --- software/gadgets/settings/trunk/settings/strings.xml 2007-11-13 16:07:09 UTC (rev 697) +++ software/gadgets/settings/trunk/settings/strings.xml 2007-11-14 10:24:38 UTC (rev 698) @@ -39,9 +39,9 @@ <lblSleepStateSleep type='str'>Tux is currently sleeping</lblSleepStateSleep> <soundProg type='str'>Sound programming ...</soundProg> <lblSoundMic type='str'>Microphone</lblSoundMic> - <lblSoundStore type='str'>Store wave files locally</lblSoundStore> <lblIDNum type='str'>Tux's ID : </lblIDNum> <Sound type='str'>Have you heard the sound ?</Sound> + <Firmware type='str'>Be sure that the firmware updater gadget is correctly installed.</Firmware> <itemChangeLog type='str'>Show ChangeLog</itemChangeLog> <lblSoundLocalSelect type='str'>Select sound</lblSoundLocalSelect> <lblSoundExternal type='str'>Play external wave file</lblSoundExternal> @@ -54,7 +54,7 @@ <lblSleepStateWork type='str'>Tux isn't in sleep mode</lblSleepStateWork> <Switch type='str'>After closing this window, press on the wings and on the head. You've 15 seconds to perform this task.</Switch> - <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> + <lblSoundStore type='str'>Store wave files locally</lblSoundStore> <lblConfigTest type='str'>Self tests</lblConfigTest> <treeVersionVer type='str'>Version</treeVersionVer> <lblConfigWifi type='str'>Wifi configuration</lblConfigWifi> @@ -76,12 +76,13 @@ <Iwlist type='str'>iwlist package isn't found. Be sure that wireless tools package is instelled on your computer. (http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html#latest)</Iwlist> - <Warning type='str'>Warning</Warning> + <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <lblIDName type='str'>Tux's name : </lblIDName> <In type='str'>Would you like to test the sound input interface? To do this, you need to connect an input device in the blue connector and then click 'Yes'.</In> <lblConfigID type='str'>ID configuration</lblConfigID> + <Warning type='str'>Warning</Warning> <lblTabVersion type='str'>Versions</lblTabVersion> <lblSleepDelay type='str'>Active the sleep mode after a inactivity period of</lblSleepDelay> <Out type='str'>Would you like to test the sound output interface? Modified: software/gadgets/settings/trunk/settings.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2007-11-13 16:07:16
|
Author: Paul_R Date: 2007-11-13 17:07:09 +0100 (Tue, 13 Nov 2007) New Revision: 697 Modified: software/gadgets/settings/trunk/settings.tgf software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml software/gadgets/settings/trunk/settings/about.xml software/gadgets/settings/trunk/settings/settings.xml software/gadgets/settings/trunk/settings/strings.xml Log: * Set the sound treeview reorderable Modified: software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp 2007-11-13 14:31:33 UTC (rev 696) +++ software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp 2007-11-13 16:07:09 UTC (rev 697) @@ -17,6 +17,8 @@ self.prev = False self.flag = True self.__sound_mutex = threading.Lock() + self.__tree_mutex = threading.Lock() + self.my_dict = {} def new(self): self.widget_window = True @@ -183,12 +185,14 @@ self.event_column.pack_start(self.event_cell, True) self.event_column.add_attribute(self.event_cell, 'text', 1) - self.value_list = gtk.TreeStore(int, str) + self.value_list = gtk.ListStore(int, str) self.gadget_viewer = gtk.TreeView(self.value_list) self.gadget_viewer.append_column(self.index_column) self.gadget_viewer.append_column(self.event_column) + self.gadget_viewer.set_reorderable(True) self.gadget_viewer.set_rules_hint(True) self.gadget_viewer.get_selection().connect("changed",self.on_row_selected) + self.value_list.connect("row-changed", self.on_row_changed) self.get_widget("scrolledwindow1").add(self.gadget_viewer) self.get_widget("scrolledwindow1").show_all() @@ -560,6 +564,7 @@ # On select original sounds #-------------------------------------------------------------------------- def on_incl_orig_toggled(self, widget, *args): + self.refresh_flag = True st_wav_paths = wavs.wav_paths if widget.get_active(): wavs.wav_paths=[] @@ -577,6 +582,7 @@ wavs.wav_paths=[] wavs.wav_sizes=[] self.refresh_wav_list() + self.refresh_flag = False #-------------------------------------------------------------------------- @@ -584,9 +590,33 @@ #-------------------------------------------------------------------------- def on_row_selected(self, obj): path = obj.get_selected_rows() - self.__iter = self.value_list.get_iter(path[1][0]) + #self.__iter = self.value_list.get_iter(path[1][0]) self.__path = path[1][0] + def on_row_changed(self, model, path, treeiter): + if self.refresh_flag == True: + return + print 'changed' + rejected = False + tmp_name = model[path[0]][1] + wav_order = wavs.wav_paths + new_wav_order = [] + for i, test in enumerate(self.value_list): + if (i == path[0]) or (tmp_name != model[i][1]) or rejected == True: + print i + path = self.my_dict[model[i][1]] + new_wav_order.append(path) + else: + rejected = True + + wavs.wav_paths = [] + wavs.wav_sizes = [] + print new_wav_order + for i in range (len(new_wav_order)): + wavs.add_wav_path(new_wav_order[i]) + self.refresh_flag = True + self.refresh_wav_list() + self.refresh_flag = False #-------------------------------------------------------------------------- @@ -604,8 +634,12 @@ def on_wave_internal_add_bt_clicked(self, widget, *args): if str(self.get_widget("soundInternalChooser").get_filename())=="None": return wavs.add_wav_path(self.get_widget("soundInternalChooser").get_filename()) + + self.refresh_flag = True self.refresh_wav_list() + self.refresh_flag = False + #-------------------------------------------------------------------------- # On "remove" button clicked #-------------------------------------------------------------------------- @@ -613,8 +647,11 @@ index = self.__path[0] wavs.wav_sizes.pop(index) wavs.wav_paths.pop(index) + self.refresh_flag = True self.refresh_wav_list() + self.refresh_flag = False + #-------------------------------------------------------------------------- # On "modify" button clicked #-------------------------------------------------------------------------- @@ -632,21 +669,25 @@ #Add path to the table wavs.wav_paths[index] = path - + self.refresh_flag = True self.refresh_wav_list() + self.refresh_flag = False #-------------------------------------------------------------------------- # Refreshing wave list function #-------------------------------------------------------------------------- def refresh_wav_list(self): + print 'refresh' i = 0 - + self.my_dict = {} self.value_list.clear() for wavfile in wavs.wav_paths: filename=wavfile[wavfile.rfind('/')+1:] - self.value_list.append(None,[(i+1),str(filename)]) - i += 1 - + self.my_dict[filename] = wavs.wav_paths[i] + self.value_list.append([(i+1),str(filename)]) + i += 1 + print wavs.wav_paths + print wavs.wav_sizes #-------------------------------------------------------------------------- # On "clear" internal wave file list button clicked #-------------------------------------------------------------------------- @@ -654,8 +695,11 @@ wavs.wav_sizes=[] wavs.wav_paths=[] self.get_widget("chkSoundOriginal").set_active(False) + self.refresh_flag = True self.refresh_wav_list() + self.refresh_flag = False + #-------------------------------------------------------------------------- # On "store" button clicked #-------------------------------------------------------------------------- @@ -1321,11 +1365,11 @@ - text = gtk.TreeStore(str) + text = gtk.ListStore(str) text_viewer = gtk.TreeView(text) text_viewer.append_column(index_column) text_viewer.set_headers_visible(False) - text.append(None, [self.message]) + text.append([self.message]) scroll.add(text_viewer) Modified: software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml =================================================================== --- software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml 2007-11-13 14:31:33 UTC (rev 696) +++ software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml 2007-11-13 16:07:09 UTC (rev 697) @@ -1,5 +1,6 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> + <lblCurrentIDName type='str'>Le nom acteul est : </lblCurrentIDName> <chkSleepEnable type='str'>Permettre la mise en veille</chkSleepEnable> <lblLocal type='str'>Versions disponibles</lblLocal> <Disconnect type='str'>Déconnectez l'alimentation de tux puis fermez cette fenêtre.</Disconnect> @@ -13,7 +14,6 @@ <treeFile type='str'>Fichier</treeFile> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <lblCurrentIDNum type='str'>L'ID actuel est : </lblCurrentIDNum> - <Settingsgadget type='str'>Gadget de configuration</Settingsgadget> <help_text type='str'> </help_text> <soundErase type='str'>Effacement de la mémoire ...</soundErase> @@ -43,8 +43,6 @@ <Sound type='str'>Avez vous correctement entendu le son ?</Sound> <itemChangeLog type='str'>Voir les changements</itemChangeLog> <lblSoundLocalSelect type='str'>Selectionner un son :</lblSoundLocalSelect> - <In type='str'>Voulez-vous tester l'entrée son de Tux? -Vous devez connecter un périphérique d'entrée dans le connecteur bleu.</In> <lblSoundExternal type='str'>Lire un wave externe</lblSoundExternal> <IR type='str'>Après avoir fermer cette fenêtre, trois touches de la télécommande. Vous vez 15 secondes pour realiser cette opération.</IR> @@ -55,12 +53,12 @@ <lblSleepStateWork type='str'>Tux n'est pas en veille pour le moment</lblSleepStateWork> <Switch type='str'>Après avoir fermer cette fenêtre, pressez successivement sur les ailes puis sur la tête. Vous vez 15 secondes pour realiser cette opération.</Switch> - <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> + <lblSoundStore type='str'>Enregistrer des fichiers wave</lblSoundStore> <lblConfigTest type='str'>Auto tests</lblConfigTest> <treeVersionVer type='str'>Version</treeVersionVer> <lblConfigWifi type='str'>Configuration wifi</lblConfigWifi> <treeVersionProg type='str'>Composant</treeVersionProg> - <lblSoundStore type='str'>Enregistrer des fichiers wave</lblSoundStore> + <Settingsgadget type='str'>Gadget de configuration</Settingsgadget> <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> <speaker_name type='str'>Bruno8k</speaker_name> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> @@ -77,11 +75,13 @@ <Iwlist type='str'>iwlist n'a pas été trouvée. Assurez-vous que le paquet 'wireless tools' est correctement installé sur votre ordinateur. (http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html#latest)</Iwlist> - <Warning type='str'>Attention</Warning> + <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <Connect type='str'>Connectez l'alimentation de tux puis fermez cette fenêtre.</Connect> - <lblCurrentIDName type='str'>Le nom acteul est : </lblCurrentIDName> + <In type='str'>Voulez-vous tester l'entrée son de Tux? +Vous devez connecter un périphérique d'entrée dans le connecteur bleu.</In> <lblConfigID type='str'>Configuration de l'ID</lblConfigID> + <Warning type='str'>Attention</Warning> <lblTabVersion type='str'>Versions</lblTabVersion> <btnSoundPlayNum type='str'>Lire</btnSoundPlayNum> <Out type='str'>Voulez-vous tester la sortie son de Tux? Modified: software/gadgets/settings/trunk/settings/about.xml =================================================================== (Binary files differ) Modified: software/gadgets/settings/trunk/settings/settings.xml =================================================================== --- software/gadgets/settings/trunk/settings/settings.xml 2007-11-13 14:31:33 UTC (rev 696) +++ software/gadgets/settings/trunk/settings/settings.xml 2007-11-13 16:07:09 UTC (rev 697) @@ -10,7 +10,9 @@ <have_settings_part type='bool'>True</have_settings_part> <gui_state> <widget> - <visible type='bool'>False</visible> + <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/settings/trunk/settings/strings.xml =================================================================== --- software/gadgets/settings/trunk/settings/strings.xml 2007-11-13 14:31:33 UTC (rev 696) +++ software/gadgets/settings/trunk/settings/strings.xml 2007-11-13 16:07:09 UTC (rev 697) @@ -1,5 +1,6 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> + <lblCurrentIDName type='str'>The current name is : </lblCurrentIDName> <chkSleepEnable type='str'>Enable sleep mode</chkSleepEnable> <lblLocal type='str'>Available versions</lblLocal> <Disconnect type='str'>Please disconnect the power plug andpress the 'OK' button.</Disconnect> @@ -12,7 +13,6 @@ <treeFile type='str'>Fichier</treeFile> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <lblCurrentIDNum type='str'>The current ID is : </lblCurrentIDNum> - <Settingsgadget type='str'>Settings gadget</Settingsgadget> <Connect type='str'>Please connect the power plug, and press the 'OK' button</Connect> <help_text type='str'> </help_text> @@ -37,7 +37,9 @@ <btnSoundClear type='str'>Clear list</btnSoundClear> <Sound1 type='str'>Be sure that the sound volume control is at the maximum.</Sound1> <lblSleepStateSleep type='str'>Tux is currently sleeping</lblSleepStateSleep> + <soundProg type='str'>Sound programming ...</soundProg> <lblSoundMic type='str'>Microphone</lblSoundMic> + <lblSoundStore type='str'>Store wave files locally</lblSoundStore> <lblIDNum type='str'>Tux's ID : </lblIDNum> <Sound type='str'>Have you heard the sound ?</Sound> <itemChangeLog type='str'>Show ChangeLog</itemChangeLog> @@ -57,7 +59,7 @@ <treeVersionVer type='str'>Version</treeVersionVer> <lblConfigWifi type='str'>Wifi configuration</lblConfigWifi> <treeVersionProg type='str'>Component</treeVersionProg> - <lblSoundStore type='str'>Store wave files locally</lblSoundStore> + <Settingsgadget type='str'>Settings gadget</Settingsgadget> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> <speaker_name type='str'>Ryan8k</speaker_name> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> @@ -65,8 +67,7 @@ <name_to_read type='str'>Tux settings</name_to_read> <btnID type='str'>Change ID</btnID> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> - <soundProg type='str'>Sound programming ...</soundProg> - <lblSleepDelay type='str'>Active the sleep mode after a inactivity period of</lblSleepDelay> + <lblUsedChannel type='str'>Your wifi use the channel :</lblUsedChannel> <lblTabSound type='str'>Audio</lblTabSound> <btnSoundStore type='str'>Store</btnSoundStore> <lblVersions type='str'>Installed versions</lblVersions> @@ -78,12 +79,11 @@ <Warning type='str'>Warning</Warning> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <lblIDName type='str'>Tux's name : </lblIDName> - <lblCurrentIDName type='str'>The current name is : </lblCurrentIDName> + <In type='str'>Would you like to test the sound input interface? +To do this, you need to connect an input device in the blue connector and then click 'Yes'.</In> <lblConfigID type='str'>ID configuration</lblConfigID> + <lblTabVersion type='str'>Versions</lblTabVersion> + <lblSleepDelay type='str'>Active the sleep mode after a inactivity period of</lblSleepDelay> <Out type='str'>Would you like to test the sound output interface? To do this, you need to connect loudspeakers in the green connector, and press the 'Yes' button.</Out> - <lblTabVersion type='str'>Versions</lblTabVersion> - <lblUsedChannel type='str'>Your wifi use the channel :</lblUsedChannel> - <In type='str'>Would you like to test the sound input interface? -To do this, you need to connect an input device in the blue connector and then click 'Yes'.</In> </strings> Modified: software/gadgets/settings/trunk/settings.tgf =================================================================== (Binary files differ) |
From: jaguarondi <c2m...@c2...> - 2007-11-13 14:31:38
|
Author: jaguarondi Date: 2007-11-13 15:31:33 +0100 (Tue, 13 Nov 2007) New Revision: 696 Modified: daemon/trunk/libs/USBDaemon_status_table.c daemon/trunk/libs/USBDaemon_status_table.h firmware/tuxdefs/defines.h Log: * Added a version string. * Using assert for checking valid preconditions in versioning. Modified: daemon/trunk/libs/USBDaemon_status_table.c =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.c 2007-11-13 13:43:41 UTC (rev 695) +++ daemon/trunk/libs/USBDaemon_status_table.c 2007-11-13 14:31:33 UTC (rev 696) @@ -22,6 +22,7 @@ /*_____________________ I N C L U D E S____________________________________ */ #include <stdio.h> +#include <assert.h> #include "USBDaemon_status_table.h" #include "USBDaemon_usb.h" #include "USBDaemon_globals.h" @@ -47,6 +48,17 @@ unsigned char sound_flash_count = 0; /** + * CPU names mapped from their identifiers. + * Should be in sync with CPU_IDENTIFIERS so that cpu_name[some_cpu_id] + * should return its CPU name. + * XXX is there a better way to achieve this functionality? I didn't want to + * have that array declared in defines.h otherwise it would end up in all + * firmware too. + */ +char const *const cpu_name[] = {"tuxcore", "tuxaudio", "tuxrf", "fuxrf", + "fuxusb"}; + +/** * Tux status table. * * This hierarchical structure holds all current status of tux and the dongle. @@ -59,7 +71,7 @@ */ struct connection_status_t connection_status; -/** +/** * Update tux_status with the given firmware version data. */ void update_firmware_version(const unsigned char *data) @@ -72,14 +84,7 @@ * like revision and author. So we should save that number. */ current_cpu = CPU_VER_CPU(data[1]); /* Check if the value received is a valid CPU number. */ - if ((current_cpu < 0) || (current_cpu > 4)) - { - log_error("received an INVALID CPU number: %d", current_cpu); - /* Mark current_cpu as invalid to discard any new information data - * until a valid CPU number is received. */ - current_cpu = INVALID_CPU_NUM; - return; - } + assert(current_cpu >= LOWEST_CPU_NUM && current_cpu <= HIGHEST_CPU_NUM); /* Select the corresponding CPU entry in the status table. */ firmware = &tux_status.firmware[current_cpu]; /* Save major, minor and update numbers. */ @@ -87,7 +92,7 @@ firmware->version_minor = data[2]; firmware->version_update = data[3]; - log_debug("version of %i: %i.%i.%i", CPU_VER_CPU(current_cpu), + log_debug("version of %s: %d.%d.%d", cpu_name[current_cpu], CPU_VER_MAJ(firmware->version_major), firmware->version_minor, firmware->version_update); } @@ -97,19 +102,38 @@ */ static void update_firmware_revision(const unsigned char *data) { + /* Release types defined as strings. See parameters of REVISION_CMD. */ + char revision_string[40]; struct firmware_version_t *firmware; - /* Check that a valid CPU number has been received. */ + + /* Preconditions */ + assert((current_cpu == INVALID_CPU_NUM) || + (current_cpu >= LOWEST_CPU_NUM && current_cpu <= HIGHEST_CPU_NUM)); + /* Check that a valid CPU number has been received. INVALID_CPU_NUM can be + * be received if the version frame is lost and we directly get the + * revision frame. */ if (current_cpu == INVALID_CPU_NUM) return; /* Select the corresponding CPU entry in the status table. */ firmware = &tux_status.firmware[current_cpu]; /* Save revision number. */ firmware->revision = (data[2] << 8) + data[1]; - - log_debug("revision of %i: %i", current_cpu, firmware->revision); + /* We already got the version when receiving the revision so we can now + * store the version string. */ + sprintf(revision_string, " - r%d (SVN/UNRELEASED)", firmware->revision); + sprintf(firmware->version_string, "%s %d.%d.%d%s%s%s", cpu_name[current_cpu], + CPU_VER_MAJ(firmware->version_major), firmware->version_minor, + firmware->version_update, + data[3] & 1<<2 ? "" : revision_string, + data[3] & 1<<0 ? "(modified locally)" : "", + data[3] & 1<<1 ? "(mixed revisions)" : ""); + printf(firmware->version_string); + printf("\n"); + log_debug("revision of %s: %d - type %d", cpu_name[current_cpu], + firmware->revision, data[3]); } -/** +/** * Update tux_status with the given firmware author data. */ static void update_firmware_author(const unsigned char *data) @@ -123,17 +147,17 @@ /* Save author. */ firmware->author = (data[2] << 8) + data[1]; - log_debug("author of %i: %i", current_cpu, firmware->author); + log_debug("author of %s: %d", cpu_name[current_cpu], firmware->author); } -/** +/** * Update tux_status with the given properties of the sound flash. */ static void update_sound_flash_properties(const unsigned char *data) { tux_status.sound_flash.number_of_sounds = data[1]; - log_debug("%i sounds in flash", tux_status.sound_flash.number_of_sounds); + log_debug("%d sounds in flash", tux_status.sound_flash.number_of_sounds); } static void update_ir(const unsigned char *new_status) @@ -308,7 +332,7 @@ tcp_frame[4] = DATA_STATUS_AUDIO; - + tcp_frame[5] = play; tcp_frame[6] = record; tcp_frame[7] = status; @@ -617,7 +641,7 @@ /* The answer from the usb_tux_connection command has been received */ connection_status.usb_request_f = false; connection_status.tux_id = (new_status[1] << 8) + new_status[2]; - log_debug("id returned by tux: %i (0x%.2x%.2x)", + log_debug("id returned by tux: %d (0x%.2x%.2x)", connection_status.tux_id, new_status[1], new_status[2]); break; case STATUS_PORTS_CMD: @@ -659,7 +683,7 @@ break; case STATUS_AUDIO_CMD: - { + { int play; int record; int status; Modified: daemon/trunk/libs/USBDaemon_status_table.h =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.h 2007-11-13 13:43:41 UTC (rev 695) +++ daemon/trunk/libs/USBDaemon_status_table.h 2007-11-13 14:31:33 UTC (rev 696) @@ -283,7 +283,11 @@ int version_minor; int version_update; int revision; + int release; + int local_modification; + int mixed_revisions; int author; + char version_string[100]; } firmware[5]; /** Sound flash properties. */ struct sound_flash_t Modified: firmware/tuxdefs/defines.h =================================================================== --- firmware/tuxdefs/defines.h 2007-11-13 13:43:41 UTC (rev 695) +++ firmware/tuxdefs/defines.h 2007-11-13 14:31:33 UTC (rev 696) @@ -56,6 +56,12 @@ /** We use '-1' to indicate an invalid CPU number. */ INVALID_CPU_NUM = -1, }; +/** Lowest valid value for a CPU identifier. + * Should be set according to CPU_IDENTIFIERS. */ +#define LOWEST_CPU_NUM 0 +/** Highest valid value for a CPU identifier. + * Should be set according to CPU_IDENTIFIERS. */ +#define HIGHEST_CPU_NUM 4 /** * I2C addresses of all CPUs. |
From: Paul_R <c2m...@c2...> - 2007-11-13 13:43:44
|
Author: Paul_R Date: 2007-11-13 14:43:41 +0100 (Tue, 13 Nov 2007) New Revision: 695 Modified: software/gadgets/settings/trunk/settings.tgf software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.glade software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp software/gadgets/settings/trunk/settings/Scripts/Python/init.pyp software/gadgets/settings/trunk/settings/Scripts/Python/main.pyp software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml software/gadgets/settings/trunk/settings/settings.xml software/gadgets/settings/trunk/settings/strings.xml Log: * Added the initialize and destroy function * Changes the way to store the sounds Modified: software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.glade 2007-11-13 12:42:10 UTC (rev 694) +++ software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.glade 2007-11-13 13:43:41 UTC (rev 695) @@ -1169,27 +1169,6 @@ </child> <child> - <widget class="GtkScrolledWindow" id="scrolledwindow1"> - <property name="width_request">376</property> - <property name="height_request">152</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> - <property name="shadow_type">GTK_SHADOW_NONE</property> - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> - - <child> - <placeholder/> - </child> - </widget> - <packing> - <property name="x">0</property> - <property name="y">0</property> - </packing> - </child> - - <child> <widget class="GtkFileChooserButton" id="soundInternalChooser"> <property name="width_request">200</property> <property name="height_request">27</property> @@ -1324,7 +1303,7 @@ <property name="width_request">360</property> <property name="height_request">16</property> <property name="visible">True</property> - <property name="label" translatable="yes">label5</property> + <property name="label" translatable="yes">label3</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -1344,6 +1323,27 @@ <property name="y">184</property> </packing> </child> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="width_request">376</property> + <property name="height_request">152</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> + <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> </widget> </child> </widget> Modified: software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp 2007-11-13 12:42:10 UTC (rev 694) +++ software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp 2007-11-13 13:43:41 UTC (rev 695) @@ -6,6 +6,7 @@ import subprocess import commands import time +import threading class Window(SimpleGladeApp): def __init__(self, @@ -15,6 +16,7 @@ SimpleGladeApp.__init__(self, path, root, domain, **kwargs) self.prev = False self.flag = True + self.__sound_mutex = threading.Lock() def new(self): self.widget_window = True @@ -37,6 +39,7 @@ self.get_widget('lblTabSound').set_text(_me.string('lblTabSound')) self.get_widget('lblTabVersion').set_text(_me.string('lblTabVersion')) + self.searchWifiChannel() self.ConfigLabelUpdate() self.avoidchannel() @@ -72,8 +75,8 @@ txt = _me.string('lblSleepStateWork') self.get_widget('lblSleepState').set_text(txt) self.get_widget('btnSleep').set_label(_me.string('btnSleepSleep')) - self.get_widget('progressbar2').hide() + # ID labels self.get_widget('lblCurrentIDNum').hide() #thread.start_new_thread(self.id_request,()) @@ -86,6 +89,7 @@ #Tests labels + self.get_widget('progressbar2').hide() self.get_widget('btnSelfTest').set_label(_me.string('btnSelfTest')) #------------------------------------------------------------ @@ -206,7 +210,7 @@ self.avoidchannel() #------------------------------------------------------------ -# AVoid a specific channel number +# Avoid a specific channel number #------------------------------------------------------------ def avoidchannel(self): self.get_widget('cbbWifiChannel').set_active(self.avoidedchannel) @@ -512,12 +516,13 @@ #------------------------------------------------------------ def flashCPU(self, widget): path = '/opt/tuxdroid/firmware/%s'%self.selectedfile + print path try: gadgets['firmware_updater'].set_param('setting', True) gadgets['firmware_updater'].set_param('local_path', path) gadgets['firmware_updater'].main() except: - dialog = GdgDialog('Error', 'Please install the settings gadget in the manager \nBe sure that the firmware updater gadget is correctly installed.') + dialog = GdgDialog('Error', 'Please install the settings gadget in the Tux Droid Manager.\nBe sure that the firmware updater gadget is correctly installed.') def on_local_version_selected(self, obj): path = obj.get_selected_rows() @@ -656,48 +661,62 @@ #-------------------------------------------------------------------------- def on_wave_internal_store_bt_clicked(self, widget, *args): thread.start_new_thread(self.sound_storing,()) + #self.sound_storing() #-------------------------------------------------------------------------- # Store sound function #-------------------------------------------------------------------------- def sound_storing(self): + if self.__sound_mutex.locked(): + return + + self.__sound_mutex.acquire() if tux.status.rf_state() == 0: + self.__sound_mutex.release() print 'no RF connexion' return if len(wavs.wav_sizes)==0: + self.__sound_mutex.release() print 'no wavs to store' return if not wavs.wavs_merging("merged.wav"): + self.__sound_mutex.release() print "Sound storing : Error : file merged is too big" return self.get_widget('progressbar1').show() + self.get_widget('progressbar1').set_fraction(0) self.get_widget('lblSoundState').show() - self.get_widget('progressbar1').set_fraction(0) - - self.get_widget('lblSoundState').set_text(_me.string('SoundErase')) + self.get_widget('lblSoundState').set_text(_me.string('soundErase')) self.get_widget('progressbar1').set_fraction(0.25) + tux.cmd.sound_storing(len(wavs.wav_sizes)) - #tux.sys.wait(10) - while tux.status.flash_status()[1] <= 3: - tux.sys.wait(0.1) + + while tux.status.flash_status()[1] != 4: + tux.sys.wait(0.05) current_pos=0x0400 - tux.sys.wait(0.1) - self.get_widget('lblSoundState').set_text(_me.string('SoundTOC')) + + self.get_widget('lblSoundState').set_text(_me.string('soundTOC')) self.get_widget('progressbar1').set_fraction(0.5) + tux.cmd.sound_store_index(0x00,0x04,0x00) for size in wavs.wav_sizes: + print current_pos current_pos=current_pos+size tux.sys.wait(0.1) tux.cmd.sound_store_index((current_pos & 0xFF0000)>>16, (current_pos & 0x00FF00)>>8,current_pos & 0x0000FF) - self.get_widget('lblSoundState').set_text(_me.string('SoundProg')) + + self.get_widget('lblSoundState').set_text(_me.string('soundProg')) self.get_widget('progressbar1').set_fraction(0.75) + tux.sys.shell("aplay -D %s merged.wav"%soundcard) self.get_widget('progressbar1').hide() self.get_widget('lblSoundState').hide() + tux.sys.wait(0.3) + self.__sound_mutex.release() @@ -776,14 +795,22 @@ # On "Play recorded wave file" button clicked #-------------------------------------------------------------------------- def on_mic_play_bt_clicked(self, widget, *args): - tux.sys.shell_free("aplay -D %s rec.wav"%soundcard) + try: + tux.wav.play('/tmp/record.wav') + #tux.sys.shell_free("aplay -D %s rec.wav"%soundcard) + except: + pass #-------------------------------------------------------------------------- # On "Record wave file" button clicked #-------------------------------------------------------------------------- def on_mic_record_bt_clicked(self, widget, *args): + tux.micro.on() tux.cmd.mouth_open() - tux.sys.shell("arecord -D %s -d 10 -t wav rec.wav"%soundcard) + #tux.sys.wait(0.1) + tux.micro.capture_start('/tmp/record.wav', 10) + tux.micro.off() + #tux.sys.shell("arecord -D %s -d 10 -t wav rec.wav"%soundcard) tux.cmd.mouth_close() Modified: software/gadgets/settings/trunk/settings/Scripts/Python/init.pyp =================================================================== --- software/gadgets/settings/trunk/settings/Scripts/Python/init.pyp 2007-11-13 12:42:10 UTC (rev 694) +++ software/gadgets/settings/trunk/settings/Scripts/Python/init.pyp 2007-11-13 13:43:41 UTC (rev 695) @@ -10,18 +10,25 @@ # Initialization and finalization shared functions # ---------------------------------------------------------------------------- def initialization(): + """ Function to initialize the gadget. This function is executed when all gadgets has been loaded. """ - pass + + def run(*args): + _me.gui('widget').show() + + + _me.insert_menu(_me.string('Settingsgadget'), run, 'image', False, gtk.STOCK_PROPERTIES) + def finalization(): """ Function to finalize the gadget. This function is executed when the gadget is destroyed. """ - pass + _me.remove_menu() # ---------------------------------------------------------------------------- # Registeration of the shared functions Modified: software/gadgets/settings/trunk/settings/Scripts/Python/main.pyp =================================================================== --- software/gadgets/settings/trunk/settings/Scripts/Python/main.pyp 2007-11-13 12:42:10 UTC (rev 694) +++ software/gadgets/settings/trunk/settings/Scripts/Python/main.pyp 2007-11-13 13:43:41 UTC (rev 695) @@ -1,2 +1 @@ -# 'Voiceget' part of the gadget. This code is executed when the -# gadget is run in the gadgets manager. + Modified: software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml =================================================================== --- software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml 2007-11-13 12:42:10 UTC (rev 694) +++ software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml 2007-11-13 13:43:41 UTC (rev 695) @@ -13,6 +13,7 @@ <treeFile type='str'>Fichier</treeFile> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> <lblCurrentIDNum type='str'>L'ID actuel est : </lblCurrentIDNum> + <Settingsgadget type='str'>Gadget de configuration</Settingsgadget> <help_text type='str'> </help_text> <soundErase type='str'>Effacement de la mémoire ...</soundErase> Modified: software/gadgets/settings/trunk/settings/settings.xml =================================================================== --- software/gadgets/settings/trunk/settings/settings.xml 2007-11-13 12:42:10 UTC (rev 694) +++ software/gadgets/settings/trunk/settings/settings.xml 2007-11-13 13:43:41 UTC (rev 695) @@ -2,7 +2,7 @@ <settings> <parameters> <AvoidChannel type='int'>0</AvoidChannel> - <hidden_in_manager type='bool'>False</hidden_in_manager> + <hidden_in_manager type='bool'>True</hidden_in_manager> <SleepDelay type='str'>10</SleepDelay> <EnableSleep type='bool'>True</EnableSleep> </parameters> Modified: software/gadgets/settings/trunk/settings/strings.xml =================================================================== --- software/gadgets/settings/trunk/settings/strings.xml 2007-11-13 12:42:10 UTC (rev 694) +++ software/gadgets/settings/trunk/settings/strings.xml 2007-11-13 13:43:41 UTC (rev 695) @@ -12,6 +12,7 @@ <treeFile type='str'>Fichier</treeFile> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> <lblCurrentIDNum type='str'>The current ID is : </lblCurrentIDNum> + <Settingsgadget type='str'>Settings gadget</Settingsgadget> <Connect type='str'>Please connect the power plug, and press the 'OK' button</Connect> <help_text type='str'> </help_text> Modified: software/gadgets/settings/trunk/settings.tgf =================================================================== (Binary files differ) |
From: jaguarondi <c2m...@c2...> - 2007-11-13 12:42:11
|
Author: jaguarondi Date: 2007-11-13 13:42:10 +0100 (Tue, 13 Nov 2007) New Revision: 694 Modified: firmware/tuxup/trunk/main.c Log: * Consistency on the file path length stored in strings. Modified: firmware/tuxup/trunk/main.c =================================================================== --- firmware/tuxup/trunk/main.c 2007-11-13 10:50:14 UTC (rev 693) +++ firmware/tuxup/trunk/main.c 2007-11-13 12:42:10 UTC (rev 694) @@ -32,6 +32,7 @@ #include "common/defines.h" #define countof(X) ( (size_t) ( sizeof(X)/sizeof*(X) ) ) +#define PATH_LENGTH 255 /* Messages. */ static char const *msg_old_firmware = @@ -309,7 +310,7 @@ { /* XXX include those as defines in commands.h */ uint8_t send_data[5] = { 0x01, 0x01, 0x00, 0x00, 0xFF }; - char tmp_string[90]; + char tmp_string[PATH_LENGTH]; int ret; printf("Programming %s in the USB CPU\n", filename); @@ -399,7 +400,7 @@ { int ret = -1; size_t len; - char *extension, filenamepath[255]; + char *extension, filenamepath[PATH_LENGTH]; if (path) { @@ -469,7 +470,7 @@ */ int main(int argc, char *argv[]) { - char path[90]; + char path[PATH_LENGTH]; enum program_modes_t program_mode = NONE; time_t start_time, end_time; int ret = 0; |
From: Paul_R <c2m...@c2...> - 2007-11-13 10:50:16
|
Author: Paul_R Date: 2007-11-13 11:50:14 +0100 (Tue, 13 Nov 2007) New Revision: 693 Modified: firmware/tuxaudio/trunk/flash.c Log: * Corrected a bug in the flash play init sequence. Modified: firmware/tuxaudio/trunk/flash.c =================================================================== --- firmware/tuxaudio/trunk/flash.c 2007-11-13 08:56:49 UTC (rev 692) +++ firmware/tuxaudio/trunk/flash.c 2007-11-13 10:50:14 UTC (rev 693) @@ -193,7 +193,7 @@ } flash_select(); // Chip Select - + flash_enable(); spiSend(READ_ARRAY_LOW_F); // Send Read Page Command spiSend(0x00); // Send Address spiSend(adp1); |
From: Paul_R <c2m...@c2...> - 2007-11-13 08:57:03
|
Author: Paul_R Date: 2007-11-13 09:56:49 +0100 (Tue, 13 Nov 2007) New Revision: 692 Modified: software/gadgets/settings/trunk/settings.tgf software/gadgets/settings/trunk/settings/Pictures/Icons/gadget.png software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.glade software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml software/gadgets/settings/trunk/settings/about.xml software/gadgets/settings/trunk/settings/settings.xml software/gadgets/settings/trunk/settings/strings.xml Log: * Added the ID configuration frame (hidden for now) * Added a new class to display the Cchangelog and the firmwares descriptions. Modified: software/gadgets/settings/trunk/settings/Pictures/Icons/gadget.png =================================================================== (Binary files differ) Modified: software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.glade 2007-11-13 08:40:35 UTC (rev 691) +++ software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.glade 2007-11-13 08:56:49 UTC (rev 692) @@ -423,6 +423,168 @@ <child> <widget class="GtkFixed" id="fixed15"> <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="lblIDNum"> + <property name="width_request">144</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label3</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="GtkLabel" id="lblIDName"> + <property name="width_request">144</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label4</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">37</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="txtIDNum"> + <property name="width_request">72</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">168</property> + <property name="y">4</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="txtIDName"> + <property name="width_request">72</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">168</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnID"> + <property name="width_request">160</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_btnID_clicked" last_modification_time="Mon, 12 Nov 2007 11:35:46 GMT"/> + </widget> + <packing> + <property name="x">8</property> + <property name="y">64</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lblCurrentIDNum"> + <property name="width_request">224</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label3</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">264</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lblCurrentIDName"> + <property name="width_request">224</property> + <property name="height_request">17</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label4</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">264</property> + <property name="y">36</property> + </packing> + </child> </widget> </child> </widget> @@ -1156,6 +1318,32 @@ <property name="y">32</property> </packing> </child> + + <child> + <widget class="GtkLabel" id="lblSoundState"> + <property name="width_request">360</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label5</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">184</property> + </packing> + </child> </widget> </child> </widget> Modified: software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp 2007-11-13 08:40:35 UTC (rev 691) +++ software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp 2007-11-13 08:56:49 UTC (rev 692) @@ -17,8 +17,18 @@ self.flag = True def new(self): + self.widget_window = True + _me.set_param('widget_window', True) self.get_widget("window1").set_title(_me.string('name_to_read')) thread.start_new_thread(self.update, ()) + + def on_window1_destroy(self, widget, *args): + self.widget_window = False + _me.set_param('widget_window', False) + +#------------------------------------------------------------ +# This function update all labels and create the GUI +#------------------------------------------------------------ def update(self): self.avoidedchannel = _me.get_param('AvoidChannel') @@ -34,7 +44,9 @@ self.VersionsLabelUpdate() self.SoundLabelUpdate() - +#------------------------------------------------------------ +# Config Tab labels +#------------------------------------------------------------ def ConfigLabelUpdate(self): #Frame labels self.get_widget('lblConfigWifi').set_text(_me.string('lblConfigWifi')) @@ -55,16 +67,30 @@ self.get_widget('lblSleepDelay').set_text(_me.string('lblSleepDelay')) self.get_widget('spinSleepDelay').set_text(str(_me.get_param('SleepDelay'))) + #Check if tux is sleeping ... txt = _me.string('lblSleepStateWork') self.get_widget('lblSleepState').set_text(txt) self.get_widget('btnSleep').set_label(_me.string('btnSleepSleep')) self.get_widget('progressbar2').hide() + # ID labels + self.get_widget('lblCurrentIDNum').hide() + #thread.start_new_thread(self.id_request,()) + #request the name + + self.get_widget('frame16').hide() + self.get_widget('lblIDNum').set_text(_me.string('lblIDNum')) + self.get_widget('lblIDName').set_text(_me.string('lblIDName')) + self.get_widget('btnID').set_label(_me.string('btnID')) + #Tests labels self.get_widget('btnSelfTest').set_label(_me.string('btnSelfTest')) - + +#------------------------------------------------------------ +# Version tab labels +#------------------------------------------------------------ def VersionsLabelUpdate(self): # Hide the check for update button while the function is not implemented # in the firmware updater gadget @@ -112,6 +138,10 @@ self.get_widget("scrolledwindow3").show_all() self.searchFiles() + +#------------------------------------------------------------ +# Sound tab labels +#------------------------------------------------------------ def SoundLabelUpdate(self): self.get_widget('btnSoundAdd').set_label(_me.string('btnSoundAdd')) self.get_widget('btnSoundClear').set_label(_me.string('btnSoundClear')) @@ -131,6 +161,7 @@ self.get_widget('lblSoundLocalSelect').set_text(_me.string('lblSoundLocalSelect')) self.get_widget('lblSoundMic').set_text(_me.string('lblSoundMic')) self.get_widget('lblSoundStore').set_text(_me.string('lblSoundStore')) + self.get_widget('lblSoundState').hide() self.SoundTreeviewUpdate() self.get_widget('progressbar1').hide() @@ -157,11 +188,14 @@ self.get_widget("scrolledwindow1").add(self.gadget_viewer) self.get_widget("scrolledwindow1").show_all() -#--------------------------------------------------------------------------- -# -# CONFIG TAB -# -#--------------------------------------------------------------------------- + +#================================================================== +# CONFIG TAB FUNCTIONS +#================================================================== + +#------------------------------------------------------------ +# on combo box choose wifi channel +#------------------------------------------------------------ def on_cbbWifiChannel_changed(self, widget, *args): #Reject the first signal if self.flag == True: @@ -171,7 +205,9 @@ _me.set_param('AvoidChannel', self.avoidedchannel) self.avoidchannel() - +#------------------------------------------------------------ +# AVoid a specific channel number +#------------------------------------------------------------ def avoidchannel(self): self.get_widget('cbbWifiChannel').set_active(self.avoidedchannel) if self.channel == -1: @@ -182,8 +218,17 @@ else: tux.connect.avoid_wifi(self.avoidedchannel) +#------------------------------------------------------------ +# This function search the current wifi channel +# If iwlist command isn't found, an error message occur. +#------------------------------------------------------------ def searchWifiChannel(self): - a = commands.getoutput('iwlist channel') + try: + a = commands.getoutput('iwlist channel') + except: + thread.start_new_thread(self.popup, (_me.string('Warning'), _me.string('Iwlist'), False)) + return + if a.rfind('Current Channel') != -1: self.get_widget('lblUsedChannel').set_text(_me.string('lblNoChannel')) self.get_widget('lblChannel').set_text('') @@ -197,16 +242,25 @@ self.get_widget('lblUsedChannel').set_text(_me.string('lblUsedChannel')) self.get_widget('lblChannel').set_text(str(self.channel)) +#------------------------------------------------------------ +# on sleep enable checkbox +#------------------------------------------------------------ def on_chkSleepEnable_toggled(self, widget, *args): _me.set_param('EnableSleep', widget.get_active()) self.enablesleep = widget.get_active() ## Send the active sleep command +#------------------------------------------------------------ +# on sleep delay spin button +#------------------------------------------------------------ def on_spinSleepDelay_changed(self, widget, *args): self.sleepdelay = self.get_widget('spinSleepDelay').get_text() _me.set_param('SleepDelay', self.sleepdelay) ## Send the delay +#------------------------------------------------------------ +# on sleep button clicked +#------------------------------------------------------------ def on_btnSleep_clicked(self, widget, *args): #if sleeping -> change label and send the wakeup command @@ -214,22 +268,56 @@ self.get_widget('btnSleep').set_label(_me.string('btnSleepWakeup')) self.get_widget('lblSleepState').set_text(_me.string('lblSleepStateSleep')) +#------------------------------------------------------------ +# on self test button clicked +#------------------------------------------------------------ def on_btnSelfTest_clicked(self, widget, *args): thread.start_new_thread(self.testmode,()) + ''' +#------------------------------------------------------------ +# On ID button clicked +#------------------------------------------------------------ + def on_btnID_clicked(self, widget, *args): + error = '' + try: + ID = int(self.get_widget('txtIDNum').get_text()) + print ID + if ID == 0 or ID >= 65535: + thread.start_new_thread(self.popup, (_me.string('Warning'), _me.string('IDErrorOverflow'), False)) + else: + thread.start_new_thread(tux.connect.change_id, (ID,)) + except: + thread.start_new_thread(self.popup, (_me.string('Warning'), _me.string('IDErrorOverflow'), False)) + + Name = self.get_widget('txtIDName').get_text() + # Send the name + + thread.start_new_thread(self.id_request, ()) +#------------------------------------------------------------ +# Request the ID +#------------------------------------------------------------ + def id_request(self): + ID = tux.connect.id_request() + if ID == False: + self.get_widget('lblCurrentIDNum').set_text(_me.string('lblCurrentIDNumError')) + self.get_widget('txtIDNum').set_text('1') + else: + self.get_widget('lblCurrentIDNum').set_text(_me.string('lblCurrentIDNum')+str(ID)) + self.get_widget('txtIDNum').set_text(str(ID)) + self.get_widget('lblCurrentIDNum').show() + ''' + +#================================================================== +# VERSION TAB FUNCTIONS +#================================================================== -#--------------------------------------------------------------------------- -# -# VERSION TAB -# -#--------------------------------------------------------------------------- - - #-------------------------------------------------------------------------- - # Search for local files - #-------------------------------------------------------------------------- +#------------------------------------------------------------ +# Search local tar.gz file on /opt/tuxdroid/firmware +#------------------------------------------------------------ def searchFiles(self): filelist = os.listdir('/opt/tuxdroid/firmware') tmppath = [] @@ -242,15 +330,19 @@ if flag != -1: self.refresh_files() +#------------------------------------------------------------ +# refresh the tree view +#------------------------------------------------------------ def refresh_files(self): self.file_tree_store.clear() versions = [] for i in range(len(self.filepath)): + ver = [] proc = subprocess.Popen("tar -C '/tmp' -xvf '/opt/tuxdroid/firmware/%s'"%self.filepath[i][0], shell = True, stdout = subprocess.PIPE) proc.wait() - version, tux_core, tux_audio, tux_rf, fux_rf, fux_usb, change = self.get_new_version_infos() - self.filepath[i][1] = str(version) - versions.append([tux_core, tux_audio, tux_rf, fux_rf, fux_usb]) + ver = self.get_new_version_infos() + self.filepath[i][1] = str(ver[0]) + versions.append(ver) os.system('rm -rf /tmp/tuxdroid-firmware*') for i in range(len(self.filepath)): @@ -262,6 +354,9 @@ self.file_tree_store.append(tmp, ('Fux RF',versions[i][3])) self.file_tree_store.append(tmp, ('Fux USB',versions[i][4])) +#------------------------------------------------------------ +# XML parser +#------------------------------------------------------------ def get_new_version_infos(self): filelist = os.listdir('/tmp') tmppath = '' @@ -281,14 +376,25 @@ tux_rf = str(tux_rf).replace('\n','').replace('\t', '') fux_usb = version[0].getElementsByTagName('fux_usb')[0].childNodes[0].nodeValue fux_usb = str(fux_usb).replace('\n','').replace('\t', '') - change = racine[0].getElementsByTagName('release_notes')[0].childNodes[0].nodeValue ver = version[0].attributes['tuxdroid_firmware_version'].nodeValue - return ver, tux_core, tux_audio, tux_rf, fux_rf, fux_usb, change + + description = racine[0].getElementsByTagName('description') + + desc = racine[0].getElementsByTagName('description')[0].childNodes[0].nodeValue + change = racine[0].getElementsByTagName('changes') + ch_tuxcore = change[0].getElementsByTagName('tux_core')[0].childNodes[0].nodeValue + ch_tuxaudio = change[0].getElementsByTagName('tux_audio')[0].childNodes[0].nodeValue + ch_fuxrf = change[0].getElementsByTagName('fux_rf')[0].childNodes[0].nodeValue + ch_tuxrf = change[0].getElementsByTagName('tux_rf')[0].childNodes[0].nodeValue + ch_fuxusb = change[0].getElementsByTagName('fux_usb')[0].childNodes[0].nodeValue + + return [ver, tux_core, tux_audio, tux_rf, fux_rf, fux_usb, desc, ch_tuxcore, ch_tuxaudio, ch_tuxrf, ch_fuxrf, ch_fuxusb] - #-------------------------------------------------------------------------- - # Retreive tux HW and SW versions - #-------------------------------------------------------------------------- +#------------------------------------------------------------ +# Retreive the current tux versions and display them in +# a treeview +#------------------------------------------------------------ def refresh_version(self): self.cpu_tree_store.clear() @@ -338,9 +444,9 @@ version_table.append([name,version]) self.cpu_tree_store.append( tmp,(name, version)) - #-------------------------------------------------------------------------- - # On right click & Menu functions - #-------------------------------------------------------------------------- +#------------------------------------------------------------ +# On right click on a treeview +#------------------------------------------------------------ def on_tree_button_pressed(self, widget, event): def show_popup(p, button, time): tux.sys.wait(0.1) @@ -348,8 +454,16 @@ if event.button == 3: # right click thread.start_new_thread(show_popup, (None, event.button, event.time)) +#------------------------------------------------------------ +# Treeview menu +#------------------------------------------------------------ def show_gadget_popup(self, status_icon, button, activate_time): menu = gtk.Menu() + + item = gtk.CheckMenuItem(_me.string('itemDescription')) + item.connect("activate", self.showDescription) + menu.append(item) + item = gtk.CheckMenuItem(_me.string('itemChangeLog')) item.connect("activate", self.showChangeLog) menu.append(item) @@ -361,17 +475,41 @@ menu.show_all() menu.popup(None, None, None, button, activate_time) +#------------------------------------------------------------ +# Show the description +#------------------------------------------------------------ + def showDescription(self, widget): + proc = subprocess.Popen("tar -C '/tmp' -xvf '/opt/tuxdroid/firmware/%s'"%self.selectedfile, shell = True, stdout = subprocess.PIPE) + proc.wait() + xml = [] + xml = self.get_new_version_infos() + + title = _me.string('itemChangeLog') + message = str(xml[6]) + dialog = GdgText(title, message, True) + os.system('rm -rf /tmp/tuxdroid-firmware*') +#------------------------------------------------------------ +# Show the changelog +#------------------------------------------------------------ def showChangeLog(self, widget): proc = subprocess.Popen("tar -C '/tmp' -xvf '/opt/tuxdroid/firmware/%s'"%self.selectedfile, shell = True, stdout = subprocess.PIPE) proc.wait() - version, tux_core, tux_audio, tux_rf, fux_rf, fux_usb, change = self.get_new_version_infos() + xml = [] + xml = self.get_new_version_infos() title = _me.string('itemChangeLog') - message = change - dialog = GdgDialog(title, message, True) + message = '======= Tuxcore =======\n' + xml[7] + '\n \n' + message = message + '======= Tuxaudio =======\n' + xml[8] + '\n \n' + message = message + '======= Tux RF =======\n' + xml[9] + '\n \n' + message = message + '======= Fux RF =======\n' + xml[10] + '\n \n' + message = message + '======= Fux USB =======\n' + xml[11] + '\n \n' + dialog = GdgText(title, message, True) os.system('rm -rf /tmp/tuxdroid-firmware*') +#------------------------------------------------------------ +# Flash the CPU with selected tar.gz +#------------------------------------------------------------ def flashCPU(self, widget): path = '/opt/tuxdroid/firmware/%s'%self.selectedfile try: @@ -385,14 +523,16 @@ path = obj.get_selected_rows() self.selectedfile = self.filepath[path[1][0][0]][0] - +#------------------------------------------------------------ +# Check for update +#------------------------------------------------------------ def on_btnUpdate_clicked(self, widget, *args): print ' clicked' -#--------------------------------------------------------------------------- -# -# SOUND TAB -# -#--------------------------------------------------------------------------- + + +#================================================================== +# SOUND TAB FUNCTIONS +#================================================================== #-------------------------------------------------------------------------- # On select external wave file event @@ -532,16 +672,18 @@ return self.get_widget('progressbar1').show() + self.get_widget('lblSoundState').show() self.get_widget('progressbar1').set_fraction(0) - print "Sound storing : Erase flash" + self.get_widget('lblSoundState').set_text(_me.string('SoundErase')) self.get_widget('progressbar1').set_fraction(0.25) tux.cmd.sound_storing(len(wavs.wav_sizes)) - while tux.status.flash_status()[1] != 3: - pass + #tux.sys.wait(10) + while tux.status.flash_status()[1] <= 3: + tux.sys.wait(0.1) current_pos=0x0400 tux.sys.wait(0.1) - print "Sound storing : Indexes" + self.get_widget('lblSoundState').set_text(_me.string('SoundTOC')) self.get_widget('progressbar1').set_fraction(0.5) tux.cmd.sound_store_index(0x00,0x04,0x00) @@ -550,11 +692,11 @@ tux.sys.wait(0.1) tux.cmd.sound_store_index((current_pos & 0xFF0000)>>16, (current_pos & 0x00FF00)>>8,current_pos & 0x0000FF) - + self.get_widget('lblSoundState').set_text(_me.string('SoundProg')) self.get_widget('progressbar1').set_fraction(0.75) tux.sys.shell("aplay -D %s merged.wav"%soundcard) self.get_widget('progressbar1').hide() - print "Sound storing : Storage done." + self.get_widget('lblSoundState').hide() tux.sys.wait(0.3) @@ -645,17 +787,14 @@ tux.cmd.mouth_close() -#======================================================================================= -# -# Test function -# -#======================================================================================= +#================================================================== +# SELF TEST FUNCTIONS +#================================================================== def testmode(self): self.get_widget('progressbar2').show() self.get_widget('progressbar2').set_fraction(0) STEPS = 28.0 fraction = float(1.0 / STEPS) - print fraction actual_fraction = 0 path = commands.getoutput('echo $USER') #Get the local time to create the file @@ -687,7 +826,6 @@ f.write('%s : Power plug detected\n'%time.asctime()) actual_fraction += fraction - print actual_fraction self.get_widget('progressbar2').set_fraction(actual_fraction) tux.sys.wait(2) @@ -843,6 +981,8 @@ f.write('%s : The sound flash is empty\n'%time.asctime()) else: tux.cmd.sound_play(1) + while tux.status.flash_status()[0] != 0: + tux.sys.wait(0.5) self.OK = False self.popupQuestion(_me.string('Warning'), _me.string('Sound'), self.btnOK, True) self.popup_wait() @@ -851,6 +991,8 @@ self.popup(_me.string('Warning'), _me.string('Sound1'), True) self.wait() tux.cmd.sound_play(1) + while tux.status.flash_status()[0] != 0: + tux.sys.wait(0.5) self.OK = False self.popupQuestion(_me.string('Warning'), _me.string('Sound'), self.btnOK, True) self.popup_wait() @@ -867,9 +1009,11 @@ self.popup(_me.string('Warning'), _me.string('Mic'), True) self.wait() + tux.micro.on() tux.cmd.mouth_open() tux.micro.capture_start('/tmp/capture.wav', 3) tux.cmd.mouth_close() + tux.micro.off() actual_fraction += fraction self.get_widget('progressbar2').set_fraction(actual_fraction) @@ -886,7 +1030,8 @@ actual_fraction += fraction self.get_widget('progressbar2').set_fraction(actual_fraction) - + + self.OK = False self.popupQuestion(_me.string('Warning'), _me.string('Out'), self.btnOK, True) self.popup_wait() tux.sys.wait(0.5) @@ -905,11 +1050,11 @@ actual_fraction += fraction self.get_widget('progressbar2').set_fraction(actual_fraction) - + + self.OK = False self.popupQuestion(_me.string('Warning'), _me.string('In'), self.btnOK, True) self.popup_wait() tux.sys.wait(0.5) - print 'OK' if self.OK == True: tux.sys.wait(5) self.OK = False @@ -1059,7 +1204,6 @@ self.popup_open = False def popup_wait(self): - self.OK = False tux.sys.wait(0.5) while self.popup_open == True: tux.sys.wait(0.5) @@ -1101,4 +1245,65 @@ self.wait = True +class GdgText(object): + def __init__(self, title, message, block = False, center_justify = False): + self.message = message + self.title = title + self.__center_justify = center_justify + if block: + self.__show() + else: + thread.start_new_thread(self.__show_async, ()) + + def __show_async(self): + gtk.gdk.threads_enter() + self.__show() + gtk.gdk.threads_leave() + + def __show(self): + dialogue = gtk.Dialog(self.title, None, gtk.DIALOG_MODAL, ()) + dialogue.set_property("width-request", 600) + dialogue.set_property("height-request", 400) + if gadgets.has_key('Manager'): + dialogue.set_icon_from_file(gadgets['Manager'].icons['gadget.png']) + bt_alone = dialogue.add_button("Close", gtk.RESPONSE_APPLY) + + def on_click_close(obj): + dialogue.destroy() + + bt_alone.connect("clicked", on_click_close) + + box = gtk.HBox(spacing = 5) + box.set_border_width(5) + box.show() + dialogue.vbox.pack_start(box) + + scroll = gtk.ScrolledWindow() + scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS) + + index_column = gtk.TreeViewColumn('') + index_column.set_min_width(50) + index_column.set_property("clickable", False) + index_cell = gtk.CellRendererText() + index_cell.set_property("editable", False) + index_cell.set_property("background", 'white') + index_column.pack_start(index_cell, True) + index_column.add_attribute(index_cell, 'text', 0) + index_column.set_clickable(False) + + + + text = gtk.TreeStore(str) + text_viewer = gtk.TreeView(text) + text_viewer.append_column(index_column) + text_viewer.set_headers_visible(False) + text.append(None, [self.message]) + + + scroll.add(text_viewer) + scroll.show_all() + + box.pack_start(scroll) + dialogue.run() + Modified: software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml =================================================================== --- software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml 2007-11-13 08:40:35 UTC (rev 691) +++ software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml 2007-11-13 08:56:49 UTC (rev 692) @@ -9,18 +9,24 @@ <btnSleepSleep type='str'>Mettre en veille</btnSleepSleep> <lblSoundExternalFile type='str'>Fichier :</lblSoundExternalFile> <btnSoundAdd type='str'>Ajouter</btnSoundAdd> + <lblUsedChannel type='str'>Votre wifi utilise le cannal :</lblUsedChannel> <treeFile type='str'>Fichier</treeFile> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <lblCurrentIDNum type='str'>L'ID actuel est : </lblCurrentIDNum> <help_text type='str'> </help_text> + <soundErase type='str'>Effacement de la mémoire ...</soundErase> <lblWifiAvoidance type='str'>Eviter le canal wifi n° :</lblWifiAvoidance> <itemCPU type='str'>Flasher les processeurs</itemCPU> <btnSoundPlayMic type='str'>Lire</btnSoundPlayMic> <lblSoundLocal type='str'>Lire un wave local</lblSoundLocal> + <IDErrorOverflow type='str'>L'ID doit être compris entre 1 et 65534</IDErrorOverflow> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> <lblTabConfig type='str'>Configuration</lblTabConfig> <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> + <soundTOC type='str'>Ecriture des indexes</soundTOC> + <btnID type='str'>Changer l'ID</btnID> <btnUpdate type='str'>Verifier les mises à jour</btnUpdate> <lblNoChannel type='str'>Pas de connexion wifi trouvée</lblNoChannel> <gui_conf_delay_lb type='str'>Délai (sec)</gui_conf_delay_lb> @@ -28,16 +34,22 @@ <lblConfigSleep type='str'>Configuration de la veille</lblConfigSleep> <btnSleepWakeup type='str'>Reveiller</btnSleepWakeup> <btnSoundClear type='str'>Purger</btnSoundClear> + <lblIDName type='str'>Nom du Tux : </lblIDName> <Sound1 type='str'>Assurez vous que le réglage de volume soit au maximum</Sound1> <lblSleepStateSleep type='str'>Tux est actuellement en veille</lblSleepStateSleep> <lblSoundMic type='str'>Microphone</lblSoundMic> + <lblIDNum type='str'>ID de Tux : </lblIDNum> <Sound type='str'>Avez vous correctement entendu le son ?</Sound> <itemChangeLog type='str'>Voir les changements</itemChangeLog> <lblSoundLocalSelect type='str'>Selectionner un son :</lblSoundLocalSelect> + <In type='str'>Voulez-vous tester l'entrée son de Tux? +Vous devez connecter un périphérique d'entrée dans le connecteur bleu.</In> <lblSoundExternal type='str'>Lire un wave externe</lblSoundExternal> <IR type='str'>Après avoir fermer cette fenêtre, trois touches de la télécommande. Vous vez 15 secondes pour realiser cette opération.</IR> + <lblCurrentIDNumError type='str'>Pas d'ID trouvé.</lblCurrentIDNumError> <gui_conf_about_title type='str'>A propos</gui_conf_about_title> + <itemDescription type='str'>Voir la description</itemDescription> <btnSelfTest type='str'>Démarrer les tests</btnSelfTest> <lblSleepStateWork type='str'>Tux n'est pas en veille pour le moment</lblSleepStateWork> <Switch type='str'>Après avoir fermer cette fenêtre, pressez successivement sur les ailes puis sur la tête. @@ -47,28 +59,30 @@ <treeVersionVer type='str'>Version</treeVersionVer> <lblConfigWifi type='str'>Configuration wifi</lblConfigWifi> <treeVersionProg type='str'>Composant</treeVersionProg> - <lblSoundExternalPlay type='str'>Lecture</lblSoundExternalPlay> + <lblSoundStore type='str'>Enregistrer des fichiers wave</lblSoundStore> <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> <speaker_name type='str'>Bruno8k</speaker_name> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <lblSoundExternalPlay type='str'>Lecture</lblSoundExternalPlay> <name_to_read type='str'>Parametres de Tux</name_to_read> <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> - <lblUsedChannel type='str'>Votre wifi utilise le cannal :</lblUsedChannel> + <soundProg type='str'>Ecriture du son ...</soundProg> <lblSleepDelay type='str'>Activer la veille après une période d'inactivité de </lblSleepDelay> <lblTabSound type='str'>Audio</lblTabSound> <btnSoundStore type='str'>Ecrire</btnSoundStore> <lblVersions type='str'>Versions installées</lblVersions> <chkSoundOriginal type='str'>Fichier originaux</chkSoundOriginal> <btnSoundModify type='str'>Modifier</btnSoundModify> + <Iwlist type='str'>iwlist n'a pas été trouvée. +Assurez-vous que le paquet 'wireless tools' est correctement installé sur votre ordinateur. +(http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html#latest)</Iwlist> <Warning type='str'>Attention</Warning> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <Connect type='str'>Connectez l'alimentation de tux puis fermez cette fenêtre.</Connect> - <In type='str'>Voulez-vous tester l'entrée son de Tux? -Vous devez connecter un périphérique d'entrée dans le connecteur bleu.</In> + <lblCurrentIDName type='str'>Le nom acteul est : </lblCurrentIDName> <lblConfigID type='str'>Configuration de l'ID</lblConfigID> + <lblTabVersion type='str'>Versions</lblTabVersion> + <btnSoundPlayNum type='str'>Lire</btnSoundPlayNum> <Out type='str'>Voulez-vous tester la sortie son de Tux? Vous devez connecter des haut-parleurs dans la prise verte.</Out> - <lblTabVersion type='str'>Versions</lblTabVersion> - <btnSoundPlayNum type='str'>Lire</btnSoundPlayNum> - <lblSoundStore type='str'>Enregistrer des fichiers wave</lblSoundStore> </strings> Modified: software/gadgets/settings/trunk/settings/about.xml =================================================================== (Binary files differ) Modified: software/gadgets/settings/trunk/settings/settings.xml =================================================================== --- software/gadgets/settings/trunk/settings/settings.xml 2007-11-13 08:40:35 UTC (rev 691) +++ software/gadgets/settings/trunk/settings/settings.xml 2007-11-13 08:56:49 UTC (rev 692) @@ -3,20 +3,17 @@ <parameters> <AvoidChannel type='int'>0</AvoidChannel> <hidden_in_manager type='bool'>False</hidden_in_manager> - <SleepDelay type='int'>10</SleepDelay> + <SleepDelay type='str'>10</SleepDelay> <EnableSleep type='bool'>True</EnableSleep> </parameters> <general> + <have_settings_part type='bool'>True</have_settings_part> <gui_state> <widget> - <y type='int'>147</y> - <visible type='bool'>True</visible> - <x type='int'>417</x> + <visible type='bool'>False</visible> </widget> <conf> - <y type='int'>50</y> - <visible type='bool'>True</visible> - <x type='int'>5</x> + <visible type='bool'>False</visible> </conf> </gui_state> <language type='str'>en_US</language> @@ -24,9 +21,11 @@ <notify_delay type='int'>60</notify_delay> <framework_version type='str'>0.0.0</framework_version> <menu_active type='bool'>True</menu_active> - <main_priority type='int'>4</main_priority> + <have_widget_part type='bool'>True</have_widget_part> <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> <notify_priority type='int'>4</notify_priority> </general> </settings> Modified: software/gadgets/settings/trunk/settings/strings.xml =================================================================== --- software/gadgets/settings/trunk/settings/strings.xml 2007-11-13 08:40:35 UTC (rev 691) +++ software/gadgets/settings/trunk/settings/strings.xml 2007-11-13 08:56:49 UTC (rev 692) @@ -6,38 +6,47 @@ <gui_conf_remote_title type='str'>Remote</gui_conf_remote_title> <btnSoundRemove type='str'>Remove</btnSoundRemove> <Mic type='str'>After closing this window, say anything to Tux.</Mic> - <treeVersionProg type='str'>Component</treeVersionProg> + <btnSleepSleep type='str'>Sleep</btnSleepSleep> <lblSoundExternalFile type='str'>File :</lblSoundExternalFile> <btnSoundAdd type='str'>Add</btnSoundAdd> <treeFile type='str'>Fichier</treeFile> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> + <lblCurrentIDNum type='str'>The current ID is : </lblCurrentIDNum> + <Connect type='str'>Please connect the power plug, and press the 'OK' button</Connect> <help_text type='str'> </help_text> + <soundErase type='str'>Erasing flash ...</soundErase> <lblWifiAvoidance type='str'>Avoid the wifi channel number :</lblWifiAvoidance> <itemCPU type='str'>Flash the CPUs</itemCPU> <btnSoundPlayMic type='str'>Play</btnSoundPlayMic> <lblSoundLocal type='str'>Play local wave files</lblSoundLocal> + <IDErrorOverflow type='str'>The ID must be included between 1 and 65534.</IDErrorOverflow> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Update</gui_conf_update_title> <lblTabConfig type='str'>Configuration</lblTabConfig> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> + <btnSoundModify type='str'>Modify</btnSoundModify> <btnUpdate type='str'>Check for updates</btnUpdate> <lblNoChannel type='str'>No wifi connection found</lblNoChannel> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <btnSoundPlayNum type='str'>Play</btnSoundPlayNum> <btnSoundRecordMic type='str'>Record</btnSoundRecordMic> <lblConfigSleep type='str'>Sleep configuration</lblConfigSleep> <btnSleepWakeup type='str'>Wakeup</btnSleepWakeup> <btnSoundClear type='str'>Clear list</btnSoundClear> <Sound1 type='str'>Be sure that the sound volume control is at the maximum.</Sound1> <lblSleepStateSleep type='str'>Tux is currently sleeping</lblSleepStateSleep> - <speaker_name type='str'>Ryan8k</speaker_name> + <lblSoundMic type='str'>Microphone</lblSoundMic> + <lblIDNum type='str'>Tux's ID : </lblIDNum> <Sound type='str'>Have you heard the sound ?</Sound> <itemChangeLog type='str'>Show ChangeLog</itemChangeLog> <lblSoundLocalSelect type='str'>Select sound</lblSoundLocalSelect> <lblSoundExternal type='str'>Play external wave file</lblSoundExternal> <IR type='str'>After closing this window, press the keys '1', '2' and '3' of the remote control. You've 15 seconds to perform this task.</IR> + <lblCurrentIDNumError type='str'>Unable to read the current ID.</lblCurrentIDNumError> <gui_conf_about_title type='str'>About</gui_conf_about_title> + <itemDescription type='str'>Show the description</itemDescription> <btnSelfTest type='str'>Start self test</btnSelfTest> <lblSleepStateWork type='str'>Tux isn't in sleep mode</lblSleepStateWork> <Switch type='str'>After closing this window, press on the wings and on the head. @@ -46,29 +55,34 @@ <lblConfigTest type='str'>Self tests</lblConfigTest> <treeVersionVer type='str'>Version</treeVersionVer> <lblConfigWifi type='str'>Wifi configuration</lblConfigWifi> - <btnSleepSleep type='str'>Sleep</btnSleepSleep> - <lblSoundExternalPlay type='str'>Play</lblSoundExternalPlay> + <treeVersionProg type='str'>Component</treeVersionProg> + <lblSoundStore type='str'>Store wave files locally</lblSoundStore> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> - <lblSoundMic type='str'>Microphone</lblSoundMic> + <speaker_name type='str'>Ryan8k</speaker_name> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <lblSoundExternalPlay type='str'>Play</lblSoundExternalPlay> <name_to_read type='str'>Tux settings</name_to_read> + <btnID type='str'>Change ID</btnID> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> - <lblUsedChannel type='str'>Your wifi use the channel :</lblUsedChannel> + <soundProg type='str'>Sound programming ...</soundProg> <lblSleepDelay type='str'>Active the sleep mode after a inactivity period of</lblSleepDelay> <lblTabSound type='str'>Audio</lblTabSound> <btnSoundStore type='str'>Store</btnSoundStore> <lblVersions type='str'>Installed versions</lblVersions> <chkSoundOriginal type='str'>Include originals</chkSoundOriginal> - <btnSoundModify type='str'>Modify</btnSoundModify> + <soundTOC type='str'>TOC programming ...</soundTOC> + <Iwlist type='str'>iwlist package isn't found. +Be sure that wireless tools package is instelled on your computer. +(http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html#latest)</Iwlist> <Warning type='str'>Warning</Warning> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> - <Connect type='str'>Please connect the power plug, and press the 'OK' button</Connect> - <In type='str'>Would you like to test the sound input interface? -To do this, you need to connect an input device in the blue connector and then click 'Yes'.</In> + <lblIDName type='str'>Tux's name : </lblIDName> + <lblCurrentIDName type='str'>The current name is : </lblCurrentIDName> <lblConfigID type='str'>ID configuration</lblConfigID> <Out type='str'>Would you like to test the sound output interface? To do this, you need to connect loudspeakers in the green connector, and press the 'Yes' button.</Out> <lblTabVersion type='str'>Versions</lblTabVersion> - <btnSoundPlayNum type='str'>Play</btnSoundPlayNum> - <lblSoundStore type='str'>Store wave files locally</lblSoundStore> + <lblUsedChannel type='str'>Your wifi use the channel :</lblUsedChannel> + <In type='str'>Would you like to test the sound input interface? +To do this, you need to connect an input device in the blue connector and then click 'Yes'.</In> </strings> Modified: software/gadgets/settings/trunk/settings.tgf =================================================================== (Binary files differ) |
From: jaguarondi <c2m...@c2...> - 2007-11-13 08:40:39
|
Author: jaguarondi Date: 2007-11-13 09:40:35 +0100 (Tue, 13 Nov 2007) New Revision: 691 Modified: firmware/tuxup/trunk/main.c Log: * Consistency with the 'const' keyword. Modified: firmware/tuxup/trunk/main.c =================================================================== --- firmware/tuxup/trunk/main.c 2007-11-12 14:45:38 UTC (rev 690) +++ firmware/tuxup/trunk/main.c 2007-11-13 08:40:35 UTC (rev 691) @@ -34,7 +34,7 @@ #define countof(X) ( (size_t) ( sizeof(X)/sizeof*(X) ) ) /* Messages. */ -static const char *msg_old_firmware = +static char const *msg_old_firmware = "\nERROR: Your dongle firmware is too old to support switching to bootloader" "\nmode automatically.\n" "\n To enter bootloading mode manually, you need to unplug the dongle, press" @@ -48,7 +48,7 @@ "\nCheck http://www.tuxisalive.com/documentation/how-to/updating-the-firmware" "\nfor more details.\n"; -static const char *msg_dfu_programmer_not_installed = +static char const *msg_dfu_programmer_not_installed = "\nERROR: dfu-programmer is not installed or is not in your path, tuxup uses" "\nit to reprogram the USB cpu so installing dfu-programmer is mandatory.\n"; @@ -56,10 +56,10 @@ enum program_modes_t { NONE, ALL, MAIN, INPUTFILES }; /* The name of this program. */ -static const char *program_name = "tuxup"; +static char const *program_name = "tuxup"; /* The version defined in version.h */ -static const char *program_version = VERSION; +static char const *program_version = VERSION; /* Whether to display verbose messages. */ int verbose = 0; @@ -176,7 +176,7 @@ * from the hex file and returns 0 if the hex file has a cpu and version * numbers, 1 otherwise. */ -static int check_hex_file(const char *filename, version_bf_t * version) +static int check_hex_file(char const *filename, version_bf_t * version) { FILE *fs = NULL; char word[80]; @@ -209,7 +209,7 @@ return 1; } -static int prog_flash(const char *filename) +static int prog_flash(char const *filename) { version_bf_t version; uint8_t cpu_i2c_addr; @@ -267,7 +267,7 @@ return 1; } -static int prog_eeprom(uint8_t cpu_nbr, const char *filename) +static int prog_eeprom(uint8_t cpu_nbr, char const *filename) { uint8_t cpu_i2c_addr; @@ -305,7 +305,7 @@ return 1; } -static int prog_usb(const char *filename) +static int prog_usb(char const *filename) { /* XXX include those as defines in commands.h */ uint8_t send_data[5] = { 0x01, 0x01, 0x00, 0x00, 0xFF }; @@ -477,7 +477,7 @@ int next_option; /* A string listing valid short options letters. */ - const char *const short_options = "maphvV"; + char const *const short_options = "maphvV"; /* An array describing valid long options. */ const struct option long_options[] = { @@ -591,18 +591,18 @@ break; case MAIN: { - const char *s[]={"tuxcore.hex", "tuxcore.eep", "tuxaudio.hex", + char const *s[]={"tuxcore.hex", "tuxcore.eep", "tuxaudio.hex", "tuxaudio.eep"}; - const char **p; + char const **p; for (p = s; p < &s[countof(s)] && !ret ; p++) ret = program(*p, path); } break; case ALL: { - const char *s[]={"fuxusb.hex", "tuxcore.hex", "tuxcore.eep", + char const *s[]={"fuxusb.hex", "tuxcore.hex", "tuxcore.eep", "tuxaudio.hex", "tuxaudio.eep", "fuxrf.hex", "tuxrf.hex"}; - const char **p; + char const **p; for (p = s; p < &s[countof(s)] && !ret ; p++) ret = program(*p, path); } |
From: jaguarondi <c2m...@c2...> - 2007-11-12 14:45:39
|
Author: jaguarondi Date: 2007-11-12 15:45:38 +0100 (Mon, 12 Nov 2007) New Revision: 690 Modified: firmware/tuxup/trunk/main.c Log: * Small cleanup. Modified: firmware/tuxup/trunk/main.c =================================================================== --- firmware/tuxup/trunk/main.c 2007-11-12 14:42:25 UTC (rev 689) +++ firmware/tuxup/trunk/main.c 2007-11-12 14:45:38 UTC (rev 690) @@ -586,12 +586,13 @@ { int i; for (i = optind; i < argc && !ret ; ++i) - ret = program(argv[i], NULL); /* XXX returned values are not used yet */ + ret = program(argv[i], NULL); } break; case MAIN: { - const char *s[]={"tuxcore.hex","tuxcore.eep","tuxaudio.hex","tuxaudio.eep"}; + const char *s[]={"tuxcore.hex", "tuxcore.eep", "tuxaudio.hex", + "tuxaudio.eep"}; const char **p; for (p = s; p < &s[countof(s)] && !ret ; p++) ret = program(*p, path); @@ -599,7 +600,8 @@ break; case ALL: { - const char *s[]={"fuxusb.hex", "tuxcore.hex","tuxcore.eep","tuxaudio.hex","tuxaudio.eep", "fuxrf.hex", "tuxrf.hex"}; + const char *s[]={"fuxusb.hex", "tuxcore.hex", "tuxcore.eep", + "tuxaudio.hex", "tuxaudio.eep", "fuxrf.hex", "tuxrf.hex"}; const char **p; for (p = s; p < &s[countof(s)] && !ret ; p++) ret = program(*p, path); |
From: jaguarondi <c2m...@c2...> - 2007-11-12 14:42:24
|
Author: jaguarondi Date: 2007-11-12 15:42:25 +0100 (Mon, 12 Nov 2007) New Revision: 689 Modified: firmware/tuxaudio/trunk/AT26F004.c firmware/tuxaudio/trunk/PC_communication.c firmware/tuxaudio/trunk/flash.c firmware/tuxaudio/trunk/hardware.h Log: * read_data was not handling the HOLD signal of the flash, now fixed. Also renamed some macros. Modified: firmware/tuxaudio/trunk/AT26F004.c =================================================================== --- firmware/tuxaudio/trunk/AT26F004.c 2007-11-12 14:36:27 UTC (rev 688) +++ firmware/tuxaudio/trunk/AT26F004.c 2007-11-12 14:42:25 UTC (rev 689) @@ -51,10 +51,10 @@ { uint8_t status; - FLASH_CS_ON; + flash_select(); spiSend(READ_STATUS_REG); /* Send Read Status Command */ status = spiSend(NOP); /* Read status on spi */ - FLASH_CS_OFF; + flash_unselect(); return status; } /** @@ -64,9 +64,9 @@ */ void write_enable(void) { - FLASH_CS_ON; + flash_select(); spiSend(WRITE_EN); /* Send Write Enable Command */ - FLASH_CS_OFF; + flash_unselect(); } /** * \ingroup at26f004 @@ -75,9 +75,9 @@ */ void write_disable(void) { - FLASH_CS_ON; + flash_select(); spiSend(WRITE_DIS); /* Send Write Disable Command */ - FLASH_CS_OFF; + flash_unselect(); } /** @@ -87,10 +87,10 @@ */ void write_status(uint8_t const status) { - FLASH_CS_ON; + flash_select(); spiSend(WRITE_STATUS_REG); /* Send Write Status Command */ spiSend(status); /* Send status */ - FLASH_CS_OFF; + flash_unselect(); } /** * \ingroup at26f004 @@ -102,13 +102,13 @@ */ void unprotect_sector(uint8_t const ad2, uint8_t const ad1, uint8_t const ad0) { - FLASH_CS_ON; + flash_select(); spiSend(UNPROTECT_SECTOR); /* Send unprotect sector command */ /* Send Adress */ spiSend(ad2); spiSend(ad1); spiSend(ad0); - FLASH_CS_OFF; + flash_unselect(); } /** * \ingroup at26f004 @@ -127,9 +127,9 @@ write_enable(); /* Enable the writing */ - FLASH_CS_ON; + flash_select(); spiSend(CHIP_ERASE); /* Send Erase Bulk command */ - FLASH_CS_OFF; + flash_unselect(); } /** @@ -146,14 +146,14 @@ while (read_status() & BUSY) ; /* Wait Page Program Cycle */ write_enable(); - FLASH_CS_ON; + flash_select(); spiSend(BYTE_PROGRAM); /* Send Page Byte Command */ /* Send adress */ spiSend(ad2); spiSend(ad1); spiSend(ad0); spiSend(data); /* Write data in flash */ - FLASH_CS_OFF; + flash_unselect(); } /** @@ -168,14 +168,16 @@ { uint8_t data1; - FLASH_CS_ON; + flash_enable(); // Set the HOLD signal + flash_select(); spiSend(READ_ARRAY_LOW_F); /* Send Read Page Command */ /* Send address */ spiSend(ad2); spiSend(ad1); spiSend(ad0); data1 = spiSend(NOP); /* Wait response */ - FLASH_CS_OFF; + flash_unselect(); + flash_onhold(); // Reset the HOLD signal return data1; } Modified: firmware/tuxaudio/trunk/PC_communication.c =================================================================== --- firmware/tuxaudio/trunk/PC_communication.c 2007-11-12 14:36:27 UTC (rev 688) +++ firmware/tuxaudio/trunk/PC_communication.c 2007-11-12 14:42:25 UTC (rev 689) @@ -38,8 +38,6 @@ spi_count = 0; // Reset spi counter spi_slave = HEADERS; // Set state machine spi_master = HEADERM; - if (programmingFlash || flashPlay) - HOLD_ON; // Reset SPI to fix strange bug on the spi SPCR = 0x50; SPSR = 0x00; Modified: firmware/tuxaudio/trunk/flash.c =================================================================== --- firmware/tuxaudio/trunk/flash.c 2007-11-12 14:36:27 UTC (rev 688) +++ firmware/tuxaudio/trunk/flash.c 2007-11-12 14:42:25 UTC (rev 689) @@ -165,7 +165,7 @@ { uint8_t count, i; uint8_t adp1, adp0, sounds_stored; // Address pointer varaible - HOLD_OFF; + flash_enable(); sounds_stored = read_data(0x00, 0x00, 0x00); if (sounds_stored == 0xFF) /* if unprogrammed we have 0xFF stored in flash */ { @@ -192,7 +192,7 @@ count++; } - FLASH_CS_ON; // Chip Select + flash_select(); // Chip Select spiSend(READ_ARRAY_LOW_F); // Send Read Page Command spiSend(0x00); // Send Address @@ -204,7 +204,7 @@ ad[i] = spiSend(NOP); // Read start and stop sound address } - FLASH_CS_OFF; // Chip Deselect + flash_unselect(); // Chip Deselect /* Check adresses */ if (ad[0] > TOP_A2) @@ -249,13 +249,13 @@ } } resetFifo(&PWMFifo); - FLASH_CS_ON; // Chip Select + flash_select(); // Chip Select spiSend(0x03); // Send Read Page Command spiSend(ad[0]); // Send Address spiSend(ad[1]); spiSend(ad[2]); - HOLD_ON; // Reset the HOLD signal + flash_onhold(); // Reset the HOLD signal OCR0A = 250; // Normal operation for PWM if fifo adaptative is on flash_state = 0; @@ -273,7 +273,7 @@ static void playingSound(void) { uint8_t sound; - HOLD_OFF; + flash_enable(); while (!spi_start && !isFifoFull(&PWMFifo)) { sound = spiSend(0x00); // Wait response @@ -302,7 +302,7 @@ break; } } - HOLD_ON; + flash_onhold(); } /* Static functions */ @@ -405,7 +405,7 @@ { flash_state = 0; write_enable(); - FLASH_CS_ON; + flash_select(); spiSend(SEQU_PROGRAM); spiSend(ad2); spiSend(ad1); @@ -422,7 +422,7 @@ else flash_state = 0; } - FLASH_CS_OFF; // Chip Deselect + flash_unselect(); // Chip Deselect } /** @@ -438,10 +438,10 @@ { if (!isFifoEmpty(&PWMFifo)) // Fifo not empty { - FLASH_CS_ON; // Chip Select + flash_select(); // Chip Select spiSend(SEQU_PROGRAM); // Send Sequencial Program Command spiSend(pullFifo(&PWMFifo)); // Write data in flash - FLASH_CS_OFF; // Chip DeselecT + flash_unselect(); // Chip DeselecT ad0++; // Increment address byte if (ad0 == 0x00) { Modified: firmware/tuxaudio/trunk/hardware.h =================================================================== --- firmware/tuxaudio/trunk/hardware.h 2007-11-12 14:36:27 UTC (rev 688) +++ firmware/tuxaudio/trunk/hardware.h 2007-11-12 14:42:25 UTC (rev 689) @@ -21,21 +21,17 @@ #include <avr/io.h> -#ifndef HARDWARE_H -#define HARDWARE_H +#ifndef _HARDWARE_H_ +#define _HARDWARE_H_ /* Flash memory port */ -#define FLASH_PORT PORTB -#define FLASH_CS_PIN _BV(PB1) -#define FLASH_HOLD_PIN _BV(PB0) +#define FLASH_PORT PORTB +#define FLASH_CS_PIN _BV(PB1) +#define FLASH_HOLD_PIN _BV(PB0) /* Flash memory commands */ -#define FLASH_CS_ON FLASH_PORT &= ~FLASH_CS_PIN -#define FLASH_CS_OFF FLASH_PORT |= FLASH_CS_PIN -#define HOLD_ON FLASH_PORT &= ~FLASH_HOLD_PIN -#define HOLD_OFF FLASH_PORT |= FLASH_HOLD_PIN +#define flash_select() (FLASH_PORT &= ~FLASH_CS_PIN) +#define flash_unselect() (FLASH_PORT |= FLASH_CS_PIN) +#define flash_onhold() (FLASH_PORT &= ~FLASH_HOLD_PIN) +#define flash_enable() (FLASH_PORT |= FLASH_HOLD_PIN) - -#endif - - - +#endif /* _HARDWARE_H_ */ |
From: jaguarondi <c2m...@c2...> - 2007-11-12 14:36:33
|
Author: jaguarondi Date: 2007-11-12 15:36:27 +0100 (Mon, 12 Nov 2007) New Revision: 688 Modified: firmware/tuxaudio/trunk/CHANGES firmware/tuxcore/trunk/CHANGES Log: * Typo. Modified: firmware/tuxaudio/trunk/CHANGES =================================================================== --- firmware/tuxaudio/trunk/CHANGES 2007-11-12 12:22:20 UTC (rev 687) +++ firmware/tuxaudio/trunk/CHANGES 2007-11-12 14:36:27 UTC (rev 688) @@ -9,7 +9,7 @@ Version 0.3.1: - * Versioning of the firmware now has a variation field nd a release_type to + * Versioning of the firmware now has a variation field and a release_type to mark final releases. * Reviewed the flash playing function to use a fifo and to be able to keep Modified: firmware/tuxcore/trunk/CHANGES =================================================================== --- firmware/tuxcore/trunk/CHANGES 2007-11-12 12:22:20 UTC (rev 687) +++ firmware/tuxcore/trunk/CHANGES 2007-11-12 14:36:27 UTC (rev 688) @@ -14,7 +14,7 @@ * Reorganization of commands.h is on the way. - * Versioning of the firmware now has a variation field nd a release_type to + * Versioning of the firmware now has a variation field and a release_type to mark final releases. * Added doxygen configuration file. The documentation can be founf online at |
From: jaguarondi <c2m...@c2...> - 2007-11-12 12:22:20
|
Author: jaguarondi Date: 2007-11-12 13:22:20 +0100 (Mon, 12 Nov 2007) New Revision: 687 Modified: firmware/tuxup/trunk/bootloader.c Log: * Now progress is seen when programming. Modified: firmware/tuxup/trunk/bootloader.c =================================================================== --- firmware/tuxup/trunk/bootloader.c 2007-11-12 11:47:35 UTC (rev 686) +++ firmware/tuxup/trunk/bootloader.c 2007-11-12 12:22:20 UTC (rev 687) @@ -327,6 +327,7 @@ if ((ret == 5) && (data_buffer[0] == 0xF0) && (data_buffer[1] == 0)) { printf("."); + fflush (stdout); return TRUE; } else |
From: jaguarondi <c2m...@c2...> - 2007-11-12 11:47:37
|
Author: jaguarondi Date: 2007-11-12 12:47:35 +0100 (Mon, 12 Nov 2007) New Revision: 686 Modified: firmware/tuxup/trunk/main.c Log: * main() now returns an error when programming fails for any reason. Modified: firmware/tuxup/trunk/main.c =================================================================== --- firmware/tuxup/trunk/main.c 2007-11-12 10:13:49 UTC (rev 685) +++ firmware/tuxup/trunk/main.c 2007-11-12 11:47:35 UTC (rev 686) @@ -31,6 +31,8 @@ #include "version.h" #include "common/defines.h" +#define countof(X) ( (size_t) ( sizeof(X)/sizeof*(X) ) ) + /* Messages. */ static const char *msg_old_firmware = "\nERROR: Your dongle firmware is too old to support switching to bootloader" @@ -393,20 +395,20 @@ * programming will be selected. In case of eeprom, the correct CPU * will be choosen from the filename. */ -static int program(char *filename, char *path) +static int program(char const *filename, char const *path) { int ret = -1; size_t len; - char *extension, filenamepath[90]; + char *extension, filenamepath[255]; if (path) { /* Checking path */ len = strlen(path); + strcpy(filenamepath, path); /* Append '/' at the end if not specified. */ if (path[len - 1] != '/') - strcat(path, "/"); - strcpy(filenamepath, path); + strcat(filenamepath, "/"); strcat(filenamepath, filename); filename = filenamepath; } @@ -470,6 +472,7 @@ char path[90]; enum program_modes_t program_mode = NONE; time_t start_time, end_time; + int ret = 0; int next_option; @@ -582,24 +585,25 @@ case INPUTFILES: { int i; - for (i = optind; i < argc; ++i) - program(argv[i], NULL); /* XXX returned values are not used yet */ + for (i = optind; i < argc && !ret ; ++i) + ret = program(argv[i], NULL); /* XXX returned values are not used yet */ } break; case MAIN: - program("tuxcore.hex", path); - program("tuxcore.eep", path); - program("tuxaudio.hex", path); - program("tuxaudio.eep", path); + { + const char *s[]={"tuxcore.hex","tuxcore.eep","tuxaudio.hex","tuxaudio.eep"}; + const char **p; + for (p = s; p < &s[countof(s)] && !ret ; p++) + ret = program(*p, path); + } break; case ALL: - program("fuxusb.hex", path); - program("tuxcore.hex", path); - program("tuxcore.eep", path); - program("tuxaudio.hex", path); - program("tuxaudio.eep", path); - program("tuxrf.hex", path); - program("fuxrf.hex", path); + { + const char *s[]={"fuxusb.hex", "tuxcore.hex","tuxcore.eep","tuxaudio.hex","tuxaudio.eep", "fuxrf.hex", "tuxrf.hex"}; + const char **p; + for (p = s; p < &s[countof(s)] && !ret ; p++) + ret = program(*p, path); + } break; default: abort(); @@ -608,6 +612,10 @@ if (!pretend) fux_disconnect(); + /* In case of error of some sort, we return it. */ + if (ret) + return ret; + /* Print time elapsed for programming. */ end_time = time(NULL); if (!pretend) |
From: jaguarondi <c2m...@c2...> - 2007-11-12 10:13:57
|
Author: jaguarondi Date: 2007-11-12 11:13:49 +0100 (Mon, 12 Nov 2007) New Revision: 685 Modified: firmware/tuxup/trunk/main.c Log: * Accept the next coming release 0.3.1 of fuxusb as a valid firmware. Modified: firmware/tuxup/trunk/main.c =================================================================== --- firmware/tuxup/trunk/main.c 2007-11-09 16:57:15 UTC (rev 684) +++ firmware/tuxup/trunk/main.c 2007-11-12 10:13:49 UTC (rev 685) @@ -130,7 +130,7 @@ /* Check if we have the old firmware that requires entering * bootloader mode manually, exits with a message that exlains what * to do in such a case. */ - if (device->descriptor.bcdDevice < 0x100) + if (device->descriptor.bcdDevice < 0x030) { fprintf(stderr, msg_old_firmware); exit(1); |
From: jaguarondi <c2m...@c2...> - 2007-11-09 16:57:15
|
Author: jaguarondi Date: 2007-11-09 17:57:15 +0100 (Fri, 09 Nov 2007) New Revision: 684 Modified: firmware/tuxaudio/trunk/version.h Log: * Bumping to version 0.3.2 (SVN/UNRELEASED). Modified: firmware/tuxaudio/trunk/version.h =================================================================== --- firmware/tuxaudio/trunk/version.h 2007-11-09 16:56:26 UTC (rev 683) +++ firmware/tuxaudio/trunk/version.h 2007-11-09 16:57:15 UTC (rev 684) @@ -30,7 +30,7 @@ #define VER_MAJOR 0 #define VER_MINOR 3 -#define VER_UPDATE 1 +#define VER_UPDATE 2 /** RELEASE should be set to '1' prior to tagging a release, and reset * immediately after. It's like appending (SVN_UNRELEASED) to a version number * when equal to '0'. */ |
From: jaguarondi <c2m...@c2...> - 2007-11-09 16:56:27
|
Author: jaguarondi Date: 2007-11-09 17:56:26 +0100 (Fri, 09 Nov 2007) New Revision: 683 Added: firmware/tuxaudio/tags/0.3.1/ Modified: firmware/tuxaudio/tags/0.3.1/version.h Log: * Releasing tuxaudio 0.3.1. See CHANGES for details. Copied: firmware/tuxaudio/tags/0.3.1 (from rev 682, firmware/tuxaudio/trunk) Property changes on: firmware/tuxaudio/tags/0.3.1 ___________________________________________________________________ Name: svn:externals + common -r 679 http://svn.tuxisalive.com/firmware/tuxdefs Modified: firmware/tuxaudio/tags/0.3.1/version.h =================================================================== --- firmware/tuxaudio/trunk/version.h 2007-11-09 16:53:35 UTC (rev 682) +++ firmware/tuxaudio/tags/0.3.1/version.h 2007-11-09 16:56:26 UTC (rev 683) @@ -34,7 +34,7 @@ /** RELEASE should be set to '1' prior to tagging a release, and reset * immediately after. It's like appending (SVN_UNRELEASED) to a version number * when equal to '0'. */ -#define RELEASE 0 +#define RELEASE 1 #define AUTHOR_ID 0 /* official release */ #define VARIATION 0 /* generic firmware */ |
From: jaguarondi <c2m...@c2...> - 2007-11-09 16:53:35
|
Author: jaguarondi Date: 2007-11-09 17:53:35 +0100 (Fri, 09 Nov 2007) New Revision: 682 Modified: firmware/tuxcore/trunk/version.h Log: * Bumping to version 0.3.2 (SVN/UNRELEASED). Modified: firmware/tuxcore/trunk/version.h =================================================================== --- firmware/tuxcore/trunk/version.h 2007-11-09 16:49:06 UTC (rev 681) +++ firmware/tuxcore/trunk/version.h 2007-11-09 16:53:35 UTC (rev 682) @@ -30,7 +30,7 @@ #define VER_MAJOR 0 #define VER_MINOR 3 -#define VER_UPDATE 1 +#define VER_UPDATE 2 /** RELEASE should be set to '1' prior to tagging a release, and reset * immediately after. It's like appending (SVN_UNRELEASED) to a version number * when equal to '0'. */ |
From: jaguarondi <c2m...@c2...> - 2007-11-09 16:50:43
|
Author: jaguarondi Date: 2007-11-09 17:11:44 +0100 (Fri, 09 Nov 2007) New Revision: 678 Added: firmware/fuxusb/tags/0.3.1/ firmware/fuxusb/tags/0.3.1/bootloading.c firmware/fuxusb/tags/0.3.1/bootloading.h firmware/fuxusb/tags/0.3.1/config.h firmware/fuxusb/tags/0.3.1/global.c firmware/fuxusb/tags/0.3.1/global.h firmware/fuxusb/tags/0.3.1/i2c.c firmware/fuxusb/tags/0.3.1/i2c.h firmware/fuxusb/tags/0.3.1/lib_board/ firmware/fuxusb/tags/0.3.1/lib_board/c5131_evab.h firmware/fuxusb/tags/0.3.1/lib_board/kbd_drv.c firmware/fuxusb/tags/0.3.1/lib_board/kbd_drv.h firmware/fuxusb/tags/0.3.1/lib_c/ firmware/fuxusb/tags/0.3.1/lib_c/stdint.h firmware/fuxusb/tags/0.3.1/lib_mcu/ firmware/fuxusb/tags/0.3.1/lib_mcu/5131_drv.h firmware/fuxusb/tags/0.3.1/lib_mcu/c51_drv.h firmware/fuxusb/tags/0.3.1/lib_mcu/compiler.h firmware/fuxusb/tags/0.3.1/lib_mcu/ext_5131.h firmware/fuxusb/tags/0.3.1/lib_mcu/fa-usb/ firmware/fuxusb/tags/0.3.1/lib_mcu/fa-usb/fa-usb.html firmware/fuxusb/tags/0.3.1/lib_mcu/fa-usb/flash_api.bak firmware/fuxusb/tags/0.3.1/lib_mcu/fa-usb/flash_api.c firmware/fuxusb/tags/0.3.1/lib_mcu/fa-usb/flash_api.h firmware/fuxusb/tags/0.3.1/lib_mcu/mcu.h firmware/fuxusb/tags/0.3.1/lib_mcu/mcu_drv.h firmware/fuxusb/tags/0.3.1/lib_mcu/reg_5131.h firmware/fuxusb/tags/0.3.1/lib_mcu/spi/ firmware/fuxusb/tags/0.3.1/lib_mcu/spi/spi_lib.c firmware/fuxusb/tags/0.3.1/lib_mcu/spi/spi_lib.h firmware/fuxusb/tags/0.3.1/lib_mcu/twi/ firmware/fuxusb/tags/0.3.1/lib_mcu/twi/twi.h firmware/fuxusb/tags/0.3.1/lib_mcu/uart/ firmware/fuxusb/tags/0.3.1/lib_mcu/uart/tools/ firmware/fuxusb/tags/0.3.1/lib_mcu/uart/tools/c51_bdr.c firmware/fuxusb/tags/0.3.1/lib_mcu/uart/uart_bdr.h firmware/fuxusb/tags/0.3.1/lib_mcu/uart/uart_lib.c firmware/fuxusb/tags/0.3.1/lib_mcu/uart/uart_lib.h firmware/fuxusb/tags/0.3.1/lib_mcu/usb/ firmware/fuxusb/tags/0.3.1/lib_mcu/usb/uart_usb_lib.c firmware/fuxusb/tags/0.3.1/lib_mcu/usb/uart_usb_lib.h firmware/fuxusb/tags/0.3.1/lib_mcu/usb/usb_drv.c firmware/fuxusb/tags/0.3.1/lib_mcu/usb/usb_drv.h firmware/fuxusb/tags/0.3.1/main.c firmware/fuxusb/tags/0.3.1/modules/ firmware/fuxusb/tags/0.3.1/modules/fifo/ firmware/fuxusb/tags/0.3.1/modules/fifo/fifo.c firmware/fuxusb/tags/0.3.1/modules/fifo/fifo.h firmware/fuxusb/tags/0.3.1/modules/fifo/fifo_mic.c firmware/fuxusb/tags/0.3.1/modules/fifo/fifo_mic.h firmware/fuxusb/tags/0.3.1/modules/fifo/fifo_spk.c firmware/fuxusb/tags/0.3.1/modules/fifo/fifo_spk.h firmware/fuxusb/tags/0.3.1/modules/fifo_stt/ firmware/fuxusb/tags/0.3.1/modules/fifo_stt/fifo_stt.bak firmware/fuxusb/tags/0.3.1/modules/fifo_stt/fifo_stt.c firmware/fuxusb/tags/0.3.1/modules/fifo_stt/fifo_stt.h firmware/fuxusb/tags/0.3.1/modules/scheduler/ firmware/fuxusb/tags/0.3.1/modules/scheduler/scheduler.c firmware/fuxusb/tags/0.3.1/modules/scheduler/scheduler.h firmware/fuxusb/tags/0.3.1/modules/spi/ firmware/fuxusb/tags/0.3.1/modules/spi/spi_task.c firmware/fuxusb/tags/0.3.1/modules/spi/spi_task.h firmware/fuxusb/tags/0.3.1/modules/timer_soft/ firmware/fuxusb/tags/0.3.1/modules/timer_soft/timer_soft.c firmware/fuxusb/tags/0.3.1/modules/timer_soft/timer_soft.gif firmware/fuxusb/tags/0.3.1/modules/timer_soft/timer_soft.h firmware/fuxusb/tags/0.3.1/modules/usb/ firmware/fuxusb/tags/0.3.1/modules/usb/usb_task.c firmware/fuxusb/tags/0.3.1/modules/usb/usb_task.h firmware/fuxusb/tags/0.3.1/modules/usb_enum/ firmware/fuxusb/tags/0.3.1/modules/usb_enum/USB_ENUM.H firmware/fuxusb/tags/0.3.1/modules/usb_enum/usb_enum.c firmware/fuxusb/tags/0.3.1/usb_RFDongle.Uv2 firmware/fuxusb/tags/0.3.1/version.h Log: * Version 0.3.1 of fuxusb added directly as a tag as this code wasn't in SVN yet. It's the stable USB code released on production early 2007. This update adds versioning through standard tux commands. Property changes on: firmware/fuxusb/tags/0.3.1 ___________________________________________________________________ Name: svn:externals + common -r 677 http://svn.tuxisalive.com/firmware/tuxdefs Added: firmware/fuxusb/tags/0.3.1/bootloading.c =================================================================== --- firmware/fuxusb/tags/0.3.1/bootloading.c (rev 0) +++ firmware/fuxusb/tags/0.3.1/bootloading.c 2007-11-09 16:11:44 UTC (rev 678) @@ -0,0 +1,49 @@ +/* KySoH iTux agent + * + * Behavioural source code + * created on 2005/10/19 David Bourgeois + * -------------------------------------------------------- + * $Id: main.c 28 2006-01-12 16:51:01Z david $ + */ + +//#include "lib_mcu/twi/twi.h" +#include "bootloading.h" + +uint8_t Command_FromUSB_bootload_cmd; +uint8_t cpu_address; +uint8_t page_size; +uint8_t page_address; +uint8_t packets_per_page; +uint8_t address_idx; +uint8_t packet_idx; + +blHeader_t blHeader; /* header for bootloading */ + +/* + * Initialize i2c interface + */ +void blInit(void) +{ + i2cSetBitrate(); /* set TWI bitrate */ + i2cInit(); /* initialize TWI interface */ + blHeader.blData = &i2cSendData[2]; +} + +/* + * Sends the data stored in i2cSendData array. Only the + * 'dataLength' first bytes are sent. + * + * Prepare the i2c communication and store the page address in the + * i2c buffer. Status can be followed with i2cFlags.i2c_busy which + * is set when the communication is in progress and cleared when + * done. i2cFlags.s_val is set when the bootload has succeded. + */ +void blSendData(blHeader_t blHeader, uint8_t dataLength) +{ + i2cFlags.s_val = 0; + i2cDeviceAddrRW = blHeader.slave_address; + i2cSendData[0] = blHeader.page_address >> 8; /* the first 2 bytes of the i2c frame are the page address */ + i2cSendData[1] = blHeader.page_address; + i2cSendDataLength = dataLength + 2; + i2cMasterStart(); +} Added: firmware/fuxusb/tags/0.3.1/bootloading.h =================================================================== --- firmware/fuxusb/tags/0.3.1/bootloading.h (rev 0) +++ firmware/fuxusb/tags/0.3.1/bootloading.h 2007-11-09 16:11:44 UTC (rev 678) @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2006, C2ME S.A. + * All rights reserved. + * + * $Id:$ + */ + +#ifndef _BOOTLOADING_H_ +#define _BOOTLOADING_H_ + +#include "lib_c/stdint.h" +#include "i2c.h" +#include "config.h" + +/** USB bootloader commands */ +#define BOOT_INIT 1 +#define BOOT_FILLPAGE 2 +#define BOOT_EXIT 3 + +#define BOOTLOADER_CMD (uint8_t)0xF0 /* Bootloader status command */ + +/** + * \brief Bootloading header structure which holds all information to initiate + * a bootloading communication + */ +typedef struct blHeader_s { + /* 7 bits slave address aligned left + rw bit */ + uint8_t slave_address; + /* 16 bits address of the first byte of the page to write */ + uint16_t page_address; + /* page length in multiple of 64 bytes */ + uint8_t page_length; + /* pointer to the bootloader data */ + uint8_t xdata *blData; +} blHeader_t; + +extern blHeader_t blHeader; + +/* + * Extern declarations + */ + +void blInit(void); +void blSendData(blHeader_t blHeader, uint8_t dataLength); + +extern uint8_t Command_FromUSB_bootload_cmd; +extern uint8_t cpu_address; +extern uint8_t page_size; +extern uint8_t page_address; +extern uint8_t packets_per_page; +extern uint8_t address_idx; +extern uint8_t packet_idx; + +#endif /* _BOOTLOADING_H_ */ Added: firmware/fuxusb/tags/0.3.1/config.h =================================================================== --- firmware/fuxusb/tags/0.3.1/config.h (rev 0) +++ firmware/fuxusb/tags/0.3.1/config.h 2007-11-09 16:11:44 UTC (rev 678) @@ -0,0 +1,130 @@ +/*H************************************************************************** +* NAME: config.h +*---------------------------------------------------------------------------- +* Copyright (c) 2004 Atmel. +*---------------------------------------------------------------------------- +* PURPOSE: +* Describes the system dependant software configuration. +* This file is included by all source files in order to access to system wide +* configuration. +*---------------------------------------------------------------------------- +* $Id: config.h 482 2007-03-16 15:02:58Z david $ +*****************************************************************************/ + +#ifndef _CONFIG_H_ +#define _CONFIG_H_ + +/*_____ I N C L U D E S ____________________________________________________*/ +#include "version.h" +#include "lib_c/stdint.h" +#include "lib_mcu/compiler.h" +#include "lib_mcu/reg_5131.h" +#include "lib_mcu/ext_5131.h" +#include "lib_mcu/5131_drv.h" +#include <stdio.h> + +/*_____ M A C R O S ________________________________________________________*/ + + +//#define USB_ENUM_DEBUG +//#define MAIN_DEBUG +//#define USB_TASK_DEBUG +//#define BOOTLOAD_DEBUG + +#define DEBUG_1 P3_6 +#define DEBUG_2 P4_0 + +/*_____ D E F I N I T I O N ________________________________________________*/ + +// Board config +#define FOSC 24000 +#define CPUB_VERSION //#define FILE_BOARD_H "lib_board/c5131_evab.h" 0x0102 +#define X2_MODE // Allow use of c51 x2 mode feature + +#define SPI_Clock_Div8 + + +#define BAUDRATE 115200 // in bps +#define BDR_GENERATOR BRG_TIMER2 // Available value: BRG_INTERNAL, BRG_TIMER1, BRG_TIMER2 + + + +/*_____ D E F I N I T I O N ________________________________________________*/ + +/* USB Configuration */ + /* DEVICE DESCRIPTOR */ + + +#define EP_AUDIO_IN 1 +#define EP_AUDIO_OUT 2 +#define EP_AUDIO_OUT_TTS 3 +#define EP_CMD_IN 4 +#define EP_CMD_OUT 5 + + + +#define USB_SPECIFICATION 0x1001 +#define DEVICE_CLASS 0x00 +#define DEVICE_SUB_CLASS 0 +#define DEVICE_PROTOCOL 0 +#define EP_CONTROL_LENGTH 32 + +#define VENDOR_ID 0xEB03 /* Atmel vendor ID = 03EBh */ +#define PRODUCT_ID 0x07FF /* Product ID: FF07h*/ +#define RELEASE_NUMBER (0x0100*VER_UPDATE)+(0x1000*VER_MINOR)+(0x0001*VER_MAJOR) // 0x2021 //(VER_MAJOR)//((0x0000)|(VER_MAJOR<<24)|(VER_MINOR<<8)|(VER_UPDATE)) +#define NB_CONFIGURATION 1 + + + /* CONFIGURATION DESCRIPTOR */ +#define CONF_LENGTH 0xE800 // 232 +#define NB_INTERFACE 6 +#define CONF_NB 1 +#define CONF_ATTRIBUTES USB_CONFIG_BUSPOWERED +#define MAX_POWER 50 /* 100 mA */ + +#define LANG_ID 0x00 +#define LANGUAGE_ID 0x0904 + +#define EP_CONTROL 0x00 +#define EP_IN 0x01 +#define EP_KBD_IN EP_IN +#define EP_IN_LENGTH 64 +#define ENDPOINT_0 0x00 +#define ENDPOINT_1 0x81 + +#define RX_EP 2 +#define TX_EP 1 +#define TX_EP_SIZE 32 + + +/* STRING INDEX */ +/*******************************************/ + +#define MAN_STRING_INDEX 1 +#define PROD_STRING_INDEX 2 +#define SN_STRING_INDEX 3 +#define CONFIG_STRING_INDEX 4 + + +#define USB_MANUFACTURER_NAME {'K'<<8, 'y'<<8, 's'<<8, 'o'<<8, 'h'<<8} +#define USB_MN_LENGTH 5 + +#define USB_PRODUCT_NAME {'T'<<8, 'u'<<8, 'x'<<8, ' '<<8, 'D'<<8, \ + 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8} +#define USB_PN_LENGTH 9 + +#define USB_SERIAL_NUMBER {'1'<<8, '0'<<8, '0'<<8, '0'<<8, '1'<<8} +#define USB_SN_LENGTH 5 + + +#define USB_CONFIG_NAME {'T'<<8, 'u'<<8, 'x'<<8, ' '<<8, 'D'<<8, \ + 'r'<<8, 'o'<<8, 'i'<<8, 'd'<<8} +#define USB_CONFIG_LENGTH 9 + +#define LANG_ID 0x00 +#define LANGUAGE_ID 0x0904 + +/*_____ D E C L A R A T I O N ______________________________________________*/ + + +#endif /* _CONFIG_H_ */ Added: firmware/fuxusb/tags/0.3.1/global.c =================================================================== --- firmware/fuxusb/tags/0.3.1/global.c (rev 0) +++ firmware/fuxusb/tags/0.3.1/global.c 2007-11-09 16:11:44 UTC (rev 678) @@ -0,0 +1,95 @@ +/*C************************************************************************** +* NAME: global.c +*---------------------------------------------------------------------------- +* Copyright (c) 2006 C2me. +*---------------------------------------------------------------------------- +* RELEASE: c5131-usb-RF Dongle +* REVISION: 1.3 +*---------------------------------------------------------------------------- +* PURPOSE: +*---------------------------------------------------------------------------- +* $Id: global.c 481 2007-03-09 14:36:33Z raphael $ +*****************************************************************************/ + +#include "global.h" + +#include "version.h" + + + + +/*_____ M A C R O S ________________________________________________________*/ + +/*_____ D E F I N I T I O N ________________________________________________*/ + +/*_____ D E C L A R A T I O N ______________________________________________*/ + + + +//------------------------------------------------------- +// SPI Controler +//------------------------------------------------------- +bit spi_task_on_Flag; // = 1; // to turn ON the RF Task + // = 0; // to turn OFF the RF Task +//------------------------------------------------------- +// USB Controler +//------------------------------------------------------- +unsigned int usb_sof_counter; +unsigned char usb_configuration_nb; +bit usb_connected_Flag; + +bit CMD_OUT_usb_Bank; // To store the number of the Bank used for the CMD_OUT Endpoint +char CMD_IN_Bank_Nb; + +bit USB_ParserProcess_Permit_Flag; +bit USB_StatusProcess_Permit_Flag; +bit USB_Status_NewCmd_Flag; +//------------------------------------------------------- +// I2C Controler +//------------------------------------------------------- + +unsigned char i2c_wait_counter = 0; +bit i2c_task_on_Flag; + +//------------------------------------------------------- +// RF Controler +//------------------------------------------------------- +// RF Header +//------------------------------------------------------- + +#define RF_2FRAMES_HDR 0x80 +#define RF_AUDIO_HDR 0x02 +#define RF_CMD_HDR 0x08 + +//------------------------------------------------------- + +bit RF_OFFLine_Back; +unsigned char RF_Status; +unsigned char RF_Status_Temp; + +unsigned int spi_watchdog_ctr; + +//------------------------------------------------------- +// Tux Command and Status +//------------------------------------------------------- + + // From USB + //------------------------------------------------------- +unsigned char USBCommand_ForDongle[65]; // For Dongle +unsigned char USBCommand_ForRF[65]; // For RF +unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB +bit USBCommand_NewRequest_Flag; +unsigned char USBCommand_Header; // Needed to analyze the LIBUSB command : to RF or to I2C + + #define LIBUSB_TUX_CMD_HDR 0 + #define LIBUSB_DONGLE_CMD_HDR 1 + #define LIBUSB_BOOTLOADER_CMD_HDR 2 + +//------------------------------------------------------- +// Dongle Info +//------------------------------------------------------- + +code version_t info_version ={VERSION_CMD, CPU_VER_JOIN(FUXUSB_CPU_NUM, VER_MAJOR), VER_MINOR, VER_UPDATE}; +code revision_t info_revision={REVISION_CMD, REVISION_NUMBER, RELEASE_TYPE}; +code author_t info_author={AUTHOR_CMD, AUTHOR_ID, VARIATION}; + Added: firmware/fuxusb/tags/0.3.1/global.h =================================================================== --- firmware/fuxusb/tags/0.3.1/global.h (rev 0) +++ firmware/fuxusb/tags/0.3.1/global.h 2007-11-09 16:11:44 UTC (rev 678) @@ -0,0 +1,110 @@ +/*C************************************************************************** +* NAME: global.h +*---------------------------------------------------------------------------- +* Copyright (c) 2006 C2me. +*---------------------------------------------------------------------------- +* RELEASE: c5131-usb-RF Dongle +* REVISION: 1.3 +*---------------------------------------------------------------------------- +* PURPOSE: +* +*****************************************************************************/ + + + +#ifndef _GLOBAL_H_ +#define _GLOBAL_H_ + +#include "common\api.h" +#include "common\defines.h" +#include "common\commands.h" + +/*_____ M A C R O S ________________________________________________________*/ + +/*_____ D E F I N I T I O N ________________________________________________*/ + +// Hardware +#define rf_reset_signal P0_1 +#define RF_OFFLINE P2_3 + + +/*_____ D E C L A R A T I O N ______________________________________________*/ + +extern unsigned int Sleep_Ctr; +//------------------------------------------------------- +// SPI Controler +//------------------------------------------------------- +extern bit spi_task_on_Flag; // = 1; // to turn ON the RF Task + // = 0; // to turn OFF the RF Task +extern unsigned int spi_watchdog_ctr; +#define SPI_WATCHDOG_MAX (6000) + + +//------------------------------------------------------- +// USB Controler +//------------------------------------------------------- +extern unsigned int usb_sof_counter; +extern unsigned char usb_configuration_nb; +extern bit usb_connected_Flag; + +extern bit CMD_OUT_usb_Bank; // To store the number of the Bank used for the CMD_OUT Endpoint +extern char CMD_IN_Bank_Nb; + +extern bit USB_ParserProcess_Permit_Flag; +extern bit USB_StatusProcess_Permit_Flag; +extern bit USB_Status_NewCmd_Flag; + +//------------------------------------------------------- +// I2C Controler +//------------------------------------------------------- + +extern unsigned char i2c_wait_counter; +extern bit i2c_task_on_Flag; + +//------------------------------------------------------- +// RF Controler +//------------------------------------------------------- +// RF Header +//------------------------------------------------------- + +#define RF_2FRAMES_HDR 0x80 +#define RF_AUDIO_HDR 0x02 +#define RF_CMD_HDR 0x08 + +//------------------------------------------------------- + +extern bit RF_OFFLine_Back; +extern unsigned char RF_Status; +extern unsigned char RF_Status_Temp; + +//------------------------------------------------------- +// Tux Command and Status +//------------------------------------------------------- + + + + // From USB + //------------------------------------------------------- +extern unsigned char USBCommand_ForRF[]; // Store the USB Command +extern unsigned char USBCommand_ForDongle[]; // For Dongle +extern unsigned char USBCommand_Ctr; // Store the number of byte sent by the LIBUSB + +extern bit USBCommand_NewRequest_Flag; +extern unsigned char USBCommand_Header; // Needed to analyze the LIBUSB command : to RF or to I2C + + + #define LIBUSB_TUX_CMD_HDR 0 + #define LIBUSB_DONGLE_CMD_HDR 1 + #define LIBUSB_BOOTLOADER_CMD_HDR 2 + + + +//------------------------------------------------------- +// Dongle Info +//------------------------------------------------------- + +extern code version_t info_version; +extern code revision_t info_revision; +extern code author_t info_author; + +#endif /* _GLOBAL_H_ */ Added: firmware/fuxusb/tags/0.3.1/i2c.c =================================================================== --- firmware/fuxusb/tags/0.3.1/i2c.c (rev 0) +++ firmware/fuxusb/tags/0.3.1/i2c.c 2007-11-09 16:11:44 UTC (rev 678) @@ -0,0 +1,301 @@ +#include "i2c.h" + +#define I2C_DEBUG 0 + +/* + * DEBUG + */ +//#define __debug__ + +/* I2C status and address variables */ +uint8_t i2cDeviceAddrRW; +volatile I2C_FLAGS i2cFlags; +/* send/transmit buffer (outgoing data) */ +uint8_t xdata i2cSendData[I2C_SEND_DATA_BUFFER_SIZE]; +uint8_t *i2cDataToSend; +uint8_t i2cSendDataIndex; +uint8_t i2cSendDataLength; +/* receive buffer (incoming data) */ +uint8_t xdata i2cReceiveData[I2C_RECEIVE_DATA_BUFFER_SIZE]; +uint8_t i2cReceiveDataIndex; +uint8_t i2cReceiveDataLength; + +/* function pointer to i2c receive routine */ +/* I2cSlaveReceive is called when this processor is addressed as a slave for + * writing */ +static void (*i2cSlaveReceive)(uint8_t receiveDataLength, uint8_t* recieveData); +/* I2cSlaveTransmit is called when this processor is addressed as a slave for + * reading */ +static uint8_t (*i2cSlaveTransmit)(uint8_t transmitDataLengthMax, uint8_t* transmitData); + +/* functions */ + +/* + * Set the TWI transaction bitrate + */ +void i2cSetBitrate(void) +{ + /* Setting SSCON based on TWI_SCAL defined in i2c.h */ + SSCON = TWI_SCAL_VALUE; /* twi intialisation */ +} + +/* + * This function initializes the TWI interface for i2c communication. You + * should use the definitions in i2c.h to select the mode you want. + * + * Note that you should set the i2cSlaveReceive and i2cSlaveTransmit handlers + * after this initialization otherwise they'll be cleared. + */ +void i2cInit(void) +{ + /* Set up twi */ + SSCON = TWI_SSIE | TWI_SCAL_VALUE; /* enable TWI */ +#ifdef TWI_INT_ENABLED + Enable_twi_interrupt(); +#endif + +#ifdef TWI_SLA_ENABLED /* If Slave mode: */ + /* Set local device address (used in slave mode only) */ + SSADR = I2C_SLA_ADD; + + /* Enabling Slave mode */ + TWI_SET_AA(); /* enable TWI ACK */ + i2cSlaveReceive = 0; /* XXX do we need those 2 lines? clear SlaveReceive and SlaveTransmit handler to null */ + i2cSlaveTransmit = 0; +#endif + +#ifdef TWI_M_ENABLED +#endif +} + +/* Set the user function which handles receiving (incoming) data as a slave */ +void i2cSetSlaveReceiveHandler(void (*i2cSlaveRx_func)(uint8_t receiveDataLength, uint8_t* recieveData)) +{ + i2cSlaveReceive = i2cSlaveRx_func; +} + +/* Set the user function which handles transmitting (outgoing) data as a slave */ +void i2cSetSlaveTransmitHandler(uint8_t (*i2cSlaveTx_func)(uint8_t transmitDataLengthMax, uint8_t* transmitData)) +{ + i2cSlaveTransmit = i2cSlaveTx_func; +} + +void i2cSendStart(void); +/* Start a Master transmission, i2cSendDataIndex is reset automatically here */ +void i2cMasterStart(void) +{ + i2cFlags.i2c_busy = 1; + i2cSendDataIndex = 0; /* don't forget to reset the index */ + i2cSendStart(); +} + +void i2cSendStart(void) +{ + TWI_SET_START(); +} + +void i2cSendStop(void) +{ + TWI_SET_STOP(); + i2cFlags.i2c_busy = 0; +} + +void i2cSendByte(uint8_t _data) +{ + SSDAT = _data; +} + +void i2cAckReceiveByte(void) +{ + TWI_SET_AA(); +} + +void i2cNackReceiveByte(void) +{ + TWI_CLEAR_AA(); +} + +#define TW_DATA SSDAT +uint8_t i2cGetReceivedByte(void) +{ + return SSDAT; +} + +uint8_t i2cGetStatus(void) +{ + return TW_STATUS; +} + +#ifdef __debug__ +uint8_t i2cStatus[20]; /* debug only */ +uint8_t i2cStatusIdx = 0; +#endif + +/* TWI interrupt service routine */ +#ifdef TWI_INT_ENABLED +void it_TWI(void) interrupt IRQ_TWI using 1 +{ +#ifdef __debug__ + i2cStatus[i2cStatusIdx++] = TW_STATUS; + if (i2cStatusIdx == 20) i2cStatusIdx = 0; +#endif + + + switch (TW_STATUS) + { + /* * * Master General * * */ + case TW_START: // 0x08: Sent start condition + case TW_REP_START: // 0x10: Sent repeated start condition +#if I2C_DEBUG +#endif + // send device address + TWI_CLEAR_START(); /* clear start condition */ + i2cSendByte(i2cDeviceAddrRW); + break; + + + /* * * Master Transmitter & Receiver status codes * * */ + + case TW_MT_SLA_ACK: // 0x18: Slave address acknowledged + case TW_MT_DATA_ACK: // 0x28: Data acknowledged +#if I2C_DEBUG +#endif + if(i2cSendDataIndex < i2cSendDataLength) + { + + i2cSendByte( i2cSendData[i2cSendDataIndex++] ); /* send data */ + } + else + { + i2cSendStop(); /* End of data stream */ + i2cFlags.s_val = 1; + } + break; + case TW_MR_DATA_NACK: // 0x58: Data received, NACK reply issued +#if I2C_DEBUG +#endif + i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; // store final received data byte + /* no break, continue to transmit STOP condition */ + case TW_MR_SLA_NACK: // 0x48: Slave address not acknowledged + case TW_MT_SLA_NACK: // 0x20: Slave address not acknowledged + case TW_MT_DATA_NACK: // 0x30: Data not acknowledged +#if I2C_DEBUG +#endif + i2cFlags.mt_nack = 1; + i2cSendStop(); + break; + case TW_MT_ARB_LOST: // 0x38: Bus arbitration lost + //case TW_MR_ARB_LOST: // 0x38: Bus arbitration lost +#if I2C_DEBUG +#endif + i2cInit(); + break; + case TW_MR_DATA_ACK: // 0x50: Data acknowledged +#if I2C_DEBUG +#endif + // store received data byte + i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; + // fall-through to see if more bytes will be received + case TW_MR_SLA_ACK: // 0x40: Slave address acknowledged +#if I2C_DEBUG +#endif + if(i2cReceiveDataIndex < (i2cReceiveDataLength-1)) + i2cAckReceiveByte(); /* receive more bytes */ + else + i2cNackReceiveByte(); /* receive the last byte */ + break; + + + /* * * Slave Receiver status codes * * */ + + case TW_SR_SLA_ACK: // 0x60: own SLA+W has been received, ACK has been returned + case TW_SR_ARB_LOST_SLA_ACK: // 0x68: own SLA+W has been received, ACK has been returned + case TW_SR_GCALL_ACK: // 0x70: GCA+W has been received, ACK has been returned + case TW_SR_ARB_LOST_GCALL_ACK: // 0x78: GCA+W has been received, ACK has been returned +#if I2C_DEBUG +#endif + /* we are being addressed as slave for writing (data will be received from master) */ + i2cFlags.i2c_busy = 1; + i2cReceiveDataIndex = 0; + i2cFlags.s_nack = 0; /* reset nack flag here, not in user app */ + i2cAckReceiveByte(); /* accept data */ + break; + case TW_SR_DATA_ACK: // 0x80: data byte has been received, ACK has been returned + case TW_SR_GCALL_DATA_ACK: // 0x90: data byte has been received, ACK has been returned +#if I2C_DEBUG +#endif + i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; /* get received data byte */ + /* check receive buffer status */ + if(i2cReceiveDataIndex < I2C_RECEIVE_DATA_BUFFER_SIZE) + { + i2cAckReceiveByte(); /* accept more data */ + } + else + { + i2cNackReceiveByte(); /* refuse more data */ + } + break; + case TW_SR_DATA_NACK: // 0x88: data byte has been received, NACK has been returned + case TW_SR_GCALL_DATA_NACK: // 0x98: data byte has been received, NACK has been returned +#if I2C_DEBUG +#endif + //i2cReceiveData[i2cReceiveDataIndex++] = TW_DATA; /* receive last byte XXX check if this is right */ + //i2cNackReceiveByte(); //XXX bug here? // receive data byte and return NACK + //i2cAckReceiveByte(); [> I should clear the interrupt and enable acknoledge for slave mode (disabled during previous nack) <] + i2cFlags.s_nack = 1; /* XXX check if this flag is reset in all possible conditions */ + //break; + /* pass along to restart slave mode */ + case TW_SR_STOP: // 0xA0: STOP or REPEATED START has been received while addressed as slave +#if I2C_DEBUG +#endif + i2cInit(); /* enable TWI ACK */ + if(i2cSlaveReceive) i2cSlaveReceive(i2cReceiveDataIndex, i2cReceiveData); /* i2c receive is complete, call i2cSlaveReceive */ + i2cFlags.i2c_busy = 0; /* XXX check if this flag is reset in all possible conditions */ + break; + + + /* * * Slave Transmitter * * */ + + case TW_ST_SLA_ACK: // 0xA8: own SLA+R has been received, ACK has been returned + case TW_ST_ARB_LOST_SLA_ACK: // 0xB0: GCA+R has been received, ACK has been returned +#if I2C_DEBUG +#endif + // we are being addressed as slave for reading (data must be transmitted back to master) + // request data from application + if(i2cSlaveTransmit) i2cSendDataLength = i2cSlaveTransmit(I2C_SEND_DATA_BUFFER_SIZE, i2cSendData); + i2cSendDataIndex = 0; /* reset data index */ + /* fall-through to transmit first data byte */ + case TW_ST_DATA_ACK: // 0xB8: data byte has been transmitted, ACK has been received +#if I2C_DEBUG +#endif + TW_DATA = i2cSendData[i2cSendDataIndex++]; /* transmit data byte */ + if(i2cSendDataIndex < i2cSendDataLength) + i2cAckReceiveByte(); /* expect ACK to data byte */ + else + i2cNackReceiveByte(); /* expect NACK to data byte */ + break; + case TW_ST_DATA_NACK: // 0xC0: data byte has been transmitted, NACK has been received + case TW_ST_LAST_DATA: // 0xC8: last data byte transmitted, ACK received +#if I2C_DEBUG +#endif + /* all done, switch to open slave */ + i2cInit(); /* enable TWI ACK */ + break; + + + /* * * Misc * * */ + + case TW_NO_INFO: // 0xF8: No relevant state information + /* do nothing */ +#if I2C_DEBUG +#endif + break; + case TW_BUS_ERROR: // 0x00: Bus error due to illegal start or stop condition +#if I2C_DEBUG +#endif + i2cSendStop(); /* reset internal hardware and release bus */ + break; + } + TWI_CLEAR_SI(); +} +#endif Added: firmware/fuxusb/tags/0.3.1/i2c.h =================================================================== --- firmware/fuxusb/tags/0.3.1/i2c.h (rev 0) +++ firmware/fuxusb/tags/0.3.1/i2c.h 2007-11-09 16:11:44 UTC (rev 678) @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2006, C2ME S.A. + * All rights reserved. + * + * $Id:$ + */ + +#ifndef _I2C_H_ +#define _I2C_H_ + +#include "lib_c/stdint.h" +#include "lib_mcu/twi/twi.h" +#include "config.h" + +#ifdef __debug__ +extern uint8_t i2cStatus[20]; /* XXX debug only */ +extern uint8_t i2cStatusIdx; +#endif + +/* * * include custom configuration here * * */ + +#define I2C_SEND_DATA_BUFFER_SIZE 130 +#define I2C_RECEIVE_DATA_BUFFER_SIZE 8 + +/* + * Choose operation mode, comment/uncomment lines + * For Slave only operation, choose Master and Slave + */ +#define TWI_INT_ENABLED /* comment if you don't want twi interrupts */ +#define TWI_M_ENABLED /* comment if you don't want twi master mode */ +//#define TWI_SLA_ENABLED /* comment if you don't want twi slave mode */ + +/* SSADR: TWI (Slave) Address Register + * Bits 7..1 : TWI (Slave) Address Register + * Bit 0 : TWI General Call Recognition Enable Bit */ +#define I2C_SLA_ADD ((0X55<<1) | 0x01) /* Only necessary in slave mode */ + +/* + * Initialise TWI clock + * + * Here we set SCL frequency in Master mode by defining TWI_SCAL: + * SCL_freq = F_CPU/TWI_SCAL + * + * TWI_SCAL value should be one of: 256 224 192 160 960 120 60 + */ + +//#define TWI_SCAL 160 /* TWI_SCAL value should be: 256 224 192 160 960 120 60 */ +#define TWI_SCAL 960 /* TWI_SCAL value should be: 256 224 192 160 960 120 60 */ + +/* * * END of code customisation * * */ + +#if TWI_SCAL == 256 +#define TWI_SCAL_VALUE TWI_RATIO_256 +#elif TWI_SCAL == 224 +#define TWI_SCAL_VALUE TWI_RATIO_224 +#elif TWI_SCAL == 192 +#define TWI_SCAL_VALUE TWI_RATIO_192 +#elif TWI_SCAL == 160 +#define TWI_SCAL_VALUE TWI_RATIO_160 +#elif TWI_SCAL == 960 +#define TWI_SCAL_VALUE TWI_RATIO_960 +#elif TWI_SCAL == 120 +#define TWI_SCAL_VALUE TWI_RATIO_120 +#elif TWI_SCAL == 60 +#define TWI_SCAL_VALUE TWI_RATIO_60 +#else +#error Incorrect TWI_SCAL value, should be: 256 224 192 160 960 120 60 +#define TWI_SCAL_VALUE +#endif + +/*! defines and constants */ +#define TWCR_CMD_MASK 0x0F + +/* + * Bits that are set inside interrupt routines, and watched outside in + * the program's main loop. + */ +typedef struct +{ + uint8_t i2c_busy: 1; /* set when twi hardware is busy, cleared after an i2c stop */ + uint8_t mt_nack: 1; /* error due to a nack received by the master transmitter */ + uint8_t s_nack: 1; /* error due to a nack replied by the slave */ + uint8_t sr_end: 1; /* set at the end of a receiver slave transmission if i2cSlaveReceive has not been defined */ + uint8_t st_end: 1; /* set at the end of a transmitter slave transmission if i2cSlaveTransmit has not been defined */ + uint8_t i2c_idx: 1; /* application side - can be used for data indexes status */ + uint8_t s_val: 1; /* application side - can be used for data validation */ +} +I2C_FLAGS; +extern volatile I2C_FLAGS i2cFlags; + +/*! types */ +typedef enum +{ + I2C_IDLE = 0, I2C_BUSY = 1, + I2C_MASTER_TX = 2, I2C_MASTER_RX = 3, + I2C_SLAVE_TX = 4, I2C_SLAVE_RX = 5 +} eI2cStateType; + +/* I2C state and address variables */ +extern uint8_t i2cDeviceAddrRW; +/* send/transmit buffer (outgoing data) */ +extern uint8_t xdata i2cSendData[]; +extern uint8_t i2cSendDataIndex; +extern uint8_t i2cSendDataLength; +/* receive buffer (incoming data) */ +extern uint8_t xdata i2cReceiveData[]; +extern uint8_t i2cReceiveDataIndex; +extern uint8_t i2cReceiveDataLength; + +/* Functions */ +void i2cSetBitrate(void); +void i2cInit(void); +void i2cSetSlaveReceiveHandler(void (*i2cSlaveRx_func)(uint8_t receiveDataLength, uint8_t* recieveData)); +void i2cSetSlaveTransmitHandler(uint8_t (*i2cSlaveTx_func)(uint8_t transmitDataLengthMax, uint8_t* transmitData)); +void i2cMasterStart(void); + +#endif + Added: firmware/fuxusb/tags/0.3.1/lib_board/c5131_evab.h =================================================================== --- firmware/fuxusb/tags/0.3.1/lib_board/c5131_evab.h (rev 0) +++ firmware/fuxusb/tags/0.3.1/lib_board/c5131_evab.h 2007-11-09 16:11:44 UTC (rev 678) @@ -0,0 +1,51 @@ +/*H************************************************************************** +* NAME: c5131_evab.h +*---------------------------------------------------------------------------- +* Copyright (c) 2004 Atmel. +*---------------------------------------------------------------------------- +* RELEASE: c5131-usb-cdc-1_0_2 +* REVISION: 1.8 +*---------------------------------------------------------------------------- +* PURPOSE: +* Configuration file. Selection of the device. +*****************************************************************************/ +#ifndef _C5131_EVAB_H +#define _C5131_EVAB_H + +/*_____ D E F I N I T I O N S ______________________________________________*/ +#define GENEB_BUZZER P1_5 // CPU I/O Port connected to GENEB Buzzer Pin or mute +#define GENEB_BP1 P3_2 // CPU I/O Port connected to GENEB BP1 + +#define GENEB_TWI_IT P3_2 // Port I/O IT pin of CPU connected to GENEB TWI_IT Pin +#define GENEB_SDA P1_1 +#define GENEB_SCL P1_0 + +#define GENEB_A16 P3_4 // CPU I/O Port connected to GENEB A16 +#define GENEB_CS_RAM P1_2 +#define GENEB_CS_FLASH P1_3 +#define GENEB_ISP_FLASH P1_4 + +#define RST_ETH P1_5 +#define CS_ETH P3_5 + +#define CPUb_enable_all_leds() (AUXR&=~1,P3_0=0,P3_1=0,P4_0=0,P4_1=0,P1_5=0) +#define CPUb_disable_all_leds() (AUXR|=1,P3_0=1,P3_1=1,P4_0=1,P4_1=1,P1_5=1) +#define Geneb_enable_ram() (GENEB_ISP_FLASH=1,CS_ETH=1,GENEB_CS_RAM=0) +#define Geneb_disable_ram() (GENEB_CS_RAM=1) +#define Geneb_enable_isp() (GENEB_ISP_FLASH=0,GENEB_CS_FLASH=1) +#define Geneb_disable_isp() (GENEB_ISP_FLASH=1) + +/*_____ I N C L U D E S ____________________________________________________*/ +#ifdef GENEB_VERSION +#include "lib_board/geneb.h" +#endif + + +/*_____ M A C R O S ________________________________________________________*/ + +/*_____ D E C L A R A T I O N S ____________________________________________*/ + +#endif /* _C5131_EVAB_H */ + + + Added: firmware/fuxusb/tags/0.3.1/lib_board/kbd_drv.c =================================================================== --- firmware/fuxusb/tags/0.3.1/lib_board/kbd_drv.c (rev 0) +++ firmware/fuxusb/tags/0.3.1/lib_board/kbd_drv.c 2007-11-09 16:11:44 UTC (rev 678) @@ -0,0 +1,68 @@ +/*C************************************************************************** +* NAME: kbd_drv.c +*---------------------------------------------------------------------------- +* Copyright (c) 2004 Atmel. +*---------------------------------------------------------------------------- +* RELEASE: c5131-usb-cdc-1_0_2 +* REVISION: 1.1 +*---------------------------------------------------------------------------- +* PURPOSE: +* This file contains C functions to control: +* SWITCHES +*****************************************************************************/ + +/*_____ I N C L U D E S ____________________________________________________*/ +#include "config.h" +#include "kbd_drv.h" + +/*_____ M A C R O S ________________________________________________________*/ + +/*_____ D E F I N I T I O N S ______________________________________________*/ +#define KBD_COL_MASK 0x0F +#define KBD_COL0 0x08 +#define KBD_COL1 0x04 +#define KBD_COL2 0x02 +#define KBD_COL3 0x01 +#define KBD_ROW_MASK 0xF0 +#define KBD_ROW0 0x10 +#define KBD_ROW1 0x20 +#define KBD_ROW2 0x40 +#define KBD_ROW3 0x80 + +#define DEFAULT_SWITCHES_VALUE 0xFF +#define DEFAULT_SCAN_KEY_VALUE 0 +/*_____ D E C L A R A T I O N S ____________________________________________*/ + + +/*V************************************************************************** +* NAME: scan_key +*---------------------------------------------------------------------------- +* PURPOSE: +* scan_key is a structure allowing easy byte/word access (Union16). +* 16 keys on keypad in a 16-bit variable => all cases supported +* Ex. for geneb: +* MSb LSb +* 9 5 1 < * 6 2 > 0 7 3 V # 8 4 C +*****************************************************************************/ +volatile Union16 idata scan_key; +Byte code geneb_keys[]= { 'C', '4', '8', '#', + 'V', '3', '7', '0', + '>', '2', '6', '*', + '<', '1', '5', '9' }; +void kbd_test_hit (void) +{ + + +} + + +bit kbd_init (void) +{ + return 0; +} + + + + + + Added: firmware/fuxusb/tags/0.3.1/lib_board/kbd_drv.h =================================================================== --- firmware/fuxusb/tags/0.3.1/lib_board/kbd_drv.h (rev 0) +++ firmware/fuxusb/tags/0.3.1/lib_board/kbd_drv.h 2007-11-09 16:11:44 UTC (rev 678) @@ -0,0 +1,49 @@ +/*H************************************************************************** +* NAME: kbd_drv.h +*---------------------------------------------------------------------------- +* Copyright (c) 2004 Atmel. +*---------------------------------------------------------------------------- +* RELEASE: c5131-usb-cdc-1_0_2 +* REVISION: 1.1 +*---------------------------------------------------------------------------- +* PURPOSE: +* Include file of twi_common.c file +*****************************************************************************/ +#ifndef _KBD_DRV_H +#define _KBD_DRV_H + +/*_____ I N C L U D E S ____________________________________________________*/ +#include FILE_BOARD_H + +/*_____ M A C R O S ________________________________________________________*/ +//#ifdef USE_TWI_INTERRUPT + +/*F************************************************************************** +* NAME: get_switches +*---------------------------------------------------------------------------- +* PARAMS: none +* return: Uchar: switches value +*---------------------------------------------------------------------------- +* PURPOSE: +* 0=SWITCH ON, 1= SWITCH OFF, MSB =SWITCH 8, LSB = SWITCH 1 +*---------------------------------------------------------------------------- +* EXAMPLE: +*---------------------------------------------------------------------------- +* NOTE: +*---------------------------------------------------------------------------- +* REQUIREMENTS: +*****************************************************************************/ + + +/*_____ D E C L A R A T I O N S ____________________________________________*/ + +#define ROW_PORT KBF +#define ROW_ALL ((KBF & 0xF0)>>4) + +#define SELECT_COLUMN 0 /*the active level is 0*/ +#define FREE_COLUMN 1 + +/*FUNCTION PROTOTYPES*/ + +#endif /* _KBD_DRV_H */ + Added: firmware/fuxusb/tags/0.3.1/lib_c/stdint.h =================================================================== --- firmware/fuxusb/tags/0.3.1/lib_c/stdint.h (rev 0) +++ firmware/fuxusb/tags/0.3.1/lib_c/stdint.h 2007-11-09 16:11:44 UTC (rev 678) @@ -0,0 +1,560 @@ +/* + * ISO/IEC 9899:1999 7.18 Integer types <stdint.h> + */ + +#ifndef __STDINT_H_ +#define __STDINT_H_ + +/** \defgroup avr_stdint <stdint.h>: Standard Integer Types + \code #include <stdint.h> \endcode + + Use [u]intN_t if you need exactly N bits. + + Since these typedefs are mandated by the C99 standard, they are preferred + over rolling your own typedefs. */ + +/* Integer types */ + +/** \name Exact-width integer types + Integer types having exactly the specified width */ + +/*@{*/ + +/** \ingroup avr_stdint + 8-bit signed type. */ + +typedef signed char int8_t; + +/** \ingroup avr_stdint + 8-bit unsigned type. */ + +typedef unsigned char uint8_t; + +/** \ingroup avr_stdint + 16-bit signed type. */ + +typedef signed int int16_t; + +/** \ingroup avr_stdint + 16-bit unsigned type. */ + +typedef unsigned int uint16_t; + +/** \ingroup avr_stdint + 32-bit signed type. */ + +typedef signed long int int32_t; + +/** \ingroup avr_stdint + 32-bit unsigned type. */ + +typedef unsigned long int uint32_t; + +/** \ingroup avr_stdint + 64-bit signed type. */ + +// typedef signed long long int int64_t; + +/** \ingroup avr_stdint + 64-bit unsigned type. */ + +// typedef unsigned long long int uint64_t; + +/*@}*/ + +/** \name Integer types capable of holding object pointers + These allow you to declare variables of the same size as a pointer. */ + +/*@{*/ + +/** \ingroup avr_stdint + Signed pointer compatible type. */ + +typedef int16_t intptr_t; + +/** \ingroup avr_stdint + Unsigned pointer compatible type. */ + +typedef uint16_t uintptr_t; + +/*@}*/ + +/** \name Minimum-width integer types + Integer types having at least the specified width */ + +/*@{*/ + +/** \ingroup avr_stdint + signed int with at least 8 bits. */ + +typedef int8_t int_least8_t; + +/** \ingroup avr_stdint + unsigned int with at least 8 bits. */ + +typedef uint8_t uint_least8_t; + +/** \ingroup avr_stdint + signed int with at least 16 bits. */ + +typedef int16_t int_least16_t; + +/** \ingroup avr_stdint + unsigned int with at least 16 bits. */ + +typedef uint16_t uint_least16_t; + +/** \ingroup avr_stdint + signed int with at least 32 bits. */ + +typedef int32_t int_least32_t; + +/** \ingroup avr_stdint + unsigned int with at least 32 bits. */ + +typedef uint32_t uint_least32_t; + +/** \ingroup avr_stdint + signed int with at least 64 bits. */ + +// typedef int64_t int_least64_t; + +/** \ingroup avr_stdint + unsigned int with at least 64 bits. */ + +// typedef uint64_t uint_least64_t; + +/*@}*/ + + +/** \name Fastest minimum-width integer types + Integer types being usually fastest having at least the specified width */ + +/*@{*/ + +/** \ingroup avr_stdint + fastest signed int with at least 8 bits. */ + +typedef int8_t int_fast8_t; + +/** \ingroup avr_stdint + fastest unsigned int with at least 8 bits. */ + +typedef uint8_t uint_fast8_t; + +/** \ingroup avr_stdint + fastest signed int with at least 16 bits. */ + +typedef int16_t int_fast16_t; + +/** \ingroup avr_stdint + fastest unsigned int with at least 16 bits. */ + +typedef uint16_t uint_fast16_t; + +/** \ingroup avr_stdint + fastest signed int with at least 32 bits. */ + +typedef int32_t int_fast32_t; + +/** \ingroup avr_stdint + fastest unsigned int with at least 32 bits. */ + +typedef uint32_t uint_fast32_t; + +/** \ingroup avr_stdint + fastest signed int with at least 64 bits. */ + +// typedef int64_t int_fast64_t; + +/** \ingroup avr_stdint + fastest unsigned int with at least 64 bits. */ + +// typedef uint64_t uint_fast64_t; + +/*@}*/ + + +/** \name Greatest-width integer types + Types designating integer data capable of representing any value of + any integer type in the corresponding signed or unsigned category */ + +/*@{*/ + +/** \ingroup avr_stdint + largest signed int available. */ + +// typedef int64_t intmax_t; + +/** \ingroup avr_stdint + largest unsigned int available. */ + +// typedef uint64_t uintmax_t; + +/*@}*/ + +/* Helping macro */ +#ifndef __CONCAT +#define __CONCATenate(left, right) left ## right +#define __CONCAT(left, right) __CONCATenate(left, right) +#endif + +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) + +/** \name Limits of specified-width integer types + C++ implementations should define these macros only when + __STDC_LIMIT_MACROS is defined before <stdint.h> is included */ + +/*@{*/ + +/** \ingroup avr_stdint + largest positive value an int8_t can hold. */ + +#define INT8_MAX 0x7f + +/** \ingroup avr_stdint + smallest negative value an int8_t can hold. */ + +#define INT8_MIN (-INT8_MAX - 1) + +/** \ingroup avr_stdint + largest value an uint8_t can hold. */ + +#define UINT8_MAX (__CONCAT(INT8_MAX, U) * 2U + 1U) + +/** \ingroup avr_stdint + largest positive value an int16_t can hold. */ + +#define INT16_MAX 0x7fff + +/** \ingroup avr_stdint + smallest negative value an int16_t can hold. */ + +#define INT16_MIN (-INT16_MAX - 1) + +/** \ingroup avr_stdint + largest value an uint16_t can hold. */ + +#define UINT16_MAX (__CONCAT(INT16_MAX, U) * 2U + 1U) + +/** \ingroup avr_stdint + largest positive value an int32_t can hold. */ + +#define INT32_MAX 0x7fffffffL + +/** \ingroup avr_stdint + smallest negative value an int32_t can hold. */ + +#define INT32_MIN (-INT32_MAX - 1L) + +/** \ingroup avr_stdint + largest value an uint32_t can hold. */ + +#define UINT32_MAX (__CONCAT(INT32_MAX, U) * 2UL + 1UL) + +/** \ingroup avr_stdint + largest positive value an int64_t can hold. */ + +#define INT64_MAX 0x7fffffffffffffffLL + +/** \ingroup avr_stdint + smallest negative value an int64_t can hold. */ + +#define INT64_MIN (-INT64_MAX - 1LL) + +/** \ingroup avr_stdint + largest value an uint64_t can hold. */ + +#define UINT64_MAX (__CONCAT(INT64_MAX, U) * 2ULL + 1ULL) + +/*@}*/ + +/** \name Limits of minimum-width integer types */ +/*@{*/ + +/** \ingroup avr_stdint + largest positive value an int_least8_t can hold. */ + +#define INT_LEAST8_MAX INT8_MAX + +/** \ingroup avr_stdint + smallest negative value an int_least8_t can hold. */ + +#define INT_LEAST8_MIN INT8_MIN + +/** \ingroup avr_stdint + largest value an uint_least8_t can hold. */ + +#define UINT_LEAST8_MAX UINT8_MAX + +/** \ingroup avr_stdint + largest positive value an int_least16_t can hold. */ + +#define INT_LEAST16_MAX INT16_MAX + +/** \ingroup avr_stdint + smallest negative value an int_least16_t can hold. */ + +#define INT_LEAST16_MIN INT16_MIN + +/** \ingroup avr_stdint + largest value an uint_least16_t can hold. */ + +#define UINT_LEAST16_MAX UINT16_MAX + +/** \ingroup avr_stdint + largest positive value an int_least32_t can hold. */ + +#define INT_LEAST32_MAX INT32_MAX + +/** \ingroup avr_stdint + smallest negative value an int_least32_t can hold. */ + +#define INT_LEAST32_MIN INT32_MIN + +/** \ingroup avr_stdint + largest value an uint_least32_t can hold. */ + +#define UINT_LEAST32_MAX UINT32_MAX + +/** \ingroup avr_stdint + largest positive value an int_least64_t can hold. */ + +#define INT_LEAST64_MAX INT64_MAX + +/** \ingroup avr_stdint + smallest negative value an int_least64_t can hold. */ + +#define INT_LEAST64_MIN INT64_MIN + +/** \ingroup avr_stdint + largest value an uint_least64_t can hold. */ + +#define UINT_LEAST64_MAX UINT64_MAX + +/*@}*/ + +/** \name Limits of fastest minimum-width integer types */ + +/*@{*/ + +/** \ingroup avr_stdint + largest positive value an int_fast8_t can hold. */ + +#define INT_FAST8_MAX INT8_MAX + +/** \ingroup avr_stdint + smallest negative value an int_fast8_t can hold. */ + +#define INT_FAST8_MIN INT8_MIN + +/** \ingroup avr_stdint + largest value an uint_fast8_t can hold. */ + +#define UINT_FAST8_MAX UINT8_MAX + +/** \ingroup avr_stdint + largest positive value an int_fast16_t can hold. */ + +#define INT_FAST16_MAX INT16_MAX + +/** \ingroup avr_stdint + smallest negative value an int_fast16_t can hold. */ + +#define INT_FAST16_MIN INT16_MIN + +/** \ingroup avr_stdint + largest value an uint_fast16_t can hold. */ + +#define UINT_FAST16_MAX UINT16_MAX + +/** \ingroup avr_stdint + largest positive value an int_fast32_t can hold. */ + +#define INT_FAST32_MAX INT32_MAX + +/** \ingroup avr_stdint + smallest negative value an int_fast32_t can hold. */ + +#define INT_FAST32_MIN INT32_MIN + +/** \ingroup avr_stdint + largest value an uint_fast32_t can hold. */ + +#define UINT_FAST32_MAX UINT32_MAX + +/** \ingroup avr_stdint + largest positive value an int_fast64_t can hold. */ + +#define INT_FAST64_MAX INT64_MAX + +/** \ingroup avr_stdint + smallest negative value an int_fast64_t can hold. */ + +#define INT_FAST64_MIN INT64_MIN + +/** \ingroup avr_stdint + largest value an uint_fast64_t can hold. */ + +#define UINT_FAST64_MAX UINT64_MAX + +/*@}*/ + +/** \name Limits of integer types capable of holding object pointers */ + +/*@{*/ + +/** \ingroup avr_stdint + largest positive value an intptr_t can hold. */ + +#define INTPTR_MAX INT16_MAX + +/** \ingroup avr_stdint + smallest negative value an intptr_t can hold. */ + +#define INTPTR_MIN INT16_MIN + +/** \ingroup avr_stdint + largest value an uintptr_t can hold. */ + +#define UINTPTR_MAX UINT16_MAX + +/*@}*/ + +/** \name Limits of greatest-width integer types */ + +/*@{*/ + +/** \ingroup avr_stdint + largest positive value an intmax_t can hold. */ + +#define INTMAX_MAX INT64_MAX + +/** \ingroup avr_stdint + smallest negative value an intmax_t can hold. */ + +#define INTMAX_MIN INT64_MIN + +/** \ingroup avr_stdint + largest value an uintmax_t can hold. */ + +#define UINTMAX_MAX UINT64_MAX + +/*@}*/ + +/** \name Limits of other integer types + C++ implementations should define these macros only when + __STDC_LIMIT_MACROS is defined before <stdint.h> is included */ + +/*@{*/ + +/** \ingroup avr_stdint + largest positive value a ptrdiff_t can hold. */ + +#define PTRDIFF_MAX INT16_MAX + +/** \ingroup avr_stdint + smallest negative value a ptrdiff_t can hold. */ + +#define PTRDIFF_MIN INT16_MIN + + +/* Limits of sig_atomic_t */ +/* signal.h is currently not implemented (not avr/signal.h) */ + +/** \ingroup avr_stdint + largest positive value a sig_atomic_t can hold. */ + +#define SIG_ATOMIC_MAX INT8_MAX + +/** \ingroup avr_stdint + smallest negative value a sig_atomic_t can hold. */ + +#define SIG_ATOMIC_MIN INT8_MIN + + +/** \ingroup avr_stdint + largest value a size_t can hold. */ + +#define SIZE_MAX (__CONCAT(INT16_MAX, U)) + + +/* Limits of wchar_t */ +/* wchar.h is currently not implemented */ +/* #define WCHAR_MAX */ +/* #define WCHAR_MIN */ + + +/* Limits of wint_t */ +/* wchar.h is currently not implemented */ +/* #define WINT_MAX */ +/* #define WINT_MIN */ + + +#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ + +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) + +/** \name Macros for integer constants + C++ implementations should define these macros only when + __STDC_CONSTANT_MACROS is defined before <stdint.h> is included. + + These definitions are valid for integer constants without suffix and + for macros defined as integer constant without suffix */ + +/** \ingroup avr_stdint + define a constant of type int8_t */ + +#define INT8_C(value) ((int8_t) value) + +/** \ingroup avr_stdint + define a constant of type uint8_t */ + +#define UINT8_C(value) ((uint8_t) __CONCAT(value, U)) + +/** \ingroup avr_stdint + define a constant of type int16_t */ + +#define INT16_C(value) value + +/** \ingroup avr_stdint + define a constant of type uint16_t */ + +#define UINT16_C(value) __CONCAT(value, U) + +/** \ingroup avr_stdint + define a constant of type int32_t */ + +#define INT32_C(value) __CONCAT(value, L) + +/** \ingroup avr_stdint + define a constant of type uint32_t */ + +#define UINT32_C(value) __CONCAT(value, UL) + +/** \ingroup avr_stdint + define a constant of type int64_t */ + +#define INT64_C(value) __CONCAT(value, LL) + +/** \ingroup avr_stdint + define a constant of type uint64_t */ + +#define UINT64_C(value) __CONCAT(value, ULL) + +/** \ingroup avr_stdint + define a constant of type intmax_t */ + +#define INTMAX_C(value) __CONCAT(value, LL) + +/** \ingroup avr_stdint + define a constant of type uintmax_t */ + +#define UINTMAX_C(value) __CONCAT(value, ULL) + +/*@}*/ + +#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ + + +#endif /* _STDINT_H_ */ Added: firmware/fuxusb/tags/0.3.1/lib_mcu/5131_drv.h =================================================================== --- firmware/fuxusb/tags/0.3.1/lib_mcu/5131_drv.h (rev 0) +++ firmware/fuxusb/tags/0.3.1/lib_mcu/5131_drv.h 2007-11-09 16:11:44 UTC (rev 678) @@ -0,0 +1,248 @@ +/*H************************************************************************** +* NAME: 5131_drv.h +*---------------------------------------------------------------------------- +* Copyright (c) 2004 Atmel. +*---------------------------------------------------------------------------- +* RELEASE: c5131-usb-cdc-1_0_2 +* REVISION: 1.7 +*---------------------------------------------------------------------------- +* PURPOSE: +* This file contains the C51 driver definition +*****************************************************************************/ + +#ifndef _5131_DRV_H_ +#define _5131_DRV_H_ + +/*_____ I N C L U D E S ____________________________________________________*/ + + +/*_____ M A C R O S ________________________________________________________*/ + + +/*_____ D E F I N I T I O N ________________________________________________*/ +/* SYSTEM MANAGEMENT */ +#define MSK_SMOD1 0x80 /* PCON */ +#define MSK_SMOD0 0x40 +#define MSK_GF1 0x08 +#define MSK_GF0 0x04 +#define MSK_PD 0x02 +#define MSK_IDL 0x01 + +#define MSK_EXT16 0x40 /* AUXR */ +#define MSK_M0 0x20 +#define MSK_DPHDIS 0x10 +#define MSK_XRS 0x0C +#define MSK_EXTRAM 0x02 +#define MSK_AO 0x01 +#define ERAM_256 0x00 +#define ERAM_512 0x04 +#define ERAM_1024 0x08 +#define ERAM_2048 0x0C + + +/* PLL & CLOCK */ +#define MSK_X2 0x01 /* CKCON */ +#define MSK_T0X2 0x02 +#define MSK_T1X2 0x04 +#define MSK_WDX2 0x40 + + +/* TIMERS */ +#define MSK_GATE1 0x80 /* TMOD */ +#define MSK_C_T1 0x40 +#define MSK_MO1 0x30 +#define MSK_GATE0 0x08 +#define MSK_C_T0 0x04 +#define MSK_MO0 0x03 + + +/* WATCHDOG */ +#define MSK_WTO 0x07 /* WDTPRG*/ + +/*_____ D E C L A R A T I O N ______________________________________________*/ + +#define Set_x2_mode() (CKCON0 |= MSK_X2) +#define Set_x1_mode() (CKCON0 &= ~MSK_X2) +#define Mode_x2() ((CKCON0 & MSK_X2) == MSK_X2) + +#define Set_timer0_x1_mode() (CKCON0 |= MSK_T0X2) +#define Set_timer0_x2_mode() (CKCON0 &=~MSK_T0X2) +#define Set_timer1_x1_mode() (CKCON0 |= MSK_T1X2) +#define Set_timer1_x2_mode() (CKCON0 &=~MSK_T1X2) +#define Set_timer2_x1_mode() (CKCON0 |= MSK_T2X2) +#define Set_timer2_x2_mode() (CKCON0 &=~MSK_T2X2) +#define Set_uart_x1_mode() (CKCON0 |= MSK_UARTX2) +#define Set_uart_x2_mode() (CKCON0 &=~MSK_UARTX2) +#define Set_pca_x1_mode() (CKCON0 |= MSK_PCAX2) +#define Set_pca_x2_mode() (CKCON0 &=~MSK_PCAX2) + +#define Set_spi_x1_mode() (CKCON1 |= MSK_SPIX2) +#define Set_spi_x2_mode() (CKCON1 &=~MSK_SPIX2) + +#define Set_idle_mode() (PCON |= MSK_IDLE) +#define Set_power_down_mode() (PCON |= MSK_PD) + +#define Enable_eram() (AUXR &= ~MSK_EXTRAM) +#define Disable_eram() (AUXR |= MSK_EXTRAM) +#define Set_eram_size(s) ((AUXR &= ~MSK_XRS),(AUXR |= s)) + +#define Enable_interrupt() (EA = 1) +#define Disable_interrupt() (EA = 0) + +#define Enable_twi_interrupt() (IEN1 |= 0x02) +#define Disable_twi_interrupt() (IEN1 &= 0xFD) + +#define Enable_spi_interrupt() (IEN1 |= 0x04) +#define Disable_spi_interrupt() (IEN1 &= ~0x04) + +#define Disable_ale() (AUXR |= MSK_AO) +#define Enable_ale() (AUXR &= ~MSK_AO) +#define Switch_ale() (AUXR ^= MSK_AO) + +#define STANDARD_PORT 0 +#define LED_PORT_2MA 1 +#define LED_PORT_4MA 2 +#define LED_PORT_10MA 3 + +#define Configure_led(num,type) {LEDCON &= (0xFF & ~(0x03 << (num*2))); \ + LEDCON |= (type << (num*2));} + +#define Led_0_on() (P3_3 = 0) +#define Led_0_off() (P3_3 = 1) +#define Led_0_toggle() (P3_3 = ~P3_3) +#define Led_0_status() (P3_3) +#define Led_0_write(x) (P3_3 = x) +#define Led_1_on() (P3_5 = 0) +#define Led_1_off() (P3_5 = 1) +#define Led_1_toggle() (P3_5 = ~P3_5) +#define Led_1_status() (P3_5) +#define Led_1_write(x) (P3_5 = x) +#define Led_2_on() (P3_6 = 0) +#define Led_2_off() (P3_6 = 1) +#define Led_2_toggle() (P3_6 = ~P3_6) +#define Led_2_status() (P3_6) +#define Led_2_write(x) (P3_6 = x) +#define Led_3_on() (P3_7 = 0) +#define Led_3_off() (P3_7 = 1) +#define Led_3_toggle() (P3_7 = ~P3_7) +#define Led_3_status() (P3_7) +#define Led_3_write(x) (P3_7 = x) + + +#define Led_all_on() (P3 &= 0x17) +#define Led_all_off() (P3 |= ~0x17) + +/*C************************************************************************** +* NAME: PLL_3MHz +*---------------------------------------------------------------------------- +* PURPOSE: +* PLLDIV value for an oscillator frequency of 3MHz +*****************************************************************************/ +#define PLL_3MHz 0xF0 + +/*C************************************************************************** +* NAME: PLL_4MHz +*---------------------------------------------------------------------------- +* PURPOSE: +* PLLDIV value for an oscillator frequency of 4MHz +*****************************************************************************/ +#define PLL_4MHz 0xC0 + +/*C************************************************************************** +* NAME: PLL_6MHz +*---------------------------------------------------------------------------- +* PURPOSE: +* PLLDIV value for an oscillator frequency of 6MHz +*****************************************************************************/ +#define PLL_6MHz 0x70 + +/*C************************************************************************** +* NAME: PLL_8MHz +*---------------------------------------------------------------------------- +* PURPOSE: +* PLLDIV value for an oscillator frequency of 8MHz +**********************************... [truncated message content] |