tux-droid-svn Mailing List for Tux Droid CE (Page 208)
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...> - 2008-01-07 08:28:56
|
Author: Paul_R Date: 2008-01-07 09:28:50 +0100 (Mon, 07 Jan 2008) New Revision: 831 Modified: software/gadgets/flash_management/trunk/flash_management.tgf software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp software/gadgets/flash_management/trunk/flash_management/settings.xml software/gadgets/flash_management/trunk/flash_management/strings.xml Log: * Added the english help file * Fix a bug in the wav format detection. Modified: software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp 2008-01-04 16:59:01 UTC (rev 830) +++ software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp 2008-01-07 08:28:50 UTC (rev 831) @@ -126,7 +126,7 @@ wavs.wav_sizes=[] for i in range(17): wavfile = wave.open('/opt/tuxdroid/apps/tuxgi/sounds/%d.wav'%(i+1), 'r') - if wavfile.getsampwidth() != 1 and wavfile.getframerate() != 8000: + if wavfile.getsampwidth() != 1 or wavfile.getframerate() != 8000: dialog = GdgDialog(_me.string('Warning'), _me.string('FileSample')) wavfile.close() return @@ -197,7 +197,9 @@ if str(self.get_widget("soundInternalChooser").get_filename())=="None": return path = str(self.get_widget("soundInternalChooser").get_filename()) wavfile = wave.open(path, 'r') - if wavfile.getsampwidth() != 1 and wavfile.getframerate() != 8000: + print wavfile.getsampwidth() + print wavfile.getframerate() + if wavfile.getsampwidth() != 1 or wavfile.getframerate() != 8000: dialog = GdgDialog(_me.string('Warning'), _me.string('FileSample')) wavfile.close() return @@ -227,6 +229,14 @@ index = self.__path[0] if str(self.get_widget("soundInternalChooser").get_filename())=="None": return path = self.get_widget("soundInternalChooser").get_filename() + wavfile = wave.open(path, 'r') + if wavfile.getsampwidth() != 1 or wavfile.getframerate() != 8000: + dialog = GdgDialog(_me.string('Warning'), _me.string('FileSample')) + wavfile.close() + return + else: + wavfile.close() + #Add size to the table f = open(path,'rb') wh = f.read(44) Modified: software/gadgets/flash_management/trunk/flash_management/settings.xml =================================================================== --- software/gadgets/flash_management/trunk/flash_management/settings.xml 2008-01-04 16:59:01 UTC (rev 830) +++ software/gadgets/flash_management/trunk/flash_management/settings.xml 2008-01-07 08:28:50 UTC (rev 831) @@ -10,7 +10,7 @@ <visible type='bool'>False</visible> </selftest> <widget> - <visible type='bool'>True</visible> + <visible type='bool'>False</visible> </widget> </gui_state> <have_main_part type='bool'>False</have_main_part> Modified: software/gadgets/flash_management/trunk/flash_management/strings.xml =================================================================== --- software/gadgets/flash_management/trunk/flash_management/strings.xml 2008-01-04 16:59:01 UTC (rev 830) +++ software/gadgets/flash_management/trunk/flash_management/strings.xml 2008-01-07 08:28:50 UTC (rev 831) @@ -23,8 +23,30 @@ <gui_conf_update_title type='str'>Update</gui_conf_update_title> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> - <help_text type='str'> - </help_text> + <help_text type='str'>--= Flash Memory Management =-- + +With this gadget you can modify the sound flash memory content of Tux. +The sound files to store in the Tux memory need to be in wave format with follwoing specifications: 8Khz frequency, 8 bits resolution and mono. + +The gadget has two parts. In the first part you can create the sounds list and store them on the Tux sound memory chip. +The check box 'Include originals' will automatically load the original Tux sounds into the list. These sounds are used in several gadgets, the gadget manager and for the stand alone behavior of Tux. +This function allows to easily replace the official Tux sounds with customized ones, and it also makes it easy to restore the sound memory to it's original state. + +New sound files can be added to the list by selecting the desired wave file and clicking the 'Add' button. + +The sounds list order can be changed by dragging a sound in the list and dropping it on the desired location. +A sound can be deleted by selecting it in the list and clicking the 'Remove' button. +The 'Replace' button will replace the sound in the list with the one you selected. + +When you are done configuring the list, you can flash the sounds in the memory of Tux. Click the 'Store' button, and a progress bar will display the flashing process. + +The part 'Local wave files', let's you play the stored sounds. This can help to test if the sounds are stored correctly. + +Note : +Sound files can be easily converted using sox to make them compatible with Tux (http://sox.sourceforge.net/). + +For example: +sox 'file.mp3' -c 1 -r 8000 -b 'file.wav'</help_text> <lblSoundExternal type='str'>Play external wave file</lblSoundExternal> <lblSoundExternalFile type='str'>File :</lblSoundExternalFile> <lblSoundExternalPlay type='str'>Play</lblSoundExternalPlay> Modified: software/gadgets/flash_management/trunk/flash_management.tgf =================================================================== (Binary files differ) |
From: jaguarondi <c2m...@c2...> - 2008-01-04 16:58:59
|
Author: jaguarondi Date: 2008-01-04 17:59:01 +0100 (Fri, 04 Jan 2008) New Revision: 830 Modified: daemon/trunk/led.c daemon/trunk/led.h Log: * Updated the documentation of led_configure_effect() and added it to the module interface. This function can be used to set different effects on each LED so you can then use the led_set or led_pulse commands with the LAST effect to get everything you want. Modified: daemon/trunk/led.c =================================================================== --- daemon/trunk/led.c 2008-01-04 16:48:54 UTC (rev 829) +++ daemon/trunk/led.c 2008-01-04 16:59:01 UTC (rev 830) @@ -114,7 +114,19 @@ return ack; } -int config_effects(leds_t leds, int left_intensity_delta, +/** + * \brief Configure the hardware to the desired LED effect. + * \param leds Which LEDs are affected by the command + * \param left_intensity_delta Variation of intensity the left LED will have, + * necessary to handle timings. + * \param right_intensity_delta Variation of intensity the right LED will have, + * necessary to handle timings. + * \param effect Fading or gradient effect applied when changing the intensity. + * + * \sa The effect types and parameters are described in the documentation of + * effect_type_t. + */ +int led_configure_effects(leds_t leds, int left_intensity_delta, int right_intensity_delta, led_effect_t *effect) { int ack; @@ -328,8 +340,8 @@ left_intensity_delta = abs(intensity - get_led_left_intensity()); right_intensity_delta = abs(intensity - get_led_right_intensity()); - ack = config_effects(leds, left_intensity_delta, right_intensity_delta, - effect); + ack = led_configure_effects(leds, left_intensity_delta, + right_intensity_delta, effect); /*if (ack != ACK_CMD_OK)*/ /*return ack;*/ ack = send_usb_tux_cmd(LED_SET_CMD, leds, intensity, 0); @@ -350,7 +362,7 @@ * * The effect duration has priority on the pulse period. If you set the pulse * period to 0.2s but the fading effect to 0.5s, then you will have 2 effects - * per period (or per pulse) and the pulse period will spend 1s and not 0.2s. + * per period (or per pulse) and the pulse period will spend 1s and not 0.2s. */ int led_pulse(leds_t leds, int min_intensity, int max_intensity, \ int toggle_count, float pulse_period, led_effect_t *effect) @@ -370,7 +382,7 @@ assert(toggle_count > 0); delta = max_intensity - min_intensity; - ack = config_effects(leds, delta, delta, effect); + ack = led_configure_effects(leds, delta, delta, effect); pulse_width = roundf(pulse_period/FW_MAIN_LOOP_DELAY/2); if (pulse_width < 1) Modified: daemon/trunk/led.h =================================================================== --- daemon/trunk/led.h 2008-01-04 16:48:54 UTC (rev 829) +++ daemon/trunk/led.h 2008-01-04 16:59:01 UTC (rev 830) @@ -92,6 +92,8 @@ extern int led_set(leds_t leds, int intensity, led_effect_t *effect); extern int led_pulse(leds_t leds, int min_intensity, int max_intensity, \ int toggle_count, float pulse_period, led_effect_t *effect); +extern int led_configure_effects(leds_t leds, int left_intensity_delta, + int right_intensity_delta, led_effect_t *effect); /*! @} */ #endif /* _LED_H_ */ |
From: jaguarondi <c2m...@c2...> - 2008-01-04 16:48:52
|
Author: jaguarondi Date: 2008-01-04 17:48:54 +0100 (Fri, 04 Jan 2008) New Revision: 829 Modified: api/python/trunk/tuxapi_class.py Log: * Updated the python API to support the pulse effect of the LEDs. Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2008-01-04 16:47:57 UTC (rev 828) +++ api/python/trunk/tuxapi_class.py 2008-01-04 16:48:54 UTC (rev 829) @@ -2321,8 +2321,9 @@ Example: >>> tux.cmd.leds_blink(10,25) """ - self.last_ack=self.structured(TUX_CMD_STRUCT_LEDS, \ - TUX_CMD_STRUCT_SUB_BLINK,count,delay,0) + self.last_ack=self.estructured(TUX_CMD_STRUCT_LEDS, + TUX_CMD_STRUCT_SUB_PULSE, 3, 0, 255, + count, delay, 2, 0, 0) #-------------------------------------------------------------------------- # Send a command to tux for turning the leds off @@ -2523,9 +2524,9 @@ "leds" as enum : Which LEDs are affected by the command (0=LED_NONE, 1=LED_LEFT, 2=LED_RIGHT, 3=LED_BOTH) - intensity as int 8bits : Value of the intensity the LEDs should be + intensity as int : Value of the intensity the LEDs should be set to (0..255). - effect_type : Fading or gradient effect applied when + effect_type as enum : Fading or gradient effect applied when changing the intensity. The values are: - 0=UNAFFECTED Don't update the effect parameters. This can either be the @@ -2561,8 +2562,8 @@ - GRADIENT_DELTA=7 Gradient effect, the intensity changes by a delta value of 'effect_step'. - effect_speed : See above. - effect_step : See above. + effect_speed as int : See above. + effect_step as int : See above. Example: >>> tux.cmd.led_set(3, 0xFF, 4, 0.5, 0) @@ -2573,6 +2574,8 @@ effect_speed = 1.0/16 if effect_step > 255: effect_step = 255 + # workaround to send a float over TCP/IP in the current API: + # effect_speed is multiplied by 16 self.last_ack=self.estructured(TUX_CMD_STRUCT_LEDS, TUX_CMD_STRUCT_SUB_SET, leds, intensity, effect_type, int(effect_speed*16), effect_step) @@ -2580,10 +2583,98 @@ #-------------------------------------------------------------------------- # Mapping of the daemon command to pulse the LEDs. #-------------------------------------------------------------------------- - def led_pulse(self): - # XXX to write - pass + def led_pulse(self, leds, min_intensity, max_intensity, pulse_count, + pulse_period, effect_type, effect_speed, effect_step): + """ + Pulses the LEDs with an effect. This is the raw function provided by + the daemon and is not the easiest to use. See the daemon API + documentation for details. New functions have to be created and this + one probably will have to be removed or kept for debug purposes only. + We don't send floats through TCP/IP (effect_speed and effect_step), we + just multiply by 16 and divide by the same value on the other side. So + the boundaries are 1/16 to 15. + + Parameters: + See the daemon API for details. + "leds" as enum : Which LEDs are affected by the command + (0=LED_NONE, 1=LED_LEFT, 2=LED_RIGHT, + 3=LED_BOTH) + min_intensity as int : Value of the intensity the LEDs should be + set to (0..255). + max_intensity as int : Value of the intensity the LEDs should be + set to (0..255). + pulse_count as int : Number of toggles before pusling stops. + pulse_period as float : Period between 2 pulses, in seconds. + effect_type as enum : Fading or gradient effect applied when + changing the intensity. The values are: + - 0=UNAFFECTED Don't update the effect + parameters. This can either be the + last effect set by software, or by + firmware in the autonomous mode. This + is probably not what you want. + - LAST=1 Last effect requested by + software. + - NONE=2 Don't use effects, equivalent + to on/off mode. + - DEFAULT=3 Default effect which is a + short fading effect. + - FADE_DURATION=4 Fading effect, + 'effect_speed' sets the duration (in + seconds) the effect will last. + - FADE_RATE=5 Fading effect, + 'effect_speed' sets the rate of the + effect. Its value represents the + number of seconds it takes to apply the + effect from off to on. So the actual + effect duration will take less time + than specified if the intensity starts + or ends at intermediate values. + Therefore this parameter guarantees a + constant rate of the effect, not the + duration. + - GRADIENT_NBR=6 Gradient effect, the + intensity changes gradually by a number + of steps given by 'effect_step'. + 'effect_speed' represents the number of + seconds it should take to apply the + effect. + - GRADIENT_DELTA=7 Gradient effect, the + intensity changes by a delta value of + 'effect_step'. + effect_speed as int : See above. + effect_step as int : See above. + + The effect duration has priority on the pulse period. If you set the + pulse period to 0.2s but the fading effect to 0.5s, then you will have + 2 effects per period (or per pulse) and the pulse period will spend 1s + and not 0.2s. + + Example: + >>> tux.cmd.led_pulse(3, 0x0, 0x80, 6, 0.7, 4, 0.3, 5) + """ + if effect_speed > 15: + effect_speed = 15 + if effect_speed < 1.0/16: + effect_speed = 1.0/16 + if effect_step > 255: + effect_step = 255 + if pulse_count > 255: + pulse_count = 255 + if pulse_period > 1: + pulse_period = 1 + if (pulse_period <= 0): + return + if (max_intensity <= min_intensity): + return + # workaround to send a float over TCP/IP in the current API: + # pulse_period is multiplied by 250 + # effect_speed is multiplied by 16 + self.last_ack=self.estructured(TUX_CMD_STRUCT_LEDS, + TUX_CMD_STRUCT_SUB_PULSE, leds, min_intensity, max_intensity, + pulse_count, int(250 * pulse_period), effect_type, + int(effect_speed*16), effect_step) + #-------------------------------------------------------------------------- # Send a command to tux for playing a sound from the flash memory #-------------------------------------------------------------------------- |
From: jaguarondi <c2m...@c2...> - 2008-01-04 16:47:58
|
Author: jaguarondi Date: 2008-01-04 17:47:57 +0100 (Fri, 04 Jan 2008) New Revision: 828 Modified: daemon/trunk/led.c daemon/trunk/led.h daemon/trunk/libs/USBDaemon_command_tux.c Log: * Added functions to pulse the LEDs. Something similar to the blink function but now using effects too, and both eyes are independent. Modified: daemon/trunk/led.c =================================================================== --- daemon/trunk/led.c 2008-01-04 14:12:52 UTC (rev 827) +++ daemon/trunk/led.c 2008-01-04 16:47:57 UTC (rev 828) @@ -114,21 +114,10 @@ return ack; } -/** - * \brief Set the intensity of the LEDs. - * \param leds Which LEDs are affected by the command - * \param intensity Value of the intensity the LEDs should be set to. - * \param effect Fading or gradient effect applied when changing the intensity. - * - * \sa The effect types and parameters are described in the documentation of - * effect_type_t. - */ -int led_set(leds_t leds, int intensity, led_effect_t *effect) +int config_effects(leds_t leds, int left_intensity_delta, + int right_intensity_delta, led_effect_t *effect) { int ack; - /* Preconditions */ - assert(LED_NONE <= leds && leds <= LED_BOTH); - assert(0 <= intensity && intensity <= 255); switch(effect->type) { @@ -176,30 +165,27 @@ * If both leds are not at the same initial level, we can only * have the same duration by assigning different parameters to * each eye. */ - int left_increase, right_increase; /* Flag that indicates if nothing needs to be done. */ bool skip = true; /* We should use effect NONE if we don't want fading. */ assert(effect->speed > 0); - left_increase = abs(intensity - get_led_left_intensity()); - right_increase = abs(intensity - get_led_right_intensity()); /* Don't divide by zero if there's nothing to do ;-). */ - if (leds & LED_LEFT && left_increase) + if (leds & LED_LEFT && left_intensity_delta) { skip = false; ack = config_fading(LED_LEFT, effect->speed / \ - left_increase); + left_intensity_delta); /* XXX Due to bugs lying around in the dongle, RF and daemon, * we can't trust the ack, so disabled for now. */ /*if (ack != ACK_CMD_OK)*/ /*return ack;*/ } - if (leds & LED_RIGHT && right_increase) + if (leds & LED_RIGHT && right_intensity_delta) { skip = false; ack = config_fading(LED_RIGHT, effect->speed / \ - right_increase); + right_intensity_delta); } /* XXX Due to bugs lying around in the dongle, RF and daemon, * we can't trust the ack, so disabled for now. */ @@ -230,7 +216,6 @@ break; case GRADIENT_NBR: { - int left_increase, right_increase; int delta; /* Flag indicating if nothing needs to be done. */ bool skip = true; @@ -241,13 +226,11 @@ /* We should use effect NONE if we don't want gradient. */ assert(effect->speed > 0); - left_increase = abs(intensity - get_led_left_intensity()); - right_increase = abs(intensity - get_led_right_intensity()); /* Don't divide by zero if there's nothing to do ;-). */ - if (leds & LED_LEFT && left_increase) + if (leds & LED_LEFT && left_intensity_delta) { skip = false; - delta = roundf(left_increase / effect->step); + delta = roundf(left_intensity_delta / effect->step); /* If we can't have as many steps as required. */ if (delta == 0) delta = 1; @@ -258,10 +241,10 @@ /*if (ack != ACK_CMD_OK)*/ /*return ack;*/ } - if (leds & LED_RIGHT && right_increase) + if (leds & LED_RIGHT && right_intensity_delta) { skip = false; - delta = roundf(right_increase / effect->step); + delta = roundf(right_intensity_delta / effect->step); /* If we can't have as many steps as required. */ if (delta == 0) delta = 1; @@ -279,7 +262,6 @@ break; case GRADIENT_DELTA: { - int left_increase, right_increase; float gradient_delay; /* Flag indicating if nothing needs to be done. */ bool skip = true; @@ -290,25 +272,23 @@ /* We should use effect NONE if we don't want gradient. */ assert(effect->speed > 0); - left_increase = abs(intensity - get_led_left_intensity()); - right_increase = abs(intensity - get_led_right_intensity()); /* Don't divide by zero if there's nothing to do ;-). */ - if (leds & LED_LEFT && left_increase) + if (leds & LED_LEFT && left_intensity_delta) { skip = false; gradient_delay = effect->speed * effect->step / \ - left_increase; + left_intensity_delta; ack = config_gradient(LED_LEFT, effect->step, gradient_delay); /* XXX Due to bugs lying around in the dongle, RF and daemon, * we can't trust the ack, so disabled for now. */ /*if (ack != ACK_CMD_OK)*/ /*return ack;*/ } - if (leds & LED_RIGHT && right_increase) + if (leds & LED_RIGHT && right_intensity_delta) { skip = false; gradient_delay = effect->speed * effect->step / \ - right_increase; + right_intensity_delta; ack = config_gradient(LED_RIGHT, effect->step, gradient_delay); } /* XXX Due to bugs lying around in the dongle, RF and daemon, @@ -325,11 +305,80 @@ assert(0); break; } + return ack; +} + +/** + * \brief Set the intensity of the LEDs. + * \param leds Which LEDs are affected by the command + * \param intensity Value of the intensity the LEDs should be set to. + * \param effect Fading or gradient effect applied when changing the intensity. + * + * \sa The effect types and parameters are described in the documentation of + * effect_type_t. + */ +int led_set(leds_t leds, int intensity, led_effect_t *effect) +{ + int ack; + int left_intensity_delta, right_intensity_delta; + + /* Preconditions */ + assert(LED_NONE <= leds && leds <= LED_BOTH); + assert(0 <= intensity && intensity <= 255); + + left_intensity_delta = abs(intensity - get_led_left_intensity()); + right_intensity_delta = abs(intensity - get_led_right_intensity()); + ack = config_effects(leds, left_intensity_delta, right_intensity_delta, + effect); + /*if (ack != ACK_CMD_OK)*/ + /*return ack;*/ ack = send_usb_tux_cmd(LED_SET_CMD, leds, intensity, 0); return ack; } -void led_pulse(void) +/** + * \brief Pulse the LEDs. + * \param leds Which LEDs are affected by the command. + * \param min_intensity Value of the minimum intensity when pulsing. + * \param max_intensity Value of the maximum intensity when pulsing. + * \param toggle_count Number of toggles before pusling stops. + * \param pulse_period Period between 2 pulses, in seconds. + * \param effect Fading or gradient effect applied when changing the intensity. + * + * \sa The effect types and parameters are described in the documentation of + * effect_type_t. + * + * The effect duration has priority on the pulse period. If you set the pulse + * period to 0.2s but the fading effect to 0.5s, then you will have 2 effects + * per period (or per pulse) and the pulse period will spend 1s and not 0.2s. + */ +int led_pulse(leds_t leds, int min_intensity, int max_intensity, \ + int toggle_count, float pulse_period, led_effect_t *effect) { - /* XXX add pulsing here. */ + int ack; + /* Pulse width or duration of the pulse, in hardware loops. The pulse + * period is twice that number. */ + int pulse_width; + int delta; + + /* Preconditions */ + assert(LED_NONE <= leds && leds <= LED_BOTH); + assert(0 <= min_intensity && min_intensity <= 255); + assert(0 <= max_intensity && max_intensity <= 255); + assert(max_intensity > min_intensity); + assert(pulse_period > 0); + assert(toggle_count > 0); + + delta = max_intensity - min_intensity; + ack = config_effects(leds, delta, delta, effect); + + pulse_width = roundf(pulse_period/FW_MAIN_LOOP_DELAY/2); + if (pulse_width < 1) + pulse_width = 1; + if (pulse_width > 255) + pulse_width = 255; + ack = send_usb_tux_cmd(LED_PULSE_RANGE_CMD, leds, max_intensity, + min_intensity); + ack = send_usb_tux_cmd(LED_PULSE_CMD, leds, toggle_count, pulse_width); + return ack; } Modified: daemon/trunk/led.h =================================================================== --- daemon/trunk/led.h 2008-01-04 14:12:52 UTC (rev 827) +++ daemon/trunk/led.h 2008-01-04 16:47:57 UTC (rev 828) @@ -90,6 +90,8 @@ * Prototypes. */ extern int led_set(leds_t leds, int intensity, led_effect_t *effect); +extern int led_pulse(leds_t leds, int min_intensity, int max_intensity, \ + int toggle_count, float pulse_period, led_effect_t *effect); /*! @} */ #endif /* _LED_H_ */ Modified: daemon/trunk/libs/USBDaemon_command_tux.c =================================================================== --- daemon/trunk/libs/USBDaemon_command_tux.c 2008-01-04 14:12:52 UTC (rev 827) +++ daemon/trunk/libs/USBDaemon_command_tux.c 2008-01-04 16:47:57 UTC (rev 828) @@ -480,7 +480,17 @@ break; case TUX_CMD_STRUCT_SUB_PULSE: { - /* XXX add pulsing here. */ + led_effect_t effect; + effect.type = data[7]; + /* Workaround to send a float through TCP/IP, just send a + * uint8_t which is the float parameter multiplied by 16, then + * divide it here again. The limitation is of course the range. + * pulse_period is multiplied by 250. + */ + effect.speed = (float)data[8]/16; + effect.step = data[9]; + printf("%x %x %x %x %x %x %x %x \n",data[2], data[3], data[4], data[5], data[6], data[7], data[8], data[9]); + ACK = led_pulse(data[2], data[3], data[4], data[5], (float)data[6]/250, &effect); } break; } |
From: jaguarondi <c2m...@c2...> - 2008-01-04 14:13:01
|
Author: jaguarondi Date: 2008-01-04 15:12:52 +0100 (Fri, 04 Jan 2008) New Revision: 827 Modified: firmware/hex/bootloader.tuxaudio.hex firmware/hex/bootloader.tuxcore.hex firmware/hex/fuxrf.hex firmware/hex/fuxusb.hex firmware/hex/tuxaudio.eep firmware/hex/tuxaudio.hex firmware/hex/tuxcore.eep firmware/hex/tuxcore.hex firmware/hex/tuxrf.hex firmware/hex_dev/fuxrf.hex firmware/hex_dev/fuxusb.hex firmware/hex_dev/tuxaudio.eep firmware/hex_dev/tuxaudio.hex firmware/hex_dev/tuxcore.eep firmware/hex_dev/tuxcore.hex firmware/hex_dev/tuxrf.hex Log: * Set the correct mime-type to hex files. Property changes on: firmware/hex/bootloader.tuxaudio.hex ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex/bootloader.tuxcore.hex ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex/fuxrf.hex ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex/fuxusb.hex ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex/tuxaudio.eep ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex/tuxaudio.hex ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex/tuxcore.eep ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex/tuxcore.hex ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex/tuxrf.hex ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex_dev/fuxrf.hex ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex_dev/fuxusb.hex ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex_dev/tuxaudio.eep ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex_dev/tuxaudio.hex ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex_dev/tuxcore.eep ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex_dev/tuxcore.hex ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Property changes on: firmware/hex_dev/tuxrf.hex ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: Paul_R <c2m...@c2...> - 2008-01-04 14:00:12
|
Author: Paul_R Date: 2008-01-04 15:00:09 +0100 (Fri, 04 Jan 2008) New Revision: 826 Modified: software/gadgets/flash_management/trunk/flash_management.tgf software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/conf/other.glade software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/conf/other.pyp software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.glade software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml software/gadgets/flash_management/trunk/flash_management/strings.xml Log: * Minor changes on the widget GUI. Removed the notification part on the conf GUI * Changed some strings * Added the french help Modified: software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/conf/other.glade =================================================================== (Binary files differ) Modified: software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/conf/other.pyp 2008-01-04 13:49:15 UTC (rev 825) +++ software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/conf/other.pyp 2008-01-04 14:00:09 UTC (rev 826) @@ -53,16 +53,6 @@ txt = _me.string('gui_conf_remote_set_bt') self.get_widget("button_remote").set_label(txt) - # Update Frame - txt = _me.string('gui_conf_update_title') - self.get_widget("label12").set_text(txt) - - txt = "%s : " % _me.string('gui_conf_delay_lb') - self.get_widget("label13").set_text(txt) - - value = _me.get_var('notify_delay') - self.get_widget("delay_spinbutton").set_value(value) - # Bottom buttons txt = _me.string('gui_conf_cancel_bt') self.get_widget("label6").set_text(txt) @@ -89,7 +79,6 @@ """ On button 'accept' clicked """ - _me.set_var('notify_delay', int(self.get_widget("delay_spinbutton").get_value())) self.get_widget("window1").destroy() def on_cancel_clicked(self, widget, *args): Modified: software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.glade 2008-01-04 13:49:15 UTC (rev 825) +++ software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.glade 2008-01-04 14:00:09 UTC (rev 826) @@ -659,6 +659,18 @@ <property name="spacing">0</property> <child> + <widget class="GtkFixed" id="fixed13"> + <property name="width_request">2</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> <widget class="GtkScrolledWindow" id="scrolledwindow1"> <property name="width_request">320</property> <property name="visible">True</property> @@ -685,42 +697,6 @@ <property name="visible">True</property> <child> - <widget class="GtkButton" id="btnSoundClear"> - <property name="width_request">72</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Clear list</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_wave_internal_clist_bt_clicked"/> - </widget> - <packing> - <property name="x">20</property> - <property name="y">116</property> - </packing> - </child> - - <child> - <widget class="GtkButton" id="btnSoundStore"> - <property name="width_request">72</property> - <property name="height_request">27</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes">Store</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_wave_internal_store_bt_clicked"/> - </widget> - <packing> - <property name="x">96</property> - <property name="y">116</property> - </packing> - </child> - - <child> <widget class="GtkFileChooserButton" id="soundInternalChooser"> <property name="width_request">185</property> <property name="height_request">27</property> @@ -740,29 +716,8 @@ </child> <child> - <widget class="GtkCheckButton" id="chkSoundOriginal"> - <property name="width_request">148</property> - <property name="height_request">24</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="label" translatable="yes"></property> - <property name="use_underline">True</property> - <property name="relief">GTK_RELIEF_NORMAL</property> - <property name="focus_on_click">True</property> - <property name="active">False</property> - <property name="inconsistent">False</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_incl_orig_toggled" last_modification_time="Mon, 16 Apr 2007 10:51:02 GMT"/> - </widget> - <packing> - <property name="x">19</property> - <property name="y">18</property> - </packing> - </child> - - <child> <widget class="GtkProgressBar" id="progressbar1"> - <property name="width_request">216</property> + <property name="width_request">240</property> <property name="height_request">16</property> <property name="visible">True</property> <property name="orientation">GTK_PROGRESS_LEFT_TO_RIGHT</property> @@ -778,7 +733,7 @@ <child> <widget class="GtkButton" id="btnSoundAdd"> - <property name="width_request">72</property> + <property name="width_request">80</property> <property name="height_request">27</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -796,7 +751,7 @@ <child> <widget class="GtkButton" id="btnSoundRemove"> - <property name="width_request">72</property> + <property name="width_request">80</property> <property name="height_request">27</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -807,14 +762,14 @@ <signal name="clicked" handler="on_wave_internal_remove_bt_clicked"/> </widget> <packing> - <property name="x">96</property> + <property name="x">102</property> <property name="y">82</property> </packing> </child> <child> <widget class="GtkButton" id="btnSoundModify"> - <property name="width_request">72</property> + <property name="width_request">80</property> <property name="height_request">27</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -825,14 +780,50 @@ <signal name="clicked" handler="on_btnSoundModify_clicked" last_modification_time="Mon, 05 Nov 2007 14:45:42 GMT"/> </widget> <packing> - <property name="x">172</property> + <property name="x">184</property> <property name="y">82</property> </packing> </child> <child> + <widget class="GtkButton" id="btnSoundClear"> + <property name="width_request">80</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Clear list</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_wave_internal_clist_bt_clicked"/> + </widget> + <packing> + <property name="x">20</property> + <property name="y">116</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnSoundStore"> + <property name="width_request">80</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Store</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_wave_internal_store_bt_clicked"/> + </widget> + <packing> + <property name="x">102</property> + <property name="y">116</property> + </packing> + </child> + + <child> <widget class="GtkLabel" id="lblSoundState"> - <property name="width_request">216</property> + <property name="width_request">240</property> <property name="height_request">41</property> <property name="visible">True</property> <property name="label" translatable="yes">label3</property> @@ -855,6 +846,27 @@ <property name="y">168</property> </packing> </child> + + <child> + <widget class="GtkCheckButton" id="chkSoundOriginal"> + <property name="width_request">148</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes"></property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_incl_orig_toggled" last_modification_time="Mon, 16 Apr 2007 10:51:02 GMT"/> + </widget> + <packing> + <property name="x">19</property> + <property name="y">18</property> + </packing> + </child> </widget> <packing> <property name="padding">0</property> Modified: software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp 2008-01-04 13:49:15 UTC (rev 825) +++ software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp 2008-01-04 14:00:09 UTC (rev 826) @@ -24,7 +24,9 @@ def new(self): self.widget_window = True - self.get_widget("window1").set_title(_me.string('name_to_read')) + self.get_widget("window1").set_title(_me.string('name_to_read')) + wavs.wav_paths=[] + wavs.wav_sizes=[] thread.start_new_thread(self.update, ()) def on_window1_destroy(self, widget, *args): @@ -124,8 +126,6 @@ wavs.wav_sizes=[] for i in range(17): wavfile = wave.open('/opt/tuxdroid/apps/tuxgi/sounds/%d.wav'%(i+1), 'r') - print wavfile.getsampwidth() - print wavfile.getframerate() if wavfile.getsampwidth() != 1 and wavfile.getframerate() != 8000: dialog = GdgDialog(_me.string('Warning'), _me.string('FileSample')) wavfile.close() @@ -197,8 +197,6 @@ if str(self.get_widget("soundInternalChooser").get_filename())=="None": return path = str(self.get_widget("soundInternalChooser").get_filename()) wavfile = wave.open(path, 'r') - print wavfile.getsampwidth() - print wavfile.getframerate() if wavfile.getsampwidth() != 1 and wavfile.getframerate() != 8000: dialog = GdgDialog(_me.string('Warning'), _me.string('FileSample')) wavfile.close() @@ -343,7 +341,7 @@ self.get_widget('lblSoundState').set_text(_me.string('soundProg')+str(i+1)) tux.cmd.sound_storing() #while tux.status.sound_record()[0] != 1: - #print 'wait' + # print 'wait' tux.sys.wait(0.2) tux.sys.shell("aplay -D %s %s"%(soundcard, sound_table[i])) #while tux.status.sound_record()[0] != 2: @@ -406,7 +404,7 @@ self.get_widget('lblSoundState').set_text(_me.string('Succeeded')) self.__sound_mutex.release() - + def on_disconnected(self): self.disconnected = True tux.sys.shell('pkill aplay') Modified: software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml =================================================================== --- software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml 2008-01-04 13:49:15 UTC (rev 825) +++ software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml 2008-01-04 14:00:09 UTC (rev 826) @@ -6,7 +6,7 @@ <Warning type='str'>Attention</Warning> <btnSoundAdd type='str'>Ajouter</btnSoundAdd> <btnSoundClear type='str'>Purger</btnSoundClear> - <btnSoundModify type='str'>Modifier</btnSoundModify> + <btnSoundModify type='str'>Remplacer</btnSoundModify> <btnSoundPlayNum type='str'>Lire</btnSoundPlayNum> <btnSoundRemove type='str'>Enlever</btnSoundRemove> <btnSoundStore type='str'>Ecrire</btnSoundStore> @@ -23,11 +23,34 @@ <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> - <help_text type='str'> - </help_text> - <lblSleepDelay type='str'>Activer la veille après une période d'inactivité de </lblSleepDelay> - <lblSleepStateSleep type='str'>Tux est actuellement en veille</lblSleepStateSleep> - <lblSleepStateWork type='str'>Tux n'est pas en veille pour le moment</lblSleepStateWork> + <help_text type='str'>--= Gestion de la mémoire flash =-- + +Ce gadget vous permet de changer les sons contenus dans la mémoire de Tux. +Les fichiers pouvant être enregistré dans la mémoire doivent être des fichiers waves, avec une fréquence d'échantillonnage de 8kHz et une résolution de 8 bits, en mono. + +Ce gadget se présente en deux sections. La première section permet de créer une liste de sons, et des les programmer dans Tux. +La case 'Fichiers originaux' permet le chargement automatiquement dans la liste des sons d'origines de Tux. Ces sons sont utilisés dans un bon nombre de gadgets, par le manager ainsi que par Tux lui-même. +Vous pouvez bien évidemment remplacer ces sons par les vôtres, ou simplement reprendre la liste par défaut. + +Il est également possible de charger un fichier directement dans la liste. Pour cela, il suffit de spécifier le fichier, et d'appuyer sur le bouton 'ajouter'. + +Tous les sons peuvent être réorganisés dans la liste, en les sélectionnant et en changeant leurs emplacements. +Vous pouvez également supprimer un fichier, en le selectionnant dans la liste et en appuyant sur le bouton 'enlever'. +Enfin, vous avez la possibilité de remplacer un son contenu dans la liste par celui que vous aurez spécifié. + +Lorsque la liste est configurée, vous pourrez programmer les sons dans Tux. Il vous suffira d'appuyer sur le bouton 'Ecrire'. +Cette opération nécessite un certain temps, dépendant du nombre de sons à programmer. + +La section 'Lire un wave local' permet d'écouter un son enregistrer dans la mémoire de Tux. Vous pourrez alors vérifier que la programmation s'est déroulée correctement. + + +Note : +Vous pouvez très facilement convertir vos fichiers afin de les rendrent compatibles avec Tux en utilisant le logiciel sox (http://sox.sourceforge.net/). + +Exemple de conversion avec Sox : +sox 'file.mp3' -c 1 -r 8000 -b 'file.wav' + +</help_text> <lblSoundExternal type='str'>Lire un wave externe</lblSoundExternal> <lblSoundExternalFile type='str'>Fichier :</lblSoundExternalFile> <lblSoundExternalPlay type='str'>Lecture</lblSoundExternalPlay> @@ -38,9 +61,7 @@ <lblTabConfig type='str'>Configuration</lblTabConfig> <lblTabSound type='str'>Audio</lblTabSound> <lblTabVersion type='str'>Versions</lblTabVersion> - <lblUsedChannel type='str'>Votre wifi utilise le cannal :</lblUsedChannel> <lblVersions type='str'>Versions installées</lblVersions> - <lblWifiAvoidance type='str'>Eviter le canal wifi n° :</lblWifiAvoidance> <name_to_read type='str'>Gestion de la mémoire flash</name_to_read> <norf type='str'>Pas de connexion RF</norf> <nowavs type='str'>Pas de fichier à enregistrer</nowavs> @@ -50,7 +71,7 @@ <soundProg1 type='str'>Enregistrement du son ...</soundProg1> <soundTOC type='str'>Ecriture des index</soundTOC> <speaker_name type='str'>Bruno8k</speaker_name> - <toobig type='str'>Il y a trop de fichiers</toobig> + <toobig type='str'>La durée dépasse 70 sec.</toobig> <treeFile type='str'>Fichier</treeFile> <treeVersionProg type='str'>Composant</treeVersionProg> <treeVersionVer type='str'>Version</treeVersionVer> Modified: software/gadgets/flash_management/trunk/flash_management/strings.xml =================================================================== --- software/gadgets/flash_management/trunk/flash_management/strings.xml 2008-01-04 13:49:15 UTC (rev 825) +++ software/gadgets/flash_management/trunk/flash_management/strings.xml 2008-01-04 14:00:09 UTC (rev 826) @@ -6,7 +6,7 @@ <Warning type='str'>Warning</Warning> <btnSoundAdd type='str'>Add</btnSoundAdd> <btnSoundClear type='str'>Clear list</btnSoundClear> - <btnSoundModify type='str'>Modify</btnSoundModify> + <btnSoundModify type='str'>Replace</btnSoundModify> <btnSoundPlayNum type='str'>Play</btnSoundPlayNum> <btnSoundRemove type='str'>Remove</btnSoundRemove> <btnSoundStore type='str'>Store</btnSoundStore> @@ -25,9 +25,6 @@ <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> <help_text type='str'> </help_text> - <lblSleepDelay type='str'>Active the sleep mode after a inactivity period of</lblSleepDelay> - <lblSleepStateSleep type='str'>Tux is currently sleeping</lblSleepStateSleep> - <lblSleepStateWork type='str'>Tux isn't in sleep mode</lblSleepStateWork> <lblSoundExternal type='str'>Play external wave file</lblSoundExternal> <lblSoundExternalFile type='str'>File :</lblSoundExternalFile> <lblSoundExternalPlay type='str'>Play</lblSoundExternalPlay> @@ -38,9 +35,7 @@ <lblTabConfig type='str'>Configuration</lblTabConfig> <lblTabSound type='str'>Audio</lblTabSound> <lblTabVersion type='str'>Versions</lblTabVersion> - <lblUsedChannel type='str'>Your wifi use the channel :</lblUsedChannel> <lblVersions type='str'>Installed versions</lblVersions> - <lblWifiAvoidance type='str'>Avoid the wifi channel number :</lblWifiAvoidance> <name_to_read type='str'>Flash memory management</name_to_read> <norf type='str'>Tux cannot be found. Please connect the dongle and/or switch on Tux</norf> @@ -51,7 +46,7 @@ <soundProg1 type='str'>Recording ...</soundProg1> <soundTOC type='str'>Writing indexes ...</soundTOC> <speaker_name type='str'>Ryan8k</speaker_name> - <toobig type='str'>Wavs files are too big ...</toobig> + <toobig type='str'>The total duration exceeds 70 sec.</toobig> <treeFile type='str'>File</treeFile> <treeVersionProg type='str'>Component</treeVersionProg> <treeVersionVer type='str'>Version</treeVersionVer> Modified: software/gadgets/flash_management/trunk/flash_management.tgf =================================================================== (Binary files differ) |
From: jaguarondi <c2m...@c2...> - 2008-01-04 13:49:15
|
Author: jaguarondi Date: 2008-01-04 14:49:15 +0100 (Fri, 04 Jan 2008) New Revision: 825 Modified: api/python/trunk/tuxapi_class.py api/python/trunk/tuxapi_const.py Log: * Added a mapping of the daemon command led_set() in order to test the new LED effects. The other LED functions have been updated to use the default effect. Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2008-01-04 13:11:19 UTC (rev 824) +++ api/python/trunk/tuxapi_class.py 2008-01-04 13:49:15 UTC (rev 825) @@ -1851,6 +1851,21 @@ return self.cmd_ack() #-------------------------------------------------------------------------- + # Send an extended structured command to tux + #-------------------------------------------------------------------------- + def estructured(self,fct,cmd,param1,param2,param3, param4=0, param5=0, + param6=0, param7=0, param8=0, param9=0, param10=0): + if not self.parent.daemon.connected: + return 2 + data=(DEST_TUX,SD_DEFAULT,DATA_TP_CMD,SUBDATA_TP_STRUCT, \ + fct,cmd,param1,param2,param3,param4,param5,param6, + param7,param8,param9,param10) + self.parent._sock_send_frame("".join( [chr(x) for x in data] )) + if self.no_ack: + return 2 + else: + return self.cmd_ack() + #-------------------------------------------------------------------------- # Send a raw command to tux #-------------------------------------------------------------------------- def raw(self,cmd,param1,param2,param3): @@ -2290,7 +2305,7 @@ >>> tux.cmd.leds_on() """ self.last_ack=self.structured(TUX_CMD_STRUCT_LEDS, \ - TUX_CMD_STRUCT_SUB_ON,0,0,0) + TUX_CMD_STRUCT_SUB_SET,3,255,3) #-------------------------------------------------------------------------- # Send a command to tux for blinking the leds @@ -2320,7 +2335,7 @@ >>> tux.cmd.leds_off() """ self.last_ack=self.structured(TUX_CMD_STRUCT_LEDS, \ - TUX_CMD_STRUCT_SUB_OFF,0,0,0) + TUX_CMD_STRUCT_SUB_SET,3,0,3) #-------------------------------------------------------------------------- # Send a command to tux for turning the leds on during a specified time @@ -2369,8 +2384,8 @@ Example: >>> tux.cmd.ledl_on() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_LEDL, \ - TUX_CMD_STRUCT_SUB_ON,0,0,0) + self.last_ack=self.structured(TUX_CMD_STRUCT_LEDS, \ + TUX_CMD_STRUCT_SUB_SET, 1, 255, 3) #-------------------------------------------------------------------------- # Send a command to tux for turning the left led off @@ -2382,8 +2397,8 @@ Example: >>> tux.cmd.ledl_off() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_LEDL, \ - TUX_CMD_STRUCT_SUB_OFF,0,0,0) + self.last_ack=self.structured(TUX_CMD_STRUCT_LEDS, \ + TUX_CMD_STRUCT_SUB_SET, 1, 0, 3) #-------------------------------------------------------------------------- # Send a command to tux for turning the left led on during a specified time @@ -2433,8 +2448,8 @@ Example: >>> tux.cmd.ledr_on() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_LEDR, \ - TUX_CMD_STRUCT_SUB_ON,0,0,0) + self.last_ack=self.structured(TUX_CMD_STRUCT_LEDS, \ + TUX_CMD_STRUCT_SUB_SET,2,255,3) #-------------------------------------------------------------------------- # Send a command to tux for turning the right led off @@ -2446,8 +2461,8 @@ Example: >>> tux.cmd.ledr_off() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_LEDR, \ - TUX_CMD_STRUCT_SUB_OFF,0,0,0) + self.last_ack=self.structured(TUX_CMD_STRUCT_LEDS, \ + TUX_CMD_STRUCT_SUB_SET,2,0,3) #-------------------------------------------------------------------------- # Send a command to tux for turning the right led on during a specified @@ -2489,6 +2504,87 @@ self.parent.daemon.free_thread_list.append(t) #-------------------------------------------------------------------------- + # Mapping of the daemon command to set the LEDs. + #-------------------------------------------------------------------------- + def led_set(self, leds, intensity, effect_type, effect_speed, effect_step): + """ + Set the LEDs intensity with an effect. This is the raw function + provided by the daemon and is not the easiest to use. See the daemon + API documentation for details. New functions have to be created and + this one probably will have to be removed or kept for debug purposes + only. + + We don't send floats through TCP/IP (effect_speed and effect_step), we + just multiply by 16 and divide by the same value on the other side. So + the boundaries are 1/16 to 15. + + Parameters: + See the daemon API for details. + "leds" as enum : Which LEDs are affected by the command + (0=LED_NONE, 1=LED_LEFT, 2=LED_RIGHT, + 3=LED_BOTH) + intensity as int 8bits : Value of the intensity the LEDs should be + set to (0..255). + effect_type : Fading or gradient effect applied when + changing the intensity. The values are: + - 0=UNAFFECTED Don't update the effect + parameters. This can either be the + last effect set by software, or by + firmware in the autonomous mode. This + is probably not what you want. + - LAST=1 Last effect requested by + software. + - NONE=2 Don't use effects, equivalent + to on/off mode. + - DEFAULT=3 Default effect which is a + short fading effect. + - FADE_DURATION=4 Fading effect, + 'effect_speed' sets the duration (in + seconds) the effect will last. + - FADE_RATE=5 Fading effect, + 'effect_speed' sets the rate of the + effect. Its value represents the + number of seconds it takes to apply the + effect from off to on. So the actual + effect duration will take less time + than specified if the intensity starts + or ends at intermediate values. + Therefore this parameter guarantees a + constant rate of the effect, not the + duration. + - GRADIENT_NBR=6 Gradient effect, the + intensity changes gradually by a number + of steps given by 'effect_step'. + 'effect_speed' represents the number of + seconds it should take to apply the + effect. + - GRADIENT_DELTA=7 Gradient effect, the + intensity changes by a delta value of + 'effect_step'. + effect_speed : See above. + effect_step : See above. + + Example: + >>> tux.cmd.led_set(3, 0xFF, 4, 0.5, 0) + """ + if effect_speed > 15: + effect_speed = 15 + if effect_speed < 1.0/16: + effect_speed = 1.0/16 + if effect_step > 255: + effect_step = 255 + self.last_ack=self.estructured(TUX_CMD_STRUCT_LEDS, + TUX_CMD_STRUCT_SUB_SET, leds, intensity, effect_type, + int(effect_speed*16), effect_step) + + #-------------------------------------------------------------------------- + # Mapping of the daemon command to pulse the LEDs. + #-------------------------------------------------------------------------- + def led_pulse(self): + # XXX to write + pass + + #-------------------------------------------------------------------------- # Send a command to tux for playing a sound from the flash memory #-------------------------------------------------------------------------- def sound_play(self,index,volume=0): Modified: api/python/trunk/tuxapi_const.py =================================================================== --- api/python/trunk/tuxapi_const.py 2008-01-04 13:11:19 UTC (rev 824) +++ api/python/trunk/tuxapi_const.py 2008-01-04 13:49:15 UTC (rev 825) @@ -314,6 +314,8 @@ TUX_CMD_STRUCT_SUB_CLOSE = 0x0D TUX_CMD_STRUCT_SUB_DOWN = 0x0D TUX_CMD_STRUCT_SUB_ERASE = 0x0E +TUX_CMD_STRUCT_SUB_SET = 0x0F +TUX_CMD_STRUCT_SUB_PULSE = 0x10 # Tux request information TUX_REQ_INFO_VERSION = 0x01 |
From: jaguarondi <c2m...@c2...> - 2008-01-04 13:11:31
|
Author: jaguarondi Date: 2008-01-04 14:11:19 +0100 (Fri, 04 Jan 2008) New Revision: 824 Modified: firmware/hex_dev/tuxcore.eep firmware/hex_dev/tuxcore.hex Log: * Updated tuxcore to get the new LEDs functionalities. Modified: firmware/hex_dev/tuxcore.eep =================================================================== --- firmware/hex_dev/tuxcore.eep 2008-01-04 11:39:33 UTC (rev 823) +++ firmware/hex_dev/tuxcore.eep 2008-01-04 13:11:19 UTC (rev 824) @@ -1,14 +1,14 @@ :100000001831331A00144102000012900400000A53 :100010001B350000003E020000FF00000000000051 -:100020009A021E00FF000000000000000000000017 -:100030009A021E00FF000000000000000000000007 -:100040009A021E00FF0000000000000000000000F7 -:1000500041020000009A0432000090030000FF03F8 +:10002000D003010A00D303021EFF000000000000FD +:10003000D003010A00D303021EFF000000000000ED +:10004000D003010A00D303021EFF000000000000DD +:100050004102000000D30304320090030000FF03BC :10006000900200000041020000FF00000000000AB2 :1000700038900100FF0000000000000000000000B8 :1000800033900500FF0000000000000000000000A9 -:100090001A000000FF000000000000000000000047 -:1000A0001B000000FF000000000000000000000531 +:10009000D103FF00FF00000000000000000000008E +:1000A000D1030000FF000000000000000000000578 :1000B000900600000541020000FF00000000000A59 :1000C000900700000A410200000A80020500FF0AB2 :1000D000900800000A410200000080020500FF01B4 Modified: firmware/hex_dev/tuxcore.hex =================================================================== --- firmware/hex_dev/tuxcore.hex 2008-01-04 11:39:33 UTC (rev 823) +++ firmware/hex_dev/tuxcore.hex 2008-01-04 13:11:19 UTC (rev 824) @@ -1,423 +1,466 @@ -:1000000019C064C719C489C342C443C32EC02EC0DB -:100010002CC02BC02AC029C028C027C0ACC725C00F -:1000200024C023C022C021C020C02FC21EC01DC0BA -:100030003CC61BC011241FBECFEFD4E0DEBFCDBF36 -:1000400011E0A0E0B1E0E0EFF9E102C005900D920F -:10005000A835B107D9F712E0A8E5B1E001C01D92BB -:10006000AC30B107E1F73BD0C2CCCACF1F920F92A0 -:100070000FB60F9211242F933F938F9380915E01BF -:100080008F5F80935E0121E030E03093590120932F -:100090005801893199F410925E0130935B012093ED -:1000A0005A0180915F018F5F80935F018A3031F444 -:1000B00010925F0130935D0120935C018F913F911D -:1000C0002F910F900FBE0F901F901895269A87B111 -:1000D0008C6087B92F9A87E08BBB78940895CFEF17 -:1000E000D4E0DEBFCDBF6CD281D882E08093B00077 -:1000F00096E09093B1001092B2009DE79093B30008 -:1001000080937000E3DFF0D186DA90D582D88091B9 -:10011000580190915901892B19F1109259011092AF -:10012000580112D4809186018111E3D18091DC01C4 -:10013000882329F08091DC0181508093DC0180913B -:100140009101882319F081508093910184D480918A -:100150000D01882321F088B1837F88B901C070D454 -:1001600080915A0190915B01892B81F010925B0183 -:1001700010925A0191E090938F018091010288239F -:1001800029F08150809301029093000280915C01DC -:1001900090915D01892B21F010925D0110925C011C -:1001A00080918F01882309F407C180910B01909100 -:1001B0000C01892B09F000C110928F01E09115010B -:1001C000F091160193818481981709F0F5C081E0C0 -:1001D00080936B0161ECCF0139D6609176018091FB -:1001E00015019091160132D6609177018091150129 -:1001F000909116012BD66091780180911501909114 -:10020000160124D660EC80911501909116011ED63E -:1002100063B1809115019091160118D666B1809155 -:1002200015019091160112D669B180911501909136 -:1002300016010CD663EC809115019091160106D63B -:10024000609187018091150190911601FFD5609111 -:1002500088018091150190911601F8D560918A016D -:100260008091150190911601F1D564EC80911501F2 -:1002700090911601EBD560918C01809115019091C0 -:100280001601E4D5609180018091150190911601CD -:10029000DDD560E08091150190911601D7D5809150 -:1002A000850180FF1EC08E7F8093850162EC809166 -:1002B000150190911601CAD560917A0180911501BE -:1002C00090911601C3D560917901809115019091AB -:1002D0001601BCD560917B018091150190911601AA -:1002E000B5D58091850181FF1EC08D7F80938501EA -:1002F00067EC8091150190911601A8D560917D0160 -:100300008091150190911601A1D560917C01809199 -:100310001501909116019AD560917E018091150189 -:100320009091160193D5809184018823F1F081503A -:100330008093840165EC809115019091160186D51A -:1003400060917F0180911501909116017FD5609198 -:100350008401809115019091160178D560917F01FB -:10036000809115019091160171D580918E0188239D -:10037000E1F0815080938E016FEF80911501909193 -:10038000160164D560918E0180911501909116013E -:100390005DD560E0809115019091160157D560E020 -:1003A000809115019091160151D58091860181604F -:1003B0008093860110926B0111D48091700181119C -:1003C000ACD81CDA80910B0190910C01029709F0D6 -:1003D0009ECE80910102882309F099CEF894109264 -:1003E00068001DBA10927A0080916C01837F80931F -:1003F0006C0101D777D00FD1ECD170D1B5D19091EC -:10040000640089EE8093640080E280936B0081E059 -:100410008BBB8091680081608093680083B7817F87 -:10042000846083BF83B7816083BF7894889583B7E6 -:100430008E7F83BF90936400F9D3C2D047DE54D03F -:1004400083E090E090930C0180930B0182E0809315 -:1004500001025DCE909361018093600108958FE861 -:1004600080937A00089510927A00089580937C001A -:10047000EAE7F0E08081806480830895209178002D -:10048000822F20917900922F08951F920F920FB61C -:100490000F9211242F933F934F935F936F937F930A -:1004A0008F939F93AF93BF93EF93FF93E09160017E -:1004B000F09161010995FF91EF91BF91AF919F91EB -:1004C0008F917F916F915F914F913F912F910F90FD -:1004D0000FBE0F901F9018958091860182608093C7 -:1004E00086010895C0DF08958CE692E0B3DFB7DFA0 -:1004F000089580916201882339F4809186018E7F6E -:100500008093860186E02EC0813099F5B7DF9C018B -:1005100088B1817080937B012932310528F440999C -:100520000BC0409A389A08C083E0283E380720F074 -:10053000409B02C0409838982093790130937A010B -:1005400080918501816080938501809186018D7FF6 -:100550008093860180918101882319F081E0809346 -:10056000630187E083DF809162018F5F8093620186 -:100570000895823021F580918101882319F081E06E -:10058000809363017BDF80937C0190937D01809158 -:100590006301882321F081E080937E0102C01092E4 -:1005A0007E011092630180918501826080938501B4 -:1005B000809186018D7F809386011092620108955B -:1005C0003998419A8AB18F738AB98BB1806C8BB993 -:1005D00084B1877E84B985B1886185B953985B9A67 -:1005E00088E180936B00E8E6F0E0808181608083A1 -:1005F00082E080936C0080818260808380E88093B9 -:100600006D00808184608083E9E6F0E0808188600D -:100610008083E99A08954198399A8BB18F738BB989 -:100620008AB1806C8AB985B1877E85B984B18861C9 -:1006300084B95B98539A0895809181018D7F80934E -:1006400081018BB18C7F8BB908959091810192606B -:100650009093810180938701109265015998589A6F -:1006600008954E9B04C04F9B02C082E003C04F9987 -:1006700003C081E0EADF089582E080938701089556 -:100680004F9B03C081E0E1DF089582E08093870102 -:1006900008951F920F920FB60F9211248F934F99C6 -:1006A00004C081E080930D0102C010920D01809181 -:1006B0008701882369F0815080938701882341F462 -:1006C0008BB18C7F8BB95898599A84E080936501DF -:1006D0008F910F900FBE0F901F9018958091810100 -:1006E0008D7F809381018BB18C7F8BB90895909120 -:1006F000810192609093810180938801109266013C -:100700005898599A08951C9902C081E0F0DF089525 -:100710001B9902C081E0EBDF08951F920F920FB684 -:100720000F9211248F939F9383B199278095909571 -:1007300088719070892B89F080918801882369F0F5 -:10074000815080938801882341F48BB18C7F8BB9D1 -:100750005998589A88E0809366019F918F910F90E5 -:100760000FBE0F901F901895809181018B7F809311 -:10077000810180918B018E7F80938B015C982898FA -:1007800008959091810194609093810180938A01F2 -:1007900060930001109267015C9880918B018160E9 -:1007A00080938B0108958FEF8093890165E082E04B -:1007B000E8DF089580918001882319F465E081E0E5 -:1007C000E0DF089580918001813011F465E0D9DF88 -:1007D0000895809181018E7F8093810180918B01AA -:1007E000897F80938B0185B1897F85B90895909128 -:1007F00081019160909381011092690180938C0135 -:100800006093010180918B018B7F826080938B01CB -:1008100008959091810191609093810191E090936E -:10082000690180938C016093010180918B018D7F20 -:10083000846080938B0108951F920F920FB60F92E0 -:1008400011248F939F9380918C018823C9F081504C -:1008500080938C018823A1F490918B01997F9093D0 -:100860008B0185B1897F85B98AE080936801809189 -:100870006901882311F4946001C0926090938B0108 -:100880009F918F910F900FBE0F901F9018951F9200 -:100890000F920FB60F9211242F933F934F938F9384 -:1008A0009F93319947C080910001882331F0809156 -:1008B000800191E089278093800140918901442340 -:1008C00021F180918A018130E9F480918D018823A2 -:1008D00099F0242F3327992740972817390764F474 -:1008E000809180018E7F8093800110928901109207 -:1008F0008D0110928A0112C040938D018FEF809379 -:10090000890118C08FEF8093890180918A01882323 -:1009100089F0815080938A01882361F480918B0152 -:100920008E7F80938B015C98289828985C9A84E04D -:10093000809367019F918F914F913F912F910F90DD -:100940000FBE0F901F901895909164018091000147 -:10095000981709F4289880910101981719F485B126 -:10096000897F85B9892F8F5F80936401863039F440 -:100970001092640185B190918B01892B85B980918A -:100980008901882361F0815080938901882339F49B -:1009900080918B018E7F80938B015C982898809149 -:1009A0006701882341F0815080936701882319F4FF -:1009B000DBDE1092000180916501882369F081508F -:1009C00080936501882341F4809181018D7F80931C -:1009D00081018BB18C7F8BB980916601882369F08E -:1009E000815080936601882341F4809181018D7F3D -:1009F000809381018BB18C7F8BB9809168018823B2 -:100A000031F0815080936801882309F4E2DE089573 -:100A1000982F80916D01882391F4992381F0292FDB -:100A2000215080916C019CE0892780936C012223E6 -:100A300031F060936D0160936E0120936F01089512 -:100A400098B120916C0183EF8227982398B988B1DF -:100A5000822B88B9089580916D018823B1F081506F -:100A600080936D01882389F480916C019CE0892733 -:100A700080936C0180916F01815080936F01882376 -:100A800021F080916E0180936D010895382FDB0174 -:100A9000A80FB11D20E00CC080917001E82FFF2746 -:100AA000E856FE4F9E9190838F5F809370012F5F79 -:100AB000231791F70895CF93DF9380916B018823DB -:100AC000A9F5209171012223A1F511C0E92FFF277B -:100AD000DF01A854BE4F8C91E052FE4F80839F5F90 -:100AE0009217A1F79093E801109297011CC0E09132 -:100AF0001501F0911601938184819817B9F0C0EE29 -:100B0000D1E01882BE018091150190911601BDD1EE -:100B1000219681E0C43ED807A1F784E08093E801E4 -:100B200081E08093970181E090E005C080E090E053 -:100B300002C090E0CBCFDF91CF910895CF93DF93A8 -:100B400092D0F8948091DD018D7F8093DD018091BA -:100B5000DD0181608093DD017894C0E0D0E0809178 -:100B6000DD0180FD1EC08091DD0182FF0BC0F89485 -:100B70008091DD018B7F8093DD01789486E0809306 -:100B8000DC0127C08091DD0181FF03C080E090E09F -:100B900022C069D0F8948091DD0181608093DD01ED -:100BA000789480E1C030D80711F02196D8CF109208 -:100BB000BC008091DD018E7F8093DD018091DD019D -:100BC0008D7F8093DD018091DD018B7F8093DD013E -:100BD00020D181E090E0DF91CF910895CF93DF9312 -:100BE0008091DD0180FD1FC08091DC018823D9F454 -:100BF00062DF8823C1F0A2DF90919701882379F00A -:100C0000913089F4C0EED1E0699180911501909105 -:100C100016011CD181E0C43ED80729F0F5CF9923F5 -:100C200011F410927101DF91CF9108958091DD014F -:100C300082608093DD01EDD086E495E00AD084E106 -:100C40008093DF0108951092B90080E28093B8008C -:100C500008959093730180937201089590937501A4 -:100C6000809374010895CF93DF93CDB7DEB72197BA -:100C70000FB6F894DEBF0FBECDBF198203C08981C5 -:100C80008F5F898389818832D0F38091DD0180FD77 -:100C900003C085EE8093BC0021960FB6F894DEBFAA -:100CA0000FBECDBFDF91CF9108951F920F920FB667 -:100CB0000F9211242F933F934F935F936F937F93E2 -:100CC0008F939F93AF93BF93EF93FF938091DD0139 -:100CD00081608093DD01E091B900E695E695E695A7 -:100CE000FF27EE0FFF1FE95EFE4F0190F081E02D20 -:100CF00009941092DE018091DF010EC09091DE0117 -:100D00008091E801981760F4E92FFF27E052FE4F29 -:100D100080819F5F9093DE018093BB0085EC5CC077 -:100D200085ED8093BC008091DD018E7F8093DD0195 -:100D30008091DD01826059C001C000C08091DD0159 -:100D400084608093DD014BC03FC052C051C001C0E0 -:100D500000C01092E9018091DD01877F8093DD0161 -:100D6000809170018D3178F012C08091E9019091ED -:100D7000BB00E82FFF27E651FE4F90838F5F8093E3 -:100D8000E901883020F48091BC00806425C0809106 -:100D9000BC008F7B21C08091DD0188608093DD01E4 -:100DA00013C08091DD0183FD0FC08091E901843083 -:100DB00059F4E0917201F09173016AEE71E00995C6 -:100DC00003C002C001C000C08091DD018E7F80930E -:100DD000DD018091BC00856C8093BC0009C085ED6D -:100DE0008093BC008091DD018E7F8093DD0100C087 -:100DF000FF91EF91BF91AF919F918F917F916F91F3 -:100E00005F914F913F912F910F900FBE0F901F90C8 -:100E100018951092B90080E28093B80085E5809320 -:100E2000BA0085EC8093BC000895FC011382148203 -:100E30000895FC0120E030E083819481891B928138 -:100E4000891711F421E030E0C9010895DC01FC01AB -:100E5000238192818481F22FF81BF91719F481E024 -:100E600090E00895E22FFF27892F99270197E82323 -:100E7000F9238D919C911197E80FF91F60832F5FE3 -:100E8000FD01238380E090E00895CF93DF93DC01A0 -:100E9000EC012C818B81281719F482E090E013C0BB -:100EA000E22FFF27ED018A8199270197E823F92393 -:100EB0008D919C91E80FF91F8081FB0180832F5F4A -:100EC0002C8380E090E0DF91CF9108951F920F92E4 -:100ED0000FB60F9211248F939F938091F80183FF97 -:100EE00004C080E88093F7013FC08091F80184FF3F -:100EF0001EC085B58E7F85BD8091F7018095982FA6 -:100F00009695880F891B8093F6018091F8018F7E5A -:100F10008093F8018091F80180628093F8018CE061 -:100F20008093F5011092FA011092F9011DC0809191 -:100F3000F80185FF0EC08091F6018093F70185B519 -:100F4000816085BD8091F8018F7B8093F801E898DE -:100F50000BC08FEF8093F70185B5816085BD8091CF -:100F6000F80180618093F8019F918F910F900FBEDF -:100F70000F901F9018951F920F920FB60F92112489 -:100F80002F933F934F938F939F935D988091F70199 -:100F9000882321F08091F701815013C08091F801DE -:100FA00080FFBCC08091F80186FF0EC08091F801DF -:100FB00088608093F8018091F8018F798093F8011F -:100FC00080E88093F70108C18091F80185FF99C0FE -:100FD0008091F50181508093F5014A9B13C0809167 -:100FE000F9019091FA014091F50121E030E002C051 -:100FF000220F331F4A95E2F7822B932B9093FA012D -:101000008093F9018091F501882309F06AC081E09D -:10101000809384018091F80188608093F801809129 -:10102000F8018F7D8093F80180E88093F70180912B -:10103000F9019091FA01807C97708050914051F4B1 -:101040008091F9019091FA01209102012817B1F0E5 -:1010500080EF12C08091F9019091FA01807C977025 -:101060008050924091F48091F9019091FA01209181 -:101070000201281719F080EE80930A018091F9018E -:101080009091FA018093020134C08091F90190910E -:10109000FA01807C97708050934041F480910A015E -:1010A000813F39F580ED80930A0123C08091F901D9 -:1010B0009091FA0180937F0180917F0180688093F5 -:1010C0007F018091F9019091FA0193FF04C0809112 -:1010D0007F01806403C080917F018F7B80937F01BB -:1010E00008C08091F80180648093F80180E88093C3 -:1010F000F70180916900816080936900E09AE89A25 -:101100006BC08091F80183FF67C08091F801877FF1 -:101110008093F80185B58E7F85BD5EC08091F80112 -:1011200082FF0AC08091F80192E089278093F8013C -:101130008091F8018B7F26C08091F501882349F1C9 -:101140008091F50181508093F5012091F201309159 -:10115000F3014091F50181E090E002C0880F991FF2 -:101160004A95E2F728233923232B21F48091F801B3 -:10117000826003C08091F8018D7F8093F801809197 -:10118000F80184608093F8018091F6018093F70163 -:1011900019C08091F80188608093F8018091F8016E -:1011A00081608093F8018091F8018D7F8093F80130 -:1011B00080E88093F70180916900816080936900E5 -:1011C000E09AE89A8091F80181FF03C084B58062BB -:1011D00002C084B58F7D84BD9F918F914F913F91C7 -:1011E0002F910F900FBE0F901F9018955D98559AF4 -:1011F00008955D9A08955D98089583E084BD88E020 -:1012000085BD16BC88BD83ED87BD82E080936E00EE -:101210000895F3DF81E08093F8018091F801886000 -:101220008093F80180E88093F70185B5816085BDE2 -:10123000E9E6F0E0808181608083E09AE89A089591 -:1012400085B58E7F85BDE898089585B58E7F85BD6F -:10125000E8980895EF92FF920F931F93082FE62EC0 -:1012600085B58E7F85BDE898C8DF1092F8018EE0C5 -:101270008093F5011092F7011092F801006C11278C -:101280001093F3010093F2018091F2019091F30128 -:1012900026E0880F991F2A95E1F79093F301809338 -:1012A000F2018091F2019091F301FF242FE3E222F9 -:1012B000FF248E299F299093F3018093F20182E20B -:1012C0008093F60185B5816085BD1F910F91FF90D8 -:1012D000EF900895CF93DF93FC018081803F09F068 -:1012E00052C0DF011196818183FF07C08091760192 -:1012F00083FD03C081E0809304018C9180FF07C0CF -:101300008091760180FD03C081E0809305018C917E -:1013100081FF07C08091760181FD03C081E0809349 -:1013200006018C9184FF07C08091760184FD03C083 -:1013300081E0809307018C9182FD07C08091760146 -:1013400082FF03C081E0809308018C9185FF0AC071 -:101350008091760185FD0DC081E080930E018C9116 -:1013600085FD07C08091760185FF03C081E08093F1 -:101370000F018C9180937601828180937701838124 -:1013800080937801C7C0803419F481815ED9BFC0D1 -:10139000823311F451D9BBC0833311F462D9B7C081 -:1013A000883311F46DD9B3C0813419F481819FD988 -:1013B000AEC0843311F4A7D9AAC0853311F4A8D9DB -:1013C000A6C0863311F48AD9A2C0803821F4628184 -:1013D0008181D7D99CC0893311F4ECD998C08A3364 -:1013E00011F4F0D994C0813311F4DDD990C0803369 -:1013F00011F4BAD98CC0823821F462818181F7D985 -:1014000086C0833821F46281818103DA80C087330A -:1014100011F4DFD97CC08A3121F480916C018C6099 -:1014200005C08B3131F480916C01837F80936C0116 -:101430006EC08C3121F480916C018460F7CF8D31C6 -:1014400021F480916C018B7FF1CF8E3121F480915A -:101450006C018860EBCF8F3121F480916C01877F24 -:10146000E5CF8A3921F462818181D2DA50C0813995 -:1014700021F462818181EEDE4AC0803911F0823927 -:1014800061F48093B80181818093B9018281809356 -:10149000BA0183E0809371013DC0873BB1F4818143 -:1014A0008160818380818093B80181818093B901BB -:1014B00082818093BA0183E08093710181E090E0A2 -:1014C00090930C0180930B0125C0823081F4C0EF12 -:1014D000DDE1FE012196E4916E2F8091150190913E -:1014E0001601B4DC8DE1CC3FD807A1F0F2CF8F37E5 -:1014F00021F4818180938E010DC08E3359F4E3E095 -:10150000F1E0119281E0EC30F80721F0FACF81E0B0 -:1015100080938F01DF91CF910895CF93DF93CDB763 -:10152000DEB724970FB6F894DEBF0FBECDBFF89498 -:1015300090917001E92FFF27E956FE4F40814295B7 -:1015400046954695437020E030E0BE016F5F7F4FC7 -:10155000992319F41092700114C09150FB01E20F0D -:10156000F11DA92FBB27A856BE4F8C9180832F5FFA -:101570003F4F421768F7909370017894CE0101961F -:10158000A9DE24960FB6F894DEBF0FBECDBFDF9163 -:10159000CF910895FF920F931F93CF93DF93CDB711 -:1015A000DEB724970FB6F894DEBF0FBECDBF8C0117 -:1015B000F62E1BC0D8014C91429546954695437036 -:1015C00020E030E0BE016F5F7F4FFB01E20FF11DB5 -:1015D000D8018D918D0180832F5F3F4F4217A8F76F -:1015E000F21AF7FC04C0CB0175DEFF2019F7249630 -:1015F0000FB6F894DEBF0FBECDBFDF91CF911F9124 -:101600000F91FF90089583E0EDEFF1E0AFEDB0E0D2 -:10161000182EDCD1089583E0EDEFF1E0AFEDB0E0FE -:10162000182ECFD10895A0910902B0910A029D0110 -:101630002F5F3F4F30930A0220930902BAD1802DC9 -:1016400080930402E5E0F2E0D9012F5F3F4FB1D172 -:10165000802D819382E0E930F807B1F730930A02D8 -:10166000209309020895AC01DC01A3D1802D809361 -:10167000010250930A0240930902D5DF81E0809372 -:1016800000020895109202020895809103018823B8 -:1016900051F01092030180E090E0E5DF8091790144 -:1016A00080939001089580910401882329F010927D -:1016B00004018FE190E05CC080910501882329F04E -:1016C000109205018FE290E053C0809106018823BB -:1016D00029F0109206018FE390E04AC08091070143 -:1016E000882329F0109207018FE490E041C0809197 -:1016F0000801882329F0109208018FE590E038C096 -:1017000080910B0190910C018130910549F482E0A8 -:1017100090E090930C0180930B018FE690E028C03D -:10172000039741F48FE790E09EDF10920C01109236 -:101730000B01089580910E01882329F010920E016B -:101740008FE890E015C080910F01882329F0109256 -:101750000F018FE990E00CC090910A01903F51F485 -:1017600081EF80930A0183E0809309018FEA90E082 -:101770007ADF0895903E51F481EE80930A018FEB59 -:1017800090E071DF85E0809309010895903D31F488 -:101790008FEC90E068DF10920A0108958091920129 -:1017A0008823D1F080910901882381F0913F21F4B1 -:1017B0006091900188E003C0609190018CE04ADD67 -:1017C0008091090181508093090104C060919001CA -:1017D00084E040DD10929201089505C064E085E048 -:1017E00092E0D8DE20DF90910402809101029817E8 -:1017F00010F09F3F99F71092000208951F93809177 -:1018000000028111EADF80910102882309F43DDFA3 -:101810008091760182FF03C0DCD710928C01809109 -:101820006A01882391F08091760190916C01946017 -:1018300090936C018091760190916C0182FF02C0BF -:10184000986001C0977F90936C0190917F01809187 -:101850009301981709F4ABC010917F011F73809119 -:101860007F0180917F01809393018091FD01882306 -:1018700019F064E082E0CCD880919501882369F06A -:10188000163159F480916A01882321F481E0809314 -:101890006A0109C010926A0106C01C3321F481E07C -:1018A0008093950102C01092950180916A0188236E -:1018B00009F47DC01432E1F1153298F4103109F4C5 -:1018C00054C0113130F41A3018F11D3009F06FC0D6 -:1018D0003FC0123201F1133230F5103209F067C007 -:1018E00040C0143309F44EC0153340F41632B9F039 -:1018F000163220F1123309F05AC03EC0183309F4F1 -:1019000049C0193309F44CC0163309F050C01CC04B -:10191000109357014CC08091570197D648C08091D1 -:101920005701E5D644C065E0809157012AD73FC0F2 -:1019300060910101809157015AD739C0609101012E -:101940008091570166D733C044D70ED7C7D62FC072 -:1019500090E08091FD01882309F491E09093FD01CE -:1019600026C080916C0198E003C080916C0194E0E6 -:10197000892780936C011BC0809101018823B9F0F5 -:10198000815005C080910101853088F48F5F80937C -:1019900001010DC080910001882349F0815005C0EC -:1019A00080910001853018F48F5F809300011F91B2 -:1019B0000895F999FECFB2BDA1BDF89A119600B471 -:1019C0000895F7DF01921A94E1F70895019003D08A -:1019D0001A94E1F70895F999FECFB2BDA1BD00BCFC -:1019E00011960FB6F894FA9AF99A0FBE0895FFCFA0 -:1019F0000505FF01000000000000000000000000DD -:101A0000BC012000001001EF06790679067E069ED3 -:101A1000067E069E06A406A6069D06A5069C06A7AB -:101A200006A806A906A906B506CB06B506CB06D1BB -:101A300006E106E206E306E406E406EF06EF06EF3B -:081A400006EF06EF06F80601AF -:0C1DF000C8000301C9240201CA00000061 +:1000000019C0D9C871C4AEC39AC45DC32EC02EC076 +:100010002CC02BC02AC09AC5A4C585C521C925C03E +:1000200024C023C022C021C020C049C21EC01DC0A0 +:10003000B1C71BC011241FBECFEFD4E0DEBFCDBFC0 +:1000400011E0A0E0B1E0E6E7FCE102C005900D920E +:10005000A237B107D9F712E0A2E7B1E001C01D92C3 +:10006000A432B107E1F732D005CECACF1F920F926A +:100070000FB60F9211248F939F93809175018F5F1C +:100080008093750191E090937201893179F4109217 +:10009000750190937301809176018F5F8093760153 +:1000A0008A3021F410927601909374019F918F9180 +:1000B0000F900FBE0F901F901895269A87B18C60F5 +:1000C00087B92F9A87E08BBB78940895CFEFD4E05F +:1000D000DEBFCDBF8FD2C9D982E08093B00096E059 +:1000E0009093B1001092B2009DE79093B30080937B +:1000F0007000E3DF13D2E5DBFBD40DD7C9D98091C3 +:1001000072018823F1F0109272017ED480919F01D8 +:10011000811109D28091F601882329F08091F6019E +:1001200081508093F6018091AA01882319F08150B3 +:100130008093AA0190E080910D01811191E0892FB7 +:10014000CBD580917301882371F01092730191E0F7 +:100150009093A80180911B02882329F081508093FD +:100160001B0290931A0280917401882311F010925F +:1001700074018091A801882309F43CC180910B018E +:1001800090910C01892B09F035C11092A801E091E2 +:100190002F01F091300193818481981709F02AC1D1 +:1001A00081E08093840161ECCF01C5D760918D011E +:1001B00080912F0190913001BED76091990180917B +:1001C0002F0190913001B7D760919A0180912F0152 +:1001D00090913001B0D760EC80912F019091300167 +:1001E000AAD763B180912F0190913001A4D766B155 +:1001F00080912F01909130019ED769B180912F019C +:100200009091300198D763EC80912F01909130014B +:1002100092D76091A00180912F01909130018BD7EE +:100220006091A10180912F019091300184D760915C +:10023000A30180912F01909130017DD764EC8091D2 +:100240002F019091300177D76091A50180912F0106 +:100250009091300170D76091970180912F0190911A +:10026000300169D760E080912F019091300163D710 +:100270008091B001882389F11092B0016EEC8091D9 +:100280002F019091300157D76091100180912F017B +:100290009091300150D760911D0180912F01909174 +:1002A000300149D780911F01880F880F880F609116 +:1002B0001E01660F660F682B90911201990F8091B5 +:1002C0001101982B80910D018295807F892B682BDD +:1002D00080912F01909130012ED780919E0180FF57 +:1002E0001EC08E7F80939E0162EC80912F019091C1 +:1002F000300121D76091910180912F0190913001BF +:100300001AD76091900180912F019091300113D7FD +:100310006091920180912F01909130010CD78091D2 +:100320009E0181FF1EC08D7F80939E0167EC8091AE +:100330002F0190913001FFD66091940180912F019F +:1003400090913001F8D66091930180912F019091A6 +:100350003001F1D66091950180912F01909130018B +:10036000EAD680919D018823F1F0815080939D0110 +:1003700065EC80912F0190913001DDD6609196015E +:1003800080912F0190913001D6D660919D0180918E +:100390002F0190913001CFD66091960180912F016D +:1003A00090913001C8D68091A7018823E1F0815057 +:1003B0008093A7016FEF80912F0190913001BBD600 +:1003C0006091A70180912F0190913001B4D660E037 +:1003D00080912F0190913001AED660E080912F0185 +:1003E00090913001A8D680919F01816080939F01F8 +:1003F0001092840168D5809187018111E4D951DB85 +:1004000080910B0190910C01029709F078CE8091B8 +:100410001B02882309F073CEF894109268001DBA6D +:1004200010927A006ED326D877D00FD112D270D125 +:10043000D3D19091640089EE8093640080E2809330 +:100440006B0081E08BBB80916800816080936800C5 +:1004500083B7817F846083BF83B7816083BF7894D3 +:10046000889583B78E7F83BF9093640054D5C2D0A4 +:1004700024DE54D083E090E090930C0180930B0134 +:1004800082E080931B023BCE9093780180937701AA +:1004900008958FE880937A00089510927A00089565 +:1004A00080937C00EAE7F0E0808180648083089597 +:1004B00020917800822F20917900922F08951F9229 +:1004C0000F920FB60F9211242F933F934F935F9388 +:1004D0006F937F938F939F93AF93BF93EF93FF930C +:1004E000E0917701F09178010995FF91EF91BF912B +:1004F000AF919F918F917F916F915F914F913F91BC +:100500002F910F900FBE0F901F90189580919F0113 +:10051000826080939F010895C0DF089586E892E08D +:10052000B3DFB7DF089580917901882339F4809192 +:100530009F018E7F80939F0186E02EC0813099F5C8 +:10054000B7DF9C0188B18170809392012932310517 +:1005500028F440990BC0409A389A08C083E0283E9E +:10056000380720F0409B02C04098389820939001B3 +:100570003093910180919E01816080939E018091D2 +:100580009F018D7F80939F0180919801882319F0AE +:1005900081E080937A0187E083DF809179018F5F2A +:1005A000809379010895823021F580919801882304 +:1005B00019F081E080937A017BDF8093930190931F +:1005C000940180917A01882321F081E08093950144 +:1005D00002C01092950110927A0180919E01826072 +:1005E00080939E0180919F018D7F80939F01109247 +:1005F000790108953998419A8AB18F738AB98BB17C +:10060000806C8BB984B1877E84B985B1886185B9E6 +:1006100053985B9A88E180936B00E8E6F0E0808174 +:100620008160808382E080936C008081826080831F +:1006300080E880936D00808184608083E9E6F0E04B +:10064000808188608083E99A08954198399A8BB1B6 +:100650008F738BB98AB1806C8AB985B1877E85B971 +:1006600084B1886184B95B98539A08958091980108 +:100670008D7F809398018BB18C7F8BB90895909179 +:1006800098019260909398018093A00110927D014F +:100690005998589A08954E9B04C04F9B02C082E01F +:1006A00003C04F9903C081E0EADF089582E08093A0 +:1006B000A00108954F9B03C081E0E1DF089582E02F +:1006C0008093A00108951F920F920FB60F921124EC +:1006D0008F934F9904C081E080930D0102C0109266 +:1006E0000D018091A001882369F081508093A001C1 +:1006F000882341F48BB18C7F8BB95898599A84E048 +:1007000080937D018F910F900FBE0F901F901895D1 +:10071000809198018D7F809398018BB18C7F8BB9EC +:100720000895909198019260909398018093A1010F +:1007300010927E015898599A08951C9902C081E040 +:10074000F0DF599A81E08093800182E0EADF08952A +:100750001B9902C081E0E5DF599A82E08093800115 +:10076000E0DF08951F920F920FB60F9211248F931E +:100770009F9383B199278095909588719070892B6C +:1007800021F18091A101882301F1982F915090933C +:10079000A10180918001882361F0813019F41B99B7 +:1007A00008C004C0823029F41C9903C01092A10132 +:1007B00002C0992351F4109280018BB18C7F8BB9C8 +:1007C0005998589A88E080937E019F918F910F905D +:1007D0000FBE0F901F901895809198018B7F80938A +:1007E00098018091A4018E7F8093A4015C98289841 +:1007F0000895909198019460909398018093A3013B +:100800006093000110927F015C988091A401816047 +:100810008093A40108958FEF8093A20165E082E0A8 +:10082000E8DF089580919701882321F465E081E055 +:10083000E0DF089582E08093A301089580919701FD +:10084000813019F465E0D5DF089582E08093A3013B +:100850000895809198018E7F809398018091A401E2 +:10086000897F8093A40185B1897F85B90895982FE8 +:10087000809198018160809398019093A501809167 +:100880008201813039F44B9B05C0992319F09F5F99 +:100890009093A50110928201609301018091A401BF +:1008A0008B7F82608093A4010895982F8091980196 +:1008B0008160809398019093A501809182018823A3 +:1008C00039F44B9B05C0992319F09F5F9093A501C4 +:1008D00081E080938201609301018091A4018D7F6A +:1008E00084608093A40108951F920F920FB60F9217 +:1008F00011248F939F938091A5018823C9F0815083 +:100900008093A5018823A1F49091A401997F9093ED +:10091000A40185B1897F85B98AE0809381018091A6 +:100920008201882311F4946001C092609093A40125 +:100930009F918F910F900FBE0F901F9018951F924F +:100940000F920FB60F9211242F933F934F938F93D3 +:100950009F9382E080937C01809168008D7F8093DB +:100960006800319947C080910001882331F080915F +:10097000970191E08927809397014091A201442338 +:1009800021F18091A3018130E9F48091A6018823AF +:1009900099F0242F3327992740972817390764F4B3 +:1009A000809197018E7F809397011092A2011092FF +:1009B000A6011092A30112C04093A6018FEF80936D +:1009C000A20118C08FEF8093A2018091A301882318 +:1009D00089F081508093A301882361F48091A40160 +:1009E0008E7F8093A4015C98289828985C9A84E074 +:1009F00080937F019F918F914F913F912F910F9005 +:100A00000FBE0F901F90189590917B01809100016F +:100A1000981709F4289880910101981719F485B165 +:100A2000897F85B9892F8F5F80937B01863039F468 +:100A300010927B0185B19091A401892B85B9809199 +:100A4000A201882361F081508093A201882339F4A8 +:100A50008091A4018E7F8093A4015C982898809156 +:100A60007F01882341F0815080937F01882319F40E +:100A7000B3DE1092000180917D01882369F08150DE +:100A800080937D01882341F4809198018D7F80932C +:100A900098018BB18C7F8BB980917E01882369F09E +:100AA000815080937E01882341F4809198018D7F4D +:100AB000809398018BB18C7F8BB9809181018823C1 +:100AC00031F0815080938101882309F4C2DE809146 +:100AD0007C01882361F0815080937C01882339F464 +:100AE00082E08BBB809168008260809368000895EB +:100AF00091E0909380008AE08093810090936F0052 +:100B0000089510928100EFE6F0E080818D7F808370 +:100B1000429880918501837F8093850180818B7FBE +:100B20008083439808951F920F920FB60F9211245D +:100B30008F939F9388B190918501892B88B99F915C +:100B40008F910F900FBE0F901F9018951F920F92CC +:100B50000FB60F92112442980F900FBE0F901F9066 +:100B600018951F920F920FB60F92112443980F9071 +:100B70000FBE0F901F9018959C01E0E1F1E013C0AB +:100B800020FF02C02E7F05C021FF03C02D7FEDE1B5 +:100B9000F1E091E092834187662329F060878385A5 +:100BA000882309F49487C90183709070892B41F7D9 +:100BB00008959C01E0E1F1E00BC020FF02C02E7F10 +:100BC00005C021FF03C02D7FEDE1F1E0678346837F +:100BD000C90183709070892B81F708959C01E0E131 +:100BE000F1E00DC020FF02C02E7F05C021FF03C031 +:100BF0002D7FEDE1F1E06111648341114583C9016D +:100C000083709070892B71F708959C01E0E1F1E009 +:100C100041E00BC020FF02C02E7F05C021FF03C0B2 +:100C20002D7FEDE1F1E063834183C9018370907012 +:100C3000892B81F70895FC018181882329F1828520 +:100C40008823F9F481E08093B001638120813581AC +:100C5000822F9927462F5527261738F4830F911D89 +:100C6000841795073CF4230F09C0831B910948178B +:100C700059071CF06083118207C0231B20838481E5 +:100C800082878285815082878385882331F08150D5 +:100C90008387882311F481E0848781818823D9F4B4 +:100CA00084858823C1F080858F3F21F08150808723 +:100CB000882319F08185838701C012829681808103 +:100CC000981718F08781838301C0938381E0818323 +:100CD00084818287148608951F93182F809186013E +:100CE000811729F01093860181E08093B00180E1A3 +:100CF00091E0A1DF8DE191E09EDF2091100126308F +:100D000010F0112361F0809185018B7F8093850124 +:100D100080916F008D7F80936F0042980AC0809110 +:100D2000850184608093850180916F00826080934B +:100D30006F0090911D01963010F0112361F08091A9 +:100D40008501877F8093850180916F008B7F8093E1 +:100D50006F0043980AC08091850188608093850167 +:100D600080916F00846080936F002093880090933F +:100D70008A001F910895382FDB01A80FB11D20E0D4 +:100D80000CC080918701E82FFF27EE54FE4F9E9103 +:100D900090838F5F809387012F5F231791F70895CA +:100DA000CF93DF93809184018823A9F52091880156 +:100DB0002223A1F511C0E92FFF27DF01AE52BE4F5C +:100DC0008C91E650FE4F80839F5F9217A1F790931E +:100DD00002021092B1011CC0E0912F01F09130018C +:100DE000938184819817B9F0CAEFD1E01882BE01CF +:100DF00080912F0190913001BDD1219681E0CE3FAD +:100E0000D807A1F784E08093020281E08093B101CA +:100E100081E090E005C080E090E002C090E0CBCFA0 +:100E2000DF91CF910895CF93DF9392D0F894809182 +:100E3000F7018D7F8093F7018091F70181608093A6 +:100E4000F7017894C0E0D0E08091F70180FD1EC0EA +:100E50008091F70182FF0BC0F8948091F7018B7F9E +:100E60008093F701789486E08093F60127C0809103 +:100E7000F70181FF03C080E090E022C069D0F894C0 +:100E80008091F70181608093F701789480E1C03010 +:100E9000D80711F02196D8CF1092BC008091F701AD +:100EA0008E7F8093F7018091F7018D7F8093F7010A +:100EB0008091F7018B7F8093F70120D181E090E052 +:100EC000DF91CF910895CF93DF938091F70180FD5B +:100ED0001FC08091F6018823D9F462DF8823C1F016 +:100EE000A2DF9091B101882379F0913089F4CAEFA3 +:100EF000D1E0699180912F01909130011CD181E066 +:100F0000CE3FD80729F0F5CF992311F4109288012C +:100F1000DF91CF9108958091F70182608093F7016E +:100F2000EDD08BEB96E00AD084E18093F90108952F +:100F30001092B90080E28093B800089590938A01DE +:100F400080938901089590938C0180938B0108957B +:100F5000CF93DF93CDB7DEB721970FB6F894DEBFFE +:100F60000FBECDBF198203C089818F5F89838981BC +:100F70008832D0F38091F70180FD03C085EE809325 +:100F8000BC0021960FB6F894DEBF0FBECDBFDF9137 +:100F9000CF9108951F920F920FB60F9211242F93A5 +:100FA0003F934F935F936F937F938F939F93AF93F1 +:100FB000BF93EF93FF938091F70181608093F701D6 +:100FC000E091B900E695E695E695FF27EE0FFF1F45 +:100FD000EF5CFE4F0190F081E02D09941092F80132 +:100FE0008091F9010EC09091F8018091020298174A +:100FF00060F4E92FFF27E650FE4F80819F5F9093BA +:10100000F8018093BB0085EC5CC085ED8093BC004B +:101010008091F7018E7F8093F7018091F7018260C4 +:1010200059C001C000C08091F70184608093F7012E +:101030004BC03FC052C051C001C000C0109203025B +:101040008091F701877F8093F701809187018D312F +:1010500078F012C0809103029091BB00E82FFF2727 +:10106000EC5FFD4F90838F5F80930302883020F404 +:101070008091BC00806425C08091BC008F7B21C022 +:101080008091F70188608093F70113C08091F70188 +:1010900083FD0FC080910302843059F4E0918901EF +:1010A000F0918A0164E072E0099503C002C001C0BA +:1010B00000C08091F7018E7F8093F7018091BC0082 +:1010C000856C8093BC0009C085ED8093BC00809145 +:1010D000F7018E7F8093F70100C0FF91EF91BF91E0 +:1010E000AF919F918F917F916F915F914F913F91C0 +:1010F0002F910F900FBE0F901F9018951092B9006E +:1011000080E28093B80085E58093BA0085EC8093F7 +:10111000BC000895FC01138214820895FC0120E0B4 +:1011200030E083819481891B9281891711F421E039 +:1011300030E0C9010895DC01FC01238192818481A2 +:10114000F22FF81BF91719F481E090E00895E22FCF +:10115000FF27892F99270197E823F9238D919C91E7 +:101160001197E80FF91F60832F5FFD01238380E053 +:1011700090E00895CF93DF93DC01EC012C818B810B +:10118000281719F482E090E013C0E22FFF27ED0149 +:101190008A8199270197E823F9238D919C91E80F83 +:1011A000F91F8081FB0180832F5F2C8380E090E01A +:1011B000DF91CF9108951F920F920FB60F921124D5 +:1011C0008F939F938091120283FF04C080E88093E5 +:1011D00011023FC08091120284FF1EC085B58E7F30 +:1011E00085BD809111028095982F9695880F891B57 +:1011F00080931002809112028F7E80931202809160 +:1012000012028062809312028CE080930F0210928F +:101210001402109213021DC08091120285FF0EC0AD +:10122000809110028093110285B5816085BD809107 +:1012300012028F7B80931202E8980BC08FEF80938D +:10124000110285B5816085BD809112028061809315 +:1012500012029F918F910F900FBE0F901F901895C3 +:101260001F920F920FB60F9211242F933F934F931B +:101270008F939F935D9880911102882321F0809134 +:101280001102815013C08091120280FF86C08091AC +:10129000120286FF0EC080911202886080931202B3 +:1012A000809112028F798093120280E8809311025C +:1012B000D2C08091120285FF63C080910F028150DD +:1012C00080930F024A9B13C08091130290911402E5 +:1012D00040910F0221E030E002C0220F331F4A95F7 +:1012E000E2F7822B932B9093140280931302809148 +:1012F0000F028823A9F582E080939D01809112025C +:10130000886080931202809112028F7D8093120276 +:1013100080E88093110280911302909114028F73E0 +:10132000809396018091130290911402807C9770B3 +:101330008054974029F480919601806880939601AB +:10134000809113029091140293FF04C08091960142 +:10135000806403C0809196018F7B8093960108C0C2 +:101360008091120280648093120280E880931102BF +:1013700080916900816080936900E09AE89A6BC06F +:101380008091120283FF67C080911202877F809351 +:10139000120285B58E7F85BD5EC08091120282FFEC +:1013A0000AC08091120292E08927809312028091F4 +:1013B00012028B7F26C080910F02882349F1809111 +:1013C0000F02815080930F0220910C0230910D0288 +:1013D00040910F0281E090E002C0880F991F4A956A +:1013E000E2F728233923232B21F480911202826013 +:1013F00003C0809112028D7F8093120280911202AD +:10140000846080931202809110028093110219C0AF +:101410008091120288608093120280911202816092 +:1014200080931202809112028D7F8093120280E8D5 +:101430008093110280916900816080936900E09A35 +:10144000E89A8091120281FF03C084B5806202C0D5 +:1014500084B58F7D84BD9F918F914F913F912F9146 +:101460000F900FBE0F901F9018955D98559A089594 +:101470005D9A08955D98089583E084BD88E085BDF8 +:1014800016BC88BD83ED87BD82E080936E00089511 +:10149000F3DF81E0809312028091120288608093D2 +:1014A000120280E88093110285B5816085BDE9E66E +:1014B000F0E0808181608083E09AE89A089585B5A4 +:1014C0008E7F85BDE898089585B58E7F85BDE898A7 +:1014D0000895EF92FF920F931F93082FE62E85B584 +:1014E0008E7F85BDE898C8DF109212028EE080934F +:1014F0000F021092110210921202006C1127109329 +:101500000D0200930C0280910C0290910D0226E0D6 +:10151000880F991F2A95E1F790930D0280930C0292 +:1015200080910C0290910D02FF242FE3E222FF2410 +:101530008E299F2990930D0280930C0282E2809362 +:10154000100285B5816085BD1F910F91FF90EF90CE +:101550000895CF93DF93FC018081803F09F052C052 +:10156000DF011196818183FF07C080918D0183FD8A +:1015700003C081E0809304018C9180FF07C08091BB +:101580008D0180FD03C081E0809305018C9181FF76 +:1015900007C080918D0181FD03C081E08093060129 +:1015A0008C9184FF07C080918D0184FD03C081E090 +:1015B000809307018C9182FD07C080918D0182FF8D +:1015C00003C081E0809308018C9185FF0AC080915F +:1015D0008D0185FD0DC081E080930E018C9185FD0C +:1015E00007C080918D0185FF03C081E080930F01CA +:1015F0008C9180938D018281809399018381809366 +:101600009A01DEC0803419F4818139D8D6C0823382 +:1016100011F42CD8D2C0833311F43DD8CEC0883316 +:1016200011F448D8CAC0813419F481817AD8C5C070 +:10163000843311F482D8C1C0853311F489D8BDC078 +:10164000863311F465D8B9C0803821F46281818174 +:10165000D0D8B3C0893311F4E5D8AFC08A3311F4C0 +:10166000EDD8ABC0813311F4D6D8A7C0803311F4C4 +:10167000B3D8A3C0823821F462818181F8D89DC09B +:10168000833821F46281818110D997C0873311F4A6 +:10169000E0D893C0823D31F48181438162819927F2 +:1016A00088DA8BC0833D29F4818143816281992747 +:1016B00083C0803D31F481814381628199278EDA34 +:1016C0007CC0813D21F48181628199276DC081397F +:1016D00021F462818181FDDE70C0803911F0823990 +:1016E00061F48093D20181818093D30182818093C0 +:1016F000D40183E08093880163C0873BB1F481818A +:101700008160818380818093D20181818093D30124 +:1017100082818093D40183E08093880181E090E00E +:1017200090930C0180930B014BC0823081F4C0EF89 +:10173000DDE1FE012196E4916E2F80912F019091C1 +:101740003001F9DC8DE1CC3FD807D1F1F2CF8F37F2 +:1017500021F481818093A70133C08E3341F4E3E00B +:10176000F1E0119281E0EC30F80751F1FACF8A31C3 +:1017700011F46FEF03C08B3121F460E083E090E05F +:1017800013C08C3111F46FEF03C08D3121F460E090 +:1017900081E090E009C08E3111F46FEF03C08F310A +:1017A00029F460E082E090E030DA07C08A3941F441 +:1017B0004281618183E090E0DFD981E08093A801DC +:1017C000DF91CF910895CF93DF93CDB7DEB7249704 +:1017D0000FB6F894DEBF0FBECDBFF894909187018D +:1017E000E92FFF27EF54FE4F4081429546954695DD +:1017F000437020E030E0BE016F5F7F4F992319F402 +:101800001092870114C09150FB01E20FF11DA92F26 +:10181000BB27AE54BE4F8C9180832F5F3F4F421742 +:1018200068F7909387017894CE01019692DE249612 +:101830000FB6F894DEBF0FBECDBFDF91CF910895F4 +:10184000FF920F931F93CF93DF93CDB7DEB724970B +:101850000FB6F894DEBF0FBECDBF8C01F62E1BC0B5 +:10186000D8014C91429546954695437020E030E072 +:10187000BE016F5F7F4FFB01E20FF11DD8018D911B +:101880008D0180832F5F3F4F4217A8F7F21AF7FCB4 +:1018900004C0CB015EDEFF2019F724960FB6F89442 +:1018A000DEBF0FBECDBFDF91CF911F910F91FF9093 +:1018B000089583E0E7E1F2E0AFEDB0E0182EC9D182 +:1018C000089583E0E7E1F2E0AFEDB0E0182EBCD17F +:1018D0000895A0912102B09122029D012F5F3F4FF8 +:1018E0003093220220932102A7D1802D80931C02E5 +:1018F000EDE1F2E0D9012F5F3F4F9ED1802D819322 +:1019000082E0E132F807B1F73093220220932102FE +:101910000895AC01DC0190D1802D80931B0250937F +:10192000220240932102D5DF81E080931A020895BC +:1019300080910301882351F01092030180E090E030 +:10194000E8DF809190018093A901089580910401BE +:10195000882329F0109204018FE190E05CC080910F +:101960000501882329F0109205018FE290E053C011 +:1019700080910601882329F0109206018FE390E000 +:101980004AC080910701882329F0109207018FE453 +:1019900090E041C080910801882329F0109208014D +:1019A0008FE590E038C080910B0190910C0181305F +:1019B000910549F482E090E090930C0180930B0133 +:1019C0008FE690E028C0039741F48FE790E0A1DF15 +:1019D00010920C0110920B01089580910E01882342 +:1019E00029F010920E018FE890E015C080910F0150 +:1019F000882329F010920F018FE990E00CC090919C +:101A00000A01903F51F481EF80930A0183E08093B3 +:101A100009018FEA90E07DDF0895903E51F481EE58 +:101A200080930A018FEB90E074DF85E080930901D9 +:101A30000895903D31F48FEC90E06BDF10920A0135 +:101A400008958091AB018823D1F08091090188230A +:101A500081F0913F21F46091A90188E003C0609179 +:101A6000A9018CE036DD8091090181508093090144 +:101A700004C06091A90184E02CDD1092AB010895AF +:101A800005C064E08DE192E0DBDE23DF90911C0273 +:101A900080911B02981710F09F3F99F710921A023D +:101AA00008951F9380911A028111EADF80911B0231 +:101AB000882309F43DDF80918D0182FF03C0C9D6E0 +:101AC0001092A501909196018091AC01981709F4AC +:101AD000B1C08091960187FFADC0109196011F7330 +:101AE00080919601809196018093AC0180911702BC +:101AF000882329F044E062E083E090E03DD88091C3 +:101B0000AE01882369F0163159F48091830188234E +:101B100021F481E08093830109C01092830106C003 +:101B20001C3321F481E08093AE0102C01092AE011B +:101B300080918301882309F47DC01432E1F11532CC +:101B400098F4103109F455C0113130F41A3018F1FD +:101B50001D3009F06FC03FC0123201F1133230F571 +:101B6000103209F067C040C0143309F44EC0153379 +:101B700040F41632B9F0163220F1123309F05AC08F +:101B80003EC0183309F449C0193309F44CC0163368 +:101B900009F050C01CC0109371014CC080917101BC +:101BA0006ED548C080917101BCD544C065E080917C +:101BB00071011FD63FC0609101018091710157D61C +:101BC00039C060910101809171016FD633C041D657 +:101BD00003D69ED52FC090E080911702882309F488 +:101BE00091E09093170226C040E061E082E090E02F +:101BF00004C040E061E081E090E0BED71BC080916E +:101C000001018823B9F0815005C080910101853020 +:101C100088F48F5F809301010DC0809100018823BB +:101C200049F0815005C080910001853018F48F5F24 +:101C3000809300011F910895F999FECFB2BDA1BD17 +:101C4000F89A119600B40895F7DF01921A94E1F71B +:101C50000895019003D01A94E1F70895F999FECF01 +:101C6000B2BDA1BD00BC11960FB6F894FA9AF99ACC +:061C70000FBE0895FFCF36 +:101C76000505FF0100000000000000000000000054 +:101C860000000000010200FF00000000000000004C +:101C960000010200FF0000000000D6012000002A1B +:101CA600016408EE07EE07F3071308F30713081994 +:101CB600081B0812081A0811081C081D081E081E11 +:101CC600082A0840082A08400846085608570858AF +:101CD6000859085908640864086408640864086DAB +:021CE6000801F3 +:0C1DF000C8000302C9360300CA0000004E :00000001FF |
From: jaguarondi <c2m...@c2...> - 2008-01-04 11:39:35
|
Author: jaguarondi Date: 2008-01-04 12:39:33 +0100 (Fri, 04 Jan 2008) New Revision: 823 Added: daemon/trunk/led.c daemon/trunk/led.h daemon/trunk/log.c daemon/trunk/log.h daemon/trunk/status.c daemon/trunk/status.h Removed: daemon/trunk/libs/USBDaemon_log.c daemon/trunk/libs/USBDaemon_log.h Modified: daemon/trunk/Makefile daemon/trunk/libs/USBDaemon_command_tux.c daemon/trunk/libs/USBDaemon_command_tux.h daemon/trunk/libs/USBDaemon_pidfile.c daemon/trunk/libs/USBDaemon_status_table.c daemon/trunk/libs/USBDaemon_status_table.h daemon/trunk/libs/USBDaemon_tcp_server.c daemon/trunk/libs/USBDaemon_usb.c daemon/trunk/main.c daemon/trunk/versioning.c Log: Didn't commit for a while, there's too much for a single commit but I can't split it anymore. Here are the changes: * Added led.[ch] to control the new LED firmware functions with fading effects. All effects should work with led_set(). The pulsing functions are not added yet. * Continued to refactor the status, new files status.[ch] have been added, work in progress. * Moved libs/USBDaemon_log.[ch] to log.[ch]. * Corrected some messages in libs/USBDaemon_usb.c. Modified: daemon/trunk/Makefile =================================================================== --- daemon/trunk/Makefile 2008-01-04 11:39:24 UTC (rev 822) +++ daemon/trunk/Makefile 2008-01-04 11:39:33 UTC (rev 823) @@ -18,9 +18,9 @@ TARGET = tuxd C_INCLUDE_DIRS = -I"/usr/local/include" C_PREPROC = - CFLAGS = -pipe -Wall -Werror -g2 -O0 -DUSB_DEBUG + CFLAGS = -pipe -Wall -Werror -g2 -std=gnu99 -O0 -DUSB_DEBUG LIB_DIRS = -L"/usr/local/lib" - LIBS = -lusb + LIBS = -lusb -lm LDFLAGS = -pipe endif @@ -30,22 +30,24 @@ TARGET = USBDaemon C_INCLUDE_DIRS = C_PREPROC = - CFLAGS = -pipe -Wall -g0 -O2 - LIB_DIRS = - LIBS = -lusb + CFLAGS = -pipe -Wall -g0 -O2 -std=c99 + LIB_DIRS = -L"/usr/local/lib" + LIBS = -lusb -lm LDFLAGS = -pipe -s endif SRC_OBJS = \ $(OBJ_DIR)/main.o \ $(OBJ_DIR)/USBDaemon_usb.o \ + $(OBJ_DIR)/status.o \ $(OBJ_DIR)/USBDaemon_status_table.o \ $(OBJ_DIR)/USBDaemon_pidfile.o \ $(OBJ_DIR)/USBDaemon_command_tux.o \ $(OBJ_DIR)/USBDaemon_tcp_server.o \ $(OBJ_DIR)/supervise.o \ $(OBJ_DIR)/versioning.o \ - $(OBJ_DIR)/USBDaemon_log.o + $(OBJ_DIR)/led.o \ + $(OBJ_DIR)/log.o define build_target @echo Linking... @@ -102,9 +104,15 @@ $(OBJ_DIR)/versioning.o: versioning.c versioning.h $(compile_source) -$(OBJ_DIR)/USBDaemon_log.o: libs/USBDaemon_log.c libs/USBDaemon_log.h +$(OBJ_DIR)/led.o: led.c led.h $(compile_source) +$(OBJ_DIR)/status.o: status.c status.h + $(compile_source) + +$(OBJ_DIR)/log.o: log.c log.h + $(compile_source) + $(OBJ_DIR)/USBDaemon_usb.o: libs/USBDaemon_usb.c \ libs/USBDaemon_usb.h \ libs/USBDaemon_globals.h \ Added: daemon/trunk/led.c =================================================================== --- daemon/trunk/led.c (rev 0) +++ daemon/trunk/led.c 2008-01-04 11:39:33 UTC (rev 823) @@ -0,0 +1,335 @@ +/* + * Tux Droid - USB Daemon + * Copyright (C) 2007 KYSOH S.A. <in...@ky...> + * + * 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$ */ + +#include <assert.h> +#include <math.h> + +#include "led.h" +#include "status.h" +#include "libs/USBDaemon_command_tux.h" +#include "libs/USBDaemon_status_table.h" +#include "tuxdefs/api.h" + +/** Default settings for the fading effect. */ +#define DEFAULT_STEP 1 +/** Default settings for the fading effect. */ +#define DEFAULT_DELAY 1 + +/** Values corresponding to the firmware implementation of the fading effect. + * 'delay' is the delay (4ms time base) before which 'step' is applied. */ +static int delay = DEFAULT_DELAY, step = DEFAULT_STEP; + +/** + * \brief Configure the led effect parameters for a fading effect. + * \param leds Which LEDs should be configured. + * \param fading_delay Delay (in seconds) between 2 increments of intensity + * when fading. + * \return ack of tux command. + * + * One problem is that around 1sec (delay = 1, step = 1, 255 steps to fade from + * off to on), the resolution is quite coarse if we increment step or delay but + * not both simultaneously. We have approximately 0.25s, 0.5s, 1s, 2s, 3s, etc. + * when delay or step is increased. XXX If necessary we can add intermediate + * values by using 3/4 or 2,3,4/5 or even 2,3,7,9/10 and get a 100ms + * resolution, but the gradient (steps) effect starts to be noticeable. + */ +int config_fading(leds_t leds, float fading_delay) +{ + int ack; + float loops = fading_delay / FW_MAIN_LOOP_DELAY; + + /* Can't go infinitely fast. */ + if (loops == 0) + { + step = 0xFF; + delay = 1; + } + /* XXX We only handle the firmware function for now, + * when the delay will be over 255, we should split in 2 + * commands while tracking the time. */ + else if (loops > 255) + { + step = 1; + delay = 255; + } + /* Faster speed, the delay is set to minimum and we need to + * increase the step. */ + else if (loops < 1) + { + delay = 1; + step = roundf(1/loops); + } + else if (loops >= 1) + { + step = 1; + delay = roundf(loops); + } + ack = send_usb_tux_cmd(LED_FADE_SPEED_CMD, leds, delay, step); + return ack; +} + +/** + * \brief Configure the led effect parameters for a gradient effect. + * \param leds Which LEDs should be configured. + * \param delta Intensity increment to apply at each step. + * \param gradient_delay Delay (in seconds) between 2 increments of intensity. + * \return ack of tux command. + */ +int config_gradient(leds_t leds, int delta, float gradient_delay) +{ + int ack; + + /* Preconditions. */ + assert(delta > 0); + assert(delta <= 255); + + delay = roundf(gradient_delay / FW_MAIN_LOOP_DELAY); + /* Can't go infinitely fast. */ + if (delay == 0) + delay = 1; + /* Hardware doesn't support longer delays, we should do them with multiple + * commands if necessary. XXX Not supported for now. */ + if (delay > 255) + delay = 255; + ack = send_usb_tux_cmd(LED_FADE_SPEED_CMD, leds, delay, delta); + return ack; +} + +/** + * \brief Set the intensity of the LEDs. + * \param leds Which LEDs are affected by the command + * \param intensity Value of the intensity the LEDs should be set to. + * \param effect Fading or gradient effect applied when changing the intensity. + * + * \sa The effect types and parameters are described in the documentation of + * effect_type_t. + */ +int led_set(leds_t leds, int intensity, led_effect_t *effect) +{ + int ack; + /* Preconditions */ + assert(LED_NONE <= leds && leds <= LED_BOTH); + assert(0 <= intensity && intensity <= 255); + + switch(effect->type) + { + case UNAFFECTED: + /* Just change the intensity in this case. */ + break; + case LAST: + /* Don't update the parameters but send them in case the standalone + * changed them in the meantime. */ + ack = send_usb_tux_cmd(LED_FADE_SPEED_CMD, leds, delay, step); + /* XXX Due to bugs lying around in the dongle, RF and daemon, + * we can't trust the ack, so disabled for now. */ + /*if (ack != ACK_CMD_OK)*/ + /*return ack;*/ + break; + case NONE: + /* Emulate on/off. */ + step = 0xFF; + delay = 1; + ack = send_usb_tux_cmd(LED_FADE_SPEED_CMD, leds, delay, step); + /* XXX Due to bugs lying around in the dongle, RF and daemon, + * we can't trust the ack, so disabled for now. */ + /*if (ack != ACK_CMD_OK)*/ + /*return ack;*/ + break; + case DEFAULT: + /* Use default settings. */ + step = DEFAULT_STEP; + delay = DEFAULT_DELAY; + ack = send_usb_tux_cmd(LED_FADE_SPEED_CMD, leds, delay, step); + /* XXX Due to bugs lying around in the dongle, RF and daemon, + * we can't trust the ack, so disabled for now. */ + /*if (ack != ACK_CMD_OK)*/ + /*return ack;*/ + break; + case FADE_DURATION: + { + /* Intensity is changed by 'step' each 'delay'*4ms. + * So the duration from I1 to I2 is: + * duration = abs(I2 - I1) * 4ms * delay / step + * The fading delay in seconds is + * fading_delay = delay * 4ms / step + * = duration / abs(I2 - I1) + * + * If both leds are not at the same initial level, we can only + * have the same duration by assigning different parameters to + * each eye. */ + int left_increase, right_increase; + /* Flag that indicates if nothing needs to be done. */ + bool skip = true; + + /* We should use effect NONE if we don't want fading. */ + assert(effect->speed > 0); + left_increase = abs(intensity - get_led_left_intensity()); + right_increase = abs(intensity - get_led_right_intensity()); + /* Don't divide by zero if there's nothing to do ;-). */ + if (leds & LED_LEFT && left_increase) + { + skip = false; + ack = config_fading(LED_LEFT, effect->speed / \ + left_increase); + /* XXX Due to bugs lying around in the dongle, RF and daemon, + * we can't trust the ack, so disabled for now. */ + /*if (ack != ACK_CMD_OK)*/ + /*return ack;*/ + } + if (leds & LED_RIGHT && right_increase) + { + skip = false; + ack = config_fading(LED_RIGHT, effect->speed / \ + right_increase); + } + /* XXX Due to bugs lying around in the dongle, RF and daemon, + * we can't trust the ack, so disabled for now. */ + /*if (ack != ACK_CMD_OK)*/ + /*return ack;*/ + if (skip) + /* Nothing to do then. */ + return ack; + } + break; + case FADE_RATE: + /* Intensity is changed by 'step' each 'delay'*4ms, and it takes + * 255 steps to go from off to on. + * So the duration from off to on is: + * duration = 255 * 4ms * delay / step + * The fading delay in seconds is + * fading_delay = delay * 4ms / step + * = duration / 255 + * Now the delay should be rounded to the closest int or, if + * inferior to 1, we should play with the step in order to + * achieve faster effects. + */ + ack = config_fading(leds, effect->speed / 255); + /* XXX Due to bugs lying around in the dongle, RF and daemon, + * we can't trust the ack, so disabled for now. */ + /*if (ack != ACK_CMD_OK)*/ + /*return ack;*/ + break; + case GRADIENT_NBR: + { + int left_increase, right_increase; + int delta; + /* Flag indicating if nothing needs to be done. */ + bool skip = true; + + /* Preconditions */ + assert(effect->step > 0); + assert(effect->step <= 255); + /* We should use effect NONE if we don't want gradient. */ + assert(effect->speed > 0); + + left_increase = abs(intensity - get_led_left_intensity()); + right_increase = abs(intensity - get_led_right_intensity()); + /* Don't divide by zero if there's nothing to do ;-). */ + if (leds & LED_LEFT && left_increase) + { + skip = false; + delta = roundf(left_increase / effect->step); + /* If we can't have as many steps as required. */ + if (delta == 0) + delta = 1; + ack = config_gradient(LED_LEFT, delta, + effect->speed/effect->step); + /* XXX Due to bugs lying around in the dongle, RF and daemon, + * we can't trust the ack, so disabled for now. */ + /*if (ack != ACK_CMD_OK)*/ + /*return ack;*/ + } + if (leds & LED_RIGHT && right_increase) + { + skip = false; + delta = roundf(right_increase / effect->step); + /* If we can't have as many steps as required. */ + if (delta == 0) + delta = 1; + ack = config_gradient(LED_RIGHT, delta, + effect->speed/effect->step); + } + /* XXX Due to bugs lying around in the dongle, RF and daemon, + * we can't trust the ack, so disabled for now. */ + /*if (ack != ACK_CMD_OK)*/ + /*return ack;*/ + if (skip) + /* Nothing to do then. */ + return ack; + } + break; + case GRADIENT_DELTA: + { + int left_increase, right_increase; + float gradient_delay; + /* Flag indicating if nothing needs to be done. */ + bool skip = true; + + /* Preconditions */ + assert(effect->step > 0); + assert(effect->step <= 255); + /* We should use effect NONE if we don't want gradient. */ + assert(effect->speed > 0); + + left_increase = abs(intensity - get_led_left_intensity()); + right_increase = abs(intensity - get_led_right_intensity()); + /* Don't divide by zero if there's nothing to do ;-). */ + if (leds & LED_LEFT && left_increase) + { + skip = false; + gradient_delay = effect->speed * effect->step / \ + left_increase; + ack = config_gradient(LED_LEFT, effect->step, gradient_delay); + /* XXX Due to bugs lying around in the dongle, RF and daemon, + * we can't trust the ack, so disabled for now. */ + /*if (ack != ACK_CMD_OK)*/ + /*return ack;*/ + } + if (leds & LED_RIGHT && right_increase) + { + skip = false; + gradient_delay = effect->speed * effect->step / \ + right_increase; + ack = config_gradient(LED_RIGHT, effect->step, gradient_delay); + } + /* XXX Due to bugs lying around in the dongle, RF and daemon, + * we can't trust the ack, so disabled for now. */ + /*if (ack != ACK_CMD_OK)*/ + /*return ack;*/ + if (skip) + /* Nothing to do then. */ + return ack; + } + break; + default: + /* Not a correct type. */ + assert(0); + break; + } + ack = send_usb_tux_cmd(LED_SET_CMD, leds, intensity, 0); + return ack; +} + +void led_pulse(void) +{ + /* XXX add pulsing here. */ +} Property changes on: daemon/trunk/led.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: daemon/trunk/led.h =================================================================== --- daemon/trunk/led.h (rev 0) +++ daemon/trunk/led.h 2008-01-04 11:39:33 UTC (rev 823) @@ -0,0 +1,95 @@ +/* + * Tux Droid - USB Daemon + * Copyright (C) 2007 KYSOH S.A. <in...@ky...> + * + * 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$ */ + +/** \file led.h + \brief Blue LEDs control interface. + \ingroup led +*/ + +/** \defgroup led LEDs + The LED module contains the functions that drive the eye LEDs. + There are 2 main functions: + - Setting the LEDs to a given intensity; it's possible to apply an effect + when changing the intensity; + - Pulsing the LEDs, you can choose the period, the intensity range and the + effect. +*/ +/*! @{ */ + +#ifndef _LED_H_ +#define _LED_H_ + +#include "tuxdefs/defines.h" + +/* + * Structure definitions, constants and custom types. + */ + +/** Types of effects applied when changing the intensity of the LEDs. */ +enum effect_type_t +{ + UNAFFECTED, /**< Don't update the effect parameters. This can either be + the last effect set by software, or by firmware in the + autonomous mode. This is probably not what you want. */ + LAST, /**< Last effect requested by software. */ + NONE, /**< Don't use effects, equivalent to on/off mode. */ + DEFAULT, /**< Default effect which is a short fading effect. */ + FADE_DURATION, /**< Fading effect, 'effect.speed' sets the duration (in + seconds) the effect will last. */ + FADE_RATE, /**< Fading effect, 'effect.speed' sets the rate of the + effect. Its value represents the number of seconds it + takes to apply the effect from off to on. So the actual + effect duration will take less time than specified if the + intensity starts or ends at intermediate values. + Therefore this parameter guarantees a constant rate of + the effect, not the duration. + */ + GRADIENT_NBR, /**< Gradient effect, the intensity changes gradually by a + number of steps given by 'effect.step'. 'effect.speed' + represents the number of seconds it should take to apply + the effect. */ + GRADIENT_DELTA, /**< Gradient effect, the intensity changes by a delta + value of 'effect.step'. 'effect.speed' represents the + number of seconds it should take to apply the effect. */ +}; + +/** Fading or gradient effect. This structure holds the type of effect and the + * corresponding parameters. + * \sa The effect types and parameters are described in the documentation of + * effect_type_t. */ +struct led_effect_t +{ + enum effect_type_t type; /**< Type of effect. */ + float speed; /**< Speed of the effect, used in both + gradients and fading effects. */ + int step; /**< Intensity step of the gradient effect. Not + used for the fading effect. */ +}; +typedef struct led_effect_t led_effect_t; + +/* + * Prototypes. + */ +extern int led_set(leds_t leds, int intensity, led_effect_t *effect); +/*! @} */ + +#endif /* _LED_H_ */ Property changes on: daemon/trunk/led.h ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Modified: daemon/trunk/libs/USBDaemon_command_tux.c =================================================================== --- daemon/trunk/libs/USBDaemon_command_tux.c 2008-01-04 11:39:24 UTC (rev 822) +++ daemon/trunk/libs/USBDaemon_command_tux.c 2008-01-04 11:39:33 UTC (rev 823) @@ -27,9 +27,11 @@ #include "USBDaemon_usb.h" #include "USBDaemon_command_tux.h" #include "USBDaemon_globals.h" -#include "USBDaemon_log.h" +#include "../log.h" #include "../tuxdefs/commands.h" #include "USBDaemon_pidfile.h" +#include "../led.h" +#include "../status.h" /*_____________________ D E F I N I T I O N S ______________________________*/ @@ -58,10 +60,6 @@ static void tux_req_status(unsigned char const data[], unsigned char result[]); static void tux_req_info(unsigned char const data[], unsigned char result[]); -static unsigned char send_usb_tux_cmd(unsigned char cmd, unsigned char param1, - unsigned char param2, - unsigned char param3); - /************************************************************************** */ /* COMMANDS FROM CLIENTS DISPATCHER */ /************************************************************************** */ @@ -460,8 +458,31 @@ ACK = send_usb_tux_cmd(LED_OFF_CMD, 0, 0, 0); break; case TUX_CMD_STRUCT_SUB_BLINK: - ACK = send_usb_tux_cmd(LED_BLINK_CMD, data[2], data[3], 0); + { + led_effect_t myeffect; + myeffect.type = DEFAULT; + //ACK = send_usb_tux_cmd(LED_PULSE_CMD, 3, data[2], data[3]); + ACK = led_set(data[2], data[3], &myeffect); + } break; + case TUX_CMD_STRUCT_SUB_SET: + { + led_effect_t effect; + effect.type = data[4]; + /* Workaround to send a float through TCP/IP, just send a + * uint8_t which is the float parameter multiplied by 16, then + * divide it here again. The limitation is of course the range. + */ + effect.speed = (float)data[5]/16; + effect.step = data[6]; + ACK = led_set(data[2], data[3], &effect); + } + break; + case TUX_CMD_STRUCT_SUB_PULSE: + { + /* XXX add pulsing here. */ + } + break; } break; case TUX_CMD_STRUCT_LEDL: @@ -581,10 +602,10 @@ case DATA_STATUS_MOTOR_FOR_WINGS: result[1] = portc.bits.PB1; break; - case DATA_STATUS_LEFT_BLUE_LED: + case DATA_STATUS_LED_LEFT_INTENSITY: result[1] = portc.bits.PB2; break; - case DATA_STATUS_RIGHT_BLUE_LED: + case DATA_STATUS_LED_RIGHT_INTENSITY: result[1] = portc.bits.PB3; break; case DATA_STATUS_HEAD_MOTOR_FOR_MOUTH: Modified: daemon/trunk/libs/USBDaemon_command_tux.h =================================================================== --- daemon/trunk/libs/USBDaemon_command_tux.h 2008-01-04 11:39:24 UTC (rev 822) +++ daemon/trunk/libs/USBDaemon_command_tux.h 2008-01-04 11:39:33 UTC (rev 823) @@ -41,6 +41,9 @@ unsigned char param1, unsigned char param2, unsigned char param3); +extern unsigned char send_usb_tux_cmd(unsigned char cmd, unsigned char param1, + unsigned char param2, + unsigned char param3); extern void tux_audio_init(void); extern unsigned char send_wave_wings(unsigned char count, unsigned char speed); extern unsigned char send_stop_wings(); Deleted: daemon/trunk/libs/USBDaemon_log.c =================================================================== --- daemon/trunk/libs/USBDaemon_log.c 2008-01-04 11:39:24 UTC (rev 822) +++ daemon/trunk/libs/USBDaemon_log.c 2008-01-04 11:39:33 UTC (rev 823) @@ -1,211 +0,0 @@ - -#include "USBDaemon_globals.h" -#include "USBDaemon_log.h" - -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <time.h> -#include <assert.h> -#include <syslog.h> - -/** Name of log file for target LOG_TARGET_TUX */ -#define LOG_FILE "/var/log/" TUX_DAEMON_NAME ".log" - -/** All logged messages are prefixed with this text */ -#define LOG_PREFIX TUX_DAEMON_NAME - -/** Current logging level */ -static log_level_t current_level = LOG_LEVEL_INFO; - -/** Logging level names */ -static const char *level_names[] = -{ - [LOG_LEVEL_DEBUG] = "debug", - [LOG_LEVEL_INFO] = "info", - [LOG_LEVEL_WARNING] = "warning", - [LOG_LEVEL_ERROR] = "error", - [LOG_LEVEL_NONE] = "none" -}; - -/** Logging level to syslog priority mapping */ -static int level_prio[] = -{ - [LOG_LEVEL_DEBUG] = LOG_DEBUG, - [LOG_LEVEL_INFO] = LOG_INFO, - [LOG_LEVEL_WARNING] = LOG_WARNING, - [LOG_LEVEL_ERROR] = LOG_ERR, - [LOG_LEVEL_NONE] = 0 -}; - -/** Current logging target */ -static log_target_t log_target = LOG_TARGET_SHELL; - -/** Log file for target LOG_TARGET_TUX */ -static FILE *log_file; - -/** Whether the log has been opened */ -static bool log_opened; - -/** - * Open the log. - * - * /param[in] target Logging target - * - * /return true if successfull, false otherwise - */ -bool log_open(log_target_t target) -{ - if (log_opened) - return true; - - switch (target) - { - case LOG_TARGET_SYSLOG: - openlog(LOG_PREFIX, 0, LOG_DAEMON); - break; - - case LOG_TARGET_TUX: - log_file = fopen(LOG_FILE, "at"); - if (log_file == NULL) - return false; - break; - - case LOG_TARGET_SHELL: - break; - } - - log_target = target; - log_opened = true; - - return true; -} - -/** - * Close the log. - */ -void log_close(void) -{ - if (!log_opened) - return; - - switch (log_target) - { - case LOG_TARGET_SYSLOG: - closelog(); - break; - - case LOG_TARGET_TUX: - fclose(log_file); - log_file = NULL; - break; - - case LOG_TARGET_SHELL: - break; - } - - log_opened = false; -} - -/** - * Set the logging level. - * - * /param[in] new_level New logging level - */ -void log_set_level(log_level_t new_level) -{ - assert(new_level >= LOG_LEVEL_DEBUG && new_level <= LOG_LEVEL_NONE); - current_level = new_level; -} - -/** - * Get the logging level. - * - * /return current logging level - */ -log_level_t log_get_level(void) -{ - return current_level; -} - -/** - * Log formatted message at the specified level. - * - * /param[in] at_level Level to log the message at - * /param[in] fmt Message format - * /param[in] ... Optional message data - * - * If the priority of the specifed level is lower than the priority - * of the current logging level, the message is silently dropped. - * - * /return true if successful, false otherwise - */ -bool log_text(log_level_t at_level, const char *fmt, ...) -{ - char text[1024], *p = text; - size_t size = sizeof(text); - int prio; - time_t now; - va_list al; - int r; - - /* No need for the log to be 'opened' when logging to std{out,err} */ - if (log_target != LOG_TARGET_SHELL && !log_opened) - return false; - - /* Logging at level NONE has no sense */ - assert(at_level >= LOG_LEVEL_DEBUG && at_level < LOG_LEVEL_NONE); - - if (at_level < current_level) - return true; - - /* Add date & time when LOG_TARGET_TUX */ - if (log_target == LOG_TARGET_TUX) - { - now = time(NULL); - r = strftime(p, size, "%F %T ", localtime(&now)); - if (r == 0) - return false; - - p += r; - size -= r; - } - - /* Only prefix non-INFO level messages */ - if (at_level != LOG_LEVEL_INFO) - { - r = snprintf(p, size, "%s: ", level_names[at_level]); - if (r < 0) - return false; - - p += r; - size -= r; - } - - va_start(al, fmt); - r = vsnprintf(p, size, fmt, al); - va_end(al); - if (r < 0) - return false; - - switch (log_target) - { - case LOG_TARGET_SYSLOG: - prio = level_prio[at_level]; - syslog(prio, "%s", text); - break; - - case LOG_TARGET_TUX: - fprintf(log_file, "%s\n", text); - break; - - case LOG_TARGET_SHELL: - if (at_level == LOG_LEVEL_WARNING || at_level == LOG_LEVEL_ERROR) - fprintf(stderr, "%s\n", text); - else - fprintf(stdout, "%s\n", text); - break; - } - - return true; -} Deleted: daemon/trunk/libs/USBDaemon_log.h =================================================================== --- daemon/trunk/libs/USBDaemon_log.h 2008-01-04 11:39:24 UTC (rev 822) +++ daemon/trunk/libs/USBDaemon_log.h 2008-01-04 11:39:33 UTC (rev 823) @@ -1,38 +0,0 @@ -#ifndef __USBDAEMON_LOG_H__ -#define __USBDAEMON_LOG_H__ - -#include <stdbool.h> - -/** Logging target */ -typedef enum log_target -{ - LOG_TARGET_SYSLOG, - LOG_TARGET_TUX, - LOG_TARGET_SHELL -} log_target_t; - -extern bool log_open(log_target_t target); -extern void log_close(void); - -/** Logging levels, in increasing priorities */ -typedef enum log_level -{ - LOG_LEVEL_DEBUG, - LOG_LEVEL_INFO, - LOG_LEVEL_WARNING, - LOG_LEVEL_ERROR, - LOG_LEVEL_NONE -} log_level_t; - -extern void log_set_level(log_level_t new_level); -extern log_level_t log_get_level(void); - -extern bool log_text(log_level_t at_level, const char *fmt, ...) - __attribute__((format(printf, 2, 3))); - -#define log_debug(fmt, ...) log_text(LOG_LEVEL_DEBUG, (fmt), ## __VA_ARGS__) -#define log_info(fmt, ...) log_text(LOG_LEVEL_INFO, (fmt), ## __VA_ARGS__) -#define log_warning(fmt, ...) log_text(LOG_LEVEL_WARNING, (fmt), ## __VA_ARGS__) -#define log_error(fmt, ...) log_text(LOG_LEVEL_ERROR, (fmt), ## __VA_ARGS__) - -#endif Modified: daemon/trunk/libs/USBDaemon_pidfile.c =================================================================== --- daemon/trunk/libs/USBDaemon_pidfile.c 2008-01-04 11:39:24 UTC (rev 822) +++ daemon/trunk/libs/USBDaemon_pidfile.c 2008-01-04 11:39:33 UTC (rev 823) @@ -31,7 +31,7 @@ #include <signal.h> #include "USBDaemon_globals.h" -#include "USBDaemon_log.h" +#include "../log.h" #define PIDFILE "/var/run/" TUX_DAEMON_NAME ".pid" Modified: daemon/trunk/libs/USBDaemon_status_table.c =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.c 2008-01-04 11:39:24 UTC (rev 822) +++ daemon/trunk/libs/USBDaemon_status_table.c 2008-01-04 11:39:33 UTC (rev 823) @@ -1,6 +1,6 @@ /* * Tux Droid - USB Daemon - * Copyright (C) 2007 C2ME Sa <rem...@c2...> + * Copyright (C) 2007 C2ME S.A. <tux...@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 @@ -28,8 +28,9 @@ #include "USBDaemon_status_table.h" #include "USBDaemon_usb.h" #include "USBDaemon_globals.h" -#include "USBDaemon_log.h" +#include "../log.h" #include "USBDaemon_tcp_server.h" +#include "../status.h" #include "../supervise.h" #include "../versioning.h" #include "../tuxdefs/commands.h" @@ -49,14 +50,6 @@ unsigned char sound_flash_count = 0; /** - * Tux status table. - * - * This hierarchical structure holds all current status of tux and the dongle. - * As soon as a new status is received from tux, the structure is updated. - */ -struct tux_status_t tux_status; - -/** * Status table and settings of the dongle and RF modules */ struct connection_status_t connection_status; @@ -252,6 +245,17 @@ tcp_server_send_raw(tcp_frame); } +static void update_leds(uint8_t const * led_status) +{ + set_led_left_intensity(*led_status++); + set_led_right_intensity(*led_status++); + set_led_left_fading(*led_status & 0x01 ? true : false); + set_led_left_pulsing(*led_status & 0x02 ? true : false); + set_led_right_fading(*led_status & 0x04 ? true : false); + set_led_right_pulsing(*led_status & 0x08 ? true : false); + set_led_mask(*led_status & 0x10 ? true : false); +} + /* TODO Add functions to get the average battery voltage and status */ static void battery_changed(unsigned int const level, unsigned int const loaded) @@ -435,24 +439,10 @@ tcp_server_send_raw(tcp_frame); } - /* right blue led */ - if ((portc.Byte & 0x08) != (new_value & 0x08)) - { - tcp_frame[4] = DATA_STATUS_RIGHT_BLUE_LED; - tcp_frame[5] = !portc.bits.PB3; - log_debug("right blue led %s", tcp_frame[5] ? "on" : "off"); - tcp_server_send_raw(tcp_frame); - } + /* Blue led I/O */ + tux_status.io.left_led = (new_value & 0x04) ? true : false; + tux_status.io.right_led = (new_value & 0x08) ? true : false; - /* left blue led */ - if ((portc.Byte & 0x04) != (new_value & 0x04)) - { - tcp_frame[4] = DATA_STATUS_LEFT_BLUE_LED; - tcp_frame[5] = !portc.bits.PB2; - log_debug("left blue led %s", tcp_frame[5] ? "on" : "off"); - tcp_server_send_raw(tcp_frame); - } - portc.Byte = new_value; } @@ -703,6 +693,10 @@ position2_changed(new_status[1]); break; + case STATUS_LED_CMD: + update_leds(&new_status[1]); + break; + case PONG_CMD: pong_received++; pong_event(new_status[1], pong_received); @@ -734,6 +728,7 @@ new_status[2], new_status[3]); break; } + status_log(); } /************************************************************************ */ Modified: daemon/trunk/libs/USBDaemon_status_table.h =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.h 2008-01-04 11:39:24 UTC (rev 822) +++ daemon/trunk/libs/USBDaemon_status_table.h 2008-01-04 11:39:33 UTC (rev 823) @@ -141,6 +141,8 @@ #define TUX_CMD_STRUCT_SUB_CLOSE 0x0D #define TUX_CMD_STRUCT_SUB_DOWN 0x0D #define TUX_CMD_STRUCT_SUB_ERASE 0x0E +#define TUX_CMD_STRUCT_SUB_SET 0x0F +#define TUX_CMD_STRUCT_SUB_PULSE 0x10 /* Tux request information */ #define TUX_REQ_INFO_VERSION 0x01 @@ -154,7 +156,7 @@ #define DATA_STATUS_HEAD_PUSH_POSITION 0x06 #define DATA_STATUS_WINGS_POSITION_SWITCH 0x08 #define DATA_STATUS_MOTOR_FOR_WINGS 0x09 -#define DATA_STATUS_LEFT_BLUE_LED 0x0A +#define DATA_STATUS_LED_LEFT_INTENSITY 0x0A #define DATA_STATUS_I2C_SDA_LINE 0x0B #define DATA_STATUS_I2C_SCL_LINE 0x0C #define DATA_STATUS_HEAD_MOTOR_FOR_MOUTH 0x0D @@ -176,7 +178,7 @@ #define DATA_STATUS_MOUTH_POSITION_COUNTER 0x1D #define DATA_STATUS_WINGS_POSITION_COUNTER 0x1E #define DATA_STATUS_SPIN_POSITION_COUNTER 0x1F -#define DATA_STATUS_RIGHT_BLUE_LED 0x20 +#define DATA_STATUS_LED_RIGHT_INTENSITY 0x20 #define DATA_STATUS_RF_CONNECTED 0x21 #define DATA_STATUS_IR_CODE 0x22 #define DATA_STATUS_PONG 0x24 @@ -273,150 +275,8 @@ extern void update_raw_status_table(const unsigned char *new_status); extern void update_system_status_table(const unsigned char *new_status); -/** Number of firmware information structures to store. - * There's one for each firmware and one for the general release package. - * Firmware will have the same index as defined in CPU_IDENTIFIERS, the last - * one will be the release package. */ -#define NUMBER_OF_FIRMWARE (HIGHEST_CPU_NUM + 2) -/** Index of the general release package information structure defined in - * tux_status. */ -#define RELEASE_INDEX (NUMBER_OF_FIRMWARE - 1) -/** Size of the version string. */ -#define VERSION_STRING_LENGTH 100 -/** States of the battery charger */ -typedef enum charger_status -{ - CHARGER_UNPLUGGED = 0, /**< unplugged, on batteries */ - CHARGER_CHARGING = 1, /**< fast charge ongoing */ - CHARGER_PLUGGED_NO_POWER = 2, /**< transformer plugged on tux but not in - the wall socket */ - CHARGER_TRICKLE = 3, /**< trickle mode, mainly activated at the end of - charge */ - CHARGER_INHIBITED = 4, /**< the CPU has inhibited the charger */ -} charger_status_t; - -/** States of the battery level - * \todo TODO write the function that would compute the battery state depending - * on the battery voltage, load and charger status */ -typedef enum battery_status -{ - FULL, - HIGH, - LOW, - EMPTY, -} battery_status_t; - /** - * Tux status table. - * - * This hierarchical structure holds all available status of tux and the - * dongle. - */ -struct tux_status_t -{ - /** Firmware general information like versioning , svn revision, author and - * a couple more stuff. - * - * The version number is written as 'major.minor.update'. - * - * When local_modification or mixed_revisions are found, it can't be a - * release. */ - struct firmware_info_t - { - unsigned int version_major; /**< Major version number */ - unsigned int version_minor; /**< Minor version number */ - unsigned int version_update;/**< Update version number */ - unsigned int revision; /**< SVN revision number */ - bool release; /**< Set for a released firmware */ - bool local_modification; /**< Has local modifications compared to - the SVN revision copy */ - bool mixed_revisions; /**< Has been compiled with a mix of SVN - revisions */ - unsigned int author;/**< Number representing the author of the - firmware, '0' is the official firmware of Kysoh */ - unsigned int variation; /**< Variation can be used by the author to - differentiate multiple variations of the - same firmware */ - char version_string[VERSION_STRING_LENGTH]; /**< Whole version number - stored as a string */ - } firmware_info[NUMBER_OF_FIRMWARE]; - - /** Sound flash properties. */ - struct sound_flash_t - { - unsigned int number_of_sounds; /**< number of sounds stored in the - sound flash */ - unsigned int flash_usage; /**< flash space percentage filled */ - unsigned int available_record_time; /**< time (in seconds) of free - space remaining in the flash */ - } sound_flash; - - /** Battery status. - * 'loaded' can be used to filter out 'level' measurements that occurred - * when the motors were running as the battery voltage is highly affected - * by the load. */ - struct battery_t - { - unsigned int level; /**< Last battery level measurement (raw data - from the ADC) */ - bool loaded; /**< Set if the battery was loaded when the - measurement was done (i.e. motors running). */ - float voltage; /**< Mean battery voltage */ - battery_status_t status;/**< Battery level status (low, high, etc.) */ - charger_status_t charger_state; /**<Battery charger state. */ - - } battery; - - /** Audio status */ - struct audio_t - { - unsigned int play_internal_sound; /**< Number of the sound currently - playing ('0' when none) */ - bool streaming; /**< Set when audio data is streamed through the RF - link */ - bool mute; /**< Set when the amplifier has been muted */ - audiorec_status_t record_state; /**< States of the recording process */ - unsigned int last_block_size; /**< Size of the last recorded audio - segment. This can be used by the - recording process to determine if the - correct length has been recorded. */ - } audio; - - /** Raw I/O status */ - struct buttons_t - { - bool head; /**< Head push button */ - bool left_flipper; /**< Left flipper push button */ - bool right_flipper; /**< Right flipper push button */ - uint8_t RC5_code; /**< Last code of the Tuxdroid remote button pressed. - - Bit 6 is the toggle bit, it's toggled each time you - press a remote key and should be used to - differentiate successive key presses of the same - button. - - Bits 5-0 are the 6 bits RC5 command code. */ - bool RC5_receiving; /**< Set when the remote button is pressed, cleared - when released. If you're clicking the remote - buttons very quickly, RC5_receiving will miss the - button releases in between. You should use the - toggle bit of the remote code to differentiate - successive key presses. */ - } buttons; - - /** Raw I/O status */ - struct io_t - { - bool plugged; /**< Power plug insertion switch, set when the - transformer is plugged to tux */ - bool charger_led_signal; /**< LED signal of the BQ2002T IC charger. - Goes low when fast charging, high otherwise - (trickle, not charging, init, etc. See the - datasheet for details. */ - bool charge_inhibit; - } io; -}; - -/** * Daemon version information. */ struct daemon_version_t @@ -443,9 +303,6 @@ uint8_t wifi_channel; }; -/* Structures that define the variables that should be accessible by the API. - */ -extern struct tux_status_t tux_status; extern struct daemon_version_t daemon_version; extern struct connection_status_t connection_status; Modified: daemon/trunk/libs/USBDaemon_tcp_server.c =================================================================== --- daemon/trunk/libs/USBDaemon_tcp_server.c 2008-01-04 11:39:24 UTC (rev 822) +++ daemon/trunk/libs/USBDaemon_tcp_server.c 2008-01-04 11:39:33 UTC (rev 823) @@ -36,7 +36,7 @@ #include "USBDaemon_usb.h" #include "USBDaemon_pidfile.h" #include "../supervise.h" -#include "USBDaemon_log.h" +#include "../log.h" /*_____________________ V A R I A B L E S __________________________________*/ Modified: daemon/trunk/libs/USBDaemon_usb.c =================================================================== --- daemon/trunk/libs/USBDaemon_usb.c 2008-01-04 11:39:24 UTC (rev 822) +++ daemon/trunk/libs/USBDaemon_usb.c 2008-01-04 11:39:33 UTC (rev 823) @@ -26,7 +26,7 @@ #include "USBDaemon_usb.h" #include "USBDaemon_globals.h" -#include "USBDaemon_log.h" +#include "../log.h" #include "USBDaemon_status_table.h" #include "USBDaemon_tcp_server.h" @@ -148,7 +148,7 @@ log_error("Your dongle firmware is too old.\n" "This version is not compatible with this daemon, please \ update\n" - "the firmware to version 1.00 or better.\n" + "the firmware to version 0.3.1 or better.\n" "Check http://www.tuxisalive.com/documentation/how-to/\ updating-the-firmware\nfor details."); return 0; @@ -293,8 +293,9 @@ /* Send data */ idx = usb_write_TuxDroid(data, TUX_SEND_LENGTH); if (idx <= 0) - return ACK_CMD_TIMEOUT; - log_debug("CMD: %.2x %.2x %.2x %.2x", data[0], data[1], data[2], data[3]); + return ACK_CMD_ERROR; + log_debug("CMD: %.2x %.2x %.2x %.2x %.2x", data[0], data[1], data[2], + data[3], data[4]); cmd_status_flag = 1; counter = 0; csf = cmd_status_flag; Copied: daemon/trunk/log.c (from rev 740, daemon/trunk/libs/USBDaemon_log.c) =================================================================== --- daemon/trunk/log.c (rev 0) +++ daemon/trunk/log.c 2008-01-04 11:39:33 UTC (rev 823) @@ -0,0 +1,232 @@ +/* + * Tux Droid - USB Daemon + * Copyright (C) 2007 C2ME S.A. <tux...@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: USBDaemon_status_table.c 743 2007-11-29 10:50:21Z jaguarondi $ */ + +#include <stdlib.h> +#include <stdio.h> +#include <stdarg.h> +#include <time.h> +#include <assert.h> +#include <syslog.h> + +#include "libs/USBDaemon_globals.h" +#include "log.h" + +/** Name of log file for target LOG_TARGET_TUX */ +#define LOG_FILE "/var/log/" TUX_DAEMON_NAME ".log" + +/** All logged messages are prefixed with this text */ +#define LOG_PREFIX TUX_DAEMON_NAME + +/** Current logging level */ +static log_level_t current_level = LOG_LEVEL_INFO; + +/** Logging level names */ +static const char *level_names[] = +{ + [LOG_LEVEL_DEBUG] = "debug", + [LOG_LEVEL_INFO] = "info", + [LOG_LEVEL_WARNING] = "warning", + [LOG_LEVEL_ERROR] = "error", + [LOG_LEVEL_NONE] = "none" +}; + +/** Logging level to syslog priority mapping */ +static int level_prio[] = +{ + [LOG_LEVEL_DEBUG] = LOG_DEBUG, + [LOG_LEVEL_INFO] = LOG_INFO, + [LOG_LEVEL_WARNING] = LOG_WARNING, + [LOG_LEVEL_ERROR] = LOG_ERR, + [LOG_LEVEL_NONE] = 0 +}; + +/** Current logging target */ +static log_target_t log_target = LOG_TARGET_SHELL; + +/** Log file for target LOG_TARGET_TUX */ +static FILE *log_file; + +/** Whether the log has been opened */ +static bool log_opened; + +/** + * Open the log. + * + * /param[in] target Logging target + * + * /return true if successfull, false otherwise + */ +bool log_open(log_target_t target) +{ + if (log_opened) + return true; + + switch (target) + { + case LOG_TARGET_SYSLOG: + openlog(LOG_PREFIX, 0, LOG_DAEMON); + break; + + case LOG_TARGET_TUX: + log_file = fopen(LOG_FILE, "at"); + if (log_file == NULL) + return false; + break; + + case LOG_TARGET_SHELL: + break; + } + + log_target = target; + log_opened = true; + + return true; +} + +/** + * Close the log. + */ +void log_close(void) +{ + if (!log_opened) + return; + + switch (log_target) + { + case LOG_TARGET_SYSLOG: + closelog(); + break; + + case LOG_TARGET_TUX: + fclose(log_file); + log_file = NULL; + break; + + case LOG_TARGET_SHELL: + break; + } + + log_opened = false; +} + +/** + * Set the logging level. + * + * /param[in] new_level New logging level + */ +void log_set_level(log_level_t new_level) +{ + assert(new_level >= LOG_LEVEL_DEBUG && new_level <= LOG_LEVEL_NONE); + current_level = new_level; +} + +/** + * Get the logging level. + * + * /return current logging level + */ +log_level_t log_get_level(void) +{ + return current_level; +} + +/** + * Log formatted message at the specified level. + * + * /param[in] at_level Level to log the message at + * /param[in] fmt Message format + * /param[in] ... Optional message data + * + * If the priority of the specifed level is lower than the priority + * of the current logging level, the message is silently dropped. + * + * /return true if successful, false otherwise + */ +bool log_text(log_level_t at_level, const char *fmt, ...) +{ + char text[1024], *p = text; + size_t size = sizeof(text); + int prio; + time_t now; + va_list al; + int r; + + /* No need for the log to be 'opened' when logging to std{out,err} */ + if (log_target != LOG_TARGET_SHELL && !log_opened) + return false; + + /* Logging at level NONE has no sense */ + assert(at_level >= LOG_LEVEL_DEBUG && at_level < LOG_LEVEL_NONE); + + if (at_level < current_level) + return true; + + /* Add date & time when LOG_TARGET_TUX */ + if (log_target == LOG_TARGET_TUX) + { + now = time(NULL); + r = strftime(p, size, "%F %T ", localtime(&now)); + if (r == 0) + return false; + + p += r; + size -= r; + } + + /* Only prefix non-INFO level messages */ + if (at_level != LOG_LEVEL_INFO) + { + r = snprintf(p, size, "%s: ", level_names[at_level]); + if (r < 0) + return false; + + p += r; + size -= r; + } + + va_start(al, fmt); + r = vsnprintf(p, size, fmt, al); + va_end(al); + if (r < 0) + return false; + + switch (log_target) + { + case LOG_TARGET_SYSLOG: + prio = level_prio[at_level]; + syslog(prio, "%s", text); + break; + + case LOG_TARGET_TUX: + fprintf(log_file, "%s\n", text); + break; + + case LOG_TARGET_SHELL: + if (at_level == LOG_LEVEL_WARNING || at_level == LOG_LEVEL_ERROR) + fprintf(stderr, "%s\n", text); + else + fprintf(stdout, "%s\n", text); + break; + } + + return true; +} Copied: daemon/trunk/log.h (from rev 740, daemon/trunk/libs/USBDaemon_log.h) =================================================================== --- daemon/trunk/log.h (rev 0) +++ daemon/trunk/log.h 2008-01-04 11:39:33 UTC (rev 823) @@ -0,0 +1,38 @@ +#ifndef __USBDAEMON_LOG_H__ +#define __USBDAEMON_LOG_H__ + +#include <stdbool.h> + +/** Logging target */ +typedef enum log_target +{ + LOG_TARGET_SYSLOG, + LOG_TARGET_TUX, + LOG_TARGET_SHELL +} log_target_t; + +extern bool log_open(log_target_t target); +extern void log_close(void); + +/** Logging levels, in increasing priorities */ +typedef enum log_level +{ + LOG_LEVEL_DEBUG, + LOG_LEVEL_INFO, + LOG_LEVEL_WARNING, + LOG_LEVEL_ERROR, + LOG_LEVEL_NONE +} log_level_t; + +extern void log_set_level(log_level_t new_level); +extern log_level_t log_get_level(void); + +extern bool log_text(log_level_t at_level, const char *fmt, ...) + __attribute__((format(printf, 2, 3))); + +#define log_debug(fmt, ...) log_text(LOG_LEVEL_DEBUG, (fmt), ## __VA_ARGS__) +#define log_info(fmt, ...) log_text(LOG_LEVEL_INFO, (fmt), ## __VA_ARGS__) +#define log_warning(fmt, ...) log_text(LOG_LEVEL_WARNING, (fmt), ## __VA_ARGS__) +#define log_error(fmt, ...) log_text(LOG_LEVEL_ERROR, (fmt), ## __VA_ARGS__) + +#endif Modified: daemon/trunk/main.c =================================================================== --- daemon/trunk/main.c 2008-01-04 11:39:24 UTC (rev 822) +++ daemon/trunk/main.c 2008-01-04 11:39:33 UTC (rev 823) @@ -35,7 +35,7 @@ #include <signal.h> #include <sys/file.h> #include "libs/USBDaemon_globals.h" -#include "libs/USBDaemon_log.h" +#include "log.h" #include "libs/USBDaemon_pidfile.h" #include "libs/USBDaemon_usb.h" #include "libs/USBDaemon_tcp_server.h" Added: daemon/trunk/status.c =================================================================== --- daemon/trunk/status.c (rev 0) +++ daemon/trunk/status.c 2008-01-04 11:39:33 UTC (rev 823) @@ -0,0 +1,191 @@ +/* + * Tux Droid - USB Daemon + * Copyright (C) 2007 KYSOH S.A. <in...@ky...> + * + * 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$ */ + +#include <stdbool.h> +#include <assert.h> + +#include "status.h" +#include "log.h" + +/** + * Tux status table. + * + * This hierarchical structure holds all current status of tux and the dongle. + * As soon as a new status is received from tux, the structure is updated. + */ +struct tux_status_t tux_status; + +/* Flags for updated status. */ +static bool up_led; + + +/* + * LEDs + */ + +/** + * Set the intensity status of the left LED. + */ +void set_led_left_intensity(int intensity) +{ + up_led = true; + tux_status.led.left.intensity = intensity; +} + +/** + * Get the intensity status of the left LED. + */ +int get_led_left_intensity(void) +{ + return tux_status.led.left.intensity; +} + +/** + * Set the fading status of the left LED. + */ +void set_led_left_fading(bool fading) +{ + up_led = true; + tux_status.led.left.fading = fading; +} + +/** + * Get the fading status of the left LED. + */ +bool get_led_left_fading(void) +{ + return tux_status.led.left.fading; +} + +/** + * Set the pulsing status of the left LED. + */ +void set_led_left_pulsing(bool pulsing) +{ + up_led = true; + tux_status.led.left.pulsing = pulsing; +} + +/** + * Get the pulsing status of the left LED. + */ +bool get_led_left_pulsing(void) +{ + return tux_status.led.left.pulsing; +} + +/** + * Set the intensity status of the right LED. + */ +void set_led_right_intensity(int intensity) +{ + up_led = true; + tux_status.led.right.intensity = intensity; +} + +/** + * Get the intensity status of the right LED. + */ +int get_led_right_intensity(void) +{ + return tux_status.led.right.intensity; +} + +/** + * Set the fading status of the right LED. + */ +void set_led_right_fading(bool fading) +{ + up_led = true; + tux_status.led.right.fading = fading; +} + +/** + * Get the fading status of the right LED. + */ +bool get_led_right_fading(void) +{ + return tux_status.led.right.fading; +} + +/** + * Set the pulsing status of the right LED. + */ +void set_led_right_pulsing(bool pulsing) +{ + up_led = true; + tux_status.led.right.pulsing = pulsing; +} + +/** + * Get the pulsing status of the right LED. + */ +bool get_led_right_pulsing(void) +{ + return tux_status.led.right.pulsing; +} + +/** + * Set the mask status of the LEDs. + */ +void set_led_mask(bool mask) +{ + up_led = true; + tux_status.led.mask = mask; +} + +/** + * Get the mask status of the LEDs. + */ +bool get_led_mask(void) +{ + return tux_status.led.mask; +} + + +/* + * Control functions. + */ + +/** + * When status are updated, log what changed. + * + * \todo TODO we should remove the flags and compare the table with a backup + * copy, then determine what changed and do the logs and callbacks. + */ +void status_log(void) +{ + if (up_led) + { + struct led_t *led = &tux_status.led; + + up_led = false; + log_debug("LEDs L:%3d (%s%s) R:%3d (%s%s) %s", + led->left.intensity, + led->left.fading ? "F" : "_", + led->left.pulsing ? "P" : "_", + led->right.intensity, + led->right.fading ? "F" : "_", + led->right.pulsing ? "P" : "_", + led->mask ? "masked" : ""); + } +} Property changes on: daemon/trunk/status.c ___________________________________________________________________ Name: svn:mime-type + text/plain Name: svn:keywords + Id Name: svn:eol-style + native Added: daemon/trunk/status.h =================================================================== --- daemon/trunk/status.h (rev 0) +++ daemon/trunk/status.h 2008-01-04 11:39:33 UTC (rev 823) @@ -0,0 +1,240 @@ +/* + * Tux Droid - USB Daemon + * Copyright (C) 2007 KYSOH S.A. <in...@ky...> + * + * 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$ */ + +/** \file status.h + \brief Status module interface. + \ingroup status +*/ + +/** \defgroup status Status + The status module contains all tux status and its accessors functions. +*/ +/*! @{ */ + +#include <stdbool.h> + +#include "tuxdefs/api.h" +#include "tuxdefs/defines.h" +#include "version.h" + + +/** + * \name Versioning of the firmware + * XXX should clean this part + * @{ */ +/** Number of firmware information structures to store. + * There's one for each firmware and one for the general release package. + * Firmware will have the same index as defined in CPU_IDENTIFIERS, the last + * one will be the release package. */ +#define NUMBER_OF_FIRMWARE (HIGHEST_CPU_NUM + 2) +/** Index of the general release package information structure defined in + * tux_status. */ +#define RELEASE_INDEX (NUMBER_OF_FIRMWARE - 1) +/** Size of the version string. */ +#define VERSION_STRING_LENGTH 100 +/*! @} */ + +/** + * \name Battery and charger states definitions. + * XXX should add the accessors + * @{ */ +/** States of the battery charger */ +typedef enum charger_status +{ + CHARGER_UNPLUGGED = 0, /**< Unplugged, on batteries */ + CHARGER_CHARGING = 1, /**< Fast charge ongoing */ + CHARGER_PLUGGED_NO_POWER = 2, /**< Transformer plugged on tux but not in + the wall socket */ + CHARGER_TRICKLE = 3, /**< Trickle mode, mainly activated at the end of + charge */ + CHARGER_INHIBITED = 4, /**< The CPU has inhibited the charger */ +} charger_status_t; + +/** States of the battery level + * \todo TODO write the function that would compute the battery state depending + * on the battery voltage, load and charger status */ +typedef enum battery_status +{ + FULL, /**< Battery fully charged */ + HIGH, /**< Battery level high */ + LOW, /**< Battery level low */ + EMPTY, /**< Battery empty, tux won't work any longer */ +} battery_status_t; +/*! @} */ + +/** + * Tux status table. + * + * This hierarchical structure holds all available status of tux and the + * dongle. + * XXX this structure should be moved to .c file to hide the included data. + */ +struct tux_status_t +{ + /** Firmware general information like versioning , svn revision, author and + * a couple more stuff. + * + * The version number is written as 'major.minor.update'. + * + * When local_modification or mixed_revisions are found, it can't be a + * release. */ + struct firmware_info_t + { + unsigned int version_major; /**< Major version number */ + unsigned int version_minor; /**< Mi... [truncated message content] |
From: jaguarondi <c2m...@c2...> - 2008-01-04 11:39:23
|
Author: jaguarondi Date: 2008-01-04 12:39:24 +0100 (Fri, 04 Jan 2008) New Revision: 822 Modified: firmware/tuxcore/trunk/led.c firmware/tuxcore/trunk/led.h firmware/tuxdefs/defines.h Log: * Lowercased a typedef. Modified: firmware/tuxcore/trunk/led.c =================================================================== --- firmware/tuxcore/trunk/led.c 2008-01-04 11:30:15 UTC (rev 821) +++ firmware/tuxcore/trunk/led.c 2008-01-04 11:39:24 UTC (rev 822) @@ -166,7 +166,7 @@ old value is kept. 'cnt' can be set to 255 to trigger an infinite pulsing effect. */ -void led_pulse(LEDS_t leds, uint8_t const cnt, uint8_t const pulse_width) +void led_pulse(leds_t leds, uint8_t const cnt, uint8_t const pulse_width) { /* XXX we should really find a way to optimize this loop for the 2 leds. * We don't want to add a new function call, bu don't want to have the code @@ -206,7 +206,7 @@ \param max Maximum intensity \param min Minimum intensity */ -void led_pulse_range(LEDS_t leds, uint8_t const max, uint8_t const min) +void led_pulse_range(leds_t leds, uint8_t const max, uint8_t const min) { led_t *led = &left_led; @@ -235,7 +235,7 @@ led_command. \param step Intenisty step applied when fading. */ -void led_set_fade_speed(LEDS_t leds, uint8_t const delay, uint8_t const step) +void led_set_fade_speed(leds_t leds, uint8_t const delay, uint8_t const step) { led_t *led = &left_led; @@ -264,7 +264,7 @@ \param leds Set left, right or both leds. \param intensity 8 bits PWM value the led should be set to. */ -void led_set_intensity(LEDS_t leds, uint8_t const intensity) +void led_set_intensity(leds_t leds, uint8_t const intensity) { led_t *led = &left_led; Modified: firmware/tuxcore/trunk/led.h =================================================================== --- firmware/tuxcore/trunk/led.h 2008-01-04 11:30:15 UTC (rev 821) +++ firmware/tuxcore/trunk/led.h 2008-01-04 11:39:24 UTC (rev 822) @@ -78,11 +78,11 @@ void led_init(void); void led_shutdown(void); -void led_set_fade_speed(LEDS_t leds, uint8_t const delay, uint8_t const step); -void led_set_intensity(LEDS_t leds, uint8_t const intensity); -void led_pulse_range(LEDS_t leds, uint8_t const max, uint8_t const min); +void led_set_fade_speed(leds_t leds, uint8_t const delay, uint8_t const step); +void led_set_intensity(leds_t leds, uint8_t const intensity); +void led_pulse_range(leds_t leds, uint8_t const max, uint8_t const min); void pulse_led(led_t *const led, uint8_t const cnt, uint8_t const pulse_width); -void led_pulse(LEDS_t led, uint8_t const cnt, uint8_t const pulse_width); +void led_pulse(leds_t led, uint8_t const cnt, uint8_t const pulse_width); void led_control(bool mask); #endif /* _LED_H_ */ Modified: firmware/tuxdefs/defines.h =================================================================== --- firmware/tuxdefs/defines.h 2008-01-04 11:30:15 UTC (rev 821) +++ firmware/tuxdefs/defines.h 2008-01-04 11:39:24 UTC (rev 822) @@ -32,6 +32,7 @@ #ifndef _DEFINES_H_ #define _DEFINES_H_ +#include <stdint.h> /** * \name Identifiers and addresses. * @{ */ @@ -170,14 +171,16 @@ /** * Type indicating which led should be affected by the command. * The left LED is affected to bit0 and the right LED is at bit1. This - * simplifies comparisons. + * simplifies comparisons. Assigning an hex value helps keep in mind the bit + * relation. */ typedef enum { + LED_NONE = 0, LED_LEFT = 0x01, LED_RIGHT = 0x02, LED_BOTH = 0x03, -} LEDS_t; +} leds_t; /*! @} */ @@ -198,7 +201,14 @@ /*! @} */ +/** + * \name Various specifications + */ +/*! @{ */ +#define FW_MAIN_LOOP_DELAY 0.004 /*! @} */ +/*! @} */ + #endif /* _DEFINES_H_ */ |
From: Paul_R <c2m...@c2...> - 2008-01-04 11:30:32
|
Author: Paul_R Date: 2008-01-04 12:30:15 +0100 (Fri, 04 Jan 2008) New Revision: 821 Modified: software/gadgets/flash_management/trunk/flash_management.tgf software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.glade software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml software/gadgets/flash_management/trunk/flash_management/strings.xml Log: * Added a protection to be sure that the wavs files are in a 8k/8bits format * Added a protection to stop the transfert when the dongle is disconnected, or the RF connection is lost. When the connection is lost, aplay is killed with 'pkill' Modified: software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.glade 2008-01-04 09:05:29 UTC (rev 820) +++ software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.glade 2008-01-04 11:30:15 UTC (rev 821) @@ -777,32 +777,6 @@ </child> <child> - <widget class="GtkLabel" id="lblSoundState"> - <property name="width_request">216</property> - <property name="height_request">18</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">24</property> - <property name="y">168</property> - </packing> - </child> - - <child> <widget class="GtkButton" id="btnSoundAdd"> <property name="width_request">72</property> <property name="height_request">27</property> @@ -855,6 +829,32 @@ <property name="y">82</property> </packing> </child> + + <child> + <widget class="GtkLabel" id="lblSoundState"> + <property name="width_request">216</property> + <property name="height_request">41</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">24</property> + <property name="y">168</property> + </packing> + </child> </widget> <packing> <property name="padding">0</property> Modified: software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp 2008-01-04 09:05:29 UTC (rev 820) +++ software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp 2008-01-04 11:30:15 UTC (rev 821) @@ -7,6 +7,7 @@ import commands import time import threading +import wave class Window(SimpleGladeApp): def __init__(self, @@ -19,6 +20,7 @@ self.__sound_mutex = threading.Lock() self.__tree_mutex = threading.Lock() self.my_dict = {} + self.disconnected = False def new(self): self.widget_window = True @@ -121,7 +123,16 @@ wavs.wav_paths=[] wavs.wav_sizes=[] for i in range(17): - wavs.add_wav_path('/opt/tuxdroid/apps/tuxgi/sounds/%d.wav'%(i+1)) + wavfile = wave.open('/opt/tuxdroid/apps/tuxgi/sounds/%d.wav'%(i+1), 'r') + print wavfile.getsampwidth() + print wavfile.getframerate() + if wavfile.getsampwidth() != 1 and wavfile.getframerate() != 8000: + dialog = GdgDialog(_me.string('Warning'), _me.string('FileSample')) + wavfile.close() + return + else: + wavfile.close() + wavs.add_wav_path('/opt/tuxdroid/apps/tuxgi/sounds/%d.wav'%(i+1)) for path in st_wav_paths: wavs.add_wav_path(path) else: @@ -184,7 +195,17 @@ #-------------------------------------------------------------------------- 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()) + path = str(self.get_widget("soundInternalChooser").get_filename()) + wavfile = wave.open(path, 'r') + print wavfile.getsampwidth() + print wavfile.getframerate() + if wavfile.getsampwidth() != 1 and wavfile.getframerate() != 8000: + dialog = GdgDialog(_me.string('Warning'), _me.string('FileSample')) + wavfile.close() + return + else: + wavfile.close() + wavs.add_wav_path(self.get_widget("soundInternalChooser").get_filename()) self.refresh_flag = True self.refresh_wav_list() @@ -268,6 +289,9 @@ self.get_widget('lblSoundState').show() self.get_widget('lblSoundState').set_text(_me.string('norf')) return + else: + self.disconnected = False + if len(wavs.wav_sizes)==0: self.__sound_mutex.release() self.get_widget('lblSoundState').show() @@ -278,7 +302,8 @@ self.get_widget('lblSoundState').show() self.get_widget('lblSoundState').set_text(_me.string('toobig')) return - + tux.event.on_rf_disconnected = self.on_disconnected + tux.event.on_disconnected = self.on_disconnected try: ver = tux.hw.behavior_get_version() if int(ver[3]) < 733: @@ -343,27 +368,53 @@ self.get_widget('lblSoundState').set_text(_me.string('soundErase')) tux.cmd.sound_storing(len(wavs.wav_sizes)) - tux.sys.wait(10) + + for i in range(10): + if self.disconnected == True: return + tux.sys.wait(1) + current_pos=0x0400 tux.sys.wait(0.1) + + if self.disconnected == True: return + self.get_widget('progressbar1').set_fraction(0.5) self.get_widget('lblSoundState').set_text(_me.string('soundTOC')) + + if self.disconnected == True: return + tux.cmd.sound_store_index(0x00,0x04,0x00) + for size in wavs.wav_sizes: + + if self.disconnected == True: return + 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('progressbar1').set_fraction(0.75) self.get_widget('lblSoundState').set_text(_me.string('soundProg1')) + + if self.disconnected == True: return + tux.sys.shell("aplay -D %s merged.wav"%soundcard) + if self.disconnected == True: return + self.get_widget('progressbar1').set_fraction(1) - tux.sys.wait(0.3) - self.get_widget('progressbar1').hide() - self.get_widget('lblSoundState').hide() - + self.get_widget('lblSoundState').set_text(_me.string('Succeeded')) + self.__sound_mutex.release() + def on_disconnected(self): + self.disconnected = True + tux.sys.shell('pkill aplay') + self.get_widget('progressbar1').set_fraction(1) + self.get_widget('lblSoundState').set_text(_me.string('norf')) + if self.__sound_mutex.locked(): + self.__sound_mutex.release() + #-------------------------------------------------------------------------- # On "play" flash sound button clicked #-------------------------------------------------------------------------- Modified: software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml =================================================================== --- software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml 2008-01-04 09:05:29 UTC (rev 820) +++ software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml 2008-01-04 11:30:15 UTC (rev 821) @@ -1,6 +1,9 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> + <FileSample type='str'>Le fichier wav doit être au format 8kHz / 8bits</FileSample> <Settingsgadget type='str'>Gestion de la mémoire flash</Settingsgadget> + <Succeeded type='str'>Programation terminée</Succeeded> + <Warning type='str'>Attention</Warning> <btnSoundAdd type='str'>Ajouter</btnSoundAdd> <btnSoundClear type='str'>Purger</btnSoundClear> <btnSoundModify type='str'>Modifier</btnSoundModify> Modified: software/gadgets/flash_management/trunk/flash_management/strings.xml =================================================================== --- software/gadgets/flash_management/trunk/flash_management/strings.xml 2008-01-04 09:05:29 UTC (rev 820) +++ software/gadgets/flash_management/trunk/flash_management/strings.xml 2008-01-04 11:30:15 UTC (rev 821) @@ -1,6 +1,9 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> + <FileSample type='str'>The wav file must have a 8kHz/8bits format.</FileSample> <Settingsgadget type='str'>Sound flash management</Settingsgadget> + <Succeeded type='str'>Programming succeeded</Succeeded> + <Warning type='str'>Warning</Warning> <btnSoundAdd type='str'>Add</btnSoundAdd> <btnSoundClear type='str'>Clear list</btnSoundClear> <btnSoundModify type='str'>Modify</btnSoundModify> @@ -39,7 +42,8 @@ <lblVersions type='str'>Installed versions</lblVersions> <lblWifiAvoidance type='str'>Avoid the wifi channel number :</lblWifiAvoidance> <name_to_read type='str'>Flash memory management</name_to_read> - <norf type='str'>No RF connection detected</norf> + <norf type='str'>Tux cannot be found. +Please connect the dongle and/or switch on Tux</norf> <nowavs type='str'>No wavs to store</nowavs> <official type='str'>Official version</official> <soundErase type='str'>Erasing flash ...</soundErase> Modified: software/gadgets/flash_management/trunk/flash_management.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2008-01-04 09:05:27
|
Author: Paul_R Date: 2008-01-04 10:05:29 +0100 (Fri, 04 Jan 2008) New Revision: 820 Added: software/gadgets/flash_management/trunk/flash_management.tgf software/gadgets/flash_management/trunk/flash_management/ Removed: software/gadgets/flash_management/trunk/settings.tgf software/gadgets/flash_management/trunk/settings/ Modified: software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp software/gadgets/flash_management/trunk/flash_management/Scripts/Python/init.pyp software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml software/gadgets/flash_management/trunk/flash_management/settings.xml software/gadgets/flash_management/trunk/flash_management/strings.xml Log: * Names consistency ... Copied: software/gadgets/flash_management/trunk/flash_management (from rev 819, software/gadgets/flash_management/trunk/settings) Modified: software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/flash_management/trunk/settings/Scripts/Python/GUI/widget/other.pyp 2008-01-04 09:02:48 UTC (rev 819) +++ software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp 2008-01-04 09:05:29 UTC (rev 820) @@ -306,7 +306,7 @@ tux.cmd.sound_erase() - tux.sys.wait(1) + tux.sys.wait(10) while tux.status.sound_record()[0] != 0: tux.sys.wait(0.1) @@ -317,11 +317,13 @@ self.get_widget('progressbar1').set_fraction(current) self.get_widget('lblSoundState').set_text(_me.string('soundProg')+str(i+1)) tux.cmd.sound_storing() - while tux.status.sound_record()[0] != 1: - tux.sys.wait(0.1) + #while tux.status.sound_record()[0] != 1: + #print 'wait' + tux.sys.wait(0.2) tux.sys.shell("aplay -D %s %s"%(soundcard, sound_table[i])) - while tux.status.sound_record()[0] != 2: - tux.sys.wait(0.1) + #while tux.status.sound_record()[0] != 2: + # print 'wait ...' + tux.sys.wait(0.2) tux.cmd.sound_confirm(True) current = current + fraction Modified: software/gadgets/flash_management/trunk/flash_management/Scripts/Python/init.pyp =================================================================== --- software/gadgets/flash_management/trunk/settings/Scripts/Python/init.pyp 2008-01-04 09:02:48 UTC (rev 819) +++ software/gadgets/flash_management/trunk/flash_management/Scripts/Python/init.pyp 2008-01-04 09:05:29 UTC (rev 820) @@ -15,23 +15,15 @@ Function to initialize the gadget. This function is executed when all gadgets has been loaded. """ + - - 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. """ - _me.remove_menu() - # ---------------------------------------------------------------------------- # Registeration of the shared functions # ---------------------------------------------------------------------------- -_me.insert_funct('initialization', initialization) -_me.insert_funct('finalization', finalization) +#_me.insert_funct('initialization', initialization) +#_me.insert_funct('finalization', finalization) Modified: software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml =================================================================== --- software/gadgets/flash_management/trunk/settings/Strings/fr_ALL.xml 2008-01-04 09:02:48 UTC (rev 819) +++ software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml 2008-01-04 09:05:29 UTC (rev 820) @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> - <Settingsgadget type='str'>Gestion de la mémoire son</Settingsgadget> + <Settingsgadget type='str'>Gestion de la mémoire flash</Settingsgadget> <btnSoundAdd type='str'>Ajouter</btnSoundAdd> <btnSoundClear type='str'>Purger</btnSoundClear> <btnSoundModify type='str'>Modifier</btnSoundModify> Modified: software/gadgets/flash_management/trunk/flash_management/settings.xml =================================================================== --- software/gadgets/flash_management/trunk/settings/settings.xml 2008-01-04 09:02:48 UTC (rev 819) +++ software/gadgets/flash_management/trunk/flash_management/settings.xml 2008-01-04 09:05:29 UTC (rev 820) @@ -29,6 +29,6 @@ <AvoidChannel type='int'>0</AvoidChannel> <EnableSleep type='bool'>False</EnableSleep> <SleepDelay type='str'>5</SleepDelay> - <hidden_in_manager type='bool'>True</hidden_in_manager> + <hidden_in_manager type='bool'>False</hidden_in_manager> </parameters> </settings> Modified: software/gadgets/flash_management/trunk/flash_management/strings.xml =================================================================== --- software/gadgets/flash_management/trunk/settings/strings.xml 2008-01-04 09:02:48 UTC (rev 819) +++ software/gadgets/flash_management/trunk/flash_management/strings.xml 2008-01-04 09:05:29 UTC (rev 820) @@ -1,6 +1,6 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> - <Settingsgadget type='str'>Sound memory management</Settingsgadget> + <Settingsgadget type='str'>Sound flash management</Settingsgadget> <btnSoundAdd type='str'>Add</btnSoundAdd> <btnSoundClear type='str'>Clear list</btnSoundClear> <btnSoundModify type='str'>Modify</btnSoundModify> Copied: software/gadgets/flash_management/trunk/flash_management.tgf (from rev 819, software/gadgets/flash_management/trunk/settings.tgf) =================================================================== (Binary files differ) Deleted: software/gadgets/flash_management/trunk/settings.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2008-01-04 09:02:59
|
Author: Paul_R Date: 2008-01-04 10:02:48 +0100 (Fri, 04 Jan 2008) New Revision: 819 Added: software/gadgets/flash_management/ Removed: software/gadgets/settings/ Modified: software/gadgets/flash_management/trunk/settings.tgf Log: * Rename the settings gadget in flash management gadget. * Changed the init code to display the gadget in the manager * Changed some names and strings to increase the consistency. Now, this gadget is 'flash_management' and the displayed name is 'Flash memory management' Copied: software/gadgets/flash_management (from rev 812, software/gadgets/settings) Modified: software/gadgets/flash_management/trunk/settings.tgf =================================================================== (Binary files differ) |
From: MCMic <c2m...@c2...> - 2008-01-02 17:21:23
|
Author: MCMic Date: 2008-01-02 18:21:15 +0100 (Wed, 02 Jan 2008) New Revision: 818 Modified: software/scripts/tux_trivia/trunk/tux_trivia.py Log: Add of random order of questions. Maybe we can directly use the question class in 'question_list2'. Modified: software/scripts/tux_trivia/trunk/tux_trivia.py =================================================================== --- software/scripts/tux_trivia/trunk/tux_trivia.py 2008-01-02 15:00:46 UTC (rev 817) +++ software/scripts/tux_trivia/trunk/tux_trivia.py 2008-01-02 17:21:15 UTC (rev 818) @@ -99,6 +99,19 @@ print TXT_FileError + FILE_Questions tux.destroy() +#mix beginning (by MCMic) +question_list2 = [] +while len(question_list) > 0: + num = randrange(len(question_list)/3) + question_list2.append(question_list[3*num]) + question_list2.append(question_list[3*num+1]) + question_list2.append(question_list[3*num+2]) + question_list.pop(3*num) + question_list.pop(3*num) + question_list.pop(3*num) +question_list = question_list2 +#end + class Question: """Question for the game""" def __init__(self, question, correctReply, wrongReply): |
From: jaguarondi <c2m...@c2...> - 2008-01-02 15:00:47
|
Author: jaguarondi Date: 2008-01-02 16:00:46 +0100 (Wed, 02 Jan 2008) New Revision: 817 Modified: software/scripts/tux_trivia/trunk/tux_trivia.py Log: * Added the license and credits. Modified: software/scripts/tux_trivia/trunk/tux_trivia.py =================================================================== --- software/scripts/tux_trivia/trunk/tux_trivia.py 2007-12-31 16:19:42 UTC (rev 816) +++ software/scripts/tux_trivia/trunk/tux_trivia.py 2008-01-02 15:00:46 UTC (rev 817) @@ -1,26 +1,50 @@ -#!/usr/bin/python +#!/usr/bin/env python # -*- coding: utf-8 -*- -# -# Trivia quiz script. -# -# Make your own question lists: -# -# question files have the following format: -# -# Question? -# Correct awnser. -# Wrong awnser. -# -# Example: -# Who created the GNU project in 1984? -# Richard Stallman. -# Linus Torvalds. +# $Id$ -import time, sys +""" +Trivia quiz script for Tuxdroid + +Use the left and right flippers to select the answer. At the end of the quiz, +you get the score. Pressing the head button will cancel the quiz and give the +score. + +Make your own question lists in the the following format: + +Question 1? +Correct awnser. +Wrong awnser. +Question 2? +Correct awnser. +Wrong awnser. +""" + +__version__ = "0.1" + " r" + "$Revision$"[11:15] +__license__ = """ +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. +""" +__author__ = "MCMic" +__contributors__ = ["Rutger Bazen", + "David Bourgeois"] + +import sys +from random import randrange + sys.path.append('/opt/tuxdroid/api/python') from tux import * -import pickle -from random import randrange # Init state of tux tux.cmd.eyes_open() Property changes on: software/scripts/tux_trivia/trunk/tux_trivia.py ___________________________________________________________________ Name: svn:keywords - Id + Author Date Id Revision |
From: jaguarondi <c2m...@c2...> - 2007-12-31 16:19:41
|
Author: jaguarondi Date: 2007-12-31 17:19:42 +0100 (Mon, 31 Dec 2007) New Revision: 816 Added: software/scripts/tux_trivia/trunk/quiz/FR-questions-permis_a_points Removed: software/scripts/tux_trivia/trunk/quiz/FR-questions-permis a points Log: * Removed whitespaces in filenames. Deleted: software/scripts/tux_trivia/trunk/quiz/FR-questions-permis a points =================================================================== --- software/scripts/tux_trivia/trunk/quiz/FR-questions-permis a points 2007-12-31 16:15:50 UTC (rev 815) +++ software/scripts/tux_trivia/trunk/quiz/FR-questions-permis a points 2007-12-31 16:19:42 UTC (rev 816) @@ -1,30 +0,0 @@ -Combien je perds de points sur mon permis de conduire, si je dépasse la vitesse maximum autorisée de moins de 20 Kilomètre heure? -1 point. -0 points. -Accélération de l'allure d'un véhicule sur le point d'être dépassé ? -2 points. -1 point. -Non respect du panneau Stop ? -4 points. -3 points. -Non port de la ceinture de sécurité ? -3 points. -1 point. -Utilisation d'un téléphone portable tenu en mains ? -2 points. -1 point. -Dépassement de la vitesse maximale autorisée compris entre 40 et 50 kilomètre heure ? -4 points. -3 points. -Gêne ou entrave à la circulation ? -6 points. -3 points. -Conduite avec un taux d'alcoolémie compris entre 0.5 et 0.8 grammes par litre de sang -6 points. -4 points. -Non respect des distances de sécurité entre véhicules ? -3 points. -2 points. -Homicide involontaireou blessures causées involontairement à un tiers et entraînant une incapacité totale de travail ? -6 points. -4 points. Copied: software/scripts/tux_trivia/trunk/quiz/FR-questions-permis_a_points (from rev 815, software/scripts/tux_trivia/trunk/quiz/FR-questions-permis a points) =================================================================== --- software/scripts/tux_trivia/trunk/quiz/FR-questions-permis_a_points (rev 0) +++ software/scripts/tux_trivia/trunk/quiz/FR-questions-permis_a_points 2007-12-31 16:19:42 UTC (rev 816) @@ -0,0 +1,30 @@ +Combien je perds de points sur mon permis de conduire, si je dépasse la vitesse maximum autorisée de moins de 20 Kilomètre heure? +1 point. +0 points. +Accélération de l'allure d'un véhicule sur le point d'être dépassé ? +2 points. +1 point. +Non respect du panneau Stop ? +4 points. +3 points. +Non port de la ceinture de sécurité ? +3 points. +1 point. +Utilisation d'un téléphone portable tenu en mains ? +2 points. +1 point. +Dépassement de la vitesse maximale autorisée compris entre 40 et 50 kilomètre heure ? +4 points. +3 points. +Gêne ou entrave à la circulation ? +6 points. +3 points. +Conduite avec un taux d'alcoolémie compris entre 0.5 et 0.8 grammes par litre de sang +6 points. +4 points. +Non respect des distances de sécurité entre véhicules ? +3 points. +2 points. +Homicide involontaireou blessures causées involontairement à un tiers et entraînant une incapacité totale de travail ? +6 points. +4 points. |
From: jaguarondi <c2m...@c2...> - 2007-12-31 08:46:49
|
Author: jaguarondi Date: 2007-12-31 09:46:33 +0100 (Mon, 31 Dec 2007) New Revision: 814 Modified: api/python/trunk/tuxapi_class.py Log: * Spelling. Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2007-12-28 09:26:29 UTC (rev 813) +++ api/python/trunk/tuxapi_class.py 2007-12-31 08:46:33 UTC (rev 814) @@ -5642,7 +5642,7 @@ Print the docstring of an element of tux api Parameters: - "element" as methode or class + "element" as method or class Examples: >>> tux.misc.doc(tux) @@ -5708,7 +5708,7 @@ c_header='' my_doc='' for i in range(80-len(indent)): c_header=c_header+'-' - my_doc='%s%s)\tMethode : %s<br>'%(my_doc,funct_num,funct_name) + my_doc='%s%s)\tMethod : %s<br>'%(my_doc,funct_num,funct_name) self.header_doc=self.header_doc+indent+'<a href="#%s">'%(funct_num) \ +my_doc+'</a>' my_doc=indent+'<a name=%s></a>'%(funct_num)+self.h_funct_b+ \ |
From: jerome <c2m...@c2...> - 2007-12-28 09:26:36
|
Author: jerome Date: 2007-12-28 10:26:29 +0100 (Fri, 28 Dec 2007) New Revision: 813 Modified: software/gadgets/PC_monitor/trunk/pc_monitor.tgf software/gadgets/PC_monitor/trunk/pc_monitor/Strings/fr_ALL.xml software/gadgets/PC_monitor/trunk/pc_monitor/about.xml software/gadgets/PC_monitor/trunk/pc_monitor/settings.xml software/gadgets/PC_monitor/trunk/pc_monitor/strings.xml Log: * Incremented version number Modified: software/gadgets/PC_monitor/trunk/pc_monitor/Strings/fr_ALL.xml =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/Strings/fr_ALL.xml 2007-12-20 12:10:22 UTC (rev 812) +++ software/gadgets/PC_monitor/trunk/pc_monitor/Strings/fr_ALL.xml 2007-12-28 09:26:29 UTC (rev 813) @@ -1,26 +1,26 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> - <gui_conf_remote_title type='str'>Télécommande</gui_conf_remote_title> - <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <err_no_values type='str'>Il n'y a pas encore de valeurs.</err_no_values> + <gui_conf_about_title type='str'>A propos</gui_conf_about_title> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> - <gui_conf_threshold_label type='str'>Seuil :</gui_conf_threshold_label> - <help_text type='str'>Le gadget Moniteur PC vous donne les status de votre CPU et de votre RAM. -Tux peut aussi notifier quand votre CPU a une charge trop haute ou quand votre RAM est au maximum de ses capités</help_text> - <err_no_values type='str'>Il n'y a pas encore de valeurs.</err_no_values> - <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> - <gui_conf_update_title type='str'>Monitoring</gui_conf_update_title> + <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> + <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> <gui_conf_delay_lb type='str'>interval mise a jour (sec) :</gui_conf_delay_lb> - <gui_conf_about_title type='str'>A propos</gui_conf_about_title> + <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <gui_conf_notification_label type='str'>Notification après (sec) :</gui_conf_notification_label> + <gui_conf_ram_frame_label type='str'>Mémoire physique</gui_conf_ram_frame_label> <gui_conf_rb_behavior type='str'>Comportement</gui_conf_rb_behavior> - <gui_conf_ram_frame_label type='str'>Mémoire physique</gui_conf_ram_frame_label> - <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> - <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> - <gui_conf_notification_label type='str'>Notification après (sec) :</gui_conf_notification_label> - <speaker_name type='str'>Bruno8k</speaker_name> + <gui_conf_rb_tts type='str'>Notification TTS</gui_conf_rb_tts> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> - <gui_conf_rb_tts type='str'>Notification TTS</gui_conf_rb_tts> + <gui_conf_remote_title type='str'>Télécommande</gui_conf_remote_title> + <gui_conf_threshold_label type='str'>Seuil :</gui_conf_threshold_label> + <gui_conf_update_title type='str'>Monitoring</gui_conf_update_title> + <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <help_text type='str'>Le gadget Moniteur PC vous donne les status de votre CPU et de votre RAM. +Tux peut aussi notifier quand votre CPU a une charge trop haute ou quand votre RAM est au maximum de ses capités</help_text> <name_to_read type='str'>Moniteur PC</name_to_read> - <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> <read_text type='str'>La charge c p u est de %s pourçan, et la charge ram est de %s pourçan</read_text> + <speaker_name type='str'>Bruno8k</speaker_name> </strings> Modified: software/gadgets/PC_monitor/trunk/pc_monitor/about.xml =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/about.xml 2007-12-20 12:10:22 UTC (rev 812) +++ software/gadgets/PC_monitor/trunk/pc_monitor/about.xml 2007-12-28 09:26:29 UTC (rev 813) @@ -1,7 +1,7 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_author type='str'>jer...@ky...</gadget_author> <gadget_description type='str'>PC monitor gadget for tux droid.</gadget_description> - <gadget_author type='str'>jer...@ky...</gadget_author> <gadget_name type='str'>pc_monitor</gadget_name> - <gadget_version type='str'>0.0.2</gadget_version> + <gadget_version type='str'>0.0.3</gadget_version> </about> Modified: software/gadgets/PC_monitor/trunk/pc_monitor/settings.xml =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/settings.xml 2007-12-20 12:10:22 UTC (rev 812) +++ software/gadgets/PC_monitor/trunk/pc_monitor/settings.xml 2007-12-28 09:26:29 UTC (rev 813) @@ -1,46 +1,46 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> - <parameters> - <spin_ram_seuil type='int'>95</spin_ram_seuil> - <first_ram type='bool'>True</first_ram> - <ram_tag type='bool'>False</ram_tag> - <ram_load type='str'>00</ram_load> - <tts_ram_active type='bool'>True</tts_ram_active> - <timer_busy type='bool'>False</timer_busy> - <ram_tts_message type='str'>Memory is up!</ram_tts_message> - <cpu_tag type='bool'>False</cpu_tag> - <values type='list'>[]</values> - <spin_notif type='int'>6</spin_notif> - <spin_cpu_seuil type='int'>95</spin_cpu_seuil> - <cpu_tts_message type='str'>CPU overload!</cpu_tts_message> - <cpu_behavior_file type='str'>empty</cpu_behavior_file> - <ram_behavior_file type='str'>empty</ram_behavior_file> - <first_cpu type='bool'>True</first_cpu> - <tts_active type='bool'>True</tts_active> - <cpu_load type='str'>00</cpu_load> - </parameters> <general> - <have_settings_part type='bool'>True</have_settings_part> + <framework_version type='str'>0.0.0</framework_version> <gui_state> + <conf> + <visible type='bool'>False</visible> + </conf> <widget> - <y type='int'>512</y> <visible type='bool'>True</visible> <x type='int'>32</x> + <y type='int'>512</y> </widget> - <conf> - <visible type='bool'>False</visible> - </conf> </gui_state> + <have_main_part type='bool'>True</have_main_part> + <have_settings_part type='bool'>True</have_settings_part> + <have_widget_part type='bool'>False</have_widget_part> <language type='str'>en_US</language> + <main_priority type='int'>4</main_priority> + <menu_active type='bool'>True</menu_active> <notified type='bool'>True</notified> <notify_delay type='int'>6</notify_delay> - <framework_version type='str'>0.0.0</framework_version> - <menu_active type='bool'>True</menu_active> - <have_widget_part type='bool'>False</have_widget_part> + <notify_priority type='int'>4</notify_priority> + <pitch type='int'>100</pitch> <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> + <parameters> + <cpu_behavior_file type='str'>empty</cpu_behavior_file> + <cpu_load type='str'>00</cpu_load> + <cpu_tag type='bool'>False</cpu_tag> + <cpu_tts_message type='str'>CPU overload!</cpu_tts_message> + <first_cpu type='bool'>True</first_cpu> + <first_ram type='bool'>True</first_ram> + <ram_behavior_file type='str'>empty</ram_behavior_file> + <ram_load type='str'>00</ram_load> + <ram_tag type='bool'>False</ram_tag> + <ram_tts_message type='str'>Memory is up!</ram_tts_message> + <spin_cpu_seuil type='int'>95</spin_cpu_seuil> + <spin_notif type='int'>6</spin_notif> + <spin_ram_seuil type='int'>95</spin_ram_seuil> + <timer_busy type='bool'>False</timer_busy> + <tts_active type='bool'>True</tts_active> + <tts_ram_active type='bool'>True</tts_ram_active> + <values type='list'>[]</values> + </parameters> </settings> Modified: software/gadgets/PC_monitor/trunk/pc_monitor/strings.xml =================================================================== --- software/gadgets/PC_monitor/trunk/pc_monitor/strings.xml 2007-12-20 12:10:22 UTC (rev 812) +++ software/gadgets/PC_monitor/trunk/pc_monitor/strings.xml 2007-12-28 09:26:29 UTC (rev 813) @@ -1,25 +1,25 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> - <gui_conf_remote_title type='str'>Remote</gui_conf_remote_title> - <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <err_no_values type='str'>There is not yet values about</err_no_values> + <gui_conf_about_title type='str'>About</gui_conf_about_title> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> - <gui_conf_threshold_label type='str'>Set threshold :</gui_conf_threshold_label> - <help_text type='str'>PC Monitor Gadget gives the status of your CPU and RAM. Tux will also notify you when your CPU workload is too high or when your RAM is getting full</help_text> - <err_no_values type='str'>There is not yet values about</err_no_values> - <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> - <gui_conf_update_title type='str'>Monitoring</gui_conf_update_title> + <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> + <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> <gui_conf_delay_lb type='str'>Update interval (sec) :</gui_conf_delay_lb> - <gui_conf_about_title type='str'>About</gui_conf_about_title> + <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <gui_conf_notification_label type='str'>Notification after (sec) :</gui_conf_notification_label> + <gui_conf_ram_frame_label type='str'>Physical RAM</gui_conf_ram_frame_label> <gui_conf_rb_behavior type='str'>Behavior :</gui_conf_rb_behavior> - <gui_conf_ram_frame_label type='str'>Physical RAM</gui_conf_ram_frame_label> - <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> - <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> - <gui_conf_notification_label type='str'>Notification after (sec) :</gui_conf_notification_label> - <speaker_name type='str'>Ryan8k</speaker_name> + <gui_conf_rb_tts type='str'>TTS Notification :</gui_conf_rb_tts> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> - <gui_conf_rb_tts type='str'>TTS Notification :</gui_conf_rb_tts> + <gui_conf_remote_title type='str'>Remote</gui_conf_remote_title> + <gui_conf_threshold_label type='str'>Set threshold :</gui_conf_threshold_label> + <gui_conf_update_title type='str'>Monitoring</gui_conf_update_title> + <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> + <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <help_text type='str'>PC Monitor Gadget gives the status of your CPU and RAM. Tux will also notify you when your CPU workload is too high or when your RAM is getting full</help_text> <name_to_read type='str'>PC monitor</name_to_read> - <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> <read_text type='str'>The c p u has a %s percent workload, your ram memory is used for %s percent</read_text> + <speaker_name type='str'>Ryan8k</speaker_name> </strings> Modified: software/gadgets/PC_monitor/trunk/pc_monitor.tgf =================================================================== (Binary files differ) |
From: jaguarondi <c2m...@c2...> - 2007-12-20 12:10:27
|
Author: jaguarondi Date: 2007-12-20 13:10:23 +0100 (Thu, 20 Dec 2007) New Revision: 811 Modified: firmware/tuxcore/trunk/motors.c Log: * When adding LED PWM, we noticed that the flipper position interrupt was triggered by the LED signal (PC2) while the switch signal (PC1) was around VDD/2. The capacitor that filters the switch signal (PC1) also decreases the rising time so the uncertainty period between which the input pin (PC1) could change from low to high is quite long. During this time, it seems changes of PC2 can affect PC1 directly, probably through crosstalks, and this triggers the flipper interrupt. In order to filter out this glitches, we disabled the interrupt for a couple milliseconds after it occurs the first time. Modified: firmware/tuxcore/trunk/motors.c =================================================================== --- firmware/tuxcore/trunk/motors.c 2007-12-20 11:57:20 UTC (rev 810) +++ firmware/tuxcore/trunk/motors.c 2007-12-20 12:10:23 UTC (rev 811) @@ -161,7 +161,46 @@ } /*! @} */ +/** Counter for flipper interrupt suspend. */ +uint8_t static suspend_flippers_delay = 0; + +/** Flipper interrupt suspend delay. */ +#define SUSPEND_FLIPPERS_DELAY 2 + /** + Suspend the flippers interrupt for debouncing, see the flipper ISR for + details about the problem. + */ +inline static void suspend_flippers_int(void) +{ + suspend_flippers_delay = SUSPEND_FLIPPERS_DELAY; + PCICR &= ~_BV(PCIE1); +} + +/** + Resume the flippers interrupt. + */ +inline static void resume_flippers_int(void) +{ + /* Clear pending interrupts before enabling them. */ + PCIFR = _BV(PCIF1); + PCICR |= _BV(PCIE1); +} + +/** + Resume interrupts when disabled for debouncing. + */ +inline static void manage_interrupts(void) +{ + if (suspend_flippers_delay) + { + suspend_flippers_delay--; + if (!suspend_flippers_delay) + resume_flippers_int(); + } +} + +/** * \name Eyes functions * @{ */ /** \brief Low level access to stop the eyes motor. */ @@ -594,9 +633,19 @@ FLIPPERS_BRAKING_DLY period. So we only count when the switch is pushed but not when it is released. As the interrupt triggers on a signal change, we need to suppress the release interrupt. + + When adding LED PWM, we noticed that the flipper position interrupt was + triggered by the LED signal (PC2) while the switch signal (PC1) was around + VDD/2. The capacitor that filters the switch signal (PC1) also decreases the + rising time so the uncertainty period between which the input pin (PC1) + could change from low to high is quite long. During this time, it seems + changes of PC2 can affect PC1 directly, probably through crosstalks, and + this triggers this interrupt. In order to filter out this glitches, we + disabled the interrupts for a couple milliseconds. */ ISR(SIG_PIN_CHANGE1) { + suspend_flippers_int(); /* We only count when the switch is pushed, not released. */ if (~PSW_FLIPPERS_PIN & PSW_FLIPPERS_MK) { @@ -828,4 +877,7 @@ stop_spinning(); } } + + /* Handle interrupt suspend. */ + manage_interrupts(); } |
From: remi <c2m...@c2...> - 2007-12-20 12:10:27
|
Author: remi Date: 2007-12-20 13:10:22 +0100 (Thu, 20 Dec 2007) New Revision: 812 Modified: software/gadgets/clipboard_translator/trunk/clipboard_translator.tgf Log: Modified: software/gadgets/clipboard_translator/trunk/clipboard_translator.tgf =================================================================== (Binary files differ) |
From: remi <c2m...@c2...> - 2007-12-20 11:57:19
|
Author: remi Date: 2007-12-20 12:57:20 +0100 (Thu, 20 Dec 2007) New Revision: 810 Modified: software/gadgets/clipboard_translator/trunk/clipboard_translator.tgf Log: Help updated Modified: software/gadgets/clipboard_translator/trunk/clipboard_translator.tgf =================================================================== (Binary files differ) |
From: jerome <c2m...@c2...> - 2007-12-20 11:46:21
|
Author: jerome Date: 2007-12-20 12:46:16 +0100 (Thu, 20 Dec 2007) New Revision: 809 Modified: software/gadgets/rss_feeder/trunk/rss_feeder.tgf software/gadgets/rss_feeder/trunk/rss_feeder/settings.xml software/gadgets/rss_feeder/trunk/rss_feeder/strings.xml Log: * bug fixes: can not add some feeds when feedparser library was not able to detect the encoding. * Improvement : Automated translation tool. * Added popup to get the bad state of added feed. * bug fixes : problem with tts when voice was set to 'french voice.'. Modified: software/gadgets/rss_feeder/trunk/rss_feeder/settings.xml =================================================================== --- software/gadgets/rss_feeder/trunk/rss_feeder/settings.xml 2007-12-20 11:29:56 UTC (rev 808) +++ software/gadgets/rss_feeder/trunk/rss_feeder/settings.xml 2007-12-20 11:46:16 UTC (rev 809) @@ -6,21 +6,42 @@ <conf> <visible type='bool'>False</visible> </conf> + <gui_add> + <visible type='bool'>False</visible> + </gui_add> + <gui_modify> + <visible type='bool'>False</visible> + </gui_modify> + <no_internet> + <visible type='bool'>False</visible> + </no_internet> + <no_values> + <visible type='bool'>False</visible> + </no_values> + <popup_no_test> + <visible type='bool'>False</visible> + </popup_no_test> + <progress> + <visible type='bool'>False</visible> + </progress> + <url_error> + <visible type='bool'>False</visible> + </url_error> <widget> - <visible type='bool'>False</visible> + <visible type='bool'>True</visible> </widget> </gui_state> <have_main_part type='bool'>False</have_main_part> <have_settings_part type='bool'>False</have_settings_part> <have_widget_part type='bool'>True</have_widget_part> - <language type='str'>en_US</language> + <language type='str'>fr_ALL</language> <main_priority type='int'>1</main_priority> <menu_active type='bool'>True</menu_active> <notified type='bool'>True</notified> <notify_delay type='int'>60</notify_delay> - <notify_priority type='int'>5</notify_priority> + <notify_priority type='int'>4</notify_priority> <pitch type='int'>100</pitch> - <speaker type='int'>4</speaker> + <speaker type='int'>1</speaker> </general> <parameters> <automated_translation type='bool'>True</automated_translation> Modified: software/gadgets/rss_feeder/trunk/rss_feeder/strings.xml =================================================================== --- software/gadgets/rss_feeder/trunk/rss_feeder/strings.xml 2007-12-20 11:29:56 UTC (rev 808) +++ software/gadgets/rss_feeder/trunk/rss_feeder/strings.xml 2007-12-20 11:46:16 UTC (rev 809) @@ -22,6 +22,7 @@ <at_gui_popup_no_test_label2 type='str'>No test available for this notification option</at_gui_popup_no_test_label2> <at_gui_widget_checkbutton1 type='str'>Updated or added new name</at_gui_widget_checkbutton1> <at_gui_widget_checkbutton10 type='str'>Automated translation</at_gui_widget_checkbutton10> + <at_gui_widget_checkbutton11 type='str'>Enable log text</at_gui_widget_checkbutton11> <at_gui_widget_checkbutton2 type='str'>News title that have changed or added</at_gui_widget_checkbutton2> <at_gui_widget_checkbutton3 type='str'>News Summary</at_gui_widget_checkbutton3> <at_gui_widget_checkbutton8 type='str'>Check for updated feeds at Gadget Manager startup</at_gui_widget_checkbutton8> @@ -38,6 +39,8 @@ <at_gui_widget_label2 type='str'>Delete</at_gui_widget_label2> <at_gui_widget_label20 type='str'>Number of news by RSS feed to update: </at_gui_widget_label20> <at_gui_widget_label21 type='str'>What do you want Tux Droid to read?</at_gui_widget_label21> + <at_gui_widget_label22 type='str'> Feeds log </at_gui_widget_label22> + <at_gui_widget_label23 type='str'>Clear</at_gui_widget_label23> <at_gui_widget_label3 type='str'>Apply</at_gui_widget_label3> <at_gui_widget_label4 type='str'>Cancel</at_gui_widget_label4> <at_gui_widget_label5 type='str'>Feeds</at_gui_widget_label5> @@ -63,8 +66,30 @@ <gui_conf_update_title type='str'>Update</gui_conf_update_title> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> - <help_text type='str'> - </help_text> + <help_text type='str'>This gadget can read RSS feeds that you can find on many +different websites like news headlines, blogs, podcast, etc. + +To add an RSS feed , click the 'add' button in the gadget and +give a name of your choosing. Next add the RSS feed, by +for example doing a copy-paste from the Firefox web +browser. + +Several types of notifications are available: + +- Do nothing: If you want to turn off notifications select this option. + +- Behavior: Select a custom python behavior script to be notified of an + RSS feed update. + +- TTS (Text to Speech) message: If you want to be notified +with a TTS message. + +- Wav sound: If you want to be notified with a sound (8bit 8khz). + +- Custom notification: Tux will read the RSS feeds with the TTS. +Enable the check boxes for the parts you want to hear. + +Automated translation is realized by Google translation tool and Bablefish.</help_text> <name_to_read type='str'>Rss reader</name_to_read> <speaker_name type='str'>Ryan8k</speaker_name> <tree_cb_column type='str'>Update</tree_cb_column> Modified: software/gadgets/rss_feeder/trunk/rss_feeder.tgf =================================================================== (Binary files differ) |
From: remi <c2m...@c2...> - 2007-12-20 11:41:24
|
Author: remi Date: 2007-12-20 12:22:08 +0100 (Thu, 20 Dec 2007) New Revision: 807 Modified: software/gadgets/clipboard_translator/trunk/clipboard_translator.tgf Log: ADD : Add help string Modified: software/gadgets/clipboard_translator/trunk/clipboard_translator.tgf =================================================================== (Binary files differ) |
From: remi <c2m...@c2...> - 2007-12-20 11:41:10
|
Author: remi Date: 2007-12-20 12:29:56 +0100 (Thu, 20 Dec 2007) New Revision: 808 Modified: software/gadgets/clipboard_translator/trunk/clipboard_translator.tgf Log: Notification is enabled by default Modified: software/gadgets/clipboard_translator/trunk/clipboard_translator.tgf =================================================================== (Binary files differ) |
From: remi <c2m...@c2...> - 2007-12-20 10:54:44
|
Author: remi Date: 2007-12-20 11:54:35 +0100 (Thu, 20 Dec 2007) New Revision: 806 Added: software/gadgets/clipboard_translator/ software/gadgets/clipboard_translator/branches/ software/gadgets/clipboard_translator/tags/ software/gadgets/clipboard_translator/trunk/ software/gadgets/clipboard_translator/trunk/clipboard_translator.tgf Log: ADD : clipboard translator gadget Added: software/gadgets/clipboard_translator/trunk/clipboard_translator.tgf =================================================================== (Binary files differ) Property changes on: software/gadgets/clipboard_translator/trunk/clipboard_translator.tgf ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream |