[tuxdroid-svn] r4711 - in software_suite_v3/smart-core/smart-api/csharp/trunk: . API API Documenta
Status: Beta
Brought to you by:
ks156
Author: JDM Date: 2009-05-30 14:35:03 +0200 (Sat, 30 May 2009) New Revision: 4711 Added: software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/ software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/_tux_a_p_i_8cs.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/_tux_a_p_i_8cs_source.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/annotated.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/class_tux_a_p_i_1_1_tux_a_p_i-members.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/class_tux_a_p_i_1_1_tux_a_p_i.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/class_tux_a_p_i_1_1_tux_button_event_args-members.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/class_tux_a_p_i_1_1_tux_button_event_args.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/class_tux_a_p_i_1_1_tux_button_event_mgr-members.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/class_tux_a_p_i_1_1_tux_button_event_mgr.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/class_tux_a_p_i_1_1_tux_date_time_event_args-members.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/class_tux_a_p_i_1_1_tux_date_time_event_args.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/class_tux_a_p_i_1_1_tux_date_time_event_mgr-members.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/class_tux_a_p_i_1_1_tux_date_time_event_mgr.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/classes.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/doxygen.css software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/doxygen.png software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/files.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/ftv2blank.png software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/ftv2doc.png software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/ftv2folderclosed.png software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/ftv2folderopen.png software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/ftv2lastnode.png software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/ftv2link.png software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/ftv2mlastnode.png software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/ftv2mnode.png software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/ftv2node.png software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/ftv2plastnode.png software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/ftv2pnode.png software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/ftv2vertline.png software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/functions.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/functions_enum.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/functions_evnt.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/functions_func.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/functions_prop.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/index.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/main.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/namespace_tux_a_p_i.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/namespaces.html software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/tab_b.gif software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/tab_l.gif software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/tab_r.gif software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/tabs.css software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/tree.html software_suite_v3/smart-core/smart-api/csharp/trunk/API/ software_suite_v3/smart-core/smart-api/csharp/trunk/API/TuxAPI.cs software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/ software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo.sln software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo.suo software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/ software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/Form1.Designer.cs software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/Form1.cs software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/Form1.resx software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/Program.cs software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/Properties/ software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/Properties/AssemblyInfo.cs software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/Properties/Resources.Designer.cs software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/Properties/Resources.resx software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/Properties/Settings.Designer.cs software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/Properties/Settings.settings software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/TuxAPI.cs software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/TuxAPIDemo.csproj software_suite_v3/smart-core/smart-api/csharp/trunk/Control Tux Droid/TuxAPIDemo/tux.ico software_suite_v3/smart-core/smart-api/csharp/trunk/README.TXT Log: * First revision for C# API Added: software_suite_v3/smart-core/smart-api/csharp/trunk/API/TuxAPI.cs =================================================================== --- software_suite_v3/smart-core/smart-api/csharp/trunk/API/TuxAPI.cs (rev 0) +++ software_suite_v3/smart-core/smart-api/csharp/trunk/API/TuxAPI.cs 2009-05-30 12:35:03 UTC (rev 4711) @@ -0,0 +1,1301 @@ +/* + * C# TuxAPI + * + * An API written in C# for the Tux Droid + * + * Joel Matteotti <joel.matteotti _AT_ free _DOT_ fr> + * + * Version 1.0.0 + * + * =============== GPL HEADER ===================== + * This file is part of C# TuxAPI. + * + * C# TuxAPI 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 3 of the License, or + * (at your option) any later version. + * + * C# TuxAPI 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 "C# TuxAPI". If not, see <http://www.gnu.org/licenses/>. + * + * ==================================================== + * + * TODO Code: + * + * - Complete the status part + * - Allow the use of sound_flash + * - Modify the 3 values of the TuxAPI_LEDS_INTENSITY_LEVEL enumeration + * - Rename all constant of TuxAPI_STATUS_REQUESTED for more short name + * + * +*/ + + +//blinked leds: +/* + * count : + <uint8> +fx_speed : + <float> +fx_step : + <uint8> +fx_type : + <<UNAFFECTED|LAST|NONE|DEFAULT|FADE_DURATION|FADE_RATE|GRADIENT_NBR|GRADIENT_DELTA>> +leds : + <<LED_BOTH|LED_RIGHT|LED_LEFT>> +max_intensity : + <float> +min_intensity : + <float> +period : + <float>*/ + + +//sound flash: +/* + * http://127.0.0.1:270/0/sound_flash/play?track=1&volume=500.0 ronflement + * http://127.0.0.1:270/0/sound_flash/play?track=2&volume=500.0 pet + "oops" + * http://127.0.0.1:270/0/sound_flash/play?track=3&volume=500.0 yumm + * http://127.0.0.1:270/0/sound_flash/play?track=4&volume=500.0 "hello" + * http://127.0.0.1:270/0/sound_flash/play?track=5&volume=500.0 "ready" + * http://127.0.0.1:270/0/sound_flash/play?track=6&volume=500.0 "yo" + * http://127.0.0.1:270/0/sound_flash/play?track=7&volume=500.0 (???) + * http://127.0.0.1:270/0/sound_flash/play?track=8&volume=500.0 rire moqueur + * http://127.0.0.1:270/0/sound_flash/play?track=9&volume=500.0 'bloop' + * http://127.0.0.1:270/0/sound_flash/play?track=10&volume=500.0 'plock' aigue + * http://127.0.0.1:270/0/sound_flash/play?track=11&volume=500.0 'plock' grave + * http://127.0.0.1:270/0/sound_flash/play?track=12&volume=500.0 'touc touc' + * http://127.0.0.1:270/0/sound_flash/play?track=13&volume=500.0 'twiing' + * http://127.0.0.1:270/0/sound_flash/play?track=14&volume=500.0 FIRE ALARM :D + * http://127.0.0.1:270/0/sound_flash/play?track=15&volume=500.0 moto ? + * http://127.0.0.1:270/0/sound_flash/play?track=16&volume=500.0 'wong' + * http://127.0.0.1:270/0/sound_flash/play?track=17&volume=500.0 coucou coucou coucou + * + +*/ + +using System; +using System.Net; +using System.Threading; + +namespace TuxAPI +{ + public class TuxAPI + { + #region ENUMERATIONS + /// <summary> + /// WebClient to play with the url (i think it's not the better method but it work ATM) + /// </summary> + private static WebClient wc; + + /// <summary> + /// Access level + /// </summary> + private enum TuxAPI_LEVEL: int + { + CLIENT_LEVEL_ANONYME = -1, + CLIENT_LEVEL_FREE = 0, + CLIENT_LEVEL_RESTRICTED = 1, + CLIENT_LEVEL_ROOT = 2, + } + + /// <summary> + /// All action can do Tux + /// </summary> + private enum TuxAPI_ACTION : byte + { + FLIPPERS_UP = 1, + FLIPPERS_DOWN = 2, + + MOUTH_OPEN = 3, + MOUTH_CLOSE = 4, + + EYES_OPEN = 5, + EYES_CLOSE = 6, + + LEDS_ON = 7, + LEDS_OFF = 8, + + ROTATE_LEFT = 9, + ROTATE_RIGHT = 10, + + ATTITUNE_PLAY = 11, + ATTITUNE_STOP = 12, + + WAV_PLAY = 13, + WAV_STOP = 14, + } + + /// <summary> + /// The TTS voice (TODO: Add others voices) + /// </summary> + public enum TuxAPI_SPEAK_LOCUTOR : byte + { + Bruno = 0, + Julie = 1, + } + + /// <summary> + /// 3 levels of luminosity intensity i've defined (value to check and modify !!) + /// </summary> + public enum TuxAPI_LEDS_INTENSITY_LEVEL + { + Minimum = 0, + Middle = 5, + Maximum = 10, + } + + /// <summary> + /// //<<LED_BOTH|LED_RIGHT|LED_LEFT>> + /// </summary> + public enum TuxAPI_LEDS : byte + { + LED_BOTH = 0, + LED_LEFT = 1, + LED_RIGHT = 2, + } + + /// <summary> + /// The 3 buttons + /// </summary> + public enum TuxAPI_BUTTON_REQUESTED : byte + { + head_button = 0, + left_wing_button = 1, + right_wing_button = 2, + } + + /// <summary> + /// Enumeration for status request (rename all for more short name) + /// </summary> + public enum TuxAPI_STATUS_REQUESTED : byte + { + flippers_motor_on = 0, + flippers_position = 1, + flippers_remaining_movements = 2, + + eyes_motor_on = 3, + eyes_position = 4, + eyes_remaining_movements = 5, + + mouth_motor_on = 6, + mouth_position = 7, + mouth_remaining_movements = 8, + + spin_left_motor_on = 9, + spin_right_motor_on = 10, + spinning_direction = 11, + spinning_remaining_movements = 12, + + light_level = 13, + right_led_state = 14, + left_led_state = 15, + + battery_level = 16, + battery_state = 17, + charger_state = 18, + + //----------- + + /* TODO: modify the number of any status + descriptor_complete = 4, + radio_state = 5, + dongle_plug = 6, + + + connection_quality = 15, + + audio_flash_play = 16, + audio_general_play = 17, + + flash_programming_current_track = 18, + flash_programming_last_track_size = 19, + + tuxcore_symbolic_version = 20, + tuxaudio_symbolic_version = 21, + fuxusb_symbolic_version = 22, + fuxrf_symbolic_version = 23, + tuxrf_symbolic_version = 24, + driver_symbolic_version = 25, + + sound_reflash_begin = 26, + sound_reflash_end = 27, + sound_reflash_current_trac = 28, + + + left_wing_button = 34, + sound_flash_count = 35, + + osl_symbolic_version=38, + general_sound_state = 39, + wav_volume=40, + tts_volume=41, + tts_pitch=42, + tts_locutor=43, + wav_0_sound_state=44, + wav_0_pause_state=45, + wav_0_stop=46, + right_wing_button=47, + wav_1_sound_state=48, + wav_1_pause_state=49, + wav_1_stop=50, + wav_2_sound_state=51, + wav_2_pause_state=52, + wav_2_stop=53, + wav_3_sound_state=54, + wav_3_pause_state=55, + wav_3_stop=56, + tts_0_sound_state=57, + head_button=58, + tts_0_pause_state=59, + tts_0_stop=60, + tts_0_voice_loaded=61, + tts_0_speak_status=62, + tts_0_voice_list=63, + tts_wav_channel_start=64, + None=65, + remote_button=66,*/ + + + + } + + #endregion + + #region CONTROL METHODS + + #region SERVER VARIABLES + /// <summary> + /// Tux Droid httpserver host + /// </summary> + public static string TuxAPI_Host { get; set; } + /// <summary> + /// Tux Droid httpserver port + /// </summary> + public static string TuxAPI_Port { get; set; } + #endregion + + #region MOTORS CONTROL + /// <summary> + /// Allow Tux todo an action + /// </summary> + /// <param name="level">Access Level</param> + /// <param name="action">Action todo from enum</param> + private static void DoMotorAction(TuxAPI_LEVEL level, TuxAPI_ACTION action) + { + wc = new WebClient(); + string final_uri = string.Empty; + + //http://localhost:270/0/flippers/up?0 //permet de faire mettre les ailles en haut ! + + final_uri = "http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/"; + + switch (action) + { + case TuxAPI_ACTION.FLIPPERS_UP: + { + final_uri = final_uri + "flippers/up?"; + } + break; + case TuxAPI_ACTION.FLIPPERS_DOWN: + { + final_uri = final_uri + "flippers/down?"; + } + break; + case TuxAPI_ACTION.MOUTH_OPEN: + { + final_uri = final_uri + "mouth/open?"; + } + break; + case TuxAPI_ACTION.MOUTH_CLOSE: + { + final_uri = final_uri + "mouth/close?"; + } + break; + case TuxAPI_ACTION.EYES_OPEN: + { + final_uri = final_uri + "eyes/open?"; + } + break; + case TuxAPI_ACTION.EYES_CLOSE: + { + final_uri = final_uri + "eyes/close?"; + } + break; + } + + wc.DownloadString(final_uri); + } + + /// <summary> + /// Allow to rotate Tux + /// </summary> + /// <param name="level">Access Level</param> + /// <param name="action">Action todo from enum (left rotation or right rotation)</param> + /// <param name="rotation">Number of rotation</param> + private static void DoRotorAction(TuxAPI_LEVEL level, TuxAPI_ACTION action, int rotation) + { + wc = new WebClient(); + string final_uri = string.Empty; + + final_uri = "http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/"; + + switch (action) + { + case TuxAPI_ACTION.ROTATE_LEFT: + { + final_uri = final_uri + "spinning/left_on?count=" + rotation; + } + break; + case TuxAPI_ACTION.ROTATE_RIGHT: + { + final_uri = final_uri + "spinning/right_on?count=" + rotation; + } + break; + } + + wc.DownloadString(final_uri); + } + #endregion + + #region LEDS CONTROL + /// <summary> + /// Basic leds action On/Off + /// </summary> + /// <param name="level">Access Level</param> + /// <param name="action">Open or Close</param> + /// <param name="leds">What eye ? left or right or both ?</param> + private static void DoLedsAction(TuxAPI_LEVEL level, TuxAPI_ACTION action, TuxAPI_LEDS leds) + { + wc = new WebClient(); + string final_uri = string.Empty; + + final_uri = "http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/"; + + #region Quel action effecteur ? ouvrir/fermer + switch (action) + { + case TuxAPI_ACTION.LEDS_OFF: + { + final_uri = final_uri + "leds/off?leds="+leds; + } + break; + case TuxAPI_ACTION.LEDS_ON: + { + final_uri = final_uri + "leds/on?leds="+leds+"&intensity=10.0"; //dont know the real maximum of intensity TODO: change 10.0 to the maximum + } + break; + } + #endregion + + wc.DownloadString(final_uri); + } + + /// <summary> + /// Leds actions with intensity control choosing in the enum (don't know if this method is util ..) + /// </summary> + /// <param name="level">Access Level</param> + /// <param name="action">Open or Close</param> + /// <param name="leds">What eye ? left or right or both ?</param> + /// <param name="intensity">Intensity of leds</param> + private static void DoLedsAction(TuxAPI_LEVEL level, TuxAPI_ACTION action, TuxAPI_LEDS leds, TuxAPI_LEDS_INTENSITY_LEVEL intensity) + { + wc = new WebClient(); + string final_uri = string.Empty; + + final_uri = "http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/"; + + + #region Quel action effecteur ? ouvrir/fermer + switch (action) + { + case TuxAPI_ACTION.LEDS_OFF: + { + final_uri = final_uri + "leds/off?leds=" + leds; + } + break; + case TuxAPI_ACTION.LEDS_ON: + { + final_uri = final_uri + "leds/on?leds=" + leds + "&intensity="+((double)intensity+0.1).ToString().Replace(",","."); + } + break; + } + #endregion + + wc.DownloadString(final_uri); + } + + /// <summary> + /// Leds actions with real intensity control + /// </summary> + /// <param name="level">Access Level</param> + /// <param name="action">Open or Close</param> + /// <param name="leds">What eye ? left or right or both ?</param> + /// <param name="intensity">Intensity of leds</param> + private static void DoLedsAction(TuxAPI_LEVEL level, TuxAPI_ACTION action, TuxAPI_LEDS leds, double intensity) + { + wc = new WebClient(); + string final_uri = string.Empty; + + + final_uri = "http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/"; + + #region Quel action effecteur ? ouvrir/fermer + switch (action) + { + case TuxAPI_ACTION.LEDS_OFF: + { + final_uri = final_uri + "leds/off?leds=" + leds; + } + break; + case TuxAPI_ACTION.LEDS_ON: + { + final_uri = final_uri + "leds/on?leds=" + leds + "&intensity=" + (intensity + 0.1).ToString().Replace(",", "."); + } + break; + } + #endregion + + wc.DownloadString(final_uri); + } + + /// <summary> + /// Blinky leds + /// </summary> + /// <param name="level">Access Level</param> + /// <param name="leds">What eye ? left or right or both ?</param> + /// <param name="count">How many blink ?</param> + private static void DoBlinkLedsAction(TuxAPI_LEVEL level, TuxAPI_LEDS leds, int count) + { + wc = new WebClient(); + string final_uri = string.Empty; + final_uri = "http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/leds/blink?count=" + count + "&delay=0.1&leds=" + leds; + wc.DownloadString(final_uri); + } + + /// <summary> + /// Blinky leds + /// </summary> + /// <param name="level">Access Level</param> + /// <param name="leds">What eye ? left or right or both ?</param> + /// <param name="count">How many blink ?</param> + /// <param name="delay">Delay between 2 blink (in second (?))</param> + private static void DoBlinkLedsAction(TuxAPI_LEVEL level, TuxAPI_LEDS leds, int count, double delay) + { + wc = new WebClient(); + string final_uri = string.Empty; + final_uri = "http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/leds/blink?count=" + count + "&delay=" + delay.ToString().Replace(",", ".") + "&leds=" + leds; + wc.DownloadString(final_uri); + } + #endregion + + #region TTS SPEECH CONTROL + /// <summary> + /// Allow to use the TTS Speech + /// </summary> + /// <param name="level">Access Level</param> + /// <param name="Text">Text to read</param> + private static void DoSpeak(TuxAPI_LEVEL level, string Text) + { + wc = new WebClient(); + string final_uri = string.Empty; + + //http://localhost:270/0/flippers/up?0 //permet de faire mettre les ailles en haut ! + + final_uri = "http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/tts/speak?text=" + Text; + + wc.DownloadString(final_uri); + } + + /// <summary> + /// Allow to use the TTS Speech with locutor choose + /// </summary> + /// <param name="level">Access Level</param> + /// <param name="locutor">Locutor from enum</param> + /// <param name="Text">Text to read</param> + private static void DoSpeak(TuxAPI_LEVEL level, TuxAPI_SPEAK_LOCUTOR locutor, string Text) + { + wc = new WebClient(); + string start_uri = string.Empty; + string final_url = string.Empty; + + start_uri = "http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/tts/"; + + //1 - locutor choice + //http://127.0.0.1:270/0/tts/locutor?name=Bruno + final_url = start_uri + "locutor?name=" + (byte)locutor; + wc.DownloadString(final_url); + + //2 - the text + final_url = start_uri + "speak?text=" + Text; + + wc.DownloadString(final_url); + } + + /// <summary> + /// Allow to use the TTS Speech with pitch modification + /// </summary> + /// <param name="level">Access Level</param> + /// <param name="pitch">pitch value 50 to 200</param> + /// <param name="Text">Text to read</param> + private static void DoSpeak(TuxAPI_LEVEL level, int pitch, string Text) + { + wc = new WebClient(); + string start_uri = string.Empty; + string final_url = string.Empty; + + start_uri = "http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/tts/"; + + //1 - pitch + //http://127.0.0.1:270/0/tts/pitch?value=10 + final_url = start_uri + "pitch?value=" + pitch; + wc.DownloadString(final_url); + + //2 - text + final_url = start_uri + "speak?text=" + Text; + + wc.DownloadString(final_url); + } + + /// <summary> + /// Allow to use the TTS Speech with locutor choosse and pitch modification + /// </summary> + /// <param name="level">Access Level</param> + /// <param name="locutor">Locutor from enum</param> + /// <param name="pitch">pitch value 50 to 200</param> + /// <param name="Text">Text to read</param> + private static void DoSpeak(TuxAPI_LEVEL level, TuxAPI_SPEAK_LOCUTOR locutor, int pitch, string Text) + { + wc = new WebClient(); + string start_uri = string.Empty; + string final_url = string.Empty; + + start_uri = "http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/tts/"; + + //1 - l'interlocuteur + //http://127.0.0.1:270/0/tts/locutor?name=Bruno + final_url = start_uri + "locutor?name=" + (byte)locutor; + wc.DownloadString(final_url); + + //2 - Le pitch + //http://127.0.0.1:270/0/tts/pitch?value=10 + final_url = start_uri + "pitch?value=" + pitch; + wc.DownloadString(final_url); + + //3 - le texte + final_url = start_uri + "speak?text=" + Text; + + wc.DownloadString(final_url); + } + #endregion + + #region ATTITUNES CONTROL + /// <summary> + /// Allow to play and stop attitune + /// </summary> + /// <param name="level">Access Level</param> + /// <param name="action">Action todo Play / Stop</param> + /// <param name="attitune_path">Attitune to load and play</param> + private static void AttituneControl(TuxAPI_LEVEL level, TuxAPI_ACTION action, string attitune) + { + wc = new WebClient(); + string final_uri = string.Empty; + string final_url = string.Empty; + + + final_uri = "http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/attitune/"; + + switch (action) + { + case TuxAPI_ACTION.ATTITUNE_PLAY: //Need to fix: the attitune stopping before the end !! + { + //attitune/load_and_play? + final_url = final_uri + "load_and_play?path=" + attitune; + final_url = final_url.Replace("\\", "\\\\"); + wc.DownloadString(final_url); + } + break; + case TuxAPI_ACTION.ATTITUNE_STOP: + { + final_url = final_uri + "stop?"; + wc.DownloadString(final_url); + } + break; + } + } + #endregion + + #region WAV CONTROL + /// <summary> + /// Allow to play and stop wav sound + /// </summary> + /// <param name="level">Access Level</param> + /// <param name="action">Action todo: Play / Stop</param> + /// <param name="sound">Sound to play</param> + private static void WavControl(TuxAPI_LEVEL level, TuxAPI_ACTION action, string sound) + { + wc = new WebClient(); + string final_uri = string.Empty; + string final_url = string.Empty; + + + //http://localhost:270/0/flippers/up?0 //permet de faire mettre les ailles en haut ! + + + final_uri = "http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/wav/"; + + //http://127.0.0.1:270/0/wav/play?path=C:\Documents%20and%20Settings\Joe\Visual%20Studio%202008\Projects\TuxAPIDemo\TuxAPIDemo\bin\Debug\tux.wav&begin=0.0&end=100.0 + + switch (action) + { + case TuxAPI_ACTION.WAV_PLAY: + { + final_url = final_uri + "play?path=" + sound + "&begin=0.0&end=20000.0"; //TODO: Fix the end value + final_url = final_url.Replace("\\", "\\\\"); + wc.DownloadString(final_url); + } + break; + case TuxAPI_ACTION.WAV_STOP: + { + final_url = final_uri + "stop?"; + wc.DownloadString(final_url); + } + break; + } + } + #endregion + + #endregion + + #region "STANDARD" API FUNCTIONS TO CALL + + #region TTS Speak + public static void Speak(string Text) + { + DoSpeak(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, Text); + } + public static void Speak(TuxAPI_SPEAK_LOCUTOR locutor, string Text) + { + DoSpeak(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, locutor, Text); + } + + public static void Speak(int pitch, string Text) + { + DoSpeak(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, pitch, Text); + } + + public static void Speak(TuxAPI_SPEAK_LOCUTOR locutor, int pitch, string Text) + { + DoSpeak(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, locutor, pitch, Text); + } + #endregion + + #region Flippers actions + /// <summary> + /// Fait lever les ailles de Tux + /// </summary> + public static void Flippers_Up() + { + DoMotorAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.FLIPPERS_UP); + } + + /// <summary> + /// Fait baisser les ailles de Tux + /// </summary> + public static void Flippers_Down() + { + DoMotorAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.FLIPPERS_DOWN); + } + #endregion + + #region Eyes actions + /// <summary> + /// Fait ouvrir les yeux à Tux + /// </summary> + public static void Eyes_Open() + { + DoMotorAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.EYES_OPEN); + } + + /// <summary> + /// Fait fermer les yeux à Tux + /// </summary> + public static void Eyes_Close() + { + DoMotorAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.EYES_CLOSE); + } + #endregion + + #region Mouth actions + /// <summary> + /// Faire ouvrir sont bec à Tux + /// </summary> + public static void Mouth_Open() + { + DoMotorAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.MOUTH_OPEN); + } + + /// <summary> + /// Fait fermer sont bec à Tux + /// </summary> + public static void Mouth_Close() + { + DoMotorAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.MOUTH_CLOSE); + } + #endregion + + #region Leds On/Off + /// <summary> + /// Allume les yeux de Tux + /// </summary> + public static void Leds_On() + { + DoLedsAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.LEDS_ON, TuxAPI_LEDS.LED_BOTH); + } + public static void Leds_On(TuxAPI_LEDS leds) + { + DoLedsAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.LEDS_ON, leds); + } + public static void Leds_On(TuxAPI_LEDS_INTENSITY_LEVEL intensity) + { + DoLedsAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.LEDS_ON, TuxAPI_LEDS.LED_BOTH, intensity); + } + public static void Leds_On(TuxAPI_LEDS leds, TuxAPI_LEDS_INTENSITY_LEVEL intensity) + { + DoLedsAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.LEDS_ON, leds, intensity); + } + public static void Leds_On(TuxAPI_LEDS leds, double intensity) + { + DoLedsAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.LEDS_ON, leds, intensity); + } + + /// <summary> + /// Eteint les yeux de Tux + /// </summary> + public static void Leds_Off() + { + DoLedsAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.LEDS_OFF, TuxAPI_LEDS.LED_BOTH); + } + + public static void Leds_Off(TuxAPI_LEDS leds) + { + DoLedsAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.LEDS_OFF, leds); + } + + + public static void Leds_Blink() + { + DoBlinkLedsAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_LEDS.LED_BOTH, 1); + } + + public static void Leds_Blink(TuxAPI_LEDS leds) + { + DoBlinkLedsAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, leds, 1); + } + + public static void Leds_Blink(TuxAPI_LEDS leds, int count) + { + DoBlinkLedsAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, leds, count); + } + + public static void Leds_Blink(TuxAPI_LEDS leds, int count, double delay) + { + DoBlinkLedsAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, leds, count, delay); + } + + #endregion + + #region Rotation + /// <summary> + /// Permet de faire tourner Tux sur la gauche + /// </summary> + /// <param name="rotation">Nombre de rotation</param> + public static void Rotation_Left(int rotation) + { + DoRotorAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.ROTATE_LEFT, rotation); + } + + /// <summary> + /// Permet de faire tourner Tux sur la droite + /// </summary> + /// <param name="rotation"></param> + public static void Rotation_Right(int rotation) + { + DoRotorAction(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.ROTATE_RIGHT, rotation); + } + #endregion + + #region Attitune + /// <summary> + /// Play attitune + /// </summary> + /// <param name="attitune">the attitune to play</param> + public static void PlayAttitune(string attitune) + { + AttituneControl(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.ATTITUNE_PLAY, attitune); + } + + /// <summary> + /// Stop current playing attitune + /// </summary> + public static void StopAttitune() + { + AttituneControl(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.ATTITUNE_STOP, ""); + } + #endregion + + #region Wav Sound + public static void PlayWav(string sound) + { + WavControl(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.WAV_PLAY, sound); + } + + public static void StopWav() + { + WavControl(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, TuxAPI_ACTION.WAV_STOP, ""); + } + #endregion + + #endregion + + #region SPECIAL STATUS: + private static string getRawStatus(TuxAPI_LEVEL level, TuxAPI_STATUS_REQUESTED status) + { + wc = new WebClient(); + + string status_name = string.Empty; + + switch (status) + { + #region Flippers + case TuxAPI_STATUS_REQUESTED.flippers_motor_on: status_name = "flippers_motor_on"; + break; + case TuxAPI_STATUS_REQUESTED.flippers_position: status_name = "flippers_position"; + break; + case TuxAPI_STATUS_REQUESTED.flippers_remaining_movements: status_name = "flippers_remaining_movements"; + break; + #endregion + + #region Eyes + case TuxAPI_STATUS_REQUESTED.eyes_motor_on: status_name = "eyes_motor_on"; + break; + case TuxAPI_STATUS_REQUESTED.eyes_position: status_name = "eyes_position"; + break; + case TuxAPI_STATUS_REQUESTED.eyes_remaining_movements: status_name = "eyes_remaining_movements"; + break; + #endregion + + #region Mouth + case TuxAPI_STATUS_REQUESTED.mouth_motor_on: status_name = "mouth_motor_on"; + break; + case TuxAPI_STATUS_REQUESTED.mouth_position: status_name = "mouth_position"; + break; + case TuxAPI_STATUS_REQUESTED.mouth_remaining_movements: status_name = "mouth_remaining_movements"; + break; + #endregion + + #region Spin + case TuxAPI_STATUS_REQUESTED.spin_left_motor_on: status_name = "spin_left_motor_on"; + break; + case TuxAPI_STATUS_REQUESTED.spin_right_motor_on: status_name = "spin_right_motor_on"; + break; + case TuxAPI_STATUS_REQUESTED.spinning_direction: status_name = "spinning_direction"; + break; + case TuxAPI_STATUS_REQUESTED.spinning_remaining_movements: status_name = "spinning_remaining_movements"; + break; + #endregion + + #region Leds + case TuxAPI_STATUS_REQUESTED.right_led_state: status_name = "right_led_state"; + break; + case TuxAPI_STATUS_REQUESTED.left_led_state: status_name = "left_led_state"; + break; + #endregion + + + case TuxAPI_STATUS_REQUESTED.light_level: status_name = "light_level"; + break; + case TuxAPI_STATUS_REQUESTED.battery_state: status_name = "battery_state"; + break; + case TuxAPI_STATUS_REQUESTED.battery_level: status_name = "battery_level"; + break; + case TuxAPI_STATUS_REQUESTED.charger_state: status_name = "charger_state"; + break; + } + + + string data_raw = wc.DownloadString("http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/status/request_one?status_name="+status_name); + + string[] sp = data_raw.Split('>'); + + string data = sp[10].Replace("</value", "").Trim(); + + + return data; + } + + public static string getStatus(TuxAPI_STATUS_REQUESTED status) + { + return getRawStatus(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, status); + } + + + //==================== GESTION DES EVENEMENT ======================= + //=== TEST === + + public delegate void leftWingActive(); + + + #endregion + + #region special buttons + private static string getRawButtonStatus(TuxAPI_LEVEL level, TuxAPI_BUTTON_REQUESTED button) + { + wc = new WebClient(); + string status_name = string.Empty; + + switch (button) + { + case TuxAPI_BUTTON_REQUESTED.head_button: status_name = "head_button"; + break; + case TuxAPI_BUTTON_REQUESTED.left_wing_button: status_name = "left_wing_button"; + break; + case TuxAPI_BUTTON_REQUESTED.right_wing_button: status_name = "right_wing_button"; + break; + } + + string data_raw = wc.DownloadString("http://" + TuxAPI_Host + ":" + TuxAPI_Port + "/" + (int)level + "/status/request_one?status_name=" + status_name); + string[] sp = data_raw.Split('>'); + string data = sp[10].Replace("</value", "").Trim(); + + return data; + } + + public static bool getButtonStatus(TuxAPI_BUTTON_REQUESTED button) + { + string state = getRawButtonStatus(TuxAPI_LEVEL.CLIENT_LEVEL_FREE, button); + + if (state == "False") + return false; + if (state == "True") + return true; + + return false; + } + #endregion + } + + + + //============= GESTION DES BOUTONS ============== + + /// <summary> + /// Event Manager for the 3 buttons of Tux Droid + /// </summary> + public class TuxButtonEventMgr + { + //on défini une délégation + public delegate void HeadButtonPressedEventHandler(object sender, TuxButtonEventArgs e); + public delegate void LeftButtonPressedEventHandler(object sender, TuxButtonEventArgs e); + public delegate void RightButtonPressedEventHandler(object sender, TuxButtonEventArgs e); + + //on créer l'événement + public event HeadButtonPressedEventHandler OnHeadButtonPressed; + public event LeftButtonPressedEventHandler OnLeftButtonPressed; + public event RightButtonPressedEventHandler OnRightButtonPressed; + + /// <summary> + /// Timer for checking the buttons status + /// </summary> + System.Windows.Forms.Timer t1 = new System.Windows.Forms.Timer(); + + /// <summary> + /// Start the buttons's event manager + /// </summary> + public void Start() + { + t1.Interval = 500; //500 like a good value + t1.Enabled = true; //active timer + t1.Tick += new EventHandler(t1_Tick); //tick + } + + /// <summary> + /// Function called when timer Tick + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + void t1_Tick(object sender, EventArgs e) + { + TuxButtonEventArgs b1 = new TuxButtonEventArgs(); //head + TuxButtonEventArgs b2 = new TuxButtonEventArgs(); //left + TuxButtonEventArgs b3 = new TuxButtonEventArgs(); //right + + //head + if (b1 != null && OnHeadButtonPressed != null) + { + b1.buttonPressed = TuxAPI.getButtonStatus(TuxAPI.TuxAPI_BUTTON_REQUESTED.head_button); + OnHeadButtonPressed(this, b1); + } + + //left + if (b2 != null && OnLeftButtonPressed != null) + { + b2.buttonPressed = TuxAPI.getButtonStatus(TuxAPI.TuxAPI_BUTTON_REQUESTED.left_wing_button); + OnLeftButtonPressed(this, b2); + } + + //right + if (b3 != null && OnRightButtonPressed != null) + { + b3.buttonPressed = TuxAPI.getButtonStatus(TuxAPI.TuxAPI_BUTTON_REQUESTED.right_wing_button); + OnRightButtonPressed(this, b3); + } + } + + //constructeur + public TuxButtonEventMgr() { } + } + + /// <summary> + /// Permet de connaitre ou de donner l'état d'un bouton + /// </summary> + public class TuxButtonEventArgs : EventArgs + { + private bool m_buttonPressed; + public bool buttonPressed + { + get { return m_buttonPressed; } + set { m_buttonPressed = value; } + } + } + + + + //========== GESTION DES MODIFICATION DATE/TIME ======== + + //ajouter la gestion heure et chaque element séparé + + public class TuxDateTimeEventMgr + { + private string old_day { get; set; } + private string old_month { get; set; } + private string old_year { get; set; } + private string old_hour { get; set; } + private string old_min { get; set; } + private string old_sec { get; set; } + + //on défini une délégation + public delegate void DayChangeEventHandler(object sender, TuxDateTimeEventArgs e); + public delegate void MonthChangeEventHandler(object sender, TuxDateTimeEventArgs e); + public delegate void YearChangeEventHandler(object sender, TuxDateTimeEventArgs e); + + public delegate void HourChangeEventHandler(object sender, TuxDateTimeEventArgs e); + public delegate void MinutesChangeEventHandler(object sender, TuxDateTimeEventArgs e); + public delegate void SecondsChangeEventHandler(object sender, TuxDateTimeEventArgs e); + + //on créer l'événement + public event DayChangeEventHandler OnDayChange; + public event MonthChangeEventHandler OnMonthChange; + public event YearChangeEventHandler OnYearChange; + + public event HourChangeEventHandler OnHourChange; + public event MinutesChangeEventHandler OnMinutesChange; + public event SecondsChangeEventHandler OnSecondsChange; + + + /// <summary> + /// Timer for checking the buttons status + /// </summary> + System.Windows.Forms.Timer t1 = new System.Windows.Forms.Timer(); + + /// <summary> + /// Start the buttons's event manager + /// </summary> + public void Start() + { + old_day = DateTime.Now.Day.ToString(); + old_month = DateTime.Now.Month.ToString(); + old_year = DateTime.Now.Year.ToString(); + + old_hour = DateTime.Now.Hour.ToString(); + old_min = DateTime.Now.Minute.ToString(); + old_sec = DateTime.Now.Second.ToString(); + + + t1.Interval = 500; //set good value + t1.Enabled = true; //active timer + t1.Tick += new EventHandler(t1_Tick); //tick + } + + /// <summary> + /// Function called when timer Tick + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + void t1_Tick(object sender, EventArgs e) + { + + //TuxButtonEventArgs e = new TuxButtonEventArgs(); + TuxDateTimeEventArgs DayEventArgs = new TuxDateTimeEventArgs(); + TuxDateTimeEventArgs MonthEventArgs = new TuxDateTimeEventArgs(); + TuxDateTimeEventArgs YearEventArgs = new TuxDateTimeEventArgs(); + + TuxDateTimeEventArgs HourEventArgs = new TuxDateTimeEventArgs(); + TuxDateTimeEventArgs MinutesEventArgs = new TuxDateTimeEventArgs(); + TuxDateTimeEventArgs SecondsEventArgs = new TuxDateTimeEventArgs(); + + //Ok now we check ! + string day = DateTime.Now.Day.ToString(); + string month = DateTime.Now.Month.ToString(); + string year = DateTime.Now.Year.ToString(); + + string hour = DateTime.Now.Hour.ToString(); + string min = DateTime.Now.Minute.ToString(); + string sec = DateTime.Now.Second.ToString(); + + + + if (old_day == string.Empty || old_day == "") //no data yet + old_day = day; + else + { + if (DayEventArgs != null && OnDayChange != null) + { + if (day != old_day) + { + old_day = day; + DayEventArgs.DateTimeHaveChanged = true; + OnDayChange(this, DayEventArgs); + } + else + { + DayEventArgs.DateTimeHaveChanged = false; + OnDayChange(this, DayEventArgs); + } + } + } + + if (old_month == string.Empty || old_month == "") //no data yet + old_month = month; + else + { + if (MonthEventArgs != null && OnMonthChange != null) + { + if (month != old_month) + { + old_month = month; + MonthEventArgs.DateTimeHaveChanged = true; + OnMonthChange(this, MonthEventArgs); + } + else + { + MonthEventArgs.DateTimeHaveChanged = false; + OnMonthChange(this, MonthEventArgs); + } + } + } + + if (old_year == string.Empty || old_year == "") + old_year = year; + else + { + if (YearEventArgs != null && OnYearChange != null) + { + if (year != old_year) + { + old_year = year; + YearEventArgs.DateTimeHaveChanged = true; + OnYearChange(this, YearEventArgs); + } + else + { + YearEventArgs.DateTimeHaveChanged = false; + OnYearChange(this, YearEventArgs); + } + } + } + + if (old_hour == string.Empty || old_hour == "") + old_hour = hour; + else + { + if (HourEventArgs != null && OnHourChange != null) + { + if (hour != old_hour) + { + old_hour = hour; + HourEventArgs.DateTimeHaveChanged = true; + OnHourChange(this, HourEventArgs); + } + else + { + if (HourEventArgs.DateTimeHaveChanged) + { + HourEventArgs.DateTimeHaveChanged = false; + OnHourChange(this, HourEventArgs); + } + } + } + } + + if (old_min == string.Empty || old_min == "") + old_min = min; + else + { + if (MinutesEventArgs != null && OnMinutesChange != null) + { + if (min != old_min) + { + old_min = min; + MinutesEventArgs.DateTimeHaveChanged = true; + OnMinutesChange(this, MinutesEventArgs); + } + else + { + if (MinutesEventArgs.DateTimeHaveChanged) + { + MinutesEventArgs.DateTimeHaveChanged = false; + OnMinutesChange(this, MinutesEventArgs); + } + } + } + } + + if (old_sec == string.Empty || old_sec == "") + old_sec = sec; + else + { + if (SecondsEventArgs != null && OnSecondsChange != null) + { + if (sec != old_sec) + { + old_sec = sec; + SecondsEventArgs.DateTimeHaveChanged = true; + OnSecondsChange(this, SecondsEventArgs); + } + else + { + SecondsEventArgs.DateTimeHaveChanged = false; + OnSecondsChange(this, SecondsEventArgs); + } + } + } + } + } + + public class TuxDateTimeEventArgs : EventArgs + { + private bool m_DateTimeHaveChanged; + public bool DateTimeHaveChanged + { + get { return m_DateTimeHaveChanged; } + set { m_DateTimeHaveChanged = value; } + } + } + +} Added: software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/_tux_a_p_i_8cs.html =================================================================== --- software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/_tux_a_p_i_8cs.html (rev 0) +++ software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/_tux_a_p_i_8cs.html 2009-05-30 12:35:03 UTC (rev 4711) @@ -0,0 +1,50 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>Tux C# API: C:/Documents and Settings/Administrateur/Bureau/apidoc/TuxAPI.cs File Reference</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.9 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="main.html"><span>Main Page</span></a></li> + <li><a href="namespaces.html"><span>Packages</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + </ul> + </div> +</div> +<div class="contents"> +<h1>C:/Documents and Settings/Administrateur/Bureau/apidoc/TuxAPI.cs File Reference</h1> +<p> +<a href="_tux_a_p_i_8cs_source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> +<tr><td></td></tr> +<tr><td colspan="2"><br><h2>Classes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="class_tux_a_p_i_1_1_tux_a_p_i.html">TuxAPI.TuxAPI</a></td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="class_tux_a_p_i_1_1_tux_button_event_mgr.html">TuxAPI.TuxButtonEventMgr</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Event Manager for the 3 buttons of Tux Droid. <a href="class_tux_a_p_i_1_1_tux_button_event_mgr.html#_details">More...</a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="class_tux_a_p_i_1_1_tux_button_event_args.html">TuxAPI.TuxButtonEventArgs</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Permet de connaitre ou de donner l'état d'un bouton. <a href="class_tux_a_p_i_1_1_tux_button_event_args.html#_details">More...</a><br></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="class_tux_a_p_i_1_1_tux_date_time_event_mgr.html">TuxAPI.TuxDateTimeEventMgr</a></td></tr> + +<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="class_tux_a_p_i_1_1_tux_date_time_event_args.html">TuxAPI.TuxDateTimeEventArgs</a></td></tr> + +<tr><td colspan="2"><br><h2>Packages</h2></td></tr> +<tr><td class="memItemLeft" nowrap align="right" valign="top">package </td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_tux_a_p_i.html">TuxAPI</a></td></tr> + +</table> +</div> +<hr size="1"><address style="text-align: right;"><small>Generated on Sat May 30 13:14:08 2009 for Tux C# API by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> +</body> +</html> Added: software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/_tux_a_p_i_8cs_source.html =================================================================== --- software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/_tux_a_p_i_8cs_source.html (rev 0) +++ software_suite_v3/smart-core/smart-api/csharp/trunk/API Documentation/_tux_a_p_i_8cs_source.html 2009-05-30 12:35:03 UTC (rev 4711) @@ -0,0 +1,1151 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> +<title>Tux C# API: C:/Documents and Settings/Administrateur/Bureau/apidoc/TuxAPI.cs Source File</title> +<link href="tabs.css" rel="stylesheet" type="text/css"> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.5.9 --> +<div class="navigation" id="top"> + <div class="tabs"> + <ul> + <li><a href="main.html"><span>Main Page</span></a></li> + <li><a href="namespaces.html"><span>Packages</span></a></li> + <li><a href="annotated.html"><span>Classes</span></a></li> + <li class="current"><a href="files.html"><span>Files</span></a></li> + </ul> + </div> + <div class="tabs"> + <ul> + <li><a href="files.html"><span>File List</span></a></li> + </ul> + </div> +<h1>C:/Documents and Settings/Administrateur/Bureau/apidoc/TuxAPI.cs</h1><a href="_tux_a_p_i_8cs.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> +<a name="l00002"></a>00002 <span class="comment"> * C# TuxAPI</span> +<a name="l00003"></a>00003 <span class="comment"> * </span> +<a name="l00004"></a>00004 <span class="comment"> * An API written in C# for the Tux Droid</span> +<a name="l00005"></a>00005 <span class="comment"> * </span> +<a name="l00006"></a>00006 <span class="comment"> * Joel Matteotti <joel.matteotti _AT_ free _DOT_ fr></span> +<a name="l00007"></a>00007 <span class="comment"> * </span> +<a name="l00008"></a>00008 <span class="comment"> * Version 1.0.0</span> +<a name="l00009"></a>00009 <span class="comment"> * </span> +<a name="l00010"></a>00010 <span class="comment"> * =============== GPL HEADER =====================</span> +<a name="l00011"></a>00011 <span class="comment"> * This file is part of C# TuxAPI.</span> +<a name="l00012"></a>00012 <span class="comment"> *</span> +<a name="l00013"></a>00013 <span class="comment"> * C# TuxAPI is free software: you can redistribute it and/or modify</span> +<a name="l00014"></a>00014 <span class="comment"> * it under the terms of the GNU General Public License as published by</span> +<a name="l00015"></a>00015 <span class="comment"> * the Free Software Foundation, either version 3 of the License, or</span> +<a name="l00016"></a>00016 <span class="comment"> * (at your option) any later version.</span> +<a name="l00017"></a>00017 <span class="comment"> *</span> +<a name="l00018"></a>00018 <span class="comment"> * C# TuxAPI is distributed in the hope that it will be useful,</span> +<a name="l00019"></a>00019 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span> +<a name="l00020"></a>00020 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> +<a name="l00021"></a>00021 <span class="comment"> * GNU General Public License for more details.</span> +<a name="l00022"></a>00022 <span class="comment"> *</span> +<a name="l00023"></a>00023 <span class="comment"> * You should have received a copy of the GNU General Public License</span> +<a name="l00024"></a>00024 <span class="comment"> * along with "C# TuxAPI". If not, see <http://www.gnu.org/licenses/>.</span> +<a name="l00025"></a>00025 <span class="comment"> * </span> +<a name="l00026"></a>00026 <span class="comment"> * ====================================================</span> +<a name="l00027"></a>00027 <span class="comment"> * </span> +<a name="l00028"></a>00028 <span cl... [truncated message content] |