Index: /trunk/LICENCE-fr.txt
===================================================================
--- /trunk/LICENCE-fr.txt	(revision 2)
+++ /trunk/LICENCE-fr.txt	(revision 2)
@@ -0,0 +1,529 @@
+
+Le framework de développement UTC/CNRS Heudiasyc Flair est distribué 
+sous les termes de la licence CECILL-C version 1.0.
+
+Copyright (c) UTC/CNRS Heudiasyc. All rights reserved.
+
+
+
+CONTRAT DE LICENCE DE LOGICIEL LIBRE CeCILL-C
+
+
+    Avertissement
+
+Ce contrat est une licence de logiciel libre issue d'une concertation
+entre ses auteurs afin que le respect de deux grands principes préside à
+sa rédaction:
+
+    * d'une part, le respect des principes de diffusion des logiciels
+      libres: accès au code source, droits étendus conférés aux
+      utilisateurs,
+    * d'autre part, la désignation d'un droit applicable, le droit
+      français, auquel elle est conforme, tant au regard du droit de la
+      responsabilité civile que du droit de la propriété intellectuelle
+      et de la protection qu'il offre aux auteurs et titulaires des
+      droits patrimoniaux sur un logiciel.
+
+Les auteurs de la licence CeCILL-C (pour Ce[a] C[nrs] I[nria] L[ogiciel]
+L[ibre]) sont:
+
+Commissariat à l'Energie Atomique - CEA, établissement public de
+recherche à caractère scientifique, technique et industriel, dont le
+siège est situé 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris.
+
+Centre National de la Recherche Scientifique - CNRS, établissement
+public à caractère scientifique et technologique, dont le siège est
+situé 3 rue Michel-Ange, 75794 Paris cedex 16.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, établissement public à caractère scientifique et technologique,
+dont le siège est situé Domaine de Voluceau, Rocquencourt, BP 105, 78153
+Le Chesnay cedex.
+
+
+    Préambule
+
+Ce contrat est une licence de logiciel libre dont l'objectif est de
+conférer aux utilisateurs la liberté de modifier et de réutiliser le
+logiciel régi par cette licence.
+
+L'exercice de cette liberté est assorti d'une obligation de remettre à
+la disposition de la communauté les modifications apportées au code
+source du logiciel afin de contribuer à son évolution.
+
+L'accessibilité au code source et les droits de copie, de modification
+et de redistribution qui découlent de ce contrat ont pour contrepartie
+de n'offrir aux utilisateurs qu'une garantie limitée et de ne faire
+peser sur l'auteur du logiciel, le titulaire des droits patrimoniaux et
+les concédants successifs qu'une responsabilité restreinte.
+
+A cet égard l'attention de l'utilisateur est attirée sur les risques
+associés au chargement, à l'utilisation, à la modification et/ou au
+développement et à la reproduction du logiciel par l'utilisateur étant
+donné sa spécificité de logiciel libre, qui peut le rendre complexe à
+manipuler et qui le réserve donc à des développeurs ou des
+professionnels avertis possédant des connaissances informatiques
+approfondies. Les utilisateurs sont donc invités à charger et tester
+l'adéquation du logiciel à leurs besoins dans des conditions permettant
+d'assurer la sécurité de leurs systèmes et/ou de leurs données et, plus
+généralement, à l'utiliser et l'exploiter dans les mêmes conditions de
+sécurité. Ce contrat peut être reproduit et diffusé librement, sous
+réserve de le conserver en l'état, sans ajout ni suppression de clauses.
+
+Ce contrat est susceptible de s'appliquer à tout logiciel dont le
+titulaire des droits patrimoniaux décide de soumettre l'exploitation aux
+dispositions qu'il contient.
+
+
+    Article 1 - DEFINITIONS
+
+Dans ce contrat, les termes suivants, lorsqu'ils seront écrits avec une
+lettre capitale, auront la signification suivante:
+
+Contrat: désigne le présent contrat de licence, ses éventuelles versions
+postérieures et annexes.
+
+Logiciel: désigne le logiciel sous sa forme de Code Objet et/ou de Code
+Source et le cas échéant sa documentation, dans leur état au moment de
+l'acceptation du Contrat par le Licencié.
+
+Logiciel Initial: désigne le Logiciel sous sa forme de Code Source et
+éventuellement de Code Objet et le cas échéant sa documentation, dans
+leur état au moment de leur première diffusion sous les termes du Contrat.
+
+Logiciel Modifié: désigne le Logiciel modifié par au moins une
+Contribution Intégrée.
+
+Code Source: désigne l'ensemble des instructions et des lignes de
+programme du Logiciel et auquel l'accès est nécessaire en vue de
+modifier le Logiciel.
+
+Code Objet: désigne les fichiers binaires issus de la compilation du
+Code Source.
+
+Titulaire: désigne le ou les détenteurs des droits patrimoniaux d'auteur
+sur le Logiciel Initial.
+
+Licencié: désigne le ou les utilisateurs du Logiciel ayant accepté le
+Contrat.
+
+Contributeur: désigne le Licencié auteur d'au moins une Contribution
+Intégrée.
+
+Concédant: désigne le Titulaire ou toute personne physique ou morale
+distribuant le Logiciel sous le Contrat.
+
+Contribution Intégrée: désigne l'ensemble des modifications,
+corrections, traductions, adaptations et/ou nouvelles fonctionnalités
+intégrées dans le Code Source par tout Contributeur.
+
+Module Lié: désigne un ensemble de fichiers sources y compris leur
+documentation qui, sans modification du Code Source, permet de réaliser
+des fonctionnalités ou services supplémentaires à ceux fournis par le
+Logiciel.
+
+Logiciel Dérivé: désigne toute combinaison du Logiciel, modifié ou non,
+et d'un Module Lié.
+
+Parties: désigne collectivement le Licencié et le Concédant.
+
+Ces termes s'entendent au singulier comme au pluriel.
+
+
+    Article 2 - OBJET
+
+Le Contrat a pour objet la concession par le Concédant au Licencié d'une
+licence non exclusive, cessible et mondiale du Logiciel telle que
+définie ci-après à l'article 5 pour toute la durée de protection des droits
+portant sur ce Logiciel.
+
+
+    Article 3 - ACCEPTATION
+
+3.1 L'acceptation par le Licencié des termes du Contrat est réputée
+acquise du fait du premier des faits suivants:
+
+    * (i) le chargement du Logiciel par tout moyen notamment par
+      téléchargement à partir d'un serveur distant ou par chargement à
+      partir d'un support physique;
+    * (ii) le premier exercice par le Licencié de l'un quelconque des
+      droits concédés par le Contrat.
+
+3.2 Un exemplaire du Contrat, contenant notamment un avertissement
+relatif aux spécificités du Logiciel, à la restriction de garantie et à
+la limitation à un usage par des utilisateurs expérimentés a été mis à
+disposition du Licencié préalablement à son acceptation telle que
+définie à l'article 3.1 ci dessus et le Licencié reconnaît en avoir pris
+connaissance.
+
+
+    Article 4 - ENTREE EN VIGUEUR ET DUREE
+
+
+      4.1 ENTREE EN VIGUEUR
+
+Le Contrat entre en vigueur à la date de son acceptation par le Licencié
+telle que définie en 3.1.
+
+
+      4.2 DUREE
+
+Le Contrat produira ses effets pendant toute la durée légale de
+protection des droits patrimoniaux portant sur le Logiciel.
+
+
+    Article 5 - ETENDUE DES DROITS CONCEDES
+
+Le Concédant concède au Licencié, qui accepte, les droits suivants sur
+le Logiciel pour toutes destinations et pour la durée du Contrat dans
+les conditions ci-après détaillées.
+
+Par ailleurs, si le Concédant détient ou venait à détenir un ou
+plusieurs brevets d'invention protégeant tout ou partie des
+fonctionnalités du Logiciel ou de ses composants, il s'engage à ne pas
+opposer les éventuels droits conférés par ces brevets aux Licenciés
+successifs qui utiliseraient, exploiteraient ou modifieraient le
+Logiciel. En cas de cession de ces brevets, le Concédant s'engage à
+faire reprendre les obligations du présent alinéa aux cessionnaires.
+
+
+      5.1 DROIT D'UTILISATION
+
+Le Licencié est autorisé à utiliser le Logiciel, sans restriction quant
+aux domaines d'application, étant ci-après précisé que cela comporte:
+
+   1. la reproduction permanente ou provisoire du Logiciel en tout ou
+      partie par tout moyen et sous toute forme.
+
+   2. le chargement, l'affichage, l'exécution, ou le stockage du
+      Logiciel sur tout support.
+
+   3. la possibilité d'en observer, d'en étudier, ou d'en tester le
+      fonctionnement afin de déterminer les idées et principes qui sont
+      à la base de n'importe quel élément de ce Logiciel; et ceci,
+      lorsque le Licencié effectue toute opération de chargement,
+      d'affichage, d'exécution, de transmission ou de stockage du
+      Logiciel qu'il est en droit d'effectuer en vertu du Contrat.
+
+
+      5.2 DROIT DE MODIFICATION
+
+Le droit de modification comporte le droit de traduire, d'adapter,
+d'arranger ou d'apporter toute autre modification au Logiciel et le
+droit de reproduire le logiciel en résultant. Il comprend en particulier
+le droit de créer un Logiciel Dérivé.
+
+Le Licencié est autorisé à apporter toute modification au Logiciel sous
+réserve de mentionner, de façon explicite, son nom en tant qu'auteur de
+cette modification et la date de création de celle-ci.
+
+
+      5.3 DROIT DE DISTRIBUTION
+
+Le droit de distribution comporte notamment le droit de diffuser, de
+transmettre et de communiquer le Logiciel au public sur tout support et
+par tout moyen ainsi que le droit de mettre sur le marché à titre
+onéreux ou gratuit, un ou des exemplaires du Logiciel par tout procédé.
+
+Le Licencié est autorisé à distribuer des copies du Logiciel, modifié ou
+non, à des tiers dans les conditions ci-après détaillées.
+
+
+        5.3.1 DISTRIBUTION DU LOGICIEL SANS MODIFICATION
+
+Le Licencié est autorisé à distribuer des copies conformes du Logiciel,
+sous forme de Code Source ou de Code Objet, à condition que cette
+distribution respecte les dispositions du Contrat dans leur totalité et
+soit accompagnée:
+
+   1. d'un exemplaire du Contrat,
+
+   2. d'un avertissement relatif à la restriction de garantie et de
+      responsabilité du Concédant telle que prévue aux articles 8
+      et 9,
+
+et que, dans le cas où seul le Code Objet du Logiciel est redistribué,
+le Licencié permette un accès effectif au Code Source complet du
+Logiciel pendant au moins toute la durée de sa distribution du Logiciel,
+étant entendu que le coût additionnel d'acquisition du Code Source ne
+devra pas excéder le simple coût de transfert des données.
+
+
+        5.3.2 DISTRIBUTION DU LOGICIEL MODIFIE
+
+Lorsque le Licencié apporte une Contribution Intégrée au Logiciel, les
+conditions de distribution du Logiciel Modifié en résultant sont alors
+soumises à l'intégralité des dispositions du Contrat.
+
+Le Licencié est autorisé à distribuer le Logiciel Modifié sous forme de
+code source ou de code objet, à condition que cette distribution
+respecte les dispositions du Contrat dans leur totalité et soit
+accompagnée:
+
+   1. d'un exemplaire du Contrat,
+
+   2. d'un avertissement relatif à la restriction de garantie et de
+      responsabilité du Concédant telle que prévue aux articles 8
+      et 9,
+
+et que, dans le cas où seul le code objet du Logiciel Modifié est
+redistribué, le Licencié permette un accès effectif à son code source
+complet pendant au moins toute la durée de sa distribution du Logiciel
+Modifié, étant entendu que le coût additionnel d'acquisition du code
+source ne devra pas excéder le simple coût de transfert des données.
+
+
+        5.3.3 DISTRIBUTION DU LOGICIEL DERIVE
+
+Lorsque le Licencié crée un Logiciel Dérivé, ce Logiciel Dérivé peut
+être distribué sous un contrat de licence autre que le présent Contrat à
+condition de respecter les obligations de mention des droits sur le
+Logiciel telles que définies à l'article 6.4. Dans le cas où la création du
+Logiciel Dérivé a nécessité une modification du Code Source le licencié
+s'engage à ce que: 
+
+   1. le Logiciel Modifié correspondant à cette modification soit régi
+      par le présent Contrat,
+   2. les Contributions Intégrées dont le Logiciel Modifié résulte
+      soient clairement identifiées et documentées,
+   3. le Licencié permette un accès effectif au code source du Logiciel
+      Modifié, pendant au moins toute la durée de la distribution du
+      Logiciel Dérivé, de telle sorte que ces modifications puissent
+      être reprises dans une version ultérieure du Logiciel, étant
+      entendu que le coût additionnel d'acquisition du code source du
+      Logiciel Modifié ne devra pas excéder le simple coût du transfert
+      des données.
+
+
+        5.3.4 COMPATIBILITE AVEC LA LICENCE CeCILL
+
+Lorsqu'un Logiciel Modifié contient une Contribution Intégrée soumise au
+contrat de licence CeCILL, ou lorsqu'un Logiciel Dérivé contient un
+Module Lié soumis au contrat de licence CeCILL, les stipulations prévues
+au troisième item de l'article 6.4 sont facultatives.
+
+
+    Article 6 - PROPRIETE INTELLECTUELLE
+
+
+      6.1 SUR LE LOGICIEL INITIAL
+
+Le Titulaire est détenteur des droits patrimoniaux sur le Logiciel
+Initial. Toute utilisation du Logiciel Initial est soumise au respect
+des conditions dans lesquelles le Titulaire a choisi de diffuser son
+oeuvre et nul autre n'a la faculté de modifier les conditions de
+diffusion de ce Logiciel Initial.
+
+Le Titulaire s'engage à ce que le Logiciel Initial reste au moins régi
+par le Contrat et ce, pour la durée visée à l'article 4.2.
+
+
+      6.2 SUR LES CONTRIBUTIONS INTEGREES
+
+Le Licencié qui a développé une Contribution Intégrée est titulaire sur
+celle-ci des droits de propriété intellectuelle dans les conditions
+définies par la législation applicable.
+
+
+      6.3 SUR LES MODULES LIES
+
+Le Licencié qui a développé un Module Lié est titulaire sur celui-ci des
+droits de propriété intellectuelle dans les conditions définies par la
+législation applicable et reste libre du choix du contrat régissant sa
+diffusion dans les conditions définies à l'article 5.3.3.
+
+
+      6.4 MENTIONS DES DROITS
+
+Le Licencié s'engage expressément:
+
+   1. à ne pas supprimer ou modifier de quelque manière que ce soit les
+      mentions de propriété intellectuelle apposées sur le Logiciel;
+
+   2. à reproduire à l'identique lesdites mentions de propriété
+      intellectuelle sur les copies du Logiciel modifié ou non;
+
+   3. à faire en sorte que l'utilisation du Logiciel, ses mentions de
+      propriété intellectuelle et le fait qu'il est régi par le Contrat
+      soient indiqués dans un texte facilement accessible notamment
+      depuis l'interface de tout Logiciel Dérivé.
+
+Le Licencié s'engage à ne pas porter atteinte, directement ou
+indirectement, aux droits de propriété intellectuelle du Titulaire et/ou
+des Contributeurs sur le Logiciel et à prendre, le cas échéant, à
+l'égard de son personnel toutes les mesures nécessaires pour assurer le
+respect des dits droits de propriété intellectuelle du Titulaire et/ou
+des Contributeurs.
+
+
+    Article 7 - SERVICES ASSOCIES
+
+7.1 Le Contrat n'oblige en aucun cas le Concédant à la réalisation de
+prestations d'assistance technique ou de maintenance du Logiciel.
+
+Cependant le Concédant reste libre de proposer ce type de services. Les
+termes et conditions d'une telle assistance technique et/ou d'une telle
+maintenance seront alors déterminés dans un acte séparé. Ces actes de
+maintenance et/ou assistance technique n'engageront que la seule
+responsabilité du Concédant qui les propose.
+
+7.2 De même, tout Concédant est libre de proposer, sous sa seule
+responsabilité, à ses licenciés une garantie, qui n'engagera que lui,
+lors de la redistribution du Logiciel et/ou du Logiciel Modifié et ce,
+dans les conditions qu'il souhaite. Cette garantie et les modalités
+financières de son application feront l'objet d'un acte séparé entre le
+Concédant et le Licencié.
+
+
+    Article 8 - RESPONSABILITE
+
+8.1 Sous réserve des dispositions de l'article 8.2, le Licencié a la 
+faculté, sous réserve de prouver la faute du Concédant concerné, de
+solliciter la réparation du préjudice direct qu'il subirait du fait du
+Logiciel et dont il apportera la preuve.
+
+8.2 La responsabilité du Concédant est limitée aux engagements pris en
+application du Contrat et ne saurait être engagée en raison notamment:
+(i) des dommages dus à l'inexécution, totale ou partielle, de ses
+obligations par le Licencié, (ii) des dommages directs ou indirects
+découlant de l'utilisation ou des performances du Logiciel subis par le
+Licencié et (iii) plus généralement d'un quelconque dommage indirect. En
+particulier, les Parties conviennent expressément que tout préjudice
+financier ou commercial (par exemple perte de données, perte de
+bénéfices, perte d'exploitation, perte de clientèle ou de commandes,
+manque à gagner, trouble commercial quelconque) ou toute action dirigée
+contre le Licencié par un tiers, constitue un dommage indirect et
+n'ouvre pas droit à réparation par le Concédant.
+
+
+    Article 9 - GARANTIE
+
+9.1 Le Licencié reconnaît que l'état actuel des connaissances
+scientifiques et techniques au moment de la mise en circulation du
+Logiciel ne permet pas d'en tester et d'en vérifier toutes les
+utilisations ni de détecter l'existence d'éventuels défauts. L'attention
+du Licencié a été attirée sur ce point sur les risques associés au
+chargement, à l'utilisation, la modification et/ou au développement et à
+la reproduction du Logiciel qui sont réservés à des utilisateurs avertis.
+
+Il relève de la responsabilité du Licencié de contrôler, par tous
+moyens, l'adéquation du produit à ses besoins, son bon fonctionnement et
+de s'assurer qu'il ne causera pas de dommages aux personnes et aux biens.
+
+9.2 Le Concédant déclare de bonne foi être en droit de concéder
+l'ensemble des droits attachés au Logiciel (comprenant notamment les
+droits visés à l'article 5).
+
+9.3 Le Licencié reconnaît que le Logiciel est fourni "en l'état" par le
+Concédant sans autre garantie, expresse ou tacite, que celle prévue à
+l'article 9.2 et notamment sans aucune garantie sur sa valeur commerciale,
+son caractère sécurisé, innovant ou pertinent.
+
+En particulier, le Concédant ne garantit pas que le Logiciel est exempt
+d'erreur, qu'il fonctionnera sans interruption, qu'il sera compatible
+avec l'équipement du Licencié et sa configuration logicielle ni qu'il
+remplira les besoins du Licencié.
+
+9.4 Le Concédant ne garantit pas, de manière expresse ou tacite, que le
+Logiciel ne porte pas atteinte à un quelconque droit de propriété
+intellectuelle d'un tiers portant sur un brevet, un logiciel ou sur tout
+autre droit de propriété. Ainsi, le Concédant exclut toute garantie au
+profit du Licencié contre les actions en contrefaçon qui pourraient être
+diligentées au titre de l'utilisation, de la modification, et de la
+redistribution du Logiciel. Néanmoins, si de telles actions sont
+exercées contre le Licencié, le Concédant lui apportera son aide
+technique et juridique pour sa défense. Cette aide technique et
+juridique est déterminée au cas par cas entre le Concédant concerné et
+le Licencié dans le cadre d'un protocole d'accord. Le Concédant dégage
+toute responsabilité quant à l'utilisation de la dénomination du
+Logiciel par le Licencié. Aucune garantie n'est apportée quant à
+l'existence de droits antérieurs sur le nom du Logiciel et sur
+l'existence d'une marque.
+
+
+    Article 10 - RESILIATION
+
+10.1 En cas de manquement par le Licencié aux obligations mises à sa
+charge par le Contrat, le Concédant pourra résilier de plein droit le
+Contrat trente (30) jours après notification adressée au Licencié et
+restée sans effet.
+
+10.2 Le Licencié dont le Contrat est résilié n'est plus autorisé à
+utiliser, modifier ou distribuer le Logiciel. Cependant, toutes les
+licences qu'il aura concédées antérieurement à la résiliation du Contrat
+resteront valides sous réserve qu'elles aient été effectuées en
+conformité avec le Contrat.
+
+
+    Article 11 - DISPOSITIONS DIVERSES
+
+
+      11.1 CAUSE EXTERIEURE
+
+Aucune des Parties ne sera responsable d'un retard ou d'une défaillance
+d'exécution du Contrat qui serait dû à un cas de force majeure, un cas
+fortuit ou une cause extérieure, telle que, notamment, le mauvais
+fonctionnement ou les interruptions du réseau électrique ou de
+télécommunication, la paralysie du réseau liée à une attaque
+informatique, l'intervention des autorités gouvernementales, les
+catastrophes naturelles, les dégâts des eaux, les tremblements de terre,
+le feu, les explosions, les grèves et les conflits sociaux, l'état de
+guerre...
+
+11.2 Le fait, par l'une ou l'autre des Parties, d'omettre en une ou
+plusieurs occasions de se prévaloir d'une ou plusieurs dispositions du
+Contrat, ne pourra en aucun cas impliquer renonciation par la Partie
+intéressée à s'en prévaloir ultérieurement.
+
+11.3 Le Contrat annule et remplace toute convention antérieure, écrite
+ou orale, entre les Parties sur le même objet et constitue l'accord
+entier entre les Parties sur cet objet. Aucune addition ou modification
+aux termes du Contrat n'aura d'effet à l'égard des Parties à moins
+d'être faite par écrit et signée par leurs représentants dûment habilités.
+
+11.4 Dans l'hypothèse où une ou plusieurs des dispositions du Contrat
+s'avèrerait contraire à une loi ou à un texte applicable, existants ou
+futurs, cette loi ou ce texte prévaudrait, et les Parties feraient les
+amendements nécessaires pour se conformer à cette loi ou à ce texte.
+Toutes les autres dispositions resteront en vigueur. De même, la
+nullité, pour quelque raison que ce soit, d'une des dispositions du
+Contrat ne saurait entraîner la nullité de l'ensemble du Contrat.
+
+
+      11.5 LANGUE
+
+Le Contrat est rédigé en langue française et en langue anglaise, ces
+deux versions faisant également foi.
+
+
+    Article 12 - NOUVELLES VERSIONS DU CONTRAT
+
+12.1 Toute personne est autorisée à copier et distribuer des copies de
+ce Contrat.
+
+12.2 Afin d'en préserver la cohérence, le texte du Contrat est protégé
+et ne peut être modifié que par les auteurs de la licence, lesquels se
+réservent le droit de publier périodiquement des mises à jour ou de
+nouvelles versions du Contrat, qui posséderont chacune un numéro
+distinct. Ces versions ultérieures seront susceptibles de prendre en
+compte de nouvelles problématiques rencontrées par les logiciels libres.
+
+12.3 Tout Logiciel diffusé sous une version donnée du Contrat ne pourra
+faire l'objet d'une diffusion ultérieure que sous la même version du
+Contrat ou une version postérieure.
+
+
+    Article 13 - LOI APPLICABLE ET COMPETENCE TERRITORIALE
+
+13.1 Le Contrat est régi par la loi française. Les Parties conviennent
+de tenter de régler à l'amiable les différends ou litiges qui
+viendraient à se produire par suite ou à l'occasion du Contrat.
+
+13.2 A défaut d'accord amiable dans un délai de deux (2) mois à compter
+de leur survenance et sauf situation relevant d'une procédure d'urgence,
+les différends ou litiges seront portés par la Partie la plus diligente
+devant les Tribunaux compétents de Paris.
+
+
+Version 1.0 du 2006-09-05.
+
Index: /trunk/LICENSE.txt
===================================================================
--- /trunk/LICENSE.txt	(revision 2)
+++ /trunk/LICENSE.txt	(revision 2)
@@ -0,0 +1,561 @@
+
+UTC/CNRS Heudiasyc Flair framework is distributed under the CECILL-C 
+License, Version 1.0.
+
+Copyright (c) UTC/CNRS Heudiasyc. All rights reserved.
+
+
+
+CeCILL-C FREE SOFTWARE LICENSE AGREEMENT
+
+
+    Notice
+
+This Agreement is a Free Software license agreement that is the result
+of discussions between its authors in order to ensure compliance with
+the two main principles guiding its drafting:
+
+    * firstly, compliance with the principles governing the distribution
+      of Free Software: access to source code, broad rights granted to
+      users,
+    * secondly, the election of a governing law, French law, with which
+      it is conformant, both as regards the law of torts and
+      intellectual property law, and the protection that it offers to
+      both authors and holders of the economic rights over software.
+
+The authors of the CeCILL-C (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre])
+license are:
+
+Commissariat à l'Energie Atomique - CEA, a public scientific, technical
+and industrial research establishment, having its principal place of
+business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France.
+
+Centre National de la Recherche Scientifique - CNRS, a public scientific
+and technological establishment, having its principal place of business
+at 3 rue Michel-Ange, 75794 Paris cedex 16, France.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, a public scientific and technological establishment, having its
+principal place of business at Domaine de Voluceau, Rocquencourt, BP
+105, 78153 Le Chesnay cedex, France.
+
+
+    Preamble
+
+The purpose of this Free Software license agreement is to grant users
+the right to modify and re-use the software governed by this license.
+
+The exercising of this right is conditional upon the obligation to make
+available to the community the modifications made to the source code of
+the software so as to contribute to its evolution.
+
+In consideration of access to the source code and the rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty and the software's author, the holder of the
+economic rights, and the successive licensors only have limited liability.
+
+In this respect, the risks associated with loading, using, modifying
+and/or developing or reproducing the software by the user are brought to
+the user's attention, given its Free Software status, which may make it
+complicated to use, with the result that its use is reserved for
+developers and experienced professionals having in-depth computer
+knowledge. Users are therefore encouraged to load and test the
+suitability of the software as regards their requirements in conditions
+enabling the security of their systems and/or data to be ensured and,
+more generally, to use and operate it in the same conditions of
+security. This Agreement may be freely reproduced and published,
+provided it is not altered, and that no provisions are either added or
+removed herefrom.
+
+This Agreement may apply to any or all software for which the holder of
+the economic rights decides to submit the use thereof to its provisions.
+
+
+    Article 1 - DEFINITIONS
+
+For the purpose of this Agreement, when the following expressions
+commence with a capital letter, they shall have the following meaning:
+
+Agreement: means this license agreement, and its possible subsequent
+versions and annexes.
+
+Software: means the software in its Object Code and/or Source Code form
+and, where applicable, its documentation, "as is" when the Licensee
+accepts the Agreement.
+
+Initial Software: means the Software in its Source Code and possibly its
+Object Code form and, where applicable, its documentation, "as is" when
+it is first distributed under the terms and conditions of the Agreement.
+
+Modified Software: means the Software modified by at least one
+Integrated Contribution.
+
+Source Code: means all the Software's instructions and program lines to
+which access is required so as to modify the Software.
+
+Object Code: means the binary files originating from the compilation of
+the Source Code.
+
+Holder: means the holder(s) of the economic rights over the Initial
+Software.
+
+Licensee: means the Software user(s) having accepted the Agreement.
+
+Contributor: means a Licensee having made at least one Integrated
+Contribution.
+
+Licensor: means the Holder, or any other individual or legal entity, who
+distributes the Software under the Agreement.
+
+Integrated Contribution: means any or all modifications, corrections,
+translations, adaptations and/or new functions integrated into the
+Source Code by any or all Contributors.
+
+Related Module: means a set of sources files including their
+documentation that, without modification to the Source Code, enables
+supplementary functions or services in addition to those offered by the
+Software.
+
+Derivative Software: means any combination of the Software, modified or
+not, and of a Related Module.
+
+Parties: mean both the Licensee and the Licensor.
+
+These expressions may be used both in singular and plural form.
+
+
+    Article 2 - PURPOSE
+
+The purpose of the Agreement is the grant by the Licensor to the
+Licensee of a non-exclusive, transferable and worldwide license for the
+Software as set forth in Article 5 hereinafter for the whole term of the
+protection granted by the rights over said Software. 
+
+
+    Article 3 - ACCEPTANCE
+
+3.1 The Licensee shall be deemed as having accepted the terms and
+conditions of this Agreement upon the occurrence of the first of the
+following events:
+
+    * (i) loading the Software by any or all means, notably, by
+      downloading from a remote server, or by loading from a physical
+      medium;
+    * (ii) the first time the Licensee exercises any of the rights
+      granted hereunder.
+
+3.2 One copy of the Agreement, containing a notice relating to the
+characteristics of the Software, to the limited warranty, and to the
+fact that its use is restricted to experienced users has been provided
+to the Licensee prior to its acceptance as set forth in Article 3.1
+hereinabove, and the Licensee hereby acknowledges that it has read and
+understood it.
+
+
+    Article 4 - EFFECTIVE DATE AND TERM
+
+
+      4.1 EFFECTIVE DATE
+
+The Agreement shall become effective on the date when it is accepted by
+the Licensee as set forth in Article 3.1.
+
+
+      4.2 TERM
+
+The Agreement shall remain in force for the entire legal term of
+protection of the economic rights over the Software.
+
+
+    Article 5 - SCOPE OF RIGHTS GRANTED
+
+The Licensor hereby grants to the Licensee, who accepts, the following
+rights over the Software for any or all use, and for the term of the
+Agreement, on the basis of the terms and conditions set forth hereinafter.
+
+Besides, if the Licensor owns or comes to own one or more patents
+protecting all or part of the functions of the Software or of its
+components, the Licensor undertakes not to enforce the rights granted by
+these patents against successive Licensees using, exploiting or
+modifying the Software. If these patents are transferred, the Licensor
+undertakes to have the transferees subscribe to the obligations set
+forth in this paragraph.
+
+
+      5.1 RIGHT OF USE
+
+The Licensee is authorized to use the Software, without any limitation
+as to its fields of application, with it being hereinafter specified
+that this comprises:
+
+   1. permanent or temporary reproduction of all or part of the Software
+      by any or all means and in any or all form.
+
+   2. loading, displaying, running, or storing the Software on any or
+      all medium.
+
+   3. entitlement to observe, study or test its operation so as to
+      determine the ideas and principles behind any or all constituent
+      elements of said Software. This shall apply when the Licensee
+      carries out any or all loading, displaying, running, transmission
+      or storage operation as regards the Software, that it is entitled
+      to carry out hereunder.
+
+
+      5.2 RIGHT OF MODIFICATION
+
+The right of modification includes the right to translate, adapt,
+arrange, or make any or all modifications to the Software, and the right
+to reproduce the resulting software. It includes, in particular, the
+right to create a Derivative Software.
+
+The Licensee is authorized to make any or all modification to the
+Software provided that it includes an explicit notice that it is the
+author of said modification and indicates the date of the creation thereof.
+
+
+      5.3 RIGHT OF DISTRIBUTION
+
+In particular, the right of distribution includes the right to publish,
+transmit and communicate the Software to the general public on any or
+all medium, and by any or all means, and the right to market, either in
+consideration of a fee, or free of charge, one or more copies of the
+Software by any means.
+
+The Licensee is further authorized to distribute copies of the modified
+or unmodified Software to third parties according to the terms and
+conditions set forth hereinafter.
+
+
+        5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION
+
+The Licensee is authorized to distribute true copies of the Software in
+Source Code or Object Code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+   1. a copy of the Agreement,
+
+   2. a notice relating to the limitation of both the Licensor's
+      warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the Object Code of the Software is
+redistributed, the Licensee allows effective access to the full Source
+Code of the Software at a minimum during the entire period of its
+distribution of the Software, it being understood that the additional
+cost of acquiring the Source Code shall not exceed the cost of
+transferring the data.
+
+
+        5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE
+
+When the Licensee makes an Integrated Contribution to the Software, the
+terms and conditions for the distribution of the resulting Modified
+Software become subject to all the provisions of this Agreement.
+
+The Licensee is authorized to distribute the Modified Software, in
+source code or object code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+   1. a copy of the Agreement,
+
+   2. a notice relating to the limitation of both the Licensor's
+      warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the object code of the Modified
+Software is redistributed, the Licensee allows effective access to the
+full source code of the Modified Software at a minimum during the entire
+period of its distribution of the Modified Software, it being understood
+that the additional cost of acquiring the source code shall not exceed
+the cost of transferring the data.
+
+
+        5.3.3 DISTRIBUTION OF DERIVATIVE SOFTWARE
+
+When the Licensee creates Derivative Software, this Derivative Software
+may be distributed under a license agreement other than this Agreement,
+subject to compliance with the requirement to include a notice
+concerning the rights over the Software as defined in Article 6.4.
+In the event the creation of the Derivative Software required modification 
+of the Source Code, the Licensee undertakes that:
+
+   1. the resulting Modified Software will be governed by this Agreement,
+   2. the Integrated Contributions in the resulting Modified Software
+      will be clearly identified and documented,
+   3. the Licensee will allow effective access to the source code of the
+      Modified Software, at a minimum during the entire period of
+      distribution of the Derivative Software, such that such
+      modifications may be carried over in a subsequent version of the
+      Software; it being understood that the additional cost of
+      purchasing the source code of the Modified Software shall not
+      exceed the cost of transferring the data.
+
+
+        5.3.4 COMPATIBILITY WITH THE CeCILL LICENSE
+
+When a Modified Software contains an Integrated Contribution subject to
+the CeCILL license agreement, or when a Derivative Software contains a
+Related Module subject to the CeCILL license agreement, the provisions
+set forth in the third item of Article 6.4 are optional.
+
+
+    Article 6 - INTELLECTUAL PROPERTY
+
+
+      6.1 OVER THE INITIAL SOFTWARE
+
+The Holder owns the economic rights over the Initial Software. Any or
+all use of the Initial Software is subject to compliance with the terms
+and conditions under which the Holder has elected to distribute its work
+and no one shall be entitled to modify the terms and conditions for the
+distribution of said Initial Software.
+
+The Holder undertakes that the Initial Software will remain ruled at
+least by this Agreement, for the duration set forth in Article 4.2.
+
+
+      6.2 OVER THE INTEGRATED CONTRIBUTIONS
+
+The Licensee who develops an Integrated Contribution is the owner of the
+intellectual property rights over this Contribution as defined by
+applicable law.
+
+
+      6.3 OVER THE RELATED MODULES
+
+The Licensee who develops a Related Module is the owner of the
+intellectual property rights over this Related Module as defined by
+applicable law and is free to choose the type of agreement that shall
+govern its distribution under the conditions defined in Article 5.3.3.
+
+
+      6.4 NOTICE OF RIGHTS
+
+The Licensee expressly undertakes:
+
+   1. not to remove, or modify, in any manner, the intellectual property
+      notices attached to the Software;
+
+   2. to reproduce said notices, in an identical manner, in the copies
+      of the Software modified or not;
+
+   3. to ensure that use of the Software, its intellectual property
+      notices and the fact that it is governed by the Agreement is
+      indicated in a text that is easily accessible, specifically from
+      the interface of any Derivative Software.
+
+The Licensee undertakes not to directly or indirectly infringe the
+intellectual property rights of the Holder and/or Contributors on the
+Software and to take, where applicable, vis-à-vis its staff, any and all
+measures required to ensure respect of said intellectual property rights
+of the Holder and/or Contributors.
+
+
+    Article 7 - RELATED SERVICES
+
+7.1 Under no circumstances shall the Agreement oblige the Licensor to
+provide technical assistance or maintenance services for the Software.
+
+However, the Licensor is entitled to offer this type of services. The
+terms and conditions of such technical assistance, and/or such
+maintenance, shall be set forth in a separate instrument. Only the
+Licensor offering said maintenance and/or technical assistance services
+shall incur liability therefor.
+
+7.2 Similarly, any Licensor is entitled to offer to its licensees, under
+its sole responsibility, a warranty, that shall only be binding upon
+itself, for the redistribution of the Software and/or the Modified
+Software, under terms and conditions that it is free to decide. Said
+warranty, and the financial terms and conditions of its application,
+shall be subject of a separate instrument executed between the Licensor
+and the Licensee.
+
+
+    Article 8 - LIABILITY
+
+8.1 Subject to the provisions of Article 8.2, the Licensee shall be
+entitled to claim compensation for any direct loss it may have suffered
+from the Software as a result of a fault on the part of the relevant
+Licensor, subject to providing evidence thereof.
+
+8.2 The Licensor's liability is limited to the commitments made under
+this Agreement and shall not be incurred as a result of in particular:
+(i) loss due the Licensee's total or partial failure to fulfill its
+obligations, (ii) direct or consequential loss that is suffered by the
+Licensee due to the use or performance of the Software, and (iii) more
+generally, any consequential loss. In particular the Parties expressly
+agree that any or all pecuniary or business loss (i.e. loss of data,
+loss of profits, operating loss, loss of customers or orders,
+opportunity cost, any disturbance to business activities) or any or all
+legal proceedings instituted against the Licensee by a third party,
+shall constitute consequential loss and shall not provide entitlement to
+any or all compensation from the Licensor.
+
+
+    Article 9 - WARRANTY
+
+9.1 The Licensee acknowledges that the scientific and technical
+state-of-the-art when the Software was distributed did not enable all
+possible uses to be tested and verified, nor for the presence of
+possible defects to be detected. In this respect, the Licensee's
+attention has been drawn to the risks associated with loading, using,
+modifying and/or developing and reproducing the Software which are
+reserved for experienced users.
+
+The Licensee shall be responsible for verifying, by any or all means,
+the suitability of the product for its requirements, its good working
+order, and for ensuring that it shall not cause damage to either persons
+or properties.
+
+9.2 The Licensor hereby represents, in good faith, that it is entitled
+to grant all the rights over the Software (including in particular the
+rights set forth in Article 5).
+
+9.3 The Licensee acknowledges that the Software is supplied "as is" by
+the Licensor without any other express or tacit warranty, other than
+that provided for in Article 9.2 and, in particular, without any warranty
+as to its commercial value, its secured, safe, innovative or relevant
+nature.
+
+Specifically, the Licensor does not warrant that the Software is free
+from any error, that it will operate without interruption, that it will
+be compatible with the Licensee's own equipment and software
+configuration, nor that it will meet the Licensee's requirements.
+
+9.4 The Licensor does not either expressly or tacitly warrant that the
+Software does not infringe any third party intellectual property right
+relating to a patent, software or any other property right. Therefore,
+the Licensor disclaims any and all liability towards the Licensee
+arising out of any or all proceedings for infringement that may be
+instituted in respect of the use, modification and redistribution of the
+Software. Nevertheless, should such proceedings be instituted against
+the Licensee, the Licensor shall provide it with technical and legal
+assistance for its defense. Such technical and legal assistance shall be
+decided on a case-by-case basis between the relevant Licensor and the
+Licensee pursuant to a memorandum of understanding. The Licensor
+disclaims any and all liability as regards the Licensee's use of the
+name of the Software. No warranty is given as regards the existence of
+prior rights over the name of the Software or as regards the existence
+of a trademark.
+
+
+    Article 10 - TERMINATION
+
+10.1 In the event of a breach by the Licensee of its obligations
+hereunder, the Licensor may automatically terminate this Agreement
+thirty (30) days after notice has been sent to the Licensee and has
+remained ineffective.
+
+10.2 A Licensee whose Agreement is terminated shall no longer be
+authorized to use, modify or distribute the Software. However, any
+licenses that it may have granted prior to termination of the Agreement
+shall remain valid subject to their having been granted in compliance
+with the terms and conditions hereof.
+
+
+    Article 11 - MISCELLANEOUS
+
+
+      11.1 EXCUSABLE EVENTS
+
+Neither Party shall be liable for any or all delay, or failure to
+perform the Agreement, that may be attributable to an event of force
+majeure, an act of God or an outside cause, such as defective
+functioning or interruptions of the electricity or telecommunications
+networks, network paralysis following a virus attack, intervention by
+government authorities, natural disasters, water damage, earthquakes,
+fire, explosions, strikes and labor unrest, war, etc.
+
+11.2 Any failure by either Party, on one or more occasions, to invoke
+one or more of the provisions hereof, shall under no circumstances be
+interpreted as being a waiver by the interested Party of its right to
+invoke said provision(s) subsequently.
+
+11.3 The Agreement cancels and replaces any or all previous agreements,
+whether written or oral, between the Parties and having the same
+purpose, and constitutes the entirety of the agreement between said
+Parties concerning said purpose. No supplement or modification to the
+terms and conditions hereof shall be effective as between the Parties
+unless it is made in writing and signed by their duly authorized
+representatives.
+
+11.4 In the event that one or more of the provisions hereof were to
+conflict with a current or future applicable act or legislative text,
+said act or legislative text shall prevail, and the Parties shall make
+the necessary amendments so as to comply with said act or legislative
+text. All other provisions shall remain effective. Similarly, invalidity
+of a provision of the Agreement, for any reason whatsoever, shall not
+cause the Agreement as a whole to be invalid.
+
+
+      11.5 LANGUAGE
+
+The Agreement is drafted in both French and English and both versions
+are deemed authentic.
+
+
+    Article 12 - NEW VERSIONS OF THE AGREEMENT
+
+12.1 Any person is authorized to duplicate and distribute copies of this
+Agreement.
+
+12.2 So as to ensure coherence, the wording of this Agreement is
+protected and may only be modified by the authors of the License, who
+reserve the right to periodically publish updates or new versions of the
+Agreement, each with a separate number. These subsequent versions may
+address new issues encountered by Free Software.
+
+12.3 Any Software distributed under a given version of the Agreement may
+only be subsequently distributed under the same version of the Agreement
+or a subsequent version.
+
+
+    Article 13 - GOVERNING LAW AND JURISDICTION
+
+13.1 The Agreement is governed by French law. The Parties agree to
+endeavor to seek an amicable solution to any disagreements or disputes
+that may arise during the performance of the Agreement.
+
+13.2 Failing an amicable solution within two (2) months as from their
+occurrence, and unless emergency proceedings are necessary, the
+disagreements or disputes shall be referred to the Paris Courts having
+jurisdiction, by the more diligent Party.
+
+
+Version 1.0 dated 2006-09-05.
+
+
+LICENSE
+
+1. By using and/or opening any packaging enclosing this 
+software, expanding any compressed file containing this 
+software or by utilizing this software, you agree to be 
+bound by the terms of this license agreement.
+
+2. THE SOFTWARE IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY 
+KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
+PURPOSE AND NONINFRINGEMENT. No oral or written advice given 
+by Licensor or by an authorized representative of Licensor 
+shall create a warranty.
+
+3. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT SHALL 
+THE LICENSOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+LIABILITY, INCLUDING BUT NOT LIMITED TO PERSONAL INJURY, OR 
+ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES 
+WHATSOEVER, INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS 
+OF PROFITS, LOSS OF DATA, BUSINESS INTERRUPTION OR ANY OTHER 
+COMMERCIAL DAMAGES OR LOSSES, ARISING OUT OF OR RELATED TO 
+YOUR USE OR INABILITY TO USE THE SOFTWARE, HOWEVER CAUSED, 
+REGARDLESS OF THE THEORY OF LIABILITY (CONTRACT, TORT OR 
+OTHERWISE) AND EVEN IF LICENSOR HAS BEEN ADVISED OF THE 
+POSSIBILITY OF SUCH DAMAGES.
+
+4. THIS SOFTWARE IS NOT INTENDED FOR USE IN ANY APPLICATION 
+IN WHICH THE FAILURE OF THE SOFTWARE COULD LEAD TO DEATH, 
+PERSONAL INJURY OR SEVERE PHYSICAL OR ENVIRONMENTAL DAMAGE.
+
+5. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED 
+WARRANTIES, LIABILITY OR LIMITATIONS ON APPLICABLE STATUTORY 
+RIGHTS OF A CONSUMER, SO THE ABOVE EXCLUSIONS AND 
+LIMITATIONS MAY NOT APPLY TO YOU. IF SUCH EXCLUSIONS FROM 
+LIABILITY APPLY TO YOU, DO NOT USE THIS SOFTWARE.
Index: /trunk/lib/FlairCore/CMakeLists.txt
===================================================================
--- /trunk/lib/FlairCore/CMakeLists.txt	(revision 2)
+++ /trunk/lib/FlairCore/CMakeLists.txt	(revision 2)
@@ -0,0 +1,43 @@
+PROJECT(FlairCore)
+cmake_minimum_required(VERSION 2.8)
+include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/GlobalCmakeFlair.cmake)
+
+find_package(LibXml2 REQUIRED)
+
+execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
+                OUTPUT_VARIABLE GCC_VERSION)
+
+if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
+	if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+		ADD_DEFINITIONS("-std=c++11")
+	else()
+		ADD_DEFINITIONS("-std=c++0x")
+	endif()
+else()
+	message(STATUS "GCC version < 4.3, c+11 is not supported!")
+endif()
+
+FILE(GLOB FLAIRCORE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
+
+INCLUDE_DIRECTORIES(
+	${LIBXML2_INCLUDE_DIR}
+	${CMAKE_SYSROOT}/usr/include/opencv
+	${CMAKE_SYSROOT}/usr/include/udt
+	${CMAKE_CURRENT_SOURCE_DIR}/src
+	${CMAKE_CURRENT_SOURCE_DIR}/src/unexported
+)
+
+SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/nrt)
+if(NOT WIN32)
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/rt)
+endif()
+
+add_custom_target(
+	svn_rev
+	COMMAND $ENV{FLAIR_ROOT}/flair-dev/scripts/svn_revision.sh $ENV{FLAIR_ROOT}/flair-src ${CMAKE_CURRENT_SOURCE_DIR}/src/unexported/svnversion.h
+)
+
+add_dependencies(FlairCore_rt svn_rev)
+add_dependencies(FlairCore_nrt svn_rev)
Index: /trunk/lib/FlairCore/nrt/CMakeLists.txt
===================================================================
--- /trunk/lib/FlairCore/nrt/CMakeLists.txt	(revision 2)
+++ /trunk/lib/FlairCore/nrt/CMakeLists.txt	(revision 2)
@@ -0,0 +1,12 @@
+PROJECT(FlairCore_nrt)
+
+ADD_DEFINITIONS(-D_GNU_SOURCE -D_REENTRANT)
+
+ADD_LIBRARY(${PROJECT_NAME}
+	${FLAIRCORE_SRC}
+)
+
+INSTALL(TARGETS ${PROJECT_NAME}
+	LIBRARY DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+	ARCHIVE DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+)
Index: /trunk/lib/FlairCore/rt/CMakeLists.txt
===================================================================
--- /trunk/lib/FlairCore/rt/CMakeLists.txt	(revision 2)
+++ /trunk/lib/FlairCore/rt/CMakeLists.txt	(revision 2)
@@ -0,0 +1,20 @@
+PROJECT(FlairCore_rt)
+
+find_package(Xenomai REQUIRED)
+ADD_DEFINITIONS(${XENOMAI_DEFINITIONS})
+
+INCLUDE_DIRECTORIES(
+	${XENOMAI_INCLUDE_DIR}
+)
+
+ADD_LIBRARY(${PROJECT_NAME}
+	${FLAIRCORE_SRC}
+)
+
+INSTALL(TARGETS ${PROJECT_NAME}
+	LIBRARY DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+	ARCHIVE DESTINATION $ENV{FLAIR_ROOT}/flair-bin/lib/${ARCH_DIR}
+)
+
+FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/../src/*.h")
+INSTALL(FILES ${files} DESTINATION $ENV{FLAIR_ROOT}/flair-dev/include/FlairCore)
Index: /trunk/lib/FlairCore/src/AhrsData.cpp
===================================================================
--- /trunk/lib/FlairCore/src/AhrsData.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/AhrsData.cpp	(revision 2)
@@ -0,0 +1,252 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/03/01
+//  filename:   AhrsData.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class defining ahrs datas
+//
+//
+/*********************************************************************/
+
+#include "AhrsData.h"
+#include "Euler.h"
+#include <math.h>
+#include <string.h>
+#include <stdlib.h>
+
+using std::string;
+
+namespace flair { namespace core {
+
+/*! \class AhrsDataElement
+    */
+    class AhrsDataElement: public IODataElement {
+        public:
+
+            AhrsDataElement(const AhrsData *inAhrsData,string name,AhrsData::PlotableData_t inPlotableData):
+                            IODataElement(inAhrsData,name),
+                            ahrsData(inAhrsData),
+                            plotableData(inPlotableData) {
+
+                size=sizeof(float);
+            }
+
+            ~AhrsDataElement() {}
+
+            void CopyData(char* destination) const {
+                float data;
+                Vector3D angularRates;
+                Euler eulerAngles;
+                Quaternion quaternion;
+                ahrsData->GetQuaternionAndAngularRates(quaternion,angularRates);
+                quaternion.ToEuler(eulerAngles);
+                switch(plotableData) {
+                case AhrsData::Roll:
+                    data=eulerAngles.roll;
+                    break;
+                case AhrsData::Pitch:
+                    data=eulerAngles.pitch;
+                    break;
+                case AhrsData::Yaw:
+                    data=eulerAngles.yaw;
+                    break;
+                case AhrsData::RollDeg:
+                    data=Euler::ToDegree(eulerAngles.roll);
+                    break;
+                case AhrsData::PitchDeg:
+                    data=Euler::ToDegree(eulerAngles.pitch);
+                    break;
+                case AhrsData::YawDeg:
+                    data=Euler::ToDegree(eulerAngles.yaw);
+                    break;
+                case AhrsData::Q0:
+                    data=quaternion.q0;
+                    break;
+                case AhrsData::Q1:
+                    data=quaternion.q1;
+                    break;
+                case AhrsData::Q2:
+                    data=quaternion.q2;
+                    break;
+                case AhrsData::Q3:
+                    data=quaternion.q3;
+                    break;
+                case AhrsData::Wx:
+                    data=angularRates.x;
+                    break;
+                case AhrsData::Wy:
+                    data=angularRates.y;
+                    break;
+                case AhrsData::Wz:
+                    data=angularRates.z;
+                    break;
+                case AhrsData::WxDeg:
+                    data=Euler::ToDegree(angularRates.x);
+                    break;
+                case AhrsData::WyDeg:
+                    data=Euler::ToDegree(angularRates.y);
+                    break;
+                case AhrsData::WzDeg:
+                    data=Euler::ToDegree(angularRates.z);
+                    break;
+                default:
+                    ahrsData->Err("data type unavailable.\n");
+                    data=0;
+                    break;
+                }
+                memcpy(destination,&data,sizeof(float));
+            }
+
+            const FloatType &GetDataType(void) const {
+                return dataType;
+            }
+
+        private:
+            const AhrsData *ahrsData;
+            AhrsData::PlotableData_t plotableData;
+            FloatType dataType;
+
+    };
+
+AhrsData::AhrsData(const Object *parent,std::string name,int n): io_data(parent,name,n), dataType(floatType) {
+    if(n>1) Warn("n>1 not supported\n");
+
+    AppendLogDescription("q0",floatType);
+    AppendLogDescription("q1",floatType);
+    AppendLogDescription("q2",floatType);
+    AppendLogDescription("q3",floatType);
+
+    AppendLogDescription("wx",floatType);
+    AppendLogDescription("wy",floatType);
+    AppendLogDescription("wz",floatType);
+}
+
+AhrsData::~AhrsData() {}
+
+Quaternion AhrsData::GetQuaternion(void) const {
+    Quaternion out;
+    GetMutex();
+    out=quaternion;
+    ReleaseMutex();
+    return out;
+}
+
+Vector3D AhrsData::GetAngularRates(void) const {
+    Vector3D out;
+    GetMutex();
+    out=angularRates;
+    ReleaseMutex();
+    return out;
+}
+
+void AhrsData::GetQuaternionAndAngularRates(Quaternion &outQuaternion,Vector3D &outAngularRates) const {
+    GetMutex();
+    outQuaternion=quaternion;
+    outAngularRates=angularRates;
+    ReleaseMutex();
+}
+
+void AhrsData::SetQuaternionAndAngularRates(const Quaternion &inQuaternion,const Vector3D &inAngularRates) {
+    GetMutex();
+    quaternion=inQuaternion;
+    angularRates=inAngularRates;
+    ReleaseMutex();
+}
+
+void AhrsData::SetQuaternion(const Quaternion &inQuaternion) {
+    GetMutex();
+    quaternion=inQuaternion;
+    ReleaseMutex();
+}
+
+void AhrsData::SetAngularRates(const Vector3D &inAngularRates) {
+    GetMutex();
+    angularRates=inAngularRates;
+    ReleaseMutex();
+}
+
+IODataElement* AhrsData::Element(PlotableData_t plotableData) const {
+    string name;
+    switch(plotableData) {
+    case AhrsData::Roll:
+        name="Roll";
+        break;
+    case AhrsData::Pitch:
+        name="Pitch";
+        break;
+    case AhrsData::Yaw:
+        name="Yaw";
+        break;
+     case AhrsData::RollDeg:
+        name="Roll degree";
+        break;
+    case AhrsData::PitchDeg:
+        name="Pitch degree";
+        break;
+    case AhrsData::YawDeg:
+        name="Yaw degree";
+        break;
+    case AhrsData::Q0:
+        name="Q0";
+        break;
+    case AhrsData::Q1:
+        name="Q1";
+        break;
+    case AhrsData::Q2:
+        name="Q2";
+        break;
+    case AhrsData::Q3:
+        name="Q3";
+        break;
+    case AhrsData::Wx:
+        name="Wx";
+        break;
+    case AhrsData::Wy:
+        name="Wy";
+        break;
+    case AhrsData::Wz:
+        name="Wz";
+        break;
+    case AhrsData::WxDeg:
+        name="Wx degree";
+        break;
+    case AhrsData::WyDeg:
+        name="Wy degree";
+        break;
+    case AhrsData::WzDeg:
+        name="Wz degree";
+        break;
+    default:
+        Err("data type unavailable.\n");
+    }
+
+    return new AhrsDataElement(this,name,plotableData);
+}
+
+void AhrsData::CopyDatas(char *dst) const {
+    GetMutex();
+    Queue(&dst,&quaternion.q0,sizeof(quaternion.q0));
+    Queue(&dst,&quaternion.q1,sizeof(quaternion.q1));
+    Queue(&dst,&quaternion.q2,sizeof(quaternion.q2));
+    Queue(&dst,&quaternion.q3,sizeof(quaternion.q3));
+
+    Queue(&dst,&angularRates.x,sizeof(angularRates.x));
+    Queue(&dst,&angularRates.y,sizeof(angularRates.y));
+    Queue(&dst,&angularRates.z,sizeof(angularRates.z));
+    ReleaseMutex();
+}
+
+void AhrsData::Queue(char **dst,const void *src,size_t size) const {
+    memcpy(*dst,src,size);
+    *dst+=size;
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/AhrsData.h
===================================================================
--- /trunk/lib/FlairCore/src/AhrsData.h	(revision 2)
+++ /trunk/lib/FlairCore/src/AhrsData.h	(revision 2)
@@ -0,0 +1,178 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file AhrsData.h
+ * \brief Class defining AHRS datas
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/03/01
+ * \version 4.0
+ */
+#ifndef AHRSDATA_H
+#define AHRSDATA_H
+
+#include <io_data.h>
+#include <IODataElement.h>
+#include <Vector3D.h>
+#include <Quaternion.h>
+
+namespace flair { namespace core {
+
+    /*! \class AhrsData
+    *
+    * \brief Class defining AHRS datas
+    *
+    * AHRS datas consist of quaternion and rotational angles values. \n
+    *
+    */
+    class AhrsData: public io_data {
+        public:
+            class Type: public DataType {
+            public:
+                Type(const ScalarType &inElementDataType):
+                    elementDataType(inElementDataType) {}
+                const ScalarType  &GetElementDataType() const {return elementDataType;}
+                std::string GetDescription() const {return "ahrs data";}
+                size_t GetSize() const {
+                    return 7*elementDataType.GetSize();
+                }
+            private:
+                const ScalarType &elementDataType;
+            };
+
+            /*!
+            \enum PlotableData_t
+            \brief Datas wich can be plotted in a DataPlot1D
+            */
+            typedef enum {
+                Roll/*! roll */, Pitch/*! pitch */, Yaw/*! yaw */,
+                RollDeg/*! roll degree*/, PitchDeg/*! pitch degree */, YawDeg/*! yaw degree */,
+                Q0/*! quaternion 0 */, Q1/*! quaternion 1 */, Q2/*! quaternion 2 */, Q3/*! quaternion 3 */,
+                Wx/*! x filtered angular rate */, Wy/*! y filtered angular rate */, Wz/*! z filtered angular rate */,
+                WxDeg/*! x filtered angular rate degree*/, WyDeg/*! y filtered angular rate degree*/, WzDeg/*! z filtered angular rate degree*/,
+                } PlotableData_t;
+
+            /*!
+            * \brief Constructor
+            *
+            * Construct an io_data representing AHRS datas. \n
+            *
+            * \param parent parent
+            * \param name name
+            * \param n number of samples
+            */
+            AhrsData(const Object* parent,std::string name="",int n=1);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~AhrsData();
+
+            /*!
+            * \brief Element
+            *
+            * Get a pointer to a specific element. This pointer can be used for plotting.
+            *
+            * \param plotableData data type
+            *
+            * \return pointer to the element
+            */
+            IODataElement *Element(PlotableData_t plotableData) const;
+
+            /*!
+            * \brief Set quaternion
+            *
+            * This method is mutex protected.
+            *
+            * \param quaternion quaternion
+            *
+            */
+            void SetQuaternion(const Quaternion &quaternion);
+
+            /*!
+            * \brief Get quaternion
+            *
+            * This method is mutex protected.
+            *
+            * \return quaternion
+            *
+            */
+            Quaternion GetQuaternion(void) const;
+
+            /*!
+            * \brief Set angular rates
+            *
+            * This method is mutex protected.
+            *
+            * \param angularRates angular rates
+            *
+            */
+            void SetAngularRates(const Vector3D &angularRates);
+
+            /*!
+            * \brief Get angular rates
+            *
+            * This method is mutex protected.
+            *
+            * \return angular rates
+            *
+            */
+            Vector3D GetAngularRates(void) const;
+
+            /*!
+            * \brief Get both quaternion and angular rates
+            *
+            * This method is mutex protected.
+            *
+            * \param quaternion quaternion
+            * \param angularRates angular rates
+            *
+            */
+            void GetQuaternionAndAngularRates(Quaternion &quaternion,Vector3D &angularRates) const;
+
+            /*!
+            * \brief Set both quaternion and angular rates
+            *
+            * This method is mutex protected.
+            *
+            * \param quaternion quaternion
+            * \param angularRates angular rates
+            *
+            */
+            void SetQuaternionAndAngularRates(const Quaternion &quaternion,const Vector3D &angularRates);
+
+            const Type &GetDataType() const {return dataType;}
+        private:
+            /*!
+            * \brief Copy datas
+            *
+            * Reimplemented from io_data. \n
+            * See io_data::CopyDatas.
+            *
+            * \param dst destination buffer
+            */
+            void CopyDatas(char *dst) const;
+
+            void Queue(char **dst,const void *src,size_t size) const;
+
+            /*!
+            * \brief %Quaternion
+            *
+            */
+            Quaternion quaternion;
+
+            /*!
+            * \brief Angular rates
+            *
+            */
+            Vector3D angularRates;
+
+            Type dataType;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // AHRSDATA_H
Index: /trunk/lib/FlairCore/src/Box.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Box.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Box.cpp	(revision 2)
@@ -0,0 +1,76 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/28
+//  filename:   Box.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class to display a box on the ground station
+//
+//
+/*********************************************************************/
+#include "Box.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+Box::Box(const LayoutPosition* position,string name,string type): Widget(position->getLayout(),name,type)
+{
+    value_changed=true;
+    SetVolatileXmlProp("row",position->Row());
+    SetVolatileXmlProp("col",position->Col());
+    delete position;
+}
+
+Box::~Box()
+{
+core::Object::ObjectName();
+}
+
+bool Box::ValueChanged(void)
+{
+    bool ret;
+
+    GetMutex();
+    if(value_changed==true)
+    {
+       value_changed=false;
+       ret=true;
+    }
+    else
+    {
+        ret=false;
+    }
+    ReleaseMutex();
+
+    return ret;
+}
+
+void Box::SetValueChanged(void)
+{
+    value_changed=true;
+}
+
+void Box::GetMutex(void) const
+{
+    ((Layout*)Parent())->mutex->GetMutex();
+}
+
+void Box::ReleaseMutex(void) const
+{
+    ((Layout*)Parent())->mutex->ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Box.h
===================================================================
--- /trunk/lib/FlairCore/src/Box.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Box.h	(revision 2)
@@ -0,0 +1,109 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Box.h
+ * \brief Abstract class to display a box on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/28
+ * \version 4.0
+ */
+
+#ifndef BOX_H
+#define BOX_H
+
+#include <Widget.h>
+
+namespace flair
+{
+namespace gui
+{
+
+    class Layout;
+    class LayoutPosition;
+
+    /*! \class Box
+    *
+    * \brief Abstract class to display a box on the ground station
+    *
+    * This is an abstract class to display boxes (like CheckBox, SpinBox, etc). \n
+    * To access reimplemented box's value, use Box::GetMutex and Box::ReleaseMutex. \n
+    * Note that this mutex is in reality the one from the parent Layout. To minimize memory
+    * footprint, each Box does not have its own Mutex.
+    */
+    class Box: public Widget
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a Box. \n
+            * Type must agree with predifined (hard coded) types
+            * in ground station code. \n
+            * The Box will automatically be child of position->getLayout() Layout. After calling this method,
+            * position will be deleted as it is no longer usefull.
+            *
+            * \param position position
+            * \param name name
+            * \param type type
+            */
+            Box(const LayoutPosition* position,std::string name,std::string type);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Box();
+
+            /*!
+            * \brief Has the value changed since last call?
+            *
+            * This method returns the value of an internal flag
+            * which is set through SetValueChanged(). \n
+            * After calling this method, the internal flag is
+            * set to false.
+            *
+            * \return true is valued has changed since last call
+            */
+            bool ValueChanged(void);
+
+        protected:
+            /*!
+            * \brief Set the value changed flag
+            *
+            * The reimplemented class must call this method when Box's value is changed. \n
+            * This method must be called with Mutex locked. Indeed, as reimplemented class
+            * also has to lock the Mutex to change the Box value, this mecanism avoid two successives
+            * lock and unlock.
+            *
+            */
+            void SetValueChanged(void);
+
+            /*!
+            * \brief Get Mutex
+            *
+            * This method must be called before changing Box's value or
+            * calling SetValueChanged().
+            *
+            */
+            void GetMutex(void) const;
+
+            /*!
+            * \brief Release Mutex
+            *
+             * This method must be called after changing Box's value or
+            *  calling SetValueChanged().
+            *
+            */
+            void ReleaseMutex(void) const;
+
+
+        private:
+            bool value_changed;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // BOX_H
Index: /trunk/lib/FlairCore/src/CheckBox.cpp
===================================================================
--- /trunk/lib/FlairCore/src/CheckBox.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/CheckBox.cpp	(revision 2)
@@ -0,0 +1,68 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   CheckBox.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QCheckBox on the ground station
+//
+//
+/*********************************************************************/
+#include "CheckBox.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+CheckBox::CheckBox(const LayoutPosition* position,string name,bool default_value):Box(position,name,"CheckBox")
+{
+    //update value from xml file
+    box_value=default_value;
+
+    GetPersistentXmlProp("value",box_value);
+    SetPersistentXmlProp("value",Value());
+    SendXml();
+}
+
+CheckBox::~CheckBox()
+{
+
+}
+
+bool CheckBox::IsChecked(void) const
+{
+    bool tmp;
+
+    GetMutex();
+    tmp=box_value;
+    ReleaseMutex();
+
+    return tmp;
+}
+
+int CheckBox::Value(void) const
+{
+    if(IsChecked()==true)
+        return 1;
+    else
+        return 0;
+}
+
+void CheckBox::XmlEvent(void)
+{
+    GetMutex();
+    if(GetPersistentXmlProp("value",box_value)) SetValueChanged();
+    ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/CheckBox.h
===================================================================
--- /trunk/lib/FlairCore/src/CheckBox.h	(revision 2)
+++ /trunk/lib/FlairCore/src/CheckBox.h	(revision 2)
@@ -0,0 +1,79 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file CheckBox.h
+ * \brief Class displaying a QCheckBox on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef CHECKBOX_H
+#define CHECKBOX_H
+
+#include <Box.h>
+
+namespace flair
+{
+namespace gui
+{
+
+    class LayoutPosition;
+
+    /*! \class CheckBox
+    *
+    * \brief Class displaying a QCheckBox on the ground station
+    *
+    */
+    class CheckBox: public Box
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a QCheckBox at given position.
+            *
+            * \param position position to display the QCheckBox
+            * \param name name
+            * \param default_value default value if not in the xml config file
+            */
+            CheckBox(const LayoutPosition* position,std::string name,bool default_value=true);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~CheckBox();
+
+            /*!
+            * \brief Is checked?
+            *
+            * \return true if checked
+            */
+            bool IsChecked(void) const;
+
+            /*!
+            * \brief Value
+            *
+            * \return 1 if checked, 0 otherwise
+            */
+            int Value(void) const;
+
+        private:
+            /*!
+            * \brief XmlEvent from ground station
+            *
+            * Reimplemented from Widget.
+            *
+            */
+            void XmlEvent(void);
+
+            bool box_value;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // CHECKBOX_H
Index: /trunk/lib/FlairCore/src/ComboBox.cpp
===================================================================
--- /trunk/lib/FlairCore/src/ComboBox.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/ComboBox.cpp	(revision 2)
@@ -0,0 +1,66 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   ComboBox.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QComboBox on the ground station
+//
+//
+/*********************************************************************/
+#include "ComboBox.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+ComboBox::ComboBox(const LayoutPosition* position,string name):Box(position,name,"ComboBox")
+{
+    //update value from xml file
+    box_value=0;
+    GetPersistentXmlProp("value",box_value);
+    SetPersistentXmlProp("value",box_value);
+
+    SendXml();
+}
+
+ComboBox::~ComboBox()
+{
+
+}
+
+void ComboBox::AddItem(string name)
+{
+    SetVolatileXmlProp("item",name);
+    SendXml();
+}
+
+int ComboBox::CurrentIndex(void) const
+{
+    int tmp;
+
+    GetMutex();
+    tmp=box_value;
+    ReleaseMutex();
+
+    return tmp;
+}
+
+void ComboBox::XmlEvent(void)
+{
+    GetMutex();
+    if(GetPersistentXmlProp("value",box_value)) SetValueChanged();
+    ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/ComboBox.h
===================================================================
--- /trunk/lib/FlairCore/src/ComboBox.h	(revision 2)
+++ /trunk/lib/FlairCore/src/ComboBox.h	(revision 2)
@@ -0,0 +1,82 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ComboBox.h
+ * \brief Class displaying a QComboBox on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef COMBOBOX_H
+#define COMBOBOX_H
+
+#include <Box.h>
+
+namespace flair
+{
+namespace gui
+{
+
+    class LayoutPosition;
+
+    /*! \class ComboBox
+    *
+    * \brief Class displaying a QComboBox on the ground station
+    *
+    */
+    class ComboBox: public Box
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a QComboBox at given position.
+            *
+            * \param position position to display the QComboBox
+            * \param name name
+            */
+            ComboBox(const LayoutPosition* position,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~ComboBox();
+
+             /*!
+            * \brief Add an item
+            *
+            * Add an item to the end of the list.
+            *
+            * \param name item nam
+            */
+            void AddItem(std::string name);
+
+            /*!
+            * \brief Currend index
+            *
+            * Index of the currently selected item. Items are numbered starting to 0.
+            *
+            * \return index number
+            */
+            int CurrentIndex(void) const;
+
+        private:
+            /*!
+            * \brief XmlEvent from ground station
+            *
+            * Reimplemented from Widget.
+            *
+            */
+            void XmlEvent(void);
+
+            int box_value;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // COMBOBOX_H
Index: /trunk/lib/FlairCore/src/ConditionVariable.cpp
===================================================================
--- /trunk/lib/FlairCore/src/ConditionVariable.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/ConditionVariable.cpp	(revision 2)
@@ -0,0 +1,46 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   ConditionVariable.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a condition variable
+//
+//
+/*********************************************************************/
+
+#include "ConditionVariable.h"
+#include "ConditionVariable_impl.h"
+
+using std::string;
+
+namespace flair { namespace core {
+
+ConditionVariable::ConditionVariable(const Object* parent,string name): Mutex(parent,name) {
+     pimpl_=new ConditionVariable_impl(this);
+}
+
+ConditionVariable::~ConditionVariable() {
+    delete pimpl_;
+}
+
+void ConditionVariable::CondWait(void) {
+    pimpl_->CondWait();
+}
+
+bool ConditionVariable::CondWaitUntil(Time date) {
+    return pimpl_->CondWaitUntil(date);
+}
+
+void ConditionVariable::CondSignal(void) {
+    pimpl_->CondSignal();
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/ConditionVariable.h
===================================================================
--- /trunk/lib/FlairCore/src/ConditionVariable.h	(revision 2)
+++ /trunk/lib/FlairCore/src/ConditionVariable.h	(revision 2)
@@ -0,0 +1,89 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ConditionVariable.h
+ * \brief Class defining a condition variable
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 4.0
+ */
+
+#ifndef CONDITIONVARIABLE_H
+#define CONDITIONVARIABLE_H
+
+#include <Mutex.h>
+
+class ConditionVariable_impl;
+
+namespace flair
+{
+namespace core
+{
+
+    /*! \class ConditionVariable
+    *
+    * \brief Class defining a condition variable
+    *
+    */
+
+    class ConditionVariable: public Mutex
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a condition variable with its associated mutex.
+            *
+            * \param parent parent
+            * \param name name
+            */
+            ConditionVariable(const Object* parent,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~ConditionVariable();
+
+            /*!
+            * \brief Block on the condition variable
+            *
+            * This method must be called with mutex locked (see Mutex::GetMutex) by the calling thread or undefined behaviour will result. \n
+            * It atomically releases mutex and causes the calling thread to block on the condition variable. \n
+            * Only one thread can be blocked at the same time. \n
+            * Upon successful return, the mutex has been locked and is owned by the calling thread which should unlock it (see Mutex::ReleaseMutex).
+            */
+            void CondWait(void);
+
+            /*!
+            * \brief Block on the condition variable with a timeout
+            *
+            * This method must be called with mutex locked (see Mutex::GetMutex) by the calling thread or undefined behaviour will result. \n
+            * It atomically releases mutex and causes the calling thread to block on the condition variable. \n
+            * Only one thread can be blocked at the same time. \n
+            * Upon successful return, the mutex has been locked and is owned by the calling thread which should unlock it (see Mutex::ReleaseMutex).
+            *
+            * \param date absolute date
+            * \return true if the condition variable is signaled before the date specified in parameter elapses, false otherwise
+            */
+            bool CondWaitUntil(Time date);
+
+            /*!
+            * \brief Unblock threads blocked on the condition variable
+            *
+            * This method should be called with mutex locked (see Mutex::GetMutex) by the calling thread. \n
+            * In this case, upon return, the calling thread should unlock the mutex (see Mutex::ReleaseMutex).
+            *
+            */
+            void CondSignal(void);
+
+        private:
+            class ConditionVariable_impl* pimpl_;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // CONDITIONVARIABLE_H
Index: /trunk/lib/FlairCore/src/ConditionVariable_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/ConditionVariable_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/ConditionVariable_impl.cpp	(revision 2)
@@ -0,0 +1,82 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/07
+//  filename:   ConditionVariable_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a condition variable
+//
+//
+/*********************************************************************/
+
+#include "ConditionVariable_impl.h"
+#include "ConditionVariable.h"
+#include "Mutex_impl.h"
+#include <string.h>
+
+using std::string;
+using namespace flair::core;
+
+ConditionVariable_impl::ConditionVariable_impl(ConditionVariable* self) {
+    this->self=self;
+    int status;
+
+#ifdef __XENO__
+    status=rt_cond_create(&m_ResumeCond,NULL);
+#else
+    status=pthread_cond_init(&m_ResumeCond, 0);
+#endif
+    if(status!=0) self->Err("error creating condition variable (%s)\n",strerror(-status));
+}
+
+ConditionVariable_impl::~ConditionVariable_impl() {
+    int status;
+
+#ifdef __XENO__
+    status=rt_cond_delete(&m_ResumeCond);
+#else
+    status=pthread_cond_destroy(&m_ResumeCond);
+#endif
+    if(status!=0) self->Err("error destroying condition variable (%s)\n",strerror(-status));
+}
+
+void ConditionVariable_impl::CondWait(void) {
+    int status;
+#ifdef __XENO__
+    status=rt_cond_wait(&m_ResumeCond, &self->Mutex::pimpl_->mutex,TM_INFINITE);
+#else
+    status=pthread_cond_wait(&m_ResumeCond, &self->Mutex::pimpl_->mutex);
+#endif
+    if(status!=0) self->Err("error (%s)\n",strerror(-status));
+}
+
+bool ConditionVariable_impl::CondWaitUntil(Time date) {
+    int status;
+#ifdef __XENO__
+    status=rt_cond_wait_until(&m_ResumeCond, &self->Mutex::pimpl_->mutex,date);
+#else
+    struct timespec restrict;
+    restrict.tv_sec=date/1000000000;
+    restrict.tv_nsec=date%1000000000;
+    status=pthread_cond_timedwait(&m_ResumeCond, &self->Mutex::pimpl_->mutex,&restrict);
+#endif
+    if (status==0) return true;
+    if(status!=ETIMEDOUT) self->Err("error (%s)\n",strerror(-status));
+    return false;
+}
+
+void ConditionVariable_impl::CondSignal(void) {
+     int status;
+#ifdef __XENO__
+    status=rt_cond_signal(&m_ResumeCond);
+#else
+    status=pthread_cond_signal(&m_ResumeCond);
+#endif
+    if(status!=0) self->Err("error (%s)\n",strerror(-status));
+}
Index: /trunk/lib/FlairCore/src/ConnectedSocket.cpp
===================================================================
--- /trunk/lib/FlairCore/src/ConnectedSocket.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/ConnectedSocket.cpp	(revision 2)
@@ -0,0 +1,110 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/04/21
+//  filename:   ConnectedSocket.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a connected socket
+//
+//
+/*********************************************************************/
+#include "ConnectedSocket.h"
+#include <string.h>
+#include <stdexcept>
+
+using std::string;
+
+namespace flair
+{
+namespace core
+{
+
+ConnectedSocket::ConnectedSocket(const Object* parent,const std::string name):Object(parent,name) {};
+
+ConnectedSocket::~ConnectedSocket() {};
+
+uint16_t ConnectedSocket::ReadUInt16(Time const& timeout) {
+    char buffer[sizeof(uint16_t)];
+    size_t alreadyReceived=0;
+    Time remainingTimeout=timeout; //ms
+    do {
+        Time beforeTime=GetTime(); //ns
+        ssize_t received=RecvMessage(buffer+alreadyReceived,sizeof(uint16_t)-alreadyReceived,remainingTimeout);
+        remainingTimeout-=(GetTime()-beforeTime)/100000;
+        if ((received<0) || (remainingTimeout<0)) throw std::runtime_error("Timeout");
+        alreadyReceived+=received;
+    } while (alreadyReceived!=sizeof(uint16_t));
+    uint16_t *dataInNetworkEndianness=(uint16_t*)buffer;
+    uint16_t myinteger=NetworkToHost16(*dataInNetworkEndianness);
+    return myinteger;
+}
+
+void ConnectedSocket::WriteUInt16(uint16_t const& data,Time const& timeout) {
+    uint16_t dataInNetworkEndianness=HostToNetwork16(data);
+    char *buffer=(char *)&dataInNetworkEndianness;
+    size_t alreadySent=0;
+    Time remainingTimeout=timeout; //ms
+    do {
+        Time beforeTime=GetTime(); //ns
+        ssize_t sent=SendMessage(buffer+alreadySent,sizeof(uint16_t)-alreadySent,remainingTimeout);
+        remainingTimeout-=(GetTime()-beforeTime)/100000;
+        if ((sent<0) || (remainingTimeout<0)) throw std::runtime_error("Timeout");
+        alreadySent+=sent;
+    } while (alreadySent!=sizeof(uint16_t));
+}
+
+uint32_t ConnectedSocket::ReadUInt32(Time const& timeout) {
+    char buffer[sizeof(uint32_t)];
+    size_t alreadyReceived=0;
+    Time remainingTimeout=timeout; //ms
+    do {
+        Time beforeTime=GetTime(); //ns
+        ssize_t received=RecvMessage(buffer+alreadyReceived,sizeof(uint32_t)-alreadyReceived,remainingTimeout);
+        remainingTimeout-=(GetTime()-beforeTime)/100000;
+        if ((received<0) || (remainingTimeout<0)) throw std::runtime_error("Timeout");
+        alreadyReceived+=received;
+    } while (alreadyReceived!=sizeof(uint32_t));
+    uint32_t *dataInNetworkEndianness=(uint32_t*)buffer;
+    uint32_t myinteger=NetworkToHost32(*dataInNetworkEndianness);
+    return myinteger;
+}
+
+void ConnectedSocket::WriteUInt32(uint32_t const& data,Time const& timeout) {
+    uint32_t dataInNetworkEndianness=HostToNetwork32(data);
+    char *buffer=(char *)&dataInNetworkEndianness;
+    size_t alreadySent=0;
+    Time remainingTimeout=timeout; //ms
+    do {
+        Time beforeTime=GetTime(); //ns
+        ssize_t sent=SendMessage(buffer+alreadySent,sizeof(uint32_t)-alreadySent,remainingTimeout);
+        remainingTimeout-=(GetTime()-beforeTime)/100000;
+        if ((sent<0) || (remainingTimeout<0)) throw std::runtime_error("Timeout");
+        alreadySent+=sent;
+    } while (alreadySent!=sizeof(uint32_t));
+}
+
+string ConnectedSocket::ReadString(const size_t &stringSize, Time timeout) {
+    char buffer[stringSize+1];
+    size_t alreadyReceived=0;
+    Time remainingTimeout=timeout; //ms
+    do {
+        Time beforeTime=GetTime(); //ns
+        ssize_t received=RecvMessage(buffer+alreadyReceived,stringSize-alreadyReceived,remainingTimeout);
+        remainingTimeout-=(GetTime()-beforeTime)/100000;
+        if ((received<0) || (remainingTimeout<0)) throw std::runtime_error("Timeout");
+        alreadyReceived+=received;
+    } while (alreadyReceived!=stringSize);
+    buffer[stringSize]='\0';
+
+    string mystring=buffer;
+    return mystring;
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/ConnectedSocket.h
===================================================================
--- /trunk/lib/FlairCore/src/ConnectedSocket.h	(revision 2)
+++ /trunk/lib/FlairCore/src/ConnectedSocket.h	(revision 2)
@@ -0,0 +1,108 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ConnectedSocket.h
+ * \brief Class defining a socket working in connected mode
+ * \author Gildas Bayard, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2015/04/21
+ * \version 4.0
+ */
+
+#ifndef CONNECTEDSOCKET_H
+#define CONNECTEDSOCKET_H
+
+#include <Object.h>
+
+namespace flair
+{
+namespace core
+{
+
+    /*! \class ConnectedSocket
+    *
+    * \brief Interface class encapsulating a connected socket. Preserves packets order and guaranty delivery.
+    *
+    */
+    class ConnectedSocket: public Object {
+    public:
+        /*!
+        * \brief Constructor
+        *
+        */
+        ConnectedSocket(const Object* parent,const std::string name);
+
+        /*!
+        * \brief Destructor
+        *
+        */
+        ~ConnectedSocket();
+
+        /*!
+        * \brief Returns a socket which listens on a specific port/address
+        *
+        * \param const Object* parentObject
+        * \param const string name
+        * \param unsigned int port
+        * \param const localAddress (defaults to any)
+        */
+        virtual void Listen(const unsigned int port,const std::string localAddress="ANY")=0;
+
+        /*!
+        * \brief Returns a socket on a new incoming connexion
+        *
+        * \param ConnectedSocket &listeningSocket
+        */
+        virtual ConnectedSocket *Accept(Time timeout)=0; //should throw an exception if not a listening socket
+
+        /*!
+        * \brief Returns a socket connected to a distant host
+        *
+        * \param const Object* parentObject
+        * \param const string name
+        * \param unsigned int port
+        * \param const distantAddress
+        * \param timeout timeout (in milliseconds)
+        */
+        virtual bool Connect(const unsigned int port,const std::string distantAddress,Time timeout)=0;
+
+        /*!
+        * \brief Send a message
+        *
+        * \param message message
+        * \param message_len message length
+        * \param timeout timeout (in milliseconds)
+        */
+        virtual ssize_t SendMessage(const char* message,size_t message_len,Time timeout)=0;
+
+        /*!
+        * \brief Receive a message
+        *
+        * Receive a message and wait up to timeout. \n
+        *
+        * \param buf buffer to put the message
+        * \param buf_len buffer length
+        * \param timeout timeout (in milliseconds)
+        *
+        * \return size of the received message
+        */
+        virtual ssize_t RecvMessage(char* buf,size_t buf_len,Time timeout)=0;
+
+        std::string ReadString(const size_t &stringLength, Time timeout);
+        uint16_t ReadUInt16(Time const& timeout);
+        void WriteUInt16(uint16_t const& data,Time const& timeout);
+        uint32_t ReadUInt32(Time const& timeout);
+        void WriteUInt32(uint32_t const& data,Time const& timeout);
+
+        //!! See Socket.h for a more generic implementation of network/host endianness conversion
+        virtual uint16_t NetworkToHost16(uint16_t data)=0;
+        virtual uint16_t HostToNetwork16(uint16_t data)=0;
+        virtual uint32_t NetworkToHost32(uint32_t data)=0;
+        virtual uint32_t HostToNetwork32(uint32_t data)=0;
+};
+
+} // end namespace core
+} // end namespace flair
+
+#endif // CONNECTEDSOCKET_H
Index: /trunk/lib/FlairCore/src/DataPlot.cpp
===================================================================
--- /trunk/lib/FlairCore/src/DataPlot.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/DataPlot.cpp	(revision 2)
@@ -0,0 +1,97 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/10
+//  filename:   DataPlot.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class to display plots on ground station
+//
+//
+/*********************************************************************/
+
+#include "DataPlot.h"
+#include "DataPlot_impl.h"
+#include "LayoutPosition.h"
+#include "FrameworkManager.h"
+#include "IODataElement.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+using namespace core;
+
+void RGBFromColor(DataPlot::Color_t color,uint8_t &r,uint8_t &g,uint8_t &b)
+{
+    switch(color)
+    {
+        case DataPlot::Red:
+            r=255;
+            g=0;
+            b=0;
+            break;
+        case DataPlot::Blue:
+            r=0;
+            g=0;
+            b=255;
+            break;
+        case DataPlot::Green:
+            r=0;
+            g=255;
+            b=0;
+            break;
+        case DataPlot::Yellow:
+            r=255;
+            g=255;
+            b=0;
+            break;
+        case DataPlot::Black:
+            r=0;
+            g=0;
+            b=0;
+            break;
+        case DataPlot::White:
+            r=255;
+            g=255;
+            b=255;
+            break;
+    }
+}
+
+DataPlot::DataPlot(const LayoutPosition* position,string name,string type):SendData(position,name,type)
+{
+    pimpl_=new DataPlot_impl();
+}
+
+DataPlot::~DataPlot()
+{
+    delete pimpl_;
+}
+
+void DataPlot::AddDataToSend(const IODataElement *element)
+{
+    pimpl_->tosend.push_back(element);
+
+    SetSendSize(SendSize()+element->Size());
+}
+
+void DataPlot::CopyDatas(char* buf) const {
+    int buf_size=0;
+
+    for(size_t i=0;i<pimpl_->tosend.size();i++) {
+        pimpl_->tosend[i]->CopyData(buf+buf_size);
+        buf_size+=pimpl_->tosend[i]->Size();
+    }
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/DataPlot.h
===================================================================
--- /trunk/lib/FlairCore/src/DataPlot.h	(revision 2)
+++ /trunk/lib/FlairCore/src/DataPlot.h	(revision 2)
@@ -0,0 +1,118 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file DataPlot.h
+ * \brief Abstract class to display plots on ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/10
+ * \version 4.0
+ */
+
+#ifndef DATAPLOT_H
+#define DATAPLOT_H
+
+#include <SendData.h>
+
+class DataPlot_impl;
+
+namespace flair
+{
+    namespace core
+    {
+        class IODataElement;
+    }
+}
+namespace flair
+{
+namespace gui
+{
+    class LayoutPosition;
+
+    /*! \class DataPlot
+    *
+    * \brief Abstract class to display plots on ground station
+    *
+    */
+    class DataPlot: public SendData
+    {
+        public:
+            /*!
+            \enum Color_t
+            \brief Types of colors
+            */
+            typedef enum {
+                Red/*! red  */,
+                Blue/*! blue  */,
+                Green/*! green  */,
+                Yellow/*! yellow  */,
+                Black/*! black  */,
+                White/*! white  */,
+                } Color_t;
+
+            /*!
+            * \brief Constructor
+            *
+            * Type must agree with predifined (hard coded) types
+            * in ground station code. After calling this constructor,
+            * position will be deleted as it is no longer usefull.
+            * The DataPlot will automatically be child of position->getLayout() Layout.
+            *
+            * \param position position
+            * \param name nom
+            * \param type type
+            */
+            DataPlot(const LayoutPosition* position,std::string name,std::string type);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~DataPlot();
+
+        protected:
+            /*!
+            * \brief Add an IODataElement to the plot.
+            *
+            * This method registers element for sending.
+            *
+            * \param element element to plot
+            */
+            void AddDataToSend(const core::IODataElement *element);
+
+        private:
+            /*!
+            * \brief Copy datas to specified buffer
+            *
+            * Reimplemented from SendData.
+            *
+            * \param buf output buffer
+            */
+            void CopyDatas(char* buf) const;
+
+            /*!
+            * \brief Extra Xml event
+            *
+            * Reimplemented from SendData.
+            */
+            void ExtraXmlEvent(void){};
+
+            class DataPlot_impl* pimpl_;
+    };
+
+    /*!
+    * \brief Get RGB components from color type
+    *
+    *
+    * \param color input color
+    * \param r output component
+    * \param g output component
+    * \param b output component
+    */
+    void RGBFromColor(DataPlot::Color_t color,uint8_t &r,uint8_t &g,uint8_t &b);
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // DATAPLOT_H
Index: /trunk/lib/FlairCore/src/DataPlot1D.cpp
===================================================================
--- /trunk/lib/FlairCore/src/DataPlot1D.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/DataPlot1D.cpp	(revision 2)
@@ -0,0 +1,70 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   DataPlot1D.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a 1D plot on the ground station
+//
+//
+/*********************************************************************/
+
+#include "DataPlot1D.h"
+#include "LayoutPosition.h"
+#include "IODataElement.h"
+#include "FrameworkManager.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+using namespace core;
+
+DataPlot1D::DataPlot1D(const LayoutPosition* position,string name,float ymin,float ymax):DataPlot(position,name,"DataPlot1D")
+{
+    SetVolatileXmlProp("min",ymin);
+    SetVolatileXmlProp("max",ymax);
+    SendXml();
+}
+
+DataPlot1D::~DataPlot1D() {
+}
+
+void DataPlot1D::AddCurve(const core::IODataElement* element,uint8_t r,uint8_t g,uint8_t b,string curve_name)
+{
+    if(curve_name!="")
+    {
+        SetVolatileXmlProp("curve",curve_name);
+    }
+    else
+    {
+        SetVolatileXmlProp("curve",element->Parent()->ObjectName() + "\\" +element->ObjectName());
+    }
+    SetVolatileXmlProp("type",element->GetDataType().GetDescription());
+    SetVolatileXmlProp("r",r);
+    SetVolatileXmlProp("g",g);
+    SetVolatileXmlProp("b",b);
+
+    SendXml();
+
+    //save data information
+    AddDataToSend(element);
+}
+
+void DataPlot1D::AddCurve(const core::IODataElement* element,Color_t color,string curve_name) {
+    uint8_t r,g,b;
+    RGBFromColor(color,r,g,b);
+    AddCurve(element,r,g,b,curve_name);
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/DataPlot1D.h
===================================================================
--- /trunk/lib/FlairCore/src/DataPlot1D.h	(revision 2)
+++ /trunk/lib/FlairCore/src/DataPlot1D.h	(revision 2)
@@ -0,0 +1,85 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file DataPlot1D.h
+ * \brief Class displaying a 1D plot on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef DATAPLOT1D_H
+#define DATAPLOT1D_H
+
+#include <DataPlot.h>
+#include <stdint.h>
+
+namespace flair
+{
+namespace core
+{
+    class IODataElement;
+}
+
+namespace gui
+{
+
+    class LayoutPosition;
+
+    /*! \class DataPlot1D
+    *
+    * \brief Class displaying a 1D plot on the ground station
+    *
+    */
+    class DataPlot1D: private DataPlot
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a 1D plot at given position.
+            *
+            * \param position position to display the plot
+            * \param name name
+            * \param ymin default ymin of the plot
+            * \param ymax default ymax of the plot
+            */
+            DataPlot1D(const LayoutPosition* position,std::string name,float ymin,float ymax);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~DataPlot1D();
+
+            /*!
+            * \brief Add a curve from an IODataElement to the plot.
+            *
+            * Curve's color can be selected by its name.
+            *
+            * \param element element to plot
+            * \param color color of the curve
+            * \param curve_name name of the curve for the legend, if unspecified, element->ObjectName() will be used
+            */
+            void AddCurve(const core::IODataElement* element,Color_t color,std::string curve_name="");
+
+            /*!
+            * \brief Add a curve from an IODataElement to the plot.
+            *
+            * Curve's color can be selected by its RGB components.
+            *
+            * \param element element to plot
+            * \param r red component of the curve
+            * \param g green component of the curve
+            * \param b blue component of the curve
+            * \param curve_name name of the curve for the legend, if unspecified, element->ObjectName() will be used
+            */
+            void AddCurve(const core::IODataElement* element,uint8_t r=255,uint8_t g=0,uint8_t b=0,std::string curve_name="");
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // DATAPLOT1D_H
Index: /trunk/lib/FlairCore/src/DataPlot2D.cpp
===================================================================
--- /trunk/lib/FlairCore/src/DataPlot2D.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/DataPlot2D.cpp	(revision 2)
@@ -0,0 +1,70 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/08
+//  filename:   DataPlot2D.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a 2D plot on the ground station
+//
+//
+/*********************************************************************/
+
+#include "DataPlot2D.h"
+#include "LayoutPosition.h"
+#include "IODataElement.h"
+#include <typeinfo>
+
+using std::string;
+
+namespace flair { namespace gui {
+
+DataPlot2D::DataPlot2D(const LayoutPosition* position,string name,string x_name,float xmin,float xmax,string y_name,float ymin,float ymax):DataPlot(position,name,"DataPlot2D") {
+    SetVolatileXmlProp("xmin",xmin);
+    SetVolatileXmlProp("xmax",xmax);
+    SetVolatileXmlProp("ymin",ymin);
+    SetVolatileXmlProp("ymax",ymax);
+    SetVolatileXmlProp("x_name",x_name);
+    SetVolatileXmlProp("y_name",y_name);
+    SendXml();
+}
+
+DataPlot2D::~DataPlot2D() {}
+
+void DataPlot2D::AddCurve(const core::IODataElement* x_element,const core::IODataElement* y_element,Color_t color,string curve_name) {
+    uint8_t r,g,b;
+    RGBFromColor(color,r,g,b);
+    AddCurve(x_element,y_element,r,g,b,curve_name);
+}
+
+void DataPlot2D::AddCurve(const core::IODataElement* x_element,const core::IODataElement* y_element,uint8_t r,uint8_t g,uint8_t b,string curve_name) {
+    if(typeid(x_element->GetDataType())!=typeid(y_element->GetDataType())) {
+        Err("x_element type is different from y_element type (%i-%i)\n",x_element->GetDataType().GetDescription().c_str(),y_element->GetDataType().GetDescription().c_str());
+        //gerer erreur
+        return;
+    }
+
+    if(curve_name!="") {
+        SetVolatileXmlProp("curve",curve_name);
+    } else {
+        SetVolatileXmlProp("curve",x_element->Parent()->ObjectName() + "\\" +x_element->ObjectName()+ "\\" +y_element->ObjectName());
+    }
+    SetVolatileXmlProp("type",x_element->GetDataType().GetDescription());
+    SetVolatileXmlProp("r",r);
+    SetVolatileXmlProp("g",g);
+    SetVolatileXmlProp("b",b);
+
+    SendXml();
+
+    //save data information
+    AddDataToSend(x_element);
+    AddDataToSend(y_element);
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/DataPlot2D.h
===================================================================
--- /trunk/lib/FlairCore/src/DataPlot2D.h	(revision 2)
+++ /trunk/lib/FlairCore/src/DataPlot2D.h	(revision 2)
@@ -0,0 +1,93 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file DataPlot2D.h
+ * \brief Class displaying a 2D plot on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef DATAPLOT2D_H
+#define DATAPLOT2D_H
+
+#include <DataPlot.h>
+#include <stdint.h>
+
+namespace flair
+{
+    namespace core
+    {
+        class IODataElement;
+    }
+}
+namespace flair
+{
+namespace gui
+{
+
+    class LayoutPosition;
+
+    /*! \class DataPlot2D
+    *
+    * \brief Class displaying a 2D plot on the ground station
+    *
+    */
+    class DataPlot2D: private DataPlot
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a 2D plot at given place position.
+            *
+            * \param position position to display the plot
+            * \param name name
+            * \param x_name name of x axis
+            * \param xmin default xmin of the plot
+            * \param xmax default xmax of the plot
+            * \param y_name name of y axis
+            * \param ymin default ymin of the plot
+            * \param ymax default ymax of the plot
+            */
+            DataPlot2D(const LayoutPosition* position,std::string name,std::string x_name,float xmin,float xmax,std::string y_name,float ymin,float ymax);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~DataPlot2D();
+
+            /*!
+            * \brief Add a curve from elements to the plot.
+            *
+            * Curve's color can be selected by its name.
+            *
+            * \param x_element element to plot for x coordinate
+            * \param y_element element to plot for y coordinate
+            * \param color color of the curve
+            * \param curve_name name of the curve ofr the legend
+            */
+            void AddCurve(const core::IODataElement* x_element,const core::IODataElement* y_element,Color_t color,std::string curve_name="");
+
+            /*!
+            * \brief Add a curve from elements to the plot.
+            *
+            * Curve's color can be selected by its RGB components.
+            *
+            * \param x_element element to plot for x coordinate
+            * \param y_element element to plot for y coordinate
+            * \param r red component of the curve
+            * \param g green component of the curve
+            * \param b blue component of the curve
+            * \param curve_name name of the curve ofr the legend
+            */
+            void AddCurve(const core::IODataElement* x_element,const core::IODataElement* y_element,uint8_t r=255,uint8_t g=0,uint8_t b=0,std::string curve_name="");
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // DATAPLOT2D_H
Index: /trunk/lib/FlairCore/src/DataPlot_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/DataPlot_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/DataPlot_impl.cpp	(revision 2)
@@ -0,0 +1,26 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/10
+//  filename:   DataPlot_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe de base pour les DataPlot_impl
+//
+//
+/*********************************************************************/
+
+#include "DataPlot_impl.h"
+
+DataPlot_impl::DataPlot_impl()
+{
+}
+
+DataPlot_impl::~DataPlot_impl()
+{
+}
Index: /trunk/lib/FlairCore/src/DoubleSpinBox.cpp
===================================================================
--- /trunk/lib/FlairCore/src/DoubleSpinBox.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/DoubleSpinBox.cpp	(revision 2)
@@ -0,0 +1,86 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   DoubleSpinBox.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QDoubleSpinBox on the ground station
+//
+//
+/*********************************************************************/
+
+#include "DoubleSpinBox.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+DoubleSpinBox::DoubleSpinBox(const LayoutPosition* position,string name,double min,double max,double step,int decimals,double default_value):Box(position,name,"DoubleSpinBox")
+{
+    //update value from xml file
+    if(default_value<min) default_value=min;
+    if(default_value>max) default_value=max;
+    box_value=default_value;
+
+    SetVolatileXmlProp("min",min);
+    SetVolatileXmlProp("max",max);
+    SetVolatileXmlProp("step",step);
+    SetVolatileXmlProp("decimals",decimals);
+    GetPersistentXmlProp("value",box_value);
+    SetPersistentXmlProp("value",box_value);
+
+    SendXml();
+}
+
+DoubleSpinBox::DoubleSpinBox(const LayoutPosition* position,string name,string suffix,double min,double max,double step,int decimals,double default_value):Box(position,name,"DoubleSpinBox")
+{
+    //update value from xml file
+    if(default_value<min) default_value=min;
+    if(default_value>max) default_value=max;
+    box_value=default_value;
+
+    SetVolatileXmlProp("suffix",suffix);
+    SetVolatileXmlProp("min",min);
+    SetVolatileXmlProp("max",max);
+    SetVolatileXmlProp("step",step);
+    SetVolatileXmlProp("decimals",decimals);
+    GetPersistentXmlProp("value",box_value);
+    SetPersistentXmlProp("value",box_value);
+
+    SendXml();
+}
+
+DoubleSpinBox::~DoubleSpinBox()
+{
+
+}
+
+double DoubleSpinBox::Value(void) const
+{
+    double tmp;
+
+    GetMutex();
+    tmp=box_value;
+    ReleaseMutex();
+
+    return tmp;
+}
+
+void DoubleSpinBox::XmlEvent(void)
+{
+    GetMutex();
+    if(GetPersistentXmlProp("value",box_value)) SetValueChanged();
+    ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/DoubleSpinBox.h
===================================================================
--- /trunk/lib/FlairCore/src/DoubleSpinBox.h	(revision 2)
+++ /trunk/lib/FlairCore/src/DoubleSpinBox.h	(revision 2)
@@ -0,0 +1,94 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file DoubleSpinBox.h
+ * \brief Class displaying a QDoubleSpinBox on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef DOUBLESPINBOX_H
+#define DOUBLESPINBOX_H
+
+#include <Box.h>
+
+namespace flair
+{
+namespace gui
+{
+
+    class Layout;
+
+    /*! \class DoubleSpinBox
+    *
+    * \brief Class displaying a QDoubleSpinBox on the ground station
+    *
+    */
+    class DoubleSpinBox: public Box
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a QDoubleSpinBox at given position. \n
+            * The QDoubleSpinBox is saturated to min and max values.
+            *
+            * \param position position to display the QDoubleSpinBox
+            * \param name name
+            * \param min minimum value
+            * \param max maximum value
+            * \param step step
+            * \param decimals number of decimals
+            * \param default_value default value if not in the xml config file
+            */
+            DoubleSpinBox(const LayoutPosition* position,std::string name,double min,double max,double step,int decimals=2,double default_value=0);
+
+            /*!
+            * \brief Constructor
+            *
+            * Construct a QDoubleSpinBox at given position. \n
+            * The QDoubleSpinBox is saturated to min and max values.
+            *
+            * \param position position to display the QDoubleSpinBox
+            * \param name name
+            * \param suffix suffix for the value (eg unit)
+            * \param min minimum value
+            * \param max maximum value
+            * \param step step
+            * \param decimals number of decimals
+            * \param default_value default value if not in the xml config file
+            */
+            DoubleSpinBox(const LayoutPosition* position,std::string name,std::string suffix,double min,double max,double step,int decimals=2,double default_value=0);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~DoubleSpinBox();
+
+            /*!
+            * \brief Value
+            *
+            * \return value
+            */
+            double Value(void) const;
+
+        private:
+            /*!
+            * \brief XmlEvent from ground station
+            *
+            * Reimplemented from Widget.
+            *
+            */
+            void XmlEvent(void);
+
+            double box_value;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // DOUBLESPINBOX_H
Index: /trunk/lib/FlairCore/src/Euler.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Euler.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Euler.cpp	(revision 2)
@@ -0,0 +1,130 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/05/02
+//  filename:   Euler.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining euler angles
+//
+//
+/*********************************************************************/
+
+#include "Euler.h"
+#include "Quaternion.h"
+#include <math.h>
+
+#define PI ((float)3.14159265358979323846)
+#define PI_D ((double)3.14159265358979323846)
+
+namespace flair
+{
+namespace core
+{
+
+Euler::Euler(float inRoll,float inPitch,float inYaw): roll(inRoll), pitch(inPitch),yaw(inYaw) {
+}
+
+Euler::~Euler() {
+
+}
+
+Euler& Euler::operator=(const Euler &euler) {
+    roll=euler.roll;
+    pitch=euler.pitch;
+    yaw=euler.yaw;
+    return (*this);
+}
+/*
+void Euler::RotateX(float value) {
+    float pitch_tmp;
+    pitch_tmp=pitch*cosf(value)+yaw*sinf(value);
+    yaw=-pitch*sinf(value)+yaw*cosf(value);
+    pitch=pitch_tmp;
+    roll+=value;
+    if(roll<-PI) roll+=2*PI;
+    if(roll>PI) roll-=2*PI;
+}
+
+void Euler::RotateXDeg(float value) {
+    RotateX(ToRadian(value));
+}
+
+void Euler::RotateY(float value) {
+    float roll_tmp;
+    roll_tmp=roll*cosf(value)-yaw*sinf(value);
+    yaw=roll*sinf(value)+yaw*cosf(value);
+    roll=roll_tmp;
+    pitch+=value;
+    if(pitch<-PI) pitch+=2*PI;
+    if(pitch>PI) pitch-=2*PI;
+}
+
+void Euler::RotateYDeg(float value) {
+    RotateY(ToRadian(value));
+}
+
+void Euler::RotateZ(float value) {
+    float roll_tmp;
+    roll_tmp=roll*cosf(value)+pitch*sinf(value);
+    pitch=-roll*sinf(value)+pitch*cosf(value);
+    roll=roll_tmp;
+    yaw+=value;
+    if(yaw<-PI) yaw+=2*PI;
+    if(yaw>PI) yaw-=2*PI;
+}
+
+void Euler::RotateZDeg(float value) {
+    RotateZ(ToRadian(value));
+}
+*/
+void Euler::ToQuaternion(Quaternion &quaternion) const {
+    quaternion.q0=cos(yaw/2)*cos(pitch/2)*cos(roll/2)
+        +sin(yaw/2)*sin(pitch/2)*sin(roll/2);
+
+    quaternion.q1=cos(yaw/2)*cos(pitch/2)*sin(roll/2)
+        -sin(yaw/2)*sin(pitch/2)*cos(roll/2);
+
+    quaternion.q2=cos(yaw/2)*sin(pitch/2)*cos(roll/2)
+        +sin(yaw/2)*cos(pitch/2)*sin(roll/2);
+
+    quaternion.q3=sin(yaw/2)*cos(pitch/2)*cos(roll/2)
+        -cos(yaw/2)*sin(pitch/2)*sin(roll/2);
+}
+
+Quaternion Euler::ToQuaternion(void) const {
+    Quaternion quaternion;
+    ToQuaternion(quaternion);
+    return quaternion;
+}
+
+float Euler::ToDegree(float radianValue) {
+    return radianValue*180.0f/PI;
+}
+
+float Euler::ToRadian(float degreeValue) {
+    return degreeValue/180.0f*PI;
+}
+
+float Euler::YawDistanceFrom(float angle) const {
+    float rot1,rot2;
+    if(angle > yaw ) {
+        rot1=angle-yaw;
+        rot2=2*PI-angle+yaw;
+    } else {
+        rot1=2*PI+angle-yaw;
+        rot2=yaw-angle;
+    }
+    if(rot2<rot1) rot1=-rot2;
+    rot1=-rot1;//pour avoir rot1=yaw-angle
+
+    return rot1;
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Euler.h
===================================================================
--- /trunk/lib/FlairCore/src/Euler.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Euler.h	(revision 2)
@@ -0,0 +1,152 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Euler.h
+ * \brief Class defining euler angles
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/05/02
+ * \version 4.0
+ */
+
+#ifndef EULER_H
+#define EULER_H
+
+namespace flair { namespace core {
+    class Quaternion;
+
+    /*! \class Euler
+    *
+    * \brief Class defining euler angles
+    *
+    * Euler angles are expressed in radians.
+    *
+    */
+    class Euler {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct euler angles using specified values.
+            *
+            * \param roll roll value
+            * \param pitch pitch value
+            * \param yaw yaw value
+            */
+            Euler(float roll=0,float pitch=0,float yaw=0);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Euler();
+
+            /*!
+            * \brief x axis rotation
+            *
+            * \param value rotation value in radians
+            */
+            //todo: passer par un quaternion
+            //void RotateX(float value);
+
+            /*!
+            * \brief x axis rotation
+            *
+            * \param value rotation value in degrees
+            */
+            //void RotateXDeg(float value);
+
+            /*!
+            * \brief y axis rotation
+            *
+            * \param value rotation value in radians
+            */
+            //void RotateY(float value);
+
+            /*!
+            * \brief y axis rotation
+            *
+            * \param value rotation value in degrees
+            */
+            //void RotateYDeg(float value);
+
+            /*!
+            * \brief z axis rotation
+            *
+            * \param value rotation value in radians
+            */
+            //void RotateZ(float value);
+
+            /*!
+            * \brief z axis rotation
+            *
+            * \param value rotation value in degrees
+            */
+            //void RotateZDeg(float value);
+
+            /*!
+            * \brief Convert to quaternion
+            *
+            * \param quaternion output quaternion
+            */
+            void ToQuaternion(Quaternion &quaternion) const;
+
+            /*!
+            * \brief Convert to quaternion
+            *
+            * \return quaternion
+            */
+            Quaternion ToQuaternion(void) const;
+            /*!
+            * \brief Convert from radian to degree
+            *
+            * \param radianValue value in radian
+            *
+            * \return value in degree
+            */
+            static float ToDegree(float radianValue);
+
+            /*!
+            * \brief Convert from degree to radian
+            *
+            * \param degreeValue value in degree
+            *
+            * \return value in radian
+            */
+            static float ToRadian(float degreeValue);
+
+            /*!
+            * \brief Compute yaw distance
+            *
+            * Compute yaw distance from given angle. This is the minimum distance.
+            *
+            * \param angle starting angle
+            *
+            * \return value distance in radian
+            */
+            float YawDistanceFrom(float angle) const;
+
+            /*!
+            * \brief roll value
+            */
+            float roll;
+
+            /*!
+            * \brief pitch value
+            */
+            float pitch;
+
+            /*!
+            * \brief yaw value
+            */
+            float yaw;
+
+            Euler& operator=(const Euler &euler);
+
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // EULER_H
Index: /trunk/lib/FlairCore/src/FrameworkManager.cpp
===================================================================
--- /trunk/lib/FlairCore/src/FrameworkManager.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/FrameworkManager.cpp	(revision 2)
@@ -0,0 +1,188 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/08/31
+//  filename:   FrameworkManager.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Main class of the Framework library
+//
+//
+/*********************************************************************/
+
+#include "FrameworkManager.h"
+#include "FrameworkManager_impl.h"
+#include "IODevice.h"
+#include "config.h"
+#include "svnversion.h"
+
+using std::string;
+using std::vector;
+using namespace flair::gui;
+
+namespace
+{
+    flair::core::FrameworkManager* frameworkmanager=NULL;
+}
+
+
+namespace flair
+{
+namespace core
+{
+
+
+FrameworkManager* getFrameworkManager(void) {
+    return frameworkmanager;
+}
+
+bool IsBigEndian(void) {
+    union {
+        uint32_t i;
+        char c[4];
+    } bint = {0x01020304};
+
+    if(bint.c[0] == 1) {
+        return true;
+    } else {
+        return false;
+    }
+}
+
+FrameworkManager::FrameworkManager(string name): Object(NULL,name,XML_ROOT_TYPE)
+{
+    if(frameworkmanager!=NULL) {
+        Err("FrameworkManager should be instanced only one time\n");
+        return;
+    }
+
+    Printf(SVN_REV);
+    frameworkmanager=this;
+    pimpl_=new FrameworkManager_impl(this,name);
+}
+
+FrameworkManager::~FrameworkManager() {
+    //Printf("destruction FrameworkManager\n");
+
+    //stop ui_com thread (which sends datas for graphs), we do not need it as graphs will be destroyed
+    if(getUiCom()!=NULL) {
+        getUiCom()->SafeStop();
+        getUiCom()->Join();
+    }
+
+    //we start by deleting threads (except pimpl which must be deleted at last)
+    // (before deleting objects that could be used by the threads)
+    //Printf("delete Threads\n");
+    for(vector<const Object*>::iterator it=Childs()->begin() ; it < Childs()->end(); it++ ) {
+        //Printf("child %i %s %s\n",Childs()->size(),(*it)->ObjectName().c_str(),(*it)->ObjectType().c_str());
+        if((*it)->ObjectType()=="Thread") {
+            if(*it!=pimpl_) {
+                //Printf("del\n");
+                delete (Thread*)(*it);
+                //Childs() vector has been modified, we start from beginning again
+                //it will be incremented by the loop, so in fact we start again at begin()+1
+                //it is not a problem since begin is pimpl
+                it=Childs()->begin();
+                //Printf("del ok\n");
+            }
+        }
+    }
+
+    //next we delete IODevice
+    // (before deleting objects that could be used by the IODevice)
+    //Printf("delete IODevices\n");
+    for(vector<const Object*>::iterator it=Childs()->begin() ; it < Childs()->end(); it++ ) {
+        //Printf("child %i %s %s\n",Childs()->size(),(*it)->ObjectName().c_str(),(*it)->ObjectType().c_str());
+        if((*it)->ObjectType()=="IODevice") {
+            //Printf("del\n");
+            delete (IODevice*)*it;
+            //Printf("del ok\n");
+            //Childs() vector has been modified, we start from beginning again
+            //it will be incremented by the loop, so in fact we start again at begin()+1
+            //it is not a problem since begin is pimpl (not an IODevice)
+            it=Childs()->begin();
+            //Printf("del ok\n");
+        }
+    }
+
+//Printf("delete childs\n");
+    //on efface les enfants en commencant par la fin
+    //le ui_com puis FrameworkManager_impl est détruit en dernier
+    //permet de garder l'uicom pour notifer des destructions
+    while(Childs()->size()!=0) {
+        //Printf("child %i %s %s\n",Childs()->size(),Childs()->back()->ObjectName().c_str(),Childs()->back()->ObjectType().c_str());
+        if(Childs()->back()!=NULL) delete Childs()->back();
+    }
+
+    //childs.clear();
+
+//Printf("destruction FrameworkManager ok\n");
+}
+
+void FrameworkManager::SetupConnection(string address,uint16_t port,size_t rcv_buf_size) {
+    pimpl_->SetupConnection(address,port,rcv_buf_size);
+}
+
+void FrameworkManager::SetupUserInterface(string xml_file) {
+    pimpl_->SetupUserInterface(xml_file);
+}
+
+gui::TabWidget* FrameworkManager::GetTabWidget(void) const {
+    return pimpl_->tabwidget;
+}
+
+void FrameworkManager::UpdateSendData(const SendData *obj) {
+    if(getUiCom()!=NULL) getUiCom()->UpdateSendData(obj);
+}
+
+void FrameworkManager::BlockCom(void) {
+    if(getUiCom()!=NULL) getUiCom()->Block();
+}
+
+void FrameworkManager::UnBlockCom(void) {
+    if(getUiCom()!=NULL) getUiCom()->UnBlock();
+}
+
+bool FrameworkManager::ConnectionLost(void) const {
+    if(getUiCom()!=NULL) {
+        return (getUiCom()->ConnectionLost()| pimpl_->connection_lost);
+    } else {
+        return false;
+    }
+}
+
+void FrameworkManager::SetupLogger(string log_path) {
+    pimpl_->SetupLogger(log_path);
+}
+
+void FrameworkManager::AddDeviceToLog(IODevice *device) {
+    pimpl_->AddDeviceToLog(device);
+}
+
+void FrameworkManager::StartLog(void) {
+    pimpl_->StartLog();
+}
+
+void FrameworkManager::StopLog(void) {
+    pimpl_->StopLog();
+}
+
+bool FrameworkManager::IsLogging(void) const {
+    return pimpl_->is_logging;
+}
+
+void FrameworkManager::DisableErrorsDisplay(bool value) {
+    pimpl_->disable_errors=value;
+}
+
+bool FrameworkManager::IsDisplayingErrors(void) const {
+    return !(pimpl_->disable_errors);
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/FrameworkManager.h
===================================================================
--- /trunk/lib/FlairCore/src/FrameworkManager.h	(revision 2)
+++ /trunk/lib/FlairCore/src/FrameworkManager.h	(revision 2)
@@ -0,0 +1,222 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file FrameworkManager.h
+ * \brief Main class of the Framework library
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/08/31
+ * \version 4.0
+ */
+
+#ifndef FRAMEWORKMANAGER_H
+#define FRAMEWORKMANAGER_H
+
+#include <Object.h>
+
+class FrameworkManager_impl;
+
+namespace flair
+{
+    namespace gui
+    {
+        class TabWidget;
+        class SendData;
+    }
+}
+namespace flair
+{
+namespace core
+{
+    class IODevice;
+
+    /*! \class FrameworkManager
+    *
+    * \brief Main class of the Framework library
+    *
+    * This is the main class of the library. Only one instance of this class is allowed
+    * by program. Morevoer, its name must be unique if more than one program using this class
+    * is running on the same system (a control and a simlator for example). \n
+    * This class allows: \n
+    * -connexion with ground station, \n
+    * -creation of a QTabWidget on ground station, \n
+    * -handling of xml files, used for default values of Widgets, \n
+    * -logging of datas.
+    */
+    class FrameworkManager: public Object
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a FrameworkManager. \n
+            * Call SetupConnection method just after this constructor to setup the conection with a ground station.
+            *
+            * \param name name, must be unique
+            */
+            FrameworkManager(std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            * Calling it will automatically destruct all childs. \n
+            * Destruction implies destruction of the QTabWidget on ground station.
+            *
+            */
+            ~FrameworkManager();
+
+            /*!
+            * \brief Setup the connection with ground station
+            *
+            * Call this method just after the constructor of this class. If this method is not called, the program will run headless.
+            *
+            * \param address address of ground station
+            * \param port port of ground station
+            * \param rcv_buf_size receive buffer size
+            */
+            void SetupConnection(std::string address,uint16_t port,size_t rcv_buf_size=10000);
+
+            /*!
+            * \brief Setup the user interface
+            *
+            * If this method is called after SetupConnection, Widgets will be displayed in the ground station.
+            * Otherwise, it will run headless, but default values of Widgets will be taken from the xml file.
+            *
+            * \param xml_file xml file for default values of Widgets
+            */
+            void SetupUserInterface(std::string xml_file);
+
+            /*!
+            * \brief Get TabWidget
+            *
+            * \return TabWidget
+            */
+            gui::TabWidget* GetTabWidget(void) const;
+
+            /*!
+            * \brief Logger setup
+            *
+            * Setup path of log files. \n
+            * No logging will be performed if this method is not called. \n
+            *
+            * \param log_path path to store logs
+            */
+            void SetupLogger(std::string log_path);
+
+            /*!
+            * \brief Add log element
+            *
+            * The added element will be automatically logged once
+            * logging started (see StartLog()). \n
+            * This element must define on its side the io_data
+            * to log, trough IODevice::SetDataToLog method.
+            *
+            * \param device IODevice to add
+            */
+            void AddDeviceToLog(IODevice *device);
+
+            /*!
+            * \brief Start logging
+            *
+            * All IODevice added through AddDeviceToLog() method
+            * will automatically be logged. \n
+            * SetupLogger() must have been called before.
+            */
+            void StartLog(void);
+
+            /*!
+            * \brief Stop logging
+            *
+            * Logs will automatically be sent to ground station.
+            */
+            void StopLog(void);
+
+            /*!
+            * \brief Is logging?
+            *
+            * \return true if is logging
+            */
+            bool IsLogging(void) const;
+
+            /*!
+            * \brief Notify that SendData's period has changed
+            *
+            * This funtion must be called when the period has changed. \n
+            * Normally, it occurs in the Widget::XmlEvent method. \n
+            * This method must be called with communication blocked (see BlockCom()).
+            *
+            * \param obj SendData which changed
+            */
+            void UpdateSendData(const gui::SendData *obj);
+
+            /*!
+            * \brief Block communication
+            *
+            * This funtion blocks the communication beetween the program and ground station. \n
+            * It must be called before changing datas or parameters exchanged between the program
+            * and the ground station.
+            *
+            */
+            void BlockCom(void);
+
+             /*!
+            * \brief Unblock communication
+            *
+            * This funtion unblocks the communication beetween the program and ground station. \n
+            * It must be called after changing datas or parameters exchanged between the program
+            * and the ground station.
+            *
+            */
+            void UnBlockCom(void);
+
+            /*!
+            * \brief Is connection lost?
+            *
+            * Once this method returns true, it will never return false back. \n
+            * Note that this method return false if no connection is defined (see SetupConnection).
+            *
+            * \return true if connection with ground station is lost
+            */
+            bool ConnectionLost(void) const;
+
+            /*!
+            * \brief Disable errors display
+            *
+            * Disable errors display, if you do not want to saturate console for exemple.
+            * By defaults errors disply is enabled.
+            *
+            * \param value true to disable errors display
+            */
+            void DisableErrorsDisplay(bool value);
+
+            /*!
+            * \brief Is displaying errors?
+            *
+            *
+            * \return true if errors display is enabled
+            */
+            bool IsDisplayingErrors(void) const;
+
+        private:
+            class FrameworkManager_impl* pimpl_;
+    };
+
+    /*!
+    * \brief get FrameworkManager
+    *
+    * \return the FrameworkManager
+    */
+    FrameworkManager* getFrameworkManager(void);
+
+    /*!
+    * \brief is big endian?
+    *
+    * \return true if big endian, false if little endian
+    */
+    bool IsBigEndian(void);
+
+} // end namespace core
+} // end namespace flair
+
+#endif // FRAMEWORKMANAGER_H
Index: /trunk/lib/FlairCore/src/FrameworkManager_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/FrameworkManager_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/FrameworkManager_impl.cpp	(revision 2)
@@ -0,0 +1,945 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/08/31
+//  filename:   FrameworkManager.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Classe de base de la librairie
+//
+//
+/*********************************************************************/
+
+#include "FrameworkManager_impl.h"
+#include "FrameworkManager.h"
+#include "Widget_impl.h"
+#include <unistd.h>
+#include "IODevice.h"
+#include "IODevice_impl.h"
+#include "TabWidget.h"
+#include "Layout.h"
+#include "PushButton.h"
+#include "communication.h"
+#include "config.h"
+#include "Watchdog.h"
+#include <errno.h>
+#include <string.h>
+#include <arpa/inet.h>
+#include <sys/mman.h>
+#include <execinfo.h>
+#include <signal.h>
+#include <fcntl.h>
+#ifdef __XENO__
+#include <native/task.h>
+#endif
+
+using namespace std;
+using namespace flair::core;
+using namespace flair::gui;
+
+ui_com* FrameworkManager_impl::com=NULL;
+FrameworkManager_impl* FrameworkManager_impl::_this=NULL;
+
+namespace {
+#ifdef __XENO__
+
+#ifdef SIGDEBUG
+    static const char *reason_str[] = {
+        "undefined",
+        "received signal",
+        "invoked syscall",
+        "triggered fault",
+        "affected by priority inversion",
+         "missing mlockall",
+        "runaway thread",
+    };
+
+    void warn_upon_switch(int sig, siginfo_t *si, void *context)     {
+        unsigned int reason = si->si_value.sival_int;
+        void *bt[32];
+        int nentries;
+#ifdef SIGDEBUG_WATCHDOG
+        printf("\nSIGDEBUG received, reason %d: %s\n", reason,
+           reason <= SIGDEBUG_WATCHDOG ? reason_str[reason] : "<unknown>");
+#endif
+        // Dump a backtrace of the frame which caused the switch to secondary mode:
+        nentries = backtrace(bt,sizeof(bt) / sizeof(bt[0]));
+        backtrace_symbols_fd(bt,nentries,fileno(stdout));
+    }
+#else //SIGDEBUG
+    void warn_upon_switch(int sig __attribute__((unused))) {
+        void *bt[32];
+        int nentries;
+
+        /* Dump a backtrace of the frame which caused the switch to
+           secondary mode: */
+        nentries = backtrace(bt,sizeof(bt) / sizeof(bt[0]));
+        backtrace_symbols_fd(bt,nentries,fileno(stdout));
+    }
+#endif //SIGDEBUG
+#endif //__XENO__
+    void seg_fault(int sig __attribute__((unused))) {
+        void *bt[32];
+        int nentries;
+
+        printf("Segmentation fault:\n");
+        /* Dump a backtrace of the frame which caused the segfault: */
+        nentries = backtrace(bt,sizeof(bt) / sizeof(bt[0]));
+        backtrace_symbols_fd(bt,nentries,fileno(stdout));
+
+        exit(1);
+    }
+}
+
+FrameworkManager_impl::FrameworkManager_impl(FrameworkManager *self,string name): Thread(self,"FrameworkManager",FRAMEWORK_TASK_PRIORITY) {
+    this->self=self;
+    is_logging=false;
+    logger_defined=false;
+    disable_errors=false;
+    ui_defined=false;
+    rcv_buf=NULL;
+    _this=this;
+
+    // Avoids memory swapping for this program
+    mlockall(MCL_CURRENT|MCL_FUTURE);
+    struct sigaction sa;
+
+    //catch segfault
+    signal(SIGSEGV, seg_fault);
+
+    //catch primary->secondary switch
+#ifdef __XENO__
+#ifdef SIGDEBUG
+    sigemptyset(&sa.sa_mask);
+    sa.sa_sigaction = warn_upon_switch;
+    sa.sa_flags = SA_SIGINFO;
+    sigaction(SIGDEBUG, &sa, NULL);
+#else
+    signal(SIGXCPU, warn_upon_switch);
+#endif
+
+    string task_name="Framework_"+name;
+    int status=rt_task_shadow(NULL,task_name.c_str(),10,0);
+    if(status!=0) {
+        self->Err("rt_task_shadow error (%s)\n",strerror(-status));
+    }
+
+#endif //__XENO__
+}
+
+void FrameworkManager_impl::ConnectionLost(void) {
+    Err("connection lost\n");
+    gcs_watchdog->SafeStop();
+    connection_lost=true;
+}
+
+FrameworkManager_impl::~FrameworkManager_impl() {
+    //Printf("destruction FrameworkManager_impl\n");
+    int status;
+
+    SafeStop();
+    Join();
+
+    if(rcv_buf!=NULL) free(rcv_buf);
+
+    if(logger_defined==true) {
+        continuer=false;
+        (void)pthread_join(log_th,NULL);
+
+        status=DeletePipe(&cmd_pipe);
+        if(status!=0) {
+            Err("Error deleting pipe (%s)\n",strerror(-status));
+        }
+        status=DeletePipe(&data_pipe);
+        if(status!=0) {
+            Err("Error deleting pipe (%s)\n",strerror(-status));
+        }
+
+#ifdef __XENO__
+        status=rt_heap_delete(&log_heap);
+        if(status!=0) {
+            Err("rt_heap_delete error (%s)\n",strerror(-status));
+        }
+#endif
+
+        logs.clear();
+    }
+
+    if(file_doc!=NULL) xmlFreeDoc(file_doc);
+
+    if(ui_defined) delete top_layout;
+
+    if(com!=NULL) {
+        delete com;
+        status=UDT::close(com_sock);
+        if(status!=0) printf("Error udt::close %s",UDT::getlasterror().getErrorMessage());
+
+        status=UDT::close(file_sock);
+        if(status!=0) printf("Error udt::close %s",UDT::getlasterror().getErrorMessage());
+
+        SleepMS(200);//a revoir, sinon UDT::cleanup bloque en RT
+        UDT::cleanup();
+    }
+
+    //Printf("destruction FrameworkManager_impl ok\n");
+}
+
+
+void FrameworkManager_impl::SetupConnection(string address,uint16_t port,size_t rcv_buf_size) {
+    UDT::startup();
+    this->rcv_buf_size=rcv_buf_size;
+
+    //socket file_socket, doit être créé en premier, cf station sol
+    Printf("Connecting to %s:%i\n",address.c_str(),port);
+    file_sock=GetSocket(address,port);
+    com_sock=GetSocket(address,port);
+
+    //receive buffer allocation
+    rcv_buf=(char*)malloc(rcv_buf_size);
+    if(rcv_buf==NULL) {
+        Err("receive buffer malloc error\n");
+    }
+
+    com=new ui_com(this,com_sock);
+
+    //file managment
+    bool blocking = true;
+    UDT::setsockopt(file_sock, 0, UDT_SNDSYN, &blocking, sizeof(bool));
+    UDT::setsockopt(file_sock, 0, UDT_RCVSYN, &blocking, sizeof(bool));
+
+    //configure timeout of blocking receive, short timeout to have priority on the other socket (see run method)
+    int timeout=1;//ms
+    UDT::setsockopt(file_sock, 0, UDT_RCVTIMEO, &timeout, sizeof(int));
+
+    timeout=100;//ms
+    UDT::setsockopt(com_sock, 0, UDT_RCVTIMEO, &timeout, sizeof(int));
+
+    Start();
+
+    //watchdog for connection with ground station
+    connection_lost=false;
+    gcs_watchdog=new Watchdog(this,std::bind(&FrameworkManager_impl::ConnectionLost,this),(Time)1000000000);
+    gcs_watchdog->Start();
+}
+
+void FrameworkManager_impl::SetupUserInterface(string xml_file) {
+    ui_defined=true;
+    this->xml_file=xml_file;
+
+    //top_layout=new Layout(NULL,XML_ROOT_ELEMENT,XML_ROOT_TYPE);
+    top_layout=new Layout(NULL,self->ObjectName(),XML_ROOT_TYPE);
+
+    //xml setup of the main widget
+    if(xml_file!="") {
+        xmlNodePtr* file_node=&(((Widget*)(top_layout))->pimpl_->file_node);
+        file_doc = xmlParseFile(xml_file.c_str());
+        if (file_doc == NULL ) {
+            self->Warn("XML document not parsed successfully. Creating a new one.\n");
+            file_doc = xmlNewDoc((xmlChar*)"1.0");
+            *file_node=xmlNewNode(NULL, (xmlChar*)XML_ROOT_TYPE);
+            xmlSetProp(*file_node,(xmlChar*)"name",(xmlChar*)ObjectName().c_str());
+            xmlDocSetRootElement(file_doc, *file_node);
+            //PrintXml();
+        } else {
+            *file_node=xmlDocGetRootElement(file_doc);
+            if(xmlStrcmp((*file_node)->name,(xmlChar*)XML_ROOT_TYPE)) {
+                self->Warn("%s, no match found in xml file\n",XML_ROOT_TYPE);
+                *file_node=xmlNewNode(NULL, (xmlChar*)XML_ROOT_TYPE);
+                xmlSetProp(*file_node,(xmlChar*)"name",(xmlChar*)ObjectName().c_str());
+                xmlDocSetRootElement(file_doc, *file_node);
+            }
+        }
+    } else {
+        self->Err("xml file not defined\n");
+    }
+
+    //gui
+    tabwidget=new TabWidget(top_layout->At(0,0),XML_MAIN_TABWIDGET,TabWidget::North);
+    save_button=new PushButton(top_layout->At(1,0),"save config on target (" + self->ObjectName() + ")");
+    //load_button=new PushButton(top_layout->At(1,1),"load config on target (" + self->ObjectName() + ")");
+}
+
+//in case of RT, this thread switches to secondary mode when calling com->Receive
+//it switches back to RT in ProcessXML when mutex are locked
+void FrameworkManager_impl::Run(void)
+{
+    while(!ToBeStopped())
+    {
+        ssize_t bytesRead;
+
+        bytesRead=com->Receive(rcv_buf,rcv_buf_size);
+
+        if(bytesRead==(ssize_t)rcv_buf_size) Err("FrameworkManager max receive size, augmenter le buffer size!\n");
+
+        if(bytesRead>0)
+        {
+            //printf("recu %ld, trame %x\n",bytesRead,(uint8_t)rcv_buf[0]);
+            //rcv_buf[bytesRead-1]=0;//pour affichage
+            //printf("%s\n",rcv_buf);
+
+            switch((uint8_t)rcv_buf[0])
+            {
+                case XML_HEADER:
+                {
+                    xmlDoc *doc;
+                    rcv_buf[bytesRead]=0;
+
+                    doc = xmlReadMemory(rcv_buf, (int)bytesRead, "include.xml", "ISO-8859-1", 0);
+                    xmlNode *cur_node = NULL;
+
+                    for (cur_node = xmlDocGetRootElement(doc); cur_node; cur_node = cur_node->next)
+                    {
+                        if (cur_node->type == XML_ELEMENT_NODE)
+                        {
+                            if(!xmlStrcmp(cur_node->name,(xmlChar*)XML_ROOT_TYPE) )
+                            {
+#ifdef __XENO__
+                                WarnUponSwitches(true);//ProcessXML should not switch to secondary mode
+#endif
+                                top_layout->Widget::pimpl_->ProcessXML(cur_node->children);
+#ifdef __XENO__
+                                WarnUponSwitches(false);//other parts of this thread can switch to secondary mode
+#endif
+                                break;
+                            }
+                        }
+                    }
+
+                    xmlFreeDoc(doc);
+
+                    if(save_button->Clicked()) SaveXml();
+
+                    SaveXmlChange(rcv_buf);
+
+                    break;
+                }
+                case WATCHDOG_HEADER: {
+                    gcs_watchdog->Touch();
+                    break;
+                }
+                default:
+                    Err("unknown id: %x\n",(uint8_t)rcv_buf[0]);
+                    break;
+            }
+        } else {
+            if(com->ConnectionLost()) SleepMS(10);//avoid infinite loop in this case
+        }
+    }
+}
+
+void FrameworkManager_impl::SaveXml(void)
+{
+    if(ui_defined) xmlSaveFormatFile(xml_file.c_str(),file_doc,1);
+}
+
+void FrameworkManager_impl::SaveXmlChange(char* buf)
+{
+    if(is_logging==true)
+    {
+        FILE *xml_change;
+        char filename[256];
+        Time time=GetTime();
+
+        sprintf(filename,"%s/changes_at_%lld.xml",log_path.c_str(),time);
+
+        xml_change=fopen(filename,"a");
+        fprintf(xml_change,"%s",buf);
+        fclose(xml_change);
+
+        sprintf(filename,"changes_at_%lld.xml",time);
+        xml_changes.push_back(filename);
+    }
+}
+
+void FrameworkManager_impl::SendFile(string path,string name)
+{
+    char *buf,*more_buf;
+    int size;
+    filebuf *pbuf;
+    ssize_t nb_write;
+    string filename=path+ "/" +name;
+
+    // open the file
+    fstream ifs(filename.c_str(), ios::in | ios::binary);
+    ifs.seekg(0, ios::end);
+    size = ifs.tellg();
+    ifs.seekg(0, ios::beg);
+    pbuf=ifs.rdbuf();
+
+    if(size<=0)
+    {
+        Err("error opening file %s\n",filename.c_str());
+        return;
+    }
+
+    buf=(char*)malloc(sizeof(uint8_t)+sizeof(int)+name.size());
+    if(buf==NULL)
+    {
+        Err("malloc error, not sending file\n");
+        return;
+    }
+
+    if(IsBigEndian())
+    {
+        buf[0]=FILE_INFO_BIG_ENDIAN;
+    }
+    else
+    {
+        buf[0]=FILE_INFO_LITTLE_ENDIAN;
+    }
+
+    memcpy(buf+1,&size,sizeof(int));
+    memcpy(buf+1+sizeof(int),name.c_str(),name.size());
+    Printf("sending %s, size: %i\n",filename.c_str(),size);
+    // send file information
+    UDT::sendmsg(file_sock, buf, sizeof(uint8_t)+sizeof(int)+name.size(), -1,true);
+
+    more_buf=(char*)realloc((void*)buf,size);
+    if(more_buf==NULL)
+    {
+        Err("realloc error, not sending file\n");
+        free(buf);
+        return;
+    }
+    else
+    {
+        buf=more_buf;
+    }
+
+    pbuf->sgetn (buf,size);
+    // send the file
+    nb_write=UDT::sendmsg(file_sock, buf, size,-1,true);
+
+    if(nb_write<0)
+    {
+        Err("UDT::sendmsg error (%s)\n",UDT::getlasterror().getErrorMessage());
+    }
+    else if (nb_write != size)
+    {
+        Err("UDT::sendmsg error, sent %ld/%i\n",nb_write,size);
+    }
+
+    ifs.close();
+    free(buf);
+}
+
+void FrameworkManager_impl::FinishSending()
+{
+    char rm_cmd[256];
+
+    //send orignal xml
+    SendFile(log_path,"setup.xml");
+    sprintf(rm_cmd,"rm %s/setup.xml",log_path.c_str());
+    system(rm_cmd);
+
+    //send xml changes
+    for(size_t i=0;i<xml_changes.size();i++)
+    {
+        //Printf("%s\n",xml_changes.at(i).c_str());
+        SendFile(log_path,xml_changes.at(i).c_str());
+        sprintf(rm_cmd,"rm %s/%s",log_path.c_str(),xml_changes.at(i).c_str());
+        system(rm_cmd);
+    }
+    xml_changes.clear();
+
+    //end notify
+    char buf=END;
+    int nb_write=UDT::sendmsg(file_sock, &buf, 1,-1,true);
+
+    if(nb_write<0)
+    {
+        Err("UDT::sendmsg error (%s)\n",UDT::getlasterror().getErrorMessage());
+    }
+    else if (nb_write != 1)
+    {
+        Err("UDT::sendmsg error, sent %i/%i\n",nb_write,1);
+    }
+}
+
+UDTSOCKET FrameworkManager_impl::GetSocket(string address,uint16_t port) {
+    while(1) {
+        UDTSOCKET new_fd;
+        new_fd = UDT::socket(AF_INET, SOCK_DGRAM, 0);
+        if(new_fd==UDT::INVALID_SOCK) {
+            Err("socket error: %s\n",UDT::getlasterror().getErrorMessage());
+            return 0;
+        }
+
+        sockaddr_in serv_addr;
+        serv_addr.sin_family = AF_INET;
+        serv_addr.sin_port = htons(short(port));
+
+        if (inet_pton(AF_INET,address.c_str(), &serv_addr.sin_addr) <= 0) {
+            Err("incorrect network address\n");
+            return 0;
+        }
+
+        memset(&(serv_addr.sin_zero), '\0', 8);
+
+        if (UDT::ERROR == UDT::connect(new_fd, (sockaddr*)&serv_addr, sizeof(serv_addr))) {
+            //Printf("connect error: %s %i\n",UDT::getlasterror().getErrorMessage(),UDT::getlasterror().getErrorCode());
+            UDT::close(new_fd);
+            if(UDT::getlasterror().getErrorCode()!=1001 && UDT::getlasterror().getErrorCode()!=1002) {
+                Err("connect error: %s\n",UDT::getlasterror().getErrorMessage());
+                return 0;
+            }
+        } else {
+            //printf("connected to %s:%i\n",inet_ntoa(serv_addr.sin_addr),serv_addr.sin_port);
+            return new_fd;
+        }
+    }
+}
+
+#ifdef __XENO__
+int FrameworkManager_impl::CreatePipe(RT_PIPE* fd,string name)
+{
+    name=self->ObjectName()+ "-" + name;
+    //xenomai limitation
+    if(name.size()>31) self->Err("rt_pipe_create error (%s is too long)\n",name.c_str());
+    //start log writter
+#ifdef RT_PIPE_SIZE
+    return rt_pipe_create(fd, name.c_str(), P_MINOR_AUTO,RT_PIPE_SIZE);
+#else
+    return rt_pipe_create(fd, name.c_str(), P_MINOR_AUTO,0);
+#endif
+}
+#else
+int FrameworkManager_impl::CreatePipe(int (*fd)[2],string name)
+{
+    //if(pipe2(fd[0],O_NONBLOCK) == -1)
+    if(pipe(fd[0]) == -1)
+    {
+        return errno;
+    }
+    else
+    {
+        int attr=fcntl((*fd)[0], F_GETFL,0);
+        if(attr == -1)
+        {
+            return errno;
+        }
+        if(fcntl((*fd)[0], F_SETFL, attr|O_NONBLOCK)== -1)
+        {
+            return errno;
+        }
+        attr=fcntl((*fd)[1], F_GETFL,0);
+        if(attr == -1)
+        {
+            return errno;
+        }
+        if(fcntl((*fd)[1], F_SETFL, attr|O_NONBLOCK)== -1)
+        {
+            return errno;
+        }
+
+        return 0;
+    }
+}
+#endif
+
+#ifdef __XENO__
+int FrameworkManager_impl::DeletePipe(RT_PIPE* fd)
+{
+    return rt_pipe_delete(fd);
+}
+#else
+int FrameworkManager_impl::DeletePipe(int (*fd)[2])
+{
+    int status1=close((*fd)[0]);
+    int status2=close((*fd)[1]);
+    if(status1==0 && status2==0) return 0;
+    if(status1!=0) return status1;
+    if(status2!=0) return status2;
+}
+#endif
+
+void FrameworkManager_impl::SetupLogger(string log_path) {
+    if(logger_defined==true) {
+        Warn("SetupLogger() was already called.\n");
+        return;
+    }
+
+    this->log_path=log_path;
+
+    int status=CreatePipe(&cmd_pipe,"log_cmd");
+    if(status!=0) {
+        Err("Error creating pipe (%s)\n",strerror(-status));
+        return;
+    }
+
+    status=CreatePipe(&data_pipe,"log_data");
+    if(status!=0) {
+        Err("Error creating pipe (%s)\n",strerror(-status));
+        return;
+    }
+
+#ifdef __XENO__
+    string tmp_name;
+    tmp_name=self->ObjectName() + "-log_heap";
+    status=rt_heap_create(&log_heap,tmp_name.c_str(),LOG_HEAP,H_FIFO);
+    if(status!=0) {
+        Err("rt_heap_create error (%s)\n",strerror(-status));
+        return;
+    }
+#endif //__XENO__
+
+    continuer=true;
+
+#ifdef NRT_STACK_SIZE
+    // Initialize thread creation attributes
+    pthread_attr_t attr;
+    if(pthread_attr_init(&attr) != 0) {
+        Err("pthread_attr_init error\n");
+        return;
+    }
+
+    if(pthread_attr_setstacksize(&attr, NRT_STACK_SIZE) != 0) {
+       Err("pthread_attr_setstacksize error\n");
+       return;
+    }
+
+    if(pthread_create(&log_th,  &attr, write_log_user, (void*)this) < 0)
+#else
+    if(pthread_create(&log_th, NULL, write_log_user, (void*)this) < 0)
+#endif
+    {
+        Err("pthread_create error\n");
+        return;
+    }
+#ifdef NRT_STACK_SIZE
+    if(pthread_attr_destroy(&attr) != 0) {
+        Err("pthread_attr_destroy error\n");
+        return;
+    }
+#endif
+
+    logger_defined=true;
+}
+
+void FrameworkManager_impl::AddDeviceToLog(IODevice *device)
+{
+    if(logger_defined==false)
+    {
+        Err("SetupLogger() was not called, not starting log\n");
+        return;
+    }
+
+    if(is_logging==false)
+    {
+        if(device->pimpl_->SetToBeLogged()) {
+            log_desc_t tmp;
+            tmp.device=device;
+            logs.push_back(tmp);
+        } else {
+            Warn("not adding it twice\n");
+        }
+    }
+    else
+    {
+        Err("impossible while logging\n");
+    }
+}
+
+void FrameworkManager_impl::StartLog(void)
+{
+    if(logger_defined==false)
+    {
+        Err("SetupLogger() was not called, not starting log\n");
+        return;
+    }
+
+    ssize_t written;
+    size_t nb_err=0;
+
+    if(logs.size()==0)
+    {
+        Warn("Not starting log: nothing to log!\n");
+        return;
+    }
+
+    if(is_logging==false)
+    {
+        for(size_t i=0;i<logs.size();i++)
+        {
+
+            logs.at(i).running=true;
+            logs.at(i).dbtFile=NULL;
+            logs.at(i).size=logs.at(i).device->pimpl_->LogSize();
+#ifdef __XENO__
+            written=rt_pipe_write(&cmd_pipe,&logs.at(i),sizeof(log_desc_t),P_NORMAL);
+#else
+            written=write(cmd_pipe[1],&logs.at(i),sizeof(log_desc_t));
+#endif
+
+            if(written<0)
+            {
+                Err("write pipe error (%s)\n",strerror(-written));
+                nb_err++;
+                logs.at(i).running=false;
+            }
+            else if (written != sizeof(log_desc_t))
+            {
+                Err("write pipe error %ld/%ld\n",written,sizeof(log_desc_t));
+                nb_err++;
+                logs.at(i).running=false;
+            }
+        }
+
+        if(nb_err!=logs.size()) is_logging=true;
+    }
+    else
+    {
+        Warn("Already logging\n");
+    }
+}
+
+void FrameworkManager_impl::StopLog(void)
+{
+    ssize_t written;
+
+    if(is_logging==true)
+    {
+        for(size_t i=0;i<logs.size();i++)
+        {
+            logs.at(i).running=false;
+        }
+        //send only one running false condition, user thread will stop and send all
+#ifdef __XENO__
+        written=rt_pipe_write(&cmd_pipe,&logs.at(0),sizeof(log_desc_t),P_NORMAL);
+#else
+        written=write(cmd_pipe[1],&logs.at(0),sizeof(log_desc_t));
+#endif
+
+        if(written<0)
+        {
+            Err("write pipe error (%s)\n",strerror(-written));
+            return;
+        }
+        else if (written != sizeof(log_desc_t))
+        {
+            Err("write pipe error %ld/%ld\n",written,sizeof(log_desc_t));
+            return;
+        }
+
+        is_logging=false;
+    }
+    else
+    {
+        Warn("Not logging\n");
+    }
+}
+
+char* FrameworkManager_impl::GetBuffer(size_t sz)
+{
+    //Printf("alloc %i\n",sz);
+#ifdef __XENO__
+    void *ptr;
+    int status=rt_heap_alloc(&log_heap,sz,TM_NONBLOCK ,&ptr);
+    if(status!=0)
+    {
+        Err("rt_heap_alloc error (%s)\n",strerror(-status));
+        ptr=NULL;
+    }
+    return (char*)ptr;
+#else
+    return (char*)malloc(sz);
+#endif
+}
+
+void FrameworkManager_impl::ReleaseBuffer(char* buf)
+{
+#ifdef __XENO__
+    int status=rt_heap_free(&log_heap,buf);
+
+    if(status!=0)
+    {
+        Err("rt_heap_free error (%s)\n",strerror(-status));
+    }
+#else
+    free(buf);
+#endif
+}
+
+void FrameworkManager_impl::WriteLog(const char* buf,size_t size)
+{
+    ssize_t written;
+
+#ifdef __XENO__
+    written=rt_pipe_write(&data_pipe,buf,size,P_NORMAL);
+#else
+    written=write(data_pipe[1],buf,size);
+#endif
+
+    if(written<0)
+    {
+        Err("erreur write pipe (%s)\n",strerror(-written));
+    }
+    else if (written != (ssize_t)size)
+    {
+        Err("erreur write pipe %ld/%ld\n",written,size);
+    }
+}
+
+void* FrameworkManager_impl::write_log_user(void * arg)
+{
+    int cmd_pipe=-1;
+    int data_pipe=-1;
+    string filename;
+    fd_set set;
+    struct timeval timeout;
+    FrameworkManager_impl *caller = (FrameworkManager_impl*)arg;
+    int rv;
+
+    vector<log_desc_t> logs;
+
+#ifdef __XENO__
+    filename=NRT_PIPE_PATH+ caller->self->ObjectName() + "-log_cmd";
+    while(cmd_pipe<0)
+    {
+        cmd_pipe = open(filename.c_str(), O_RDWR);
+        if (cmd_pipe < 0 && errno!=ENOENT) caller->self->Err("open rt_pipe error: %s %i\n",filename.c_str(),errno);
+        usleep(1000);
+    }
+    filename=NRT_PIPE_PATH+ caller->self->ObjectName() + "-log_data";
+    while(data_pipe<0)
+    {
+        data_pipe = open(filename.c_str(), O_RDWR);
+        if (data_pipe < 0 && errno!=ENOENT) caller->self->Err("open rt_pipe error: %s %i\n",filename.c_str(),errno);
+        usleep(1000);
+    }
+#else
+    cmd_pipe=caller->cmd_pipe[0];
+    data_pipe=caller->data_pipe[0];
+#endif
+
+    while(caller->continuer==true)
+    {
+        FD_ZERO(&set);
+        FD_SET(cmd_pipe, &set);
+        FD_SET(data_pipe, &set);
+
+        timeout.tv_sec = 0;
+        timeout.tv_usec = SELECT_TIMEOUT_MS*1000;
+        rv = select(FD_SETSIZE, &set, NULL, NULL, &timeout);
+
+        if(rv == -1)
+        {
+            caller->Err("select error\n"); // an error accured
+        }
+        else if(rv == 0)
+        {
+            //printf("timeout write_log_user %s\n",caller->ObjectName().c_str()); // a timeout occured
+        }
+        else
+        {
+            if(FD_ISSET(cmd_pipe, &set))
+            {
+                log_desc_t tmp;
+                read(cmd_pipe,&tmp,sizeof(log_desc_t));
+
+                if(tmp.running==true)//start logging
+                {
+                    filename= caller->log_path + "/" +caller->FileName(tmp.device)+ ".dbt";
+                    printf("Creating log file %s (log size %i)\n",filename.c_str(), (int)tmp.size);
+                    tmp.dbtFile = inithdFile((char*)filename.c_str(),UAV,tmp.size);
+                    logs.push_back(tmp);
+
+                    if(logs.size()==1)
+                    {
+                        filename= caller->log_path + "/setup.xml";
+                        xmlSaveFile(filename.c_str(),caller->file_doc);
+                    }
+                }
+                else//stop logging
+                {
+                    for(size_t i=0;i<logs.size();i++)
+                    {
+                        if(logs.at(i).dbtFile!=NULL)
+                        {
+                            close_hdfile(logs.at(i).dbtFile);
+
+                            filename= caller->FileName(logs.at(i).device)+ ".dbt";
+                            caller->SendFile(caller->log_path,filename);
+
+                            fstream txt_file;
+                            filename= caller->FileName(logs.at(i).device)+ ".txt";
+                            txt_file.open((caller->log_path+"/"+filename).c_str(),fstream::out);
+                            txt_file << "1: time (us)\n2: time (ns)\n";
+                            int index=3;
+                            logs.at(i).device->pimpl_->WriteLogsDescriptors(txt_file,&index);
+                            txt_file.close();
+
+                            caller->SendFile(caller->log_path,filename);
+                        }
+                    }
+                    //a revoir celui ci est le xml enregistré et pas forcement l'actuel
+                    //if(caller->xml_file!="") caller->SendFile(caller->xml_file);
+                    caller->FinishSending();
+
+                    logs.clear();
+                }
+            }
+
+            if(FD_ISSET(data_pipe, &set))
+            {
+                log_header_t header;
+                read(data_pipe,&header,sizeof(log_header_t));
+
+                for(size_t i=0;i<logs.size();i++)
+                {
+                    if(logs.at(i).device==header.device)
+                    {
+                        char* buf=(char*)malloc(header.size);
+                        read(data_pipe,buf,header.size);
+//printf("%s \n",header.device->ObjectName().c_str());
+//for(int i=0;i<header.size;i++) printf("%x ",buf[i]);
+//printf("\n");
+                        if(logs.at(i).size==header.size)
+                        {
+                            if(logs.at(i).dbtFile!=NULL)
+                            {
+                                write_hdfile(logs.at(i).dbtFile,buf,(road_time_t)(header.time/1000),(road_timerange_t)(header.time%1000),header.size);
+                            }
+                            else
+                            {
+                                printf("err\n");
+                            }
+                        }
+                        else
+                        {
+                            caller->self->Err("%s log size is not correct %i/%i\n",header.device->ObjectName().c_str(),header.size,logs.at(i).size);
+                        }
+                        free(buf);
+                    }
+                }
+            }
+        }
+    }
+
+#ifdef __XENO__
+    close(cmd_pipe);
+    close(data_pipe);
+#endif
+
+    pthread_exit(0);
+
+}
+
+string FrameworkManager_impl::FileName(IODevice* device)
+{
+    return getFrameworkManager()->ObjectName() + "_"+device->ObjectName();
+}
+
+void FrameworkManager_impl::PrintXml(void) const
+{
+    xmlChar *xmlbuff;
+    int buffersize;
+    xmlDocDumpFormatMemory(file_doc, &xmlbuff, &buffersize, 1);
+    Printf("xml:\n%s\n",xmlbuff);
+    xmlFree(xmlbuff);
+}
Index: /trunk/lib/FlairCore/src/GeoCoordinate.cpp
===================================================================
--- /trunk/lib/FlairCore/src/GeoCoordinate.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/GeoCoordinate.cpp	(revision 2)
@@ -0,0 +1,80 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/07/29
+//  filename:   GeoCoordinate.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a point by its lla coordinates
+//
+//
+/*********************************************************************/
+
+#include "GeoCoordinate.h"
+
+using std::string;
+
+namespace flair
+{
+namespace core
+{
+
+GeoCoordinate::GeoCoordinate(const Object* parent,string name,const GeoCoordinate *point,int n): io_data(parent,name,n)
+{
+    if(n>1) Warn("n>1 not supported\n");
+    CopyFrom(point);
+}
+
+GeoCoordinate::GeoCoordinate(const Object* parent,string name,double latitude,double longitude,double altitude,int n): io_data(parent,name,n)
+{
+    this->latitude=latitude;
+    this->longitude=longitude;
+    this->altitude=altitude;
+}
+
+GeoCoordinate::~GeoCoordinate()
+{
+
+}
+
+void GeoCoordinate::CopyFrom(const GeoCoordinate *point)
+{
+    double latitude,longitude,altitude;
+    point->GetCoordinates(&latitude,&longitude,&altitude);
+    GetMutex();
+    this->latitude=latitude;
+    this->longitude=longitude;
+    this->altitude=altitude;
+    ReleaseMutex();
+}
+
+void GeoCoordinate::SetCoordinates(double latitude,double longitude,double altitude)
+{
+    GetMutex();
+    this->latitude=latitude;
+    this->longitude=longitude;
+    this->altitude=altitude;
+    ReleaseMutex();
+}
+
+void GeoCoordinate::GetCoordinates(double *latitude,double *longitude,double *altitude) const
+{
+    GetMutex();
+    *latitude=this->latitude;
+    *longitude=this->longitude;
+    *altitude=this->altitude;
+    ReleaseMutex();
+}
+
+void GeoCoordinate::CopyDatas(char* ptr) const
+{
+    Warn("a ecrire");
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/GeoCoordinate.h
===================================================================
--- /trunk/lib/FlairCore/src/GeoCoordinate.h	(revision 2)
+++ /trunk/lib/FlairCore/src/GeoCoordinate.h	(revision 2)
@@ -0,0 +1,111 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file GeoCoordinate.h
+ * \brief Class defining a point by its lla coordinates
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/07/29
+ * \version 4.0
+ */
+#ifndef GEOCOORDINATE_H
+#define GEOCOORDINATE_H
+
+#include <io_data.h>
+
+namespace flair { namespace core {
+
+    /*! \class GeoCoordinate
+    *
+    * \brief Class defining a point by its lla coordinates
+    */
+    class GeoCoordinate: public io_data {
+        public:
+            class Type: public DataType {
+            public:
+                size_t GetSize() const {
+                    return sizeof(latitude)+sizeof(longitude)+sizeof(altitude);
+                }
+                std::string GetDescription() const {return "lla";}
+            };
+
+            /*!
+            * \brief Constructor
+            *
+            * Construct GeoCoordinate using values from another class.
+            *
+            * \param parent parent
+            * \param name name
+            * \param point class to copy
+            * \param n number of samples
+            */
+            GeoCoordinate(const Object* parent,std::string name,const GeoCoordinate *point,int n=1);
+
+            /*!
+            * \brief Constructor
+            *
+            * Construct GeoCoordinate using specified values.
+            *
+            * \param parent parent
+            * \param name name
+            * \param latitude latitude
+            * \param longitude longitude
+            * \param altitude altitude
+            * \param n number of samples
+            */
+            GeoCoordinate(const Object* parent,std::string name,double latitude,double longitude,double altitude,int n=1);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~GeoCoordinate();
+
+            /*!
+            * \brief Copy
+            *
+            * \param point class to copy
+            */
+            void CopyFrom(const GeoCoordinate *point);
+
+            /*!
+            * \brief Set coordinates
+            *
+            * \param latitude latitude
+            * \param longitude longitude
+            * \param altitude altitude
+            */
+            void SetCoordinates(double latitude,double longitude,double altitude);
+
+            /*!
+            * \brief Get coordinates
+            *
+            * \param latitude latitude
+            * \param longitude longitude
+            * \param altitude altitude
+            */
+            void GetCoordinates(double *latitude,double *longitude,double *altitude) const;
+
+            Type const &GetDataType() const {return dataType;}
+        private:
+            /*!
+            * \brief Copy datas
+            *
+            * Reimplemented from io_data. \n
+            * See io_data::CopyDatas.
+            *
+            * \param dst destination buffer
+            */
+            void CopyDatas(char* ptr) const;
+
+            double latitude;
+            double longitude;
+            double altitude;
+            Type dataType;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // GEOCOORDINATE_H
Index: /trunk/lib/FlairCore/src/GridLayout.cpp
===================================================================
--- /trunk/lib/FlairCore/src/GridLayout.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/GridLayout.cpp	(revision 2)
@@ -0,0 +1,42 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   GridLayout.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QGridLayout on the ground station
+//
+//
+/*********************************************************************/
+#include "GridLayout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+GridLayout::GridLayout(const LayoutPosition* position,string name): Layout(position->getLayout(),name,"GridLayout")
+{
+    SetVolatileXmlProp("row",position->Row());
+    SetVolatileXmlProp("col",position->Col());
+    SendXml();
+
+    delete position;
+}
+
+GridLayout::~GridLayout()
+{
+
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/GridLayout.h
===================================================================
--- /trunk/lib/FlairCore/src/GridLayout.h	(revision 2)
+++ /trunk/lib/FlairCore/src/GridLayout.h	(revision 2)
@@ -0,0 +1,57 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file GridLayout.h
+ * \brief Class displaying a QGridLayout on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef GRIDLAYOUT_H
+#define GRIDLAYOUT_H
+
+#include <Layout.h>
+
+namespace flair
+{
+namespace gui
+{
+    class LayoutPosition;
+
+    /*! \class GridLayout
+    *
+    * \brief Class displaying a QGridLayout on the ground station
+    *
+    */
+    class GridLayout: public Layout
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a QCheckBox at given position. \n
+            * The GridLayout will automatically be child of position->getLayout() Layout. After calling this constructor,
+            * position will be deleted as it is no longer usefull.
+            *
+            * \param parent parent
+            * \param name name
+
+            */
+            GridLayout(const LayoutPosition* position,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~GridLayout();
+
+        private:
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // GRIDLAYOUT_H
Index: /trunk/lib/FlairCore/src/GroupBox.cpp
===================================================================
--- /trunk/lib/FlairCore/src/GroupBox.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/GroupBox.cpp	(revision 2)
@@ -0,0 +1,42 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   GroupBox.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QGroupBox on the ground station
+//
+//
+/*********************************************************************/
+#include "GroupBox.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+GroupBox::GroupBox(const LayoutPosition* position,string name): Layout(position->getLayout(),name,"GroupBox")
+{
+    SetVolatileXmlProp("row",position->Row());
+    SetVolatileXmlProp("col",position->Col());
+    SendXml();
+
+    delete position;
+}
+
+GroupBox::~GroupBox()
+{
+
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/GroupBox.h
===================================================================
--- /trunk/lib/FlairCore/src/GroupBox.h	(revision 2)
+++ /trunk/lib/FlairCore/src/GroupBox.h	(revision 2)
@@ -0,0 +1,56 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file GroupBox.h
+ * \brief Class displaying a QGroupBox on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef GROUPBOX_H
+#define GROUPBOX_H
+
+#include <Layout.h>
+
+namespace flair
+{
+namespace gui
+{
+    class LayoutPosition;
+
+    /*! \class GroupBox
+    *
+    * \brief Class displaying a QGroupBox on the ground station
+    *
+    */
+    class GroupBox: public Layout
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a QGroupBox at given position. \n
+            * The GroupBox will automatically be child of position->getLayout() Layout. After calling this constructor,
+            * position will be deleted as it is no longer usefull.
+            *
+            * \param position position
+            * \param name name
+            */
+            GroupBox(const LayoutPosition* position,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~GroupBox();
+
+        private:
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // GROUPBOX_H
Index: /trunk/lib/FlairCore/src/I2cPort.h
===================================================================
--- /trunk/lib/FlairCore/src/I2cPort.h	(revision 2)
+++ /trunk/lib/FlairCore/src/I2cPort.h	(revision 2)
@@ -0,0 +1,102 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file I2cPort.h
+ * \brief Base class for i2c port
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/04/24
+ * \version 4.0
+ */
+
+#ifndef I2CPORT_H
+#define I2CPORT_H
+
+#include <Mutex.h>
+#include <stdint.h>
+
+namespace flair
+{
+namespace core
+{
+    /*! \class I2cPort
+    *
+    * \brief Base class for i2c port
+    *
+    * This class has a Mutex which must be used to protect access to the port in case
+    * that more than one Thread is using it. Lock the Mutex before any communication (including SetSlave)
+    * and release it after communication.
+    */
+    class I2cPort: public Mutex
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an i2c port.
+            *
+            * \param parent parent
+            * \param name name
+            */
+            I2cPort(const Object* parent,std::string name): Mutex(parent,name)
+            {}
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~I2cPort(){};
+
+            /*!
+            * \brief Set slave's address
+            *
+            * This function need to be called before any communication.
+            *
+            * \param address slave's address
+            */
+            virtual int SetSlave(uint16_t address)=0;
+
+            /*!
+            * \brief Write datas
+            *
+            * \param buf pointer to datas
+            * \param nbyte length of datas
+            *
+            * \return amount of written datas
+            */
+            virtual ssize_t Write(const void *buf,size_t nbyte)=0;
+
+            /*!
+            * \brief Read datas
+            *
+            * \param buf pointer to datas
+            * \param nbyte length of datas
+            *
+            * \return amount of read datas
+            */
+            virtual ssize_t Read(void *buf,size_t nbyte)=0;
+
+            /*!
+            * \brief Set RX timeout
+            *
+            * Timeout for waiting an ACK from the slave.
+            *
+            * \param timeout_ns timeout in nano second
+            */
+            virtual void SetRxTimeout(Time timeout_ns)=0;
+
+            /*!
+            * \brief Set TX timeout
+            *
+            * Timeout for waiting an ACK from the slave.
+            *
+            * \param timeout_ns timeout in nano second
+            */
+            virtual void SetTxTimeout(Time timeout_ns)=0;
+
+    };
+} // end namespace core
+} // end namespace framework
+
+#endif // I2CPORT_H
Index: /trunk/lib/FlairCore/src/IODataElement.h
===================================================================
--- /trunk/lib/FlairCore/src/IODataElement.h	(revision 2)
+++ /trunk/lib/FlairCore/src/IODataElement.h	(revision 2)
@@ -0,0 +1,64 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file IODataElement.h
+ * \brief Abstract class for accessing an element of an io_data.
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/11/26
+ * \version 4.0
+ */
+
+#ifndef IODATAELEMENT_H
+#define IODATAELEMENT_H
+
+#include "io_data.h"
+
+namespace flair { namespace core {
+
+    class DataType;
+
+    /*! \class IODataElement
+    *
+    * \brief Abstract class for accessing an element of an io_data.
+    */
+    class IODataElement: public Object
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an IODataElement. \n
+            *
+            */
+            IODataElement(const io_data* parent,std::string name): Object(parent,name)
+            {
+                this->parent=parent;
+            }
+            size_t Size() const
+            {
+                return size;
+            }
+
+            virtual void CopyData(char* dst) const=0;
+
+            /*!
+            * \brief DataType
+            *
+            * \return type of data
+            */
+            virtual DataType const &GetDataType(void) const=0;
+
+        protected:
+            size_t size;
+
+        private:
+            const io_data* parent;
+
+    };
+
+} // end namespace core
+} // end namespace framework
+
+#endif // IODATAELEMENT_H
Index: /trunk/lib/FlairCore/src/IODevice.cpp
===================================================================
--- /trunk/lib/FlairCore/src/IODevice.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/IODevice.cpp	(revision 2)
@@ -0,0 +1,85 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   IODevice.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class for input/ouput system
+//
+//
+/*********************************************************************/
+
+#include "IODevice.h"
+#include "IODevice_impl.h"
+#include "io_data.h"
+#include "io_data_impl.h"
+#include "FrameworkManager.h"
+
+using std::string;
+
+namespace flair
+{
+namespace core
+{
+
+IODevice::IODevice(const Object* parent,string name): Object(parent,name,"IODevice")
+{
+    pimpl_=new IODevice_impl(this);
+}
+
+IODevice::~IODevice()
+{
+    delete pimpl_;
+}
+
+void IODevice::AddDeviceToLog(const IODevice* device)
+{
+    pimpl_->AddDeviceToLog(device);
+}
+
+void IODevice::OutputToShMem(bool enabled) {
+    pimpl_->OutputToShMem(enabled);
+}
+
+void IODevice::ProcessUpdate(io_data* data)
+{
+    if(data!=NULL) data->pimpl_->SetConsistent(true);
+
+    for(size_t i=0;i<TypeChilds()->size();i++)
+    {
+        ((IODevice*)TypeChilds()->at(i))->UpdateFrom(data);
+    }
+
+    if(data!=NULL)
+    {
+        if(getFrameworkManager()->IsLogging()==true) pimpl_->WriteLog(data->DataTime());
+
+        data->pimpl_->Circle();
+    }
+
+    pimpl_->WriteToShMem();
+
+    pimpl_->ResumeThread();
+}
+
+void IODevice::AddDataToLog(const io_data* data)
+{
+    pimpl_->AddDataToLog(data);
+}
+
+DataType const &IODevice::GetInputDataType() const {
+    return dummyType;
+}
+
+DataType const &IODevice::GetOutputDataType() const {
+    return dummyType;
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/IODevice.h
===================================================================
--- /trunk/lib/FlairCore/src/IODevice.h	(revision 2)
+++ /trunk/lib/FlairCore/src/IODevice.h	(revision 2)
@@ -0,0 +1,142 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file IODevice.h
+ * \brief Abstract class for input/ouput system
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef IO_DEVICE_H
+#define IO_DEVICE_H
+
+#include <Object.h>
+
+class IODevice_impl;
+class Thread_impl;
+class FrameworkManager_impl;
+
+namespace flair { namespace core {
+
+    class io_data;
+    class DataType;
+
+    /*! \class IODevice
+    *
+    * \brief Abstract class for input/ouput system
+    *
+    * An input/output system is generally used to describe a sensor, an actuator or a filter. \n
+    * These systems can be linked (for exemple a sensor with a filter), when an IODevice
+    * is created with a parent of type IODevice.
+    * In this case, an update of the parent's data will call an update
+    * of the child's data (for exemple when a sensor gets new datas, a filter is automatically called). \n
+    * Output of this object can also be sent to a shared memory using the OutputToShMem method; in order to use it with an
+    * external program.
+    */
+    class IODevice: public Object {
+        friend class ::IODevice_impl;
+        friend class ::Thread_impl;
+        friend class ::FrameworkManager_impl;
+
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an IODevice of Object's type "IODevice" (see Object::ObjectType). \n
+            * If parent's Object::ObjectType is also "IODevice", this IODevice will be linked to its parent
+            * (see ProcessUpdate()).
+            *
+            * \param parent parent
+            * \param name name
+            */
+            IODevice(const Object* parent,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            virtual ~IODevice();
+
+            /*!
+            * \brief Add an IODevice to the logs
+            *
+            * The IODevice will be automatically logged among this IODevice logs,
+            * if logging is enabled (see SetDataToLog(), FrameworkManager::StartLog
+            * and FrameworkManager::AddDeviceToLog). \n
+            * Logging happens when ProcessUpdate() is called. \n
+            * Note that when an IODevice is just added for logs (ie. no parent/child
+            * link between the two IODevice),
+            * UpdateFrom() is not automatically called.
+            *
+            * \param device IODevice to log
+            */
+            void AddDeviceToLog(const IODevice* device);
+
+            /*!
+            * \brief Add an io_data to the log
+            *
+            * The io_data will be automatically logged if enabled (see FrameworkManager::StartLog
+            * and FrameworkManager::AddDeviceToLog),
+            * during call to ProcessUpdate().
+            *
+            * \param data data to log
+            */
+            void AddDataToLog(const io_data* data);
+
+            /*!
+            * \brief Send the output to a shared memory
+            *
+            * Use this method to output log datas to a shared memory.
+            * This can be usefull to get datas from an external progam. \n
+            * Output happens when ProcessUpdate() is called. \n
+            * The name and the structure of the shared memory will be displayed when
+            * this method is called with true as argument. \n
+            * By default it is not enabled.
+            *
+            *
+            * \param enabled true to enable the output, false otherwise
+            */
+            void OutputToShMem(bool enabled);
+
+            //TODO: these 2 method should be pure virtual
+            virtual DataType const &GetInputDataType() const;
+            virtual DataType const &GetOutputDataType() const;
+
+        protected:
+            /*!
+            * \brief Process the childs of type IODevice, and log if needed
+            *
+            * This method must be called after computing datas;
+            * generally at the end of the reimplemented UpdateFrom or after acquiring datas in case of a sensor. \n
+            * It will call UpdateFrom methods of each child of type IODevice,
+            * and log all datas (this IODevice and its childs)
+            * if logging is enabled (see SetDataToLog(), AddDeviceToLog(),
+            * FrameworkManager::StartLog and FrameworkManager::AddDeviceToLog). \n
+            * If a thread is waiting on this IODevice (see Thread::WaitUpdate), it will be resumed.
+            *
+            * \param data data to process
+            */
+            void ProcessUpdate(io_data* data);
+
+        private:
+            /*!
+            * \brief Update using provided datas
+            *
+            * This method is automatically called by ProcessUpdate()
+            * of the Object::Parent's if its Object::ObjectType is "IODevice". \n
+            * This method must be reimplemented, in order to process the data from the parent.
+            *
+            * \param data data from the parent to process
+            */
+            virtual void UpdateFrom(const io_data *data)=0;
+
+            class IODevice_impl* pimpl_;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // IO_DEVICE_H
Index: /trunk/lib/FlairCore/src/IODevice_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/IODevice_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/IODevice_impl.cpp	(revision 2)
@@ -0,0 +1,219 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   IODevice.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe de base avec entrees sorties
+//
+//
+/*********************************************************************/
+
+#include "IODevice_impl.h"
+#include "IODevice.h"
+#include "io_data.h"
+#include "io_data_impl.h"
+#include "Thread.h"
+#include "Mutex.h"
+#include "FrameworkManager.h"
+#include "FrameworkManager_impl.h"
+#include "SharedMem.h"
+#include <string.h>
+
+using std::string;
+using std::fstream;
+using namespace flair::core;
+
+IODevice_impl::IODevice_impl(const IODevice* self) {
+    this->self=self;
+    thread_to_wake=NULL;
+    wake_mutex= new Mutex(self);
+    framework_impl=::getFrameworkManagerImpl();
+    framework=getFrameworkManager();
+    tobelogged=false;
+    outputtoshm=false;
+}
+
+IODevice_impl::~IODevice_impl() {}
+
+void IODevice_impl::OutputToShMem(bool enabled) {
+    if(framework->IsLogging()) {
+        self->Err("impossible while logging\n");
+    } else {
+        if(LogSize()==0) {
+            self->Warn("log size is null, not enabling output to shared memory.");
+            return;
+        }
+
+        if(enabled) {
+            string dev_name=getFrameworkManager()->ObjectName()+ "-" + self->ObjectName();
+            shmem=new SharedMem(self,dev_name.c_str(),LogSize());
+            outputtoshm=true;
+
+            Printf("Created %s shared memory for object %s; size: %i\n",dev_name.c_str(),self->ObjectName().c_str(),LogSize());
+            PrintLogsDescriptors();
+        } else {
+            outputtoshm=false;
+            delete shmem;
+        }
+    }
+}
+
+void IODevice_impl::PrintLogsDescriptors(void) {
+    //own logs
+    for(size_t i=0;i<datasToLog.size();i++) datasToLog.at(i)->pimpl_->PrintLogDescriptor();
+    //childs logs
+    for(size_t i=0;i<self->TypeChilds()->size();i++) ((IODevice*)self->TypeChilds()->at(i))->pimpl_->PrintLogsDescriptors();
+    //manually added logs
+    for(size_t i=0;i<devicesToLog.size();i++) devicesToLog.at(i)->pimpl_->PrintLogsDescriptors();
+}
+
+void IODevice_impl::WriteToShMem(void) {
+    if(outputtoshm) {
+        size_t size=LogSize();
+
+        char* buf=framework_impl->GetBuffer(size);
+        char* buf_orig=buf;
+        if(buf==NULL) {
+            self->Err("err GetBuffer\n");
+            return;
+        }
+
+        AppendLog(&buf);
+
+        shmem->Write(buf_orig,size);
+        framework_impl->ReleaseBuffer(buf_orig);
+    }
+}
+
+void IODevice_impl::AddDeviceToLog(const IODevice* device) {
+    if(framework->IsLogging()) {
+        self->Err("impossible while logging\n");
+    } else {
+        devicesToLog.push_back(device);
+    }
+}
+
+bool IODevice_impl::SetToBeLogged(void) {
+    if(!tobelogged) {
+        tobelogged=true;
+        return true;
+    } else {
+        self->Warn("already added to log\n");
+        return false;
+    }
+}
+
+void IODevice_impl::WriteLogsDescriptors(fstream& desc_file,int *index) {
+    //own descriptor
+    for(size_t i=0;i<datasToLog.size();i++) datasToLog.at(i)->pimpl_->WriteLogDescriptor(desc_file,index);
+    //childs descriptors
+    for(size_t i=0;i<self->TypeChilds()->size();i++) ((IODevice*)self->TypeChilds()->at(i))->pimpl_->WriteLogsDescriptors(desc_file,index);
+    //manually added logs
+    for(size_t i=0;i<devicesToLog.size();i++) devicesToLog.at(i)->pimpl_->WriteLogsDescriptors(desc_file,index);
+}
+
+void IODevice_impl::ResumeThread(void) {
+    wake_mutex->GetMutex();
+    if(thread_to_wake!=NULL) {
+        thread_to_wake->Resume();
+        thread_to_wake=NULL;
+    }
+    wake_mutex->ReleaseMutex();
+}
+
+void IODevice_impl::AddDataToLog(const io_data* data) {
+    if(framework->IsLogging()) {
+        self->Err("impossible while logging\n");
+    } else {
+        datasToLog.push_back(data);
+    }
+}
+
+size_t IODevice_impl::LogSize() const {
+    size_t value=0;
+
+    for(size_t i=0;i<datasToLog.size();i++) {
+        value+=datasToLog.at(i)->GetDataType().GetSize();
+    }
+
+    //childs logs
+    for(size_t i=0;i<self->TypeChilds()->size();i++) {
+        value+=((IODevice*)self->TypeChilds()->at(i))->pimpl_->LogSize();
+    }
+    //manually added logs
+    for(size_t i=0;i<devicesToLog.size();i++) {
+        value+=devicesToLog.at(i)->pimpl_->LogSize();
+    }
+
+    return value;
+}
+
+void IODevice_impl::WriteLog(Time time) {
+    if(tobelogged==false) return;
+
+    size_t size=LogSize();
+
+    char* buf=framework_impl->GetBuffer(sizeof(FrameworkManager_impl::log_header_t)+size);
+    char* buf_orig=buf;
+    if(buf==NULL) {
+        self->Err("err GetBuffer\n");
+        return;
+    }
+
+    FrameworkManager_impl::log_header_t header;
+    header.device=self;
+    header.size=size;
+    header.time=time;
+
+    memcpy(buf,&header,sizeof(FrameworkManager_impl::log_header_t));
+    buf+=sizeof(FrameworkManager_impl::log_header_t);
+    AppendLog(&buf);
+
+    framework_impl->WriteLog(buf_orig,sizeof(FrameworkManager_impl::log_header_t)+size);
+    framework_impl->ReleaseBuffer(buf_orig);
+}
+
+void IODevice_impl::AppendLog(char** ptr)
+{
+    //Printf("AppendLog %s %x\n",self->ObjectName().c_str(),*ptr);
+
+    //copy state to buf
+    for(size_t i=0;i<datasToLog.size();i++) {
+        //printf("copy\n");
+        datasToLog.at(i)->CopyDatas(*ptr);
+        (*ptr)+=datasToLog.at(i)->GetDataType().GetSize();
+    }
+
+    //copy linked states to buf
+    for(size_t i=0;i<self->TypeChilds()->size();i++) {
+        ((IODevice*)self->TypeChilds()->at(i))->pimpl_->AppendLog(ptr);
+    }
+    //copy manually added logs to buf
+    for(size_t i=0;i<devicesToLog.size();i++) {
+        devicesToLog.at(i)->pimpl_->AppendLog(ptr);
+        //devices.at(i)->DataToLog()->CopyDatas(*ptr);
+        //(*ptr)+=devices.at(i)->DataToLog()->Size();
+    }
+    //Printf("AppendLog %s ok\n",self->ObjectName().c_str());
+}
+
+int IODevice_impl::SetToWake(const Thread* thread) {
+    int status=0;
+
+    wake_mutex->GetMutex();
+    if(thread_to_wake==NULL) {
+        thread_to_wake=(Thread*)thread;
+    } else {
+        status=-1;
+    }
+    wake_mutex->ReleaseMutex();
+
+    return status;
+}
Index: /trunk/lib/FlairCore/src/ImuData.cpp
===================================================================
--- /trunk/lib/FlairCore/src/ImuData.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/ImuData.cpp	(revision 2)
@@ -0,0 +1,250 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/01/15
+//  filename:   ImuData.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    class defining imu datas
+//
+//
+/*********************************************************************/
+
+#include "ImuData.h"
+#include "Euler.h"
+#include <math.h>
+#include <string.h>
+#include <stdlib.h>
+
+using std::string;
+
+namespace flair { namespace core {
+
+/*! \class ImuDataElement
+    */
+    class ImuDataElement: public IODataElement {
+        public:
+
+            ImuDataElement(const ImuData *inImudata,string name,ImuData::PlotableData_t inPlotableData):IODataElement(inImudata,name) {
+                imudata=inImudata;
+                plotableData=inPlotableData;
+
+                size=4;
+            }
+
+            ~ImuDataElement() {}
+
+            void CopyData(char* dst) const {
+                float data;
+                Vector3D rawAcc=imudata->GetRawAcc();
+                Vector3D rawMag=imudata->GetRawMag();
+                Vector3D rawGyr=imudata->GetRawGyr();
+                switch(plotableData) {
+                case ImuData::RawAx:
+                    data=rawAcc.x;
+                    break;
+                case ImuData::RawAy:
+                    data=rawAcc.y;
+                    break;
+                case ImuData::RawAz:
+                    data=rawAcc.z;
+                    break;
+                case ImuData::RawGx:
+                    data=rawGyr.x;
+                    break;
+                case ImuData::RawGy:
+                    data=rawGyr.y;
+                    break;
+                case ImuData::RawGz:
+                    data=rawGyr.z;
+                    break;
+                case ImuData::RawGxDeg:
+                    data=Euler::ToDegree(rawGyr.x);
+                    break;
+                case ImuData::RawGyDeg:
+                    data=Euler::ToDegree(rawGyr.y);
+                    break;
+                case ImuData::RawGzDeg:
+                    data=Euler::ToDegree(rawGyr.z);
+                    break;
+                case ImuData::RawMx:
+                    data=rawMag.x;
+                    break;
+                case ImuData::RawMy:
+                    data=rawMag.y;
+                    break;
+                case ImuData::RawMz:
+                    data=rawMag.z;
+                    break;
+                default:
+                    imudata->Err("data type unavailable.\n");
+                    data=0;
+                    break;
+                }
+
+                memcpy(dst,&data,sizeof(float));
+            }
+
+            FloatType const &GetDataType(void) const {
+                return dataType;
+            }
+
+        private:
+            const ImuData *imudata;
+            ImuData::PlotableData_t plotableData;
+            FloatType dataType;
+
+    };
+
+ImuData::ImuData(const Object* parent,std::string name,int n): io_data(parent,name,n),dataType(floatType) {
+    if(n>1) Warn("n>1 not supported\n");
+
+    AppendLogDescription("raw_ax",floatType);
+    AppendLogDescription("raw_ay",floatType);
+    AppendLogDescription("raw_az",floatType);
+
+    AppendLogDescription("raw_gx",floatType);
+    AppendLogDescription("raw_gy",floatType);
+    AppendLogDescription("raw_gz",floatType);
+
+    AppendLogDescription("raw_mx",floatType);
+    AppendLogDescription("raw_my",floatType);
+    AppendLogDescription("raw_mz",floatType);
+
+}
+
+ImuData::~ImuData() {}
+
+
+Vector3D ImuData::GetRawAcc(void) const {
+    Vector3D out;
+    GetMutex();
+    out=rawAcc;
+    ReleaseMutex();
+    return out;
+}
+
+Vector3D ImuData::GetRawMag(void) const {
+    Vector3D out;
+    GetMutex();
+    out=rawMag;
+    ReleaseMutex();
+    return out;
+}
+
+Vector3D ImuData::GetRawGyr(void) const {
+    Vector3D out;
+    GetMutex();
+    out=rawGyr;
+    ReleaseMutex();
+    return out;
+}
+
+void ImuData::GetRawAccMagAndGyr(Vector3D &inRawAcc,Vector3D &inRawMag,Vector3D &inRawGyr) const {
+    GetMutex();
+    inRawAcc=rawAcc;
+    inRawMag=rawMag;
+    inRawGyr=rawGyr;
+    ReleaseMutex();
+}
+
+void ImuData::SetRawAcc(const Vector3D &inRawAcc) {
+    GetMutex();
+    rawAcc=inRawAcc;
+    ReleaseMutex();
+}
+
+void ImuData::SetRawMag(const Vector3D &inRawMag) {
+    GetMutex();
+    rawMag=inRawMag;
+    ReleaseMutex();
+}
+
+void ImuData::SetRawGyr(const Vector3D &inRawGyr) {
+    GetMutex();
+    rawGyr=inRawGyr;
+    ReleaseMutex();
+}
+
+void ImuData::SetRawAccMagAndGyr(const Vector3D &inRawAcc,const Vector3D &inRawMag,const Vector3D &inRawGyr) {
+    GetMutex();
+    rawAcc=inRawAcc;
+    rawMag=inRawMag;
+    rawGyr=inRawGyr;
+    ReleaseMutex();
+}
+
+IODataElement* ImuData::Element(PlotableData_t data_type) const {
+    string name;
+    switch(data_type) {
+    case ImuData::RawAx:
+        name="RawAx";
+        break;
+    case ImuData::RawAy:
+        name="RawAy";
+        break;
+    case ImuData::RawAz:
+        name="RawAz";
+        break;
+    case ImuData::RawGx:
+        name="RawGx";
+        break;
+    case ImuData::RawGy:
+        name="RawGy";
+        break;
+    case ImuData::RawGz:
+        name="RawGz";
+        break;
+    case ImuData::RawGxDeg:
+        name="RawGx degree";
+        break;
+    case ImuData::RawGyDeg:
+        name="RawGy degree";
+        break;
+    case ImuData::RawGzDeg:
+        name="RawGz degree";
+        break;
+    case ImuData::RawMx:
+        name="RawMx";
+        break;
+    case ImuData::RawMy:
+        name="RawMy";
+        break;
+    case ImuData::RawMz:
+        name="RawMz";
+        break;
+    }
+
+    return new ImuDataElement(this,name,data_type);
+}
+
+void ImuData::CopyDatas(char* dst) const {
+    GetMutex();
+
+    Queue(&dst,&rawAcc.x,sizeof(rawAcc.x));
+    Queue(&dst,&rawAcc.y,sizeof(rawAcc.y));
+    Queue(&dst,&rawAcc.z,sizeof(rawAcc.z));
+
+    Queue(&dst,&rawGyr.x,sizeof(rawGyr.x));
+    Queue(&dst,&rawGyr.y,sizeof(rawGyr.y));
+    Queue(&dst,&rawGyr.z,sizeof(rawGyr.z));
+
+    Queue(&dst,&rawMag.x,sizeof(rawMag.x));
+    Queue(&dst,&rawMag.y,sizeof(rawMag.y));
+    Queue(&dst,&rawMag.z,sizeof(rawMag.z));
+
+    ReleaseMutex();
+}
+
+void ImuData::Queue(char** dst,const void *src,size_t size) const {
+    memcpy(*dst,src,size);
+    *dst+=size;
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/ImuData.h
===================================================================
--- /trunk/lib/FlairCore/src/ImuData.h	(revision 2)
+++ /trunk/lib/FlairCore/src/ImuData.h	(revision 2)
@@ -0,0 +1,209 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ImuData.h
+ * \brief Class defining IMU datas
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/01/15
+ * \version 4.0
+ */
+#ifndef IMUDATA_H
+#define IMUDATA_H
+
+#include <io_data.h>
+#include <IODataElement.h>
+#include <Vector3D.h>
+
+namespace flair { namespace core {
+
+    /*! \class ImuData
+    *
+    * \brief Class defining IMU datas
+    *
+    * IMU (inertial measurement unit) datas consist of raw accelerometer values, raw gyrometer values
+    * and raw magnetometer values.
+    *
+    */
+    class ImuData: public io_data {
+        public:
+            class Type: public DataType {
+            public:
+                Type(ScalarType const &_elementDataType):
+                    elementDataType(_elementDataType){}
+                ScalarType const &GetElementDataType() const {return elementDataType;}
+                std::string GetDescription() const {return "imu data";}
+                size_t GetSize() const {
+                    size_t size=0;
+                    size+=3*elementDataType.GetSize();//RawAcc
+                    size+=3*elementDataType.GetSize();//RawGyr
+                    size+=3*elementDataType.GetSize();//RawMag
+                    return size;
+                }
+            private:
+                ScalarType const &elementDataType;
+            };
+
+            /*!
+            \enum PlotableData_t
+            \brief Datas wich can be plotted in a DataPlot1D
+            */
+            typedef enum {
+                RawAx/*! x raw accelerometer */, RawAy/*! y raw accelerometer */ ,RawAz/*! z raw accelerometer */,
+                RawGx/*! x raw gyrometer */,RawGy/*! y raw gyrometer */,RawGz/*! z raw gyrometer */,
+                RawGxDeg/*! x raw gyrometer degree */,RawGyDeg/*! y raw gyrometer degree */,RawGzDeg/*! z raw gyrometer degree */,
+                RawMx/*! x raw magnetometer */,RawMy/*! y raw magnetometer */,RawMz/*! z raw magnetometer */
+                } PlotableData_t;
+
+            /*!
+            * \brief Constructor
+            *
+            * Construct an io_data representing IMU datas. \n
+            *
+            * \param parent parent
+            * \param name name
+            * \param n number of samples
+            */
+            ImuData(const Object* parent,std::string name="",int n=1);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~ImuData();
+
+            /*!
+            * \brief Element
+            *
+            * Get a pointer to a specific element. This pointer can be used for plotting.
+            *
+            * \param data_type data type
+            *
+            * \return pointer to the element
+            */
+            IODataElement* Element(PlotableData_t data_type) const;
+
+            /*!
+            * \brief Get raw accelerations
+            *
+            * This method is mutex protected.
+            *
+            * \return raw accelerations
+            *
+            */
+            Vector3D GetRawAcc(void) const;
+
+            /*!
+            * \brief Get raw magnetometers
+            *
+            * This method is mutex protected.
+            *
+            * \return raw magnetometers
+            *
+            */
+            Vector3D GetRawMag(void) const;
+
+            /*!
+            * \brief Get raw angular speed
+            *
+            * This method is mutex protected.
+            *
+            * \return raw angular speed
+            *
+            */
+            Vector3D GetRawGyr(void) const;
+
+            /*!
+            * \brief Get raw accelerations, magnetometers and angular speeds
+            *
+            * This method is mutex protected.
+            *
+            * \param rawAcc raw accelerations
+            * \param rawMag raw magnetometers
+            * \param rawGyr raw angular speeds
+            *
+            */
+            void GetRawAccMagAndGyr(Vector3D &rawAcc,Vector3D &rawMag,Vector3D &rawGyr) const;
+
+            /*!
+            * \brief Set raw accelerations
+            *
+            * This method is mutex protected.
+            *
+            * \param raw accelerations
+            *
+            */
+            void SetRawAcc(const Vector3D &rawAcc);
+
+            /*!
+            * \brief Set raw magnetometers
+            *
+            * This method is mutex protected.
+            *
+            * \param raw magnetometers
+            *
+            */
+            void SetRawMag(const Vector3D &rawMag);
+
+            /*!
+            * \brief Set raw angular speed
+            *
+            * This method is mutex protected.
+            *
+            * \param raw angular speed
+            *
+            */
+            void SetRawGyr(const Vector3D &rawGyr);
+
+            /*!
+            * \brief Set raw accelerations, magnetometers and angular speeds
+            *
+            * This method is mutex protected.
+            *
+            * \param rawAcc raw accelerations
+            * \param rawMag raw magnetometers
+            * \param rawGyr raw angular speeds
+            *
+            */
+            void SetRawAccMagAndGyr(const Vector3D &rawAcc,const Vector3D &rawMag,const Vector3D &rawGyr);
+
+            Type const&GetDataType() const {return dataType;}
+        private:
+            /*!
+            * \brief Copy datas
+            *
+            * Reimplemented from io_data. \n
+            * See io_data::CopyDatas.
+            *
+            * \param dst destination buffer
+            */
+            void CopyDatas(char* dst) const;
+
+            /*!
+            * \brief Raw accelerometer
+            *
+            */
+            Vector3D rawAcc;
+
+            /*!
+            * \brief Raw gyrometer
+            *
+            */
+            Vector3D rawGyr;
+
+            /*!
+            * \brief Raw magnetometer
+            *
+            */
+            Vector3D rawMag;
+
+            void Queue(char** dst,const void *src,size_t size) const;
+            Type dataType;
+
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // IMUDATA_H
Index: /trunk/lib/FlairCore/src/Label.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Label.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Label.cpp	(revision 2)
@@ -0,0 +1,65 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/17
+//  filename:   Label.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QLabel on the ground station
+//
+//
+/*********************************************************************/
+
+#include "Label.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+Label::Label(const LayoutPosition* position,string name,size_t buf_size): Widget(position->getLayout(),name,"Label")
+{
+    SetVolatileXmlProp("row",position->Row());
+    SetVolatileXmlProp("col",position->Col());
+
+    SendXml();
+
+    printf_buffer=(char*)malloc(buf_size);
+    if(printf_buffer==NULL) Err("erreur malloc\n");
+
+    delete position;
+}
+
+Label::~Label()
+{
+    if(printf_buffer!=NULL) free(printf_buffer);
+    printf_buffer=NULL;
+}
+
+
+void Label::SetText(const char * format, ...)
+{
+    int n;
+
+    va_list args;
+    va_start (args, format);
+    n = vsprintf(printf_buffer,format, args);
+    va_end (args);
+    if (n<=0) return;
+
+    SetVolatileXmlProp("value",printf_buffer);
+    SendXml();
+
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Label.h
===================================================================
--- /trunk/lib/FlairCore/src/Label.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Label.h	(revision 2)
@@ -0,0 +1,66 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Label.h
+ * \brief Class displaying a QLabel on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/08/17
+ * \version 4.0
+ */
+
+#ifndef LABEL_H
+#define LABEL_H
+
+#include <Widget.h>
+
+namespace flair
+{
+namespace gui
+{
+
+    class LayoutPosition;
+
+    /*! \class Label
+    *
+    * \brief Class displaying a QLabel on the ground station
+    *
+    */
+    class Label:public Widget
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a QLabel at given position. \n
+            * The Label will automatically be child of position->getLayout() Layout. After calling this constructor,
+            * position will be deleted as it is no longer usefull.
+            *
+            * \param parent parent
+            * \param name name
+            * \param buf_size size of the text buffer
+            */
+            Label(const LayoutPosition* position,std::string name,size_t buf_size=255);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Label();
+
+            /*!
+            * \brief Set text
+            *
+            * \param format text string to display, see standard printf
+            */
+            void SetText(const char * format, ...);
+
+        private:
+            char* printf_buffer;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // LABEL_H
Index: /trunk/lib/FlairCore/src/Layout.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Layout.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Layout.cpp	(revision 2)
@@ -0,0 +1,54 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   Layout.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class to display a layout on the ground station
+//
+//
+/*********************************************************************/
+#include "Layout.h"
+#include "LayoutPosition.h"
+#include "Mutex.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+Layout::Layout(const Widget* parent,string name,string type): Widget(parent,name,type)
+{
+    mutex=new core::Mutex(this,name);
+}
+
+Layout::~Layout()
+{
+
+}
+
+LayoutPosition* Layout::LastRowLastCol(void) const
+{
+    return new LayoutPosition(this,-1,0);
+}
+
+LayoutPosition*  Layout::NewRow(void) const
+{
+    return new LayoutPosition(this,-1,-1);
+}
+
+LayoutPosition*  Layout::At(uint16_t row,uint16_t col) const
+{
+    return new LayoutPosition(this,row,col);
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Layout.h
===================================================================
--- /trunk/lib/FlairCore/src/Layout.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Layout.h	(revision 2)
@@ -0,0 +1,99 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Layout.h
+ * \brief Abstract class to display a layout on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef LAYOUT_H
+#define LAYOUT_H
+
+#include <Widget.h>
+#include <Mutex.h>
+
+namespace flair
+{
+namespace gui
+{
+    class LayoutPosition;
+
+    /*! \class Layout
+    *
+    * \brief Abstract class to display a layout on the ground station
+    *
+    * This is an abstract class to display layouts (like GridLayout, GroupBox, etc). \n
+    * A layout can contains Widgets (Box, DataPlot, Picture, etc). \n
+    * Layout holds a Mutex, which can be used to protect access to Box's value for example.
+    */
+    class Layout: public Widget
+    {
+        friend class Box;
+
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a Layout. Type is a predifined one, and will be
+            * interpreted by the ground station.
+            *
+            * \param parent parent
+            * \param name name
+            * \param type type of layout
+            */
+            Layout(const Widget* parent,std::string name,std::string type);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Layout();
+
+            /*!
+            * \brief Last Row and Col LayoutPosition
+            *
+            * Get a LayoutPosition at the last row and col.
+            *
+            * \return the LayoutPosition
+            */
+            LayoutPosition* LastRowLastCol(void) const;
+
+            /*!
+            * \brief New Row LayoutPosition
+            *
+            * Get a LayoutPosition at a new row and first col. This new row will be at the last position.
+            *
+            * \return the LayoutPosition
+            */
+            LayoutPosition*  NewRow(void) const;
+
+            /*!
+            * \brief LayoutPosition at specified position
+            *
+            * Get a LayoutPosition at specified row and col.
+            *
+            * \param row row
+            * \param col col
+            *
+            * \return the LayoutPosition
+            */
+            LayoutPosition*  At(uint16_t row,uint16_t col) const;
+
+        private:
+            /*!
+            * \brief Mutex
+            *
+            * This Mutex can be used by friends class like Box to protect access
+            * to Box's value.
+            */
+            core::Mutex* mutex;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // LAYOUT_H
Index: /trunk/lib/FlairCore/src/LayoutPosition.cpp
===================================================================
--- /trunk/lib/FlairCore/src/LayoutPosition.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/LayoutPosition.cpp	(revision 2)
@@ -0,0 +1,53 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/12/04
+//  filename:   LayoutPosition.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class to define a position in a layout on the ground station
+//
+//
+/*********************************************************************/
+#include "LayoutPosition.h"
+
+
+namespace flair
+{
+namespace gui
+{
+
+LayoutPosition::LayoutPosition(const Layout* layout,int16_t row,int16_t col)
+{
+    this->layout=layout;
+    this->row=row;
+    this->col=col;
+}
+
+LayoutPosition::~LayoutPosition()
+{
+
+}
+
+const Layout* LayoutPosition::getLayout(void) const
+{
+    return layout;
+}
+
+int16_t LayoutPosition::Row(void) const
+{
+    return row;
+}
+
+int16_t LayoutPosition::Col(void) const
+{
+    return col;
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/LayoutPosition.h
===================================================================
--- /trunk/lib/FlairCore/src/LayoutPosition.h	(revision 2)
+++ /trunk/lib/FlairCore/src/LayoutPosition.h	(revision 2)
@@ -0,0 +1,81 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file LayoutPosition.h
+ * \brief Class to define a position in a layout on the ground station.
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/12/04
+ * \version 4.0
+ */
+
+#ifndef LAYOUTPOSITION_H
+#define LAYOUTPOSITION_H
+
+#include <stdint.h>
+
+namespace flair
+{
+namespace gui
+{
+    class Layout;
+
+    /*! \class LayoutPosition
+    *
+    * \brief Class to define a position in a layout on the ground station.
+    *
+
+    */
+    class LayoutPosition
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a LayoutPosition, in given Layout at given place.
+            *
+            * \param layout layout
+            * \param row row position
+            * \param col col position
+            */
+            LayoutPosition(const Layout* layout,int16_t row,int16_t col);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~LayoutPosition();
+
+            /*!
+            * \brief get Layout
+            *
+            * \return the parent Layout
+            */
+            const Layout* getLayout(void) const;
+
+            /*!
+            * \brief get row
+            *
+            * \return row position
+            */
+            int16_t Row(void) const;
+
+            /*!
+            * \brief get col
+            *
+            * \return col position
+            */
+            int16_t Col(void) const;
+
+
+        private:
+            const Layout *layout;
+            int16_t row,col;
+
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // LAYOUTPOSITION_H
Index: /trunk/lib/FlairCore/src/Map.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Map.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Map.cpp	(revision 2)
@@ -0,0 +1,133 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/07/23
+//  filename:   Map.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a GPS map on the ground station
+//
+//
+/*********************************************************************/
+
+#include "Map.h"
+#include "LayoutPosition.h"
+#include "Layout.h"
+#include "GeoCoordinate.h"
+#include "FrameworkManager.h"
+#include <string.h>
+#include <sstream>
+
+using std::string;
+using std::ostringstream;
+
+namespace flair
+{
+namespace gui
+{
+
+using namespace core;
+
+Map::Map(const LayoutPosition* position,string name):SendData(position,name,"Map",1000) {
+    size_t i=0;
+    while(1) {
+        double latitude,longitude;
+        double altitude=0;
+        ostringstream lat_prop,long_prop,alt_prop;
+        lat_prop << "lat" << i;
+        long_prop << "long" << i;
+        alt_prop << "alt" << i;
+        if(GetPersistentXmlProp(lat_prop.str(),latitude) && GetPersistentXmlProp(long_prop.str(),longitude)) {
+            SetVolatileXmlProp(lat_prop.str(),latitude);
+            SetVolatileXmlProp(long_prop.str(),longitude);
+            if(GetPersistentXmlProp(alt_prop.str(),altitude)) SetVolatileXmlProp(alt_prop.str(),altitude);
+            GeoCoordinate *checkpoint=new GeoCoordinate(this,"checkpoint",latitude,longitude,altitude);
+            checkpoints.push_back(checkpoint);
+        } else {
+            break;
+        }
+        i++;
+    }
+    for(size_t i=0;i<checkpoints.size();i++) {
+        double latitude,longitude,altitude;
+        checkpoints.at(i)->GetCoordinates(&latitude,&longitude,&altitude);
+        //printf("%i %f %f\n",i,latitude,longitude);
+    }
+
+    SendXml();
+/*
+    //update value from xml file
+    XmlEvent(XmlFileNode());
+    if(checkpoints_node.size()!=0) SendXml();//pour les checkpoints
+
+    //on enleve les checkpoints du xml
+    for(size_t i=0;i<checkpoints_node.size();i++)
+    {
+        xmlUnlinkNode(checkpoints_node.at(i));
+        xmlFreeNode(checkpoints_node.at(i));
+    }*/
+}
+
+Map::~Map() {
+
+}
+
+void Map::ExtraXmlEvent(void) {
+
+//attention pas rt safe (creation checkpoint)
+    size_t i=0;
+    while(1) {
+        //printf("test %i\n",i);
+        double latitude,longitude;
+        double altitude=0;
+        ostringstream lat_prop,long_prop,alt_prop;
+        lat_prop << "lat" << i;
+        long_prop << "long" << i;
+        alt_prop << "alt" << i;
+        if(GetPersistentXmlProp(lat_prop.str(),latitude) && GetPersistentXmlProp(long_prop.str(),longitude)) {
+            GetPersistentXmlProp(alt_prop.str(),altitude);
+            if(i>=checkpoints.size()) {
+                GeoCoordinate *checkpoint=new GeoCoordinate(this,"checkpoint",latitude,longitude,altitude);
+                checkpoints.push_back(checkpoint);
+                //printf("add %i\n",i);
+            } else {
+                checkpoints.at(i)->SetCoordinates(latitude,longitude,altitude);
+            }
+        } else {
+            if(i==checkpoints.size()) break;
+        }
+        i++;
+    }
+
+    for(size_t i=0;i<checkpoints.size();i++) {
+        double latitude,longitude,altitude;
+        checkpoints.at(i)->GetCoordinates(&latitude,&longitude,&altitude);
+        //printf("%i %f %f\n",i,latitude,longitude);
+    }
+}
+
+void Map::AddPoint(const GeoCoordinate* point,string name) {
+    SetVolatileXmlProp("point",name);
+    SendXml();
+
+    to_draw.push_back(point);
+    SetSendSize(to_draw.size()*3*sizeof(double));//lat,long,alt
+}
+
+void Map::CopyDatas(char* buf) const {
+    for(size_t i=0;i<to_draw.size();i++) {
+        double latitude,longitude,altitude;
+        to_draw.at(i)->GetCoordinates(&latitude,&longitude,&altitude);
+        memcpy(buf+i*3*sizeof(double),&latitude,sizeof(double));
+        memcpy(buf+sizeof(double)+i*3*sizeof(double),&longitude,sizeof(double));
+        memcpy(buf+2*sizeof(double)+i*3*sizeof(double),&altitude,sizeof(double));
+    }
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Map.h
===================================================================
--- /trunk/lib/FlairCore/src/Map.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Map.h	(revision 2)
@@ -0,0 +1,91 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Map.h
+ * \brief Class displaying a GPS map on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/07/23
+ * \version 4.0
+ */
+
+#ifndef MAP_H
+#define MAP_H
+
+#include <SendData.h>
+#include <stdint.h>
+
+namespace flair
+{
+namespace core
+{
+    class GeoCoordinate;
+}
+
+namespace gui
+{
+
+    class LayoutPosition;
+
+    /*! \class Map
+    *
+    * \brief Class displaying a GPS map on the ground station
+    *
+    */
+    class Map: public SendData
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a map at given position. \n
+            * The Map will automatically be child of position->getLayout() Layout. After calling this constructor,
+            * position will be deleted as it is no longer usefull.
+            *
+            * \param position position to draw map
+            * \param name name
+            */
+            Map(const LayoutPosition* position,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Map();
+
+            /*!
+            * \brief Add a point to the map
+            *
+            * \param point point to draw
+            * \param name name
+            */
+            void AddPoint(const core::GeoCoordinate* point,std::string name="");
+
+            /*!
+            * \brief Copy datas to specified buffer
+            *
+            * Reimplemented from SendData.
+            *
+            * \param buf output buffer
+            */
+            void CopyDatas(char* buf) const;
+
+        private:
+            /*!
+            * \brief Extra Xml event
+            *
+            * Reimplemented from SendData.
+            */
+            void ExtraXmlEvent(void);
+
+            std::vector<core::GeoCoordinate*> checkpoints;
+            std::vector<const core::GeoCoordinate*> to_draw;
+            //std::vector<xmlNodePtr> checkpoints_node;
+            //bool init;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // MAP_H
Index: /trunk/lib/FlairCore/src/Mutex.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Mutex.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Mutex.cpp	(revision 2)
@@ -0,0 +1,56 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/14
+//  filename:   Mutex.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a mutex
+//
+//
+/*********************************************************************/
+
+#include "Mutex.h"
+#include "Mutex_impl.h"
+
+using std::string;
+
+namespace flair
+{
+namespace core
+{
+
+Mutex::Mutex(const Object *parent,string name): Object(parent, name,"mutex")
+{
+    pimpl_=new Mutex_impl(this);
+}
+
+Mutex::~Mutex()
+{
+    delete pimpl_;
+}
+
+void Mutex::GetMutex(void) const
+{
+    pimpl_->GetMutex();
+}
+
+void Mutex::ReleaseMutex(void) const
+{
+    pimpl_->ReleaseMutex();
+}
+
+/*
+bool Mutex::IsLocked(void)
+{
+    return pimpl_->IsLocked();
+}
+*/
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Mutex.h
===================================================================
--- /trunk/lib/FlairCore/src/Mutex.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Mutex.h	(revision 2)
@@ -0,0 +1,75 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Mutex.h
+ * \brief Class defining a mutex
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/14
+ * \version 4.0
+ */
+
+#ifndef MUTEX_H
+#define MUTEX_H
+
+#include <Object.h>
+
+class Mutex_impl;
+class ConditionVariable_impl;
+
+namespace flair
+{
+namespace core
+{
+
+    /*! \class Mutex
+    *
+    * \brief Class defining a mutex
+    *
+    */
+    class Mutex: public Object
+    {
+        friend class ::ConditionVariable_impl;
+
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a mutex.
+            *
+            * \param parent parent
+            * \param name name
+            */
+            Mutex(const Object *parent,std::string name="");
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Mutex();
+
+            /*!
+            * \brief GetMutex
+            *
+            * Lock the mutex.
+            *
+            */
+            void GetMutex(void) const;
+
+            /*!
+            * \brief ReleaseMutex
+            *
+            * Unlock the mutex.
+            *
+            */
+            void ReleaseMutex(void) const;
+
+        private:
+            class Mutex_impl* pimpl_;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // MUTEX_H
Index: /trunk/lib/FlairCore/src/Mutex_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Mutex_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Mutex_impl.cpp	(revision 2)
@@ -0,0 +1,101 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/14
+//  filename:   Mutex.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a mutex
+//
+//
+/*********************************************************************/
+
+#include "Mutex_impl.h"
+#include "Mutex.h"
+#include <string.h>
+
+using std::string;
+using namespace flair::core;
+
+Mutex_impl::Mutex_impl(Mutex *self)
+{
+    this->self=self;
+#ifdef __XENO__
+    int status=rt_mutex_create(&mutex,NULL);
+    if(status!=0) self->Err("rt_mutex_create error (%s)\n",strerror(-status));
+#else
+    //flag_locked=false;//revoir l'implementation nrt du is_locked
+    pthread_mutexattr_t attr;
+    if(pthread_mutexattr_init(&attr)!=0)
+    {
+        self->Err("pthread_mutexattr_init error\n");
+    }
+    if(pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE) != 0)
+    {
+        self->Err("pthread_mutexattr_settype error\n");
+    }
+    if(pthread_mutex_init(&mutex, &attr)!=0)
+    {
+        self->Err("pthread_mutex_init error\n");
+    }
+    if(pthread_mutexattr_destroy(&attr)!=0)
+    {
+        self->Err("pthread_mutexattr_destroy error\n");
+    }
+#endif
+}
+
+Mutex_impl::~Mutex_impl()
+{
+    int status;
+#ifdef __XENO__
+    status=rt_mutex_delete(&mutex);
+#else
+    status=pthread_mutex_destroy(&mutex);
+#endif
+    if(status!=0) self->Err("error destroying mutex (%s)\n",strerror(-status));
+}
+
+void Mutex_impl::GetMutex(void)
+{
+    int status;
+#ifdef __XENO__
+    status=rt_mutex_acquire(&mutex,TM_INFINITE);
+#else
+    //flag_locked=true;
+    status=pthread_mutex_lock(&mutex);
+#endif
+    if(status!=0) self->Err("error (%s)\n",strerror(-status));
+}
+
+void Mutex_impl::ReleaseMutex(void)
+{
+    int status;
+#ifdef __XENO__
+    status=rt_mutex_release(&mutex);
+#else
+    status=pthread_mutex_unlock(&mutex);
+    //flag_locked=false;
+#endif
+    if(status!=0) self->Err("error (%s)\n",strerror(-status));
+}
+
+/*
+bool Mutex_impl::IsLocked(void)
+{
+#ifdef __XENO__
+    RT_MUTEX_INFO info;
+    int status=rt_mutex_inquire(&mutex_rt,&info);
+    if(status!=0) mutex->Err("erreur rt_mutex_inquire (%s)\n",strerror(-status));
+    if(info.locked>0) return true;
+    return false;
+#else
+    return flag_locked;
+#endif
+}
+*/
Index: /trunk/lib/FlairCore/src/Object.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Object.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Object.cpp	(revision 2)
@@ -0,0 +1,163 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/05/07
+//  filename:   Object.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for all Framework's classes
+//
+//
+/*********************************************************************/
+
+#include <stdio.h>
+
+#include "Object.h"
+#include "Object_impl.h"
+#include "FrameworkManager.h"
+
+#ifdef __XENO__
+#include <native/task.h>
+#include <native/timer.h>
+#include "rtdk.h"
+#else
+#include <sys/time.h>
+#endif
+
+using std::string;
+using std::vector;
+
+namespace flair
+{
+namespace core
+{
+
+Time GetTime(void)
+{
+#ifdef __XENO__
+    return rt_timer_read();
+#else
+    struct timeval t;
+    gettimeofday(&t, NULL);
+    return (Time)((Time)(t.tv_sec)*1000000 + (Time)(t.tv_usec))*1000;
+
+#endif
+}
+
+void Printf(const char *format, ...)
+{
+    va_list args;
+    va_start(args, format);
+#ifdef __XENO__
+    if(rt_task_self()!=NULL)
+    {
+        rt_vfprintf(stderr,format, args);
+    }
+    else
+#endif
+    {
+        vfprintf(stderr,format, args);
+    }
+
+    va_end (args);
+}
+
+Object::Object(const Object* parent,string name,string type)
+{
+    pimpl_=new Object_impl(this,parent,name,type);
+    if(parent!=NULL) parent->pimpl_->AddChild(this);
+}
+
+Object::~Object()
+{
+    if(pimpl_->parent!=NULL) pimpl_->parent->pimpl_->RemoveChild(this);
+    delete pimpl_;
+}
+
+string Object::ObjectName(void) const
+{
+    return pimpl_->name;
+}
+
+string Object::ObjectType(void) const
+{
+    return pimpl_->type;
+}
+
+const Object* Object::Parent(void) const
+{
+    return pimpl_->parent;
+}
+
+vector<const Object*>* Object::TypeChilds(void) const
+{
+    return &(pimpl_->type_childs);
+}
+
+vector<const Object*>* Object::Childs(void) const
+{
+    return &(pimpl_->childs);
+}
+
+void Object::ColorPrintf(color_t color, const char *function, int line, const char *format,va_list *args) const {
+#ifdef __XENO__
+    if(rt_task_self()!=NULL)
+    {
+        rt_fprintf(stderr,"\033[%dm", color);
+        if (line) {
+            rt_fprintf(stderr,"%s - line %d, %s: ", function, line, pimpl_->name.c_str());
+        } else {
+            rt_fprintf(stderr,"%s, %s: ", function, pimpl_->name.c_str());
+        }
+        rt_vfprintf(stderr,format, *args);
+        rt_fprintf(stderr,"\033[%dm", color_t::Auto);
+    }
+    else
+#endif
+    {
+        fprintf(stderr,"\033[%dm", color);
+        if (line) {
+            fprintf(stderr,"%s - line %d, %s: ", function, line, pimpl_->name.c_str());
+        } else {
+            fprintf(stderr,"%s, %s: ", function, pimpl_->name.c_str());
+        }
+        vfprintf(stderr,format, *args);
+        fprintf(stderr,"\033[%dm", color_t::Auto);
+    }
+}
+
+void Object::Information(const char *function, int line, const char *format, ...) const {
+    va_list args;
+    va_start(args, format);
+    ColorPrintf(color_t::Green, function, line, format, &args);
+    va_end (args);
+}
+
+void Object::Warning(const char *function, const char *format, ...) const {
+    va_list args;
+    va_start(args, format);
+    ColorPrintf(color_t::Orange, function, 0, format, &args);
+    va_end (args);
+}
+
+void Object::Error(const char *function, const char *format, ...) const {
+    va_list args;
+    va_start(args, format);
+    ColorPrintf(color_t::Red, function, 0, format, &args);
+    va_end (args);
+
+    pimpl_->error_occured=true;
+}
+
+bool Object::ErrorOccured(bool recursive) const
+{
+    return pimpl_->ErrorOccured(recursive);
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Object.h
===================================================================
--- /trunk/lib/FlairCore/src/Object.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Object.h	(revision 2)
@@ -0,0 +1,198 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Object.h
+ * \brief Base class for all Framework's classes
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/05/07
+ * \version 4.0
+ */
+
+#ifndef OBJECT_H
+#define OBJECT_H
+
+#include <string>
+#include <vector>
+#include <stdarg.h>
+
+#define Warn(...) Warning(__PRETTY_FUNCTION__,__VA_ARGS__)
+#define Err(...) Error(__PRETTY_FUNCTION__,__VA_ARGS__)
+#define Info(...) Information(__PRETTY_FUNCTION__,__LINE__,__VA_ARGS__)
+
+#define TIME_INFINITE 0
+#define TIME_NONBLOCK ((Time)-1)
+
+class Object_impl;
+class Widget_impl;
+
+namespace flair
+{
+namespace core
+{
+
+    class FrameworkManager;
+
+    class Message {
+    public:
+        Message(unsigned int myBufferSize):bufferSize(myBufferSize) {
+            buffer=new char[bufferSize];
+        }
+        ~Message() {
+            delete buffer;
+        }
+        char *buffer;
+        size_t bufferSize;
+    };
+
+    /*!
+    * \brief Time definition, in ns
+    *
+    */
+    typedef unsigned long long Time;
+
+    /*!
+    * \brief Time
+    *
+    * \return actual time in ns (origin depends on whether the method is compiled in hard real time mode or not. As a conquence, only time differences should be used)
+    */
+    Time GetTime(void);
+
+    /*!
+    * \brief Formatted print
+    *
+    * See standard printf for syntax.
+    *
+    * \param format text string to display
+    */
+    void Printf(const char *format, ...);
+
+    /*! \class Object
+    *
+    * \brief Base class for all Framework's classes
+    *
+    * This is the base class for all other classes. \n
+    * It handles parent/child links and thus allow auto destruction of childs.
+    *
+    */
+    class Object
+    {
+        friend class ::Widget_impl;
+
+        public:
+            typedef enum {
+                Auto=0,
+                Red=31,
+                Green=32,
+                Orange=33
+            } color_t;
+            /*!
+            * \brief Constructor
+            *
+            * Construct an Object, which is child of its parent.
+            *
+            * \param parent parent
+            * \param name name
+            * \param type type
+            */
+            Object(const Object* parent=NULL,std::string name="",std::string type="");
+
+            /*!
+            * \brief Destructor
+            *
+            * Calling it will automatically destruct all childs.
+            *
+            */
+            virtual ~Object();
+
+            /*!
+            * \brief Name
+            *
+            * \return Object's name
+            */
+            std::string ObjectName(void) const;
+
+            /*!
+            * \brief Type
+            *
+            * \return Object's type
+            */
+            std::string ObjectType(void) const;
+
+            /*!
+            * \brief Parent
+            *
+            * \return Object's parent
+            */
+            const Object* Parent(void) const;
+
+            /*!
+            * \brief Childs of the same type
+            *
+            * \return a vector of all childs of the same type
+            */
+            std::vector<const Object*>* TypeChilds(void) const;
+
+            /*!
+            * \brief Childs
+            *
+            * \return a vector of all childs
+            */
+            std::vector<const Object*>* Childs(void) const;
+
+            /*!
+            * \brief Formatted information
+            *
+            * Green colored Printf(). \n
+            * Note that it is better to call Info macro, which automatically fills function parameter.
+            *
+            * \param function name of calling function
+            * \param line line number in calling function
+            * \param format text string to display
+            */
+            void Information(const char *function, int line, const char *format, ...) const;
+
+            /*!
+            * \brief Formatted warning
+            *
+            * Orange colored Printf(). \n
+            * Note that it is better to call Warn macro, which automatically fills function parameter.
+            *
+            * \param function name of calling function
+            * \param format text string to display
+            */
+            void Warning(const char *function,const char *format, ...) const;
+
+            /*!
+            * \brief Formatted error
+            *
+            * Red colored Printf(). \n
+            * Note that it is better to call Err macro, which automatically fills function parameter. \n
+            * After calling this method, ErrorOccured() will always return true.
+            *
+            * \param function name of calling function
+            * \param format text string to display
+            */
+            void Error(const char *function,const char *format, ...) const;
+
+            /*!
+            * \brief Has an errror occured?
+            *
+            * Check if an error occured, in fact if Error() was called at least once. \n
+            * Once Error() was called, this method will never return back false.
+            *
+            * \param recursive if true, recursively check among childs
+            * \return true if an error occured
+            */
+            bool ErrorOccured(bool recursive=true) const;
+
+        private:
+            class Object_impl* pimpl_;
+            void ColorPrintf(color_t, const char *function, int line, const char *format, va_list *args) const;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // OBJECT_H
Index: /trunk/lib/FlairCore/src/Object_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Object_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Object_impl.cpp	(revision 2)
@@ -0,0 +1,103 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/05/07
+//  filename:   Object.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe pour qobject
+//
+//
+/*********************************************************************/
+
+#include "Object.h"
+#include "Object_impl.h"
+
+using std::string;
+using std::vector;
+using namespace flair::core;
+
+Object_impl::Object_impl(const Object* self,const Object* parent,string name,string type)
+{
+    //Printf("Object %s\n",name.c_str());
+    this->self=self;
+    this->parent=parent;
+    this->name=name;
+    this->type=type;
+    error_occured=false;
+
+    if(parent!=NULL)
+    {
+        if(name=="") this->name=parent->ObjectName();
+    }
+}
+
+Object_impl::~Object_impl()
+{
+    //Printf("destruction Object %s %s\n",name.c_str(),type.c_str());
+
+    while(childs.size()!=0)
+    {
+        //Printf("child %i %s %s\n",childs.size(),childs.front()->ObjectName().c_str(),childs.front()->ObjectType().c_str());
+        //if(childs.front()!=NULL)
+        delete childs.front();
+    }
+
+    if(type_childs.size()!=0)
+    {
+        type_childs.clear();
+        self->Warn("type_childs not cleared\n");
+    }
+
+    //Printf("destruction Object %s %s ok\n",name.c_str(),type.c_str());
+}
+
+void Object_impl::AddChild(const Object* child)
+{
+    childs.push_back(child);
+//self->Printf("added Object %s %s (%s %s)\n",child->ObjectName().c_str(),child->ObjectType().c_str(),name.c_str(),type.c_str());
+    if(child->ObjectType()==type) type_childs.push_back(child);
+}
+
+void Object_impl::RemoveChild(const Object* child)
+{
+    //self->Printf("removed Object %s %s (%s %s)\n",child->ObjectName().c_str(),child->ObjectType().c_str(),name.c_str(),type.c_str());
+
+    for(vector<const Object*>::iterator it=childs.begin() ; it < childs.end(); it++ )
+    {
+        if(*it==child)
+        {
+            childs.erase (it);
+            break;
+        }
+    }
+
+    for(vector<const Object*>::iterator it=type_childs.begin() ; it < type_childs.end(); it++ )
+    {
+        if(*it==child)
+        {
+            type_childs.erase (it);
+            break;
+        }
+    }
+}
+
+bool Object_impl::ErrorOccured(bool recursive)
+{
+    if(recursive==true)
+    {
+        for(size_t i=0;i<childs.size();i++)
+        {
+            if(childs[i]->ErrorOccured(true)==true)
+            {
+                return true;
+            }
+        }
+    }
+    return error_occured;
+}
Index: /trunk/lib/FlairCore/src/OneAxisRotation.cpp
===================================================================
--- /trunk/lib/FlairCore/src/OneAxisRotation.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/OneAxisRotation.cpp	(revision 2)
@@ -0,0 +1,65 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/17
+//  filename:   OneAxisRotation.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a rotation around one axis
+//
+//
+/*********************************************************************/
+
+//this "filter" is in core but it should be in filter
+//filter depends on sensoractuator
+//sensoractuators depends on oneaxisrotation
+//so if oneaxisrotation is in fiter we have a circular dependency
+//TODO: fix this!
+
+#include "OneAxisRotation.h"
+#include "OneAxisRotation_impl.h"
+#include <Vector3D.h>
+#include <Euler.h>
+
+using std::string;
+
+namespace flair
+{
+namespace core
+{
+
+OneAxisRotation::OneAxisRotation(const gui::LayoutPosition* position,string name): gui::GroupBox(position,name)
+{
+    pimpl_=new OneAxisRotation_impl(this);
+}
+
+OneAxisRotation::~OneAxisRotation()
+{
+    delete pimpl_;
+}
+
+void OneAxisRotation::ComputeRotation(Vector3D& vector) const
+{
+    pimpl_->ComputeRotation(vector);
+}
+
+void OneAxisRotation::ComputeRotation(Euler& euler) const
+{
+    pimpl_->ComputeRotation(euler);
+}
+
+void OneAxisRotation::ComputeRotation(Quaternion& quaternion) const {
+    pimpl_->ComputeRotation(quaternion);
+}
+
+void OneAxisRotation::ComputeRotation(RotationMatrix& matrix) const {
+    pimpl_->ComputeRotation(matrix);
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/OneAxisRotation.h
===================================================================
--- /trunk/lib/FlairCore/src/OneAxisRotation.h	(revision 2)
+++ /trunk/lib/FlairCore/src/OneAxisRotation.h	(revision 2)
@@ -0,0 +1,97 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file OneAxisRotation.h
+ * \brief Class defining a rotation around one axis
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/17
+ * \version 4.0
+ */
+
+#ifndef ONEAXISROTATION_H
+#define ONEAXISROTATION_H
+
+#include <GroupBox.h>
+
+class OneAxisRotation_impl;
+
+
+namespace flair
+{
+namespace gui
+{
+    class LayoutPosition;
+}
+
+namespace core
+{
+    class Vector3D;
+    class Euler;
+    class Quaternion;
+    class RotationMatrix;
+
+    /*! \class OneAxisRotation
+    *
+    * \brief Class defining a rotation around one axis
+    *
+    * Axe and value of the rotation are placed in a GroupBox on ground station.
+    *
+    */
+    class OneAxisRotation: public gui::GroupBox
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a OneAxisRotation at given position.
+            *
+            * \param position position to place the GroupBox
+            * \param name name
+            */
+            OneAxisRotation(const gui::LayoutPosition* position,std::string namel);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~OneAxisRotation();
+
+            /*!
+            * \brief Compute rotation
+            *
+            * \param vector Vector3D to rotate
+            */
+            void ComputeRotation(core::Vector3D& vector) const;
+
+            /*!
+            * \brief Compute rotation
+            *
+            * \param euler Euler angle to rotate
+            */
+            void ComputeRotation(core::Euler& euler) const;
+
+            /*!
+            * \brief Compute rotation
+            *
+            * \param quaternion Quaternion to rotate
+            */
+            void ComputeRotation(core::Quaternion& quaternion) const;
+
+            /*!
+            * \brief Compute rotation
+            *
+            * \param matrix RotationMatrix to rotate
+            */
+            void ComputeRotation(core::RotationMatrix& matrix) const;
+
+        private:
+            const class OneAxisRotation_impl* pimpl_;
+
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // ONEAXISROTATION_H
Index: /trunk/lib/FlairCore/src/OneAxisRotation_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/OneAxisRotation_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/OneAxisRotation_impl.cpp	(revision 2)
@@ -0,0 +1,82 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/17
+//  filename:   OneAxisRotation_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    objet integrant pour une rotation sur un axe
+//
+//
+/*********************************************************************/
+
+#include "OneAxisRotation_impl.h"
+#include "GroupBox.h"
+#include "ComboBox.h"
+#include "DoubleSpinBox.h"
+#include <Vector3D.h>
+#include <Euler.h>
+#include <Quaternion.h>
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+OneAxisRotation_impl::OneAxisRotation_impl(GroupBox* box)
+{
+    rot_value=new DoubleSpinBox(box->NewRow(),"value"," deg",-180.,180.,10.,1);
+    rot_axe=new ComboBox(box->LastRowLastCol(),"axis");
+    rot_axe->AddItem("x");
+    rot_axe->AddItem("y");
+    rot_axe->AddItem("z");
+}
+
+OneAxisRotation_impl::~OneAxisRotation_impl()
+{
+
+}
+
+//compute rotation of each axis through ComputeRotation(Vector3D& vector)
+void OneAxisRotation_impl::ComputeRotation(Quaternion& quat) const {
+    Vector3D rot=Vector3D(quat.q1,quat.q2,quat.q3);
+    ComputeRotation(rot);
+    quat.q1=rot.x;
+    quat.q2=rot.y;
+    quat.q3=rot.z;
+}
+
+void OneAxisRotation_impl::ComputeRotation(RotationMatrix& matrix) const {
+printf("not yet implemented\n");
+}
+
+//on utilise la rotation d'un vector pour faire une rotation de repere
+//d'ou le signe negatif
+void OneAxisRotation_impl::ComputeRotation(Vector3D& vector) const
+{
+    switch(rot_axe->CurrentIndex())
+    {
+        case 0:
+            vector.RotateXDeg(-rot_value->Value());
+            break;
+        case 1:
+            vector.RotateYDeg(-rot_value->Value());
+            break;
+        case 2:
+            vector.RotateZDeg(-rot_value->Value());
+            break;
+    }
+}
+
+void OneAxisRotation_impl::ComputeRotation(Euler& euler) const
+{
+    Quaternion quat;
+    euler.ToQuaternion(quat);
+    ComputeRotation(quat);
+    quat.ToEuler(euler);
+}
+
Index: /trunk/lib/FlairCore/src/Picture.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Picture.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Picture.cpp	(revision 2)
@@ -0,0 +1,61 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/01/30
+//  filename:   Picture.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a Picture on the ground station
+//
+//
+/*********************************************************************/
+
+#include "Picture.h"
+#include "FrameworkManager.h"
+#include "cvimage.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+using namespace core;
+
+Picture::Picture(const LayoutPosition* position,string name,const cvimage *image):SendData(position,name,"Picture",200)
+{
+    this->image=image;
+
+    SetSendSize(image->GetDataType().GetSize());
+
+    SetVolatileXmlProp("width",image->GetDataType().GetWidth());
+    SetVolatileXmlProp("height",image->GetDataType().GetHeight());
+    SendXml();
+}
+
+Picture::~Picture()
+{
+}
+
+
+void Picture::CopyDatas(char* buf) const
+{
+    if(image!=NULL)
+    {
+        image->GetMutex();
+        memcpy(buf,image->img->imageData,image->GetDataType().GetSize());
+        image->ReleaseMutex();
+    }
+}
+
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Picture.h
===================================================================
--- /trunk/lib/FlairCore/src/Picture.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Picture.h	(revision 2)
@@ -0,0 +1,81 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Picture.h
+ * \brief Class displaying a Picture on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/01/30
+ * \version 4.0
+ */
+
+#ifndef PICTURE_H
+#define PICTURE_H
+
+#include <SendData.h>
+#include <cxtypes.h>
+
+namespace flair
+{
+namespace core
+{
+    class cvimage;
+}
+
+namespace gui
+{
+
+    class LayoutPosition;
+
+    /*! \class Picture
+    *
+    * \brief Class displaying a Picture on the ground station
+    *
+    */
+    class Picture:public SendData
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a picture at given position. \n
+            * The Picture will automatically be child of position->getLayout() Layout. After calling this constructor,
+            * position will be deleted as it is no longer usefull.
+            *
+            * \param position position to draw plot
+            * \param name name
+            * \param image image to draw
+            */
+            Picture(const LayoutPosition* position,std::string name,const core::cvimage *image);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Picture();
+
+        private:
+            /*!
+            * \brief Copy datas to specified buffer
+            *
+            * Reimplemented from SendData.
+            *
+            * \param buf output buffer
+            */
+            void CopyDatas(char* buf) const;
+
+            /*!
+            * \brief Extra Xml event
+            *
+            * Reimplemented from SendData.
+            */
+            void ExtraXmlEvent(void){};
+
+            const core::cvimage *image;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // PICTURE_H
Index: /trunk/lib/FlairCore/src/PushButton.cpp
===================================================================
--- /trunk/lib/FlairCore/src/PushButton.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/PushButton.cpp	(revision 2)
@@ -0,0 +1,67 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   PushButton.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QPushButton on the ground station
+//
+//
+/*********************************************************************/
+
+#include "PushButton.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+PushButton::PushButton(const LayoutPosition* position,string name): Widget(position->getLayout(),name,"PushButton")
+{
+    SetVolatileXmlProp("row",position->Row());
+    SetVolatileXmlProp("col",position->Col());
+    delete position;
+
+    SendXml();
+
+    clicked=false;
+}
+
+PushButton::~PushButton()
+{
+
+}
+
+void PushButton::XmlEvent(void)
+{
+    int clic=0;
+    GetPersistentXmlProp("value",clic);
+
+    if(clic==1) clicked=true;
+}
+
+bool PushButton::Clicked(void)
+{
+    if(clicked==true)
+    {
+       clicked=false;
+       return true;
+    }
+    else
+    {
+        return false;
+    }
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/PushButton.h
===================================================================
--- /trunk/lib/FlairCore/src/PushButton.h	(revision 2)
+++ /trunk/lib/FlairCore/src/PushButton.h	(revision 2)
@@ -0,0 +1,77 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file PushButton.h
+ * \brief Class displaying a QPushButton on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef PUSHBUTTON_H
+#define PUSHBUTTON_H
+
+#include <Widget.h>
+
+namespace flair
+{
+namespace gui
+{
+
+    class LayoutPosition;
+
+    /*! \class PushButton
+    *
+    * \brief Class displaying a QPushButton on the ground station
+    *
+    */
+    class PushButton:public Widget
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a QPushButton at given position. \n
+            * The PushButton will automatically be child of position->getLayout() Layout. After calling this constructor,
+            * position will be deleted as it is no longer usefull.
+            *
+            * \param parent parent
+            * \param name name
+            */
+            PushButton(const LayoutPosition* position,std::string name);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~PushButton();
+
+            /*!
+            * \brief Has been clicled?
+            *
+            * After calling this method, the internal flag
+            * representing the state of the button is
+            * automatically set to false.
+            *
+            * \return true if button was clicked
+            */
+            bool Clicked(void);
+
+        private:
+            /*!
+            * \brief XmlEvent from ground station
+            *
+            * Reimplemented from Widget.
+            *
+            */
+            void XmlEvent(void);
+
+            bool clicked;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // PUSHBUTTON_H
Index: /trunk/lib/FlairCore/src/Quaternion.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Quaternion.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Quaternion.cpp	(revision 2)
@@ -0,0 +1,188 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/02/03
+//  filename:   Quaternion.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a quaternion
+//
+//
+/*********************************************************************/
+
+#include "Quaternion.h"
+#include "Vector3D.h"
+#include "Euler.h"
+#include "RotationMatrix.h"
+#include <math.h>
+#include <stdio.h>
+
+namespace flair {
+namespace core {
+
+Quaternion::Quaternion(float inQ0,float inQ1,float inQ2,float inQ3):q0(inQ0),q1(inQ1),q2(inQ2),q3(inQ3) {
+}
+
+Quaternion::~Quaternion() {
+}
+
+Quaternion& Quaternion::operator=(const Quaternion &quaternion) {
+    q0=quaternion.q0;
+    q1=quaternion.q1;
+    q2=quaternion.q2;
+    q3=quaternion.q3;
+    return (*this);
+}
+
+float Quaternion::GetNorm(void) const {
+    return sqrt(q0*q0+q1*q1+q2*q2+q3*q3);
+}
+
+void Quaternion::Normalize(void) {
+    float n=GetNorm();
+    if(n!=0) {
+        q0=q0/n;
+        q1=q1/n;
+        q2=q2/n;
+        q3=q3/n;
+    }
+}
+
+void Quaternion::Conjugate(void) {
+    q1=-q1;
+    q2=-q2;
+    q3=-q3;
+}
+
+Quaternion Quaternion::GetConjugate(void) {
+    return Quaternion(q0,-q1,-q2,-q3);
+}
+
+void Quaternion::GetLogarithm(Vector3D &logarithm) {
+    Normalize();
+    float v_norm=sqrtf(q1*q1+q2*q2+q3*q3);
+
+    if(v_norm!=0) {
+        float v_arccos = acosf(q0);
+        logarithm.x=(q1*v_arccos)/v_norm;
+        logarithm.y=(q2*v_arccos)/v_norm;
+        logarithm.z=(q3*v_arccos)/v_norm;
+    } else {
+        logarithm.x=0;
+        logarithm.y=0;
+        logarithm.z=0;
+    }
+}
+
+Vector3D Quaternion::GetLogarithm(void) {
+    Vector3D vector;
+    GetLogarithm(vector);
+    return vector;
+}
+
+Quaternion Quaternion::GetDerivative(const Vector3D &angularSpeed) const {
+    const Quaternion Qw(0,angularSpeed.x,angularSpeed.y,angularSpeed.z);
+    return 0.5*(*this)*Qw;
+}
+
+void Quaternion::Derivate(const Vector3D &angularSpeed) {
+    Quaternion Q=GetDerivative(angularSpeed);
+    (*this)=Q;
+}
+
+void Quaternion::ToEuler(Euler &euler) const {
+    euler.roll=atan2(2*(q0*q1+q2*q3), 1-2*(q1*q1+q2*q2));
+    euler.pitch=asin(2*(q0*q2-q1*q3));
+    euler.yaw = atan2(2*(q0*q3+q1*q2), 1-2*(q2*q2+q3*q3));
+}
+
+Euler Quaternion::ToEuler(void) const {
+    Euler euler;
+    ToEuler(euler);
+    return euler;
+}
+
+void Quaternion::ToRotationMatrix(RotationMatrix &matrix) const {
+    float aSq = q0 * q0;
+    float bSq = q1 * q1;
+    float cSq = q2 * q2;
+    float dSq = q3 * q3;
+    matrix.m[0][0] = aSq + bSq - cSq - dSq;
+    matrix.m[0][1] = 2.0f * (q1 * q2 - q0 * q3);
+    matrix.m[0][2] = 2.0f * (q0 * q2 + q1 * q3);
+    matrix.m[1][0] = 2.0f * (q1 * q2 + q0 * q3);
+    matrix.m[1][1] = aSq - bSq + cSq - dSq;
+    matrix.m[1][2] = 2.0f * (q2 * q3 - q0 * q1);
+    matrix.m[2][0] = 2.0f * (q1 * q3 - q0 * q2);
+    matrix.m[2][1] = 2.0f * (q0 * q1 + q2 * q3);
+    matrix.m[2][2] = aSq - bSq - cSq + dSq;
+}
+
+Quaternion &Quaternion::operator+=(const Quaternion &quaternion) {
+    q0+=quaternion.q0;
+    q1+=quaternion.q1;
+    q2+=quaternion.q2;
+    q3+=quaternion.q3;
+    return (*this);
+}
+
+Quaternion &Quaternion::operator-=(const Quaternion &quaternion) {
+    q0-=quaternion.q0;
+    q1-=quaternion.q1;
+    q2-=quaternion.q2;
+    q3-=quaternion.q3;
+    return (*this);
+}
+
+Quaternion operator + (const Quaternion &quaternionA,const Quaternion &quaterniontB) {
+    return Quaternion(
+               quaternionA.q0 + quaterniontB.q0,
+               quaternionA.q1 + quaterniontB.q1,
+               quaternionA.q2 + quaterniontB.q2,
+               quaternionA.q3 + quaterniontB.q3);
+}
+
+Quaternion operator- (const Quaternion &quaterniontA,const Quaternion &quaterniontB) {
+   return Quaternion(
+               quaterniontA.q0 - quaterniontB.q0,
+               quaterniontA.q1 - quaterniontB.q1,
+               quaterniontA.q2 - quaterniontB.q2,
+               quaterniontA.q3 - quaterniontB.q3);
+}
+
+Quaternion operator-(const Quaternion &quaternion) {
+    return Quaternion(-quaternion.q0,-quaternion.q1,-quaternion.q2,-quaternion.q3);
+}
+
+Quaternion operator * (const Quaternion &quaterniontA,const Quaternion &quaterniontB) {
+    return Quaternion(
+               quaterniontA.q0 * quaterniontB.q0 - quaterniontA.q1 * quaterniontB.q1 - quaterniontA.q2 * quaterniontB.q2 - quaterniontA.q3 * quaterniontB.q3,
+               quaterniontA.q0 * quaterniontB.q1 + quaterniontA.q1 * quaterniontB.q0 + quaterniontA.q2 * quaterniontB.q3 - quaterniontA.q3 * quaterniontB.q2,
+               quaterniontA.q0 * quaterniontB.q2 - quaterniontA.q1 * quaterniontB.q3 + quaterniontA.q2 * quaterniontB.q0 + quaterniontA.q3 * quaterniontB.q1,
+               quaterniontA.q0 * quaterniontB.q3 + quaterniontA.q1 * quaterniontB.q2 - quaterniontA.q2 * quaterniontB.q1 + quaterniontA.q3 * quaterniontB.q0);
+}
+
+Quaternion operator * (float coeff,const Quaternion &quaternion) {
+    return Quaternion(
+               coeff*quaternion.q0,
+               coeff*quaternion.q1,
+               coeff*quaternion.q2,
+               coeff*quaternion.q3);
+}
+
+
+Quaternion operator * (const Quaternion &quaternion,float coeff) {
+    return Quaternion(
+               coeff*quaternion.q0,
+               coeff*quaternion.q1,
+               coeff*quaternion.q2,
+               coeff*quaternion.q3);
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Quaternion.h
===================================================================
--- /trunk/lib/FlairCore/src/Quaternion.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Quaternion.h	(revision 2)
@@ -0,0 +1,216 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Quaternion.h
+ * \brief Class defining a quaternion
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/02/03
+ * \version 4.0
+ */
+#ifndef QUATERNION_H
+#define QUATERNION_H
+
+namespace flair { namespace core {
+    class Euler;
+    class Vector3D;
+    class RotationMatrix;
+
+    /*! \class Quaternion
+    *
+    * \brief Class defining a quaternion
+    */
+    class Quaternion {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a quaternion using specified values.
+            *
+            * \param q0, scalar part
+            * \param q1
+            * \param q2
+            * \param q3
+            */
+            Quaternion(float q0=1,float q1=0,float q2=0,float q3=0);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Quaternion();
+
+            /*!
+            * \brief Norm
+            *
+            * \return norm
+            */
+            float GetNorm(void) const;
+
+            /*!
+            * \brief Normalize
+            */
+            void Normalize(void);
+
+            /*!
+            * \brief Logarithm
+            *
+            * This method also Normalize the quaternion.
+            *
+            * \param logarithm output logarithm
+            */
+            void GetLogarithm(Vector3D &logarithm);
+
+            /*!
+            * \brief Logarithm
+            *
+            * This method also Normalize the quaternion.
+            *
+            * \return output logarithm
+            */
+            Vector3D GetLogarithm(void);
+
+            /*!
+            * \brief Conjugate
+            */
+            void Conjugate(void);
+
+            /*!
+            * \brief Conjugate
+            *
+            * \return Conjugate
+            */
+            Quaternion GetConjugate(void);
+
+            /*!
+            * \brief Derivative
+            *
+            * \param w angular speed
+            *
+            * \return derivative
+            */
+            Quaternion GetDerivative(const Vector3D &angularSpeed) const;
+
+            /*!
+            * \brief Derivate
+            *
+            * \param w rotationonal speed
+            */
+            void Derivate(const Vector3D &angularSpeed);
+
+            /*!
+            * \brief Convert to euler angles
+            *
+            * \param euler output euler angles
+            */
+            void ToEuler(Euler &euler) const;
+
+            /*!
+            * \brief Convert to euler angles
+            *
+            * \return euler angles
+            */
+            Euler ToEuler(void) const;
+
+            /*!
+            * \brief Convert to rotation matrix
+            *
+            * \param m output matrix
+            */
+            void ToRotationMatrix(RotationMatrix &matrix) const;
+
+            /*!
+            * \brief q0
+            */
+            float q0;
+
+            /*!
+            * \brief q1
+            */
+            float q1;
+
+            /*!
+            * \brief q2
+            */
+            float q2;
+
+            /*!
+            * \brief q3
+            */
+            float q3;
+
+            Quaternion& operator+=(const Quaternion& quaternion);
+            Quaternion& operator-=(const Quaternion& quaternion);
+            Quaternion& operator=(const Quaternion& quaternion);
+    };
+
+    /*! Add
+    *
+    * \brief Add
+    *
+    * \param quaterniontA quaternion
+    * \param quaterniontB quaternion
+    *
+    * \return quaterniontA+quaterniontB
+    */
+    Quaternion operator + (Quaternion const &quaterniontA,Quaternion const &quaterniontB);
+
+    /*! Substract
+    *
+    * \brief Substract
+    *
+    * \param quaterniontA quaternion
+    * \param quaterniontB quaternion
+    *
+    * \return quaterniontA-quaterniontB
+    */
+    Quaternion operator - (Quaternion const &quaternionA,Quaternion const &quaterniontB);
+
+    /*! Minus
+    *
+    * \brief Minus
+    *
+    * \param quaternion quaternion
+    *
+    * \return -quaternion
+    */
+    Quaternion operator-(const Quaternion &quaternion);
+
+    /*! Multiply
+    *
+    * \brief Multiply
+    *
+    * \param quaterniontA quaternion
+    * \param quaterniontB quaternion
+    *
+    * \return quaterniontA*quaterniontB
+    */
+    Quaternion operator * (Quaternion const &quaternionA,Quaternion const &quaterniontB);
+
+    /*! Multiply
+    *
+    * \brief Multiply
+    *
+    * \param coeff coefficient
+    * \param quat quaternion
+    *
+    * \return coeff*quat
+    */
+    Quaternion operator * (float coeff,Quaternion const &quaternion);
+
+    /*! Multiply
+    *
+    * \brief Multiply
+    *
+    * \param quat quaternion
+    * \param coeff coefficient
+    *
+    * \return coeff*quat
+    */
+    Quaternion operator * (Quaternion const &quaternion,float coeff);
+
+} // end namespace core
+} // end namespace flair
+
+#endif // QUATERNION_H
Index: /trunk/lib/FlairCore/src/RTDM_I2cPort.cpp
===================================================================
--- /trunk/lib/FlairCore/src/RTDM_I2cPort.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/RTDM_I2cPort.cpp	(revision 2)
@@ -0,0 +1,163 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/09/04
+//  filename:   RTDM_RTDM_I2cPort.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for real time i2c port using RTDM
+//
+//
+/*********************************************************************/
+
+#include "RTDM_I2cPort.h"
+
+#ifdef __XENO__
+
+#include <rtdm/rti2c.h>
+#include <errno.h>
+#include <cstring>
+
+using std::string;
+
+namespace flair
+{
+namespace core
+{
+
+RTDM_I2cPort::RTDM_I2cPort(const Object* parent,string name,string device) : I2cPort(parent,name)
+{
+    int err=0;
+    struct rti2c_config write_config;
+
+    //printf("i2c integer le mutex dans le driver, avec acces ioctl\n");
+    fd = rt_dev_open(device.c_str(), 0);
+    if (fd < 0)
+	{
+		Err("rt_dev_open (%s)\n",ObjectName().c_str(),strerror(-fd));
+	}
+
+	write_config.config_mask       = RTI2C_SET_BAUD|RTI2C_SET_TIMEOUT_RX|RTI2C_SET_TIMEOUT_TX;
+	write_config.baud_rate         = 400000;
+	write_config.rx_timeout        = 500000;
+	write_config.tx_timeout        = 1000000;//5ms pour les xbldc, normalement 1ms
+	// the rest implicitely remains default
+
+	// config
+	err = rt_dev_ioctl(fd, RTI2C_RTIOC_SET_CONFIG, &write_config );
+	if (err)
+	{
+	    Err("rt_dev_ioctl RTI2C_RTIOC_SET_CONFIG error (%s)\n",ObjectName().c_str(),strerror(-err));
+	}
+}
+
+RTDM_I2cPort::~RTDM_I2cPort()
+{
+    rt_dev_close(fd);
+}
+
+int RTDM_I2cPort::SetSlave(uint16_t address)
+{
+	int err = rt_dev_ioctl(fd, RTI2C_RTIOC_SET_SLAVE, &address);
+    if (err)
+	{
+	    Err("rt_dev_ioctl RTI2C_RTIOC_SET_SLAVE error (%s)\n",strerror(-err));
+	}
+
+	return err;
+}
+
+void RTDM_I2cPort::SetRxTimeout(Time timeout_ns)
+{
+    struct rti2c_config write_config;
+
+	write_config.config_mask       = RTI2C_SET_TIMEOUT_RX;
+	write_config.rx_timeout        = timeout_ns;
+
+	int err = rt_dev_ioctl(fd, RTI2C_RTIOC_SET_CONFIG, &write_config );
+	if (err)
+	{
+	    Err("rt_dev_ioctl RTI2C_RTIOC_SET_CONFIG (%s)\n",ObjectName().c_str(),strerror(-err));
+	}
+}
+
+void RTDM_I2cPort::SetTxTimeout(Time timeout_ns)
+{
+    struct rti2c_config write_config;
+
+	write_config.config_mask       = RTI2C_SET_TIMEOUT_TX;
+	write_config.tx_timeout        = timeout_ns;
+
+	int err = rt_dev_ioctl(fd, RTI2C_RTIOC_SET_CONFIG, &write_config );
+	if (err)
+	{
+	    Err("rt_dev_ioctl RTI2C_RTIOC_SET_CONFIG (%s)\n",ObjectName().c_str(),strerror(-err));
+	}
+}
+
+ssize_t RTDM_I2cPort::Write(const void *buf,size_t nbyte)
+{
+    return rt_dev_write(fd, buf, nbyte);
+}
+
+ssize_t RTDM_I2cPort::Read(void *buf,size_t nbyte)
+{
+    return rt_dev_read(fd, buf, nbyte);
+}
+
+} // end namespace core
+} // end namespace flair
+
+#else //__XENO__
+
+using std::string;
+using namespace flair::core;
+
+
+namespace flair
+{
+namespace core
+{
+
+RTDM_I2cPort::RTDM_I2cPort(const Object* parent,string name,string device) : I2cPort(parent,name)
+{
+    Err("not available in non real time\n");
+}
+
+RTDM_I2cPort::~RTDM_I2cPort()
+{
+
+}
+
+int RTDM_I2cPort::SetSlave(uint16_t address)
+{
+	return -1;
+}
+
+void RTDM_I2cPort::SetRxTimeout(Time timeout_ns)
+{
+}
+
+void RTDM_I2cPort::SetTxTimeout(Time timeout_ns)
+{
+}
+
+ssize_t RTDM_I2cPort::Write(const void *buf,size_t nbyte)
+{
+    return -1;
+}
+
+ssize_t RTDM_I2cPort::Read(void *buf,size_t nbyte)
+{
+    return -1;
+}
+
+} // end namespace core
+} // end namespace flair
+
+#endif
Index: /trunk/lib/FlairCore/src/RTDM_I2cPort.h
===================================================================
--- /trunk/lib/FlairCore/src/RTDM_I2cPort.h	(revision 2)
+++ /trunk/lib/FlairCore/src/RTDM_I2cPort.h	(revision 2)
@@ -0,0 +1,105 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file RTDM_I2cPort.h
+ * \brief Class for real time i2c port using RTDM
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/08/19
+ * \version 4.0
+ */
+
+#ifndef RTDM_I2CPORT_H
+#define RTDM_I2CPORT_H
+
+#include <I2cPort.h>
+
+namespace flair
+{
+namespace core
+{
+    /*! \class RTDM_I2cPort
+    *
+    * \brief Class for real time i2c port using RTDM
+    *
+    * This class can only be used with the real time version of Framework library.
+    *
+    */
+    class RTDM_I2cPort: public I2cPort
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an RTDM i2c port, with the following default values: \n
+            * - 400kbits baudrate \n
+            * - 500000ns RX timeout \n
+            * - 1000000ns TX timeout
+            *
+            * \param parent parent
+            * \param name name
+            * \param device i2c device (ex rti2c1)
+            */
+            RTDM_I2cPort(const Object* parent,std::string name,std::string device);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~RTDM_I2cPort();
+
+            /*!
+            * \brief Set slave's address
+            *
+            * This method need to be called before any communication.
+            *
+            * \param address slave's address
+            */
+            int SetSlave(uint16_t address);
+
+            /*!
+            * \brief Write datas
+            *
+            * \param buf pointer to datas
+            * \param nbyte length of datas
+            *
+            * \return amount of written datas
+            */
+            ssize_t Write(const void *buf,size_t nbyte);
+
+            /*!
+            * \brief Read datas
+            *
+            * \param buf pointer to datas
+            * \param nbyte length of datas
+            *
+            * \return amount of read datas
+            */
+            ssize_t Read(void *buf,size_t nbyte);
+
+            /*!
+            * \brief Set RX timeout
+            *
+            * Timeout for waiting an ACK from the slave.
+            *
+            * \param timeout_ns timeout in nano second
+            */
+            void SetRxTimeout(Time timeout_ns);
+
+            /*!
+            * \brief Set TX timeout
+            *
+            * Timeout for waiting an ACK from the slave.
+            *
+            * \param timeout_ns timeout in nano second
+            */
+            void SetTxTimeout(Time timeout_ns);
+
+        private:
+            int fd;
+    };
+} // end namespace core
+} // end namespace flair
+
+#endif // RTDM_I2CPORT_H
Index: /trunk/lib/FlairCore/src/RTDM_SerialPort.cpp
===================================================================
--- /trunk/lib/FlairCore/src/RTDM_SerialPort.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/RTDM_SerialPort.cpp	(revision 2)
@@ -0,0 +1,161 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/04/25
+//  filename:   RTDM_SerialPort.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    port serie temps reel
+//
+//
+/*********************************************************************/
+
+#include "RTDM_SerialPort.h"
+
+#ifdef __XENO__
+
+#include <rtdm/rtserial.h>
+#include <errno.h>
+#include <cstring>
+
+using std::string;
+
+namespace flair
+{
+namespace core
+{
+
+RTDM_SerialPort::RTDM_SerialPort(const Object* parent,string name,string device) : SerialPort(parent,name)
+{
+    struct rtser_config write_config;
+
+	write_config.config_mask       = RTSER_SET_BAUD | RTSER_SET_TIMESTAMP_HISTORY,
+	write_config.baud_rate         = 115200,
+	write_config.timestamp_history = RTSER_DEF_TIMESTAMP_HISTORY,
+	// the rest implicitely remains default
+
+	fd = rt_dev_open(device.c_str(), 0);
+	if (fd < 0)
+	{
+		Err("erreur rt_dev_open (%s)\n",strerror(-fd));
+	}
+
+	// config
+	int err = rt_dev_ioctl(fd, RTSER_RTIOC_SET_CONFIG, &write_config );
+	if (err)
+	{
+	    Err("erreur rt_dev_ioctl RTSER_RTIOC_SET_CONFIG (%s)\n",strerror(-err));
+	}
+}
+
+RTDM_SerialPort::~RTDM_SerialPort()
+{
+    rt_dev_close(fd);
+}
+
+void RTDM_SerialPort::SetBaudrate(int baudrate)
+{
+    struct rtser_config write_config;
+
+	write_config.config_mask       = RTSER_SET_BAUD;
+	write_config.baud_rate         = baudrate;
+	// the rest implicitely remains default
+
+	// config
+	int err = rt_dev_ioctl(fd, RTSER_RTIOC_SET_CONFIG, &write_config );
+	if (err)
+	{
+	    Err("erreur rt_dev_ioctl RTSER_RTIOC_SET_CONFIG (%s)\n",strerror(-err));
+	}
+}
+
+void RTDM_SerialPort::SetRxTimeout(core::Time timeout_ns)
+{
+    struct rtser_config write_config;
+
+	write_config.config_mask       = RTSER_SET_TIMEOUT_RX;
+	write_config.rx_timeout         = timeout_ns;
+	// the rest implicitely remains default
+
+	// config
+	int err = rt_dev_ioctl(fd, RTSER_RTIOC_SET_CONFIG, &write_config );
+	if (err)
+	{
+	    Err("erreur rt_dev_ioctl RTSER_RTIOC_SET_CONFIG (%s)\n",strerror(-err));
+	}
+}
+
+void RTDM_SerialPort::FlushInput(void)
+{
+    char tmp;
+
+    SetRxTimeout(1000000);
+    while(rt_dev_read(fd,&tmp,1)==1);
+    SetRxTimeout(TIME_INFINITE);
+}
+
+ssize_t RTDM_SerialPort::Write(const void *buf,size_t nbyte)
+{
+    return rt_dev_write(fd, buf, nbyte);
+}
+
+ssize_t RTDM_SerialPort::Read(void *buf,size_t nbyte)
+{
+    return rt_dev_read(fd, buf, nbyte);
+}
+
+} // end namespace core
+} // end namespace flair
+
+#else //__XENO__
+
+using std::string;
+using namespace flair::core;
+
+
+namespace flair
+{
+namespace core
+{
+
+RTDM_SerialPort::RTDM_SerialPort(const Object* parent,string name,string device) : SerialPort(parent,name)
+{
+    Err("not available in non real time\n");
+}
+
+RTDM_SerialPort::~RTDM_SerialPort()
+{
+
+}
+
+ssize_t RTDM_SerialPort::Write(const void *buf,size_t nbyte)
+{
+    return -1;
+}
+
+ssize_t RTDM_SerialPort::Read(void *buf,size_t nbyte)
+{
+    return -1;
+}
+
+void RTDM_SerialPort::SetBaudrate(int baudrate)
+{
+}
+
+void RTDM_SerialPort::SetRxTimeout(core::Time timeout_ns)
+{
+}
+
+void RTDM_SerialPort::FlushInput(void)
+{
+}
+
+} // end namespace core
+} // end namespace flair
+
+#endif
Index: /trunk/lib/FlairCore/src/RTDM_SerialPort.h
===================================================================
--- /trunk/lib/FlairCore/src/RTDM_SerialPort.h	(revision 2)
+++ /trunk/lib/FlairCore/src/RTDM_SerialPort.h	(revision 2)
@@ -0,0 +1,100 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file RTDM_SerialPort.h
+ * \brief Class for real time serial port using RTDM
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/08/19
+ * \version 4.0
+ */
+
+#ifndef RTDM_SERIALPORT_H
+#define RTDM_SERIALPORT_H
+
+#include <SerialPort.h>
+
+namespace flair
+{
+namespace core
+{
+    /*! \class RTDM_SerialPort
+    *
+    * \brief Class for real time serial port using RTDM
+    *
+    * This class can only be used with the real time version of Framework library.
+    *
+    */
+    class RTDM_SerialPort: public SerialPort
+    {
+
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an RTDM serial port, with the following default values: \n
+            * - 115200bps baudrate
+            *
+            * \param parent parent
+            * \param name name
+            * \param device serial device (ex rtser1)
+            */
+            RTDM_SerialPort(const Object* parent,std::string port_name,std::string device);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~RTDM_SerialPort();
+
+            /*!
+            * \brief Set baudrate
+            *
+            * \param baudrate baudrate
+            *
+            */
+            void SetBaudrate(int baudrate);
+
+            /*!
+            * \brief Set RX timeout
+            *
+            * Timeout for waiting datas.
+            *
+            * \param timeout_ns timeout in nano second
+            */
+            void SetRxTimeout(Time timeout_ns);
+
+            /*!
+            * \brief Write datas
+            *
+            * \param buf pointer to datas
+            * \param nbyte length of datas
+            *
+            * \return amount of written datas
+            */
+            ssize_t Write(const void *buf,size_t nbyte);
+
+            /*!
+            * \brief Read datas
+            *
+            * \param buf pointer to datas
+            * \param nbyte length of datas
+            *
+            * \return amount of read datas
+            */
+            ssize_t Read(void *buf,size_t nbyte);
+
+            /*!
+            * \brief Flush input datas
+            *
+            */
+            void FlushInput(void);
+
+        private:
+            int fd;
+    };
+} // end namespace core
+} // end namespace flair
+
+#endif // RTDM_SERIALPORT_H
Index: /trunk/lib/FlairCore/src/RangeFinderPlot.cpp
===================================================================
--- /trunk/lib/FlairCore/src/RangeFinderPlot.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/RangeFinderPlot.cpp	(revision 2)
@@ -0,0 +1,63 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/07/23
+//  filename:   RangeFinderPlot.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a 2D plot on the ground station for laser range finder like Hokuyo
+//
+//
+/*********************************************************************/
+
+#include "RangeFinderPlot.h"
+#include "cvmatrix.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+#include "FrameworkManager.h"
+#include <cxcore.h>
+
+using std::string;
+using namespace flair::core;
+
+namespace flair { namespace gui {
+
+RangeFinderPlot::RangeFinderPlot(const LayoutPosition* position,string name,
+                                 string x_name,float xmin,float xmax,
+                                 string y_name,float ymin,float ymax,
+                                 const cvmatrix* datas,float start_angle,float end_angle,uint32_t nb_samples):
+                                 SendData(position,name,"RangeFinderPlot",200) {
+    this->datas=datas;
+
+    SetSendSize(datas->GetDataType().GetSize());
+
+    SetVolatileXmlProp("xmin",xmin);
+    SetVolatileXmlProp("xmax",xmax);
+    SetVolatileXmlProp("ymin",ymin);
+    SetVolatileXmlProp("ymax",ymax);
+    SetVolatileXmlProp("x_name",x_name);
+    SetVolatileXmlProp("y_name",y_name);
+    SetVolatileXmlProp("start_angle",start_angle);
+    SetVolatileXmlProp("end_angle",end_angle);
+    SetVolatileXmlProp("nb_samples",nb_samples);
+    SetVolatileXmlProp("type",datas->GetDataType().GetElementDataType().GetDescription());
+    SendXml();
+
+    if(datas->Cols()!=1 || datas->Rows()!=nb_samples) Err("Wrong input matrix size\n");
+}
+
+RangeFinderPlot::~RangeFinderPlot() {}
+
+void RangeFinderPlot::CopyDatas(char* buf) const {
+    datas->GetMutex();
+    memcpy(buf,datas->getCvMat()->data.ptr,datas->GetDataType().GetSize());
+    datas->ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/RangeFinderPlot.h
===================================================================
--- /trunk/lib/FlairCore/src/RangeFinderPlot.h	(revision 2)
+++ /trunk/lib/FlairCore/src/RangeFinderPlot.h	(revision 2)
@@ -0,0 +1,96 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file RangeFinderPlot.h
+ * \brief Class displaying a 2D plot on the ground station for laser range finder like Hokuyo
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/07/23
+ * \version 4.0
+ */
+
+#ifndef RANGEFINDERPLOT_H
+#define RANGEFINDERPLOT_H
+
+#include <SendData.h>
+#include <stdint.h>
+
+namespace flair
+{
+    namespace core
+    {
+        class cvmatrix;
+    }
+}
+
+namespace flair
+{
+namespace gui
+{
+
+    class LayoutPosition;
+
+    /*! \class RangeFinderPlot
+    *
+    * \brief Class displaying a 2D plot on the ground station for laser range finder like Hokuyo
+    *
+    */
+    class RangeFinderPlot: public SendData
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a 2D plot at given position. \n
+            * The RangeFinderPlot will automatically be child of position->getLayout() Layout. After calling this constructor,
+            * position will be deleted as it is no longer usefull.
+            *
+            * \param position position to display the plot
+            * \param name name
+            * \param x_name name of x axis
+            * \param xmin default xmin of the plot
+            * \param xmax default xmax of the plot
+            * \param y_name name of y axis
+            * \param ymin default ymin of the plot
+            * \param ymax default ymax of the plot
+            * \param datas laser datas
+            * \param start_angle start angle of the laser
+            * \param end_angle end angle of the laser
+            * \param nb_samples number of samples
+            */
+            RangeFinderPlot(const LayoutPosition* position,std::string name,
+                            std::string x_name,float xmin,float xmax,
+                            std::string y_name,float ymin,float ymax,
+                            const core::cvmatrix* datas,float start_angle,float end_angle,uint32_t nb_samples);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~RangeFinderPlot();
+
+        private:
+            /*!
+            * \brief Copy datas to specified buffer
+            *
+            * Reimplemented from SendData.
+            *
+            * \param buf output buffer
+            */
+            void CopyDatas(char* buf) const;
+
+            /*!
+            * \brief Extra Xml event
+            *
+            * Reimplemented from SendData.
+            */
+            void ExtraXmlEvent(void){};
+
+            const core::cvmatrix* datas;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // RANGEFINDERPLOT_H
Index: /trunk/lib/FlairCore/src/RotationMatrix.cpp
===================================================================
--- /trunk/lib/FlairCore/src/RotationMatrix.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/RotationMatrix.cpp	(revision 2)
@@ -0,0 +1,75 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/02/09
+//  filename:   RotationMatrix.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a rotation matrix
+//
+//
+/*********************************************************************/
+
+#include "RotationMatrix.h"
+#include "Object.h"
+#include "Euler.h"
+#include "math.h"
+
+namespace flair
+{
+namespace core
+{
+
+RotationMatrix::RotationMatrix() {
+    for(int i=0;i<3;i++) {
+        for(int j=0;j<3;j++) {
+            if(i==j) {
+                m[i][j]=1;
+            }else {
+                m[i][j]=0;
+            }
+        }
+    }
+}
+
+RotationMatrix::~RotationMatrix() {
+
+}
+
+void RotationMatrix::ToEuler(Euler &euler) const {
+    euler.roll=atanf(m[1][2]/m[2][2]);
+    euler.pitch=asinf(-m[0][2]);
+    euler.yaw=atan2f(m[0][1],m[0][0]);
+}
+
+Euler RotationMatrix::ToEuler(void) const {
+    Euler euler;
+    ToEuler(euler);
+    return euler;
+}
+
+float& RotationMatrix::operator()(size_t row,size_t col) {
+    if(row<3 && col<3) {
+        return m[row][col];
+    } else {
+        Printf("RotationMatrix: index (%i,%i) out of bound\n",row,col);
+        return m[2][2];
+    }
+}
+
+const float& RotationMatrix::operator()(size_t row,size_t col) const {
+    if(row<3 && col<3) {
+        return m[row][col];
+    } else {
+        Printf("RotationMatrix: index (%i,%i) out of bound\n",row,col);
+        return m[2][2];
+    }
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/RotationMatrix.h
===================================================================
--- /trunk/lib/FlairCore/src/RotationMatrix.h	(revision 2)
+++ /trunk/lib/FlairCore/src/RotationMatrix.h	(revision 2)
@@ -0,0 +1,67 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file RotationMatrix.h
+ * \brief Class defining a rotation matrix
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/02/09
+ * \version 4.0
+ */
+#ifndef ROTATIONMATRIX_H
+#define ROTATIONMATRIX_H
+
+#include <stddef.h>
+
+namespace flair {
+namespace core {
+    class Euler;
+
+    /*! \class RotationMatrix
+    *
+    * \brief Class defining a rotation matrix
+    */
+    class RotationMatrix {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an identity rotation matrix
+            *
+            */
+            RotationMatrix();
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~RotationMatrix();
+
+            /*!
+            * \brief Convert to euler angles
+            *
+            * \param euler output euler angles
+            */
+            void ToEuler(Euler &euler) const;
+
+            /*!
+            * \brief Convert to euler angles
+            *
+            * \return euler angles
+            */
+            Euler ToEuler(void) const;
+            /*!
+            * \brief matrix
+            *
+            */
+            float m[3][3];
+
+            float& operator()(size_t row,size_t col);
+            const float& operator()(size_t row,size_t col) const;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // ROTATIONMATRIX_H
Index: /trunk/lib/FlairCore/src/SendData.cpp
===================================================================
--- /trunk/lib/FlairCore/src/SendData.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/SendData.cpp	(revision 2)
@@ -0,0 +1,125 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/07
+//  filename:   SendData.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class for sending datas to ground station
+//
+//
+/*********************************************************************/
+
+#include "SendData.h"
+#include "SendData_impl.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+#include "FrameworkManager.h"
+#include "FrameworkManager_impl.h"
+
+using namespace std;
+using namespace flair::core;
+
+namespace flair
+{
+namespace gui
+{
+
+SendData::SendData(const LayoutPosition* position,string name,string type,uint16_t default_periodms,bool default_enabled) :Widget(position->getLayout(),name,type) {
+    pimpl_=new SendData_impl();
+
+    pimpl_->send_size=0;
+
+    //default refesh rate: (ms)
+    pimpl_->send_period=default_periodms;
+    pimpl_->is_enabled=default_enabled;
+
+    SetVolatileXmlProp("row",position->Row());
+    SetVolatileXmlProp("col",position->Col());
+    GetPersistentXmlProp("period",pimpl_->send_period);
+    SetPersistentXmlProp("period",pimpl_->send_period);
+    GetPersistentXmlProp("enabled",pimpl_->is_enabled);
+    SetPersistentXmlProp("enabled",pimpl_->is_enabled);
+
+    delete position;
+
+    if(getUiCom()!=NULL) {
+        //register SendData for sending to ground station
+        getUiCom()->AddSendData(this);
+        //resume if necessary
+        getUiCom()->UpdateSendData(this);
+    }
+}
+
+SendData::~SendData() {
+    if(getUiCom()!=NULL) {
+        //unregister SendData for sending to ground station
+        getUiCom()->RemoveSendData(this);
+    }
+
+    delete pimpl_;
+}
+
+void SendData::XmlEvent(void) {
+    uint16_t send_period;
+    bool is_enabled;
+    bool something_changed=false;
+
+    if(GetPersistentXmlProp("period",send_period) && GetPersistentXmlProp("enabled",is_enabled)) {
+        if(send_period!=SendPeriod()) something_changed=true;
+        if(is_enabled!=IsEnabled()) something_changed=true;
+    }
+
+    if(something_changed) {
+        getFrameworkManager()->BlockCom();
+
+        SetSendPeriod(send_period);
+        SetEnabled(is_enabled);
+
+        getFrameworkManager()->UpdateSendData(this);
+
+        //ack pour la station sol
+        //period and enabled are already in persistent prop
+        SetVolatileXmlProp("period",send_period);
+        SetVolatileXmlProp("enabled",is_enabled);
+        SendXml();
+
+        getFrameworkManager()->UnBlockCom();
+    }
+
+    ExtraXmlEvent();
+}
+
+size_t SendData::SendSize(void) const {
+    return pimpl_->send_size;
+}
+
+uint16_t SendData::SendPeriod(void) const {
+    return pimpl_->send_period;
+}
+
+bool SendData::IsEnabled(void) const {
+    return pimpl_->is_enabled;
+}
+
+void SendData::SetEnabled(bool value) {
+    pimpl_->is_enabled=value;
+}
+
+void SendData::SetSendSize(size_t value) {
+    pimpl_->send_size=value;
+
+    if(getUiCom()!=NULL) getUiCom()->UpdateDataToSendSize();
+}
+
+void SendData::SetSendPeriod(uint16_t value) {
+    pimpl_->send_period=value;
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/SendData.h
===================================================================
--- /trunk/lib/FlairCore/src/SendData.h	(revision 2)
+++ /trunk/lib/FlairCore/src/SendData.h	(revision 2)
@@ -0,0 +1,100 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SendData.h
+ * \brief Abstract class for sending datas to ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/07
+ * \version 4.0
+ */
+
+#ifndef SENDDATA_H
+#define SENDDATA_H
+
+#include <Widget.h>
+
+class SendData_impl;
+
+namespace flair
+{
+namespace gui
+{
+    class LayoutPosition;
+
+    /*! \class SendData
+    *
+    * \brief Abstract class for sending datas to ground station
+    *
+    */
+    class SendData: public Widget
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            */
+            SendData(const LayoutPosition* position,std::string name,std::string type,uint16_t default_periodms=100,bool default_enabled=false);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            virtual ~SendData();
+
+            /*!
+            * \brief Copy datas to specified buffer
+            *
+            * This method must be reimplemented, in order to send datas to ground station.
+            *
+            * \param buf output buffer
+            */
+            virtual void CopyDatas(char* buf) const =0;
+
+            size_t SendSize(void) const;
+            uint16_t SendPeriod(void) const; // in ms
+            bool IsEnabled(void) const;
+
+        protected:
+
+            /*!
+            * \brief Notify that SenData's datas have changed
+            *
+            * This method must be called when the datas have changed. \n
+            * Normally, it occurs when a curve is added to a plot for example. \n
+            * This method automatically blocks and unblocks the communication.
+            *
+            */
+            void SetSendSize(size_t value);
+
+            /*!
+            * \brief Extra Xml event
+            *
+            * This method must be reimplemented to handle extra xml event. \n
+            * It is automatically called when something changed from
+            * ground station, through XmlEvent method. \n
+            */
+            virtual void ExtraXmlEvent(void)=0;
+
+        private:
+            /*!
+            * \brief XmlEvent from ground station
+            *
+            * Reimplemented from Widget. \n
+            * This method handles period and enabled properties of the SendData. \n
+            * Then it calls ExtraXmlEvent to handle specific xml events of reimplemented class.
+            *
+            */
+            void XmlEvent(void);
+
+            void SetSendPeriod(uint16_t value);
+            void SetEnabled(bool value);
+
+            class SendData_impl* pimpl_;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // SENDDATA_H
Index: /trunk/lib/FlairCore/src/SendData_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/SendData_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/SendData_impl.cpp	(revision 2)
@@ -0,0 +1,26 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/07
+//  filename:   SendData.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Base class for sending datas to ground station
+//
+//
+/*********************************************************************/
+
+#include "SendData_impl.h"
+
+SendData_impl::SendData_impl()
+{
+}
+
+SendData_impl::~SendData_impl()
+{
+}
Index: /trunk/lib/FlairCore/src/SerialPort.h
===================================================================
--- /trunk/lib/FlairCore/src/SerialPort.h	(revision 2)
+++ /trunk/lib/FlairCore/src/SerialPort.h	(revision 2)
@@ -0,0 +1,94 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SerialPort.h
+ * \brief Base class for serial port
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/04/25
+ * \version 4.0
+ */
+
+#ifndef SERIALPORT_H
+#define SERIALPORT_H
+
+#include <Object.h>
+#include <stdint.h>
+
+namespace flair
+{
+namespace core
+{
+    /*! \class SerialPort
+    *
+    * \brief Base class for serial port
+    */
+    class SerialPort: public Object
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a serial port.
+            *
+            * \param parent parent
+            * \param name name
+            */
+            SerialPort(const Object* parent,std::string name): Object(parent,name)
+            {}
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~SerialPort(){};
+
+            /*!
+            * \brief Set baudrate
+            *
+            * \param baudrate baudrate
+            *
+            */
+            virtual void SetBaudrate(int baudrate)=0;
+
+            /*!
+            * \brief Set RX timeout
+            *
+            * Timeout for waiting datas.
+            *
+            * \param timeout_ns timeout in nano second
+            */
+            virtual void SetRxTimeout(Time timeout_ns)=0;
+
+            /*!
+            * \brief Write datas
+            *
+            * \param buf pointer to datas
+            * \param nbyte length of datas
+            *
+            * \return amount of written datas
+            */
+            virtual ssize_t Write(const void *buf,size_t nbyte)=0;
+
+            /*!
+            * \brief Read datas
+            *
+            * \param buf pointer to datas
+            * \param nbyte length of datas
+            *
+            * \return amount of read datas
+            */
+            virtual ssize_t Read(void *buf,size_t nbyte)=0;
+
+            /*!
+            * \brief Flush input datas
+            *
+            */
+            virtual void FlushInput(void)=0;
+
+    };
+} // end namespace core
+} // end namespace framework
+
+#endif // SERIALPORT_H
Index: /trunk/lib/FlairCore/src/SharedMem.cpp
===================================================================
--- /trunk/lib/FlairCore/src/SharedMem.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/SharedMem.cpp	(revision 2)
@@ -0,0 +1,49 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/10
+//  filename:   SharedMem.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a shared memory
+//
+//
+/*********************************************************************/
+
+#include "SharedMem.h"
+#include "SharedMem_impl.h"
+
+using std::string;
+
+namespace flair
+{
+namespace core
+{
+
+SharedMem::SharedMem(const Object* parent,string name,size_t size): Object(parent,name,"shmem")
+{
+    pimpl_=new SharedMem_impl(this,name,size);
+}
+
+SharedMem::~SharedMem()
+{
+    delete pimpl_;
+}
+
+void SharedMem::Write(const char* buf,size_t size)
+{
+    pimpl_->Write(buf,size);
+}
+
+void SharedMem::Read(char* buf,size_t size) const
+{
+    pimpl_->Read(buf,size);
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/SharedMem.h
===================================================================
--- /trunk/lib/FlairCore/src/SharedMem.h	(revision 2)
+++ /trunk/lib/FlairCore/src/SharedMem.h	(revision 2)
@@ -0,0 +1,77 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SharedMem.h
+ * \brief Class defining a shared memory
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/10
+ * \version 4.0
+ */
+
+#ifndef SHAREDMEM_H
+#define SHAREDMEM_H
+
+#include <Object.h>
+#include <semaphore.h>
+
+class SharedMem_impl;
+
+namespace flair
+{
+namespace core
+{
+
+    /*! \class SharedMem
+    *
+    * \brief Class defining a shared memory
+    *
+    * Shared memory is identified by its name so it can be accessed
+    * by another processus using its name.
+    */
+
+    class SharedMem: public Object
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a shared memory object
+            *
+            * \param parent parent
+            * \param name name
+            * \param size size of the shared memory
+            */
+            SharedMem(const Object* parent,std::string name,size_t size);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~SharedMem();
+
+            /*!
+            * \brief Write
+            *
+            * \param buf input buffer to write to memory
+            * \param size buffer size
+            */
+            void Write(const char* buf,size_t size);
+
+            /*!
+            * \brief Read
+            *
+            * \param buf output buffer to write from memory
+            * \param size buffer size
+            */
+            void Read(char* buf,size_t size) const;
+
+        private:
+            SharedMem_impl* pimpl_;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // SHAREDMEM_H
Index: /trunk/lib/FlairCore/src/SharedMem_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/SharedMem_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/SharedMem_impl.cpp	(revision 2)
@@ -0,0 +1,186 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/10
+//  filename:   SharedMem_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a shared memory
+//
+//
+/*********************************************************************/
+
+#include "SharedMem_impl.h"
+#include "SharedMem.h"
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/mman.h>
+#include <string.h>
+
+using std::string;
+using namespace flair::core;
+
+SharedMem_impl::SharedMem_impl(const SharedMem* self,string name,size_t size)
+{
+    this->size=size;
+    this->self=self;
+
+#ifdef __XENO__
+    heap_binded=false;
+    int status=rt_heap_create(&heap,name.c_str(),size,H_SHARED|H_FIFO|H_NONCACHED);
+    if(status==-EEXIST)
+    {
+        heap_binded=true;
+        status=rt_heap_bind(&heap,name.c_str(),TM_INFINITE);
+    }
+    if(status!=0)
+    {
+        self->Err("rt_heap_create error (%s)\n",strerror(-status));
+        return;
+    }
+
+    void *ptr;
+    status=rt_heap_alloc(&heap,0,TM_NONBLOCK ,&ptr);
+    if(status!=0)
+    {
+        self->Err("rt_heap_alloc error (%s)\n",strerror(-status));
+    }
+    mem_segment =(char*)ptr;
+
+    mutex_binded=false;
+    string mutex_name="mutex_"+ name;
+    status=rt_mutex_create(&mutex,mutex_name.c_str());
+    if(status==-EEXIST)
+    {
+        mutex_binded=true;
+        status=rt_mutex_bind(&mutex,mutex_name.c_str(),TM_INFINITE);
+    }
+    if(status!=0)
+    {
+        self->Err("rt_mutex_create error (%s)\n",strerror(-status));
+        return;
+    }
+
+#else
+    shm_name="/" + name;
+    fd = shm_open(shm_name.c_str(), O_RDWR | O_CREAT, 0666);
+    if (fd == -1)
+    {
+        self->Err("Error creating shared memory\n");
+    }
+    ftruncate(fd, size);
+
+    sem_name="/"  +name;
+    sem = sem_open(sem_name.c_str(), O_CREAT, 0666, 1);
+    if (sem == SEM_FAILED)
+    {
+        self->Err("Error creating semaphore\n");
+    }
+
+    mem_segment =(char*)mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
+    if (mem_segment == MAP_FAILED)
+    {
+        self->Err("Failed to map memory\n");
+    }
+#endif
+}
+
+SharedMem_impl::~SharedMem_impl()
+{
+    int status;
+#ifdef __XENO__
+    /* unnecessary because heap is opened in H_SINGLE mode
+    status=rt_heap_free(&heap,mem_segment);
+    if(status!=0)
+    {
+        self->Err("rt_heap_free error (%s)\n",strerror(-status));
+    }
+    */
+
+    if(heap_binded==false)
+    {
+        status=rt_heap_delete(&heap);
+        if(status!=0)
+        {
+            self->Err("rt_heap_delete error (%s)\n",strerror(-status));
+        }
+    }
+
+    if(mutex_binded==false)
+    {
+        status=rt_mutex_delete(&mutex);
+        if(status!=0)
+        {
+            self->Err("error destroying mutex (%s)\n",strerror(-status));
+        }
+    }
+#else
+    status = munmap(mem_segment, size);
+    if(status!=0)
+    {
+        self->Err("Failed to unmap memory (%s)\n",strerror(-status));
+    }
+
+    status = close(fd);
+    if(status!=0)
+    {
+        self->Err("Failed to close file (%s)\n",strerror(-status));
+    }
+
+    //do not check erros as it can be done by another process
+    status = shm_unlink(shm_name.c_str());/*
+    if(status!=0)
+    {
+        self->Err("Failed to unlink memory (%s)\n",strerror(-status));
+    }
+*/
+    //do not check erros as it can be done by another process
+    status = sem_unlink(sem_name.c_str());/*
+    if(status!=0)
+    {
+        self->Err("Failed to unlink semaphore (%s)\n",strerror(-status));
+    }*/
+
+    status = sem_close(sem);
+    if(status!=0)
+    {
+        self->Err("Failed to close semaphore (%s)\n",strerror(-status));
+    }
+#endif
+}
+
+
+void SharedMem_impl::Write(const char* buf,size_t size)
+{
+#ifdef __XENO__
+    int status=rt_mutex_acquire(&mutex,TM_INFINITE);
+    if(status!=0) self->Err("error (%s)\n",strerror(-status));
+    memcpy(mem_segment,buf,size);
+    status=rt_mutex_release(&mutex);
+    if(status!=0) self->Err("error (%s)\n",strerror(-status));
+#else
+    sem_wait(sem);
+    memcpy(mem_segment,buf,size);
+    sem_post(sem);
+#endif
+}
+
+void SharedMem_impl::Read(char* buf,size_t size)
+{
+#ifdef __XENO__
+    int status=rt_mutex_acquire(&mutex,TM_INFINITE);
+    if(status!=0) self->Err("error (%s)\n",strerror(-status));
+    memcpy(buf,mem_segment,size);
+    status=rt_mutex_release(&mutex);
+    if(status!=0) self->Err("error (%s)\n",strerror(-status));
+#else
+    sem_wait(sem);
+    memcpy(buf,mem_segment,size);
+    sem_post(sem);
+#endif
+}
Index: /trunk/lib/FlairCore/src/Socket.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Socket.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Socket.cpp	(revision 2)
@@ -0,0 +1,83 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/11/17
+//  filename:   Socket.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a UDP socket
+//
+//
+/*********************************************************************/
+#include "Socket.h"
+#include "Socket_impl.h"
+#include <FrameworkManager.h>
+#include <string.h>
+#include <stdexcept>
+
+using std::string;
+
+namespace flair
+{
+namespace core
+{
+
+Socket::Socket(const Object* parent, string name,uint16_t port): Object(parent,name) {
+    pimpl_=new Socket_impl(this,name,port);
+}
+
+Socket::Socket(const Object* parent, string name,string address,bool broadcast): Object(parent,name) {
+    pimpl_=new Socket_impl(this,name,address,broadcast);
+}
+
+Socket::~Socket() {
+    delete pimpl_;
+}
+
+void Socket::SendMessage(const char* message,size_t message_len) {
+    pimpl_->SendMessage(message,message_len);
+}
+
+void Socket::SendMessage(string message) {
+    pimpl_->SendMessage(message);
+}
+
+ssize_t Socket::RecvMessage(char* buf,size_t buf_len,Time timeout,char* src,size_t* src_len) {
+    return pimpl_->RecvMessage(buf,buf_len,timeout,src,src_len);
+}
+
+void Socket::NetworkToHost(char *data,size_t dataSize) {
+    if (core::IsBigEndian()) return;
+    if (dataSize==1) return;
+    if ((dataSize==2)||(dataSize==4)||(dataSize==8)||(dataSize==16)) {
+        char dataInHostEndianness[dataSize];
+        for (unsigned int i=0;i<dataSize;i++) {
+            dataInHostEndianness[i]=data[dataSize-i-1];
+        }
+        memcpy(data,dataInHostEndianness,dataSize);
+        return;
+    }
+    throw std::runtime_error(string("Unsupported data size (")+std::to_string(dataSize)+string(") in host to network endianness conversion"));
+}
+
+void Socket::HostToNetwork(char *data,size_t dataSize) {
+    if (IsBigEndian()) return;
+    if (dataSize==1) return;
+    if ((dataSize==2)||(dataSize==4)||(dataSize==8)||(dataSize==16)) {
+        char dataInNetworkEndianness[dataSize];
+        for (unsigned int i=0;i<dataSize;i++) {
+            dataInNetworkEndianness[i]=data[dataSize-i-1];
+        }
+        memcpy(data,dataInNetworkEndianness,dataSize);
+        return;
+    }
+    throw std::runtime_error(string("Unsupported data size (")+std::to_string(dataSize)+string(") in host to network endianness conversion"));
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Socket.h
===================================================================
--- /trunk/lib/FlairCore/src/Socket.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Socket.h	(revision 2)
@@ -0,0 +1,109 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Socket.h
+ * \brief Class defining a UDP socket
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/11/17
+ * \version 4.0
+ */
+
+#ifndef SOCKET_H
+#define SOCKET_H
+
+#include <unistd.h>
+#include <stdint.h>
+#include <Object.h>
+
+class Socket_impl;
+
+namespace flair
+{
+namespace core
+{
+
+    /*! \class Socket
+    *
+    * \brief Class encapsulating a UDP socket. It assumes packets are coming from only one distant host on a given port.
+    *
+    */
+    class Socket: public Object {
+    public:
+        /*!
+        * \brief Constructor
+        *
+        * Construct the client side of the socket
+        *
+        * \param parent parent
+        * \param name name
+        * \param address server address (ex 192.168.1.1:9000)
+        * \param broadcast true if address is a broadcast address
+        */
+        Socket(const Object* parent, std::string name,std::string address,bool broadcast=false);
+
+        /*!
+        * \brief Constructor
+        *
+        * Construct the server side of the socket
+        *
+        * \param parent parent
+        * \param name name
+        * \param port listening port
+        */
+        Socket(const Object* parent, std::string name,uint16_t port);
+
+        /*!
+        * \brief Destructor
+        *
+        */
+        ~Socket();
+
+        /*!
+        * \brief Send a message
+        *
+        * In case of a broadcast Socket, Parent()->ObjectName() is used as source of the message, this name should be unique.
+        *
+        * \param message message
+        */
+        void SendMessage(std::string message);
+
+        /*!
+        * \brief Send a message
+        *
+        * \param message message
+        * \param message_len message length
+        */
+        void SendMessage(const char* message,size_t message_len);
+
+        /*!
+        * \brief Receive a message
+        *
+        * Receive a message and wait up to timeout. \n
+        * If src and src_len are specified, the source of the message will be
+        * copied in the src buffer. \n
+        * Note that in case of a broadcast socket, own messages are filtered and
+        * are not received.
+        *
+        * \param buf buffer to put the message
+        * \param buf_len buffer length
+        * \param timeout timeout
+        * \param src buffer to put source name
+        * \param src_len buffer length
+        *
+        * \return size of the received message
+        */
+        ssize_t RecvMessage(char* buf,size_t buf_len,Time timeout,char* src=NULL,size_t* src_len=NULL);
+
+        void NetworkToHost(char *data,size_t dataSize);
+        void HostToNetwork(char *data,size_t dataSize);
+
+    private:
+       class Socket_impl* pimpl_;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // SOCKET_H
Index: /trunk/lib/FlairCore/src/Socket_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Socket_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Socket_impl.cpp	(revision 2)
@@ -0,0 +1,400 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/11/17
+//  filename:   Socket_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe pour une Socket_impl
+//
+//
+/*********************************************************************/
+#include "Socket_impl.h"
+#include "Socket.h"
+#include "FrameworkManager.h"
+#include <fcntl.h>
+#include <cstdlib>
+#include <unistd.h>
+#include <string.h>
+#ifdef __XENO__
+#include "config.h"
+#endif
+
+using std::string;
+using namespace flair::core;
+
+Socket_impl::Socket_impl(const Socket* self,string name,uint16_t port)
+{
+    this->self=self;
+    this->port=port;
+    this->address="";
+    this->broadcast=false;
+    Init();
+}
+
+Socket_impl::Socket_impl(const Socket* self,string name,string address,bool broadcast)
+{
+    this->self=self;
+    int pos = address.find(":");
+    this->address=address.substr (0,pos);
+    port=atoi(address.substr(pos+1).c_str());
+    this->broadcast=broadcast;
+
+    if(pos==0 || address=="")
+    {
+        self->Err("address %s is not correct\n",address.c_str());
+    }
+    Init();
+
+}
+
+void Socket_impl::Init(void)
+{
+	int yes=1;
+
+    fd = socket(AF_INET, SOCK_DGRAM, 0); //UDP
+
+    if(broadcast==true)
+    {
+        if(setsockopt(fd, SOL_SOCKET, SO_BROADCAST, &yes, sizeof(int) )!=0)
+            self->Err("Setsockopt error\n");
+    }
+
+    if(setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int) )!=0)
+        self->Err("Setsockopt error\n");
+
+    if(address=="" || broadcast==true)
+    {
+        sockaddr_in sin = { 0 };
+
+        if(broadcast==true)
+        {
+            struct hostent *hostinfo;
+
+            hostinfo = gethostbyname(this->address.c_str());
+            if (hostinfo == NULL)
+            {
+                self->Err("hostinfo error\n");
+            }
+            sin.sin_addr = *(in_addr *) hostinfo->h_addr;
+        }
+        else
+        {
+            sin.sin_addr.s_addr=INADDR_ANY;
+        }
+
+        sin.sin_port = htons(port);
+        sin.sin_family = AF_INET;
+        if(bind(fd,(sockaddr *) &sin, sizeof sin) == -1)
+        {
+            self->Err("bind error\n");
+        }
+    }
+
+
+#ifdef __XENO__
+    string tmp_name;
+    int status;
+    is_running=true;
+
+    //pipe
+    tmp_name= getFrameworkManager()->ObjectName() + "-" + self->ObjectName()+ "-pipe";
+    //xenomai limitation
+    if(tmp_name.size()>31) self->Err("rt_pipe_create error (%s is too long)\n",tmp_name.c_str());
+#ifdef RT_PIPE_SIZE
+    status=rt_pipe_create(&pipe, tmp_name.c_str(), P_MINOR_AUTO,RT_PIPE_SIZE);
+#else
+    status=rt_pipe_create(&pipe, tmp_name.c_str(), P_MINOR_AUTO,0);
+#endif
+    if(status!=0)
+    {
+        self->Err("rt_pipe_create error (%s)\n",strerror(-status));
+    }
+
+    //start user side thread
+#ifdef NRT_STACK_SIZE
+    // Initialize thread creation attributes
+    pthread_attr_t attr;
+    if(pthread_attr_init(&attr) != 0)
+    {
+        self->Err("pthread_attr_init error\n");
+    }
+    if(pthread_attr_setstacksize(&attr, NRT_STACK_SIZE) != 0)
+    {
+        self->Err("pthread_attr_setstacksize error\n");
+    }
+    if(pthread_create(&user_thread,  &attr, user, (void*)this) < 0)
+    {
+        self->Err("pthread_create error\n");
+    }
+    if(pthread_attr_destroy(&attr) != 0)
+    {
+        self->Err("pthread_attr_destroy error\n");
+    }
+#else //NRT_STACK_SIZE
+    if(pthread_create(&user_thread, NULL, user, (void*)this) < 0)
+    {
+        self->Err("pthread_create error\n");
+    }
+#endif //NRT_STACK_SIZE
+#endif //__XENO__
+
+    if(address!="")
+    {
+        struct hostent *hostinfo;
+        hostinfo = gethostbyname(address.c_str());
+        if (hostinfo == NULL)
+        {
+            self->Err("gethostbyname\n");
+        }
+
+        sock_in.sin_addr=*(in_addr *) hostinfo->h_addr;
+        sock_in.sin_port = htons(port);
+        sock_in.sin_family = AF_INET;
+    }
+}
+
+Socket_impl::~Socket_impl()
+{
+#ifdef __XENO__
+    is_running=false;
+
+    pthread_join(user_thread,NULL);
+    int status=rt_pipe_delete(&pipe);
+    if(status!=0) self->Err("rt_pipe_delete error (%s)\n",strerror(-status));
+
+#endif
+    close(fd);
+}
+
+void Socket_impl::SendMessage(const char* src,size_t src_len)
+{
+    ssize_t written;
+    string to_send;
+
+    if(broadcast==true)
+    {
+        to_send=getFrameworkManager()->ObjectName()+ ":" + string(src, src_len);
+        src_len=to_send.size();
+        src=(char*)to_send.c_str();
+    }
+
+#ifdef __XENO__
+//Printf("send pipe %s\n",src);
+    written=rt_pipe_write(&pipe,src,src_len,P_NORMAL);
+
+    if(written<0)
+    {
+        self->Err("rt_pipe_write error (%s)\n",strerror(-written));
+    }
+    else if (written != (ssize_t)src_len)
+    {
+        self->Err("rt_pipe_write error %i/%i\n",written,to_send.size());
+    }
+#else
+    written=sendto(fd,src,src_len, 0, (struct sockaddr *) &sock_in, sizeof(sock_in));
+
+    if(written!=(ssize_t)src_len)
+    {
+        self->Err("sendto error\n");
+    }
+#endif
+}
+
+void Socket_impl::SendMessage(string message)
+{
+    ssize_t written;
+
+    if(broadcast==true) message=self->Parent()->ObjectName()+ ":" + message;
+    //Printf("SendMessage %s\n",message.c_str());
+#ifdef __XENO__
+    written=rt_pipe_write(&pipe,message.c_str(),message.size(),P_NORMAL);
+
+    if(written<0)
+    {
+        self->Err("rt_pipe_write error (%s)\n",strerror(-written));
+    }
+    else if (written != (ssize_t)message.size())
+    {
+        self->Err("rt_pipe_write error %i/%i\n",written,message.size());
+    }
+#else
+    written=sendto(fd,message.c_str(),message.size(), 0, (struct sockaddr *) &sock_in, sizeof(sock_in));
+    if(written!=(ssize_t)message.size())
+    {
+        self->Err("sendto error\n");
+    }
+
+#endif
+}
+
+ssize_t Socket_impl::RecvMessage(char* msg,size_t msg_len,Time timeout,char* src,size_t* src_len)
+{
+    ssize_t nb_read;
+    char buffer[128];
+#ifdef __XENO__
+    nb_read=rt_pipe_read(&pipe,&buffer,sizeof(buffer),timeout);
+#else
+    socklen_t sinsize = sizeof(sock_in);
+    struct timeval tv;
+
+    if(timeout!=TIME_NONBLOCK) {
+        int attr=fcntl(fd, F_GETFL,0);
+        fcntl(fd, F_SETFL, attr & (~O_NONBLOCK));
+
+        tv.tv_sec = timeout/1000000000;
+        timeout=timeout-(timeout/1000000000)*1000000000;
+        tv.tv_usec = timeout/1000;
+        if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO,&tv,sizeof(tv)) < 0) {
+            self->Err("setsockopt SO_RCVTIMEO failed\n");
+        }
+    } else {
+        fcntl(fd, F_SETFL, O_NONBLOCK);
+    }
+
+    if(broadcast==false) {
+        nb_read = recvfrom(fd, buffer, sizeof(buffer), 0, (sockaddr *) &sock_in, &sinsize);
+    } else {
+        nb_read = recvfrom(fd, buffer, sizeof(buffer), 0, NULL,NULL);
+    }
+#endif
+    if(nb_read<=0) {
+        return nb_read;
+    } else {
+        //printf("%s\n",buffer);
+        if(broadcast==true) {
+            int index=-1;
+            for(int i=0;i<nb_read;i++) {
+                if(buffer[i]==':') {
+                    index=i;
+                    break;
+                }
+            }
+            if(index<0) {
+                self->Warn("Malformed message\n");
+                return -1;
+            } else if(src_len!=NULL && src!=NULL) {
+                if(index+1>(int)(*src_len) && src!=NULL) { //+1 pour inserer un 0)
+                    self->Warn("insufficent src size\n");
+                    return -1;
+                }
+            } else if(nb_read-index-1+1>(int)msg_len) { //+1 pour inserer un 0
+                self->Warn("insufficent msg size (%i/%i)\n",nb_read-index-1+1,msg_len);
+                return -1;
+            }
+            if(src!=NULL) {
+                memcpy(src,buffer,index);
+                src[index]=0;
+            }
+            memcpy(msg,&buffer[index+1],nb_read-index-1);
+            msg[nb_read-index-1]=0;
+            return nb_read-index;
+        } else {
+            if(nb_read>(int)msg_len) {
+                self->Warn("insufficent msg size (%i/%i)\n",nb_read,msg_len);
+                return -1;
+            }
+            memcpy(msg,buffer,nb_read);
+            return nb_read;
+        }
+    }
+}
+
+#ifdef __XENO__
+void* Socket_impl::user(void * arg)
+{
+    Socket_impl *caller = (Socket_impl*)arg;
+    int pipe_fd=-1;
+    string devname;
+
+    devname= NRT_PIPE_PATH + getFrameworkManager()->ObjectName() + "-" + caller->self->ObjectName()+ "-pipe";
+    while(pipe_fd<0)
+    {
+        pipe_fd = open(devname.c_str(), O_RDWR);
+        if (pipe_fd < 0 && errno!=ENOENT) caller->self->Err("open pipe_fd error (%s)\n",strerror(-errno));
+        usleep(1000);
+    }
+
+    while(caller->is_running==true)
+    {
+        fd_set set;
+        struct timeval timeout;
+        int rv;
+
+        FD_ZERO(&set); // clear the set
+        FD_SET(caller->fd, &set); // add our file descriptor to the set
+        FD_SET(pipe_fd, &set); // add our file descriptor to the set
+
+        timeout.tv_sec = 0;
+        timeout.tv_usec = SELECT_TIMEOUT_MS*1000;
+        rv = select(FD_SETSIZE, &set, NULL, NULL, &timeout);
+
+        if(rv == -1)
+        {
+            caller->self->Err("select error\n"); // an error occured
+        }
+        else if(rv == 0)
+        {
+            //printf("timeout\n");
+        }
+        else
+        {
+            ssize_t nb_read,nb_write;
+            char buffer[1024];
+
+            if(FD_ISSET(caller->fd, &set))
+            {
+                socklen_t sinsize = sizeof(caller->sock_in);
+                if (caller->broadcast==false)
+                {
+                    nb_read = recvfrom(caller->fd, buffer, sizeof(buffer), 0, (sockaddr *) &(caller->sock_in), &sinsize);
+                }
+                else
+                {
+                    nb_read = recvfrom(caller->fd, buffer, sizeof(buffer), 0, NULL,NULL);
+                }
+                if(nb_read  < 0)
+                {
+                    caller->self->Err("recvfrom error\n");
+                }
+//printf("user %s\n",buffer);
+                //on ne garde que les messages venant pas de soi meme
+                if (caller->broadcast==false || (caller->broadcast==true && getFrameworkManager()->ObjectName().compare(0,getFrameworkManager()->ObjectName().size(),buffer,getFrameworkManager()->ObjectName().size()) != 0))
+                {
+                    nb_write=write(pipe_fd,buffer,nb_read);
+                    if(nb_write!=nb_read)
+                    {
+                        caller->self->Err("write error\n");
+                    }
+                }
+                else
+                {
+                    //printf("self %s\n",buffer);
+                }
+            }
+            if(FD_ISSET(pipe_fd, &set))
+            {
+                nb_read=read(pipe_fd,buffer,sizeof(buffer));
+                //printf("read pipe %i %s\n",nb_read,buffer);
+                if(nb_read>0)
+                {
+                    //printf("send %s\n",buffer);
+                    nb_write=sendto(caller->fd,buffer,nb_read, 0, (struct sockaddr *) &(caller->sock_in), sizeof(caller->sock_in));
+                    if(nb_write!=nb_read)
+                    {
+                        caller->self->Err("sendto error\n");
+                    }
+                }
+            }
+        }
+    }
+
+    close(pipe_fd);
+    pthread_exit(0);
+}
+#endif
Index: /trunk/lib/FlairCore/src/SpinBox.cpp
===================================================================
--- /trunk/lib/FlairCore/src/SpinBox.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/SpinBox.cpp	(revision 2)
@@ -0,0 +1,74 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   SpinBox.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QSpinBox on the ground station
+//
+//
+/*********************************************************************/
+
+#include "SpinBox.h"
+
+using std::string;
+
+namespace flair { namespace gui {
+
+SpinBox::SpinBox(const LayoutPosition* position,string name,int min,int max,int step,int default_value):Box(position,name,"SpinBox") {
+    //update value from xml file
+    if(default_value<min) default_value=min;
+    if(default_value>max) default_value=max;
+    box_value=default_value;
+
+    SetVolatileXmlProp("min",min);
+    SetVolatileXmlProp("max",max);
+    SetVolatileXmlProp("step",step);
+    GetPersistentXmlProp("value",box_value);
+    SetPersistentXmlProp("value",box_value);
+
+    SendXml();
+}
+
+SpinBox::SpinBox(const LayoutPosition* position,string name,string suffix,int min,int max,int step,int default_value):Box(position,name,"SpinBox") {
+    //update value from xml file
+    if(default_value<min) default_value=min;
+    if(default_value>max) default_value=max;
+    box_value=default_value;
+
+    SetVolatileXmlProp("suffix",suffix);
+    SetVolatileXmlProp("min",min);
+    SetVolatileXmlProp("max",max);
+    SetVolatileXmlProp("step",step);
+    GetPersistentXmlProp("value",box_value);
+    SetPersistentXmlProp("value",box_value);
+    SendXml();
+}
+
+SpinBox::~SpinBox() {
+}
+
+int SpinBox::Value(void) const {
+    int tmp;
+
+    GetMutex();
+    tmp=box_value;
+    ReleaseMutex();
+
+    return tmp;
+}
+
+void SpinBox::XmlEvent(void) {
+    GetMutex();
+    if(GetPersistentXmlProp("value",box_value)) SetValueChanged();
+    ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/SpinBox.h
===================================================================
--- /trunk/lib/FlairCore/src/SpinBox.h	(revision 2)
+++ /trunk/lib/FlairCore/src/SpinBox.h	(revision 2)
@@ -0,0 +1,91 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SpinBox.h
+ * \brief Class displaying a QSpinBox on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef SPINBOX_H
+#define SPINBOX_H
+
+#include <Box.h>
+
+namespace flair
+{
+namespace gui
+{
+
+    class LayoutPosition;
+
+    /*! \class SpinBox
+    *
+    * \brief Class displaying a QSpinBox on the ground station
+    *
+    */
+    class SpinBox : public Box
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a QSpinBox at given position. \n
+            * The QSpinBox is saturated to min and max values.
+            *
+            * \param position position to display the QSpinBox
+            * \param name name
+            * \param min minimum value
+            * \param max maximum value
+            * \param step step
+            * \param default_value default value if not in the xml config file
+            */
+            SpinBox(const LayoutPosition* position,std::string name,int min,int max,int step,int default_value=0);/*!
+
+            * \brief Constructor
+            *
+            * Construct a QSpinBox at given position. \n
+            * The QSpinBox is saturated to min and max values.
+            *
+            * \param position position to display the QSpinBox
+            * \param name name
+            * \param suffix suffix for the value (eg unit)
+            * \param min minimum value
+            * \param max maximum value
+            * \param step step
+            * \param default_value default value if not in the xml config file
+            */
+            SpinBox(const LayoutPosition* position,std::string name,std::string suffix,int min,int max,int step,int default_value=0);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~SpinBox();
+
+           /*!
+            * \brief Value
+            *
+            * \return value
+            */
+            int Value(void) const;
+
+        private:
+            /*!
+            * \brief XmlEvent from ground station
+            *
+            * Reimplemented from Widget.
+            *
+            */
+            void XmlEvent(void);
+
+            int box_value;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // SPINBOX_H
Index: /trunk/lib/FlairCore/src/Tab.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Tab.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Tab.cpp	(revision 2)
@@ -0,0 +1,39 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/10/07
+//  filename:   Tab.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QTab on the ground station
+//
+//
+/*********************************************************************/
+#include "Tab.h"
+#include "TabWidget.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+Tab::Tab(const TabWidget* parent,string name,int position): Layout(parent,name,"Tab")
+{
+    SetVolatileXmlProp("position",position);
+    SendXml();
+}
+
+Tab::~Tab()
+{
+
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Tab.h
===================================================================
--- /trunk/lib/FlairCore/src/Tab.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Tab.h	(revision 2)
@@ -0,0 +1,57 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Tab.h
+ * \brief Class displaying a QTab on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef TAB_H
+#define TAB_H
+
+#include <Layout.h>
+
+namespace flair
+{
+namespace gui
+{
+
+    class TabWidget;
+
+    /*! \class Tab
+    *
+    * \brief Class displaying a QTab on the ground station
+    *
+    * Tabs are displayed in a TabWidget.
+    */
+    class Tab: public Layout
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a Tab in the TabWidget.
+            *
+            * \param parent parent
+            * \param name name
+            * \param position tab position, -1 to put at the last position
+            */
+            Tab(const TabWidget* parent,std::string name,int position=-1);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Tab();
+
+        private:
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // TAB_H
Index: /trunk/lib/FlairCore/src/TabWidget.cpp
===================================================================
--- /trunk/lib/FlairCore/src/TabWidget.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/TabWidget.cpp	(revision 2)
@@ -0,0 +1,44 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/07/30
+//  filename:   TabWidget.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QTabWidget on the ground station
+//
+//
+/*********************************************************************/
+#include "TabWidget.h"
+#include "Tab.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+TabWidget::TabWidget(const LayoutPosition* position,string name,TabPosition_t tabPosition): Widget(position->getLayout(),name,"TabWidget")
+{
+    SetVolatileXmlProp("row",position->Row());
+    SetVolatileXmlProp("col",position->Col());
+    SetVolatileXmlProp("position",(int)tabPosition);
+    SendXml();
+
+    delete position;
+}
+
+TabWidget::~TabWidget()
+{
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/TabWidget.h
===================================================================
--- /trunk/lib/FlairCore/src/TabWidget.h	(revision 2)
+++ /trunk/lib/FlairCore/src/TabWidget.h	(revision 2)
@@ -0,0 +1,65 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file TabWidget.h
+ * \brief Class displaying a QTabWidget on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/07/30
+ * \version 4.0
+ */
+
+#ifndef TABWIDGET_H
+#define TABWIDGET_H
+
+#include <Widget.h>
+
+namespace flair
+{
+namespace gui
+{
+    class LayoutPosition;
+
+    /*! \class TabWidget
+    *
+    * \brief Class displaying a QTabWidget on the ground station
+    *
+    * TabWidget contains Tabs.
+    *
+    */
+    class TabWidget:public Widget
+    {
+        public:
+            /*!
+            * \enum TabPosition_t
+            * \brief Position of tabs
+            */
+            typedef enum { North/*! north */, South/*! south */, West/*! west */, East/*! east */} TabPosition_t;
+
+            /*!
+            * \brief Constructor
+            *
+            * Construct a QTabWidget at given position. \n
+            * The TabWidget will automatically be child of position->getLayout() Layout. After calling this constructor,
+            * position will be deleted as it is no longer usefull.
+            *
+            * \param position position
+            * \param name name
+            * \param tabPosition position of tabs
+            */
+            TabWidget(const LayoutPosition* position,std::string name,TabPosition_t tabPosition=TabWidget::West);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~TabWidget();
+
+        private:
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // TABWIDGET_H
Index: /trunk/lib/FlairCore/src/TcpSocket.cpp
===================================================================
--- /trunk/lib/FlairCore/src/TcpSocket.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/TcpSocket.cpp	(revision 2)
@@ -0,0 +1,235 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/04/28
+//  filename:   TcpSocket.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a TCP socket
+//
+//
+/*********************************************************************/
+#include "TcpSocket.h"
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+
+using std::string;
+
+namespace flair {
+namespace core {
+
+TcpSocket::TcpSocket(const Object* parent,const std::string name,bool _blockOnSend,bool _blockOnReceive):ConnectedSocket(parent,name),isConnected(false) {
+    blockOnSend=_blockOnSend;
+    blockOnReceive=_blockOnReceive;
+}
+
+TcpSocket::~TcpSocket() {
+    //Info("Debug: destroying TCP socket %s", ObjectName().c_str());
+    close(socket);
+}
+
+void TcpSocket::Listen(const unsigned int port,const std::string localAddress) {
+    socket=::socket(AF_INET,SOCK_STREAM,0);
+
+    sockaddr_in my_addr;
+    my_addr.sin_family = AF_INET;
+    my_addr.sin_port = htons(port);
+    if (localAddress=="ANY") {
+        my_addr.sin_addr.s_addr=INADDR_ANY;
+    } else {
+        inet_aton(localAddress.c_str(),&(my_addr.sin_addr));
+    }
+    memset(&(my_addr.sin_zero), '\0', 8);
+
+    if (bind(socket,(sockaddr*)&my_addr,sizeof(my_addr))<0) {
+        char errorMsg[256];
+        Err("TCP bind, %s\n",strerror_r(errno,errorMsg,sizeof(errorMsg)));
+    }
+
+    listen(socket,1);
+}
+
+TcpSocket *TcpSocket::Accept(Time timeout) {
+    char errorMsg[256];
+    TcpSocket *acceptedSocket=nullptr;
+
+    struct timeval tv;
+    if (timeout!=0) {
+        tv.tv_sec=timeout/1000; //timeout is in ms
+        tv.tv_usec=(timeout%1000)*1000;
+    }
+    fd_set rset;
+    FD_ZERO(&rset);
+    FD_SET(socket, &rset);
+    int ret=select(socket + 1, &rset, nullptr, nullptr,(timeout==0)?nullptr:&tv); //man 2 accept
+    if (ret<0) {
+        Err("select: %s\n",strerror_r(errno,errorMsg,sizeof(errorMsg)));
+    } else {
+        if (ret==0) {
+            //timeout reached
+            //Err("timeout reached\n");
+        } else {
+            //our socket is readable, a new connection can be accepted
+            acceptedSocket=new TcpSocket(this->Parent(),this->ObjectName(),blockOnSend,blockOnReceive);
+            sockaddr_in their_addr;
+            socklen_t namelen = sizeof(their_addr);
+            if ((acceptedSocket->socket=accept(socket,(sockaddr*)&their_addr, &namelen))<0) {
+                Err("error: %s\n",strerror_r(errno,errorMsg,sizeof(errorMsg)));
+                delete acceptedSocket;
+                acceptedSocket=nullptr;
+            }
+        }
+    }
+
+    return acceptedSocket;
+}
+
+bool TcpSocket::Connect(const unsigned int distantPort,const std::string distantAddress,Time timeout) {
+    bool success=false;
+    char errorMsg[256];
+
+    if (isConnected) {
+        if (this->distantPort==distantPort && this->distantAddress==distantAddress) {
+            return true;
+        } else {
+            close(socket);
+        }
+    }
+    socket=::socket(AF_INET,SOCK_STREAM,0);
+    if (socket==-1) return false;
+
+    sockaddr_in serv_addr;
+    serv_addr.sin_family = AF_INET;
+    serv_addr.sin_port = htons(short(distantPort));
+    if (inet_pton(AF_INET, distantAddress.c_str(), &serv_addr.sin_addr) <= 0) {
+        printf("incorrect network address.");
+        close(socket);
+        return false;
+    }
+    memset(&(serv_addr.sin_zero), '\0', 8);
+
+    //go non blocking
+    int flags=fcntl(socket, F_GETFL);
+    fcntl(socket, F_SETFL, flags | O_NONBLOCK);
+    if (connect(socket, (sockaddr*)&serv_addr, sizeof(serv_addr))==-1) {
+        if ((errno != EINPROGRESS) && (errno != EAGAIN)){
+            Err("socket connect: %s\n",strerror_r(errno,errorMsg,sizeof(errorMsg)));
+            success=false;
+        } else {
+            //now block with a timeout
+            struct timeval tv;
+            if (timeout!=0) {
+                tv.tv_sec=timeout/1000; //timeout is in ms
+                tv.tv_usec=(timeout%1000)*1000;
+            }
+            fd_set wset;
+            FD_ZERO(&wset);
+            FD_SET(socket, &wset);
+            int ret=select(socket + 1, NULL, &wset, NULL,(timeout==0)?NULL:&tv); //man 2 connect EINPROGRESS
+            if (ret<0) {
+                Err("select: %s\n",strerror_r(errno,errorMsg,sizeof(errorMsg)));
+                success=false;
+            } else {
+                if (ret==0) {
+                    //timeout reached
+                    //Err("timeout reached\n");
+                    success=false;
+                } else {
+                    //something happened on our socket. Check if an error occured
+                    int error;
+                    socklen_t len = sizeof(error);
+                    if (getsockopt(socket, SOL_SOCKET, SO_ERROR, &error, &len)!=0) {
+                        //Err("getsockopt: %s\n",strerror_r(errno,errorMsg,sizeof(errorMsg)));
+                        success=false;
+                    } else if (error!=0) {
+                        //Err("socket error: %d(%s)\n",error,strerror_r(error,errorMsg,sizeof(errorMsg)));
+                        success=false;
+                    } else {
+                        if (connect(socket, (sockaddr*)&serv_addr, sizeof(serv_addr))==-1) {
+                            success=false;
+                        } else {
+                            //Info("connected indeed ^^\n");
+                            success=true;
+                        }
+                    }
+                }
+            }
+        }
+    } else {
+        success=true; //never reached suprisingly...
+    }
+    //switch back to blocking mode (default)
+    fcntl(socket, F_SETFL, flags);
+
+    if (!success) {
+        close(socket);
+        //Info("Debug: Connect to %s:%d failed\n", distantAddress.c_str(), distantPort);
+        return false;
+    } else {
+        isConnected=true;
+        this->distantPort=distantPort;
+        this->distantAddress=distantAddress;
+        //Info("Debug: Connect to %s:%d succeeded\n", distantAddress.c_str(), distantPort);
+        return true;
+    }
+}
+
+ssize_t TcpSocket::SendMessage(const char* buffer,size_t bufferSize,Time timeout){
+    int flags=0;
+    if (!blockOnSend) {
+        flags|=MSG_DONTWAIT;
+    } else {
+        struct timeval tv;
+        tv.tv_sec=timeout/1000; //timeout is in ms
+        tv.tv_usec=(timeout%1000)*1000;
+
+        setsockopt(socket,SOL_SOCKET,SO_SNDTIMEO,(char *)&tv,sizeof(struct timeval));
+    }
+    ssize_t bytesSent=send(socket, buffer, bufferSize, flags);
+
+    return bytesSent;
+}
+
+ssize_t TcpSocket::RecvMessage(char* buffer,size_t bufferSize,Time timeout){
+    int flags=0;
+    if (!blockOnReceive) {
+        flags|=MSG_DONTWAIT;
+    } else {
+        struct timeval tv;
+        tv.tv_sec=timeout/1000; //timeout is in ms
+        tv.tv_usec=(timeout%1000)*1000;
+
+        setsockopt(socket,SOL_SOCKET,SO_RCVTIMEO,(char *)&tv,sizeof(struct timeval));
+    }
+    ssize_t bytesRead=recv(socket,buffer,bufferSize,flags);
+
+    return bytesRead;
+}
+
+uint16_t TcpSocket::NetworkToHost16(uint16_t data) {
+    return ntohs(data);
+}
+
+uint16_t TcpSocket::HostToNetwork16(uint16_t data) {
+    return htons(data);
+}
+
+uint32_t TcpSocket::NetworkToHost32(uint32_t data) {
+    return ntohl(data);
+}
+
+uint32_t TcpSocket::HostToNetwork32(uint32_t data) {
+    return htonl(data);
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/TcpSocket.h
===================================================================
--- /trunk/lib/FlairCore/src/TcpSocket.h	(revision 2)
+++ /trunk/lib/FlairCore/src/TcpSocket.h	(revision 2)
@@ -0,0 +1,54 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file TcpSocket.h
+ * \brief Class defining a Tcp socket
+ * \author Gildas Bayard, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2015/04/28
+ * \version 4.0
+ */
+
+#ifndef TCPSOCKET_H
+#define TCPSOCKET_H
+
+#include <ConnectedSocket.h>
+
+namespace flair
+{
+namespace core
+{
+    /*! \class TcpSocket
+    *
+    * \brief Class encapsulating a TCP socket
+    *
+    */
+    class TcpSocket:public ConnectedSocket {
+    public:
+        TcpSocket(const Object* parent,const std::string name,bool blockOnSend=false,bool blockOnReceive=true);
+        ~TcpSocket();
+        void Listen(const unsigned int port,const std::string localAddress="ANY");
+        TcpSocket *Accept(Time timeout=0); //should throw an exception if not a listening socket
+        bool Connect(const unsigned int distantPort,const std::string distantAddress,Time timeout=0); // timeout in milliseconds
+        ssize_t SendMessage(const char* message,size_t message_len,Time timeout=0); // timeout in milliseconds
+        ssize_t RecvMessage(char* buf,size_t buf_len,Time timeout=0); // timeout in milliseconds
+
+        uint16_t NetworkToHost16(uint16_t data);
+        uint16_t HostToNetwork16(uint16_t data);
+        uint32_t NetworkToHost32(uint32_t data);
+        uint32_t HostToNetwork32(uint32_t data);
+
+    private:
+        int socket; // socket file descriptor
+        bool blockOnSend;
+        bool blockOnReceive;
+        bool isConnected;
+        unsigned int distantPort;
+        std::string distantAddress;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // TCPSOCKET_H
Index: /trunk/lib/FlairCore/src/TextEdit.cpp
===================================================================
--- /trunk/lib/FlairCore/src/TextEdit.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/TextEdit.cpp	(revision 2)
@@ -0,0 +1,65 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/08/17
+//  filename:   TextEdit.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying a QTextEdit on the ground station
+//
+//
+/*********************************************************************/
+
+#include "TextEdit.h"
+#include "Layout.h"
+#include "LayoutPosition.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+TextEdit::TextEdit(const LayoutPosition* position,string name,size_t buf_size): Widget(position->getLayout(),name,"TextEdit")
+{
+    SetVolatileXmlProp("row",position->Row());
+    SetVolatileXmlProp("col",position->Col());
+    SendXml();
+
+    delete position;
+
+//    text_node=AddXmlChild("Text");
+
+    printf_buffer=(char*)malloc(buf_size);
+    if(printf_buffer==NULL) Err("erreur malloc\n");
+}
+
+TextEdit::~TextEdit()
+{
+    free(printf_buffer);
+}
+
+
+void TextEdit::Append(const char * format, ...)
+{
+    int n;
+
+    va_list args;
+    va_start(args, format);
+    n = vsprintf(printf_buffer,format, args);
+    va_end (args);
+    if (n<=0) return;
+
+    SetVolatileXmlProp("value",printf_buffer,text_node);
+    SendXml();
+
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/TextEdit.h
===================================================================
--- /trunk/lib/FlairCore/src/TextEdit.h	(revision 2)
+++ /trunk/lib/FlairCore/src/TextEdit.h	(revision 2)
@@ -0,0 +1,69 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file TextEdit.h
+ * \brief Class displaying a QTextEdit on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/08/17
+ * \version 4.0
+ */
+
+#ifndef TEXTEDIT_H
+#define TEXTEDIT_H
+
+#include <Widget.h>
+
+namespace flair
+{
+namespace gui
+{
+
+    class LayoutPosition;
+
+    /*! \class TextEdit
+    *
+    * \brief Class displaying a QTextEdit on the ground station
+    *
+    * QTextEdit allows printing on multiple lines. \n
+    *
+    */
+    class TextEdit:public Widget
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a QTabWidget at given position. \n
+            * The TextEdit will automatically be child of position->getLayout() Layout. After calling this constructor,
+            * position will be deleted as it is no longer usefull.
+            *
+            * \param parent parent
+            * \param name name
+            * \param buf_size size of the text buffer
+            */
+            TextEdit(const LayoutPosition* position,std::string name,size_t buf_size=255);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~TextEdit();
+
+            /*!
+            * \brief Append a line
+            *
+            * \param format text string to display, see standard printf
+            */
+            void Append(const char * format, ...);
+
+        private:
+            char* printf_buffer;
+            xmlNodePtr text_node;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // TEXTEDIT_H
Index: /trunk/lib/FlairCore/src/Thread.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Thread.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Thread.cpp	(revision 2)
@@ -0,0 +1,175 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/10/04
+//  filename:   Thread.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class for a thread
+//
+//
+/*********************************************************************/
+
+#include "Thread.h"
+#include "Thread_impl.h"
+#ifdef __XENO__
+#include <native/timer.h>
+#else
+#include <sys/time.h>
+#include <unistd.h>
+#endif
+
+using std::string;
+
+namespace flair
+{
+namespace core
+{
+
+Thread::Thread(const Object* parent,string name,uint8_t priority): Object(parent,name,"Thread")
+{
+     pimpl_=new Thread_impl(this,priority);
+}
+
+Thread::~Thread()
+{
+    delete pimpl_;
+}
+
+void Thread::Start(void)
+{
+    pimpl_->Start();
+}
+
+void Thread::SafeStop(void)
+{
+    pimpl_->SafeStop();
+}
+
+bool Thread::ToBeStopped(void) const
+{
+    return pimpl_->ToBeStopped();
+}
+
+#ifdef __XENO__
+void Thread::WarnUponSwitches(bool value)
+{
+    // Ask Xenomai to warn us upon switches to secondary mode.
+    if(value==true)
+    {
+        rt_task_set_mode(0, T_WARNSW, NULL);
+    }
+    else
+    {
+        rt_task_set_mode(T_WARNSW, 0, NULL);
+    }
+}
+#else
+void Thread::WarnUponSwitches(bool value)
+{
+    //Warn("Not applicable in non real time\n");
+}
+#endif
+
+void Thread::Join(void)
+{
+    pimpl_->Join();
+}
+
+void Thread::SetPeriodUS(uint32_t period) {
+    pimpl_->SetPeriodUS(period);
+}
+
+uint32_t Thread::GetPeriodUS(void) const {
+    return pimpl_->GetPeriodUS();
+}
+
+void Thread::SetPeriodMS(uint32_t period) {
+    pimpl_->SetPeriodMS(period);
+}
+
+uint32_t Thread::GetPeriodMS(void) const {
+    return pimpl_->GetPeriodMS();
+}
+
+
+bool Thread::IsPeriodSet(void)
+{
+    return pimpl_->period_set;
+}
+
+void Thread::WaitPeriod(void) const
+{
+    pimpl_->WaitPeriod();
+}
+
+void Thread::Suspend(void)
+{
+    pimpl_->Suspend();
+}
+
+bool Thread::SuspendUntil(Time date){
+    return pimpl_->SuspendUntil(date);
+}
+
+bool Thread::IsSuspended(void) const
+{
+    return pimpl_->IsSuspended();
+}
+
+void Thread::Resume(void)
+{
+    pimpl_->Resume();
+}
+
+int Thread::WaitUpdate(const IODevice* device)
+{
+    return pimpl_->WaitUpdate(device);
+}
+
+void Thread::SleepUntil(Time time) const
+{
+#ifdef __XENO__
+    int status=rt_task_sleep_until(time);
+    if(status!=0) Err("%s, error rt_task_sleep_until (%s), resume time: %lld, actual time: %lld\n",
+                      ObjectName().c_str(),
+                      strerror(-status),
+                      time,
+                      GetTime());
+    //Printf("rt_task_sleep_until, resume time: %lld, actual time: %lld\n",time,GetTime());
+#else
+    Time current=GetTime();
+    if(current<time)
+    {
+        usleep((time-current)/1000);
+    }
+#endif
+}
+
+void Thread::SleepMS(uint32_t time) const
+{
+#ifdef __XENO__
+    int status=rt_task_sleep(time*1000*1000);
+    if(status!=0) Err("erreur rt_task_sleep (%s)\n",strerror(-status));
+#else
+    usleep(time*1000);
+#endif
+}
+
+void Thread::SleepUS(uint32_t time) const
+{
+#ifdef __XENO__
+    int status=rt_task_sleep(time*1000);
+    if(status!=0) Err("erreur rt_task_sleep (%s)\n",strerror(-status));
+#else
+    usleep(time);
+#endif
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Thread.h
===================================================================
--- /trunk/lib/FlairCore/src/Thread.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Thread.h	(revision 2)
@@ -0,0 +1,233 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Thread.h
+ * \brief Abstract class for a thread
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/10/04
+ * \version 4.0
+ */
+
+#ifndef THREAD_H
+#define THREAD_H
+
+#include <Object.h>
+#include <stdint.h>
+
+class Thread_impl;
+
+namespace flair
+{
+namespace core
+{
+
+    class IODevice;
+
+    /*! \class Thread
+    *
+    * \brief Abstract class for a thread
+    *
+    * To implement a thread, Run() method must be reimplemented. \n
+    * When Start() is called, it will automatically call Run() reimplemented method.
+    * A thread can be periodic, in this case WaitPeriod() will block untill period is met.
+    * Thread can also e synnchronized with an IODevice, using WaitUpdate() method. \n
+    * Thread period is by default 100ms.
+    */
+    class Thread: public Object
+    {
+        friend class ::Thread_impl;
+
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * \param parent parent
+            * \param name name
+            * \param priority priority, should be >20 (<20 is reserved for internal use)
+            */
+            Thread(const Object* parent,std::string name,uint8_t priority);//priority>20, for real time only
+
+            /*!
+            * \brief Destructor
+            *
+            * If thread is started, SafeStop() and Join() will
+            * be automatically called.
+            *
+            */
+            virtual ~Thread();
+
+            /*!
+            * \brief Start the thread
+            *
+            */
+            void Start(void);
+
+            /*!
+            * \brief Set a stop flag
+            *
+            * ToBeStopped() will return true after calling this method.
+            */
+            void SafeStop(void);
+
+            /*!
+            * \brief Set a stop flag
+            *
+            * Reimplemented Run() can poll this method to
+            * determine when to stop the thread.
+            *
+            * \return true if SafeStop() was called
+            */
+            bool ToBeStopped(void) const;
+
+            /*!
+            * \brief Join the thread
+            *
+            * This method will block untill Run() returns.
+            *
+            */
+            void Join(void);
+
+            /*!
+            * \brief Set the period in micro second
+            *
+            * After calling this method, IsPeriodSet will return true.
+            *
+            * \param period_us period in us
+            */
+            void SetPeriodUS(uint32_t period_us);
+
+            uint32_t GetPeriodUS() const;
+
+            /*!
+            * \brief Set the period in milli second
+            *
+            * After calling this method, IsPeriodSet will return true.
+            *
+            * \param period_ums period in ms
+            */
+            void SetPeriodMS(uint32_t period_ms);
+
+            uint32_t GetPeriodMS() const;
+
+            /*!
+            * \brief Returns if period was set
+            *
+            * \return true if a period was set using SetPeriodUS or SetPeriodMS
+            * false otherwise
+            */
+            bool IsPeriodSet(void);
+
+            /*!
+            * \brief Wait the period
+            *
+            * This method will block untill period is met. \n
+            * If no period was set (see SetPeriodUS, SetPeriodMS and IsPeriodSet), this method
+            * returns immediately.
+            *
+            */
+            void WaitPeriod(void) const;
+
+            /*!
+            * \brief Wait update of an IODevice
+            *
+            * This method will block untill IODevice::ProcessUpdate
+            * is called. \n
+            * This method is usefull to synchronize a thread with an IODevice.
+            *
+            * \param device IODevice to wait update from
+            */
+            int WaitUpdate(const IODevice* device);
+
+            /*!
+            * \brief Suspend the thread
+            *
+            * This method will block untill Resume() is called.
+            *
+            */
+            void Suspend(void);
+
+            /*!
+            * \brief Suspend the thread with timeout
+            *
+            * This method will block until Resume() is called or the absolute date specified occurs
+            *
+            * \param date absolute date in ns
+            * \return true if thread is woken up by a call to Resume, false otherwise
+            */
+            bool SuspendUntil(Time date);
+
+            /*!
+            * \brief Resume the thread
+            *
+            * This method will unblock the call to Suspend().
+            *
+            */
+            void Resume(void);
+
+            /*!
+            * \brief Is the thread suspended?
+            *
+            * \return true if thread is suspended
+            *
+            */
+            bool IsSuspended(void) const;
+
+            /*!
+            * \brief Sleep until absolute time
+            *
+            * This method will block untill time is reached.
+            *
+            * \param time absolute time
+            */
+            void SleepUntil(Time time) const;
+
+            /*!
+            * \brief Sleep for a certain time in micro second
+            *
+            * This method will block untill time is elapsed.
+            *
+            * \param time_us time to wait in micro second
+            */
+            void SleepUS(uint32_t time_us) const;
+
+            /*!
+            * \brief Sleep for a cartain time in milli second
+            *
+            * This method will block untill time is elapsed.
+            *
+            * \param time_ms time to wait in milli second
+            */
+            void SleepMS(uint32_t time_ms) const;
+
+            /*!
+            * \brief Warn if real time / non real time switches occur
+            *
+            * If enabled, a message with the call stack will be displayed
+            * in case of real time / non real time switches. \n
+            * This method can help to debug application and see if switches occur. \n
+            * Note that it as no effect if this method is called from the non real time
+            * Framework library.
+            *
+            * \param enable enable or disable warns
+            */
+            static void WarnUponSwitches(bool enable);
+
+        private:
+            /*!
+            * \brief Run method
+            *
+            * This method is automatically called by Start(). \n
+            * This method must be reimplemented, in order to implement the thread.
+            *
+            */
+            virtual void Run(void)=0;
+
+            class Thread_impl* pimpl_;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // THREAD_H
Index: /trunk/lib/FlairCore/src/Thread_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Thread_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Thread_impl.cpp	(revision 2)
@@ -0,0 +1,425 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/10/04
+//  filename:   Thread_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe implementant un thread rt ou non
+//
+//
+/*********************************************************************/
+
+#include "Thread_impl.h"
+#include "Thread.h"
+#include "IODevice.h"
+#include "IODevice_impl.h"
+#include "ConditionVariable.h"
+#include "config.h"
+#include "FrameworkManager.h"
+#include <string.h>
+#ifdef __XENO__
+#include <rtdk.h>
+#else
+#include <sys/resource.h>
+#endif
+
+using std::string;
+using namespace flair::core;
+
+Thread_impl::Thread_impl(Thread* self,uint8_t priority)
+{
+    isRunning=false;
+    tobestopped=false;
+    is_suspended=false;
+    period_set=false;
+
+    this->self=self;
+    cond=new ConditionVariable(self,self->ObjectName());
+
+    if(priority<MIN_THREAD_PRIORITY)
+    {
+        priority=MIN_THREAD_PRIORITY;
+//        printf("Thread::Thread, %s: priority set to %i\n",self->ObjectName().c_str(), priority);
+    }
+    if(priority>MAX_THREAD_PRIORITY)
+    {
+        priority=MAX_THREAD_PRIORITY;
+        self->Warn("priority set to %i\n",MAX_THREAD_PRIORITY);
+    }
+
+    this->priority=priority;
+    period=100*1000*1000;//100ms par defaut
+    min_jitter=1000*1000*1000;
+    max_jitter=0;
+    mean_jitter=0;
+    last=0;
+    cpt=0;
+}
+
+Thread_impl::~Thread_impl()
+{
+    SafeStop();
+    Join();
+}
+
+void Thread_impl::Start(void)
+{
+    int status;
+
+    isRunning=true;
+
+#ifdef __XENO__
+    string th_name=getFrameworkManager()->ObjectName()+ "-" + self->ObjectName();
+
+#ifdef RT_STACK_SIZE
+    status=rt_task_create(&task_rt, th_name.c_str(), RT_STACK_SIZE, (int)priority, T_JOINABLE);
+#else
+    status=rt_task_create(&task_rt, th_name.c_str(), 0,(int)priority, T_JOINABLE);
+#endif //RT_STACK_SIZE
+    if(status!=0)
+    {
+        self->Err("rt_task_create error (%s)\n",strerror(-status));
+    }
+    else
+    {
+        //_printf("rt_task_create ok %s\n",th_name);
+    }
+
+    status=rt_task_start(&task_rt, &main_rt, (void*)this);
+    if(status!=0)
+    {
+        self->Err("rt_task_start error (%s)\n",strerror(-status));
+    }
+     else
+     {
+        //_printf("rt_task_start ok %s\n",th_name);
+     }
+
+    // Initialise the rt_print buffer for this task explicitly
+    rt_print_init(512, th_name.c_str());
+
+#else //__XENO__
+
+    // Initialize thread creation attributes
+    pthread_attr_t attr;
+    if(pthread_attr_init(&attr) != 0)
+    {
+        self->Err("Error pthread_attr_init\n");
+    }
+
+#ifdef NRT_STACK_SIZE
+    if(pthread_attr_setstacksize(&attr, NRT_STACK_SIZE) != 0)
+    {
+        self->Err("Error pthread_attr_setstacksize\n");
+    }
+#endif //NRT_STACK_SIZE
+
+    if(pthread_attr_setinheritsched(&attr,PTHREAD_EXPLICIT_SCHED)!=0)
+    {
+        self->Err("Error pthread_attr_setinheritsched\n");
+    }
+
+    if(pthread_attr_setschedpolicy(&attr, SCHED_FIFO)!=0)
+    {
+        self->Err("Error pthread_attr_setschedpolicy\n");
+    }
+
+    struct sched_param parm;
+    parm.sched_priority = priority;
+    if(pthread_attr_setschedparam(&attr,&parm)!=0)
+    {
+        self->Err("Error pthread_attr_setschedparam\n");
+    }
+
+    next_time=GetTime()+period;
+
+    if(pthread_create(&task_nrt,  &attr, main_nrt, (void*)this) != 0)
+    {
+        self->Err("pthread_create error\n");
+    }
+
+    if(pthread_attr_destroy(&attr) != 0)
+    {
+        self->Err("Error pthread_attr_destroy\n");
+    }
+
+#endif //__XENO__
+}
+
+#ifdef __XENO__
+void Thread_impl::main_rt(void * arg)
+{
+    Thread_impl *caller = (Thread_impl*)arg;
+
+    // Perform auto-init of rt_print buffers if the task doesn't do so
+    rt_print_auto_init(1);
+
+    caller->self->Run();
+
+    caller->PrintStats();
+}
+#else
+void* Thread_impl::main_nrt(void * arg)
+{
+    Thread_impl *caller = (Thread_impl*)arg;
+
+    caller->self->Run();
+
+    caller->PrintStats();
+
+    pthread_exit(0);
+}
+#endif //__XENO__
+
+void Thread_impl::SetPeriodUS(uint32_t period) {
+    if(period==0) {
+        self->Err("Period must be>0\n");
+        return;
+    }
+
+#ifdef __XENO__
+    int status=rt_task_set_periodic(&task_rt, TM_NOW, period*1000);
+    if(status!=0) self->Err("Error rt_task_set_periodic %s\n",strerror(-status));
+#else
+    next_time-=period;
+    next_time+=period*1000;
+#endif
+    this->period=period*1000;
+    period_set=true;
+}
+
+uint32_t Thread_impl::GetPeriodUS() const {
+    return this->period/1000;
+}
+
+void Thread_impl::SetPeriodMS(uint32_t period) {
+    if(period==0) {
+        self->Err("Period must be>0\n");
+        return;
+    }
+
+#ifdef __XENO__
+    int status=rt_task_set_periodic(&task_rt, TM_NOW, period*1000*1000);
+    if(status!=0) self->Err("Error rt_task_set_periodic %s\n",strerror(-status));
+#else
+    next_time-=period;
+    next_time+=period*1000*1000;
+#endif
+    this->period=period*1000*1000;
+    period_set=true;
+}
+
+uint32_t Thread_impl::GetPeriodMS() const {
+    return this->period/1000/1000;
+}
+
+void Thread_impl::WaitPeriod(void)
+{
+    if(period_set==false)
+    {
+        self->Err("Period must be set befaore calling this method\n");
+        return;
+    }
+#ifdef __XENO__
+    unsigned long overruns_r;
+    int status=rt_task_wait_period(&overruns_r);
+    if(status!=0) self->Err("Error rt_task_wait_period %s\n",strerror(-status));
+    if(status==-ETIMEDOUT) self->Err("overrun: %lld\n",overruns_r);
+#else
+    self->SleepUntil(next_time);
+    next_time+=period;
+#endif
+    ComputeJitter(GetTime());
+}
+
+
+void Thread_impl::Suspend(void) {
+    if(isRunning==false) {
+        self->Err("thread is not started\n");
+        return;
+    }
+
+    cond->GetMutex(),
+    is_suspended=true;
+    cond->CondWait();
+    is_suspended=false;
+    cond->ReleaseMutex();
+}
+
+bool Thread_impl::SuspendUntil(Time date) {
+    if(isRunning==false) {
+        self->Err("thread is not started\n");
+        return false;
+    }
+
+    cond->GetMutex(),
+    is_suspended=true;
+    bool success=cond->CondWaitUntil(date);
+    is_suspended=false;
+    cond->ReleaseMutex();
+    return success;
+}
+
+bool Thread_impl::IsSuspended(void)
+{
+    bool result;
+
+    cond->GetMutex();
+    result=is_suspended;
+    cond->ReleaseMutex();
+
+    return result;
+}
+
+void Thread_impl::Resume(void)
+{
+    if(isRunning==false)
+    {
+        self->Err("thread is not started\n");
+        return;
+    }
+
+    cond->GetMutex();
+    if(is_suspended==true)
+    {
+        cond->CondSignal();
+    }
+    else
+    {
+        self->Err("thread is not suspended\n");
+    }
+    cond->ReleaseMutex();
+}
+
+int Thread_impl::WaitUpdate(const IODevice* device)
+{
+    int status=0;
+
+    if(IsSuspended()==true)
+    {
+        self->Err("thread is already supended\n");
+        status=-1;
+    }
+    else
+    {
+        cond->GetMutex();
+
+        if(device->pimpl_->SetToWake(self)==0)
+        {
+            is_suspended=true;
+            cond->CondWait();
+            is_suspended=false;
+        }
+        else
+        {
+            self->Err("%s is already waiting an update\n",device->ObjectName().c_str());
+            status=-1;
+        }
+
+        cond->ReleaseMutex();
+    }
+
+    return status;
+}
+
+void Thread_impl::PrintStats(void)
+{
+#ifdef __XENO__
+    RT_TASK_INFO info;
+
+    int status=rt_task_inquire(NULL, &info);
+    if(status!=0)
+    {
+        self->Err("Error rt_task_inquire %s\n",strerror(-status));
+    }
+    else
+#endif
+    {
+#ifndef __XENO__
+        //if(last!=0)
+#endif
+        {
+            Printf("Thread::%s :\n",self->ObjectName().c_str());
+        }
+#ifdef __XENO__
+        Printf("    number of context switches: %i\n",info.ctxswitches);
+        Printf("    number of primary->secondary mode switch: %i\n",info.modeswitches);
+        //printf("number of page faults: %i\n",info.pagefaults);
+        Printf("    execution time (ms) in primary mode: %lld\n",info.exectime/1000000);
+#else
+/*
+        struct rusage r_usage;
+        getrusage(RUSAGE_THREAD,&r_usage);
+        printf("    memory usage = %ld\n",r_usage.ru_maxrss);
+        printf("RUSAGE :ru_utime => %lld [sec] : %lld [usec], :ru_stime => %lld [sec] : %lld [usec] \n",
+           (int64_t)r_usage.ru_utime.tv_sec, (int64_t)r_usage.ru_utime.tv_usec,
+           (int64_t)r_usage.ru_stime.tv_sec, (int64_t)r_usage.ru_stime.tv_usec);*/
+#endif
+        if(last!=0)
+        {
+            Printf("    min jitter (ns): %lld\n",min_jitter);
+            Printf("    max jitter (ns): %lld\n",max_jitter);
+            Printf("    jitter moy (ns): %lld\n",mean_jitter/cpt);
+            Printf("    itertions: %lld\n",cpt);
+        }
+    }
+}
+
+void Thread_impl::Join(void)
+{
+    if(isRunning==true)
+    {
+        int status;
+
+#ifdef __XENO__
+        status=rt_task_join(&task_rt);
+#else
+        status=pthread_join(task_nrt,NULL);
+#endif
+        if(status!=0) self->Err("error %s\n",strerror(-status));
+        isRunning=false;
+    }
+}
+
+void Thread_impl::ComputeJitter(Time time)
+{
+    Time diff,delta;
+    diff=time-last;
+
+    if(diff>=period)
+    {
+        delta=diff-period;
+    }
+    else
+    {
+        delta=period-diff;
+    }
+    //if(delta==0) rt_printf("%lld %lld\n",time,last);
+    last=time;
+    if(diff==time) return;
+
+    if(delta>max_jitter) max_jitter=delta;
+    if(delta<min_jitter) min_jitter=delta;
+    mean_jitter+=delta;
+    cpt++;
+
+    //Printf("Thread::%s jitter moy (ns): %lld\n",self->ObjectName().c_str(),mean_jitter/cpt);
+
+}
+
+void Thread_impl::SafeStop(void)
+{
+    tobestopped=true;
+    if(IsSuspended()) Resume();
+}
+
+bool Thread_impl::ToBeStopped(void)
+{
+    return tobestopped;
+}
Index: /trunk/lib/FlairCore/src/UdtSocket.cpp
===================================================================
--- /trunk/lib/FlairCore/src/UdtSocket.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/UdtSocket.cpp	(revision 2)
@@ -0,0 +1,152 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2015/04/21
+//  filename:   UdtSocket.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a UDT socket
+//
+//
+/*********************************************************************/
+#include "UdtSocket.h"
+#include <udt.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <string.h>
+
+using std::string;
+
+namespace flair
+{
+namespace core
+{
+
+UdtSocket::UdtSocket(const Object* parent,const std::string name,bool _blockOnSend,bool _blockOnReceive):ConnectedSocket(parent,name) {
+    UDT::startup();
+    blockOnSend=_blockOnSend;
+    blockOnReceive=_blockOnReceive;
+}
+
+UdtSocket::~UdtSocket(){
+}
+
+void UdtSocket::Listen(const unsigned int port,const std::string localAddress) {
+    socket = UDT::socket(AF_INET, SOCK_DGRAM, 0);
+
+    UDT::setsockopt(socket, 0, UDT_SNDSYN, &blockOnSend, sizeof(bool));
+    UDT::setsockopt(socket, 0, UDT_RCVSYN, &blockOnReceive, sizeof(bool));
+    bool reuse = true;
+    UDT::setsockopt(socket, 0, UDT_REUSEADDR, &reuse, sizeof(bool));
+
+    sockaddr_in my_addr;
+    my_addr.sin_family = AF_INET;
+    my_addr.sin_port = htons(port);
+    if (localAddress=="ANY") {
+        my_addr.sin_addr.s_addr=INADDR_ANY;
+    } else {
+        inet_aton(localAddress.c_str(),&(my_addr.sin_addr));
+    }
+    memset(&(my_addr.sin_zero), '\0', 8);
+
+    if (UDT::ERROR == UDT::bind(socket, (sockaddr*)&my_addr, sizeof(my_addr))) {
+      Err("bind, %s\n",UDT::getlasterror().getErrorMessage());
+    }
+
+    UDT::listen(socket, 1);
+}
+
+UdtSocket *UdtSocket::Accept(Time timeout) {
+    // TIMEOUT UNSUPPORTED!!
+    UdtSocket *acceptedSocket=new UdtSocket(this->Parent(),this->ObjectName());
+    acceptedSocket->blockOnSend=this->blockOnSend;
+    acceptedSocket->blockOnReceive=this->blockOnReceive;
+
+    sockaddr_in their_addr;
+    int namelen = sizeof(their_addr);
+
+    if ((acceptedSocket->socket = UDT::accept(socket, (sockaddr*)&their_addr, &namelen))==UDT::INVALID_SOCK) {
+        Err("accept: %s, code %i\n",UDT::getlasterror().getErrorMessage(),UDT::getlasterror().getErrorCode());
+    }
+
+    return acceptedSocket;
+}
+
+bool UdtSocket::Connect(const unsigned int port,const std::string distantAddress,Time timeout) {
+    bool success=true;
+    socket=UDT::socket(AF_INET, SOCK_DGRAM, 0);
+
+    UDT::setsockopt(socket, 0, UDT_SNDSYN, &blockOnSend, sizeof(bool));
+    UDT::setsockopt(socket, 0, UDT_RCVSYN, &blockOnReceive, sizeof(bool));
+    bool reuse = true;
+    UDT::setsockopt(socket, 0, UDT_REUSEADDR, &reuse, sizeof(bool));
+
+    sockaddr_in serv_addr;
+    serv_addr.sin_family = AF_INET;
+    serv_addr.sin_port = htons(short(port));
+    if (inet_pton(AF_INET, distantAddress.c_str(), &serv_addr.sin_addr) <= 0) {
+        printf("incorrect network address.");
+        success=false;
+    }
+    memset(&(serv_addr.sin_zero), '\0', 8);
+
+    if (UDT::ERROR == UDT::connect(socket, (sockaddr*)&serv_addr, sizeof(serv_addr))) {
+        success=false;
+    }
+    if (!success) {
+        UDT::close(socket);
+        return false;
+    } else return true;
+}
+
+ssize_t UdtSocket::SendMessage(const char* buffer,size_t bufferSize,Time timeout){
+    int udtTimeout=timeout;
+    if (blockOnSend) {
+        if(UDT::setsockopt(socket, 0, UDT_SNDTIMEO, &udtTimeout, sizeof(udtTimeout))!=0) Err("error UDT_SNDTIMEO %s\n", UDT::getlasterror().getErrorMessage());
+    }
+    ssize_t bytesSent=UDT::sendmsg(socket, buffer, bufferSize, -1,true);
+
+    return bytesSent;
+}
+
+ssize_t UdtSocket::RecvMessage(char* buffer,size_t bufferSize,Time timeout){
+    int udtTimeout=timeout;
+    if (blockOnReceive) {
+        if(UDT::setsockopt(socket, 0, UDT_RCVTIMEO, &udtTimeout, sizeof(udtTimeout))!=0) Err("error UDT_RCVTIMEO %s\n", UDT::getlasterror().getErrorMessage());
+    }
+    ssize_t bytesRead= UDT::recvmsg(socket,buffer,bufferSize);
+
+/*
+    if(bytesRead<0) {
+        if(UDT::getlasterror().getErrorCode()==CUDTException::ECONNLOST) {
+            connection_lost=true;
+        }
+    }
+*/
+    return bytesRead;
+}
+
+uint16_t UdtSocket::NetworkToHost16(uint16_t data) {
+    return ntohs(data);
+}
+
+uint16_t UdtSocket::HostToNetwork16(uint16_t data) {
+    return htons(data);
+}
+
+uint32_t UdtSocket::NetworkToHost32(uint32_t data) {
+    return ntohl(data);
+}
+
+uint32_t UdtSocket::HostToNetwork32(uint32_t data) {
+    return htonl(data);
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/UdtSocket.h
===================================================================
--- /trunk/lib/FlairCore/src/UdtSocket.h	(revision 2)
+++ /trunk/lib/FlairCore/src/UdtSocket.h	(revision 2)
@@ -0,0 +1,53 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file UdtSocket.h
+ * \brief Class defining a UDT socket
+ * \author Gildas Bayard, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2015/04/21
+ * \version 4.0
+ */
+
+#ifndef UDTSOCKET_H
+#define UDTSOCKET_H
+
+typedef int UDTSOCKET;
+
+#include <ConnectedSocket.h>
+
+namespace flair
+{
+namespace core
+{
+    /*! \class UdtSocket
+    *
+    * \brief Class encapsulating a UDT socket
+    *
+    */
+    class UdtSocket:public ConnectedSocket {
+    public:
+        UdtSocket(const Object* parent,const std::string name,bool blockOnSend=false,bool blockOnReceive=true);
+        ~UdtSocket();
+        void Listen(const unsigned int port,const std::string localAddress="ANY");
+        UdtSocket *Accept(Time timeout); //should throw an exception if not a listening socket
+        bool Connect(const unsigned int port,const std::string distantAddress,Time timeout); // /!\ timeout is ignored
+        ssize_t SendMessage(const char* message,size_t message_len,Time timeout);
+        ssize_t RecvMessage(char* buf,size_t buf_len,Time timeout);
+
+        uint16_t NetworkToHost16(uint16_t data);
+        uint16_t HostToNetwork16(uint16_t data);
+        uint32_t NetworkToHost32(uint32_t data);
+        uint32_t HostToNetwork32(uint32_t data);
+
+    private:
+        UDTSOCKET socket;
+        bool blockOnSend;
+        bool blockOnReceive;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // UDTSOCKET_H
Index: /trunk/lib/FlairCore/src/Unix_I2cPort.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Unix_I2cPort.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Unix_I2cPort.cpp	(revision 2)
@@ -0,0 +1,81 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/08/28
+//  filename:   Unix_I2cPort.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for unix i2c port
+//
+//
+/*********************************************************************/
+
+#include "Unix_I2cPort.h"
+#include <errno.h>
+#include <fcntl.h>   /* File control definitions */
+#include <unistd.h>
+#include <sys/ioctl.h>
+#include <linux/i2c-dev.h>
+
+
+using std::string;
+
+namespace flair
+{
+namespace core
+{
+
+Unix_I2cPort::Unix_I2cPort(const Object* parent,string name,string device) : I2cPort(parent,name)
+{
+    //open port
+    fd = open( device.c_str(), O_RDWR );
+	if (fd == -1)
+	{
+		Err("open_port: Unable to open %s\n",device.c_str());
+	}
+}
+
+Unix_I2cPort::~Unix_I2cPort()
+{
+    close(fd);
+}
+
+void Unix_I2cPort::SetRxTimeout(core::Time timeout_ns)
+{
+    Warn("not implemented\n");
+}
+
+void Unix_I2cPort::SetTxTimeout(core::Time timeout_ns)
+{
+    Warn("not implemented\n");
+}
+
+int Unix_I2cPort::SetSlave(uint16_t address)
+{
+    int err=ioctl( fd, I2C_SLAVE_FORCE, address);
+	if( err < 0 )
+    {
+        Err("Failed to set slave address\n");
+    }
+
+	return err;
+}
+
+ssize_t Unix_I2cPort::Write(const void *buf,size_t nbyte)
+{
+    return write(fd,buf, nbyte);
+}
+
+ssize_t Unix_I2cPort::Read(void *buf,size_t nbyte)
+{
+    return read(fd,buf, nbyte);
+}
+
+} // end namespace core
+} // end namespace flair
+
Index: /trunk/lib/FlairCore/src/Unix_I2cPort.h
===================================================================
--- /trunk/lib/FlairCore/src/Unix_I2cPort.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Unix_I2cPort.h	(revision 2)
@@ -0,0 +1,101 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Unix_I2cPort.h
+ * \brief Class for unix i2c port
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/08/28
+ * \version 4.0
+ */
+
+#ifndef UNIX_I2CPORT_H
+#define UNIX_I2CPORT_H
+
+#include <I2cPort.h>
+
+namespace flair
+{
+namespace core
+{
+    /*! \class Unix_I2cPort
+    *
+    * \brief Class for unix serial port
+    *
+    */
+    class Unix_I2cPort: public I2cPort
+    {
+
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an unix i2c port
+            *
+            * \param parent parent
+            * \param name name
+            * \param device serial device (ex /dev/i2c-1)
+            */
+            Unix_I2cPort(const Object* parent,std::string port_name,std::string device);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Unix_I2cPort();
+
+            /*!
+            * \brief Set slave's address
+            *
+            * This method need to be called before any communication.
+            *
+            * \param address slave's address
+            */
+            int SetSlave(uint16_t address);
+
+            /*!
+            * \brief Set RX timeout
+            *
+            * Timeout for waiting datas.
+            *
+            * \param timeout_ns timeout in nano second
+            */
+            void SetRxTimeout(Time timeout_ns);
+
+            /*!
+            * \brief Set TX timeout
+            *
+            * Timeout for waiting an ACK from the slave.
+            *
+            * \param timeout_ns timeout in nano second
+            */
+            void SetTxTimeout(Time timeout_ns);
+
+            /*!
+            * \brief Write datas
+            *
+            * \param buf pointer to datas
+            * \param nbyte length of datas
+            *
+            * \return amount of written datas
+            */
+            ssize_t Write(const void *buf,size_t nbyte);
+
+            /*!
+            * \brief Read datas
+            *
+            * \param buf pointer to datas
+            * \param nbyte length of datas
+            *
+            * \return amount of read datas
+            */
+            ssize_t Read(void *buf,size_t nbyte);
+
+        private:
+            int fd;
+    };
+} // end namespace core
+} // end namespace flair
+
+#endif // UNIX_I2CPORT_H
Index: /trunk/lib/FlairCore/src/Unix_SerialPort.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Unix_SerialPort.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Unix_SerialPort.cpp	(revision 2)
@@ -0,0 +1,147 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/04/25
+//  filename:   Unix_SerialPort.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class for unix serial port
+//
+//
+/*********************************************************************/
+
+#include "Unix_SerialPort.h"
+#include <fcntl.h>   /* File control definitions */
+#include <unistd.h>
+
+using std::string;
+
+namespace flair
+{
+namespace core
+{
+
+Unix_SerialPort::Unix_SerialPort(const Object* parent,string name,string device) : SerialPort(parent,name)
+{
+    //open port
+	fd = open(device.c_str(), O_RDWR | O_NOCTTY);// |O_NDELAY|O_NONBLOCK);
+	if (fd == -1)
+	{
+		Err("open_port: Unable to open %s\n",device.c_str());
+	}
+	//fcntl(fd, F_SETFL, 0); //read calls are non blocking
+
+	//Get the current options for the port
+
+	tcgetattr(fd, &options);
+	//Set the baud rates to 115200
+	cfsetispeed(&options, B115200);
+	cfsetospeed(&options, B115200);
+
+	options.c_cflag |= (CLOCAL | CREAD); //Enable the receiver and set local mode
+	options.c_iflag = 0; //clear input options
+	options.c_lflag=0; //clear local options
+	options.c_oflag &= ~OPOST; //clear output options (raw output)
+
+	//Set the new options for the port
+    options.c_cc[VTIME] = 0;
+    options.c_cc[VMIN] = 1;
+	FlushInput();
+	tcsetattr(fd, TCSANOW, &options);
+}
+
+Unix_SerialPort::~Unix_SerialPort()
+{
+    close(fd);
+}
+
+void Unix_SerialPort::SetBaudrate(int baudrate)
+{
+    //set port options
+	struct termios options;
+	//Get the current options for the port
+	tcgetattr(fd, &options);
+	//Set the baud rates to 115200
+
+	switch(baudrate)
+	{
+	    case 1200:
+            cfsetispeed(&options, B1200);
+            cfsetospeed(&options, B1200);
+            break;
+        case 2400:
+            cfsetispeed(&options, B2400);
+            cfsetospeed(&options, B2400);
+            break;
+        case 4800:
+            cfsetispeed(&options, B4800);
+            cfsetospeed(&options, B4800);
+            break;
+        case 9600:
+            cfsetispeed(&options, B9600);
+            cfsetospeed(&options, B9600);
+            break;
+        case 19200:
+            cfsetispeed(&options, B19200);
+            cfsetospeed(&options, B19200);
+            break;
+        case 38400:
+            cfsetispeed(&options, B38400);
+            cfsetospeed(&options, B38400);
+            break;
+        case 115200:
+            cfsetispeed(&options, B115200);
+            cfsetospeed(&options, B115200);
+            break;
+        case 460800:
+            cfsetispeed(&options, B460800);
+            cfsetospeed(&options, B460800);
+            break;
+        case 921600:
+            cfsetispeed(&options, B921600);
+            cfsetospeed(&options, B921600);
+            break;
+        default:
+            Err("unsupported baudrate\n");
+	}
+	tcsetattr(fd, TCSANOW, &options);
+	FlushInput();
+
+}
+
+void Unix_SerialPort::SetRxTimeout(core::Time timeout_ns)
+{
+
+}
+
+void Unix_SerialPort::FlushInput(void)
+{
+    tcflush(fd, TCIFLUSH);
+}
+
+ssize_t Unix_SerialPort::Write(const void *buf,size_t nbyte)
+{
+    return write(fd, buf, nbyte);
+}
+
+ssize_t Unix_SerialPort::Read(void *buf,size_t nbyte)
+{
+    if(options.c_cc[VMIN] != nbyte)
+    {
+        tcgetattr(fd, &options);//bug if not called?
+        options.c_cc[VTIME] = 0;
+        options.c_cc[VMIN] = nbyte;
+        tcsetattr(fd, TCSANOW, &options);
+    }
+
+    return read(fd, buf, nbyte);
+}
+
+} // end namespace core
+} // end namespace flair
+
Index: /trunk/lib/FlairCore/src/Unix_SerialPort.h
===================================================================
--- /trunk/lib/FlairCore/src/Unix_SerialPort.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Unix_SerialPort.h	(revision 2)
@@ -0,0 +1,100 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Unix_SerialPort.h
+ * \brief Class for unix serial port
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/08/19
+ * \version 4.0
+ */
+
+#ifndef UNIX_SERIALPORT_H
+#define UNIX_SERIALPORT_H
+
+#include <SerialPort.h>
+#include <termios.h> /* POSIX terminal control definitions */
+
+namespace flair
+{
+namespace core
+{
+    /*! \class RTDM_I2cPort
+    *
+    * \brief Class for unix serial port
+    *
+    */
+    class Unix_SerialPort: public SerialPort
+    {
+
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an unix serial port, with the following default values: \n
+            * - 115200bps baudrate
+            *
+            * \param parent parent
+            * \param name name
+            * \param device serial device (ex rtser1)
+            */
+            Unix_SerialPort(const Object* parent,std::string port_name,std::string device);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Unix_SerialPort();
+
+            /*!
+            * \brief Set baudrate
+            *
+            * \param baudrate baudrate
+            *
+            */
+            void SetBaudrate(int baudrate);
+
+            /*!
+            * \brief Set RX timeout
+            *
+            * Timeout for waiting datas.
+            *
+            * \param timeout_ns timeout in nano second
+            */
+            void SetRxTimeout(Time timeout_ns);
+
+            /*!
+            * \brief Write datas
+            *
+            * \param buf pointer to datas
+            * \param nbyte length of datas
+            *
+            * \return amount of written datas
+            */
+            ssize_t Write(const void *buf,size_t nbyte);
+
+            /*!
+            * \brief Read datas
+            *
+            * \param buf pointer to datas
+            * \param nbyte length of datas
+            *
+            * \return amount of read datas
+            */
+            ssize_t Read(void *buf,size_t nbyte);
+
+            /*!
+            * \brief Flush input datas
+            *
+            */
+            void FlushInput(void);
+
+        private:
+            int fd;
+            struct termios options;
+    };
+} // end namespace core
+} // end namespace flair
+
+#endif // UNIX_SERIALPORT_H
Index: /trunk/lib/FlairCore/src/Vector2D.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Vector2D.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Vector2D.cpp	(revision 2)
@@ -0,0 +1,108 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/05/02
+//  filename:   Vector2D.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a 2D vector
+//
+//
+/*********************************************************************/
+
+#include "Vector2D.h"
+#include "Euler.h"
+#include <math.h>
+
+namespace flair { namespace core {
+
+Vector2D::Vector2D(float inX,float inY): x(inX),y(inY) {
+}
+
+Vector2D::~Vector2D() {
+
+}
+
+Vector2D &Vector2D::operator=(const Vector2D &vector) {
+    x=vector.x;
+    y=vector.y;
+    return (*this);
+}
+
+Vector2D operator+ (const Vector2D &vectorA,const Vector2D &vectorB) {
+    return Vector2D(vectorA.x + vectorB.x,vectorA.y + vectorB.y);
+}
+
+Vector2D operator- (const Vector2D &vectorA,const Vector2D  &vectorB) {
+    return Vector2D(vectorA.x - vectorB.x,vectorA.y - vectorB.y);
+}
+
+Vector2D operator/ (const Vector2D &vector, float coeff) {
+    if(coeff!=0) {
+        return Vector2D(vector.x/ coeff,vector.y/ coeff);
+    } else {
+        return Vector2D(0,0);
+    }
+}
+
+Vector2D operator * (const Vector2D &vector, float coeff) {
+    return Vector2D(vector.x * coeff,vector.y * coeff);
+}
+
+Vector2D operator * (float coeff,const Vector2D &vector) {
+    return Vector2D(vector.x * coeff,vector.y * coeff);
+}
+
+void Vector2D::Rotate(float value) {
+    float xTmp;
+    xTmp=x*cosf(value)-y*sinf(value);
+    y=x*sinf(value)+y*cosf(value);
+    x=xTmp;
+}
+
+void Vector2D::RotateDeg(float value) {
+    Rotate(Euler::ToRadian(value));
+}
+
+float Vector2D::GetNorm(void) const {
+    return sqrt(x*x+y*y);
+}
+
+void Vector2D::Normalize(void) {
+    float n=GetNorm();
+    if(n!=0) {
+        x=x/n;
+        y=y/n;
+    }
+}
+
+void Vector2D::Saturate(Vector2D min,Vector2D max) {
+    if(x<min.x) x=min.x;
+    if(x>max.x) x=max.x;
+
+    if(y<min.y) y=min.y;
+    if(y>max.y) y=max.y;
+}
+
+void Vector2D::Saturate(float min,float max) {
+    Saturate(Vector2D(min,min),Vector2D(max,max));
+}
+
+void Vector2D::Saturate(const Vector2D &value) {
+    float x=fabs(value.x);
+    float y=fabs(value.y);
+    Saturate(Vector2D(-x,-y),Vector2D(x,y));
+}
+
+void Vector2D::Saturate(float value) {
+    float sat=fabs(value);
+    Saturate(Vector2D(-sat,-sat),Vector2D(sat,sat));
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Vector2D.h
===================================================================
--- /trunk/lib/FlairCore/src/Vector2D.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Vector2D.h	(revision 2)
@@ -0,0 +1,169 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Vector2D.h
+ * \brief Class defining a 2D vector
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/05/02
+ * \version 4.0
+ */
+
+#ifndef VECTOR2D_H
+#define VECTOR2D_H
+
+namespace flair { namespace core {
+
+    /*! \class Vector2D
+    *
+    * \brief Class defining a 2D vector
+    */
+    class Vector2D {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a Vector2D using specified values.
+            *
+            * \param x
+            * \param y
+            */
+            Vector2D(float x=0,float y=0);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Vector2D();
+
+            /*!
+            * \brief Rotation
+            *
+            * \param value rotation value in radians
+            */
+            void Rotate(float value);
+
+            /*!
+            * \brief Rotation
+            *
+            * \param value rotation value in degrees
+            */
+            void RotateDeg(float value);
+
+            /*!
+            * \brief Norm
+            *
+            * \return value
+            */
+            float GetNorm(void) const;
+
+            /*!
+            * \brief Normalize
+            */
+            void Normalize(void);
+
+            /*!
+            * \brief Saturate
+            *
+            * Saturate between min and max
+            *
+            * \param min minimum Vector2D value
+            * \param max maximum Vector2D value
+            */
+            void Saturate(Vector2D min,Vector2D max);
+
+            /*!
+            * \brief Saturate
+            *
+            * Saturate between min and max
+            *
+            * \param min minimum Vector2D(min,min) value
+            * \param max maximum Vector2D(max,max) value
+            */
+            void Saturate(float min,float max);
+
+            /*!
+            * \brief Saturate
+            *
+            * Saturate between -abs(value) and abs(value)
+            *
+            * \param value saturation Vector2D value
+            */
+            void Saturate(const Vector2D &value);
+
+            /*!
+            * \brief Saturate
+            *
+            * Saturate between -abs(Vector2D(value,value)) and abs(Vector2D(value,value))
+            *
+            * \param value saturation Vector2D(value,value)
+            */
+            void Saturate(float value);
+
+
+            /*!
+            * \brief x
+            */
+            float x;
+
+            /*!
+            * \brief y
+            */
+            float y;
+
+            Vector2D &operator=(const Vector2D &vector);
+    };
+
+    /*! Add
+    *
+    * \brief Add
+    *
+    * \param vectorA vector
+    * \param vectorB vector
+    */
+    Vector2D operator + (const Vector2D &vectorA,const Vector2D &vectorB);
+
+    /*! Substract
+    *
+    * \brief Substract
+    *
+    * \param vectorA vector
+    * \param vectorB vector
+    */
+    Vector2D operator - (const Vector2D &vectorA,const Vector2D &vectorB);
+
+    /*! Divid
+    *
+    * \brief Divid
+    *
+    * \param vector vector
+    * \param coeff coefficent
+    * \return vector/coefficient
+    */
+    Vector2D operator / (const Vector2D &vector, float coeff);
+
+    /*! Multiply
+    *
+    * \brief Multiplyf
+    *
+    * \param vector vector
+    * \param coeff coefficent
+    * \return coefficient*vector
+    */
+    Vector2D operator * (const Vector2D &vector, float coeff);
+
+    /*! Multiply
+    *
+    * \brief Multiply
+    *
+    * \param coeff coefficent
+    * \param vector vector
+    * \return coefficient*vector
+    */
+    Vector2D operator * (float coeff,const Vector2D &vector);
+
+} // end namespace core
+} // end namespace flair
+
+#endif // VECTOR2D_H
Index: /trunk/lib/FlairCore/src/Vector3D.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Vector3D.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Vector3D.cpp	(revision 2)
@@ -0,0 +1,251 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/05/02
+//  filename:   Vector3D.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a 3D vector
+//
+//
+/*********************************************************************/
+
+#include "Vector3D.h"
+#include "Vector2D.h"
+#include "RotationMatrix.h"
+#include "Euler.h"
+#include "Quaternion.h"
+#include "Object.h"
+#include <math.h>
+//#include "Vector3DSpinBox.h"
+
+namespace flair { namespace core {
+
+Vector3D::Vector3D(float inX,float inY,float inZ): x(inX),y(inY),z(inZ){
+}
+
+Vector3D::~Vector3D() {
+
+}
+/*
+void Vector3D::operator=(const gui::Vector3DSpinBox *vector) {
+    Vector3D vect=vector->Value();
+    x=vect.x;
+    y=vect.y;
+    z=vect.z;
+}*/
+
+Vector3D &Vector3D::operator=(const Vector3D &vector) {
+    x=vector.x;
+    y=vector.y;
+    z=vector.z;
+    return (*this);
+}
+
+Vector3D &Vector3D::operator+=(const Vector3D &vector) {
+    x+=vector.x;
+    y+=vector.y;
+    z+=vector.z;
+    return (*this);
+}
+
+Vector3D &Vector3D::operator-=(const Vector3D &vector) {
+    x-=vector.x;
+    y-=vector.y;
+    z-=vector.z;
+    return (*this);
+}
+
+float &Vector3D::operator[](size_t idx) {
+    if(idx==0) {
+        return x;
+    } else if(idx==1) {
+        return y;
+    } else if(idx==2) {
+        return z;
+    } else {
+        Printf("Vector3D: index %i out of bound\n",idx);
+        return z;
+    }
+}
+
+const float &Vector3D::operator[](size_t idx) const {
+    if(idx==0) {
+        return x;
+    } else if(idx==1) {
+        return y;
+    } else if(idx==2) {
+        return z;
+    } else {
+        Printf("Vector3D: index %i out of bound\n",idx);
+        return z;
+    }
+}
+
+Vector3D CrossProduct(const Vector3D &vectorA,const Vector3D &vectorB) {
+    return Vector3D(vectorA.y*vectorB.z - vectorA.z*vectorB.y,
+                    vectorA.z*vectorB.x - vectorA.x*vectorB.z,
+                    vectorA.x*vectorB.y - vectorA.y*vectorB.x);
+}
+
+float DotProduct(const Vector3D &vectorA,const Vector3D &vectorB) {
+    return vectorA.x*vectorB.x + vectorA.y*vectorB.y+ vectorA.z*vectorB.z;
+}
+
+Vector3D operator+ (const Vector3D &vectorA,const Vector3D &vectorB) {
+    return Vector3D(vectorA.x + vectorB.x,
+                    vectorA.y + vectorB.y,
+                    vectorA.z + vectorB.z);
+}
+
+Vector3D operator- (const Vector3D &vectorA,const Vector3D &vectorB) {
+    return Vector3D(vectorA.x - vectorB.x,
+                    vectorA.y - vectorB.y,
+                    vectorA.z - vectorB.z);
+}
+
+Vector3D operator-(const Vector3D &vector) {
+    return Vector3D(-vector.x,-vector.y,-vector.z);
+}
+
+Vector3D operator * (const Vector3D &vectorA,const Vector3D &vectorB) {
+    return Vector3D(vectorA.x* vectorB.x,
+                    vectorA.y* vectorB.y,
+                    vectorA.z* vectorB.z);
+}
+
+Vector3D operator * (const Vector3D &vector, float coeff) {
+    return Vector3D(vector.x* coeff,
+                    vector.y* coeff,
+                    vector.z* coeff);
+}
+
+Vector3D operator * (float coeff,const Vector3D &vector) {
+    return Vector3D(vector.x* coeff,
+                    vector.y* coeff,
+                    vector.z* coeff);
+}
+
+Vector3D operator/ (const Vector3D &vector, float coeff) {
+    if(coeff!=0) {
+        return Vector3D(vector.x/ coeff,
+                        vector.y/ coeff,
+                        vector.z/ coeff);
+    } else {
+        printf("Vector3D: err divinding by 0\n");
+        return Vector3D(0,0,0);
+    }
+}
+
+void Vector3D::RotateX(float value) {
+    float y_tmp;
+    y_tmp=y*cosf(value)-z*sinf(value);
+    z=y*sinf(value)+z*cosf(value);
+    y=y_tmp;
+}
+
+void Vector3D::RotateXDeg(float value) {
+    RotateX(Euler::ToRadian(value));
+}
+
+void Vector3D::RotateY(float value) {
+    float x_tmp;
+    x_tmp=x*cosf(value)+z*sinf(value);
+    z=-x*sinf(value)+z*cosf(value);
+    x=x_tmp;
+}
+
+void Vector3D::RotateYDeg(float value) {
+    RotateY(Euler::ToRadian(value));
+}
+
+void Vector3D::RotateZ(float value) {
+    float x_tmp;
+    x_tmp=x*cosf(value)-y*sinf(value);
+    y=x*sinf(value)+y*cosf(value);
+    x=x_tmp;
+}
+
+void Vector3D::RotateZDeg(float value) {
+    RotateZ(Euler::ToRadian(value));
+}
+
+void Vector3D::Rotate(const RotationMatrix &matrix) {
+    float a[3]= {0,0,0};
+    float b[3]= {x,y,z};
+
+    for(int i=0; i<3; i++) {
+        for(int j=0; j<3; j++) {
+            a[i]+=matrix.m[i][j]*b[j];
+        }
+    }
+
+    x=a[0];
+    y=a[1];
+    z=a[2];
+}
+
+void Vector3D::Rotate(const Quaternion &quaternion) {
+    RotationMatrix matrix;
+    quaternion.ToRotationMatrix(matrix);
+    Rotate(matrix);
+}
+
+void Vector3D::To2Dxy(Vector2D &vector) const {
+    vector.x=x;
+    vector.y=y;
+}
+
+Vector2D Vector3D::To2Dxy(void) const {
+    Vector2D vect;
+    To2Dxy(vect);
+    return vect;
+}
+
+float Vector3D::GetNorm(void) const {
+    return sqrt(x*x+y*y+z*z);
+}
+
+void Vector3D::Normalize(void) {
+    float n=GetNorm();
+    if(n!=0) {
+        x=x/n;
+        y=y/n;
+        z=z/n;
+    }
+}
+
+void Vector3D::Saturate(const Vector3D &min,const Vector3D &max) {
+    if(x<min.x) x=min.x;
+    if(x>max.x) x=max.x;
+
+    if(y<min.y) y=min.y;
+    if(y>max.y) y=max.y;
+
+    if(z<min.z) z=min.z;
+    if(z>max.z) z=max.z;
+}
+
+void Vector3D::Saturate(float min,float max) {
+    Saturate(Vector3D(min,min,min),Vector3D(max,max,max));
+}
+
+void Vector3D::Saturate(const Vector3D &value) {
+    float x=fabs(value.x);
+    float y=fabs(value.y);
+    float z=fabs(value.z);
+    Saturate(Vector3D(-x,-y,-z),Vector3D(x,y,z));
+}
+
+void Vector3D::Saturate(float value) {
+    float sat=fabs(value);
+    Saturate(Vector3D(-sat,-sat,-sat),Vector3D(sat,sat,sat));
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Vector3D.h
===================================================================
--- /trunk/lib/FlairCore/src/Vector3D.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Vector3D.h	(revision 2)
@@ -0,0 +1,299 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+
+/*!
+ * \file Vector3D.h
+ * \brief Class defining a 3D vector
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/05/02
+ * \version 4.0
+ */
+#ifndef VECTOR3D_H
+#define VECTOR3D_H
+
+#include <stddef.h>
+
+namespace flair { namespace core {
+    class Vector2D;
+    class RotationMatrix;
+    class Quaternion;
+
+    /*! \class Vector3D
+    *
+    * \brief Class defining a 3D vector
+    */
+    class Vector3D {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a Vector3D using specified values.
+            *
+            * \param x
+            * \param y
+            * \param z
+            */
+            Vector3D(float x=0,float y=0,float z=0);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Vector3D();
+
+            /*!
+            * \brief x
+            */
+            float x;
+
+            /*!
+            * \brief y
+            */
+            float y;
+
+            /*!
+            * \brief z
+            */
+            float z;
+
+            /*!
+            * \brief x axis rotation
+            *
+            * \param value rotation value in radians
+            */
+            void RotateX(float value);
+
+            /*!
+            * \brief x axis rotation
+            *
+            * \param value rotation value in degrees
+            */
+            void RotateXDeg(float value);
+
+            /*!
+            * \brief y axis rotation
+            *
+            * \param value rotation value in radians
+            */
+            void RotateY(float value);
+
+            /*!
+            * \brief y axis rotation
+            *
+            * \param value rotation value in degrees
+            */
+            void RotateYDeg(float value);
+
+            /*!
+            * \brief z axis rotation
+            *
+            * \param value rotation value in radians
+            */
+            void RotateZ(float value);
+
+            /*!
+            * \brief z axis rotation
+            *
+            * \param value rotation value in degrees
+            */
+            void RotateZDeg(float value);
+
+            /*!
+            * \brief rotation
+            *
+            * \param matrix rotation matrix
+            */
+            void Rotate(const RotationMatrix &matrix);
+
+            /*!
+            * \brief rotation
+            *
+            * Compute a rotation from a quaternion. This method uses a rotation matrix
+            * internaly.
+            *
+            * \param quaternion quaternion
+            */
+            void Rotate(const Quaternion &quaternion);
+
+            /*!
+            * \brief Convert to a Vector2D
+            *
+            * Uses x and y coordinates.
+            *
+            * \param vector destination
+            */
+            void To2Dxy(Vector2D &vector) const;
+
+            /*!
+            * \brief Convert to a Vector2D
+            *
+            * Uses x and y coordinates.
+            *
+            * \return destination
+            */
+            Vector2D To2Dxy(void) const;
+
+            /*!
+            * \brief Norm
+            *
+            * \return value
+            */
+            float GetNorm(void) const;
+
+            /*!
+            * \brief Normalize
+            */
+            void Normalize(void);
+
+            /*!
+            * \brief Saturate
+            *
+            * Saturate between min and max
+            *
+            * \param min minimum value
+            * \param max maximum value
+            */
+            void Saturate(const Vector3D &min,const Vector3D &max);
+
+            /*!
+            * \brief Saturate
+            *
+            * Saturate between min and max
+            *
+            * \param min minimum Vector3D(min,min,min) value
+            * \param max maximum Vector3D(max,max,max) value
+            */
+            void Saturate(float min,float max);
+
+            /*!
+            * \brief Saturate
+            *
+            * Saturate between -abs(value) and abs(value)
+            *
+            * \param value saturation Vector3D value
+            */
+            void Saturate(const Vector3D &value);
+
+            /*!
+            * \brief Saturate
+            *
+            * Saturate between -abs(Vector3D(value,value,value)) and abs(Vector3D(value,value,value))
+            *
+            * \param value saturation Vector3D(value,value,value)
+            */
+            void Saturate(float value);
+
+            float &operator[](size_t idx);
+            const float &operator[](size_t idx) const;
+            Vector3D &operator=(const Vector3D& vector);
+            Vector3D &operator+=(const Vector3D& vector);
+            Vector3D &operator-=(const Vector3D& vector);
+
+        private:
+
+    };
+
+    /*! Add
+    *
+    * \brief Add
+    *
+    * \param vectorA vector
+    * \param vectorB vector
+    *
+    * \return vectorA+vectorB
+    */
+    Vector3D operator + (const Vector3D &vectorA,const Vector3D &vectorB);
+
+    /*! Substract
+    *
+    * \brief Substract
+    *
+    * \param vectorA vector
+    * \param vectorB vector
+    *
+    * \return vectorA-vectorB
+    */
+    Vector3D operator - (const Vector3D &vectorA,const Vector3D &vectorB);
+
+    /*! Minus
+    *
+    * \brief Minus
+    *
+    * \param vector vector
+    *
+    * \return -vector
+    */
+    Vector3D operator-(const Vector3D &vector);
+
+    /*! Divid
+    *
+    * \brief Divid
+    *
+    * \param vector vector
+    * \param coeff coefficent
+    *
+    * \return vector/coefficient
+    */
+    Vector3D operator / (const Vector3D &vector, float coeff);
+
+    /*! Hadamard product
+    *
+    * \brief Hadamard product
+    *
+    * \param vectorA vector
+    * \param vectorBA vector
+    *
+    * \return Hadamard product
+    */
+    Vector3D operator * (const Vector3D &vectorA, const Vector3D &vectorB);
+
+    /*! Multiply
+    *
+    * \brief Multiply
+    *
+    * \param vector vector
+    * \param coeff coefficent
+    *
+    * \return coefficient*vector
+    */
+    Vector3D operator * (const Vector3D &vector, float coeff);
+
+    /*! Multiply
+    *
+    * \brief Multiply
+    *
+    * \param coeff coefficent
+    * \param vector vector
+    *
+    * \return coefficient*vector
+    */
+    Vector3D operator * (float coeff, const Vector3D &vector);
+
+    /*! Cross product
+    *
+    * \brief Cross product
+    *
+    * \param vectorA first vector
+    * \param vectorB second vector
+    *
+    * \return cross product
+    */
+    Vector3D CrossProduct(const Vector3D &vectorA, const Vector3D &vectorB);
+
+    /*! Dot product
+    *
+    * \brief Dot product
+    *
+    * \param vectorA first vector
+    * \param vectorB second vector
+    *
+    * \return dot product
+    */
+    float DotProduct(const Vector3D &vectorA, const Vector3D &vectorB);
+
+} // end namespace core
+} // end namespace flair
+
+#endif // VECTOR3D_H
Index: /trunk/lib/FlairCore/src/Vector3DSpinBox.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Vector3DSpinBox.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Vector3DSpinBox.cpp	(revision 2)
@@ -0,0 +1,72 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/02/22
+//  filename:   Vector3DSpinBox.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class displaying 3 QDoubleSpinBox for x,y,z on the ground station
+//
+//
+/*********************************************************************/
+
+#include "Vector3DSpinBox.h"
+
+using std::string;
+
+namespace flair { namespace gui {
+
+Vector3DSpinBox::Vector3DSpinBox(const LayoutPosition* position,string name,double min,double max,double step,int decimals,core::Vector3D default_value):Box(position,name,"Vector3DSpinBox") {
+    //update value from xml file
+    default_value.Saturate(min,max);
+    box_value=default_value;
+
+    SetVolatileXmlProp("min",min);
+    SetVolatileXmlProp("max",max);
+    SetVolatileXmlProp("step",step);
+    SetVolatileXmlProp("decimals",decimals);
+    GetPersistentXmlProp("value_x",box_value.x);
+    SetPersistentXmlProp("value_x",box_value.x);
+    GetPersistentXmlProp("value_y",box_value.y);
+    SetPersistentXmlProp("value_y",box_value.y);
+    GetPersistentXmlProp("value_z",box_value.z);
+    SetPersistentXmlProp("value_z",box_value.z);
+
+    SendXml();
+}
+
+Vector3DSpinBox::~Vector3DSpinBox() {
+
+}
+/*
+Vector3DSpinBox::operator core::Vector3D() const {
+    return Value();
+}
+*/
+core::Vector3D Vector3DSpinBox::Value(void) const {
+    core::Vector3D tmp;
+
+    GetMutex();
+    tmp=box_value;
+    ReleaseMutex();
+
+    return tmp;
+}
+
+void Vector3DSpinBox::XmlEvent(void) {
+    bool changed=false;
+    GetMutex();
+    if(GetPersistentXmlProp("value_x",box_value.x)) changed=true;
+    if(GetPersistentXmlProp("value_y",box_value.y)) changed=true;
+    if(GetPersistentXmlProp("value_z",box_value.z)) changed=true;
+    if(changed) SetValueChanged();
+    ReleaseMutex();
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Vector3DSpinBox.h
===================================================================
--- /trunk/lib/FlairCore/src/Vector3DSpinBox.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Vector3DSpinBox.h	(revision 2)
@@ -0,0 +1,73 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Vector3DSpinBox.h
+ * \brief Class displaying 3 QDoubleSpinBox for x,y,z on the ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/10/07
+ * \version 4.0
+ */
+
+#ifndef VECTOR3DSPINBOX_H
+#define VECTOR3DSPINBOX_H
+
+#include <Box.h>
+#include <Vector3D.h>
+
+namespace flair { namespace gui {
+    class Layout;
+
+    /*! \class Vector3DSpinBox
+    *
+    * \brief Class displaying 3 QDoubleSpinBox for x,y,z on the ground station
+    *
+    */
+    class Vector3DSpinBox: public Box {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a Vector3DSpinBox at given position. \n
+            * Each DoubleSpinBox is saturated to min and max values.
+            *
+            * \param position position to display the Vector3DSpinBox
+            * \param name name
+            * \param min minimum value
+            * \param max maximum value
+            * \param step step
+            * \param decimals number of decimals
+            * \param default_value default value if not in the xml config file
+            */
+            Vector3DSpinBox(const LayoutPosition* position,std::string name,double min,double max,double step,int decimals=2,core::Vector3D default_value=core::Vector3D(0,0,0));
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Vector3DSpinBox();
+
+            /*!
+            * \brief Value
+            *
+            * \return value
+            */
+            core::Vector3D Value(void) const;
+            //operator core::Vector3D() const;
+        private:
+            /*!
+            * \brief XmlEvent from ground station
+            *
+            * Reimplemented from Widget.
+            *
+            */
+            void XmlEvent(void);
+
+            core::Vector3D box_value;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // VECTOR3DSPINBOX_H
Index: /trunk/lib/FlairCore/src/Vector3Ddata.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Vector3Ddata.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Vector3Ddata.cpp	(revision 2)
@@ -0,0 +1,104 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/11/26
+//  filename:   Vector3Ddata.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a 3D vector and a io_data
+//
+//
+/*********************************************************************/
+
+#include "Vector3Ddata.h"
+#include <string.h>
+
+#define X 0
+#define Y 1
+#define Z 2
+
+using std::string;
+
+namespace flair { namespace core {
+
+   /*! \class Vector3DdataElement
+    */
+    class Vector3DdataElement: public IODataElement {
+    public:
+        Vector3DdataElement(const Vector3Ddata *data,string name,uint32_t elem):IODataElement(data,name) {
+            this->data=data;
+            this->elem=elem;
+            size=4;
+        }
+
+        ~Vector3DdataElement() {
+        }
+
+        void CopyData(char* dst) const {
+            float value;
+            data->GetMutex();
+            switch(elem) {
+                case X:
+                    value=data->x;
+                    break;
+                case Y:
+                    value=data->y;
+                    break;
+                case Z:
+                    value=data->z;
+                    break;
+                default:
+                    data->Err("type not handled\n");
+                    value=0;
+                    break;
+            }
+            data->ReleaseMutex();
+
+            memcpy(dst,&value,sizeof(float));
+        }
+
+        ScalarType const &GetDataType() const {
+            return dataType;
+        }
+
+    private:
+        const Vector3Ddata *data;
+        uint32_t elem;
+        FloatType dataType;
+    };
+
+Vector3Ddata::Vector3Ddata(const Object* parent, string name,float x,float y,float z,uint32_t n): io_data(parent,name,n), Vector3D(x,y,z) {
+
+}
+
+Vector3Ddata::~Vector3Ddata() {
+
+}
+
+void Vector3Ddata::CopyDatas(char* dst) const {
+    GetMutex();
+    memcpy(dst,&x,sizeof(float));
+    memcpy(dst+sizeof(float),&y,sizeof(float));
+    memcpy(dst+2*sizeof(float),&z,sizeof(float));
+    ReleaseMutex();
+}
+
+IODataElement* Vector3Ddata::XElement(void) const {
+    return new Vector3DdataElement(this,"x",X);
+}
+
+IODataElement* Vector3Ddata::YElement(void) const {
+    return new Vector3DdataElement(this,"y",Y);
+}
+
+IODataElement* Vector3Ddata::ZElement(void) const {
+    return new Vector3DdataElement(this,"z",Z);
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Vector3Ddata.h
===================================================================
--- /trunk/lib/FlairCore/src/Vector3Ddata.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Vector3Ddata.h	(revision 2)
@@ -0,0 +1,92 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+
+/*!
+ * \file Vector3Ddata.h
+ * \brief Class defining a 3D vector and a io_data
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/05/02
+ * \version 4.0
+ */
+#ifndef VECTOR3DDATA_H
+#define VECTOR3DDATA_H
+
+#include <io_data.h>
+#include <IODataElement.h>
+#include <Vector3D.h>
+
+namespace flair
+{
+namespace core
+{
+
+    /*! \class Vector3Ddata
+    *
+    * \brief Class defining a 3D vector and a io_data
+    * User must manually use the io_data's Mutex to access to Vector3D values.
+    */
+    class Vector3Ddata: public io_data, public Vector3D
+    {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a Vector3D using specified values.
+            *
+            * \param x
+            * \param y
+            * \param z
+            */
+            Vector3Ddata(const Object* parent, std::string name,float x=0,float y=0,float z=0,uint32_t n=1);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~Vector3Ddata();
+
+            /*!
+            * \brief X Element
+            *
+            * Get a vectorer to x element. This pointer can be used for plotting.
+            *
+            * \return pointer to the element
+            */
+            IODataElement* XElement(void) const;
+
+            /*!
+            * \brief Y Element
+            *
+            * Get a pointer to y element. This pointer can be used for plotting.
+            *
+            * \return pointer to the element
+            */
+            IODataElement* YElement(void) const;
+
+            /*!
+            * \brief Z Element
+            *
+            * Get a pointer to z element. This pointer can be used for plotting.
+            *
+            * \return pointer to the element
+            */
+            IODataElement* ZElement(void) const;
+
+        private:
+            /*!
+            * \brief Copy datas
+            *
+            * Reimplemented from io_data. \n
+            * See io_data::CopyDatas.
+            *
+            * \param dst destination buffer
+            */
+            void CopyDatas(char* dst) const;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // VECTOR3DDATA_H
Index: /trunk/lib/FlairCore/src/Watchdog.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Watchdog.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Watchdog.cpp	(revision 2)
@@ -0,0 +1,50 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2016/02/25
+//  filename:   Watchdog.cpp
+//
+//  author:     Gildas Bayard
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Watchdog class
+//
+/*********************************************************************/
+
+#include "Watchdog.h"
+
+namespace flair {
+namespace core {
+
+Watchdog::Watchdog(const Object* parent,std::function<void()> _expired,Time _timer):Thread(parent,"watchdog",0),expired(_expired),timer(_timer){
+}
+
+Watchdog::~Watchdog() {
+    SafeStop();
+    Join();
+}
+
+void Watchdog::Touch() {
+    if (IsSuspended()) Resume();
+}
+
+void Watchdog::SetTimer(Time _Timer) {
+    timer=_Timer; Touch();
+}
+
+void Watchdog::Run() {
+    while (!ToBeStopped()) {
+        Time current=GetTime();
+        Time date=current+timer;
+        //Printf("watchdog goes to sleep at %llu, scheduled to wake up at %llu\n",current,date);
+        if (!SuspendUntil(date)) {
+            expired();
+        }
+    }
+};
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Watchdog.h
===================================================================
--- /trunk/lib/FlairCore/src/Watchdog.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Watchdog.h	(revision 2)
@@ -0,0 +1,46 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Watchdog.h
+ * \brief Watchdog Class
+ * \author Gildas Bayard, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2016/02/25
+ * \version 1.0
+ */
+
+#ifndef WATCHDOG_H
+#define WATCHDOG_H
+
+#include <Thread.h>
+#include <functional>
+
+namespace flair {
+namespace core {
+
+    /*! \class Watchdog
+    *
+    * \brief Watchdog class
+    *
+    * Calls a given function if not touched within a specified period of time
+    *
+    */
+    class Watchdog:public Thread {
+    public:
+        Watchdog(const Object* parent,std::function<void()> _expired,Time _timer);
+        ~Watchdog();
+
+        //reset the timer
+        void Touch();
+        void SetTimer(Time _Timer);
+    private:
+        void Run();
+        std::function<void()> expired;
+        Time timer;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // WATCHDOG_H
Index: /trunk/lib/FlairCore/src/Widget.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Widget.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Widget.cpp	(revision 2)
@@ -0,0 +1,248 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/05/02
+//  filename:   Widget.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class for all Framework's widget classes
+//
+//
+/*********************************************************************/
+
+#include "Widget.h"
+#include "Widget_impl.h"
+
+using std::string;
+
+namespace flair
+{
+namespace gui
+{
+
+using namespace core;
+
+Widget::Widget(const Widget* parent,string name,string type): Object(parent,name,type)
+{
+    pimpl_=new Widget_impl(this,parent,name,type);
+}
+
+Widget::~Widget()
+{
+    delete pimpl_;
+}
+
+template <>
+bool Widget::GetPersistentXmlProp(std::string prop,double &value)
+{
+    xmlChar *result=NULL;
+    result=xmlGetProp(pimpl_->file_node,(xmlChar*)prop.c_str());
+
+    if(result!=NULL) {
+        value=xmlXPathCastStringToNumber(result);
+        xmlFree(result);
+        return true;
+    } else {
+        return false;
+    }
+}
+
+template <>
+bool Widget::GetPersistentXmlProp(std::string prop,float &value) {
+    double tmp;
+    if(GetPersistentXmlProp<double>(prop,tmp)) {
+        value=tmp;
+        return true;
+    } else {
+        return false;
+    }
+}
+
+template <>
+bool Widget::GetPersistentXmlProp(std::string prop,bool &value) {
+    double tmp;
+    if(GetPersistentXmlProp<double>(prop,tmp)) {
+        value=tmp;
+        return true;
+    } else {
+        return false;
+    }
+}
+
+template <>
+bool Widget::GetPersistentXmlProp(std::string prop,int32_t &value) {
+    double tmp;
+    if(GetPersistentXmlProp<double>(prop,tmp)) {
+        value=tmp;
+        return true;
+    } else {
+        return false;
+    }
+}
+
+template <>
+bool Widget::GetPersistentXmlProp(std::string prop,uint16_t &value) {
+    double tmp;
+    if(GetPersistentXmlProp<double>(prop,tmp)) {
+        value=tmp;
+        return true;
+    } else {
+        return false;
+    }
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop,string value,xmlNodePtr node)
+{
+    if(node==NULL) node=pimpl_->send_node;
+    xmlSetProp(node,(xmlChar*)prop.c_str(),(xmlChar*)value.c_str());
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop,char* value,xmlNodePtr node)
+{
+    if(node==NULL) node=pimpl_->send_node;
+    xmlSetProp(node,(xmlChar*)prop.c_str(),(xmlChar*)value);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop,double value,xmlNodePtr node)
+{
+    xmlChar* xmlChar_value=xmlXPathCastNumberToString(value);
+
+    if(node==NULL) node=pimpl_->send_node;
+    xmlSetProp(node,(xmlChar*)prop.c_str(),xmlChar_value);
+    xmlFree(xmlChar_value);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop,float value,xmlNodePtr node)
+{
+    SetVolatileXmlProp<double>(prop,value,node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop,int32_t value,xmlNodePtr node)
+{
+    SetVolatileXmlProp<double>(prop,value,node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop,uint32_t value,xmlNodePtr node)
+{
+    SetVolatileXmlProp<double>(prop,value,node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop,int16_t value,xmlNodePtr node)
+{
+    SetVolatileXmlProp<double>(prop,value,node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop,uint16_t value,xmlNodePtr node)
+{
+    SetVolatileXmlProp<double>(prop,value,node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop,int8_t value,xmlNodePtr node)
+{
+    SetVolatileXmlProp<double>(prop,value,node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop,uint8_t value,xmlNodePtr node)
+{
+    SetVolatileXmlProp<double>(prop,value,node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop,bool value,xmlNodePtr node)
+{
+    SetVolatileXmlProp<double>(prop,value,node);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop,xmlChar* value,xmlNodePtr node) {
+    if(node==NULL) node=pimpl_->send_node;
+    xmlSetProp(node,(xmlChar*)prop.c_str(),value);
+}
+
+template <>
+void Widget::SetVolatileXmlProp(string prop,DataType const &dataType,xmlNodePtr node) {
+    if(node==NULL) node=pimpl_->send_node;
+    xmlSetProp(node,(xmlChar*)prop.c_str(),(xmlChar*)dataType.GetDescription().c_str());
+/*
+    switch(dataType)
+    {
+        case io_data::Float:
+            xmlSetProp(node,(xmlChar*)prop.c_str(),(xmlChar*)"float");
+            break;
+        case io_data::Int8_t:
+            xmlSetProp(node,(xmlChar*)prop.c_str(),(xmlChar*)"int8_t");
+            break;
+        case io_data::Int16_t:
+            xmlSetProp(node,(xmlChar*)prop.c_str(),(xmlChar*)"int16_t");
+            break;
+    }
+    */
+}
+
+template <>
+void Widget::SetPersistentXmlProp(std::string prop,double value) {
+    SetVolatileXmlProp(prop,value);
+    SetVolatileXmlProp(prop,value,pimpl_->file_node);
+}
+
+template <>
+void Widget::SetPersistentXmlProp(std::string prop,float value)
+{
+    SetVolatileXmlProp(prop,value);
+    SetVolatileXmlProp(prop,value,pimpl_->file_node);
+}
+
+template <>
+void Widget::SetPersistentXmlProp(std::string prop,int32_t value)
+{
+    SetVolatileXmlProp(prop,value);
+    SetVolatileXmlProp(prop,value,pimpl_->file_node);
+}
+
+template <>
+void Widget::SetPersistentXmlProp(std::string prop,uint16_t value)
+{
+    SetVolatileXmlProp(prop,value);
+    SetVolatileXmlProp(prop,value,pimpl_->file_node);
+}
+
+template <>
+void Widget::SetPersistentXmlProp(std::string prop,bool value)
+{
+    SetVolatileXmlProp(prop,value);
+    SetVolatileXmlProp(prop,value,pimpl_->file_node);
+}
+
+void Widget::SendXml(void)
+{
+    pimpl_->SendXml();
+}
+
+void Widget::setEnabled(bool status)
+{
+    pimpl_->setEnabled(status);
+}
+
+bool Widget::isEnabled(void) const
+{
+    return pimpl_->isenabled;
+
+}
+
+} // end namespace gui
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/Widget.h
===================================================================
--- /trunk/lib/FlairCore/src/Widget.h	(revision 2)
+++ /trunk/lib/FlairCore/src/Widget.h	(revision 2)
@@ -0,0 +1,148 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Widget.h
+ * \brief Abstract class for all Framework's widget classes
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/05/02
+ * \version 4.0
+ */
+
+#ifndef WIDGET_H
+#define WIDGET_H
+
+#include <Object.h>
+//#include <io_data.h>
+#include <libxml/xpath.h>
+
+class Widget_impl;
+class FrameworkManager_impl;
+
+namespace flair
+{
+namespace gui
+{
+
+    /*! \class Widget
+    *
+    * \brief Abstract class for all Framework's widget classes
+    *
+    * A widget is an object to display on the ground station. \n
+    * Communication with ground station is done through xml files; properties of theses files
+    * are modified through appropriate method. \n
+    * A xml file is used for default values of the Widget, if it has been specified in the
+    *  constructor of the FrameworkManager.
+    */
+    class Widget: public core::Object
+    {
+        friend class core::FrameworkManager;
+        friend class ::Widget_impl;
+        friend class ::FrameworkManager_impl;
+
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a Widget, the xml file specified to the FrameworkManager's
+            * constructor is sued for default values. \n
+            * Two Widget with same parent must have different names. If a brother Widget already
+            * has the same name, the name of the new one will be automatically changed. \n
+            * Type must agree with predifined (hard coded) types
+            * in ground station code.
+            *
+            * \param parent parent
+            * \param name name
+            * \param type type
+            */
+            Widget(const Widget* parent,std::string name,std::string type);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            virtual ~Widget();
+
+            /*!
+            * \brief Set enabled
+            *
+            * Enable or disable the Widget on the ground station. \n
+            * A disabled widget is greyed out on the ground station
+            * and in unmodifiable.
+            *
+            * \param status
+            */
+            void setEnabled(bool status);
+
+            /*!
+            * \brief Is enabled?
+            *
+            * \return true if widget is enabled
+            */
+            bool isEnabled(void) const;
+
+        protected:
+            /*!
+            * \brief Set a persistent xml property
+            *
+            * The property will be saved in the configuration xml and also used to configure the ground station.
+            *
+            * \param prop property to set and save
+            * \param value value to set and save
+            */
+            template <typename T>
+            void SetPersistentXmlProp(std::string prop,T value);
+
+            /*!
+            * \brief Get a persistent xml property
+            *
+            * Get the property from the xml file. If no corresponding property is found in the xml, value remains unchanged. \n
+            * Thus value can be initialized with a default value before calling this method.
+            *
+            * \param prop property to get
+            * \param value value to store the result
+            * \return true if value was changed
+            */
+            template <typename T>
+            bool GetPersistentXmlProp(std::string prop,T &value);
+
+            /*!
+            * \brief Set a volatile xml property
+            *
+            * This property should be used to configure the ground station (one time init). \n
+            * The property will be destroyed after calling SendXml() as it should no be used anymore.
+            *
+            * \param prop property to set
+            * \param value value to set
+            * \param node if sepcified, node to set; otherwise use the node of the Widget
+            */
+            template <typename T>
+            void SetVolatileXmlProp(std::string prop,T value,xmlNodePtr node=NULL);
+
+            /*!
+            * \brief Send xml
+            *
+            * Send Widget's xml to ground station. \n
+            * New changes will be taken into account by ground station. \n
+            * All volatile properties will be erased after calling ths method, as they should not be used anymore.
+            */
+            void SendXml(void);
+
+            /*!
+            * \brief Xml event
+            *
+            * This method must be reimplemented to handle a xml event. \n
+            * It is automatically called when something changed from
+            * ground station. \n
+            */
+            virtual void XmlEvent(void){};
+
+         private:
+            class Widget_impl* pimpl_;
+    };
+
+} // end namespace gui
+} // end namespace flair
+
+#endif // WIDGET_H
Index: /trunk/lib/FlairCore/src/Widget_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/Widget_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/Widget_impl.cpp	(revision 2)
@@ -0,0 +1,369 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/05/02
+//  filename:   Widget.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe pour widget
+//
+//
+/*********************************************************************/
+
+#include "Widget.h"
+#include "Widget_impl.h"
+#include "Object_impl.h"
+#include "FrameworkManager.h"
+#include "FrameworkManager_impl.h"
+#include "config.h"
+#ifdef __XENO__
+#include <native/heap.h>
+#else
+#include <errno.h>
+#include <cstring>
+#endif
+
+using std::string;
+using std::vector;
+using namespace flair::core;
+using namespace flair::gui;
+
+namespace{
+#ifdef __XENO__
+    RT_HEAP xml_heap;
+
+    void xml2_free(void *mem)
+    {
+        //Printf("free %x\n",mem);
+        if(mem==NULL) return;
+        int status=rt_heap_free(&xml_heap,mem);
+
+        if(status!=0)
+        {
+            printf("libxml2: rt_heap_free error (%s)\n",strerror(-status));
+        }
+    }
+
+    void *xml2_alloc(size_t sz)
+    {
+        void *ptr;
+        //printf("alloc %i\n",sz);
+        int status=rt_heap_alloc(&xml_heap,sz,TM_NONBLOCK ,&ptr);
+        if(status!=0)
+        {
+            printf("libxml2: rt_heap_alloc error (%s)\n",strerror(-status));
+        }
+        //Printf("alloc %x %i\n",ptr,sz);
+
+        return ptr;
+
+    }
+
+    void *xml2_realloc(void *emem,size_t sz)
+    {
+        //Printf("realloc %x %i -> %i\n",emem,sz,sz);
+        void *mem_re;
+
+
+        if (emem == NULL)
+        {
+            return xml2_alloc(sz);
+        }
+        else if (sz == 0)
+        {
+            xml2_free(emem);
+        }
+
+        mem_re = xml2_alloc(sz);
+
+        memcpy(mem_re, emem, sz);
+
+        xml2_free(emem);
+
+        return mem_re;
+    }
+
+    char *xml2_strdup(const char * str)
+    {
+       // printf("strdup %s\n",str);
+        char *s = (char*)xml2_alloc(strlen(str) + 1);
+        if (s == NULL)
+           return NULL;
+
+        strcpy(s, str);
+        return s;
+
+    }
+#endif //__XENO__
+}
+
+Widget_impl::Widget_impl(Widget* self,const Widget* parent,string name,string type)
+{
+    //Printf("Widget %s\n",name.c_str());
+    isenabled=true;
+    file_node=NULL;
+    this->self=self;
+
+    //n'est execute qu'une fois lorsqu'on construit le FrameworkManager
+    if(parent==NULL)
+    {
+#ifdef __XENO__
+        string tmp_name;
+        tmp_name=name + "-xml";
+        int status=rt_heap_create(&xml_heap,tmp_name.c_str(),XML_HEAP,H_FIFO);
+        if(status!=0)
+        {
+            self->Err("rt_heap_create error (%s)\n",strerror(-status));
+        }
+
+        xmlMemSetup(xml2_free,xml2_alloc, xml2_realloc,xml2_strdup);
+#endif //__XENO__
+    }
+
+    //xml init
+    if(parent==NULL)
+    {
+        //create local doc
+        send_doc = xmlNewDoc((xmlChar*)"1.0");
+        send_node = xmlNewNode(NULL, (xmlChar*)type.c_str());
+        xmlDocSetRootElement(send_doc, send_node);
+        xmlSetProp(send_node,(xmlChar*)"name",(xmlChar*)self->ObjectName().c_str());
+    }
+    else
+    {
+        parent->pimpl_->AddChild(self);
+
+        //get node corresponding to this widget in the xml file
+        if(parent->pimpl_->file_node!=NULL)
+        {
+            xmlChar* search=xmlCharStrdup(type.c_str());
+            file_node=GetNodeByProp(parent->pimpl_->file_node->xmlChildrenNode,search,(xmlChar*)"name",(xmlChar*)name.c_str());
+            xmlFree(search);
+        }
+        else
+        {
+            self->Err("parent->file_node is NULL\n");
+        }
+
+        if(file_node==NULL)
+        {
+            self->Warn("%s, no match found in xml file\n",type.c_str());
+            xmlNode *node;
+            node=xmlNewNode(NULL, (xmlChar*)type.c_str());
+            xmlSetProp(node,(xmlChar*)"name",(xmlChar*)name.c_str());
+            file_node=xmlAddChild(parent->pimpl_->file_node,node);
+            //((Widget*)getFrameworkManager())->pimpl_->PrintXml();
+        }
+
+        send_doc=parent->pimpl_->CopyDoc();
+
+        //on recupere le dernier node
+        xmlNodePtr node=xmlDocGetRootElement(send_doc);
+        while(node->children!=NULL) node=node->children;
+
+        //on ajoute le node du widget
+        send_node = xmlNewNode(NULL, (xmlChar*)type.c_str());
+        xmlSetProp(send_node,(xmlChar*)"name",(xmlChar*)name.c_str());
+        xmlAddChild(node,send_node);
+    }
+
+    //Printf("Widget ok %s\n",name.c_str());
+}
+
+Widget_impl::~Widget_impl()
+{
+    //Printf("destruction widget %s\n",self->ObjectName().c_str());
+
+    if(self->Parent()!=NULL) ((Widget*)(self->Parent()))->pimpl_->RemoveChild(self);
+
+    //on efface les widgets enfants avant d'envoyer son propre delete au sol
+    //dans le delete child on modifie le child du parent, donc on se refere toujours au premier
+    while(childs.size()!=0)
+    {
+        //Printf("child %i %s\n",childs.size(),childs.front()->ObjectName().c_str());
+        if(childs.front()!=NULL) delete childs.front();
+    }
+    childs.clear();
+
+    self->SetVolatileXmlProp("Delete",true);
+
+    if(self->Parent()!=NULL) SendXml();
+
+    xmlFreeDoc(send_doc);
+
+    if(self->Parent()==NULL)
+    {
+        xmlCleanupParser();
+#ifdef __XENO__
+        int status;
+        RT_HEAP_INFO info;
+        status=rt_heap_inquire(&xml_heap,&info);
+        if(status!=0)
+        {
+            self->Err("rt_heap_inquire error (%s)\n",strerror(-status));
+        }
+        if(info.usedmem!=0) self->Err("fuite memoire xml heap (%ld)\n",info.usedmem);
+    //Printf("fin heap xml\n");
+        status=rt_heap_delete(&xml_heap);
+        if(status!=0)
+        {
+            self->Err("rt_heap_delete error (%s)\n",strerror(-status));
+        }
+#endif
+    }
+    //Printf("destruction widget %s ok\n",self->ObjectName().c_str());
+}
+
+void Widget_impl::AddChild(const Widget* child)
+{
+    childs.push_back((Widget*)child);
+}
+
+void Widget_impl::RemoveChild(const Widget* child)
+{
+    for(vector<Widget*>::iterator it=childs.begin() ; it < childs.end(); it++ )
+    {
+        if(*it==child)
+        {
+            childs.erase(it);
+            break;
+        }
+    }
+}
+
+xmlDocPtr Widget_impl::CopyDoc(void)
+{
+    return xmlCopyDoc(send_doc,1);
+}
+
+void Widget_impl::ClearXmlProps(void) {
+    xmlUnlinkNode(send_node);
+    xmlFreeNode(send_node);
+
+    xmlNodePtr node;
+    node=xmlDocGetRootElement(send_doc);
+
+    if(node==NULL) {//il ne reste plus rien, on refait le rootelement
+        send_node = xmlNewNode(NULL, (xmlChar*)XML_ROOT_TYPE);
+        xmlSetProp(send_node,(xmlChar*)"name",(xmlChar*)self->ObjectName().c_str());
+        xmlDocSetRootElement(send_doc, send_node);
+    } else {
+        while(node->children!=NULL) node=node->children;
+        send_node = xmlNewNode(NULL, (xmlChar*)self->ObjectType().c_str());
+        xmlSetProp(send_node,(xmlChar*)"name",(xmlChar*)self->ObjectName().c_str());
+        xmlAddChild(node,send_node);
+    }
+}
+
+void Widget_impl::printSendNode() {
+
+    xmlChar *xmlbuff;
+    int buffersize;
+    xmlDocDumpFormatMemory(send_doc, &xmlbuff, &buffersize, 1);
+    Printf("xml:\n%s\n",xmlbuff);
+    xmlFree(xmlbuff);
+}
+
+void Widget_impl::SendXml(void)
+{
+    if(getUiCom()!=NULL) {
+        xmlChar *xmlbuff;
+        int buffersize;
+        xmlDocDumpFormatMemory(send_doc, &xmlbuff, &buffersize, 0);
+        getUiCom()->Send((char*)xmlbuff,buffersize);
+        xmlFree(xmlbuff);
+
+        ClearXmlProps();
+    }
+}
+
+void Widget_impl::setEnabled(bool status) {
+    self->SetVolatileXmlProp("IsEnabled",status);
+    SendXml();
+}
+
+
+void Widget_impl::ProcessXML(xmlNode *node)
+{
+    //Printf("ProcessXML %s %s\n",xmlGetProp(send_node, (xmlChar*)"name"),send_node->name);
+    xmlNode *cur_node = NULL;
+
+    for(size_t i=0;i<childs.size();i++)
+    {
+        for (cur_node = node; cur_node; cur_node = cur_node->next)
+        {
+            if (cur_node->type == XML_ELEMENT_NODE)
+            {
+                //Printf("recherche %s\n", xmlGetProp(cur_node, (xmlChar*)"name"));
+                xmlChar* name=NULL;
+                name=xmlGetProp(cur_node, (xmlChar*)"name");
+                if (!xmlStrcmp((xmlChar *)childs[i]->ObjectName().c_str(), name))
+                {
+                    //Printf("correspond %s\n",childs[i]->ObjectName().c_str());
+                    xmlChar* new_name=NULL;
+                    new_name=xmlGetProp(cur_node, (xmlChar*)"new_name");
+                    if(new_name!=NULL)
+                    {
+                        unsigned char* ren_name=new_name;//xmlGetProp(cur_node, (xmlChar*)"new_name");
+                        self->Warn("%s existe deja, renommage en %s; possiblite de problemes!!\n",childs[i]->ObjectName().c_str(),new_name);
+                        childs[i]->Object::pimpl_->name=((const char*)ren_name);
+                        xmlSetProp(childs[i]->pimpl_->send_node,(xmlChar*)"name",xmlGetProp(cur_node, (xmlChar*)"new_name"));
+                        xmlFree(new_name);
+                        if(name!=NULL) xmlFree(name);
+                        break;
+                    }
+
+                    if(name!=NULL) xmlFree(name);
+
+                    //update file node
+                    xmlAttr *cur_prop = NULL;
+                    //xmlAttr *file_prop = NULL;
+                    for (cur_prop = cur_node->properties; cur_prop; cur_prop = cur_prop->next)
+                    {
+                        //Printf("rcv prop %s %s\n",cur_prop->name,cur_prop->children->content);
+                        xmlSetProp(childs[i]->pimpl_->file_node,cur_prop->name,cur_prop->children->content);
+                    }
+
+                    childs[i]->XmlEvent();
+
+                    childs[i]->pimpl_->ProcessXML(cur_node->children);
+                    break;
+
+                }
+                if(name!=NULL) xmlFree(name);
+            }
+        }
+    }
+
+    //printf("fin ProcessXML %s %s\n",xmlGetProp(send_node, (xmlChar*)"name"),send_node->name);
+}
+
+
+xmlNodePtr Widget_impl::GetNodeByProp(xmlNodePtr doc,xmlChar *type,xmlChar *prop,xmlChar *value)
+{
+	//printf("cherche keyword: %s %s %s\n", type,prop,value);
+    xmlNode *cur_node = NULL;
+	for (cur_node = doc; cur_node; cur_node = cur_node->next)
+    {
+        if (cur_node->type == XML_ELEMENT_NODE)
+        {
+            //printf("node %s %s\n",xmlGetProp(cur_node, (xmlChar*)"name"),cur_node->name);
+            xmlChar *test = NULL;
+            test=xmlGetProp(cur_node, prop);
+            if(!xmlStrcmp(test,value) && !xmlStrcmp(cur_node->name,type ))
+            {
+                //printf("ok\n");
+                if(test!=NULL) xmlFree(test);
+                return cur_node;
+            }
+            if(test!=NULL) xmlFree(test);
+        }
+    }
+
+    return NULL;
+}
Index: /trunk/lib/FlairCore/src/cvimage.cpp
===================================================================
--- /trunk/lib/FlairCore/src/cvimage.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/cvimage.cpp	(revision 2)
@@ -0,0 +1,78 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/20
+//  filename:   cvimage.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining an image of kind IplImage
+//
+/*********************************************************************/
+
+#include "cvimage.h"
+
+using std::string;
+
+namespace flair { namespace core {
+
+cvimage::cvimage(const Object* parent,uint16_t width,uint16_t height,Type::Format format,string name,bool allocate_data,int n): io_data(parent,name,n),dataType(width,height,format) {
+    this->allocate_data=allocate_data;
+
+    if(allocate_data) {
+        switch(format) {
+            case Type::Format::YUYV:
+            case Type::Format::UYVY:
+                img=cvCreateImage(cvSize(width,height),IPL_DEPTH_8U,2);
+                break;
+            case Type::Format::BGR:
+                img=cvCreateImage(cvSize(width,height),IPL_DEPTH_8U,3);
+                break;
+            case Type::Format::GRAY:
+                img=cvCreateImage(cvSize(width,height),IPL_DEPTH_8U,1);
+                break;
+            default:
+                Err("format no supported");
+                break;
+        }
+    } else {
+        if(n>1) Err("number of samples!=1 not possible when not allocating data\n");
+        n=1;
+        switch(format) {
+            case Type::Format::YUYV:
+            case Type::Format::UYVY:
+                img=cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,2);
+                break;
+            case Type::Format::BGR:
+                img=cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,3);
+                break;
+            case Type::Format::GRAY:
+                img=cvCreateImageHeader(cvSize(width,height),IPL_DEPTH_8U,1);
+                break;
+            default:
+                Err("format no supported");
+                break;
+        }
+    }
+
+    SetPtrToCircle((void**)&img);
+
+    if(n>1) prev=new cvimage(this,width,height,format,name,n-1);
+}
+
+cvimage::~cvimage() {
+    //printf("destructeur cvimage\n");
+
+    cvReleaseImage(&img);
+}
+
+void cvimage::CopyDatas(char* dst) const {
+    Warn("non implementé\n");
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/cvimage.h
===================================================================
--- /trunk/lib/FlairCore/src/cvimage.h	(revision 2)
+++ /trunk/lib/FlairCore/src/cvimage.h	(revision 2)
@@ -0,0 +1,125 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file cvimage.h
+ * \brief Class defining an image of kind IplImage
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/20
+ * \version 4.0
+ */
+
+#ifndef CVIMAGE_H
+#define CVIMAGE_H
+
+#include <cxcore.h>
+#include <io_data.h>
+#include <stdint.h>
+
+namespace flair
+{
+namespace core
+{
+    /*! \class cvimage
+    *
+    * \brief Class defining an image of kind IplImage
+    *
+    * IplImage is an image struct defined in OpenCV.
+    *
+    */
+    class cvimage: public io_data {
+    public:
+        class Type: public DataType {
+        public:
+            /*!
+            \enum Format_t
+            \brief Picture formats
+            */
+            enum class Format {
+                YUYV,/*!< YUYV 16 bits */
+                UYVY,/*!< UYVY 16 bits */
+                BGR,/*!< BGR 24 bits */
+                GRAY,/*!< gray 8 bits */
+            } ;
+            Type(uint16_t _width, uint16_t _height, Format _format):width(_width),height(_height),format(_format) {}
+
+            size_t GetSize() const {
+                size_t pixelSize;
+                switch(format) {
+                case Format::GRAY:
+                    pixelSize=1;
+                    break;
+                case Format::YUYV:
+                case Format::UYVY:
+                    pixelSize=2;
+                    break;
+                case Format::BGR:
+                    pixelSize=3;
+                    break;
+                default:
+                    pixelSize=0; //TODO should throw an exception instead
+                }
+                return pixelSize*width*height;
+            }
+            std::string GetDescription() const {return "cv image";};
+
+            Format GetFormat() const {return format;};
+            uint16_t GetWidth() const {return width;};
+            uint16_t GetHeight() const {return height;};
+
+        private:
+            uint16_t width;
+            uint16_t height;
+            Format format;
+
+        };
+
+        /*!
+        * \brief Constructor
+        *
+        * Construct an io_data representing an IplImage.
+        *
+        * \param parent parent
+        * \param width image width
+        * \param height image height
+        * \param name name
+        * \param allocate_data if true, IplImage image data is allocated; otherwise img->imagedata must be changed
+        * \param n number of samples
+        */
+        cvimage(const Object* parent,uint16_t width,uint16_t height,Type::Format format,std::string name="",bool allocate_data=true,int n=1);
+
+        /*!
+        * \brief Destructor
+        *
+        */
+        ~cvimage();
+
+        /*!
+        * \brief IplImage
+        *
+        * \return IplImage
+        */
+        IplImage* img;
+
+        Type const&GetDataType() const {return dataType;};
+
+    private:
+        /*!
+        * \brief Copy datas
+        *
+        * Reimplemented from io_data. \n
+        * See io_data::CopyDatas.
+        *
+        * \param dst destination buffer
+        */
+        void CopyDatas(char* dst) const;
+
+        bool allocate_data;
+        Type dataType;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // CVIMAGE_H
Index: /trunk/lib/FlairCore/src/cvmatrix.cpp
===================================================================
--- /trunk/lib/FlairCore/src/cvmatrix.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/cvmatrix.cpp	(revision 2)
@@ -0,0 +1,190 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/21
+//  filename:   cvmatrix.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class defining a matrix of kind CvMat
+//
+/*********************************************************************/
+
+#include "cvmatrix.h"
+#include "cvmatrix_impl.h"
+#include <cxcore.h>
+#include <typeinfo>
+
+#include <iostream>
+
+using std::string;
+
+namespace flair { namespace core {
+    /*! \class cvmatrixElement
+    */
+    class cvmatrixElement: public IODataElement {
+    public:
+        cvmatrixElement(const cvmatrix *matrix,string name,uint32_t row, uint32_t col):IODataElement(matrix,name) {
+            this->matrix=matrix;
+            this->row=row;
+            this->col=col;
+            if(row>=matrix->Rows() || col>=matrix->Cols()) {
+                matrix->Err("index (%i,%i) out of bound (%i,%i)\n",row,col,matrix->Rows()-1,matrix->Cols()-1);
+                size=0;
+            } else {
+                try {
+                    ScalarType const &scalarType=dynamic_cast<ScalarType const &>(matrix->GetDataType().GetElementDataType());
+                    size=scalarType.GetSize();
+                } catch (std::bad_cast e) {
+                    matrix->Err("type not handled\n");
+                    size=0;
+                }
+            }
+        }
+
+        ~cvmatrixElement() {
+        }
+
+        void CopyData(char* dst) const {
+            if (typeid(matrix->GetDataType().GetElementDataType())==typeid(FloatType)) {
+                float value=matrix->Value(row,col);
+                memcpy(dst,&value,sizeof(value));
+            } else if (typeid(matrix->GetDataType().GetElementDataType())==typeid(SignedIntegerType)) {
+                switch(matrix->GetDataType().GetElementDataType().GetSize()) {
+                case 1: {
+                        int8_t int8Value=matrix->Value(row,col);
+                        memcpy(dst,&int8Value,1);
+                    }
+                    break;
+                case 2: {
+                        int16_t int16Value=matrix->Value(row,col);
+                        memcpy(dst,&int16Value,2);
+                    }
+                    break;
+                }
+            }
+        }
+
+        DataType const &GetDataType(void) const {
+            return matrix->GetDataType().GetElementDataType();
+        }
+
+    private:
+        const cvmatrix *matrix;
+        uint32_t row,col;
+
+    };
+
+cvmatrix::cvmatrix(const Object* parent,uint32_t rows, uint32_t cols, ScalarType const &elementDataType,string name,uint32_t n): io_data(parent,name,n),dataType(rows,cols,elementDataType) {
+    pimpl_=new cvmatrix_impl(this,rows,cols,elementDataType,n);
+
+    for(uint32_t i=0;i<rows;i++) {
+        for(uint32_t j=0;j<cols;j++) {
+            AppendLogDescription(pimpl_->descriptor->ElementName(i,j),elementDataType);
+            SetValue(i,j,0);
+        }
+    }
+}
+
+cvmatrix::cvmatrix(const Object* parent,const cvmatrix_descriptor *descriptor, ScalarType const &elementDataType,string name,uint32_t n): io_data(parent,name,n),dataType(descriptor->Rows(),descriptor->Cols(),elementDataType) {
+    pimpl_=new cvmatrix_impl(this,descriptor,elementDataType,n);
+
+    for(uint32_t i=0;i<descriptor->Rows();i++) {
+        for(uint32_t j=0;j<descriptor->Cols();j++) {
+            AppendLogDescription(descriptor->ElementName(i,j),elementDataType);
+            SetValue(i,j,0);
+        }
+    }
+}
+
+cvmatrix::~cvmatrix() {
+    delete pimpl_;
+}
+
+IODataElement* cvmatrix::Element(uint32_t row, uint32_t col) const {
+    return new cvmatrixElement(this,Name(row,col),row,col);
+}
+
+IODataElement* cvmatrix::Element(uint32_t index) const {
+    if(Rows()==1) {
+        return new cvmatrixElement(this,Name(0,index),0,index);
+    } else if(Cols()==1) {
+        return new cvmatrixElement(this,Name(index,0),index,0);
+    } else {
+        Err("matrix is not 1D\n");
+        return nullptr;
+    }
+}
+
+float cvmatrix::Value(uint32_t row, uint32_t col) const {
+    float value;
+
+    if(row>=(uint32_t)pimpl_->mat->rows || col>=(uint32_t)pimpl_->mat->cols) {
+        Warn("index (%i,%i) out of bound (%i,%i)\n",row,col,pimpl_->mat->rows-1,pimpl_->mat->cols-1);
+        return 0;
+    }
+
+    GetMutex();
+    value=cvGetReal2D(pimpl_->mat,row,col);
+    ReleaseMutex();
+
+    return value;
+}
+
+float cvmatrix::ValueNoMutex(uint32_t row, uint32_t col) const {
+    if(row>=(uint32_t)pimpl_->mat->rows || col>=(uint32_t)pimpl_->mat->cols) {
+        Warn("index (%i,%i) out of bound (%i,%i)\n",row,col,pimpl_->mat->rows-1,pimpl_->mat->cols-1);
+        return 0;
+    }
+
+    return cvGetReal2D(pimpl_->mat,row,col);
+}
+
+void cvmatrix::SetValue(uint32_t row, uint32_t col,float value) {
+    if(row>=(uint32_t)pimpl_->mat->rows || col>=(uint32_t)pimpl_->mat->cols) {
+        Warn("index (%i,%i) out of bound (%i,%i)\n",row,col,pimpl_->mat->rows-1,pimpl_->mat->cols-1);
+    } else {
+        GetMutex();
+        cvSetReal2D(pimpl_->mat,row,col,value);
+        ReleaseMutex();
+    }
+}
+
+void cvmatrix::SetValueNoMutex(uint32_t row, uint32_t col,float value) {
+    if(row>=(uint32_t)pimpl_->mat->rows || col>=(uint32_t)pimpl_->mat->cols) {
+        Warn("index (%i,%i) out of bound (%i,%i)\n",row,col,pimpl_->mat->rows-1,pimpl_->mat->cols-1);
+    } else {
+        cvSetReal2D(pimpl_->mat,row,col,value);
+    }
+}
+
+CvMat* cvmatrix::getCvMat(void) const {
+    return pimpl_->mat;
+}
+
+void cvmatrix::CopyDatas(char* dst) const {
+    GetMutex();
+    //printf("%f %x %i\n",cvGetReal2D(pimpl_->mat,0,0),dst,Size());
+    memcpy(dst,pimpl_->mat->data.ptr,dataType.GetSize());
+    ReleaseMutex();
+}
+
+uint32_t cvmatrix::Rows(void) const {
+    return pimpl_->mat->rows;
+}
+
+uint32_t cvmatrix::Cols(void) const {
+    return pimpl_->mat->cols;
+}
+
+string cvmatrix::Name(uint32_t row, uint32_t col) const {
+    return pimpl_->descriptor->ElementName(row,col);
+}
+
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/cvmatrix.h
===================================================================
--- /trunk/lib/FlairCore/src/cvmatrix.h	(revision 2)
+++ /trunk/lib/FlairCore/src/cvmatrix.h	(revision 2)
@@ -0,0 +1,215 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file cvmatrix.h
+ * \brief Class defining a matrix of kind CvMat
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/21
+ * \version 4.0
+ */
+
+#ifndef CVMATRIX_H
+#define CVMATRIX_H
+
+#include <io_data.h>
+#include <IODataElement.h>
+#include <cvmatrix_descriptor.h>
+
+class cvmatrix_impl;
+struct CvMat;
+
+namespace flair { namespace core {
+
+    /*! \class cvmatrix
+    *
+    * \brief Class defining a matrix of kind CvMat
+    *
+    * CvMat is a matrix struct defined in OpenCV.
+    *
+    */
+    class cvmatrix: public io_data {
+    public:
+        class Type: public DataType {
+        public:
+            Type(size_t _nbRows,size_t _nbCols,ScalarType const &_elementDataType):nbRows(_nbRows),nbCols(_nbCols),elementDataType(_elementDataType) {}
+            size_t GetSize() const {
+                return nbRows*nbCols*elementDataType.GetSize();
+            }
+            std::string GetDescription() const {return "matrix";}
+            size_t GetNbRows() const {return nbRows;}
+            size_t GetNbCols() const {return nbCols;}
+            ScalarType const &GetElementDataType() const {return elementDataType;}
+
+        private:
+            size_t nbRows,nbCols;
+            ScalarType const &elementDataType;
+        };
+
+        /*!
+        * \brief Constructor
+        *
+        * Construct an io_data representing a CvMat. \n
+        * It uses a cvmatrix_descriptor to get size and elements' names. \n
+        * Names are used for graphs and logs.
+        *
+        * \param parent parent
+        * \param descriptor matrix description
+        * \param type type of matrix elements
+        * \param name name
+        * \param n number of samples
+        */
+        cvmatrix(const Object* parent,const cvmatrix_descriptor *descriptor, ScalarType const &elementDataType,std::string name="",uint32_t n=1);
+
+        /*!
+        * \brief Constructor
+        *
+        * Construct an io_data representing a CvMat. \n
+        * Elements are unamed.
+        *
+        * \param parent parent
+        * \param rows matrix rows
+        * \param cols matrix cols
+        * \param type type of matrix elements
+        * \param name name
+        * \param n number of samples
+        */
+        cvmatrix(const Object* parent,uint32_t rows, uint32_t cols, ScalarType const &elementDataType,std::string name="",uint32_t n=1);
+
+        /*!
+        * \brief Destructor
+        *
+        */
+        ~cvmatrix();
+
+        /*!
+        * \brief Element value
+        *
+        * Element is accessed by locking and unlocking the io_data Mutex.
+        *
+        * \param row element row
+        * \param col element col
+        *
+        * \return element value
+        */
+        float Value(uint32_t row, uint32_t col) const;
+
+        /*!
+        * \brief Element value
+        *
+        * Element is not accessed by locking and unlocking the io_data Mutex. \n
+        * Thus, this function should be called with Mutex locked. \n
+        * This function is usefull when multiple successive access are done to the
+        * elments of the matrix. It avoids unnecessary locking and unlocking.
+        *
+        * \param row element row
+        * \param col element col
+        *
+        * \return element value
+        */
+        float ValueNoMutex(uint32_t row, uint32_t col) const;
+
+        /*!
+        * \brief Set element value
+        *
+        * Element is accessed by locking and unlocking the io_data Mutex.
+        *
+        * \param row element row
+        * \param col element col
+        * \param value element value
+        */
+        void SetValue(uint32_t row, uint32_t col,float value);
+
+        /*!
+        * \brief Set element value
+        *
+        * Element is not accessed by locking and unlocking the io_data Mutex. \n
+        * Thus, this function should be called with Mutex locked. \n
+        * This function is usefull when multiple successive access are done to the
+        * elments of the matrix. It avoids unnecessary locking and unlocking.
+        *
+        * \param row element row
+        * \param col element col
+        * \param value element value
+        */
+        void SetValueNoMutex(uint32_t row, uint32_t col,float value);
+
+        /*!
+        * \brief get CvMat
+        *
+        * The io_data Mutex must be used by the user.
+        */
+        CvMat* getCvMat(void) const;
+
+        /*!
+        * \brief Element name
+        *
+        * If cvmatrix was created without cvmatrix_descriptor, element name is empty.
+        *
+        * \param row element row
+        * \param col element col
+        *
+        * \return element name
+        */
+        std::string Name(uint32_t row, uint32_t col) const;
+
+        /*!
+        * \brief Element
+        *
+        * Get a pointer to a specific element. This pointer can be used for plotting.
+        *
+        * \param row element row
+        * \param col element col
+        *
+        * \return pointer to the element
+        */
+        IODataElement* Element(uint32_t row, uint32_t col) const;
+
+        /*!
+        * \brief Element
+        *
+        * Get a pointer to a specific element. This pointer can be used for plotting. \n
+        * This function can be used for a 1D matrix.
+        *
+        * \param index element index
+        *
+        * \return pointer to the element
+        */
+        IODataElement* Element(uint32_t index) const;
+
+        /*!
+        * \brief Number of rows
+        *
+        * \return rows
+        */
+        uint32_t Rows(void) const;
+
+        /*!
+        * \brief Number of colomns
+        *
+        * \return colomns
+        */
+        uint32_t Cols(void) const;
+
+        Type const &GetDataType() const {return dataType;};
+
+    private:
+        /*!
+        * \brief Copy datas
+        *
+        * Reimplemented from io_data. \n
+        * See io_data::CopyDatas.
+        *
+        * \param dst destination buffer
+        */
+        void CopyDatas(char* dst) const;
+
+        class cvmatrix_impl* pimpl_;
+        Type dataType;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // CVMATRIX_H
Index: /trunk/lib/FlairCore/src/cvmatrix_descriptor.cpp
===================================================================
--- /trunk/lib/FlairCore/src/cvmatrix_descriptor.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/cvmatrix_descriptor.cpp	(revision 2)
@@ -0,0 +1,68 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2014/02/05
+//  filename:   cvmatrix_descriptor.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Class describing cvmatrix elements, for log and graphs purpose
+//
+/*********************************************************************/
+
+#include "cvmatrix_descriptor.h"
+#include "FrameworkManager.h"
+
+using std::string;
+
+namespace flair { namespace core {
+
+cvmatrix_descriptor::cvmatrix_descriptor(uint32_t rows, uint32_t cols) {
+    this->rows=rows;
+    this->cols=cols;
+
+    if(rows==0 || cols==0) getFrameworkManager()->Err("rows and cols must be >0\n");
+
+    element_names=(string**)malloc(rows*cols*sizeof(string*));
+    for(uint32_t i=0; i<rows*cols; i++) {
+        element_names[i]=new string();
+    }
+}
+
+cvmatrix_descriptor::~cvmatrix_descriptor() {
+    for(uint32_t i=0; i<rows*cols; i++) {
+        delete element_names[i];
+    }
+    free(element_names);
+}
+
+void cvmatrix_descriptor::SetElementName(uint32_t row, uint32_t col,string name) {
+    if(row>=rows || col>=cols) {
+        getFrameworkManager()->Err("index out of bound %s (%i,%i), range (%i,%i)\n",name.c_str(),row,col,rows-1,cols-1);
+        return;
+    }
+    *element_names[row*cols+col]=name;
+}
+
+string cvmatrix_descriptor::ElementName(uint32_t row, uint32_t col) const {
+    if(row>=rows || col>=cols) {
+        getFrameworkManager()->Err("index out of bound (%i,%i), range (%i,%i)\n",row,col,rows-1,cols-1);
+        return *element_names[0];//safe value...
+    }
+    return *element_names[row*cols+col];
+}
+
+uint32_t cvmatrix_descriptor::Rows() const {
+    return rows;
+}
+
+uint32_t cvmatrix_descriptor::Cols() const {
+    return cols;
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/cvmatrix_descriptor.h
===================================================================
--- /trunk/lib/FlairCore/src/cvmatrix_descriptor.h	(revision 2)
+++ /trunk/lib/FlairCore/src/cvmatrix_descriptor.h	(revision 2)
@@ -0,0 +1,88 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file cvmatrix_descriptor.h
+ * \brief Class describing cvmatrix elements, for log and graphs purpose
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/05
+ * \version 4.0
+ */
+
+#ifndef CVMATRIX_DESCRIPTOR_H
+#define CVMATRIX_DESCRIPTOR_H
+
+#include <string>
+
+namespace flair { namespace core
+{
+
+    /*! \class cvmatrix_descriptor
+    *
+    * \brief Class describing cvmatrix elements, for log and graphs purpose
+    *
+    * This class allows to give a name to matrix elements. These names
+    * will be used in graphs and logs.
+    */
+    class cvmatrix_descriptor {
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct a matrix descriptor.
+            *
+            * \param rows matrix rows
+            * \param cols matrix cols
+            */
+            cvmatrix_descriptor(uint32_t rows, uint32_t cols);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            ~cvmatrix_descriptor();
+
+            /*!
+            * \brief Set element name
+            *
+            * \param row element row
+            * \param col element col
+            * \param name element name
+            */
+            void SetElementName(uint32_t row, uint32_t col,std::string name);
+
+            /*!
+            * \brief Element name
+            *
+            * \param row element row
+            * \param col element col
+            *
+            * \return element name
+            */
+            std::string ElementName(uint32_t row, uint32_t col) const;
+
+            /*!
+            * \brief Number of rows
+            *
+            * \return rows
+            */
+            uint32_t Rows(void) const;
+
+            /*!
+            * \brief Number of colomns
+            *
+            * \return colomns
+            */
+            uint32_t Cols(void) const;
+
+        private:
+            uint32_t rows,cols;
+            std::string **element_names;
+
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // CVMATRIX_DESCRIPTOR_H
Index: /trunk/lib/FlairCore/src/cvmatrix_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/cvmatrix_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/cvmatrix_impl.cpp	(revision 2)
@@ -0,0 +1,69 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/21
+//  filename:   cvmatrix_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe definissant le type de données "CvMat"
+//
+/*********************************************************************/
+
+#include "cvmatrix.h"
+#include "cvmatrix_impl.h"
+#include <cxcore.h>
+#include <typeinfo>
+#include <sstream>
+
+using std::string;
+using namespace flair::core;
+
+cvmatrix_impl::cvmatrix_impl(cvmatrix* self,int rows, int cols,flair::core::ScalarType const &_elementDataType,int n):elementDataType(_elementDataType) {
+    descriptor=new cvmatrix_descriptor(rows,cols);
+    Init(self,n);
+}
+
+cvmatrix_impl::cvmatrix_impl(cvmatrix* self,const cvmatrix_descriptor *descriptor,flair::core::ScalarType const &_elementDataType,int  n):elementDataType(_elementDataType) {
+    this->descriptor=descriptor;
+    Init(self,n);
+}
+
+void cvmatrix_impl::Init(cvmatrix* self,int n) {
+    this->self=self;
+
+    mat=nullptr;
+    try {
+        ScalarType const &scalarType=dynamic_cast<ScalarType const &>(elementDataType);
+        if (typeid(scalarType)==typeid(FloatType)) {
+            mat=cvCreateMat(descriptor->Rows(),descriptor->Cols(),CV_32FC1);
+        } else if (typeid(scalarType)==typeid(SignedIntegerType)) {
+            switch(elementDataType.GetSize()) {
+            case 1:
+                mat=cvCreateMat(descriptor->Rows(),descriptor->Cols(),CV_8SC1);
+                break;
+            case 2:
+                mat=cvCreateMat(descriptor->Rows(),descriptor->Cols(),CV_16SC1);
+                break;
+            default:
+                self->Err("unsupported integer scalar type\n");
+            }
+        } else {
+            self->Err("unsupported scalar type\n");
+        }
+    } catch(std::bad_cast e) {
+        self->Err("type is not a scalar\n");
+    }
+
+    if(mat==nullptr) self->Err("allocating matrix failed\n");
+    if(n>1) self->Warn("n>1 not supported\n");
+}
+
+cvmatrix_impl::~cvmatrix_impl() {
+    cvReleaseMat(&mat);
+    delete descriptor;
+}
Index: /trunk/lib/FlairCore/src/groups.dox
===================================================================
--- /trunk/lib/FlairCore/src/groups.dox	(revision 2)
+++ /trunk/lib/FlairCore/src/groups.dox	(revision 2)
@@ -0,0 +1,18 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*! \namespace framework
+ * 
+ * \brief namespace of the Framework
+ */
+
+/*! \namespace framework::core
+ * 
+ * \brief Core classes
+ */
+
+/*! \namespace framework::gui
+ * 
+ * \brief Graphical user interface classes
+ */
Index: /trunk/lib/FlairCore/src/io_data.cpp
===================================================================
--- /trunk/lib/FlairCore/src/io_data.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/io_data.cpp	(revision 2)
@@ -0,0 +1,68 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/21
+//  filename:   io_data.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    Abstract class for data types
+//
+//
+/*********************************************************************/
+
+#include "io_data.h"
+#include "io_data_impl.h"
+
+using std::string;
+
+namespace flair { namespace core {
+
+DummyType dummyType;
+FloatType floatType;
+SignedIntegerType Int8Type(8);
+SignedIntegerType Int16Type(16);
+
+io_data::io_data(const Object* parent,string name,int n): Mutex(parent,name) {
+    pimpl_=new io_data_impl(this,n);
+}
+
+io_data::~io_data() {
+    delete pimpl_;
+}
+
+void io_data::AppendLogDescription(string description,DataType const &datatype) {
+    pimpl_->AppendLogDescription(description,datatype);
+}
+
+void io_data::SetDataTime(Time time) {
+    GetMutex();
+    pimpl_->time=time;
+    ReleaseMutex();
+}
+
+Time io_data::DataTime(void) const {
+    Time tmp;
+    GetMutex();
+    tmp=pimpl_->time;
+    ReleaseMutex();
+    return tmp;
+}
+
+const io_data* io_data::Prev(int n) const {
+    if(n>0)
+        return prev->Prev(n-1);
+    else
+        return this;
+}
+
+void io_data::SetPtrToCircle(void **ptr) {
+    pimpl_->circle_ptr=ptr;
+}
+
+} // end namespace core
+} // end namespace flair
Index: /trunk/lib/FlairCore/src/io_data.h
===================================================================
--- /trunk/lib/FlairCore/src/io_data.h	(revision 2)
+++ /trunk/lib/FlairCore/src/io_data.h	(revision 2)
@@ -0,0 +1,171 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file io_data.h
+ * \brief Abstract class for data types.
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/21
+ * \version 4.0
+ */
+
+#ifndef IO_DATA_H
+#define IO_DATA_H
+
+#include <Mutex.h>
+
+class IODevice_impl;
+class io_data_impl;
+
+namespace flair { namespace core {
+
+    class Object;
+
+    class DataType {
+    public:
+        virtual std::string GetDescription() const =0;
+        //size in bytes
+        virtual size_t GetSize() const =0;
+    };
+
+    class DummyType: public DataType {
+    public:
+        size_t GetSize() const {return 0;}
+        std::string GetDescription() const {return "dummy";};
+    };
+    extern DummyType dummyType;
+
+    class ScalarType: public DataType {
+    public:
+        ScalarType(size_t _size):size(_size) {}
+        size_t GetSize() const {return size;}
+        virtual std::string GetDescription() const {return "scalar";};
+    private:
+        size_t size;
+    };
+
+    class SignedIntegerType: public ScalarType {
+    public:
+        SignedIntegerType(size_t sizeInBits):ScalarType(sizeInBits/8){}
+        std::string GetDescription() const {return "int"+std::to_string(GetSize()*8)+"_t";};
+    };
+    extern SignedIntegerType Int8Type;
+    extern SignedIntegerType Int16Type;
+
+    class FloatType: public ScalarType {
+    public:
+        FloatType():ScalarType(4){}
+        std::string GetDescription() const {return "float";};
+    };
+    extern FloatType floatType;
+
+
+    /*! \class io_data
+    *
+    * \brief Abstract class for data types.
+    *
+    * Use this class to define a custom data type. Data types ares used for logging and graphs. \n
+    * The reimplemented class must call SetSize() in its constructor. \n
+    * io_data can be constructed with n samples (see io_data::io_data).
+    * In this case, old samples can be accessed throug io_data::Prev.
+    */
+    class io_data: public Mutex {
+        friend class IODevice;
+        friend class ::IODevice_impl;
+        friend class ::io_data_impl;
+
+        public:
+            /*!
+            * \brief Constructor
+            *
+            * Construct an io_data. \n
+            *
+            * \param parent parent
+            * \param name name
+            * \param n number of samples
+            */
+            io_data(const Object* parent,std::string name,int n);
+
+            /*!
+            * \brief Destructor
+            *
+            */
+            virtual ~io_data();
+
+            /*!
+            * \brief Set data time
+            *
+            * \param time time
+            */
+            void SetDataTime(Time time);
+
+            /*!
+            * \brief Data time
+            *
+            * \return data time
+            */
+            Time DataTime(void) const;
+
+            /*!
+            * \brief Previous data
+            *
+            * Access previous data. io_data must have been constructed with
+            * n>1, io_data::SetPtrToCircle must have been set and
+            * io_data::prev must have been allocated.
+            *
+            * \param n previous data number
+            *
+            * \return previous data
+            */
+            const io_data* Prev(int n) const;
+
+            virtual DataType const&GetDataType() const =0;
+
+        protected:
+            /*!
+            * \brief Specify the description of the reimplemented class data's
+            *
+            *  This method must be called in the constructor of the reimplemented class, once by element. \n
+            *  Each element description must be called in the same order as CopyDatas put the datas in the buffer. \n
+            *  The description will be used for the log descriptor file.
+            *
+            * \param description description of the element
+            * \param datatype type of the element
+            */
+            void AppendLogDescription(std::string description, DataType const &datatype);
+
+            /*!
+            * \brief Set the datas to circle
+            *
+            * \param ptr pointer to the data to circle
+            */
+            void SetPtrToCircle(void **ptr);
+
+            /*!
+            * \brief Pointer to previous data
+            *
+            * Reimplemented class must allocate this pointer if n>1. \n
+            * Pointer must be allocated with the same kind of reimplemented class.
+            */
+            io_data* prev;
+
+        private:
+            /*!
+            * \brief Copy datas
+            *
+            * This method is automatically called by IODevice::ProcessUpdate to log io_data datas. \n
+            * This method must be reimplemented, in order to copy the datas to the logs.
+            * Copied datas must be of size io_data::Size.
+            *
+            * \param dst destination buffer
+            */
+            virtual void CopyDatas(char* dst) const =0;
+
+            io_data_impl *pimpl_;
+    };
+
+} // end namespace core
+} // end namespace flair
+
+#endif // IO_DATA_H
Index: /trunk/lib/FlairCore/src/io_data_impl.cpp
===================================================================
--- /trunk/lib/FlairCore/src/io_data_impl.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/io_data_impl.cpp	(revision 2)
@@ -0,0 +1,78 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2012/03/21
+//  filename:   io_data_impl.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe définissant une donnée générique
+//
+//
+/*********************************************************************/
+
+#include "io_data.h"
+#include "io_data_impl.h"
+#include <fstream>
+
+using std::string;
+using namespace flair::core;
+
+io_data_impl::io_data_impl(io_data* self,int n) {
+    this->self=self;
+    this->n=n;
+    if(n<1) self->Err("n doit être >0\n");
+    size=0;
+    is_consistent=false;
+    circle_ptr=NULL;
+}
+
+io_data_impl::~io_data_impl() {}
+
+void io_data_impl::AppendLogDescription(string description,DataType const &datatype) {
+    description+=" ("+datatype.GetDescription()+")";
+    descriptors.push_back(description);
+}
+
+void io_data_impl::WriteLogDescriptor(std::fstream& desc_file,int *index) {
+    for(size_t i=0;i<descriptors.size();i++) {
+        desc_file << (*index)++ << ": " << self->ObjectName() << " - " << descriptors.at(i) << "\n";
+    }
+}
+
+void io_data_impl::PrintLogDescriptor(void) {
+    for(size_t i=0;i<descriptors.size();i++) {
+        Printf("    %s\n",descriptors.at(i).c_str());
+    }
+}
+
+void io_data_impl::Circle(void) {
+    if(n>1) {
+        self->GetMutex();
+
+        void* tmp=*self->Prev(n-1)->pimpl_->circle_ptr;
+
+        for(int i=0;i<n-1;i++) {
+            //printf("%i\n",i);
+            *(self->Prev(n-1-i)->pimpl_->circle_ptr)=*(self->Prev(n-2-i)->pimpl_->circle_ptr);
+            self->Prev(n-1-i)->pimpl_->is_consistent=self->Prev(n-2-i)->pimpl_->is_consistent;
+            self->Prev(n-1-i)->pimpl_->time=self->Prev(n-2-i)->pimpl_->time;
+        }
+        *circle_ptr=tmp;
+        is_consistent=false;
+        self->ReleaseMutex();
+
+    }
+}
+
+bool io_data_impl::IsConsistent(void) {
+    return is_consistent;
+}
+
+void io_data_impl::SetConsistent(bool status) {
+    is_consistent=status;
+}
Index: /trunk/lib/FlairCore/src/ui_com.cpp
===================================================================
--- /trunk/lib/FlairCore/src/ui_com.cpp	(revision 2)
+++ /trunk/lib/FlairCore/src/ui_com.cpp	(revision 2)
@@ -0,0 +1,600 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   ui_com.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe permettant la lecture et l'ecriture sur socket UDT
+//
+//
+/*********************************************************************/
+
+#include "ui_com.h"
+#include <cstdlib>
+#include <string.h>
+#include <unistd.h>
+#include "Mutex.h"
+#include "SendData.h"
+#include "communication.h"
+#include "FrameworkManager.h"
+#include "zlib.h"
+#include <assert.h>
+#include "config.h"
+
+#ifdef __XENO__
+#include <pthread.h>
+#include <native/task.h>
+#include <native/task.h>
+#include <fcntl.h>
+#endif
+
+using std::string;
+using namespace flair::core;
+using namespace flair::gui;
+
+ui_com::ui_com(const Object *parent,UDTSOCKET sock): Thread(parent,"send",2)
+{
+    //buffer envoi
+    send_buffer=(char*)malloc(3);
+    send_size=3;//id(1)+period(2)
+
+    //mutex
+    send_mutex=NULL;
+    send_mutex=new Mutex(this,ObjectName());
+
+    socket_fd=sock;
+    connection_lost=false;
+
+#ifdef __XENO__
+    int status;
+    string tmp_name;
+
+    is_running=true;
+
+    //pipe
+    tmp_name= getFrameworkManager()->ObjectName() + "-" + ObjectName()+ "-pipe";
+    //xenomai limitation
+    if(tmp_name.size()>31) Err("rt_pipe_create error (%s is too long)\n",tmp_name.c_str());
+#ifdef RT_PIPE_SIZE
+    status=rt_pipe_create(&pipe, tmp_name.c_str(), P_MINOR_AUTO,RT_PIPE_SIZE);
+#else
+    status=rt_pipe_create(&pipe, tmp_name.c_str(), P_MINOR_AUTO,0);
+#endif
+
+    if(status!=0)
+    {
+        Err("rt_pipe_create error (%s)\n",strerror(-status));
+        //return -1;
+    }
+
+    //start user side thread
+#ifdef NRT_STACK_SIZE
+    // Initialize thread creation attributes
+    pthread_attr_t attr;
+    if(pthread_attr_init(&attr) != 0)
+    {
+        Err("pthread_attr_init error\n");
+    }
+
+    if(pthread_attr_setstacksize(&attr, NRT_STACK_SIZE) != 0)
+    {
+       Err("pthread_attr_setstacksize error\n");
+    }
+
+    if(pthread_create(&thread,  &attr, user_thread, (void*)this) < 0)
+#else //NRT_STACK_SIZE
+    if(pthread_create(&thread, NULL, user_thread, (void*)this) < 0)
+#endif //NRT_STACK_SIZE
+    {
+        Err("pthread_create error\n");
+      //return -1;
+    }
+#ifdef NRT_STACK_SIZE
+    if(pthread_attr_destroy(&attr) != 0)
+    {
+        Err("pthread_attr_destroy error\n");
+    }
+#endif
+
+#endif//__XENO__
+    int timeout=100;
+    if(UDT::setsockopt(socket_fd, 0, UDT_RCVTIMEO, &timeout, sizeof(int))!=0) Err("UDT::setsockopt error (UDT_RCVTIMEO)\n");
+
+    bool blocking = true;
+    if(UDT::setsockopt(socket_fd, 0, UDT_SNDSYN, &blocking, sizeof(bool))!=0) Err("UDT::setsockopt error (UDT_SNDSYN)\n");
+
+    if(UDT::setsockopt(socket_fd, 0, UDT_RCVSYN, &blocking, sizeof(bool))!=0) Err("UDT::setsockopt error (UDT_RCVSYN)\n");
+//#endif //__XENO__
+
+    Start();
+}
+
+
+ui_com::~ui_com()
+{
+    //printf("destruction ui_com\n");
+
+#ifdef __XENO__
+    is_running=false;
+
+    pthread_join(thread, NULL);
+
+    int status=rt_pipe_delete(&pipe);
+    if(status!=0) Err("rt_pipe_delete error (%s)\n",strerror(-status));
+#endif
+
+    SafeStop();
+
+    if(IsSuspended()==true) Resume();
+
+    Join();
+
+    if(send_buffer!=NULL) free(send_buffer);
+    send_buffer=NULL;
+
+    //printf("destruction ui_com ok\n");
+}
+
+void ui_com::Send(char* buf,ssize_t size) {
+    if(connection_lost==true) return;
+
+    char* tosend=buf;
+    ssize_t nb_write;
+
+    if(buf[0]==XML_HEADER) {
+        //cut xml header
+        tosend=strstr(buf,"<root");
+        size-=tosend-buf;
+    }
+
+#ifdef __XENO__
+    nb_write=rt_pipe_write(&pipe,tosend,size,P_NORMAL);
+
+    if(nb_write<0)
+    {
+        Err("rt_pipe_write error (%s)\n",strerror(-nb_write));
+    }
+    else if (nb_write != size)
+    {
+        Err("rt_pipe_write error %i/%i\n",nb_write,size);
+    }
+#else //__XENO__
+
+#ifdef COMPRESS_FRAMES
+    bool sendItCompressed=false;
+    if(buf[0]==XML_HEADER) {
+        sendItCompressed=true;
+    }
+
+    if(sendItCompressed) {
+        char *out;
+        ssize_t out_size;
+        if(compressBuffer(tosend, size,&out,&out_size, 9)==Z_OK) {
+            size=out_size;
+            nb_write = UDT::sendmsg(socket_fd,out,size, -1, true);
+            free(out);
+        } else {
+            Warn("Compress error, sending it uncompressed\n");
+            sendItCompressed=false;
+        }
+    }
+
+    if(!sendItCompressed) {
+        nb_write = UDT::sendmsg(socket_fd,tosend,size, -1, true);
+    }
+
+#else //COMPRESS_FRAMES
+    nb_write = UDT::sendmsg(socket_fd,tosend,size, -1, true);
+#endif //COMPRESS_FRAMES
+//Printf("write %i %i\n",nb_write,size);
+    if(nb_write<0) {
+        Err("UDT::sendmsg error (%s)\n",UDT::getlasterror().getErrorMessage());
+        if(UDT::getlasterror().getErrorCode()==CUDTException::ECONNLOST || UDT::getlasterror().getErrorCode()==CUDTException::EINVSOCK) {
+            connection_lost=true;
+        }
+    } else if (nb_write != size) {
+        Err("%s, code %i (%ld/%ld)\n",UDT::getlasterror().getErrorMessage(),UDT::getlasterror().getErrorCode(),nb_write,size);
+    }
+#endif //__XENO__
+}
+
+ssize_t ui_com::Receive(char* buf,ssize_t buf_size) {
+    ssize_t bytesRead= UDT::recvmsg(socket_fd,buf,buf_size);
+
+    if(bytesRead<0) {
+        if(UDT::getlasterror().getErrorCode()==CUDTException::ECONNLOST) {
+            Err("UDT::recvmsg error (%s)\n",UDT::getlasterror().getErrorMessage());
+            connection_lost=true;
+        }
+    }
+
+    return bytesRead;
+}
+
+void ui_com::Run(void)
+{
+    //check endianness
+    char header;
+    if(IsBigEndian())
+    {
+        header=DATAS_BIG_ENDIAN;
+        Printf("System is big endian\n");
+    }
+    else
+    {
+        header=DATAS_LITTLE_ENDIAN;
+        Printf("System is little endian\n");
+    }
+
+#ifdef __XENO__
+    WarnUponSwitches(true);
+    printf("\n");//a revoir pourquoi??
+    //sans ce printf, dans le simu_roll, le suspend ne fonctionne pas...
+#endif
+    //on attend d'avoir des choses à faire
+    Suspend();
+
+    while(!ToBeStopped())
+    {
+        size_t resume_id;
+        Time min=0xffffffffffffffffULL;
+
+        //on recpuere l'id de la prochaine execution
+        send_mutex->GetMutex();
+        resume_id=resume_time.size();
+        for(size_t i=0;i<resume_time.size();i++)
+        {
+            if(resume_time.at(i)<min && data_to_send.at(i)->IsEnabled()==true)
+            {
+                min=resume_time.at(i);
+                resume_id=i;
+            }
+        }
+
+        //attente
+        if(resume_id<resume_time.size())
+        {
+            Time time=resume_time.at(resume_id);
+            uint16_t resume_period=data_to_send.at(resume_id)->SendPeriod();
+            send_mutex->ReleaseMutex();
+            //on dort jusqu'a la prochaine execution
+            SleepUntil(time);
+
+            //envoi des donnees
+            int offset=3;
+            send_buffer[0]=header;
+            send_mutex->GetMutex();
+
+            for(size_t i=0;i<data_to_send.size();i++) {
+                if(data_to_send.at(i)->SendPeriod()==resume_period && data_to_send.at(i)->IsEnabled()==true) {
+                    data_to_send.at(i)->CopyDatas(send_buffer+offset);
+                    offset+=data_to_send.at(i)->SendSize();
+                }
+            }
+            if(offset!=3) {
+                memcpy(&send_buffer[1],&resume_period,sizeof(uint16_t));
+                //printf("send %i %i %i %x %x\n",resume_period,offset,sizeof(uint16_t),send_buffer,&send_buffer[1]);
+                //for(int i=0;i<offset;i++) printf("%x ",send_buffer[i]);
+                //printf("\n");
+                Send(send_buffer,offset);
+            }
+
+            //on planifie la prochaine execution
+            for(size_t i=0;i<data_to_send.size();i++)
+            {
+                if(data_to_send.at(i)->SendPeriod()==resume_period)
+                {
+                    resume_time.at(i)+=data_to_send.at(i)->SendPeriod()*1000000;
+                }
+            }
+            send_mutex->ReleaseMutex();
+            //Printf("%i %lld\n",resume_period,GetTime()/1000000);
+        }
+        else
+        {
+            send_mutex->ReleaseMutex();
+            //rien a faire, suspend
+            //Printf("rien a faire suspend\n");
+            Suspend();
+            //Printf("wake\n");
+            //on planifie la prochaine execution
+            Time time=GetTime();
+            send_mutex->GetMutex();
+            for(size_t i=0;i<data_to_send.size();i++)
+            {
+                resume_time.at(i)=time+(Time)data_to_send.at(i)->SendPeriod()*1000000;
+            }
+            send_mutex->ReleaseMutex();
+        }
+    }
+}
+#ifdef __XENO__
+void* ui_com::user_thread(void * arg)
+{
+    int pipe_fd=-1;
+    string devname;
+    char* buf=NULL;
+    ui_com *caller = (ui_com*)arg;
+    int rv;
+    fd_set set;
+    struct timeval timeout;
+    ssize_t nb_read,nb_write;
+
+    buf=(char*)malloc(NRT_PIPE_SIZE);
+    if(buf==NULL)
+    {
+        caller->Err("malloc error\n");
+    }
+
+    devname= NRT_PIPE_PATH + getFrameworkManager()->ObjectName() + "-" + caller->ObjectName()+ "-pipe";
+    while(pipe_fd<0)
+    {
+        pipe_fd = open(devname.c_str(), O_RDWR);
+        if (pipe_fd < 0 && errno!=ENOENT) caller->Err("open pipe_fd error (%s)\n",strerror(-errno));
+        usleep(1000);
+    }
+
+    while(1)
+    {
+        FD_ZERO(&set); // clear the set
+        FD_SET(pipe_fd, &set); // add our file descriptor to the set
+
+        timeout.tv_sec = 0;
+        timeout.tv_usec = SELECT_TIMEOUT_MS*1000;
+
+        rv = select(FD_SETSIZE, &set, NULL, NULL, &timeout);
+
+        if(rv == -1)
+        {
+            if(caller->is_running==false && UDT::getlasterror().getErrorCode()==CUDTException::ETIMEOUT) break;//timeout
+            if(UDT::getlasterror().getErrorCode()!=CUDTException::ETIMEOUT) caller->Err("epoll_wait, %s, code %i\n",UDT::getlasterror().getErrorMessage(),UDT::getlasterror().getErrorCode());
+        }
+        else if(rv == 0)
+        {
+            //printf("timeout\n"); // a timeout occured
+            if(caller->is_running==false) break;
+
+        }
+        else
+        {
+            nb_read=read(pipe_fd,buf,NRT_PIPE_SIZE);
+            buf[nb_read]=0;
+            //printf("envoi\n%s\n",buf);
+
+#ifdef COMPRESS_FRAMES
+            char *out;
+            ssize_t out_size;
+
+            if(buf[0]==XML_HEADER) {
+                if(compressBuffer(buf, nb_read,&out,&out_size, 9)==Z_OK) {
+                    nb_read=out_size;
+                    nb_write = UDT::sendmsg(caller->socket_fd,out,out_size, -1, true);
+                    free(out);
+                } else {
+                    caller->Warn("Compress error, sending it uncompressed\n");
+                    nb_write = UDT::sendmsg(caller->socket_fd, buf,nb_read, -1, true);
+                }
+            } else {
+                nb_write = UDT::sendmsg(caller->socket_fd, buf,nb_read, -1, true);
+            }
+#else
+            nb_write = UDT::sendmsg(caller->socket_fd, buf,nb_read, -1, true);
+#endif
+
+            if(nb_write<0)
+            {
+                caller->Err("UDT::sendmsg error (%s)\n",UDT::getlasterror().getErrorMessage());
+                if(UDT::getlasterror().getErrorCode()==CUDTException::ECONNLOST || UDT::getlasterror().getErrorCode()==CUDTException::EINVSOCK)
+                {
+                    caller->connection_lost=true;
+                }
+            }
+            else if (nb_write != nb_read)
+            {
+                caller->Err("UDT::sendmsg error %i/%i\n",nb_write,nb_read);
+            }
+        }
+    }
+
+    close(pipe_fd);
+    if(buf!=NULL) free(buf);
+    pthread_exit(0);
+}
+#endif
+
+int ui_com::compressBuffer(char *in, ssize_t in_size,char **out,ssize_t *out_size, int level)
+{
+    int ret, flush;
+    unsigned have;
+    z_stream strm;
+
+    /* allocate deflate state */
+    strm.zalloc = Z_NULL;
+    strm.zfree = Z_NULL;
+    strm.opaque = Z_NULL;
+    ret = deflateInit(&strm, level);
+    if (ret != Z_OK)
+        return ret;
+
+    *out=(char*)malloc(COMPRESS_CHUNK);
+    if(!(*out))
+        return Z_BUF_ERROR;
+
+    strm.next_in = (unsigned char*)in;
+    strm.avail_out =  COMPRESS_CHUNK;
+    strm.next_out = (unsigned char*)*out;
+    strm.avail_in=in_size;
+    flush=Z_FINISH;
+
+    ret = deflate(&strm, flush);    /* no bad return value */
+    if (ret == Z_STREAM_ERROR) {
+        free(*out);
+        return ret;
+    }
+
+    have = COMPRESS_CHUNK - strm.avail_out;
+    *out_size=have;
+//printf("%i -> %i\n",in_size,have);
+    /* clean up and return */
+    (void)deflateEnd(&strm);
+
+    if(strm.avail_out!=0) {
+        return Z_OK;
+    } else {
+        return Z_STREAM_ERROR;
+    }
+}
+
+int ui_com::uncompressBuffer(unsigned char *in, ssize_t in_size,unsigned char **out,ssize_t *out_size)
+{
+    int ret;
+    //unsigned have;
+    z_stream strm;
+
+    /* allocate inflate state */
+    strm.zalloc = Z_NULL;
+    strm.zfree = Z_NULL;
+    strm.opaque = Z_NULL;
+    strm.avail_in = 0;
+    strm.next_in = Z_NULL;
+    ret = inflateInit(&strm);
+    if (ret != Z_OK)
+        return ret;
+
+    *out=(unsigned char*)malloc(COMPRESS_CHUNK);
+    if(!(*out))
+        return Z_BUF_ERROR;
+
+    strm.avail_in = in_size;
+    strm.next_in = in;
+    strm.avail_out = COMPRESS_CHUNK;
+    strm.next_out = *out;
+
+    ret = inflate(&strm, Z_NO_FLUSH);
+    assert(ret != Z_STREAM_ERROR);  /* state not clobbered */
+    switch (ret) {
+    case Z_NEED_DICT:
+        ret = Z_DATA_ERROR;     /* and fall through */
+    case Z_DATA_ERROR:
+    case Z_MEM_ERROR:
+        (void)inflateEnd(&strm);
+        return ret;
+    }
+    //have = COMPRESS_CHUNK - strm.avail_out;
+
+    /* clean up and return */
+    (void)inflateEnd(&strm);
+    return ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR;
+}
+
+bool ui_com::ConnectionLost()
+{
+    return connection_lost;
+}
+
+void ui_com::AddSendData(const SendData *obj)
+{
+    send_mutex->GetMutex();
+
+    resume_time.push_back(GetTime()+(Time)obj->SendPeriod()*1000000);
+
+    //on resume en meme temps tout ceux qui ont la meme periode
+    for(size_t i=0;i<data_to_send.size();i++)
+    {
+        if(data_to_send.at(i)->SendPeriod()==obj->SendPeriod())
+        {
+            resume_time.at(resume_time.size()-1)=resume_time.at(i);
+            break;
+        }
+    }
+
+    data_to_send.push_back(obj);
+
+    send_mutex->ReleaseMutex();
+}
+
+void ui_com::UpdateSendData(const SendData *obj)
+{
+    //le mutex est deja pris par l'appellant
+    size_t id,i;
+
+    //on recupere l'id
+    for(i=0;i<data_to_send.size();i++)
+    {
+        if(data_to_send.at(i)==obj)
+        {
+            id=i;
+            break;
+        }
+    }
+
+    //on resume en meme temps tout ceux qui ont la meme periode
+    for(i=0;i<data_to_send.size();i++)
+    {
+        if(i==id) continue;
+        if(data_to_send.at(i)->IsEnabled()==true && data_to_send.at(i)->SendPeriod()==obj->SendPeriod())
+        {
+            resume_time.at(id)=resume_time.at(i);
+            break;
+        }
+    }
+
+    //si aucun match, on planifie l'execution
+    if(i==data_to_send.size()) resume_time.at(id)=GetTime()+(Time)obj->SendPeriod()*1000000;
+
+    if(IsSuspended()==true) Resume();
+
+    return;
+}
+
+void ui_com::UpdateDataToSendSize(void)
+{
+    send_mutex->GetMutex();
+    send_size=3;//id(1)+period(2)
+    for(size_t i=0;i<data_to_send.size();i++)
+    {
+        if(data_to_send[i]!=NULL) send_size+=data_to_send[i]->SendSize();
+    }
+
+    //send_buffer=(char*)realloc((void*)send_buffer,send_size*sizeof(char));
+    if(send_buffer!=NULL) free(send_buffer);
+    send_buffer=(char*)malloc(send_size*sizeof(char));
+    send_mutex->ReleaseMutex();
+}
+
+void ui_com::RemoveSendData(const SendData *obj)
+{
+    //printf("remove_data_to_send %i\n",data_to_send.size());
+
+    send_mutex->GetMutex();
+    //on recupere l'id
+    for(size_t i=0;i<data_to_send.size();i++)
+    {
+        if(data_to_send.at(i)==obj)
+        {
+            data_to_send.erase (data_to_send.begin()+i);
+            resume_time.erase (resume_time.begin()+i);
+            //printf("remove_data_to_send %i ok\n",data_to_send.size());
+            break;
+        }
+    }
+    send_mutex->ReleaseMutex();
+
+    return;
+}
+
+void ui_com::Block(void)
+{
+    send_mutex->GetMutex();
+}
+
+void ui_com::UnBlock(void)
+{
+    send_mutex->ReleaseMutex();
+}
Index: /trunk/lib/FlairCore/src/unexported/ConditionVariable_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/ConditionVariable_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/ConditionVariable_impl.h	(revision 2)
@@ -0,0 +1,53 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file ConditionVariable_impl.h
+ * \brief Class defining a condition variable
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/07
+ * \version 4.0
+ */
+
+#ifndef CONDITIONVARIABLE_IMPL_H
+#define CONDITIONVARIABLE_IMPL_H
+
+#include "Object.h"
+#ifdef __XENO__
+#include <native/cond.h>
+#include <native/timer.h>
+#else
+#include <pthread.h>
+#endif
+
+namespace flair {
+    namespace core {
+        class ConditionVariable;
+    }
+}
+
+/*! \class ConditionVariable_impl
+* \brief Class defining a condition variable
+*
+*/
+class ConditionVariable_impl
+{
+
+    public:
+        ConditionVariable_impl(flair::core::ConditionVariable* self);
+        ~ConditionVariable_impl();
+        void CondWait(void);
+        bool CondWaitUntil(flair::core::Time date);
+        void CondSignal(void);
+
+    private:
+        flair::core::ConditionVariable* self;
+#ifdef __XENO__
+        RT_COND m_ResumeCond;
+#else
+        pthread_cond_t m_ResumeCond;
+#endif
+};
+
+#endif // CONDITIONVARIABLE_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/DataPlot_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/DataPlot_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/DataPlot_impl.h	(revision 2)
@@ -0,0 +1,39 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file DataPlot_impl.h
+ * \brief Classe de base pour les gprahes
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/10
+ * \version 4.0
+ */
+
+#ifndef DATAPLOT_IMPL_H
+#define DATAPLOT_IMPL_H
+
+#include <vector>
+
+namespace flair
+{
+    namespace core
+    {
+        class IODataElement;
+    }
+}
+
+/*! \class DataPlot_impl
+* \brief Classe de base pour les graphes
+*
+*/
+class DataPlot_impl
+{
+    public:
+        DataPlot_impl();
+        ~DataPlot_impl();
+
+        std::vector<const flair::core::IODataElement*> tosend;
+};
+
+#endif // DATAPLOT_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/FrameworkManager_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/FrameworkManager_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/FrameworkManager_impl.h	(revision 2)
@@ -0,0 +1,141 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file FrameworkManager.h
+ * \brief Classe de base de la librairie
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/08/31
+ * \version 4.0
+ */
+
+#ifndef FRAMEWORKMANAGER_IMPL_H
+#define FRAMEWORKMANAGER_IMPL_H
+
+#include "Thread.h"
+#include "ui_com.h"
+#include <io_hdfile.h>
+#include <libxml/xpath.h>
+
+#ifdef __XENO__
+#include <native/pipe.h>
+#include <native/heap.h>
+#endif
+
+namespace flair
+{
+    namespace core
+    {
+        class FrameworkManager;
+        class IODevice;
+        class Watchdog;
+    }
+    namespace gui
+    {
+        class TabWidget;
+        class PushButton;
+        class Layout;
+    }
+}
+
+class ui_com;
+
+class FrameworkManager_impl: public flair::core::Thread
+{
+    public:
+        FrameworkManager_impl(flair::core::FrameworkManager *self,std::string name);
+        ~FrameworkManager_impl();
+        void SetupConnection(std::string address,uint16_t port,size_t rcv_buf_size=10000);
+        void SetupUserInterface(std::string xml_file);
+        void SetupLogger(std::string log_path);
+        void AddDeviceToLog(flair::core::IODevice *device);
+        void StartLog();
+        void StopLog();
+        char* GetBuffer(size_t sz);
+        void ReleaseBuffer(char* buf);
+        void WriteLog(const char* buf,size_t size);
+
+        /*!
+        * \brief Affiche le xml
+        *
+        * Pour debug.
+        */
+        void PrintXml(void) const;
+
+        bool is_logging;
+        bool disable_errors;
+        bool connection_lost;
+        static ui_com *com;
+        static FrameworkManager_impl *_this;
+        std::string log_path;
+
+        flair::gui::TabWidget* tabwidget;
+        flair::gui::PushButton *save_button;//,*load_button;
+
+        xmlDocPtr file_doc;
+
+        typedef struct {
+            const flair::core::IODevice* device;
+            size_t size;
+            flair::core::Time time;
+        } log_header_t;
+
+    private:
+        flair::core::FrameworkManager *self;
+        UDTSOCKET file_sock,com_sock;
+        UDTSOCKET GetSocket(std::string address,uint16_t port);
+        void Run();
+        void SendFile(std::string path,std::string name);
+        void FinishSending(void);
+        std::string FileName(flair::core::IODevice* device);
+        void SaveXmlChange(char* buf);
+        void SaveXml(void);
+        size_t rcv_buf_size;
+        char *rcv_buf;
+#ifdef __XENO__
+        int CreatePipe(RT_PIPE* fd,std::string name);
+        int DeletePipe(RT_PIPE* fd);
+        RT_PIPE cmd_pipe;
+        RT_PIPE data_pipe;
+        RT_HEAP log_heap;
+#else
+        int CreatePipe(int (*fd)[2],std::string name);
+        int DeletePipe(int (*fd)[2]);
+        int cmd_pipe[2];
+        int data_pipe[2];
+#endif
+        //logger
+        bool continuer;//a enlever, avoir un seul bool pour toutes les taches
+        static void* write_log_user(void * arg);
+        pthread_t log_th;
+        std::string xml_file;
+        bool logger_defined;
+        bool ui_defined;
+        flair::gui::Layout* top_layout;
+
+        typedef struct {
+            flair::core::IODevice* device;
+            size_t size;
+            hdfile_t *dbtFile;
+            bool running;
+        } log_desc_t;
+
+        std::vector<log_desc_t> logs;
+        std::vector<std::string> xml_changes;
+        flair::core::Watchdog* gcs_watchdog;
+        void ConnectionLost(void);
+};
+
+namespace
+{
+    inline ui_com* getUiCom(void) {
+        return FrameworkManager_impl::com;
+    }
+
+    inline  FrameworkManager_impl* getFrameworkManagerImpl(void) {
+        return FrameworkManager_impl::_this;
+    }
+}
+
+#endif // FRAMEWORKMANAGER_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/IODevice_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/IODevice_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/IODevice_impl.h	(revision 2)
@@ -0,0 +1,65 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file IODevice_impl.h
+ * \brief Classe de base pour un système à entrées/sorties
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2011/05/01
+ * \version 4.0
+ */
+
+#ifndef IO_DEVICE_IMPL_H
+#define IO_DEVICE_IMPL_H
+
+#include <string>
+#include <Object.h>
+
+namespace flair
+{
+    namespace core
+    {
+        class io_data;
+        class IODevice;
+        class Thread;
+        class Mutex;
+        class FrameworkManager;
+        class SharedMem;
+    }
+}
+
+class FrameworkManager_impl;
+
+class IODevice_impl
+{
+    public:
+        IODevice_impl(const flair::core::IODevice* self);
+        ~IODevice_impl();
+        void ResumeThread(void);
+        size_t LogSize(void) const;
+        void AppendLog(char** ptr);
+        void AddDataToLog(const flair::core::io_data* data);
+        void WriteLogsDescriptors(std::fstream& desc_file,int *index);
+        int SetToWake(const flair::core::Thread* thread);
+        void WriteLog(flair::core::Time time);
+        void AddDeviceToLog(const flair::core::IODevice* device);
+        bool SetToBeLogged(void);//return true if possible
+        void OutputToShMem(bool enabled);
+        void WriteToShMem(void);
+        void PrintLogsDescriptors(void);
+
+    private:
+        std::vector<const flair::core::IODevice*> devicesToLog;
+        const flair::core::IODevice* self;
+        const flair::core::FrameworkManager* framework;
+        FrameworkManager_impl* framework_impl;
+        std::vector<const flair::core::io_data*> datasToLog;
+        flair::core::Thread* thread_to_wake;
+        flair::core::Mutex* wake_mutex;
+        bool tobelogged;
+        bool outputtoshm;
+        flair::core::SharedMem *shmem;
+};
+
+#endif // IO_DEVICE_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/Mutex_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/Mutex_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/Mutex_impl.h	(revision 2)
@@ -0,0 +1,50 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Mutex_impl.h
+ * \brief Class defining a mutex
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/14
+ * \version 4.0
+ */
+
+#ifndef MUTEX_IMPL_H
+#define MUTEX_IMPL_H
+
+#ifdef __XENO__
+#include <native/mutex.h>
+#else
+#include <pthread.h>
+#endif
+
+namespace flair
+{
+    namespace core
+    {
+        class Mutex;
+    }
+}
+
+class Mutex_impl
+{
+    public:
+        Mutex_impl(flair::core::Mutex *self);
+        ~Mutex_impl();
+        void GetMutex(void);
+        void ReleaseMutex(void);
+//        bool IsLocked(void);
+#ifdef __XENO__
+        RT_MUTEX mutex;
+#else
+        pthread_mutex_t mutex;
+        //bool flag_locked;
+#endif
+
+    private:
+        flair::core::Mutex *self;
+
+};
+
+#endif // MUTEX_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/Object_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/Object_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/Object_impl.h	(revision 2)
@@ -0,0 +1,39 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/05/07
+//  filename:   Object.cpp
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe pour object_impl
+//
+//
+/*********************************************************************/
+
+#ifndef OBJECT_IMPL_H
+#define OBJECT_IMPL_H
+
+class Object_impl
+{
+    public:
+        Object_impl(const flair::core::Object* self,const flair::core::Object* parent=NULL,std::string name="",std::string type="");
+        ~Object_impl();
+        std::string name,type;
+        std::vector<const flair::core::Object*> childs;
+        std::vector<const flair::core::Object*> type_childs;
+        void AddChild(const flair::core::Object* child);
+        void RemoveChild(const flair::core::Object* child);
+        bool ErrorOccured(bool recursive);
+        bool error_occured;
+        const flair::core::Object* parent;
+
+    private:
+        const flair::core::Object* self;
+};
+
+#endif // OBJECT_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/OneAxisRotation_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/OneAxisRotation_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/OneAxisRotation_impl.h	(revision 2)
@@ -0,0 +1,52 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file OneAxisRotation_impl.h
+ * \brief Classe définissant une rotation autour d'un axe
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/04/17
+ * \version 4.0
+ */
+
+#ifndef ONEAXISROTATION_IMPL_H
+#define ONEAXISROTATION_IMPL_H
+
+namespace flair
+{
+    namespace core
+    {
+        class Vector3D;
+        class Euler;
+        class Quaternion;
+        class RotationMatrix;
+    }
+    namespace gui
+    {
+        class GroupBox;
+        class ComboBox;
+        class DoubleSpinBox;
+    }
+}
+
+/*! \class OneAxisRotation_impl
+* \brief Classe définissant une rotation autour d'un axe
+*
+*/
+class OneAxisRotation_impl
+{
+    public:
+        OneAxisRotation_impl(flair::gui::GroupBox* box);
+        ~OneAxisRotation_impl();
+        void ComputeRotation(flair::core::Vector3D& point) const;
+        void ComputeRotation(flair::core::Quaternion& quat) const;
+        void ComputeRotation(flair::core::RotationMatrix& matrix) const;
+        void ComputeRotation(flair::core::Euler& euler) const;
+
+    private:
+        flair::gui::ComboBox *rot_axe;
+        flair::gui::DoubleSpinBox* rot_value;
+};
+
+#endif // ONEAXISROTATION_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/SendData_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/SendData_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/SendData_impl.h	(revision 2)
@@ -0,0 +1,35 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SendData_impl.h
+ * \brief Base class for sending datas to ground station
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/07
+ * \version 4.0
+ */
+
+#ifndef SENDDATA_IMPL_H
+#define SENDDATA_IMPL_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+class SendData_impl;
+
+/*! \class SendData_impl
+* \brief Base class for sending datas to ground station
+*
+*/
+class SendData_impl
+{
+    public:
+		SendData_impl();
+		~SendData_impl();
+        bool is_enabled;
+        size_t send_size;
+        uint16_t send_period;
+};
+
+#endif // SENDDATA_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/SharedMem_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/SharedMem_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/SharedMem_impl.h	(revision 2)
@@ -0,0 +1,63 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file SharedMem_impl.h
+ * \brief Class defining a shared memory
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2014/02/10
+ * \version 4.0
+ */
+
+#ifndef SHAREDMEM_IMPL_H
+#define SHAREDMEM_IMPL_H
+
+#include <string>
+
+#ifdef __XENO__
+#include <native/heap.h>
+#include <native/mutex.h>
+#else
+#include <semaphore.h>
+#endif
+
+namespace flair
+{
+    namespace core
+    {
+        class SharedMem;
+    }
+}
+
+/*! \class SharedMem_impl
+* \brief Class defining a shared memory
+*
+*/
+
+class SharedMem_impl
+{
+    public:
+        SharedMem_impl(const flair::core::SharedMem* self,std::string name,size_t size);
+        ~SharedMem_impl();
+
+        void Write(const char* buf,size_t size);
+        void Read(char* buf,size_t size);
+
+    private:
+        const flair::core::SharedMem* self;
+        size_t size;
+        char *mem_segment;
+#ifdef __XENO__
+        RT_HEAP heap;
+        RT_MUTEX mutex;
+        bool heap_binded;
+        bool mutex_binded;
+#else
+        int fd;
+        sem_t *sem;
+        std::string sem_name,shm_name;
+#endif
+};
+
+#endif // SHAREDMEM_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/Socket_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/Socket_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/Socket_impl.h	(revision 2)
@@ -0,0 +1,58 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Socket_impl.h
+ * \brief Classe creant une socket
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2013/11/17
+ * \version 4.0
+ */
+
+#ifndef SOCKET_IMPL_H
+#define SOCKET_IMPL_H
+
+#include <sys/socket.h>
+#include <netdb.h>
+#include <Object.h>
+#ifdef __XENO__
+#include <native/pipe.h>
+#endif
+
+namespace flair
+{
+    namespace core
+    {
+        class Socket;
+    }
+}
+
+class Socket_impl
+{
+    public:
+        Socket_impl(const flair::core::Socket* self, std::string name,std::string address,bool broadcast=false);
+        Socket_impl(const flair::core::Socket* self, std::string name,uint16_t port);
+        ~Socket_impl();
+
+        void SendMessage(std::string message);
+        void SendMessage(const char* src,size_t src_len);
+        ssize_t RecvMessage(char* msg,size_t msg_len,flair::core::Time timeout,char* src=NULL,size_t* src_len=NULL);
+
+    private:
+        int fd;
+        uint16_t port;
+        std::string address;
+        bool broadcast;
+        void Init(void);
+        const flair::core::Socket* self;
+        struct sockaddr_in sock_in;
+#ifdef __XENO__
+        bool is_running;
+        static void* user(void * arg);
+        pthread_t user_thread;
+        RT_PIPE pipe;
+#endif
+};
+
+#endif // SOCKET_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/Thread_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/Thread_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/Thread_impl.h	(revision 2)
@@ -0,0 +1,77 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Thread_impl.h
+ * \brief Classe définissant un thread
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/10/04
+ * \version 4.0
+ */
+#ifndef THREAD_IMPL_H
+#define THREAD_IMPL_H
+
+#include <string>
+#include <stdint.h>
+#include <Object.h>
+#ifdef __XENO__
+#include <native/task.h>
+#else
+#include <pthread.h>
+#endif
+
+namespace flair
+{
+    namespace core
+    {
+        class Thread;
+        class IODevice;
+        class ConditionVariable;
+    }
+}
+
+class Thread_impl
+{
+    public:
+        Thread_impl(flair::core::Thread* self,uint8_t priority);
+        ~Thread_impl();
+        void Start(void);
+        void Join(void);
+        void SafeStop(void);
+        bool ToBeStopped(void);
+        void SetPeriodUS(uint32_t period);
+        uint32_t GetPeriodUS(void) const;
+        void SetPeriodMS(uint32_t period);
+        uint32_t GetPeriodMS(void) const;
+        void WaitPeriod(void);
+        void Suspend(void);
+        bool SuspendUntil (flair::core::Time date);
+        void Resume(void);
+        bool IsSuspended(void);
+        int WaitUpdate(const flair::core::IODevice* device);
+        bool period_set;
+
+    private:
+        flair::core::Thread* self;
+        flair::core::ConditionVariable* cond;
+        uint8_t priority;
+        flair::core::Time max_jitter,min_jitter,mean_jitter;
+        flair::core::Time last;
+        uint64_t cpt;
+        flair::core::Time period;
+        bool isRunning;
+        bool tobestopped;
+        bool is_suspended;
+        void PrintStats(void);
+        void ComputeJitter(flair::core::Time time);
+#ifdef __XENO__
+        RT_TASK task_rt;
+        static void main_rt(void * arg);
+#else
+        pthread_t task_nrt;
+        static void* main_nrt(void * arg);
+        flair::core::Time next_time;
+#endif
+};
+#endif // THREAD_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/Widget_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/Widget_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/Widget_impl.h	(revision 2)
@@ -0,0 +1,115 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file Widget_impl.h
+ * \brief Classe representant un Widget
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/05/02
+ * \version 4.0
+ */
+
+#ifndef WIDGET_IMPL_H
+#define WIDGET_IMPL_H
+
+#include <libxml/xpath.h>
+#include <io_data.h>
+
+namespace flair
+{
+    namespace gui
+    {
+        class Widget;
+    }
+}
+
+/*! \class Widget_impl
+* \brief Classe representant un Widget
+*
+*  C'est une classe de base. Tout comme l'Object elle permet de gérer les liens de parenté
+*  et de détruire automatiquement les enfants. Elle permet en plus de gérer une communication
+*  avec la station sol, et donc d'y afficher un QWidget. \n
+*  La comunication avec la station sol se fait par l'échange de fichiers xml. Les propriétés xml du Widget sont
+*  modifiables par les fonctions appropriées. \n
+*  Un fichier xml de réglages par défaut du Widget est utilisé s'il a été spécifié à la construction du FrameworkManager.
+*/
+class Widget_impl
+{
+    friend class flair::core::FrameworkManager;
+    friend class FrameworkManager_impl;
+
+    public:
+        /*!
+        * \brief Constructeur
+        *
+        * Construit un Widget, qui est automatiquement enfant du parent. Le fichier xml
+        * spécifié au constructeur du FrameworkManager est utilisé pour les réglages par
+        * défaut. \n
+        * Sauf pour le FrameworkManager, ce constructeur doit être apellé depuis une tache temps réel
+        * lorsque l'on utilise la librairie framework_rt.
+        *
+        * \param parent parent
+        * \param name nom
+        * \param type type
+        */
+        Widget_impl(flair::gui::Widget* self,const flair::gui::Widget* parent,std::string name,std::string type);
+
+        /*!
+        * \brief Déstructeur
+        *
+        * Détruit automatiquement les enfants.
+        * La destruction implique la destruction du QWidget associé sur la station sol.\n
+        * Sauf pour le FrameworkManager, ce déstructeur doit être apellé depuis une tache temps réel
+        * lorsque l'on utilise la librairie framework_rt.
+        *
+        */
+        ~Widget_impl();
+
+        /*!
+        * \brief Activer
+        *
+        * Active le QWidget associé sur la station sol. \n
+        * Un QWdiget désactivé apparait grisé et n'est pas modifiable.
+        *
+        * \param status
+        */
+        void setEnabled(bool status);
+
+        /*!
+        * \brief Envoi le xml
+        *
+        * Envoi le xml à la station sol pour prendre en compte les changements.
+        */
+        void SendXml(void);
+
+        xmlNodePtr file_node;
+        xmlNodePtr send_node;
+        bool isenabled;
+
+     private:
+        flair::gui::Widget* self;
+
+        std::vector<flair::gui::Widget*> childs;
+
+        void AddChild(const flair::gui::Widget* child);
+        void RemoveChild(const flair::gui::Widget* child);
+
+         /*!
+        * \brief Efface les proriétés xml
+        *
+        *  Permet d'effacer toutes les propriétés XML fixées par SetVolatileXmlProp.
+        *  A utliser lorsque l'on a plus besoin d'utiliser ces propriétés. Utile
+        * pour réduire la taille des fichiers XML écangés avec la station sol.
+        */
+        void ClearXmlProps(void);
+
+        //xml
+        void ProcessXML(xmlNode *node);
+        xmlDocPtr CopyDoc(void);
+        static xmlNodePtr GetNodeByProp(xmlNodePtr doc,xmlChar *type,xmlChar *prop,xmlChar *value);
+        void printSendNode();
+        xmlDocPtr send_doc;
+};
+
+#endif // WIDGET_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/communication.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/communication.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/communication.h	(revision 2)
@@ -0,0 +1,22 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+#ifndef COMMUNICATION_H
+#define COMMUNICATION_H
+
+
+//messages file socket
+#define FILE_INFO_LITTLE_ENDIAN 0x01
+#define FILE_INFO_BIG_ENDIAN 0x02
+#define END 0x03
+
+#define XML_HEADER 0x3c
+#define ZLIB_HEADER 0x78
+#define WATCHDOG_HEADER 0x01
+
+#define DATAS_LITTLE_ENDIAN 0xfd
+#define DATAS_BIG_ENDIAN 0xfe
+
+
+#endif // COMMUNICATION_H
Index: /trunk/lib/FlairCore/src/unexported/config.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/config.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/config.h	(revision 2)
@@ -0,0 +1,72 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2013/04/21
+//  filename:   config.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    configuration du framework
+//
+//
+/*********************************************************************/
+
+#ifndef CONFIG_H
+#define CONFIG_H
+
+//stack size of nrt threads, comment it to use default value
+#define NRT_STACK_SIZE 1024*1024*1
+
+//stack size of rt threads, comment it to use default value
+#define RT_STACK_SIZE 1024*100
+
+//rt pipe size, comment it to use system heap
+#define RT_PIPE_SIZE 1024*1024
+
+//nrt pipe size
+#define NRT_PIPE_SIZE 1024*100
+
+//rt log heap size
+#define LOG_HEAP 1024*100
+
+//xml heap size
+#define XML_HEAP 5*1024*1024
+
+//nrt pipe path
+#define NRT_PIPE_PATH "/proc/xenomai/registry/native/pipes/"
+
+//min priority for Threads
+#define MIN_THREAD_PRIORITY 20
+
+//max priority for Threads
+#define MAX_THREAD_PRIORITY 99
+
+//priority of the FrameworkManager task (manages udt connection)
+#define FRAMEWORK_TASK_PRIORITY 1
+
+//timeout in ms for select
+#define SELECT_TIMEOUT_MS 200
+
+//type of xml root element
+#define XML_ROOT_TYPE "root"
+
+//name of xml root element
+//#define XML_ROOT_ELEMENT "Manager"
+
+//name of main tabwidget
+#define XML_MAIN_TABWIDGET "Main_TabWidget"
+
+//name of app tabwidget
+#define XML_APP_TABWIDGET "App_TabWidget"
+
+//use compression for messages with ground station
+#define COMPRESS_FRAMES
+
+//size of buffer shunck
+#define COMPRESS_CHUNK 1024
+
+#endif // CONFIG_H
Index: /trunk/lib/FlairCore/src/unexported/cvmatrix_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/cvmatrix_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/cvmatrix_impl.h	(revision 2)
@@ -0,0 +1,43 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file cvmatrix_impl.h
+ * \brief Classe définissant une matrice opencv
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/21
+ * \version 4.0
+ */
+
+#ifndef CVMATRIX_IMPL_H
+#define CVMATRIX_IMPL_H
+
+
+#include <io_data.h>
+#include <cvmatrix.h>
+
+struct CvMat;
+
+/*! \class cvmatrix_impl
+* \brief Classe définissant une matrice opencv
+*
+*/
+class cvmatrix_impl
+{
+    public:
+        cvmatrix_impl(flair::core::cvmatrix* self,int rows,int cols,flair::core::ScalarType const &elementDataType,int n);
+        cvmatrix_impl(flair::core::cvmatrix* self,const flair::core::cvmatrix_descriptor *descriptor, flair::core::ScalarType const &elementDataType,int n);
+        ~cvmatrix_impl();
+
+        CvMat* mat;
+        flair::core::ScalarType const &elementDataType;
+	// const since if element description is modified it would be a mess in the log
+        const flair::core::cvmatrix_descriptor *descriptor;
+
+    private:
+        flair::core::cvmatrix* self;
+        void Init(flair::core::cvmatrix* self,int n);
+};
+
+#endif // CVMATRIX_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/io_data_impl.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/io_data_impl.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/io_data_impl.h	(revision 2)
@@ -0,0 +1,48 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+/*!
+ * \file io_data_impl.h
+ * \brief Abstract class for data types.
+ * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
+ * \date 2012/03/21
+ * \version 4.0
+ */
+
+#ifndef IO_DATA_IMPL_H
+#define IO_DATA_IMPL_H
+
+#include "io_data.h"
+
+/*! \class io_data_impl
+* \brief Abstract class for data types.
+*
+* Use this class to define a custom data type. Data types ares used for logging and graphs. \n
+* The reimplemented class must call SetSize() in its constructor. \n
+* io_data can be constructed with n samples (see io_data::io_data).
+* In this case, old samples can be accessed throug io_data::Prev.
+*/
+class io_data_impl
+{
+    public:
+		io_data_impl(flair::core::io_data* self,int n);
+		~io_data_impl();
+		void Circle(void);
+		bool IsConsistent(void);
+		void SetConsistent(bool status);
+		void WriteLogDescriptor(std::fstream& desc_file,int *index);
+		void PrintLogDescriptor(void);
+        void AppendLogDescription(std::string description,flair::core::DataType const &datatype);
+        size_t size;
+        flair::core::Time time;
+        void** circle_ptr;
+
+    private:
+        flair::core::io_data* self;
+        int n;
+        bool is_consistent;
+        std::vector<std::string> descriptors;
+};
+
+#endif // IO_DATA_IMPL_H
Index: /trunk/lib/FlairCore/src/unexported/ui_com.h
===================================================================
--- /trunk/lib/FlairCore/src/unexported/ui_com.h	(revision 2)
+++ /trunk/lib/FlairCore/src/unexported/ui_com.h	(revision 2)
@@ -0,0 +1,76 @@
+// %flair:license{
+// This file is part of the Flair framework distributed under the
+// CECILL-C License, Version 1.0.
+// %flair:license}
+//  created:    2011/05/01
+//  filename:   ui_com.h
+//
+//  author:     Guillaume Sanahuja
+//              Copyright Heudiasyc UMR UTC/CNRS 7253
+//
+//  version:    $Id: $
+//
+//  purpose:    classe permettant la lecture et l'ecriture RT sur socket UDT
+//
+//
+/*********************************************************************/
+
+#ifndef UI_COM_H
+#define UI_COM_H
+
+#include "Thread.h"
+#include <udt.h>
+#ifdef __XENO__
+#include <native/pipe.h>
+#endif
+
+namespace flair
+{
+    namespace core
+    {
+        class Mutex;
+        class Object;
+    }
+    namespace gui
+    {
+        class SendData;
+    }
+}
+
+class ui_com: public flair::core::Thread
+{
+    public:
+        ui_com(const flair::core::Object *parent,UDTSOCKET sock);
+        ~ui_com();
+        void Send(char* buf,ssize_t size);
+        ssize_t Receive(char* buf,ssize_t buf_size);
+        void AddSendData(const flair::gui::SendData *obj);
+        void UpdateSendData(const flair::gui::SendData *obj);
+        void RemoveSendData(const flair::gui::SendData *obj);
+        void UpdateDataToSendSize(void);
+        void Block(void);
+        void UnBlock(void);
+        bool ConnectionLost(void);
+
+    private:
+        ssize_t send_size;
+        char *send_buffer;
+        std::vector<const flair::gui::SendData*> data_to_send;
+        std::vector<flair::core::Time> resume_time;
+        flair::core::Mutex *send_mutex;
+        UDTSOCKET socket_fd;
+        bool connection_lost;
+        void Run(void);
+        void SendDatas(void);
+        static int compressBuffer(char *in, ssize_t in_size,char **out,ssize_t *out_size, int level);
+        static int uncompressBuffer(unsigned char *in, ssize_t in_size,unsigned char **out,ssize_t *out_size);
+#ifdef __XENO__
+        bool is_running;
+        static void* user_thread(void * arg);
+        pthread_t thread;
+        RT_PIPE pipe;
+#endif
+
+};
+
+#endif // UI_COM_H
