[Jderobot-admin] jderobot-r867 - in trunk/src/components: . gazeboserver kinectServer teleoperatorPC visualHFSM-3.1 visualHFSM-3.1/datos_esquemas visualHFSM-3.1/datos_esquemas/my_component visualHFSM-3.1/datos_esquemas/my_component/build visualHFSM-3.1/ejemplos visualHFSM-3.1/ejemplos/src visualHFSM-3.1/gui visualHFSM-3.1/imagenes visualHFSM-3.1/recta

bmenendez en jderobot.org bmenendez en jderobot.org
Jue Feb 28 23:44:53 CET 2013


Author: bmenendez
Date: 2013-02-28 23:43:53 +0100 (Thu, 28 Feb 2013)
New Revision: 867

Added:
   trunk/src/components/visualHFSM-3.1/
   trunk/src/components/visualHFSM-3.1/Color.cpp
   trunk/src/components/visualHFSM-3.1/Color.h
   trunk/src/components/visualHFSM-3.1/Makefile
   trunk/src/components/visualHFSM-3.1/camera.cpp
   trunk/src/components/visualHFSM-3.1/camera.h
   trunk/src/components/visualHFSM-3.1/datos_esquemas/
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/CMakeLists.txt
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/Ogre.log
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/CMakeLists.txt
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/clean.sh
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/cmake_uninstall.cmake.in
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/camera.cpp
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/camera.h
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasLaser.cpp
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasLaser.h
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateCameras.cpp
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateCameras.h
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateControl.cpp
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateControl.h
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvas_main.cpp
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvas_main.h
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/control_class.cpp
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/control_class.h
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/gui.cpp
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/gui.h
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/mycomponent
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/mycomponent.cfg
   trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/mycomponent.glade
   trunk/src/components/visualHFSM-3.1/ejemplo.cpp
   trunk/src/components/visualHFSM-3.1/ejemplos/
   trunk/src/components/visualHFSM-3.1/ejemplos/ej_dummy.xml
   trunk/src/components/visualHFSM-3.1/ejemplos/src/
   trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile
   trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile-mycomponent
   trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile.am
   trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile.in
   trunk/src/components/visualHFSM-3.1/ejemplos/src/Ogre.log
   trunk/src/components/visualHFSM-3.1/ejemplos/src/camera.cpp
   trunk/src/components/visualHFSM-3.1/ejemplos/src/camera.h
   trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasLaser.cpp
   trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasLaser.h
   trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateCameras.cpp
   trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateCameras.h
   trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateControl.cpp
   trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateControl.h
   trunk/src/components/visualHFSM-3.1/ejemplos/src/canvas_main.cpp
   trunk/src/components/visualHFSM-3.1/ejemplos/src/canvas_main.h
   trunk/src/components/visualHFSM-3.1/ejemplos/src/control_class.cpp
   trunk/src/components/visualHFSM-3.1/ejemplos/src/control_class.h
   trunk/src/components/visualHFSM-3.1/ejemplos/src/gui.cpp
   trunk/src/components/visualHFSM-3.1/ejemplos/src/gui.h
   trunk/src/components/visualHFSM-3.1/ejemplos/src/mycomponent
   trunk/src/components/visualHFSM-3.1/ejemplos/src/mycomponent.cfg
   trunk/src/components/visualHFSM-3.1/ejemplos/src/mycomponent.glade
   trunk/src/components/visualHFSM-3.1/errores.txt
   trunk/src/components/visualHFSM-3.1/generate
   trunk/src/components/visualHFSM-3.1/generate.cpp
   trunk/src/components/visualHFSM-3.1/generate_old.cpp
   trunk/src/components/visualHFSM-3.1/gui/
   trunk/src/components/visualHFSM-3.1/gui/EdicionNodo.glade
   trunk/src/components/visualHFSM-3.1/gui/EdicionTransicion.glade
   trunk/src/components/visualHFSM-3.1/gui/EdicionTransicion2.glade
   trunk/src/components/visualHFSM-3.1/gui/Importar.glade
   trunk/src/components/visualHFSM-3.1/gui/nombre.glade
   trunk/src/components/visualHFSM-3.1/gui/timer.glade
   trunk/src/components/visualHFSM-3.1/gui/variables.glade
   trunk/src/components/visualHFSM-3.1/gui/ventana.glade
   trunk/src/components/visualHFSM-3.1/imagenes/
   trunk/src/components/visualHFSM-3.1/imagenes/compilar.jpg
   trunk/src/components/visualHFSM-3.1/imagenes/images.jpg
   trunk/src/components/visualHFSM-3.1/imprimir.cpp
   trunk/src/components/visualHFSM-3.1/imprimir.h
   trunk/src/components/visualHFSM-3.1/int2string.cpp
   trunk/src/components/visualHFSM-3.1/int2string.h
   trunk/src/components/visualHFSM-3.1/interfaz.cpp
   trunk/src/components/visualHFSM-3.1/interfaz.h
   trunk/src/components/visualHFSM-3.1/nodo.cpp
   trunk/src/components/visualHFSM-3.1/nodo.h
   trunk/src/components/visualHFSM-3.1/prueba_navegacion.xml
   trunk/src/components/visualHFSM-3.1/prueba_navegacion_full.xml
   trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml.xml
   trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml_2.xml
   trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml_varios.xml
   trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml_varios_save.xml
   trunk/src/components/visualHFSM-3.1/recta.c
   trunk/src/components/visualHFSM-3.1/recta.h
   trunk/src/components/visualHFSM-3.1/recta/
   trunk/src/components/visualHFSM-3.1/recta/recta.c
   trunk/src/components/visualHFSM-3.1/recta/recta.h
   trunk/src/components/visualHFSM-3.1/reemplazar.cpp
   trunk/src/components/visualHFSM-3.1/reemplazar.h
   trunk/src/components/visualHFSM-3.1/transicion.cpp
   trunk/src/components/visualHFSM-3.1/transicion.h
   trunk/src/components/visualHFSM-3.1/ventanas.cpp
   trunk/src/components/visualHFSM-3.1/ventanas.h
   trunk/src/components/visualHFSM-3.1/visualHFSM
   trunk/src/components/visualHFSM-3.1/xml.cpp
   trunk/src/components/visualHFSM-3.1/xml.h
Modified:
   trunk/src/components/gazeboserver/camera_dump.cc
   trunk/src/components/gazeboserver/encoders.h
   trunk/src/components/gazeboserver/laser.cc
   trunk/src/components/gazeboserver/motors.h
   trunk/src/components/gazeboserver/pioneer2dxJde.world
   trunk/src/components/gazeboserver/pose3dencoders.h
   trunk/src/components/kinectServer/kinectServer.cfg
   trunk/src/components/teleoperatorPC/teleoperatorPC.cfg
Log:
[bmenendez] A?\195?\177adido VisualHFSM-3.1. Se ir?\195?\161 mejorando poco a poco.


Modified: trunk/src/components/gazeboserver/camera_dump.cc
===================================================================
--- trunk/src/components/gazeboserver/camera_dump.cc	2013-02-28 14:22:00 UTC (rev 866)
+++ trunk/src/components/gazeboserver/camera_dump.cc	2013-02-28 22:43:53 UTC (rev 867)
@@ -1,7 +1,7 @@
 #include "gazebo.hh"
 #include "plugins/CameraPlugin.hh"
-#include "common/common.h"
-#include "transport/transport.h"
+#include "common/common.hh"
+#include "transport/transport.hh"
 
 #include <opencv2/core/core.hpp>
 #include <opencv2/imgproc/imgproc.hpp>

Modified: trunk/src/components/gazeboserver/encoders.h
===================================================================
--- trunk/src/components/gazeboserver/encoders.h	2013-02-28 14:22:00 UTC (rev 866)
+++ trunk/src/components/gazeboserver/encoders.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -1,8 +1,8 @@
 #include <boost/bind.hpp>
 #include "gazebo.hh"
-#include "physics/physics.h"
-#include "common/common.h"
-#include "transport/transport.h"
+#include "physics/physics.hh"
+#include "common/common.hh"
+#include "transport/transport.hh"
 
 
 // ICE utils includes
@@ -55,4 +55,4 @@
     
 }
 
-#endif	/* POSE_H */
\ No newline at end of file
+#endif	/* POSE_H */

Modified: trunk/src/components/gazeboserver/laser.cc
===================================================================
--- trunk/src/components/gazeboserver/laser.cc	2013-02-28 14:22:00 UTC (rev 866)
+++ trunk/src/components/gazeboserver/laser.cc	2013-02-28 22:43:53 UTC (rev 867)
@@ -1,9 +1,9 @@
 #include <boost/bind.hpp>
 #include "gazebo.hh"
-#include "physics/physics.h"
+#include "physics/physics.hh"
 #include "physics/MultiRayShape.hh"
-#include "common/common.h"
-#include "transport/transport.h"
+#include "common/common.hh"
+#include "transport/transport.hh"
 
 #include "plugins/RayPlugin.hh"
 

Modified: trunk/src/components/gazeboserver/motors.h
===================================================================
--- trunk/src/components/gazeboserver/motors.h	2013-02-28 14:22:00 UTC (rev 866)
+++ trunk/src/components/gazeboserver/motors.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -1,8 +1,8 @@
 #include <boost/bind.hpp>
 #include "gazebo.hh"
-#include "physics/physics.h"
-#include "common/common.h"
-#include "transport/transport.h"
+#include "physics/physics.hh"
+#include "common/common.hh"
+#include "transport/transport.hh"
 
 #include "plugins/RayPlugin.hh"
 

Modified: trunk/src/components/gazeboserver/pioneer2dxJde.world
===================================================================
--- trunk/src/components/gazeboserver/pioneer2dxJde.world	2013-02-28 14:22:00 UTC (rev 866)
+++ trunk/src/components/gazeboserver/pioneer2dxJde.world	2013-02-28 22:43:53 UTC (rev 867)
@@ -1,13 +1,20 @@
-<?xml version="1.0"?> 
-<gazebo version="1.0">
+<?xml version="1.0" ?>
+<sdf version="1.3">
   <world name="default">
     <!-- Ground -->
-    <include filename="ground_plane.model"/>
+    <include>
+      <uri>model://ground_plane</uri>
+    </include>
 
     <!-- Pioneer2dx model -->
-    <include filename="pioneer2dx.model"/>
+    <include>
+      <uri>model://pioneer2dxJde</uri>
+    </include>
 
     <!-- A global light source -->
-    <include filename="sun.light"/>
+    <include>
+      <uri>model://sun</uri>
+    </include>
+
   </world>
-</gazebo>
+</sdf>

Modified: trunk/src/components/gazeboserver/pose3dencoders.h
===================================================================
--- trunk/src/components/gazeboserver/pose3dencoders.h	2013-02-28 14:22:00 UTC (rev 866)
+++ trunk/src/components/gazeboserver/pose3dencoders.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -1,8 +1,8 @@
 #include <boost/bind.hpp>
 #include "gazebo.hh"
-#include "physics/physics.h"
-#include "common/common.h"
-#include "transport/transport.h"
+#include "physics/physics.hh"
+#include "common/common.hh"
+#include "transport/transport.hh"
 // ICE utils includes
 #include <Ice/Ice.h>
 #include <IceUtil/IceUtil.h>
@@ -84,4 +84,4 @@
 
 }
 
-#endif
\ No newline at end of file
+#endif

Modified: trunk/src/components/kinectServer/kinectServer.cfg
===================================================================
--- trunk/src/components/kinectServer/kinectServer.cfg	2013-02-28 14:22:00 UTC (rev 866)
+++ trunk/src/components/kinectServer/kinectServer.cfg	2013-02-28 22:43:53 UTC (rev 867)
@@ -1,6 +1,6 @@
 #without registry
 KinectServer.Endpoints=default -h localhost -p 9998
-KinectServer.CameraRGB=0
-KinectServer.CameraDepth=0
-KinectServer.CloudPoints=1
+KinectServer.CameraRGB=1
+KinectServer.CameraDepth=1
+KinectServer.CloudPoints=0
 KinectServer.LeafSize=17

Modified: trunk/src/components/teleoperatorPC/teleoperatorPC.cfg
===================================================================
--- trunk/src/components/teleoperatorPC/teleoperatorPC.cfg	2013-02-28 14:22:00 UTC (rev 866)
+++ trunk/src/components/teleoperatorPC/teleoperatorPC.cfg	2013-02-28 22:43:53 UTC (rev 867)
@@ -7,9 +7,3 @@
 introrob.Pose3DEncodersLeft.Proxy=Pose3DEncodersLeft:tcp -h localhost -p 9996
 introrob.Pose3DMotorsRight.Proxy=Pose3DMotorsRight:tcp -h localhost -p 9993
 introrob.Pose3DMotorsLeft.Proxy=Pose3DMotorsLeft:tcp -h localhost -p 9994
-
-
-
-
-
-

Added: trunk/src/components/visualHFSM-3.1/Color.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/Color.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/Color.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,45 @@
+#include "Color.h"
+#include <sstream>
+#include <string>
+
+
+Color::Color(unsigned char rojo, unsigned char verde, unsigned char azul){
+	R=rojo;
+	G=verde;
+	B=azul;
+}
+	
+unsigned char Color::getRojo()const{
+	return R;
+}
+unsigned char Color::getAzul()const{
+	return G;
+}
+
+unsigned char Color::getVerde()const{
+	return B;
+}
+
+void Color::convertirAGris(){
+	R=G=B=rgb2Gris();
+}
+
+Color Color::getGris()const{
+	unsigned char gris=rgb2Gris();
+	Color equivalenteGris(gris,gris,gris);
+	return equivalenteGris;
+}
+	
+bool Color::operator==(const Color& color)const{
+		return ((R==color.R)&&(G==color.G)&&(B==color.B));
+}
+
+unsigned char Color::rgb2Gris()const{
+	return (unsigned char)(R*0.3+G*0.59+B*0.11);
+}
+
+const char* Color::toString()const{
+	std::stringstream s;
+	s<<"R="<<(int)R<<" G="<<(int)G<<" B="<<(int)B;
+	return ((s.str()).c_str());
+}


Property changes on: trunk/src/components/visualHFSM-3.1/Color.cpp
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/Color.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/Color.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/Color.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,22 @@
+#ifndef COLOR_H_
+#define COLOR_H_
+
+class Color{
+public:
+	Color(unsigned char rojo, unsigned char verde, unsigned char azul);
+	
+	unsigned char getRojo()const;
+	unsigned char getAzul()const;
+	unsigned char getVerde()const;
+	
+	void convertirAGris();
+	Color getGris()const;
+	
+	bool operator==(const Color& color)const;
+	const char* toString()const;
+private:
+	unsigned char rgb2Gris()const;
+	unsigned char R,G,B;
+};
+
+#endif /*COLOR_H_*/


Property changes on: trunk/src/components/visualHFSM-3.1/Color.h
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/Makefile
===================================================================
--- trunk/src/components/visualHFSM-3.1/Makefile	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/Makefile	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,48 @@
+LIBS = -I/usr/include/gtk-2.0/gdk/ -I/usr/include/gtk-2.0/gtk/ -I/usr/include/gtk-2.0/gdk-pixbuf/ -I/usr/include/libgnomecanvas-2.0/libgnomecanvas/ -I/usr/include/libxml2/libxml/
+SRC = src
+LIB_DIR = `pkg-config --cflags --libs gtk+-2.0 libgnomecanvas-2.0 libglade-2.0 gtksourceview-2.0 gtk+-unix-print-2.0`
+GPP = g++
+CFLAGS = -g -Wall 
+SOURCES = int2string.o ./recta/recta.o nodo.o transicion.o ventanas.o xml.o imprimir.o
+
+#g++ -g -Wall -c transicion.cpp `pkg-config --cflags --libs gtk+-2.0 libgnomecanvas-2.0`
+#g++ -g -Wall interfaz.cpp -o interfaz ./src/recta/recta.o ./src/nodo.o ./src/transicion.o ./src/ventanas.o `pkg-config --cflags --libs gtk+-2.0 libgnomecanvas-2.0 libglade-2.0 gtksourceview-1.0`
+
+ALL: visualHFSM
+
+generate.o: generate.cpp reemplazar.o
+	$(GPP) $(CFLAGS) $(LIB_DIR) $(LIBS) generate.cpp -o generate reemplazar.o 
+	
+reemplazar.o: reemplazar.cpp
+	$(GPP) $(CFLAGS) $(LIB_DIR) $(LIBS) -c reemplazar.cpp -o reemplazar.o 
+
+visualHFSM: generate.o $(SOURCES) interfaz.o 
+	$(GPP) $(CFLAGS) $(LIB_DIR) $(LIBS) -o visualHFSM interfaz.o $(SOURCES)
+
+interfaz.o: interfaz.cpp
+	$(GPP) $(CFLAGS) -c interfaz.cpp  $(LIB_DIR)
+
+imprimir.o: imprimir.cpp imprimir.h
+	$(GPP) $(CFLAGS) $(LIB_DIR) -c imprimir.cpp 
+
+xml.o: xml.cpp xml.h transicion.o nodo.o
+	$(GPP) $(CFLAGS) $(LIB_DIR) -c xml.cpp 
+
+ventanas.o: ventanas.cpp transicion.o nodo.o
+	$(GPP) $(CFLAGS) $(LIB_DIR) -c ventanas.cpp
+
+nodo.o: nodo.cpp ./recta/recta.o
+	$(GPP) $(CFLAGS) $(LIB_DIR) -c nodo.cpp
+
+transicion.o: transicion.cpp ./recta/recta.o
+	$(GPP) $(CFLAGS) $(LIB_DIR) -c transicion.cpp
+
+./recta/recta.o: ./recta/recta.c ./recta/recta.h
+	$(GPP) $(CFLAGS) $(LIB_DIR) -c recta/recta.c -o ./recta/recta.o
+
+int2string.o: int2string.cpp int2string.h
+	$(GPP) $(CFLAGS) $(LIB_DIR) -c int2string.cpp 
+
+clean:
+	rm -f *.o *~ 
+ 

Added: trunk/src/components/visualHFSM-3.1/camera.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/camera.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/camera.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,378 @@
+/*  
+ * Copyright (C) 2008 Roberto Calvo Palomino
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *   
+ *   Authors : Roberto Calvo Palomino <rocapal en gsyc.escet.urjc.es>,
+ * 			   Jose María Cañas Plaza <jmplaza en gsyc.es>
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "camera.h"
+
+#define DEBUG(x...) printf(x)
+#define N_LINES_CAM 16
+#define DESVIACIONY 0
+#define DESVIACIONZ 0
+
+
+camera::camera (char* configFile): m_nameFile(NULL),
+								   m_R (NULL),
+								   m_RES (NULL),
+								   m_RT (NULL),
+								   m_T (NULL),
+								   m_K (NULL),
+								   m_pos (NULL)
+{
+	if (configFile!=NULL)
+	{
+		m_nameFile = (char*) malloc (sizeof(char)*(strlen(configFile)+1));
+		if (m_nameFile)
+		{
+			strncpy(m_nameFile,configFile,strlen(configFile));
+			m_nameFile[strlen(configFile)]='\0';
+		}
+	}
+	
+	m_R = gsl_matrix_alloc(3,3);	
+	m_K = gsl_matrix_alloc(3,3);
+  	m_T = gsl_matrix_alloc(3,4);
+  	m_RT = gsl_matrix_alloc(4,4);
+  	m_RES = gsl_matrix_alloc(3,4);
+  	
+	m_pos = gsl_vector_alloc(3);	
+	
+}
+
+/// \brief Destructor
+camera::~camera()
+{
+	if (m_nameFile)
+		free(m_nameFile);
+	
+	if (m_R)
+		gsl_matrix_free(m_R);
+		
+	if (m_RES)
+		gsl_matrix_free(m_RES);
+		
+	if (m_RT)
+		gsl_matrix_free(m_RT);
+		
+	if (m_T)
+		gsl_matrix_free(m_T);
+		
+	if (m_K)
+		gsl_matrix_free(m_K);
+		
+	if (m_pos)
+		gsl_vector_free(m_pos);
+		
+}
+
+TPinHoleCamera& camera::readConfig()
+{
+	
+	const int limit = 256;	
+	char word1[limit],word2[limit];
+	int i=0;
+	char buffer_file[limit];  
+	int number;
+	FILE *myfile;
+	int k=0;
+	int counter=0;
+
+	if ((myfile=fopen(m_nameFile,"r"))==NULL){
+		printf("Cannot find camera configuration file\n");
+		//return -1;
+	}
+
+
+	DEBUG("camera::readConfig: %s\n",m_nameFile);	
+
+	do{
+		again:
+		i=0;
+		buffer_file[0]=fgetc(myfile);
+		if (feof(myfile)) 
+			k=EOF;
+		if (buffer_file[0]==(char)255) 
+			k=EOF; 
+		if (buffer_file[0]==' '){
+			while(buffer_file[0]==' ') 
+				buffer_file[0]=fgetc(myfile);
+		}
+		if (buffer_file[0]=='#'){
+			while(buffer_file[0]=fgetc(myfile)!='\n'); 
+			goto again;
+		}
+		if (buffer_file[0]==' '){
+			while(buffer_file[0]==' ') 
+				buffer_file[0]=fgetc(myfile);
+		}
+	  	if (buffer_file[0]=='\t'){
+			while(buffer_file[0]=='\t') 
+				buffer_file[0]=fgetc(myfile);
+		}
+
+	
+
+
+ /* Captures a line and then we will process it with sscanf checking that the last character is \n. We can't doit with fscanf because this function does not difference \n from blank space. */
+		while ((buffer_file[i]!='\n')&&(buffer_file[i] != (char)255) && (i<limit-1)) {
+			buffer_file[++i]=fgetc(myfile);
+		}
+		buffer_file[i]='\n';
+	
+	  
+		if (i >= limit-1) { 
+			printf("%s...\n", buffer_file); 
+			printf ("Line too long in config file!\n"); 
+			exit(-1);
+		}
+		buffer_file[++i]='\0';
+	
+		if (sscanf(buffer_file,"%s",word1)!=1){
+		}
+		else {
+			number=sscanf(buffer_file,"%s %s ",word1,word2);
+			if (strcmp(word1,"positionX")==0){
+				cam.position.X=atof(word2);
+				counter++;
+			}
+			else if (strcmp(word1,"positionY")==0){
+				cam.position.Y=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"positionZ")==0){
+				cam.position.Z=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"positionH")==0){
+				cam.position.H=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"FOApositionX")==0){
+				cam.foa.X=atof(word2);
+				counter++;;
+			} 
+			else if (strcmp(word1,"FOApositionY")==0){
+				cam.foa.Y=atof(word2)-DESVIACIONY;
+				counter++;
+			} 
+			else if (strcmp(word1,"FOApositionZ")==0){
+				cam.foa.Z=atof(word2)-DESVIACIONZ;
+				counter++;
+			} 
+			else if (strcmp(word1,"FOApositionH")==0){
+				cam.foa.H=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"roll")==0){
+				cam.roll=atof(word2);
+				//cam.roll=3.14/2;
+				counter++;
+			} 
+			else if (strcmp(word1,"fx")==0){
+				cam.fdistx=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"fy")==0){
+				cam.fdisty=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"skew")==0){
+				cam.skew=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"u0")==0){
+				cam.u0=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"v0")==0){
+				cam.v0=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"columns")==0){
+				cam.columns=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"rows")==0){
+				cam.rows=atof(word2);
+				counter++;
+			} 
+			else{
+				printf("NaoVision: line: %s not valid in camera configuration file\n",buffer_file);
+			}
+		}
+	} while(k!=EOF);	
+
+	update_camera_matrix(&cam);
+	//if (counter==N_LINES_CAM){
+		//return 1;
+	//}
+
+	
+	//updateMatrix();
+	
+	//return true;
+	return cam;
+}
+
+void camera::updateMatrix()
+{
+/*
+	// Fill matrix T 
+	gsl_matrix_set(m_T, 0,0,1);
+	gsl_matrix_set(m_T, 1,1,1);
+	gsl_matrix_set(m_T, 2,2,1);
+	
+	gsl_matrix_set(m_T,0,3,gsl_vector_get(m_pos,0));
+	gsl_matrix_set(m_T,1,3,gsl_vector_get(m_pos,1));
+	gsl_matrix_set(m_T,2,3,gsl_vector_get(m_pos,2));	
+	
+	// Multiplicate R * T  = RES 
+	gsl_linalg_matmult (m_R,m_T,m_RES);	
+	
+	
+	for (int i=0;i<3;i++)
+    	for (int j=0;j<4;j++)
+      		gsl_matrix_set(m_RT,i,j,gsl_matrix_get(m_RES,i,j));
+      		
+	// set 0001 in the last row of RT 
+	gsl_matrix_set(m_RT,3,0,0);
+	gsl_matrix_set(m_RT,3,1,0);
+	gsl_matrix_set(m_RT,3,2,0);
+	gsl_matrix_set(m_RT,3,3,1);
+	
+	//gsl_matrix_set(m_K,0,2,142.60000610);
+	//gsl_matrix_set(m_K,1,2,150.39999390);
+	
+	//gsl_matrix_set(m_K,1,1,gsl_matrix_get(m_K,0,0));
+	gsl_matrix_set(m_K,0,1,0.0);
+ */   
+	
+}
+
+TPinHoleCamera& camera::getProgeoCam()
+{
+/*	
+	HPoint3D positionCam;
+	
+	positionCam.X= -gsl_vector_get(m_pos,0);
+	positionCam.Y= -gsl_vector_get(m_pos,1);
+	positionCam.Z= -gsl_vector_get(m_pos,2);
+	positionCam.H= 0.0;	
+	
+	m_progeoCam.position = positionCam;
+	
+	// Seting intrensic matrix
+	m_progeoCam.k11 = gsl_matrix_get(m_K,0,0);
+	m_progeoCam.k12 = gsl_matrix_get(m_K,0,1);
+	m_progeoCam.k13 = gsl_matrix_get(m_K,0,2);
+	m_progeoCam.k14 = 0;
+	
+	m_progeoCam.k21 = gsl_matrix_get(m_K,1,0);
+	m_progeoCam.k22 = gsl_matrix_get(m_K,1,1);
+	m_progeoCam.k23 = gsl_matrix_get(m_K,1,2);
+	m_progeoCam.k24 = 0;
+	
+	m_progeoCam.k31 = gsl_matrix_get(m_K,2,0);
+	m_progeoCam.k32 = gsl_matrix_get(m_K,2,1);
+	m_progeoCam.k33 = gsl_matrix_get(m_K,2,2);
+	m_progeoCam.k34 = 0;
+	
+	// Seting extrensic
+	m_progeoCam.rt11 = gsl_matrix_get(m_RT,0,0);
+	m_progeoCam.rt12 = gsl_matrix_get(m_RT,0,1);
+	m_progeoCam.rt13 = gsl_matrix_get(m_RT,0,2);
+	m_progeoCam.rt14 = gsl_matrix_get(m_RT,0,3);
+
+	m_progeoCam.rt21 = gsl_matrix_get(m_RT,1,0);
+	m_progeoCam.rt22 = gsl_matrix_get(m_RT,1,1);
+	m_progeoCam.rt23 = gsl_matrix_get(m_RT,1,2);
+	m_progeoCam.rt24 = gsl_matrix_get(m_RT,1,3);
+
+	m_progeoCam.rt31 = gsl_matrix_get(m_RT,2,0);
+	m_progeoCam.rt32 = gsl_matrix_get(m_RT,2,1);
+	m_progeoCam.rt33 = gsl_matrix_get(m_RT,2,2);
+	m_progeoCam.rt34 = gsl_matrix_get(m_RT,2,3);
+
+	m_progeoCam.rt41 = gsl_matrix_get(m_RT,3,0);
+	m_progeoCam.rt42 = gsl_matrix_get(m_RT,3,1);
+	m_progeoCam.rt43 = gsl_matrix_get(m_RT,3,2);
+	m_progeoCam.rt44 = gsl_matrix_get(m_RT,3,3);
+	
+	return m_progeoCam;
+*/	
+}
+
+void camera::test()
+{
+	
+	HPoint3D point3D;
+	HPoint2D point2D;
+	
+	point3D.X = 10;
+	point3D.Y = 10;
+	point3D.Z = 10;
+	point3D.H = 1;
+	
+	printf ("======== TEST 1 ========\n");	
+	
+	if (project(point3D, &point2D, cam))
+		printf("Project a 2D: %2.2f,%2.2f,%2.2f \n",point2D.x,point2D.y,point2D.h);	
+	else
+		printf("Error in project\n");
+	
+    point2D.h=1.0;
+	if (backproject(&point3D,point2D,cam)!=-1)
+		printf("Backproject a 3D (de nuevo): %.2f,%.2f,%.2f,%.2f \n",point3D.X, point3D.Y, point3D.Z, point3D.H);
+	else
+		printf("Error in backproject\n");
+		
+	printf ("======== TEST 2 ========\n");
+	
+	point2D.x = 85.;
+	point2D.y = 154.;
+	point2D.h = 1.;
+	
+	printf ("Pto en 2D: %2.2f,%2.2f,%2.2f \n",point2D.x,point2D.y,point2D.h);
+	
+	if (backproject(&point3D,point2D,cam)!=-1)
+		printf("Backproject a 3D: %.2f,%.2f,%.2f,%.2f \n",point3D.X, point3D.Y, point3D.Z, point3D.H);
+	else
+		printf("Error in backproject\n");
+			
+	if (project(point3D, &point2D, cam))
+		printf("Project a 2D (de nuevo): %2.2f,%2.2f,%2.2f \n",point2D.x,point2D.y,point2D.h);	
+	else
+		printf("Error in project\n");
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+

Added: trunk/src/components/visualHFSM-3.1/camera.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/camera.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/camera.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,88 @@
+
+/*  
+ * Copyright (C) 2008 Roberto Calvo Palomino
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *   
+ *   Authors : Roberto Calvo Palomino <rocapal en gsyc.escet.urjc.es>,
+ * 			   Jose María Cañas Plaza <jmplaza en gsyc.es>
+ *
+ */
+ 
+#ifndef CAMERA_H_
+#define CAMERA_H_
+
+/**
+	\class camera
+	\brief This class implement a camera instance  
+	\autor Roberto Calvo <rocapal en gsyc.es>
+	\date  17/05/2008
+**/
+
+#include <gsl/gsl_linalg.h>
+#include <gsl/gsl_multifit.h>
+
+extern "C"
+{
+#include "progeo/progeo.h"
+}
+
+class camera
+{
+	public:
+		/// \brief Constructor
+		camera (char* configFile);
+		
+		/// \brief Destructor
+		~camera();
+		
+		/// \brief Reaf file config and fill the matrix R and K
+		TPinHoleCamera& readConfig();
+		
+		/// \brief Return a progeo camera with configurated matrix
+		TPinHoleCamera& getProgeoCam();
+		
+		/// \brief Do test of cams
+		void test();
+
+	private:
+	
+		/// \brief Update Matrix
+		void updateMatrix();
+		
+		/// \brief 
+		//TPinHoleCamera m_progeoCam;
+		TPinHoleCamera cam;
+		/// \brief name file
+		char* m_nameFile;
+		
+		/// \brief R Matrix
+		gsl_matrix	*m_R; 
+
+		/// \brief aux Matrix
+		gsl_matrix	*m_RES; 
+
+		/// \brief RT Matrix
+		gsl_matrix	*m_RT;
+
+		/// \brief T Matrix
+		gsl_matrix	*m_T;
+
+		/// \brief K Matrix
+		gsl_matrix	*m_K;
+	
+		/// \brief Position vector of cam (x,y,z) 
+		gsl_vector *m_pos;
+};
+#endif /*CAMERA_H_*/

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/CMakeLists.txt
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/CMakeLists.txt	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/CMakeLists.txt	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,47 @@
+   
+
+set( CMAKE_CXX_FLAGS "-lgsl -lgslcblas" ) # Opciones para el compilador -lgslcblas -lGL -lGLU -lglut -lgazebo
+
+SET( SOURCE_FILES camera.cpp canvasLaser.cpp canvas_main.cpp canvasTeleoperateCameras.cpp canvasTeleoperateControl.cpp control_class.cpp gui.cpp)
+
+
+include_directories(
+    ${INTERFACES_CPP_DIR}
+    ${LIBS_DIR}
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${CMAKE_CURRENT_SOURCE_DIR}/cameras
+    ${CMAKE_CURRENT_SOURCE_DIR}/../../interfaces/cpp/jderobot
+    ${INCLUDE_DIR}
+)
+
+link_directories(
+   ${INTERFACES_CPP_DIR}
+   ${LIBS_DIR}
+)
+
+
+
+add_executable (mycomponent ${SOURCE_FILES})
+
+
+TARGET_LINK_LIBRARIES(choca_gira 
+    ${opencv_LIBRARIES}
+    ${gtkmm_LIBRARIES}
+    ${libglademm_LIBRARIES}
+    ${gthread_LIBRARIES}
+    ${libgnomecanvas_LIBRARIES}
+    ${libgnomecanvasmm_LIBRARIES}
+    ${gtkglextmm_LIBRARIES}
+    ${ZeroCIce_LIBRARIES}
+    ${OpenCV_LIBRARIES}
+    ${LIBS_DIR}/colorspaces/libcolorspacesmm.so
+    ${INTERFACES_CPP_DIR}/jderobot/libJderobotInterfaces.so
+    ${LIBS_DIR}/jderobotice/libjderobotice.so
+    ${LIBS_DIR}/jderobotutil/libjderobotutil.so
+    ${LIBS_DIR}/progeo/libprogeo.so
+    ${LIBS_DIR}/pioneer/libpioneer.so
+)
+
+
+
+

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/Ogre.log
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/Ogre.log	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/Ogre.log	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,238 @@
+22:44:26: Creating resource group General
+22:44:26: Creating resource group Internal
+22:44:26: Creating resource group Autodetect
+22:44:26: SceneManagerFactory for type 'DefaultSceneManager' registered.
+22:44:26: Registering ResourceManager for type Material
+22:44:26: Registering ResourceManager for type Mesh
+22:44:26: Registering ResourceManager for type Skeleton
+22:44:26: MovableObjectFactory for type 'ParticleSystem' registered.
+22:44:26: OverlayElementFactory for type Panel registered.
+22:44:26: OverlayElementFactory for type BorderPanel registered.
+22:44:26: OverlayElementFactory for type TextArea registered.
+22:44:26: Registering ResourceManager for type Font
+22:44:26: ArchiveFactory for archive type FileSystem registered.
+22:44:26: ArchiveFactory for archive type Zip registered.
+22:44:26: FreeImage version: 3.10.0
+22:44:26: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
+22:44:26: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2
+22:44:26: DDS codec registering
+22:44:26: Registering ResourceManager for type HighLevelGpuProgram
+22:44:26: Registering ResourceManager for type Compositor
+22:44:26: MovableObjectFactory for type 'Entity' registered.
+22:44:26: MovableObjectFactory for type 'Light' registered.
+22:44:26: MovableObjectFactory for type 'BillboardSet' registered.
+22:44:26: MovableObjectFactory for type 'ManualObject' registered.
+22:44:26: MovableObjectFactory for type 'BillboardChain' registered.
+22:44:26: MovableObjectFactory for type 'RibbonTrail' registered.
+22:44:26: OGRE EXCEPTION(6:FileNotFoundException): 'plugins.cfg' file not found! in ConfigFile::load at OgreConfigFile.cpp (line 84)
+22:44:26: plugins.cfg not found, automatic plugin loading disabled.
+22:44:26: *-*-* OGRE Initialising
+22:44:26: *-*-* Version 1.6.4 (Shoggoth)
+22:44:26: Loading library /usr/lib/OGRE/RenderSystem_GL.so
+22:44:26: Installing plugin: GL RenderSystem
+22:44:26: OpenGL Rendering Subsystem created.
+22:44:26: Plugin successfully installed
+22:44:26: Loading library /usr/lib/OGRE/Plugin_ParticleFX.so
+22:44:26: Installing plugin: ParticleFX
+22:44:26: Particle Emitter Type 'Point' registered
+22:44:26: Particle Emitter Type 'Box' registered
+22:44:26: Particle Emitter Type 'Ellipsoid' registered
+22:44:26: Particle Emitter Type 'Cylinder' registered
+22:44:26: Particle Emitter Type 'Ring' registered
+22:44:26: Particle Emitter Type 'HollowEllipsoid' registered
+22:44:26: Particle Affector Type 'LinearForce' registered
+22:44:26: Particle Affector Type 'ColourFader' registered
+22:44:26: Particle Affector Type 'ColourFader2' registered
+22:44:26: Particle Affector Type 'ColourImage' registered
+22:44:26: Particle Affector Type 'ColourInterpolator' registered
+22:44:26: Particle Affector Type 'Scaler' registered
+22:44:26: Particle Affector Type 'Rotator' registered
+22:44:26: Particle Affector Type 'DirectionRandomiser' registered
+22:44:26: Particle Affector Type 'DeflectorPlane' registered
+22:44:26: Plugin successfully installed
+22:44:26: Added resource location '/usr/local/share/gazebo/Media' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/fonts' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/materials/programs' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/materials/scripts' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/materials/textures' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/models' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/sets' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/maps' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/sets/..' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/sets/.' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/sets/pioneer2at' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/sets/pioneer2dx' of type 'FileSystem' to resource group 'General'
+22:44:26: CPU Identifier & Features
+22:44:26: -------------------------
+22:44:26:  *   CPU ID: GenuineIntel: Intel(R) Core(TM)2 Quad  CPU   Q8200  @ 2.33GHz
+22:44:26:  *      SSE: yes
+22:44:26:  *     SSE2: yes
+22:44:26:  *     SSE3: yes
+22:44:26:  *      MMX: yes
+22:44:26:  *   MMXEXT: yes
+22:44:26:  *    3DNOW: no
+22:44:26:  * 3DNOWEXT: no
+22:44:26:  *     CMOV: yes
+22:44:26:  *      TSC: yes
+22:44:26:  *      FPU: yes
+22:44:26:  *      PRO: yes
+22:44:26:  *       HT: no
+22:44:26: -------------------------
+22:44:26: ******************************
+*** Starting GLX Subsystem ***
+******************************
+22:44:26: GLRenderSystem::_createRenderWindow "OgreWindow(0)", 548x480 windowed  miscParams: FSAA=2 externalWindowHandle=90177567 
+22:44:26: GLXWindow::create: The externalWindowHandle parameter is deprecated.
+Use the parentWindowHandle or currentGLContext parameter instead.
+22:44:26: GLXWindow::create used FBConfigID = 125
+22:44:26: GL_VERSION = 3.3.0 NVIDIA 290.10
+22:44:26: GL_VENDOR = NVIDIA Corporation
+22:44:26: GL_RENDERER = GeForce 9600 GT/PCI/SSE2
+22:44:26: GL_EXTENSIONS = GL_ARB_base_instance GL_ARB_blend_func_extended GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_robustness GL_AR!
 B_sampler_objects GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_objects GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_ar!
 ray GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float!
  GL_ATI_texture_mirror_once GL_S3_s3tc GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_Cg_shader GL_EXT_depth_bounds_test GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXTX_framebuffer_mixed_formats GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EX!
 T_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_texture_type_2_10_10_10_REV GL_EXT_timer_query GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_x11_sync_object GL_EXT_import_sync_object GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_alpha_test GL_NV_blend_minmax GL_NV_blend_square GL_NV_complex_primitives GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_depth_cl!
 amp GL_NV_explicit_multisample GL_NV_fbo_color_attachments GL_NV_fence !
 GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragdepth GL_NV_fragment_program GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_gpu_program4 GL_NV_half_float GL_NV_light_max_exponent GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2 GL_NV_path_rendering GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_shader_buffer_load GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_expand_normal GL_NV_texture_lod_clamp GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_transform_feedback GL_NV_vdpau_interop GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_buffer_unified_memory GL_!
 NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NVX_conditional_render GL_NVX_gpu_memory_info GL_OES_depth24 GL_OES_depth32 GL_OES_depth_texture GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_get_program_binary GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_array_object GL_OES_vertex_half_float GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum 
+22:44:26: Supported GLX extensions: GLX_EXT_visual_info GLX_EXT_visual_rating GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGI_video_sync GLX_SGI_swap_control GLX_EXT_swap_control GLX_EXT_texture_from_pixmap GLX_ARB_create_context GLX_ARB_create_context_profile GLX_EXT_create_context_es2_profile GLX_ARB_create_context_robustness GLX_ARB_multisample GLX_NV_float_buffer GLX_ARB_fbconfig_float GLX_EXT_framebuffer_sRGB GLX_ARB_get_proc_address 
+22:44:26: ***************************
+22:44:26: *** GL Renderer Started ***
+22:44:26: ***************************
+22:44:26: Registering ResourceManager for type GpuProgram
+22:44:26: GLSL support detected
+22:44:26: GL: Using GL_EXT_framebuffer_object for rendering to textures (best)
+22:44:26: FBO PF_UNKNOWN depth/stencil support: D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_L8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A4L4 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_BYTE_LA depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_R5G6B5 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_B5G6R5 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A4R4G4B4 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A1R5G5B5 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_R8G8B8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_B8G8R8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A8R8G8B8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_B8G8R8A8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A2R10G10B10 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A2B10G10R10 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT16_RGB depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT16_RGBA depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT32_RGB depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT32_RGBA depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_X8R8G8B8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_X8B8G8R8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_SHORT_RGBA depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_R3G3B2 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT16_R depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT32_R depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT16_GR depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT32_GR depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_SHORT_RGB depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: [GL] : Valid FBO targets PF_UNKNOWN PF_L8 PF_A8 PF_A4L4 PF_BYTE_LA PF_R5G6B5 PF_B5G6R5 PF_A4R4G4B4 PF_A1R5G5B5 PF_R8G8B8 PF_B8G8R8 PF_A8R8G8B8 PF_B8G8R8A8 PF_A2R10G10B10 PF_A2B10G10R10 PF_FLOAT16_RGB PF_FLOAT16_RGBA PF_FLOAT32_RGB PF_FLOAT32_RGBA PF_X8R8G8B8 PF_X8B8G8R8 PF_SHORT_RGBA PF_R3G3B2 PF_FLOAT16_R PF_FLOAT32_R PF_FLOAT16_GR PF_FLOAT32_GR PF_SHORT_RGB 
+22:44:26: RenderSystem capabilities
+22:44:26: -------------------------
+22:44:26: RenderSystem Name: OpenGL Rendering Subsystem
+22:44:26: GPU Vendor: nvidia
+22:44:26: Device Name: GeForce 9600 GT/PCI/SSE2
+22:44:26: Driver Version: 3.3.0.0
+22:44:26:  * Fixed function pipeline: yes
+22:44:26:  * Hardware generation of mipmaps: yes
+22:44:26:  * Texture blending: yes
+22:44:26:  * Anisotropic texture filtering: yes
+22:44:26:  * Dot product texture operation: yes
+22:44:26:  * Cube mapping: yes
+22:44:26:  * Hardware stencil buffer: no
+22:44:26:  * Hardware vertex / index buffers: yes
+22:44:26:  * Vertex programs: yes
+22:44:26:  * Fragment programs: yes
+22:44:26:  * Geometry programs: yes
+22:44:26:  * Supported Shader Profiles: arbfp1 arbvp1 fp20 fp30 fp40 glsl gp4gp gpu_gp nvgp4 vp30 vp40
+22:44:26:  * Texture Compression: yes
+22:44:26:    - DXT: yes
+22:44:26:    - VTC: yes
+22:44:26:  * Scissor Rectangle: yes
+22:44:26:  * Hardware Occlusion Query: yes
+22:44:26:  * User clip planes: yes
+22:44:26:  * VET_UBYTE4 vertex element type: yes
+22:44:26:  * Infinite far plane projection: yes
+22:44:26:  * Hardware render-to-texture: yes
+22:44:26:  * Floating point textures: yes
+22:44:26:  * Non-power-of-two textures: yes
+22:44:26:  * Volume textures: yes
+22:44:26:  * Multiple Render Targets: 8
+22:44:26:    - With different bit depths: yes
+22:44:26:  * Point Sprites: yes
+22:44:26:  * Extended point parameters: yes
+22:44:26:  * Max Point Size: 63.375
+22:44:26:  * Vertex texture fetch: yes
+22:44:26:    - Max vertex textures: 32
+22:44:26:    - Vertex textures shared: yes
+22:44:26:  * Render to Vertex Buffer : yes
+22:44:26:  * GL 1.5 without VBO workaround: no
+22:44:26:  * Frame Buffer objects: yes
+22:44:26:  * Frame Buffer objects (ARB extension): no
+22:44:26:  * Frame Buffer objects (ATI extension): no
+22:44:26:  * PBuffer suppport: no
+22:44:26:  * GL 1.5 without HW-occlusion workaround: no
+22:44:26: Registering ResourceManager for type Texture
+22:44:26: ResourceBackgroundQueue - threading disabled
+22:44:26: Particle Renderer Type 'billboard' registered
+22:44:26: Parsing scripts for resource group Autodetect
+22:44:26: Finished parsing scripts for resource group Autodetect
+22:44:26: Parsing scripts for resource group General
+22:44:26: Parsing script Gazebo.material
+22:44:26: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DepthMap.vert in resource group General or any other group. in ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line 763)
+22:44:26: High-level program Gazebo/DepthMapVS encountered an error during loading and is thus not supported.
+OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DepthMap.vert in resource group General or any other group. in ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line 763)
+22:44:26: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at OgreGpuProgram.cpp (line 1087)
+22:44:26: Compiler error: invalid parameters in Gazebo.material(9): setting of constant failed
+22:44:26: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at OgreGpuProgram.cpp (line 1087)
+22:44:26: Compiler error: invalid parameters in Gazebo.material(10): setting of constant failed
+22:44:26: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at OgreGpuProgram.cpp (line 1087)
+22:44:26: Compiler error: invalid parameters in Gazebo.material(11): setting of constant failed
+22:44:26: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DepthMap.frag in resource group General or any other group. in ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line 763)
+22:44:26: High-level program Gazebo/DepthMapFS encountered an error during loading and is thus not supported.
+OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DepthMap.frag in resource group General or any other group. in ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line 763)
+22:44:26: Compiler error: unknown error in Gazebo.material(58): token "lightning" is not recognized
+22:44:26: Compiler error: invalid parameters in Gazebo.material(59)
+22:44:26: GLSL compiling: Gazebo/PointLightFS
+22:44:26: GLSL compiled : Gazebo/PointLightFS
+22:44:26: GLSL compiling: Gazebo/PointLightVS
+22:44:26: GLSL compiled : Gazebo/PointLightVS
+22:44:26: Compiler error: invalid parameters in Gazebo.material(360): depth_write third argument must be "true", "false", "yes", "no", "on", or "off"
+22:44:26: Compiler error: invalid parameters in Gazebo.material(377): depth_write third argument must be "true", "false", "yes", "no", "on", or "off"
+22:44:26: Parsing script Gazebo.fontdef
+22:44:26: Parsing script sample.fontdef
+22:44:26: Bad attribute line: glyph	 	0.152344	0.125	0.160156	0.1875 in font Ogre
+22:44:26: Finished parsing scripts for resource group General
+22:44:26: Parsing scripts for resource group Internal
+22:44:26: Finished parsing scripts for resource group Internal
+22:44:26: WARNING: Stencil shadows were requested, but this device does not have a hardware stencil. Shadows disabled.
+22:44:26: Texture: clouds.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
+22:44:26: Font Arialusing texture size 512x512
+22:44:26: Info: Freetype returned null for character 160 in font Arial
+22:44:26: Texture: ArialTexture: Loading 1 faces(PF_BYTE_LA,512x512x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,512x512x1.
+22:44:27: Texture: sigueLineas.png: Loading 1 faces(PF_R8G8B8,299x234x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,299x234x1.
+22:44:27: Texture: lightwood.png: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
+22:44:27: Mesh: Loading Pioneer2dx/chassis.mesh.
+22:44:27: Can't assign material Material.002 to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_949_VISUAL_950_VISUAL_951 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading Pioneer2at/chassis_top.mesh.
+22:44:27: Can't assign material Material.003 to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_949_VISUAL_950_VISUAL_952 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading Pioneer2at/sonarbank.mesh.
+22:44:27: Can't assign material default to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_949_VISUAL_950_VISUAL_953 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material default to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_949_VISUAL_950_VISUAL_954 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading Pioneer2dx/tire.mesh.
+22:44:27: Can't assign material Material.004 to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_956_VISUAL_957_VISUAL_958 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading Pioneer2at/wheel.mesh.
+22:44:27: Can't assign material Material.010 to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_956_VISUAL_957_VISUAL_959 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material.004 to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_962_VISUAL_963_VISUAL_964 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material.010 to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_962_VISUAL_963_VISUAL_965 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading sicklms200.mesh.
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_975_VISUAL_976_VISUAL_977_VISUAL_978 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading sonyvid30/sonyvid30_bottom.mesh.
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_982_VISUAL_983_VISUAL_984_VISUAL_985 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading sonyvid30/sonyvid30_mid.mesh.
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_982_VISUAL_987_VISUAL_988_VISUAL_989 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading sonyvid30/sonyvid30_top.mesh.
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_982_VISUAL_991_VISUAL_992_VISUAL_993 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material.001/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_982_VISUAL_991_VISUAL_992_VISUAL_993 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_1001_VISUAL_1002_VISUAL_1003_VISUAL_1004 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_1001_VISUAL_1006_VISUAL_1007_VISUAL_1008 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_1001_VISUAL_1010_VISUAL_1011_VISUAL_1012 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material.001/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_1001_VISUAL_1010_VISUAL_1011_VISUAL_1012 because this Material does not exist. Have you forgotten to define it in a .material script?

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/CMakeLists.txt
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/CMakeLists.txt	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/CMakeLists.txt	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,131 @@
+project (JDEROBOT_CHOCA_GIRA)
+
+cmake_minimum_required(VERSION 2.8)
+
+# ENV VARS
+SET(gladedir ./)
+
+SET( INTERFACES_CPP_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../interfaces/cpp) # Directorio con las interfaces ICE en C++
+SET( LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs) # Directorio donde se encuentran las librerias propias de jderobot
+SET( SLICE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../interfaces/slice) # Directorio donde se encuentran las interfaces ICE
+SET( LIBS_NEEDED   bgfgsegmentation jderobotice colorspaces jderobotutil progeo pioneer fuzzylib visionlib ) # Librerias de las que depende el componente
+SET( DEPS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../../../Deps) # Directorio donde se encuentran las dependencias
+
+
+
+###################
+#                                         #
+#   CHECK SYSTEM                #
+#                                         #
+###################
+
+  # FIND & CHECK PRINCIPAL LIBRARIES
+
+include(FindPkgConfig)
+PKG_CHECK_MODULES(opencv REQUIRED opencv)
+include_directories(${opencv_INCLUDE_DIRS})
+link_directories(${opencv_LIBRARY_DIRS})
+
+PKG_CHECK_MODULES(gtk20 REQUIRED gtk+-2.0)
+include_directories(${gtk20_INCLUDE_DIRS})
+link_directories(${gtk20_LIBRARY_DIRS})
+
+PKG_CHECK_MODULES(gtkgl20 REQUIRED gtkgl-2.0)
+include_directories(${gtkgl20_INCLUDE_DIRS})
+link_directories(${gtkgl20_LIBRARY_DIRS})
+
+PKG_CHECK_MODULES(gtkmm REQUIRED gtkmm-2.4)
+include_directories(${gtkmm_INCLUDE_DIRS})
+link_directories(${gtkmm_LIBRARY_DIRS})
+
+PKG_CHECK_MODULES(libglademm REQUIRED libglademm-2.4)
+include_directories(${libglademm_INCLUDE_DIRS})
+link_directories(${libglademm_LIBRARY_DIRS})
+
+PKG_CHECK_MODULES(gthread REQUIRED gthread-2.0)
+include_directories(${gthread_INCLUDE_DIRS})
+link_directories(${gthread_LIBRARY_DIRS})
+
+PKG_CHECK_MODULES(libgnomecanvas REQUIRED libgnomecanvas-2.0)
+include_directories(${libgnomecanvas_INCLUDE_DIRS})
+link_directories(${libgnomecanvas_LIBRARY_DIRS})
+
+PKG_CHECK_MODULES(libgnomecanvasmm REQUIRED libgnomecanvasmm-2.6)
+include_directories(${libgnomecanvasmm_INCLUDE_DIRS})
+link_directories(${libgnomecanvasmm_LIBRARY_DIRS})
+
+PKG_CHECK_MODULES(gtkglextmm REQUIRED gtkglextmm-1.2)
+include_directories(${gtkglextmm_INCLUDE_DIRS})
+link_directories(${gtkglextmm_LIBRARY_DIRS})
+
+
+
+  # FIND AND CHECK OTHER DEPENDENCES
+include(${DEPS_DIR}/gearbox/CMakeLists.txt)
+include(${DEPS_DIR}/ice/CMakeLists.txt)
+
+
+
+# START RECURSIVE
+add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/../../.. ${CMAKE_CURRENT_SOURCE_DIR}/../../..)
+add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/..)
+
+
+###################
+#                 #
+#    INSTALL      #
+#                 #
+###################
+
+# Install libraries
+FILE(GLOB_RECURSE LIBS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libs/*.so)
+INSTALL (FILES ${LIBS_FILES} DESTINATION /usr/local/lib/jderobot)
+#MESSAGE ( "COMARE ${LIBS_FILES} ")
+# Install libraries headers
+FILE(GLOB_RECURSE HEADERS_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libs/*.h)
+FOREACH(currentSourceFile ${HEADERS_FILES})
+	string(REGEX REPLACE ".*/(.*/).*.h" "\\1" new_source1 ${currentSourceFile})
+	INSTALL (FILES ${currentSourceFile} DESTINATION /usr/local/include/jderobot/${new_source1})
+# MESSAGE ( "COMARE ${currentSourceFile} ")
+
+ENDFOREACH(currentSourceFile)
+
+# Install Executables
+FILE(GLOB_RECURSE BIN_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../*cfg)
+    string(REGEX REPLACE ".*/(.*).cfg" "\\1" new_source1 ${BIN_FILES})
+INSTALL (FILES ../${new_source1}  DESTINATION /usr/local/bin PERMISSIONS OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE)
+
+
+
+# Install interfaces headers
+FILE(GLOB HEADER_INTERFACE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/interfaces/cpp/jderobot/*.h)
+INSTALL (FILES ${HEADER_INTERFACE_FILES} DESTINATION /usr/local/include/jderobot/jderobot)
+
+# Install slice
+FILE(GLOB SLICE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/interfaces/slice/jderobot/*.ice)
+INSTALL (FILES ${SLICE_FILES} DESTINATION /usr/local/include/jderobot/slice)
+
+# Install CONF
+FILE(GLOB_RECURSE CONF_FILES  ${CMAKE_CURRENT_SOURCE_DIR}/../*cfg)
+INSTALL (FILES ${CONF_FILES} DESTINATION /usr/local/share/jderobot/conf)
+
+# Install Glade
+FILE(GLOB_RECURSE GLADE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/../*.glade)
+INSTALL (FILES ${GLADE_FILES} DESTINATION /usr/local/share/jderobot/glade)
+
+
+
+###################
+#                 #
+#    UNINSTALL    #
+#                 #
+###################
+
+configure_file(
+    "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
+    "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
+    IMMEDIATE @ONLY)
+
+add_custom_target(uninstall
+    COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
+

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/clean.sh
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/clean.sh	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/clean.sh	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+make clean
+rm ../cmake_install.cmake
+rm -r CMakeFiles
+rm -r ../CMakeFiles
+mkdir ../temp
+mv CMakeLists.txt ../temp
+mv clean.sh ../temp
+mv cmake_uninstall.cmake.in ../temp
+rm -r *
+mv ../temp/CMakeLists.txt .
+mv ../temp/clean.sh .
+mv ../temp/cmake_uninstall.cmake.in .
+rm -r ../temp
+cd ../../../../
+./clean_repository 


Property changes on: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/clean.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/cmake_uninstall.cmake.in
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/cmake_uninstall.cmake.in	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/build/cmake_uninstall.cmake.in	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,22 @@
+if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+    message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"")
+endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
+
+file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
+string(REGEX REPLACE "\n" ";" files "${files}")
+list(REVERSE files)
+foreach (file ${files})
+    message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
+    if (EXISTS "$ENV{DESTDIR}${file}")
+        execute_process(
+            COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
+            OUTPUT_VARIABLE rm_out
+            RESULT_VARIABLE rm_retval
+        )
+        if(NOT ${rm_retval} EQUAL 0)
+            message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
+        endif (NOT ${rm_retval} EQUAL 0)
+    else (EXISTS "$ENV{DESTDIR}${file}")
+        message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.")
+    endif (EXISTS "$ENV{DESTDIR}${file}")
+endforeach(file)
\ No newline at end of file

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/camera.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/camera.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/camera.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,378 @@
+/*  
+ * Copyright (C) 2008 Roberto Calvo Palomino
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *   
+ *   Authors : Roberto Calvo Palomino <rocapal en gsyc.escet.urjc.es>,
+ * 			   Jose María Cañas Plaza <jmplaza en gsyc.es>
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "camera.h"
+
+#define DEBUG(x...) printf(x)
+#define N_LINES_CAM 16
+#define DESVIACIONY 0
+#define DESVIACIONZ 0
+
+
+camera::camera (char* configFile): m_nameFile(NULL),
+								   m_R (NULL),
+								   m_RES (NULL),
+								   m_RT (NULL),
+								   m_T (NULL),
+								   m_K (NULL),
+								   m_pos (NULL)
+{
+	if (configFile!=NULL)
+	{
+		m_nameFile = (char*) malloc (sizeof(char)*(strlen(configFile)+1));
+		if (m_nameFile)
+		{
+			strncpy(m_nameFile,configFile,strlen(configFile));
+			m_nameFile[strlen(configFile)]='\0';
+		}
+	}
+	
+	m_R = gsl_matrix_alloc(3,3);	
+	m_K = gsl_matrix_alloc(3,3);
+  	m_T = gsl_matrix_alloc(3,4);
+  	m_RT = gsl_matrix_alloc(4,4);
+  	m_RES = gsl_matrix_alloc(3,4);
+  	
+	m_pos = gsl_vector_alloc(3);	
+	
+}
+
+/// \brief Destructor
+camera::~camera()
+{
+	if (m_nameFile)
+		free(m_nameFile);
+	
+	if (m_R)
+		gsl_matrix_free(m_R);
+		
+	if (m_RES)
+		gsl_matrix_free(m_RES);
+		
+	if (m_RT)
+		gsl_matrix_free(m_RT);
+		
+	if (m_T)
+		gsl_matrix_free(m_T);
+		
+	if (m_K)
+		gsl_matrix_free(m_K);
+		
+	if (m_pos)
+		gsl_vector_free(m_pos);
+		
+}
+
+TPinHoleCamera& camera::readConfig()
+{
+	
+	const int limit = 256;	
+	char word1[limit],word2[limit];
+	int i=0;
+	char buffer_file[limit];  
+	int number;
+	FILE *myfile;
+	int k=0;
+	int counter=0;
+
+	if ((myfile=fopen(m_nameFile,"r"))==NULL){
+		printf("Cannot find camera configuration file\n");
+		//return -1;
+	}
+
+
+	DEBUG("camera::readConfig: %s\n",m_nameFile);	
+
+	do{
+		again:
+		i=0;
+		buffer_file[0]=fgetc(myfile);
+		if (feof(myfile)) 
+			k=EOF;
+		if (buffer_file[0]==(char)255) 
+			k=EOF; 
+		if (buffer_file[0]==' '){
+			while(buffer_file[0]==' ') 
+				buffer_file[0]=fgetc(myfile);
+		}
+		if (buffer_file[0]=='#'){
+			while(buffer_file[0]=fgetc(myfile)!='\n'); 
+			goto again;
+		}
+		if (buffer_file[0]==' '){
+			while(buffer_file[0]==' ') 
+				buffer_file[0]=fgetc(myfile);
+		}
+	  	if (buffer_file[0]=='\t'){
+			while(buffer_file[0]=='\t') 
+				buffer_file[0]=fgetc(myfile);
+		}
+
+	
+
+
+ /* Captures a line and then we will process it with sscanf checking that the last character is \n. We can't doit with fscanf because this function does not difference \n from blank space. */
+		while ((buffer_file[i]!='\n')&&(buffer_file[i] != (char)255) && (i<limit-1)) {
+			buffer_file[++i]=fgetc(myfile);
+		}
+		buffer_file[i]='\n';
+	
+	  
+		if (i >= limit-1) { 
+			printf("%s...\n", buffer_file); 
+			printf ("Line too long in config file!\n"); 
+			exit(-1);
+		}
+		buffer_file[++i]='\0';
+	
+		if (sscanf(buffer_file,"%s",word1)!=1){
+		}
+		else {
+			number=sscanf(buffer_file,"%s %s ",word1,word2);
+			if (strcmp(word1,"positionX")==0){
+				cam.position.X=atof(word2);
+				counter++;
+			}
+			else if (strcmp(word1,"positionY")==0){
+				cam.position.Y=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"positionZ")==0){
+				cam.position.Z=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"positionH")==0){
+				cam.position.H=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"FOApositionX")==0){
+				cam.foa.X=atof(word2);
+				counter++;;
+			} 
+			else if (strcmp(word1,"FOApositionY")==0){
+				cam.foa.Y=atof(word2)-DESVIACIONY;
+				counter++;
+			} 
+			else if (strcmp(word1,"FOApositionZ")==0){
+				cam.foa.Z=atof(word2)-DESVIACIONZ;
+				counter++;
+			} 
+			else if (strcmp(word1,"FOApositionH")==0){
+				cam.foa.H=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"roll")==0){
+				cam.roll=atof(word2);
+				//cam.roll=3.14/2;
+				counter++;
+			} 
+			else if (strcmp(word1,"fx")==0){
+				cam.fdistx=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"fy")==0){
+				cam.fdisty=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"skew")==0){
+				cam.skew=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"u0")==0){
+				cam.u0=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"v0")==0){
+				cam.v0=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"columns")==0){
+				cam.columns=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"rows")==0){
+				cam.rows=atof(word2);
+				counter++;
+			} 
+			else{
+				printf("NaoVision: line: %s not valid in camera configuration file\n",buffer_file);
+			}
+		}
+	} while(k!=EOF);	
+
+	update_camera_matrix(&cam);
+	//if (counter==N_LINES_CAM){
+		//return 1;
+	//}
+
+	
+	//updateMatrix();
+	
+	//return true;
+	return cam;
+}
+
+void camera::updateMatrix()
+{
+/*
+	// Fill matrix T 
+	gsl_matrix_set(m_T, 0,0,1);
+	gsl_matrix_set(m_T, 1,1,1);
+	gsl_matrix_set(m_T, 2,2,1);
+	
+	gsl_matrix_set(m_T,0,3,gsl_vector_get(m_pos,0));
+	gsl_matrix_set(m_T,1,3,gsl_vector_get(m_pos,1));
+	gsl_matrix_set(m_T,2,3,gsl_vector_get(m_pos,2));	
+	
+	// Multiplicate R * T  = RES 
+	gsl_linalg_matmult (m_R,m_T,m_RES);	
+	
+	
+	for (int i=0;i<3;i++)
+    	for (int j=0;j<4;j++)
+      		gsl_matrix_set(m_RT,i,j,gsl_matrix_get(m_RES,i,j));
+      		
+	// set 0001 in the last row of RT 
+	gsl_matrix_set(m_RT,3,0,0);
+	gsl_matrix_set(m_RT,3,1,0);
+	gsl_matrix_set(m_RT,3,2,0);
+	gsl_matrix_set(m_RT,3,3,1);
+	
+	//gsl_matrix_set(m_K,0,2,142.60000610);
+	//gsl_matrix_set(m_K,1,2,150.39999390);
+	
+	//gsl_matrix_set(m_K,1,1,gsl_matrix_get(m_K,0,0));
+	gsl_matrix_set(m_K,0,1,0.0);
+ */   
+	
+}
+
+TPinHoleCamera& camera::getProgeoCam()
+{
+/*	
+	HPoint3D positionCam;
+	
+	positionCam.X= -gsl_vector_get(m_pos,0);
+	positionCam.Y= -gsl_vector_get(m_pos,1);
+	positionCam.Z= -gsl_vector_get(m_pos,2);
+	positionCam.H= 0.0;	
+	
+	m_progeoCam.position = positionCam;
+	
+	// Seting intrensic matrix
+	m_progeoCam.k11 = gsl_matrix_get(m_K,0,0);
+	m_progeoCam.k12 = gsl_matrix_get(m_K,0,1);
+	m_progeoCam.k13 = gsl_matrix_get(m_K,0,2);
+	m_progeoCam.k14 = 0;
+	
+	m_progeoCam.k21 = gsl_matrix_get(m_K,1,0);
+	m_progeoCam.k22 = gsl_matrix_get(m_K,1,1);
+	m_progeoCam.k23 = gsl_matrix_get(m_K,1,2);
+	m_progeoCam.k24 = 0;
+	
+	m_progeoCam.k31 = gsl_matrix_get(m_K,2,0);
+	m_progeoCam.k32 = gsl_matrix_get(m_K,2,1);
+	m_progeoCam.k33 = gsl_matrix_get(m_K,2,2);
+	m_progeoCam.k34 = 0;
+	
+	// Seting extrensic
+	m_progeoCam.rt11 = gsl_matrix_get(m_RT,0,0);
+	m_progeoCam.rt12 = gsl_matrix_get(m_RT,0,1);
+	m_progeoCam.rt13 = gsl_matrix_get(m_RT,0,2);
+	m_progeoCam.rt14 = gsl_matrix_get(m_RT,0,3);
+
+	m_progeoCam.rt21 = gsl_matrix_get(m_RT,1,0);
+	m_progeoCam.rt22 = gsl_matrix_get(m_RT,1,1);
+	m_progeoCam.rt23 = gsl_matrix_get(m_RT,1,2);
+	m_progeoCam.rt24 = gsl_matrix_get(m_RT,1,3);
+
+	m_progeoCam.rt31 = gsl_matrix_get(m_RT,2,0);
+	m_progeoCam.rt32 = gsl_matrix_get(m_RT,2,1);
+	m_progeoCam.rt33 = gsl_matrix_get(m_RT,2,2);
+	m_progeoCam.rt34 = gsl_matrix_get(m_RT,2,3);
+
+	m_progeoCam.rt41 = gsl_matrix_get(m_RT,3,0);
+	m_progeoCam.rt42 = gsl_matrix_get(m_RT,3,1);
+	m_progeoCam.rt43 = gsl_matrix_get(m_RT,3,2);
+	m_progeoCam.rt44 = gsl_matrix_get(m_RT,3,3);
+	
+	return m_progeoCam;
+*/	
+}
+
+void camera::test()
+{
+	
+	HPoint3D point3D;
+	HPoint2D point2D;
+	
+	point3D.X = 10;
+	point3D.Y = 10;
+	point3D.Z = 10;
+	point3D.H = 1;
+	
+	printf ("======== TEST 1 ========\n");	
+	
+	if (project(point3D, &point2D, cam))
+		printf("Project a 2D: %2.2f,%2.2f,%2.2f \n",point2D.x,point2D.y,point2D.h);	
+	else
+		printf("Error in project\n");
+	
+    point2D.h=1.0;
+	if (backproject(&point3D,point2D,cam)!=-1)
+		printf("Backproject a 3D (de nuevo): %.2f,%.2f,%.2f,%.2f \n",point3D.X, point3D.Y, point3D.Z, point3D.H);
+	else
+		printf("Error in backproject\n");
+		
+	printf ("======== TEST 2 ========\n");
+	
+	point2D.x = 85.;
+	point2D.y = 154.;
+	point2D.h = 1.;
+	
+	printf ("Pto en 2D: %2.2f,%2.2f,%2.2f \n",point2D.x,point2D.y,point2D.h);
+	
+	if (backproject(&point3D,point2D,cam)!=-1)
+		printf("Backproject a 3D: %.2f,%.2f,%.2f,%.2f \n",point3D.X, point3D.Y, point3D.Z, point3D.H);
+	else
+		printf("Error in backproject\n");
+			
+	if (project(point3D, &point2D, cam))
+		printf("Project a 2D (de nuevo): %2.2f,%2.2f,%2.2f \n",point2D.x,point2D.y,point2D.h);	
+	else
+		printf("Error in project\n");
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/camera.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/camera.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/camera.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,88 @@
+
+/*  
+ * Copyright (C) 2008 Roberto Calvo Palomino
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *   
+ *   Authors : Roberto Calvo Palomino <rocapal en gsyc.escet.urjc.es>,
+ * 			   Jose María Cañas Plaza <jmplaza en gsyc.es>
+ *
+ */
+ 
+#ifndef CAMERA_H_
+#define CAMERA_H_
+
+/**
+	\class camera
+	\brief This class implement a camera instance  
+	\autor Roberto Calvo <rocapal en gsyc.es>
+	\date  17/05/2008
+**/
+
+#include <gsl/gsl_linalg.h>
+#include <gsl/gsl_multifit.h>
+
+extern "C"
+{
+#include "progeo/progeo.h"
+}
+
+class camera
+{
+	public:
+		/// \brief Constructor
+		camera (char* configFile);
+		
+		/// \brief Destructor
+		~camera();
+		
+		/// \brief Reaf file config and fill the matrix R and K
+		TPinHoleCamera& readConfig();
+		
+		/// \brief Return a progeo camera with configurated matrix
+		TPinHoleCamera& getProgeoCam();
+		
+		/// \brief Do test of cams
+		void test();
+
+	private:
+	
+		/// \brief Update Matrix
+		void updateMatrix();
+		
+		/// \brief 
+		//TPinHoleCamera m_progeoCam;
+		TPinHoleCamera cam;
+		/// \brief name file
+		char* m_nameFile;
+		
+		/// \brief R Matrix
+		gsl_matrix	*m_R; 
+
+		/// \brief aux Matrix
+		gsl_matrix	*m_RES; 
+
+		/// \brief RT Matrix
+		gsl_matrix	*m_RT;
+
+		/// \brief T Matrix
+		gsl_matrix	*m_T;
+
+		/// \brief K Matrix
+		gsl_matrix	*m_K;
+	
+		/// \brief Position vector of cam (x,y,z) 
+		gsl_vector *m_pos;
+};
+#endif /*CAMERA_H_*/

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasLaser.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasLaser.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasLaser.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,189 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#include "canvasLaser.h"
+
+namespace mycomponent {
+
+	class Control;
+	class Gui;
+	
+	    
+        void CanvasLaser::UpdateLaser(Control *control){
+            this->control=control;
+	    //this->gui=gui;
+            
+            
+        }
+
+	CanvasLaser::CanvasLaser(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& builder)
+  		: Gnome::Canvas::CanvasAA(cobject),m_canvasgroup(*(root()), 0, 0)
+	{
+            
+			
+		// create some elements there
+                Gnome::Canvas::Points m_points_green;
+		Gnome::Canvas::Points m_points_black;
+                int i,j;
+                double x1,y1,x2,y2;
+                bool borde=false;
+		this->previous_x=50;
+		this->previous_y=50;
+  		m_points_green.push_back(Gnome::Art::Point(-50, -50));
+  		m_points_green.push_back(Gnome::Art::Point(-50, 150));
+  		m_points_green.push_back(Gnome::Art::Point(-50, -50));
+  		m_points_green.push_back(Gnome::Art::Point(150, -50));
+  		m_points_green.push_back(Gnome::Art::Point(150, 150));
+  		m_points_green.push_back(Gnome::Art::Point(-50, 150));
+		
+		m_points_black.push_back(Gnome::Art::Point(50,-50));
+		m_points_black.push_back(Gnome::Art::Point(50,150));
+		m_points_black.push_back(Gnome::Art::Point(50,50));
+		
+		m_points_black.push_back(Gnome::Art::Point(-50,50));
+		m_points_black.push_back(Gnome::Art::Point(150,50));
+		
+		
+                j=0;
+                for(i=-50;i<=150;i=i+20){
+                            if(borde){
+                                m_points_green.push_back(Gnome::Art::Point(i, -50));
+                                
+                                m_points_green.push_back(Gnome::Art::Point(i, 150));
+                                borde=false;
+                            }else{
+                                m_points_green.push_back(Gnome::Art::Point(i, 150));                        
+                                
+                                m_points_green.push_back(Gnome::Art::Point(i, -50));
+                                borde=true;
+                            }
+                }
+                
+                for(i=-50;i<=150;i=i+20){
+                        
+                            if(borde){
+                                m_points_green.push_back(Gnome::Art::Point(-50, i));
+                                
+                                m_points_green.push_back(Gnome::Art::Point(150, i));
+                                borde=false;
+                            }else{
+                                m_points_green.push_back(Gnome::Art::Point(150, i));                        
+                                
+                                m_points_green.push_back(Gnome::Art::Point(-50, i));
+                                borde=true;
+                            }
+                }
+		        //pthread_mutex_lock(&control->controlGui);
+
+	//printf("%d\n",this->control->laserDataGui->distanceData[90]);
+		        //pthread_mutex_unlock(&control->controlGui);
+
+
+
+  		// we want to use the stream like interface
+  		using namespace Gnome::Canvas;
+                
+  		m_line_green = new Gnome::Canvas::Line(m_canvasgroup, m_points_green);
+  		*m_line_green << Properties::fill_color("gray")
+		  		<< Properties::width_pixels(1);
+				
+		m_line_black = new Gnome::Canvas::Line(m_canvasgroup, m_points_black);
+  		*m_line_black << Properties::fill_color("Black")
+		  		<< Properties::width_pixels(1);
+                                
+                               
+                
+		m_text = new Gnome::Canvas::Ellipse(m_canvasgroup,35, 35,60,60);
+  		*m_text << Properties::fill_color("black");
+ 		
+		//Connecting events
+		m_text->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &CanvasLaser::on_canvas_event),m_text));
+
+                
+
+	}
+
+	CanvasLaser::~CanvasLaser()
+	{
+  		delete m_line_green;
+		delete m_line_black;
+  		delete m_text;
+	}
+
+	bool CanvasLaser::on_canvas_event(GdkEvent * event, Gnome::Canvas::Item * item)
+	{
+		/* Static variables for drag-and-drop */
+  		static gboolean dragging = FALSE;
+  		//static double this->previous_x, this->previous_y;
+ 		double event_x = event->button.x;
+  		double event_y = event->button.y;
+		
+		
+		
+/*
+		switch (event->type)
+  		{
+  			case GDK_BUTTON_PRESS:
+    			if (event->button.button == 1)
+    			{
+      				GdkCursor *cursor;
+
+      				// Store these coordinates for later... 
+      				this->previous_x = event_x;
+      				this->previous_y = event_y;
+      				cursor = gdk_cursor_new(GDK_FLEUR);
+      				item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, event->button.time);
+      				gdk_cursor_destroy(cursor);
+      				dragging = TRUE;
+    			}
+    			break;
+
+  			case GDK_MOTION_NOTIFY:
+    			if (dragging && (event->motion.state & GDK_BUTTON1_MASK))
+    			{
+      				item->move(event_x - this->previous_x,
+        			event_y - this->previous_y);
+
+      				// Remember these for the next pass 
+      				this->previous_x = event_x;
+      				this->previous_y = event_y;
+				this->moved=1;
+
+    			}
+    			break;
+
+  			case GDK_BUTTON_RELEASE:
+    			item->ungrab(event->button.time);
+    			dragging = FALSE;
+    			break;
+
+  			default:
+    			break;
+  		}
+		
+ */		
+
+  		return FALSE;
+	}
+	
+
+
+}//namespace

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasLaser.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasLaser.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasLaser.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,62 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#ifndef MYCOMPONENT_CANVASLASER_H
+#define MYCOMPONENT_CANVASLASER_H
+
+#include <string>
+#include <iostream>
+#include <gtkmm.h>
+#include <libglademm.h>
+#include <IceUtil/Thread.h>
+#include <IceUtil/Time.h>
+#include <jderobot/camera.h>
+#include <colorspaces/colorspacesmm.h>
+#include <libgnomecanvasmm.h>
+#include "control_class.h"
+#include "gui.h"
+
+
+namespace mycomponent {
+	
+	class CanvasLaser : public Gnome::Canvas::CanvasAA 
+		{
+			public:
+                                void UpdateLaser(Control *control);
+				CanvasLaser(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& builder);
+				virtual ~CanvasLaser();
+				double previous_x;
+				double previous_y;
+				Gnome::Canvas::Ellipse *m_text;
+				bool moved;
+                                Control* control;
+			protected:
+				bool on_canvas_event(GdkEvent * event, Gnome::Canvas::Item * item);
+	
+				Gnome::Canvas::Group m_canvasgroup;
+				Gnome::Canvas::Line *m_line_green;
+				Gnome::Canvas::Line *m_line_black;
+		};
+
+
+} // namespace
+
+#endif /*MYCOMPONENT_CANVASLASER_H*/

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateCameras.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateCameras.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateCameras.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,168 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#include "canvasTeleoperateCameras.h"
+
+namespace mycomponent {
+
+	
+
+	CanvasControlCameras::CanvasControlCameras(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& builder)
+  		: Gnome::Canvas::CanvasAA(cobject),m_canvasgroup(*(root()), 0, 0)
+	{ 		
+		// create some elements there
+                Gnome::Canvas::Points m_points_green;
+		Gnome::Canvas::Points m_points_black;
+                int i,j;
+                double x1,y1,x2,y2;
+                bool borde=false;
+		this->previous_x=50;
+		this->previous_y=50;
+  		m_points_green.push_back(Gnome::Art::Point(-50, -50));
+  		m_points_green.push_back(Gnome::Art::Point(-50, 150));
+  		m_points_green.push_back(Gnome::Art::Point(-50, -50));
+  		m_points_green.push_back(Gnome::Art::Point(150, -50));
+  		m_points_green.push_back(Gnome::Art::Point(150, 150));
+  		m_points_green.push_back(Gnome::Art::Point(-50, 150));
+		
+		m_points_black.push_back(Gnome::Art::Point(50,-50));
+		m_points_black.push_back(Gnome::Art::Point(50,150));
+		m_points_black.push_back(Gnome::Art::Point(50,50));
+		
+		m_points_black.push_back(Gnome::Art::Point(-50,50));
+		m_points_black.push_back(Gnome::Art::Point(150,50));
+		
+		
+                j=0;
+                for(i=-50;i<=150;i=i+20){
+                            if(borde){
+                                m_points_green.push_back(Gnome::Art::Point(i, -50));
+                                
+                                m_points_green.push_back(Gnome::Art::Point(i, 150));
+                                borde=false;
+                            }else{
+                                m_points_green.push_back(Gnome::Art::Point(i, 150));                        
+                                
+                                m_points_green.push_back(Gnome::Art::Point(i, -50));
+                                borde=true;
+                            }
+                }
+                
+                for(i=-50;i<=150;i=i+20){
+                        
+                            if(borde){
+                                m_points_green.push_back(Gnome::Art::Point(-50, i));
+                                
+                                m_points_green.push_back(Gnome::Art::Point(150, i));
+                                borde=false;
+                            }else{
+                                m_points_green.push_back(Gnome::Art::Point(150, i));                        
+                                
+                                m_points_green.push_back(Gnome::Art::Point(-50, i));
+                                borde=true;
+                            }
+                }
+
+
+  		// we want to use the stream like interface
+  		using namespace Gnome::Canvas;
+                
+  		m_line_green = new Gnome::Canvas::Line(m_canvasgroup, m_points_green);
+  		*m_line_green << Properties::fill_color("gray")
+		  		<< Properties::width_pixels(1);
+				
+		m_line_black = new Gnome::Canvas::Line(m_canvasgroup, m_points_black);
+  		*m_line_black << Properties::fill_color("Black")
+		  		<< Properties::width_pixels(1);
+                                
+                               
+                
+  		m_text = new Gnome::Canvas::Ellipse(m_canvasgroup,35, 35,60,60);
+  		*m_text << Properties::fill_color("black");
+                
+		m_text->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &CanvasControlCameras::on_canvas_event),m_text));
+
+                
+
+	}
+
+	CanvasControlCameras::~CanvasControlCameras()
+	{
+  		delete m_line_green;
+		delete m_line_black;
+  		delete m_ellipse;
+  		delete m_text;
+	}
+
+	bool CanvasControlCameras::on_canvas_event(GdkEvent * event, Gnome::Canvas::Item * item)
+	{
+		/* Static variables for drag-and-drop */
+  		static gboolean dragging = FALSE;
+  		//static double this->previous_x, this->previous_y;
+  		double event_x = event->button.x;
+  		double event_y = event->button.y;
+		
+
+		switch (event->type)
+  		{
+  			case GDK_BUTTON_PRESS:
+    			if (event->button.button == 1)
+    			{
+      				GdkCursor *cursor;
+
+      				/* Store these coordinates for later... */
+      				this->previous_x = event_x;
+      				this->previous_y = event_y;
+      				cursor = gdk_cursor_new(GDK_FLEUR);
+      				item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, event->button.time);
+      				gdk_cursor_destroy(cursor);
+      				dragging = TRUE;
+    			}
+    			break;
+
+  			case GDK_MOTION_NOTIFY:
+    			if (dragging && (event->motion.state & GDK_BUTTON1_MASK))
+    			{
+      				item->move(event_x - this->previous_x,
+        			event_y - this->previous_y);
+
+      				/* Remember these for the next pass */
+      				this->previous_x = event_x;
+      				this->previous_y = event_y;
+				this->moved=1;
+
+    			}
+    			break;
+
+  			case GDK_BUTTON_RELEASE:
+    			item->ungrab(event->button.time);
+    			dragging = FALSE;
+    			break;
+
+  			default:
+    			break;
+  		}
+		
+		
+
+  		return FALSE;
+	}
+}//namespace

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateCameras.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateCameras.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateCameras.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,59 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#ifndef MYCOMPONENT_CANVASTELEOPERATECAMERAS_H
+#define MYCOMPONENT_CANVASTELEOPERATECAMERAS_H
+
+#include <string>
+#include <iostream>
+#include <gtkmm.h>
+#include <libglademm.h>
+#include <IceUtil/Thread.h>
+#include <IceUtil/Time.h>
+#include <jderobot/camera.h>
+#include <colorspaces/colorspacesmm.h>
+#include <libgnomecanvasmm.h>
+
+
+namespace mycomponent {
+
+	class CanvasControlCameras : public Gnome::Canvas::CanvasAA 
+		{
+			public:
+  				CanvasControlCameras(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& builder);
+  				virtual ~CanvasControlCameras();
+				double previous_x;
+				double previous_y;
+  				Gnome::Canvas::Ellipse *m_text;
+				bool moved;
+			protected:
+  				bool on_canvas_event(GdkEvent * event, Gnome::Canvas::Item * item);
+
+				Gnome::Canvas::Group m_canvasgroup;
+				Gnome::Canvas::Ellipse *m_ellipse;
+ 				Gnome::Canvas::Line *m_line_green;
+				Gnome::Canvas::Line *m_line_black;
+		};
+
+
+} // namespace
+
+#endif /*MYCOMPONENT_CANVASTELEOPERATECAMERAS_H*/

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateControl.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateControl.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateControl.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,171 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#include "canvasTeleoperateControl.h"
+
+namespace mycomponent {
+
+	
+
+	CanvasControl::CanvasControl(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& builder)
+  		: Gnome::Canvas::CanvasAA(cobject),m_canvasgroup(*(root()), 0, 0)
+	{ 		
+		// create some elements there
+                Gnome::Canvas::Points m_points_green;
+		Gnome::Canvas::Points m_points_black;
+                int i,j;
+                double x1,y1,x2,y2;
+                bool borde=false;
+		this->previous_x=50;
+		this->previous_y=50;
+  		m_points_green.push_back(Gnome::Art::Point(-50, -50));
+  		m_points_green.push_back(Gnome::Art::Point(-50, 150));
+  		m_points_green.push_back(Gnome::Art::Point(-50, -50));
+  		m_points_green.push_back(Gnome::Art::Point(150, -50));
+  		m_points_green.push_back(Gnome::Art::Point(150, 150));
+  		m_points_green.push_back(Gnome::Art::Point(-50, 150));
+		
+		m_points_black.push_back(Gnome::Art::Point(50,-50));
+		m_points_black.push_back(Gnome::Art::Point(50,150));
+		m_points_black.push_back(Gnome::Art::Point(50,50));
+		
+		m_points_black.push_back(Gnome::Art::Point(-50,50));
+		m_points_black.push_back(Gnome::Art::Point(150,50));
+		
+		
+                j=0;
+                for(i=-50;i<=150;i=i+20){
+                            if(borde){
+                                m_points_green.push_back(Gnome::Art::Point(i, -50));
+                                
+                                m_points_green.push_back(Gnome::Art::Point(i, 150));
+                                borde=false;
+                            }else{
+                                m_points_green.push_back(Gnome::Art::Point(i, 150));                        
+                                
+                                m_points_green.push_back(Gnome::Art::Point(i, -50));
+                                borde=true;
+                            }
+                }
+                
+                for(i=-50;i<=150;i=i+20){
+                        
+                            if(borde){
+                                m_points_green.push_back(Gnome::Art::Point(-50, i));
+                                
+                                m_points_green.push_back(Gnome::Art::Point(150, i));
+                                borde=false;
+                            }else{
+                                m_points_green.push_back(Gnome::Art::Point(150, i));                        
+                                
+                                m_points_green.push_back(Gnome::Art::Point(-50, i));
+                                borde=true;
+                            }
+                }
+
+
+  		// we want to use the stream like interface
+  		using namespace Gnome::Canvas;
+                
+  		m_line_green = new Gnome::Canvas::Line(m_canvasgroup, m_points_green);
+  		*m_line_green << Properties::fill_color("gray")
+		  		<< Properties::width_pixels(1);
+				
+		m_line_black = new Gnome::Canvas::Line(m_canvasgroup, m_points_black);
+  		*m_line_black << Properties::fill_color("Black")
+		  		<< Properties::width_pixels(1);
+                                
+                               
+                
+		m_text = new Gnome::Canvas::Ellipse(m_canvasgroup,35, 35,60,60);
+  		*m_text << Properties::fill_color("black");
+ 		
+		//Connecting events
+		m_text->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &CanvasControl::on_canvas_event),m_text));
+
+                
+
+	}
+
+	CanvasControl::~CanvasControl()
+	{
+  		delete m_line_green;
+		delete m_line_black;
+  		delete m_text;
+	}
+
+	bool CanvasControl::on_canvas_event(GdkEvent * event, Gnome::Canvas::Item * item)
+	{
+		/* Static variables for drag-and-drop */
+  		static gboolean dragging = FALSE;
+  		//static double this->previous_x, this->previous_y;
+ 		double event_x = event->button.x;
+  		double event_y = event->button.y;
+		
+
+		switch (event->type)
+  		{
+  			case GDK_BUTTON_PRESS:
+    			if (event->button.button == 1)
+    			{
+      				GdkCursor *cursor;
+
+      				/* Store these coordinates for later... */
+      				this->previous_x = event_x;
+      				this->previous_y = event_y;
+      				cursor = gdk_cursor_new(GDK_FLEUR);
+      				item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, event->button.time);
+      				gdk_cursor_destroy(cursor);
+      				dragging = TRUE;
+    			}
+    			break;
+
+  			case GDK_MOTION_NOTIFY:
+    			if (dragging && (event->motion.state & GDK_BUTTON1_MASK))
+    			{
+      				item->move(event_x - this->previous_x,
+        			event_y - this->previous_y);
+
+      				/* Remember these for the next pass */
+      				this->previous_x = event_x;
+      				this->previous_y = event_y;
+				this->moved=1;
+
+    			}
+    			break;
+
+  			case GDK_BUTTON_RELEASE:
+    			item->ungrab(event->button.time);
+    			dragging = FALSE;
+    			break;
+
+  			default:
+    			break;
+  		}
+		
+		
+
+  		return FALSE;
+	}
+	
+
+
+}//namespace

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateControl.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateControl.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvasTeleoperateControl.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,58 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#ifndef MYCOMPONENT_CANVASTELEOPERATECONTROL_H
+#define MYCOMPONENT_CANVASTELEOPERATECONTROL_H
+
+#include <string>
+#include <iostream>
+#include <gtkmm.h>
+#include <libglademm.h>
+#include <IceUtil/Thread.h>
+#include <IceUtil/Time.h>
+#include <jderobot/camera.h>
+#include <colorspaces/colorspacesmm.h>
+#include <libgnomecanvasmm.h>
+
+
+namespace mycomponent {
+
+	class CanvasControl : public Gnome::Canvas::CanvasAA 
+		{
+			public:
+  				CanvasControl(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& builder);
+  				virtual ~CanvasControl();
+				double previous_x;
+				double previous_y;
+  				Gnome::Canvas::Ellipse *m_text;
+				bool moved;
+			protected:
+  				bool on_canvas_event(GdkEvent * event, Gnome::Canvas::Item * item);
+
+				Gnome::Canvas::Group m_canvasgroup;
+				Gnome::Canvas::Line *m_line_green;
+				Gnome::Canvas::Line *m_line_black;
+		};
+
+
+} // namespace
+
+#endif /*MYCOMPONENT_CANVASTELEOPERATECONTROL_H*/

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvas_main.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvas_main.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvas_main.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,350 @@
+#include "canvas_main.h"
+#include <gtkmm.h>
+
+namespace mycomponent {
+
+	
+
+	CanvasWin::CanvasWin(BaseObjectType* cobject, /*BaseObjectType* cobject_menu,*/ const Glib::RefPtr<Gnome::Glade::Xml>& builder)
+  		: Gnome::Canvas::CanvasAA(cobject), /*Gtk::Menu::Menu(cobject_menu),*/ m_canvasgroup(*(root()), 0, 0)/*, m_pMenuPopup*/
+	{ 		
+		// create some elements there
+  		Gnome::Canvas::Points m_points;
+
+  		m_points.push_back(Gnome::Art::Point(0, 0));
+  		m_points.push_back(Gnome::Art::Point(100, 0));
+  		m_points.push_back(Gnome::Art::Point(0, 100));
+  		m_points.push_back(Gnome::Art::Point(100, 100));
+
+  		// we want to use the stream like interface
+  		using namespace Gnome::Canvas;
+
+  		m_line = new Gnome::Canvas::Line(m_canvasgroup, m_points);
+  		*m_line << Properties::fill_color("Green")
+		  		<< Properties::width_pixels(5);
+
+  		m_ellipse = new Gnome::Canvas::Ellipse(m_canvasgroup, 0, 0, 100, 100);
+  		*m_ellipse << Properties::fill_color("red");
+
+  		//m_rect = new Gnome::Canvas::Rect(m_canvasgroup, 10, 10, 50, 100);
+  		//*m_rect << Properties::width_pixels(2)
+  		//        << Properties::fill_color("white");
+
+  		//m_image = new Gnome::Canvas::Image(m_canvasgroup, 0, 0, Gdk_Imlib::Image("example.png"));
+  		//The width and height are set from the information in the image file.
+
+  		m_text = new Gnome::Canvas::Text(m_canvasgroup, 0, 0, "Funciona!!");
+  		*m_text << Properties::font("-Adobe-Helvetica-Medium-R-Normal--*-100-*-*-*-*-*-*")
+          		<< Properties::fill_color("blue"); //Changes the color of the text.
+		
+		//Connecting events
+		m_line->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_canvas_event_transition),m_line));
+		m_ellipse->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_canvas_event_state),m_ellipse));
+		m_text->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_canvas_event_state),m_text));
+		
+				
+		//Menu contextual
+		/*m_pMenuPopup = new Gtk::Menu::Menu();
+		
+		m_refActionGroup = Gtk::ActionGroup::create();
+
+		//File|New sub menu:
+		  //These menu actions would normally already exist for a main menu, because a
+		  //context menu should not normally contain menu items that are only available
+		  //via a context menu.
+		  m_refActionGroup->add(Gtk::Action::create("ContextMenu", "Context Menu"));
+
+		  m_refActionGroup->add(Gtk::Action::create("ContextEdit", "Edit"),
+				  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic_2),m_ellipse));
+
+		  m_refActionGroup->add(Gtk::Action::create("ContextProcess", "Process"),
+				  sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic));
+
+		  m_refActionGroup->add(Gtk::Action::create("ContextRemove", "Remove"),
+				  sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic));
+
+
+		  m_refUIManager = Gtk::UIManager::create();
+		  m_refUIManager->insert_action_group(m_refActionGroup);
+
+
+		  //Layout the actions in a menubar and toolbar:
+		  Glib::ustring ui_info =
+				"<ui>"
+				"  <popup name='PopupMenu'>"
+				"    <menuitem action='ContextEdit'/>"
+				"    <menuitem action='ContextProcess'/>"
+				"    <menuitem action='ContextRemove'/>"
+				"  </popup>"
+				"</ui>";
+
+		  try
+		  {
+			m_refUIManager->add_ui_from_string(ui_info);
+		  }
+		  catch(const Glib::Error& ex)
+		  {
+			std::cerr << "building menus failed: " <<  ex.what();
+		  }
+
+		  //Get the menu:
+		  m_pMenuPopup = dynamic_cast<Gtk::Menu*>(
+				  m_refUIManager->get_widget("/PopupMenu")); 
+		  if(!m_pMenuPopup)
+			g_warning("menu not found");*/
+
+	}
+
+	CanvasWin::~CanvasWin()
+	{
+  		delete m_line;
+  		delete m_ellipse;
+  		//delete m_rect;
+		//delete m_image;
+  		delete m_text;
+
+	}
+
+	bool CanvasWin::on_canvas_event_state(GdkEvent * event, Gnome::Canvas::Item * item)
+	{
+		/* Static variables for drag-and-drop */
+  		static gboolean dragging = FALSE;
+  		static double previous_x, previous_y;
+
+  		double event_x = event->button.x;
+  		double event_y = event->button.y;
+
+		switch (event->type)
+  		{
+  			case GDK_BUTTON_PRESS:
+    			if (event->button.button == 1)
+    			{
+      				GdkCursor *cursor;
+
+      				/* Store these coordinates for later... */
+      				previous_x = event_x;
+      				previous_y = event_y;
+
+      				cursor = gdk_cursor_new(GDK_FLEUR);
+      				item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, event->button.time);
+      				gdk_cursor_destroy(cursor);
+      				dragging = TRUE;
+    			}
+				if (event->button.button == 3)
+    			{
+      				
+					/*********************************************/
+
+					//Menu contextual
+					m_pMenuPopup = new Gtk::Menu::Menu();
+		
+					m_refActionGroup = Gtk::ActionGroup::create();
+
+					//File|New sub menu:
+					  //These menu actions would normally already exist for a main menu, because a
+					  //context menu should not normally contain menu items that are only available
+					  //via a context menu.
+					  m_refActionGroup->add(Gtk::Action::create("ContextMenu", "Context Menu"));
+
+					  m_refActionGroup->add(Gtk::Action::create("ContextEdit", "Editar"),
+							  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic_2),item));
+
+					  m_refActionGroup->add(Gtk::Action::create("ContextProcess", "Codigo"),
+							  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic_2),item));
+
+					  m_refActionGroup->add(Gtk::Action::create("ContextRemove", "Eliminar"),
+							  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic_2),item));
+
+
+					  m_refUIManager = Gtk::UIManager::create();
+					  m_refUIManager->insert_action_group(m_refActionGroup);
+
+
+					  //Layout the actions in a menubar and toolbar:
+					  Glib::ustring ui_info =
+							"<ui>"
+							"  <popup name='PopupMenu'>"
+							"    <menuitem action='ContextEdit'/>"
+							"    <menuitem action='ContextProcess'/>"
+							"    <menuitem action='ContextRemove'/>"
+							"  </popup>"
+							"</ui>";
+
+					  try
+					  {
+						m_refUIManager->add_ui_from_string(ui_info);
+					  }
+					  catch(const Glib::Error& ex)
+					  {
+						std::cerr << "building menus failed: " <<  ex.what();
+					  }
+
+					  //Get the menu:
+					  m_pMenuPopup = dynamic_cast<Gtk::Menu*>(
+							  m_refUIManager->get_widget("/PopupMenu")); 
+					  if(!m_pMenuPopup)
+						g_warning("menu not found");
+
+					/**********************************************/
+
+					if(m_pMenuPopup)
+      					m_pMenuPopup->popup(event->button.button, event->button.time);
+				}
+    			break;
+
+  			case GDK_MOTION_NOTIFY:
+    			if (dragging && (event->motion.state & GDK_BUTTON1_MASK))
+    			{
+      				item->move(event_x - previous_x,
+        			event_y - previous_y);
+
+      				/* Remember these for the next pass */
+      				previous_x = event_x;
+      				previous_y = event_y;
+    			}
+    			break;
+
+  			case GDK_BUTTON_RELEASE:
+    			item->ungrab(event->button.time);
+    			dragging = FALSE;
+    			break;
+
+  			default:
+    			break;
+  		}
+
+  		return FALSE;
+	}
+
+	bool CanvasWin::on_canvas_event_transition(GdkEvent * event, Gnome::Canvas::Item * item)
+	{
+		/* Static variables for drag-and-drop */
+  		static gboolean dragging = FALSE;
+  		static double previous_x, previous_y;
+
+  		double event_x = event->button.x;
+  		double event_y = event->button.y;
+
+		switch (event->type)
+  		{
+  			case GDK_BUTTON_PRESS:
+    			if (event->button.button == 1)
+    			{
+      				GdkCursor *cursor;
+
+      				/* Store these coordinates for later... */
+      				previous_x = event_x;
+      				previous_y = event_y;
+
+      				cursor = gdk_cursor_new(GDK_FLEUR);
+      				item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, event->button.time);
+      				gdk_cursor_destroy(cursor);
+      				dragging = TRUE;
+    			}
+				if (event->button.button == 3)
+    			{
+      				
+					/*********************************************/
+
+					//Menu contextual
+					m_pMenuPopup = new Gtk::Menu::Menu();
+		
+					m_refActionGroup = Gtk::ActionGroup::create();
+
+					//File|New sub menu:
+					  //These menu actions would normally already exist for a main menu, because a
+					  //context menu should not normally contain menu items that are only available
+					  //via a context menu.
+					  m_refActionGroup->add(Gtk::Action::create("ContextMenu", "Context Menu"));
+
+					  m_refActionGroup->add(Gtk::Action::create("ContextEdit", "Editar"),
+							  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic),item));
+
+					  m_refActionGroup->add(Gtk::Action::create("ContextProcess", "Condicional"),
+							  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic),item));
+
+					  m_refActionGroup->add(Gtk::Action::create("ContextRemove", "Eliminar"),
+							  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic),item));
+
+
+					  m_refUIManager = Gtk::UIManager::create();
+					  m_refUIManager->insert_action_group(m_refActionGroup);
+
+
+					  //Layout the actions in a menubar and toolbar:
+					  Glib::ustring ui_info =
+							"<ui>"
+							"  <popup name='PopupMenu'>"
+							"    <menuitem action='ContextEdit'/>"
+							"    <menuitem action='ContextProcess'/>"
+							"    <menuitem action='ContextRemove'/>"
+							"  </popup>"
+							"</ui>";
+
+					  try
+					  {
+						m_refUIManager->add_ui_from_string(ui_info);
+					  }
+					  catch(const Glib::Error& ex)
+					  {
+						std::cerr << "building menus failed: " <<  ex.what();
+					  }
+
+					  //Get the menu:
+					  m_pMenuPopup = dynamic_cast<Gtk::Menu*>(
+							  m_refUIManager->get_widget("/PopupMenu")); 
+					  if(!m_pMenuPopup)
+						g_warning("menu not found");
+
+					/**********************************************/
+
+					if(m_pMenuPopup)
+      					m_pMenuPopup->popup(event->button.button, event->button.time);
+				}
+    			break;
+
+  			case GDK_MOTION_NOTIFY:
+    			if (dragging && (event->motion.state & GDK_BUTTON1_MASK))
+    			{
+      				item->move(event_x - previous_x,
+        			event_y - previous_y);
+
+      				/* Remember these for the next pass */
+      				previous_x = event_x;
+      				previous_y = event_y;
+    			}
+    			break;
+
+  			case GDK_BUTTON_RELEASE:
+    			item->ungrab(event->button.time);
+    			dragging = FALSE;
+    			break;
+
+  			default:
+    			break;
+  		}
+
+  		return FALSE;
+	}
+
+
+	void CanvasWin::on_menu_file_popup_generic(Gnome::Canvas::Item * item)
+	{
+    	std::cout << "Opcion de transicion seleccionada." << std::endl;
+	}
+
+	void CanvasWin::on_menu_file_popup_generic_2(Gnome::Canvas::Item * item)
+	{
+    	std::cout << "Opcion de estado seleccionada." << std::endl;
+	}
+
+	/*CanvasLaserWin::CanvasLaserWin()
+	{
+  		set_title ("ventana canvas laser");
+  		add(laser_canvas);
+
+  		show_all();
+	}
+	/*-----FIN CANVAS LASER------*/
+
+}//namespace

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvas_main.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvas_main.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/canvas_main.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,70 @@
+#ifndef INTROROB_CANVASLASERWIN_H
+#define INTROROB_CANVASLASERWIN_H
+
+#include <string>
+#include <iostream>
+#include <gtkmm.h>
+#include <libglademm.h>
+#include <IceUtil/Thread.h>
+#include <IceUtil/Time.h>
+#include <jderobot/camera.h>
+#include <colorspaces/colorspacesmm.h>
+//#include "controller.h"
+//#include "drawarea.h"
+//#include "navegacion.h"
+#include <libgnomecanvasmm.h>
+//#include "menudesplegable.h"
+
+
+namespace mycomponent {
+
+	//class Navega;
+	//class MenuDesp;
+
+	class CanvasWin : public Gnome::Canvas::CanvasAA//, public Gtk::Menu::Menu
+		{
+			public:
+  				CanvasWin(BaseObjectType* cobject,/* BaseObjectType* cobject_menu,*/ const Glib::RefPtr<Gnome::Glade::Xml>& builder);
+  				virtual ~CanvasWin();
+
+				Gtk::Menu* m_pMenuPopup;
+
+			protected:
+  				bool on_canvas_event_state(GdkEvent * event, Gnome::Canvas::Item * item);
+				bool on_canvas_event_transition(GdkEvent * event, Gnome::Canvas::Item * item);
+
+				Gnome::Canvas::Group m_canvasgroup;
+				Gnome::Canvas::Ellipse *m_ellipse;
+  				//Gnome::Canvas::Rect *m_rect;
+  				//  Gnome::Canvas::Image *m_image;
+  				Gnome::Canvas::Text *m_text;
+				Gnome::Canvas::Line *m_line;
+
+				  void on_menu_file_popup_generic(Gnome::Canvas::Item * item);
+				  void on_menu_file_popup_generic_2(Gnome::Canvas::Item * item);
+
+				  //Child widgets:
+				  //Gtk::VBox m_Box;
+				  //Gtk::EventBox m_EventBox;
+				  //Gtk::Label m_Label;
+
+				  Glib::RefPtr<Gtk::UIManager> m_refUIManager;
+				  Glib::RefPtr<Gtk::ActionGroup> m_refActionGroup;
+
+				  
+
+		};
+
+	/*class CanvasLaserWin : public Gtk::Window
+		{
+			public:
+  				CanvasLaserWin();
+	
+			protected:
+  				//Member widgets:
+  				CanvasLaser laser_canvas;
+		};*/
+
+} // namespace
+
+#endif /*INTROROB_CANVASLASERWIN_H*/

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/control_class.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/control_class.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/control_class.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,653 @@
+/*
+ *
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see http://www.gnu.org/licenses/. 
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+
+
+#include "control_class.h"
+#include "gui.h"
+
+mycomponent::Control *control;
+
+//int accion;
+//int sentido;
+
+typedef enum Estados_1 {
+		avanzando,
+		parando,
+		marcha_atras,
+		girando
+}Estados_1;
+
+typedef enum Estados_2 {
+		A,
+		A_ghost,
+		B,
+		B_ghost,
+		C,
+		C_ghost
+}Estados_2;
+
+typedef enum Estados_3 {
+		X,
+		X_ghost,
+		Y,
+		Y_ghost,
+		Z,
+		Z_ghost
+}Estados_3;
+
+//Estructura para pasar argumentos a los hilos de control
+typedef struct
+{
+  int cycle;
+  int th_id;
+} th_data; 
+
+
+//Variables para los automatas
+
+int giro = (1 + rand() % 40);
+int seg_giro = (1 + rand() % 10);
+int variable_temp_prueba = 0;
+
+Estados_1 padre=avanzando;
+Estados_2 hijo=A_ghost;
+Estados_3 nieto=X_ghost;
+
+
+namespace mycomponent{
+   
+   /*
+    ITERATION Control -> Here we can put a code to navegation.
+    The laser class contains 2 attributes: distanceData(an array with the distance for all their angles (0-180º)) and numLaser (the number of angles -> 180)
+    The laser interface only contains 1 method: getLaserData (returns a LaserData object with the 2 attributes updated by gazeboserver)
+    mprx is the motors interface and contains 6 methods: set/getV, set/getW, set/getL
+    The encoders class contains 5 attributes: robotx, roboty, robottheta, robotcos, robotsin (contains the robot coordinates) 
+    The encoders interface contains 1 method: getEncodersData (returns a EncodersData object with the 5 attributes updated by gazeboserver)
+   */
+   
+   void Control::iterationControl(int th_id){
+      float v, w, l;    
+   
+      switch(th_id){
+              
+              case 1:	
+				{	
+                    printf("HILO 1\n");
+
+                  break;
+				}
+
+              case 2:
+				{     
+					if(padre==girando)               
+						printf("HILO 2\n");
+
+                  break;
+				}
+
+              case 3:		
+				{
+					if(padre==girando && hijo==A)
+	                   printf("HILO 3\n");
+
+                 break;
+				}
+
+		}//Switch seleccion de hilo
+            
+   }//Iteration control
+
+   // HANDLECAMERAS -> In this function is processed the cameras data that will send to the GUI or they will be used to depurate
+   void Control::handleCameras(){
+   
+   
+      this->data1 = cprx1->getImageData();
+      colorspaces::Image::FormatPtr fmt1 = colorspaces::Image::Format::searchFormat(this->data1->description->format);
+      if (!fmt1)
+         throw "Format not supported";
+      
+      this->image1 = new colorspaces::Image (this->data1->description->width, this->data1->description->height, fmt1, &(this->data1->pixelData[0])); // Prepare the image to use with openCV
+      
+      this->data2 = cprx2->getImageData();
+      colorspaces::Image::FormatPtr fmt2 = colorspaces::Image::Format::searchFormat(this->data2->description->format);
+      if (!fmt2)
+         throw "Format not supported";
+      
+      this->image2 = new colorspaces::Image (this->data2->description->width, this->data2->description->height, fmt2, &(this->data2->pixelData[0])); // Prepare the image to use with openCV
+   
+   
+   }
+
+   void Control::resetControl(){
+      
+      this->mprx->setV(0);
+      this->mprx->setW(0);
+      this->mprx->setL(0);
+      
+   }
+   
+      Control::~Control() {}    
+}
+   
+
+void *showGui(void*){
+   mycomponent::Gui *gui;
+   struct timeval a, b;
+   int cycle = 100;
+   long totalb,totala;
+   long diff;
+
+   gui = new mycomponent::Gui(control);
+
+   while(true){
+      gettimeofday(&a,NULL);
+      totala=a.tv_sec*1000000+a.tv_usec;
+      
+      //Controll->update();
+      control->handleCameras();
+      gui->display(*control->image1,*control->image2);
+      
+      
+      gettimeofday(&b,NULL);
+      totalb=b.tv_sec*1000000+b.tv_usec;
+      //std::cout << "Introrob takes " << (totalb-totala)/1000 << " ms" << std::endl;
+      
+      diff = (totalb-totala)/1000;
+      if(diff < 0 || diff > cycle)
+         diff = cycle;
+      else
+         diff = cycle-diff;
+      
+      //Sleep Algorithm
+      usleep(diff*1000);
+      if(diff < 33)
+         usleep(33*1000);
+   }
+}
+
+
+void *motor_th1(void* data){
+	//mycomponent::Control *ctrl;
+   struct timeval a, b;
+	th_data *datos;
+   int* cycle;
+   int* th_id;
+   long totalb,totala;
+   long diff;
+
+	float v;
+
+   //ctrl = new mycomponent::Control();
+	datos = (th_data*)data;
+	cycle = &datos->cycle;
+	th_id = &datos->th_id;
+
+	printf("Entro hilo 1 \n");
+
+
+	//El siguiente while hace las veces de iterationControl, agrupa comportamiento y motor temporal
+   while(true){
+      gettimeofday(&a,NULL);
+      totala=a.tv_sec*1000000+a.tv_usec;
+      
+      //Controll->update();
+      
+      //ctrl->iterationControl(*th_id);
+
+      //printf("Ciclo del hilo %d: %d\n",*th_id,*cycle);
+
+	//AUTOMATA 1*********************************************************
+		//Switch de evaluación de transiciones
+		switch (padre){
+			case avanzando:
+			{
+				printf("Antes de pedir el laser\n");
+				control->ld=control->lprx->getLaserData();
+				printf("Despues de pedir el laser\n");
+				if (control->ld->distanceData[45] <= 1000.0){
+					padre = parando;
+				}
+				break;
+			}
+			case parando:
+			{
+				v=control->mprx->getV();
+				if (v <= 0.1){
+					padre = marcha_atras;
+				}
+				break;
+			}
+			case marcha_atras:
+			{
+				control->ld=control->lprx->getLaserData(); // Get the laser info
+				if (control->ld->distanceData[45] > 1300.0){
+					padre = girando;
+				}
+				break;
+			}
+			case girando:
+			{
+				if (variable_temp_prueba >= seg_giro){
+					padre = avanzando;
+					giro = (1 + rand() % 40);
+					seg_giro = (1 + rand() % 10);
+					variable_temp_prueba = 0;
+				}
+				break;
+			}
+		}
+		  
+   		//Switch de actuación
+		switch (padre){
+			case avanzando:
+			{
+				//Percepcion para actuar si es necesario
+				control->mprx->setW(0.);
+				control->mprx->setV(60.);
+				break;
+			}
+			case parando:
+			{
+				//Percepcion para actuar si es necesario
+				control->mprx->setV(0.);
+				break;
+			}
+			case marcha_atras:
+			{
+				//Percepcion para actuar si es necesario
+				control->mprx->setV(-30.);
+				break;
+			}
+			case girando:
+			{
+				//Percepcion para actuar si es necesario
+				control->mprx->setW(giro);
+				variable_temp_prueba++;
+				usleep(1000000);
+				break;
+			}
+		}
+
+	//Motor temporal del hilo
+
+      gettimeofday(&b,NULL);
+      totalb=b.tv_sec*1000000+b.tv_usec;
+      //std::cout << "Introrob takes " << (totalb-totala)/1000 << " ms" << std::endl;
+      
+      diff = (totalb-totala)/1000;
+      if(diff < 0 || diff > *cycle)
+         diff = *cycle;
+      else
+         diff = *cycle-diff;
+      
+      //Sleep Algorithm
+      usleep(diff*1000);
+      if(diff < 33)
+         usleep(33*1000);
+   }
+}
+
+
+void *motor_th2(void* data){
+	mycomponent::Control *ctrl;
+   struct timeval a, b;
+	th_data *datos;
+   int* cycle;
+   int* th_id;
+   long totalb,totala;
+   long diff;
+
+   ctrl = new mycomponent::Control();
+	datos = (th_data*)data;
+	cycle = &datos->cycle;
+	th_id = &datos->th_id;
+
+	printf("Entro hilo 2 \n");
+
+   while(true){
+      gettimeofday(&a,NULL);
+      totala=a.tv_sec*1000000+a.tv_usec;
+      
+      //Controll->update();
+      
+      //ctrl->iterationControl(*th_id);
+
+      //printf("Ciclo del hilo %d: %d\n",*th_id,*cycle);
+
+	//AUTOMATA 2*********************************************************
+
+		if(padre==girando){
+			if(hijo==A_ghost || hijo==B_ghost || hijo==C_ghost){
+				hijo=(Estados_2)(hijo-1);
+			}
+			printf("HILO 2\n");
+		}else{
+			if(hijo==A || hijo==B || hijo==C){
+				hijo=(Estados_2)(hijo+1);
+			}
+		}
+
+      gettimeofday(&b,NULL);
+      totalb=b.tv_sec*1000000+b.tv_usec;
+      //std::cout << "Introrob takes " << (totalb-totala)/1000 << " ms" << std::endl;
+      
+      diff = (totalb-totala)/1000;
+      if(diff < 0 || diff > *cycle)
+         diff = *cycle;
+      else
+         diff = *cycle-diff;
+      
+      //Sleep Algorithm
+      usleep(diff*1000);
+      if(diff < 33)
+         usleep(33*1000);
+   }
+}
+
+
+void *motor_th3(void* data){
+	mycomponent::Control *ctrl;
+   struct timeval a, b;
+	th_data *datos;
+   int* cycle;
+   int* th_id;
+   long totalb,totala;
+   long diff;
+
+   ctrl = new mycomponent::Control();
+	datos = (th_data*)data;
+	cycle = &datos->cycle;
+	th_id = &datos->th_id;
+
+	printf("Entro hilo 3 \n");
+
+   while(true){
+      gettimeofday(&a,NULL);
+      totala=a.tv_sec*1000000+a.tv_usec;
+      
+      //Controll->update();
+      
+      //ctrl->iterationControl(*th_id);
+
+      //printf("Ciclo del hilo %d: %d\n",*th_id,*cycle);
+
+	//AUTOMATA 3*********************************************************
+
+		if(hijo==A){
+			if(nieto==X_ghost || nieto==Y_ghost || nieto==Z_ghost){
+				nieto=(Estados_3)(nieto-1);
+			}
+			printf("HILO 3\n");
+		}else{
+			if(nieto==X || nieto==Y || nieto==Z){
+				nieto=(Estados_3)(nieto+1);
+			}
+		}
+
+      gettimeofday(&b,NULL);
+      totalb=b.tv_sec*1000000+b.tv_usec;
+      //std::cout << "Introrob takes " << (totalb-totala)/1000 << " ms" << std::endl;
+      
+      diff = (totalb-totala)/1000;
+      if(diff < 0 || diff > *cycle)
+         diff = *cycle;
+      else
+         diff = *cycle-diff;
+      
+      //Sleep Algorithm
+      usleep(diff*1000);
+      if(diff < 33)
+         usleep(33*1000);
+   }
+}
+
+
+int main(int argc, char** argv){
+
+   int accion=0;
+   int sentido=10;
+
+   int status;
+   Ice::CommunicatorPtr ic;
+   struct timeval a, b;
+   int cycle = 300;
+   long totalb,totala;
+   long diff;
+   bool guiActivated=0;
+   bool controlActivated=0;
+
+
+	th_data data_1;
+	th_data data_2;
+	th_data data_3;
+   
+   control = new mycomponent::Control();
+
+   pthread_mutex_init(&control->controlGui, NULL);//OBJETIVO2
+   
+   //---------------- INPUT ARGUMENTS ---------------//
+
+   if (argc!=3){
+      printf("\n");
+      printf("USE: ./mycomponent --Ice.Config=mycomponent.cfg OPTION\n");      
+      printf("    -G to show the GUI\n");
+      printf("    -C to run IterationControl\n");
+      printf("    -GC IterationControl & GUI\n");
+   }
+
+   if((argc==3)&&(!strcmp(argv[2],"-G"))){
+      guiActivated=1;
+      controlActivated=0;
+   }
+
+   if((argc==3)&&(!strcmp(argv[2],"-GC"))){
+      controlActivated=1;
+      guiActivated=1;
+   }
+   
+   if((argc==3)&&(!strcmp(argv[2],"-C"))){
+      controlActivated=1;
+      guiActivated=0;
+   }
+      
+   
+   
+   if(guiActivated){
+      pthread_create(&control->thr_gui, NULL, &showGui, NULL);//OBJETIVo2  
+   }
+
+   
+   //---------------- INPUT ARGUMENTS -----------------//
+  
+   try{
+      
+                  //-----------------ICE----------------//
+      ic = Ice::initialize(argc,argv);
+      
+      // Contact to MOTORS interface
+      Ice::ObjectPrx baseMotors = ic->propertyToProxy("Mycomponent.Motors.Proxy");
+      if (0==baseMotors)
+        throw "Could not create proxy with motors";
+      // Cast to motors
+      control->mprx = jderobot::MotorsPrx::checkedCast(baseMotors);
+      if (0== control->mprx)
+         throw "Invalid proxy Mycomponent.Motors.Proxy";
+      
+      // Get driver camera
+      Ice::ObjectPrx camara1 = ic->propertyToProxy("Mycomponent.Camera1.Proxy");
+      if (0==camara1)
+         throw "Could not create proxy to camera1 server";
+      
+      // cast to CameraPrx
+      control->cprx1 = jderobot::CameraPrx::checkedCast(camara1);
+      if (0== control->cprx1)
+         throw "Invalid proxy";
+      
+      // Get driver camera
+      Ice::ObjectPrx camara2 = ic->propertyToProxy("Mycomponent.Camera2.Proxy");
+      if (0==camara2)
+         throw "Could not create proxy to camera2 server";
+      
+      // cast to CameraPrx
+      control->cprx2 = jderobot::CameraPrx::checkedCast(camara2);
+      if (0== control->cprx2)
+         throw "Invalid proxy";
+      
+      // Contact to ENCODERS interface
+      Ice::ObjectPrx baseEncoders = ic->propertyToProxy("Mycomponent.Encoders.Proxy");
+      if (0==baseEncoders)
+         throw "Could not create proxy with encoders";
+      
+      // Cast to encoders
+      control->eprx = jderobot::EncodersPrx::checkedCast(baseEncoders);
+      if (0== control->eprx)
+         throw "Invalid proxy Mycomponent.Encoders.Proxy";
+      
+      // Contact to LASER interface
+      Ice::ObjectPrx baseLaser = ic->propertyToProxy("Mycomponent.Laser.Proxy");
+      if (0==baseLaser)
+         throw "Could not create proxy with laser";
+      
+      // Cast to laser
+      control->lprx = jderobot::LaserPrx::checkedCast(baseLaser);
+      if (0== control->lprx)
+         throw "Invalid proxy Mycomponent.Laser.Proxy";
+      
+      // Contact to PTMOTORS interface
+      Ice::ObjectPrx ptmotors1 = ic->propertyToProxy("Mycomponent.PTMotors1.Proxy");
+      if (0==ptmotors1)
+         throw "Could not create proxy with motors";
+      
+      // Cast to ptmotors
+      control->ptmprx1 = jderobot::PTMotorsPrx::checkedCast(ptmotors1);
+      if (0== control->ptmprx1)
+         throw "Invalid proxy Mycomponent.PTMotors1.Proxy";
+      
+      // Contact to PTMOTORS interface
+      Ice::ObjectPrx ptmotors2 = ic->propertyToProxy("Mycomponent.PTMotors2.Proxy");
+      if (0==ptmotors2)
+         throw "Could not create proxy with motors";
+      
+      // Cast to ptmotors
+      control->ptmprx2 = jderobot::PTMotorsPrx::checkedCast(ptmotors2);
+      if (0== control->ptmprx2)
+         throw "Invalid proxy Mycomponent.PTMotors2.Proxy";
+      
+      // Contact to PTENCODERS interface
+      Ice::ObjectPrx ptencoders1 = ic->propertyToProxy("Mycomponent.PTEncoders1.Proxy");
+      if (0==ptencoders1)
+         throw "Could not create proxy with encoders";
+      
+      // Cast to encoders
+      control->pteprx1 = jderobot::PTEncodersPrx::checkedCast(ptencoders1);
+      if (0== control->pteprx1)
+         throw "Invalid proxy Mycomponent.PTEncoders1.Proxy";
+      
+      // Contact to PTENCODERS interface
+      Ice::ObjectPrx ptencoders2 = ic->propertyToProxy("Mycomponent.PTEncoders2.Proxy");
+      if (0==ptencoders2)
+         throw "Could not create proxy with encoders";
+      
+      // Cast to encoders
+      control->pteprx2 = jderobot::PTEncodersPrx::checkedCast(ptencoders2);
+      if (0== control->pteprx2)
+         throw "Invalid proxy Mycomponent.PTEncoders2.Proxy";
+      
+                  //-----------------ICE----------------//
+      
+      //****************************** Processing the Control ******************************///
+      
+
+                  //---------------- ITERATIONS CONTROL -----------//
+
+	//Inicializacion de datos para los distintos hilos de control y creacion de hilos
+	if(controlActivated){
+		data_1.cycle = 300;
+		data_1.th_id = 1;
+
+		data_2.cycle = 200;
+		data_2.th_id = 2;
+
+		data_3.cycle = 1000;
+		data_3.th_id = 3;
+
+		pthread_create(&control->thr_control_1, NULL, &motor_th1, &data_1);
+		pthread_create(&control->thr_control_2, NULL, &motor_th2, &data_2);
+		pthread_create(&control->thr_control_3, NULL, &motor_th3, &data_3);
+		//while(true){
+		//}
+ 	}
+    /*  if(controlActivated){     
+         while(true){
+
+			//printf("por poner algo\n");
+            control->iterationControl(1);
+
+            gettimeofday(&a,NULL);
+            totala=a.tv_sec*1000000+a.tv_usec;
+            gettimeofday(&b,NULL);
+            totalb=b.tv_sec*1000000+b.tv_usec;
+            //std::cout << "Introrob takes " << (totalb-totala)/1000 << " ms" << std::endl;
+            
+            diff = (totalb-totala)/1000;
+            if(diff < 0 || diff > cycle)
+               diff = cycle;
+            else
+               diff = cycle-diff;
+            
+            //Sleep Algorithm
+            usleep(diff*1000);
+            if(diff < 33)
+               usleep(33*1000);
+         }
+      }*/
+
+            //--------------ITERATIONS CONTROL-------------//
+   		if(guiActivated)   
+     	   pthread_join(control->thr_gui, NULL);
+
+		if(controlActivated){
+			pthread_join(control->thr_control_1, NULL);
+			pthread_join(control->thr_control_2, NULL);
+			pthread_join(control->thr_control_3, NULL);
+		}
+      
+
+      
+   }
+   catch (const Ice::Exception& ex) {
+      std::cerr << ex << std::endl;
+      status = 1;
+   } 
+   catch (const char* msg) {
+      std::cerr << msg << std::endl;
+      status = 1;
+   }
+   
+   
+   if (ic)
+   ic->destroy();
+   
+   
+   
+   return 0;
+}

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/control_class.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/control_class.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/control_class.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,83 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>,
+ *
+ */
+
+
+#ifndef MYCOMPONENT_CONTROL_H
+#define MYCOMPONENT_CONTROL_H
+
+
+#include <iostream>
+#include <Ice/Ice.h>
+#include <IceUtil/IceUtil.h>
+#include <jderobot/camera.h>
+#include <jderobot/motors.h>
+#include <jderobot/ptmotors.h>
+#include <jderobot/laser.h>
+#include <jderobot/encoders.h>
+#include <jderobot/ptencoders.h>
+#include <colorspaces/colorspacesmm.h>
+#include <pthread.h> //OBJETIVO2
+
+namespace mycomponent {
+    class Gui;
+    class Control {
+	public:
+	    //Control (int argc, char** argv);
+	virtual ~Control();
+	
+	    //FUNCTIONS
+	    void iterationControl(int th_id);
+	    void handleCameras();
+	    void resetControl();
+	    
+	    //HANDLE THREADS
+	    pthread_t thr_gui;//OBJETIVO2
+		pthread_t thr_control_1;
+		pthread_t thr_control_2;//Hilos jerarquicos
+		pthread_t thr_control_3;
+	    pthread_mutex_t controlGui;//OBJETIVO2
+
+	
+	    // INTERFACES DATA
+	    jderobot::EncodersDataPtr ed;
+	    jderobot::LaserDataPtr ld;
+	    jderobot::ImageDataPtr data1; // Contains the image info
+	    jderobot::ImageDataPtr data2; // Contains the image info
+	    jderobot::PTEncodersDataPtr pted1;
+	    jderobot::PTEncodersDataPtr pted2;
+    
+	    // INTERFACES
+	    jderobot::MotorsPrx mprx;
+	    jderobot::EncodersPrx eprx;
+	    jderobot::LaserPrx lprx;
+	    jderobot::CameraPrx cprx1;
+	    jderobot::CameraPrx cprx2;
+	    jderobot::PTMotorsPrx ptmprx1;
+	    jderobot::PTEncodersPrx pteprx1;
+	    jderobot::PTMotorsPrx ptmprx2;
+	    jderobot::PTEncodersPrx pteprx2;
+       
+	    colorspaces::Image* image1;	// Prepare the image to use with openCV
+	    colorspaces::Image* image2;
+     
+    };//class
+} // namespace
+#endif /*MYCOMPONENT_Control_H*/

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/gui.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/gui.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/gui.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,200 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#include "gui.h"
+
+namespace mycomponent {
+    Gui::Gui (Control* control): gtkmain(0,0) {
+        
+        this->yourCode_button_isPressed=false;
+	this->control=control;
+        this->showCanvasWin = false; 
+	    /*Init OpenGL*/
+	if(!Gtk::GL::init_check(NULL, NULL))	{
+	    std::cerr << "Couldn't initialize GL\n";
+	    std::exit(1);
+	}
+        Gnome::Canvas::init(); 
+
+	std::cout << "Loading glade\n";
+	this->gladepath=std::string("./mycomponent.glade");
+	refXml = Gnome::Glade::Xml::create("./mycomponent.glade");
+
+	//Get widgets
+        
+        refXml->get_widget("secondarywindow", secondarywindow);
+
+
+        // Button, area and window canvas teleoperate robot
+       	refXml->get_widget("windowTeleoperate", windowTeleoperate);
+        refXml->get_widget("stop_button", stop_button); //canvas
+       	refXml->get_widget_derived("canvas_control", this->canvas_control); //canvas
+        canvas_control->moved=1;
+
+        // Button, area and window canvas teleoperate cameras
+       	refXml->get_widget_derived("canvas_control_cameras", this->canvas_control_cameras); //canvas
+        
+
+
+	refXml->get_widget("yourCodeButton", yourCodeButton);
+	refXml->get_widget("stopCodeButton", stopCodeButton);
+	refXml->get_widget("exitButton", exitButton);
+
+	// Camera images
+	refXml->get_widget("image1",gtk_image1);
+	refXml->get_widget("image2",gtk_image2);
+
+
+	yourCodeButton->signal_clicked().connect(sigc::mem_fun(this,&Gui::yourCodeButton_clicked));
+	stopCodeButton->signal_clicked().connect(sigc::mem_fun(this,&Gui::stopCodeButton_clicked));
+	exitButton->signal_clicked().connect(sigc::mem_fun(this,&Gui::exitButton_clicked));
+        stop_button->signal_clicked().connect(sigc::mem_fun(this,&Gui::stop_button_clicked));
+
+	stopCodeButton->hide();
+        windowTeleoperate->show();
+        secondarywindow->show();
+        
+        camera *mycameraA = new camera("cameras/calibA");
+        myCamA= mycameraA->readConfig();
+        camera *mycameraB = new camera("cameras/calibB");
+	myCamB= mycameraB->readConfig();
+
+    }
+
+	Gui::~Gui() {
+/*	 
+		delete this->controller;
+		delete this->world;
+*/	
+	}
+
+
+
+    void Gui::display(const colorspaces::Image& image1, const colorspaces::Image& image2) {
+
+	setCamara(image1, 1);
+	setCamara(image2, 2);
+        
+        if(!(this->yourCode_button_isPressed))
+            this->teleOperate();
+        //else
+            //control->iterationControl(1);
+
+            
+        this->teleOperateCameras();
+	while (gtkmain.events_pending())
+	    gtkmain.iteration();
+    }
+    
+    void Gui::teleOperate(){
+        double k=-0.01;
+        double p=0.5;
+        double v,w,v_normalized,w_normalized;
+        
+        
+        w=canvas_control->previous_x;
+        v=canvas_control->previous_y;
+        
+        v_normalized=400*(k*v+p);
+        w_normalized=20*(k*w+p);
+        this->control->mprx->setV(v_normalized);
+        this->control->mprx->setW(w_normalized);
+    }
+    
+        void Gui::teleOperateCameras(){
+        double k=-0.01;
+        double p=0.5;
+        double v,w,v_normalized,w_normalized;
+        jderobot::PTMotorsData* myData;
+        jderobot::PTMotorsData* myData2;
+      
+        
+        w=canvas_control_cameras->previous_x;
+        v=canvas_control_cameras->previous_y;
+        v_normalized=28*(k*v+p);
+        w_normalized=-45*(k*w+p);
+        myData = new jderobot::PTMotorsData ();
+        myData2 = new jderobot::PTMotorsData ();
+        myData->latitude = v_normalized;
+        myData->longitude = w_normalized;
+        myData2->latitude = v_normalized;
+        myData2->longitude = w_normalized;
+        this->control->ptmprx1->setPTMotorsData (myData);
+        this->control->ptmprx2->setPTMotorsData (myData2);
+}
+
+    void Gui::setCamara (const colorspaces::Image& image, int id) {
+	    // Set image
+	    IplImage src; // conversión a IplImage
+	    src = image;
+
+	    colorspaces::ImageRGB8 img_rgb888(image); // conversion will happen if needed
+
+	    Glib::RefPtr<Gdk::Pixbuf> imgBuff = Gdk::Pixbuf::create_from_data((const guint8*)img_rgb888.data,
+				Gdk::COLORSPACE_RGB,
+				false,
+				8,
+				img_rgb888.width,
+				img_rgb888.height,
+				img_rgb888.step);
+
+	    if (id == 1) {
+	      gtk_image1->clear();
+	      gtk_image1->set(imgBuff);
+	    } else {
+	      gtk_image2->clear();
+	      gtk_image2->set(imgBuff);
+	    }
+    }
+
+    bool Gui::isVisible() {
+	return windowTeleoperate->is_visible();
+    }
+    void Gui::yourCodeButton_clicked() {
+	    yourCodeButton->hide();
+	    stopCodeButton->show();
+            yourCode_button_isPressed=true;
+    }
+
+    void Gui::stopCodeButton_clicked() {
+            control->resetControl();
+	    yourCodeButton->show();
+	    stopCodeButton->hide();
+                        yourCode_button_isPressed=false;
+
+            
+    }
+
+    void Gui::exitButton_clicked() {
+	    windowTeleoperate->hide();
+	    exit (0);
+    }
+    void Gui::stop_button_clicked(){
+        if(canvas_control->moved)
+            this->canvas_control->m_text->move(50-canvas_control->previous_x,50-canvas_control->previous_y);
+        canvas_control->moved=0;
+        this->control->mprx->setV(0);
+        this->control->mprx->setW(0);
+        canvas_control->previous_x=50;
+        canvas_control->previous_y=50;
+        yourCode_button_isPressed=false;
+    }
+} // namespace

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/gui.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/gui.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/gui.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,104 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#ifndef MYCOMPONENT_GUI_H
+#define MYCOMPONENT_GUI_H
+
+#include <cv.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include <GL/glut.h>
+#include <string>
+#include <iostream>
+#include <gtkmm.h>
+#include <gtkglmm.h>
+#include <gdkglmm.h>
+#include <libglademm.h>
+#include <IceUtil/Thread.h>
+#include <IceUtil/Time.h>
+#include <jderobot/camera.h>
+#include <pthread.h>
+#include <colorspaces/colorspacesmm.h>
+#include "control_class.h"
+#include "camera.h"
+#include <libgnomecanvasmm.h> 
+#include "canvasTeleoperateControl.h" 
+#include "canvasTeleoperateCameras.h"
+
+namespace mycomponent {
+    class CanvasWin; 
+    class CanvasControl;
+    class CanvasControlCameras;
+    class Control;
+    class Gui {
+      
+	public:
+	  
+	    Gui(Control *control);	
+	    virtual ~Gui();
+	    
+	    bool isVisible();
+	    void display(const colorspaces::Image& image1, const colorspaces::Image& image2);
+	    CanvasControl* canvas_control;
+	    CanvasControlCameras* canvas_control_cameras;
+ 	    
+	private:
+	  //Private Attributes
+	    
+	    TPinHoleCamera myCamA, myCamB;	    
+	    std::string gladepath; 
+	    
+	    // Canvas
+	    bool showCanvasWin; 
+	    Gtk::CheckButton * canvas_button; 
+	    Gtk::Window * canvaswindow; 
+	    Gtk::Window * windowTeleoperate; 
+	    Gtk::Button *stop_button; 
+	    bool press_stop_button;
+		    
+	    Glib::RefPtr<Gnome::Glade::Xml> refXml;
+	    Gtk::Main gtkmain;
+
+	    Gtk::Window *secondarywindow;
+	    Gtk::Button *yourCodeButton;
+	    Gtk::Button *stopCodeButton;
+	    Gtk::Button *exitButton;
+	    Gtk::Image *gtk_image1;
+	    Gtk::Image *gtk_image2;
+    	    Control* control;
+
+	    bool yourCode_button_isPressed;
+
+	  // Private Methods
+	    void initCameras();
+	    void setCamara (const colorspaces::Image& image, int id);
+	    void yourCodeButton_clicked();
+	    void stopCodeButton_clicked();
+	    void exitButton_clicked();
+	    void teleOperate();
+	    void teleOperateCameras();
+	    void canvas_button_toggled(); 
+	    void stop_button_clicked();
+
+	    
+    };//class
+}//namespace
+#endif //MYCOMPONENT_GUI_H
\ No newline at end of file

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/mycomponent
===================================================================
(Binary files differ)


Property changes on: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/mycomponent
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/mycomponent.cfg
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/mycomponent.cfg	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/mycomponent.cfg	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,9 @@
+Mycomponent.Motors.Proxy=motors1:tcp -h localhost -p 9999
+Mycomponent.Camera1.Proxy=cameraA:tcp -h localhost -p 9999
+Mycomponent.Camera2.Proxy=cameraB:tcp -h localhost -p 9999
+Mycomponent.Encoders.Proxy=encoders1:tcp -h localhost -p 9999
+Mycomponent.Laser.Proxy=laser1:tcp -h localhost -p 9999
+Mycomponent.PTEncoders1.Proxy=ptencoders1:tcp -h localhost -p 9999
+Mycomponent.PTEncoders2.Proxy=ptencoders2:tcp -h localhost -p 9999
+Mycomponent.PTMotors1.Proxy=ptmotors1:tcp -h localhost -p 9999
+Mycomponent.PTMotors2.Proxy=ptmotors2:tcp -h localhost -p 9999

Added: trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/mycomponent.glade
===================================================================
--- trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/mycomponent.glade	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/datos_esquemas/my_component/mycomponent.glade	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,223 @@
+<?xml version="1.0"?>
+<glade-interface>
+  <!-- interface-requires gtk+ 2.6 -->
+  <!-- interface-requires canvas 0.0 -->
+  <!-- interface-requires canvas 0.0 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <widget class="GtkWindow" id="secondarywindow">
+    <property name="title" translatable="yes">TELEOPERATE CAMERAS</property>
+    <child>
+      <widget class="GtkFixed" id="fixed1">
+        <property name="visible">True</property>
+        <child>
+          <widget class="GtkEventBox" id="eventbox_left">
+            <property name="width_request">320</property>
+            <property name="height_request">240</property>
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkImage" id="image1">
+                <property name="width_request">320</property>
+                <property name="height_request">240</property>
+                <property name="visible">True</property>
+                <property name="stock">gtk-missing-image</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="x">1</property>
+            <property name="y">1</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkEventBox" id="eventbox_right">
+            <property name="width_request">320</property>
+            <property name="height_request">240</property>
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkImage" id="image2">
+                <property name="width_request">320</property>
+                <property name="height_request">240</property>
+                <property name="visible">True</property>
+                <property name="stock">gtk-missing-image</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="x">328</property>
+            <property name="y">1</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GnomeCanvas" id="canvas_control_cameras">
+            <property name="width_request">200</property>
+            <property name="height_request">200</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="double_buffered">False</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+            <property name="aa">True</property>
+          </widget>
+          <packing>
+            <property name="x">230</property>
+            <property name="y">248</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+  <widget class="GtkWindow" id="windowTeleoperate">
+    <property name="title" translatable="yes">TELEOPERATE ROBOT</property>
+    <child>
+      <widget class="GtkFixed" id="fixed1">
+        <property name="visible">True</property>
+        <property name="extension_events">all</property>
+        <child>
+          <widget class="GtkButton" id="stop_button">
+            <property name="label" translatable="yes">STOP</property>
+            <property name="width_request">75</property>
+            <property name="height_request">53</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="has_tooltip">True</property>
+            <property name="tooltip" translatable="yes">W=0 &amp; V=0</property>
+            <property name="image_position">bottom</property>
+          </widget>
+          <packing>
+            <property name="x">262</property>
+            <property name="y">100</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="label1">
+            <property name="width_request">28</property>
+            <property name="height_request">28</property>
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">+W</property>
+          </widget>
+          <packing>
+            <property name="y">208</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="label2">
+            <property name="width_request">28</property>
+            <property name="height_request">28</property>
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">W-</property>
+          </widget>
+          <packing>
+            <property name="x">179</property>
+            <property name="y">208</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="label3">
+            <property name="width_request">28</property>
+            <property name="height_request">28</property>
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">V+</property>
+          </widget>
+          <packing>
+            <property name="x">206</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="label4">
+            <property name="width_request">28</property>
+            <property name="height_request">28</property>
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">V-</property>
+          </widget>
+          <packing>
+            <property name="x">206</property>
+            <property name="y">184</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GnomeCanvas" id="canvas_control">
+            <property name="width_request">200</property>
+            <property name="height_request">200</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="double_buffered">False</property>
+            <property name="aa">True</property>
+          </widget>
+          <packing>
+            <property name="x">4</property>
+            <property name="y">6</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkButton" id="exitButton">
+            <property name="width_request">80</property>
+            <property name="height_request">80</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="has_tooltip">True</property>
+            <property name="tooltip" translatable="yes">EXIT GUI</property>
+            <property name="image_position">bottom</property>
+            <child>
+              <widget class="GtkImage" id="image10">
+                <property name="visible">True</property>
+                <property name="stock">gtk-quit</property>
+                <property name="icon-size">6</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="x">262</property>
+            <property name="y">6</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkButton" id="yourCodeButton">
+            <property name="width_request">80</property>
+            <property name="height_request">80</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="has_tooltip">True</property>
+            <property name="tooltip" translatable="yes">RUN ITERATION CONTROL</property>
+            <child>
+              <widget class="GtkImage" id="image8">
+                <property name="visible">True</property>
+                <property name="stock">gtk-media-play</property>
+                <property name="icon-size">6</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="x">355</property>
+            <property name="y">6</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkButton" id="stopCodeButton">
+            <property name="width_request">80</property>
+            <property name="height_request">80</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="has_tooltip">True</property>
+            <property name="tooltip" translatable="yes">STOP ITERATION CONTROL</property>
+            <property name="xalign">0.50999999046325684</property>
+            <child>
+              <widget class="GtkImage" id="image9">
+                <property name="visible">True</property>
+                <property name="stock">gtk-media-stop</property>
+                <property name="icon-size">6</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="x">355</property>
+            <property name="y">6</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>

Added: trunk/src/components/visualHFSM-3.1/ejemplo.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplo.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplo.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,47 @@
+#include <gtk/gtk.h>
+#include <glade/glade.h>
+
+void on_button_clicked (GtkButton *button, gpointer user_data) {
+	GtkWidget *label, *entry;
+	gchar *text;
+
+	label = (GtkWidget *)g_object_get_data (G_OBJECT (button), "label");
+	entry = (GtkWidget *)g_object_get_data (G_OBJECT (button), "entry");
+
+	text = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
+	gtk_label_set_text (GTK_LABEL (label), text);
+}
+
+int main(int argc, char *argv[]) {
+	GladeXML *xml;
+	GtkWidget *label, *button, *entry;
+
+	gtk_init(&argc, &argv);
+
+	/* Cargar la interfaz de usuario */
+	xml = glade_xml_new("hola_mundo.glade", "window1", NULL);
+
+	button = glade_xml_get_widget (xml, "button");
+	label = glade_xml_get_widget (xml, "label");
+	entry = glade_xml_get_widget (xml, "entry");
+
+//	g_assert (button != NULL);
+//	g_assert (label != NULL);
+//	g_assert (entry != NULL);
+
+	g_object_set_data (G_OBJECT (button), "label", label);
+	g_object_set_data (G_OBJECT (button), "entry", entry);
+
+	/* Conectar las se�ales de la interfaz */
+	//glade_xml_signal_autoconnect(xml);
+	g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (on_button_clicked), NULL);
+
+	g_object_unref (G_OBJECT (xml));
+
+	/* Iniciar el ciclo principal */
+	gtk_main();
+
+	return 0;
+}
+	
+


Property changes on: trunk/src/components/visualHFSM-3.1/ejemplo.cpp
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/ejemplos/ej_dummy.xml
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/ej_dummy.xml	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/ej_dummy.xml	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<VisualHFSM><SubAutomata><idSub>1</idSub><idPadre>0</idPadre><Estado estado_inicial="false"><id>1</id><origenX>170</origenX><origenY>402</origenY><destinoX>210</destinoX><destinoY>442</destinoY><nombre>ChocaGira</nombre><hijo>3</hijo><codigo>i=0;</codigo><transiciones><transicion><box x1="308" y1="354" x2="314" y2="360"/><nombre></nombre><destino>2</destino><tiempo>30000</tiempo></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>413</origenX><origenY>400</origenY><destinoX>453</destinoX><destinoY>440</destinoY><nombre>Vueltas</nombre><hijo>2</hijo><codigo>i=0;</codigo><transiciones><transicion><box x1="311" y1="482" x2="317" y2="488"/><nombre></nombre><destino>1</destino><tiempo>30000</tiempo></transicion></transiciones></Estado><tiempoIteracion>200</tiempoIteracion><Librerias><lib>laser</lib><lib>motor</lib><lib>radar</lib><lib>encoders</lib><lib>lat_lon</lib><lib>camara</lib><lib>ptencoders</lib></Librerias><variables_aux>int i;</variab!
 les_aux><funciones_aux></funciones_aux></SubAutomata><SubAutomata><idSub>2</idSub><idPadre>1</idPadre><Estado estado_inicial="false"><id>1</id><origenX>163</origenX><origenY>384</origenY><destinoX>203</destinoX><destinoY>424</destinoY><nombre>aIzquierda</nombre><hijo>0</hijo><codigo>control-&gt;mprx-&gt;setW(20);</codigo><transiciones><transicion><box x1="301" y1="321" x2="307" y2="327"/><nombre></nombre><destino>2</destino><tiempo>10000</tiempo></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>414</origenX><origenY>380</origenY><destinoX>454</destinoX><destinoY>420</destinoY><nombre>aDerecha</nombre><hijo>0</hijo><codigo>control-&gt;mprx-&gt;setW(-20);</codigo><transiciones><transicion><box x1="303" y1="466" x2="309" y2="472"/><nombre></nombre><destino>1</destino><tiempo>10000</tiempo></transicion></transiciones></Estado><tiempoIteracion>100</tiempoIteracion><Librerias><lib>laser</lib><lib>motor</lib><lib>radar</lib><lib>encoders</lib><!
 lib>lat_lon</lib><lib>camara</lib><lib>ptencoders</lib></Libre!
 rias><variables_aux></variables_aux><funciones_aux></funciones_aux></SubAutomata><SubAutomata><idSub>3</idSub><idPadre>1</idPadre><Estado estado_inicial="true"><id>1</id><origenX>87</origenX><origenY>411</origenY><destinoX>127</destinoX><destinoY>451</destinoY><nombre>avanzando</nombre><hijo>0</hijo><codigo>control-&gt;mprx-&gt;setW(0.);
+control-&gt;mprx-&gt;setV(60.);
+
+control-&gt;ld=control-&gt;lprx-&gt;getLaserData();</codigo><transiciones><transicion><box x1="196" y1="348" x2="202" y2="354"/><nombre></nombre><destino>2</destino><codigo>control-&gt;ld-&gt;distanceData[45] &lt;= 1000.0</codigo></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>272</origenX><origenY>251</origenY><destinoX>312</destinoX><destinoY>291</destinoY><nombre>parando</nombre><hijo>0</hijo><codigo>control-&gt;mprx-&gt;setV(0.);
+
+v=control-&gt;mprx-&gt;getV();</codigo><transiciones><transicion><box x1="384" y1="348" x2="390" y2="354"/><nombre></nombre><destino>3</destino><codigo>v &lt;= 0.1</codigo></transicion></transiciones></Estado><Estado estado_inicial="false"><id>3</id><origenX>463</origenX><origenY>412</origenY><destinoX>503</destinoX><destinoY>452</destinoY><nombre>marcha_atras</nombre><hijo>0</hijo><codigo>control-&gt;mprx-&gt;setV(-30.);
+
+control-&gt;ld=control-&gt;lprx-&gt;getLaserData();</codigo><transiciones><transicion><box x1="383" y1="518" x2="389" y2="524"/><nombre></nombre><destino>4</destino><codigo>control-&gt;ld-&gt;distanceData[45] &gt; 1300.0</codigo></transicion></transiciones></Estado><Estado estado_inicial="false"><id>4</id><origenX>269</origenX><origenY>590</origenY><destinoX>309</destinoX><destinoY>630</destinoY><nombre>girando</nombre><hijo>0</hijo><codigo>control-&gt;mprx-&gt;setW(30);</codigo><transiciones><transicion><box x1="195" y1="517" x2="201" y2="523"/><nombre></nombre><destino>1</destino><tiempo>3000</tiempo></transicion></transiciones></Estado><tiempoIteracion>100</tiempoIteracion><Librerias><lib>laser</lib><lib>motor</lib><lib>radar</lib><lib>encoders</lib><lib>lat_lon</lib><lib>camara</lib><lib>ptencoders</lib></Librerias><variables_aux>float v;
+
+v=control-&gt;mprx-&gt;getV();
+control-&gt;ld=control-&gt;lprx-&gt;getLaserData();</variables_aux><funciones_aux></funciones_aux></SubAutomata><nombreEsquema>/home/rubensb/PFC/pfc-itis/trunk/visualHFSM/ejemplos/ej_dummy</nombreEsquema></VisualHFSM>

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,806 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# src/components/mycomponent/Makefile.  Generated from Makefile.in by configure.
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+
+
+pkgdatadir = $(datadir)/jderobot
+pkgincludedir = $(includedir)/jderobot
+pkglibdir = $(libdir)/jderobot
+pkglibexecdir = $(libexecdir)/jderobot
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = i686-pc-linux-gnu
+host_triplet = i686-pc-linux-gnu
+bin_PROGRAMS =  \
+	mycomponent$(EXEEXT)
+subdir = src/components/mycomponent
+DIST_COMMON = $(dist_conf_DATA) $(dist_glade_DATA) \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/m4/ac_pkg_swig.m4 \
+	$(top_srcdir)/m4/ac_python_devel.m4 \
+	$(top_srcdir)/m4/swig_python.m4 $(top_srcdir)/m4/libice.m4 \
+	$(top_srcdir)/m4/libgearbox.m4 $(top_srcdir)/m4/libopencv.m4 \
+	$(top_srcdir)/m4/libgtkmm.m4 $(top_srcdir)/m4/libgstreamer.m4 \
+	$(top_srcdir)/m4/lib1394.m4 $(top_srcdir)/m4/libgazebo.m4 \
+	$(top_srcdir)/m4/libplayer.m4 \
+	$(top_srcdir)/m4/libgtkglextmm.m4 \
+	$(top_srcdir)/m4/libopengl.m4 $(top_srcdir)/m4/libgsl.m4 \
+	$(top_srcdir)/m4/libfreenect.m4 \
+	$(top_srcdir)/m4/jderobotutil.m4 \
+	$(top_srcdir)/m4/jderobotice.m4 \
+	$(top_srcdir)/m4/colorspacesmm.m4 \
+	$(top_srcdir)/m4/bgfgsegmentation.m4 \
+	$(top_srcdir)/m4/component_mycomponent.m4 \
+	$(top_srcdir)/m4/component_cameraserver.m4 \
+	$(top_srcdir)/m4/component_cameraview.m4 \
+	$(top_srcdir)/m4/component_cameraview_icestorm.m4 \
+	$(top_srcdir)/m4/component_recordingserver.m4 \
+	$(top_srcdir)/m4/component_opencvdemo.m4 \
+	$(top_srcdir)/m4/component_colortuner.m4 \
+	$(top_srcdir)/m4/component_alarmgenerator.m4 \
+	$(top_srcdir)/m4/component_motiondetection.m4 \
+	$(top_srcdir)/m4/component_recorder.m4 \
+	$(top_srcdir)/m4/component_surveillance.m4 \
+	$(top_srcdir)/m4/component_gazeboserver.m4 \
+	$(top_srcdir)/m4/component_giraffeclient.m4 \
+	$(top_srcdir)/m4/component_introrob.m4 \
+	$(top_srcdir)/m4/component_bgfglab.m4 \
+	$(top_srcdir)/m4/component_teleoperator.m4 \
+	$(top_srcdir)/m4/component_calibrator.m4 \
+	$(top_srcdir)/m4/component_naooperator.m4 \
+	$(top_srcdir)/m4/component_jdenect.m4 \
+	$(top_srcdir)/m4/component_visornect.m4 \
+	$(top_srcdir)/m4/component_playerserver.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(confdir)" \
+	"$(DESTDIR)$(gladedir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_mycomponent_OBJECTS = mycomponent-control_class.$(OBJEXT) \
+	mycomponent-gui.$(OBJEXT) mycomponent-camera.$(OBJEXT) \
+	mycomponent-canvasTeleoperateControl.$(OBJEXT) \
+	mycomponent-canvasTeleoperateCameras.$(OBJEXT)
+mycomponent_OBJECTS = $(am_mycomponent_OBJECTS)
+mycomponent_DEPENDENCIES =  \
+	$(top_srcdir)/src/libs/jderobotice/libJderobotIce.la \
+	$(top_srcdir)/src/libs/jderobotutil/libJderobotUtil.la \
+	$(top_srcdir)/src/libs/colorspaces/libcolorspaces.la \
+	$(top_srcdir)/src/libs/colorspaces/libcolorspacesmm.la \
+	$(top_srcdir)/src/interfaces/cpp/jderobot/libJderobotInterfaces.la
+mycomponent_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(mycomponent_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(mycomponent_SOURCES)
+DIST_SOURCES = $(mycomponent_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+DATA = $(dist_conf_DATA) $(dist_glade_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} /home/mikel/Escritorio/PFC/jderobot/trunk/config/missing --run aclocal-1.11
+AMTAR = ${SHELL} /home/mikel/Escritorio/PFC/jderobot/trunk/config/missing --run tar
+AR = ar
+AUTOCONF = ${SHELL} /home/mikel/Escritorio/PFC/jderobot/trunk/config/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/mikel/Escritorio/PFC/jderobot/trunk/config/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/mikel/Escritorio/PFC/jderobot/trunk/config/missing --run automake-1.11
+AWK = gawk
+BGFGSEGMENTATION_CPPFLAGS = -I/usr/include/opencv   -I${top_srcdir}/src/libs
+BGFGSEGMENTATION_LDFLAGS = -lcv -lhighgui -lcvaux -lml -lcxcore  
+CC = gcc -std=gnu99
+CCDEPMODE = depmode=gcc3
+CFLAGS = -g -O2
+COLORSPACESMM_CPPFLAGS = -I/usr/include/opencv   -I${top_srcdir}/src/libs
+COLORSPACESMM_LDFLAGS = -lcv -lhighgui -lcvaux -lml -lcxcore  
+CPP = gcc -E
+CPPFLAGS = 
+CXX = g++
+CXXCPP = g++ -E
+CXXDEPMODE = depmode=gcc3
+CXXFLAGS = -g -O2
+CYGPATH_W = echo
+DEFS = -DHAVE_CONFIG_H
+DEPDIR = .deps
+DOXYGEN = 
+DSYMUTIL = 
+DUMPBIN = 
+ECHO_C = 
+ECHO_N = -n
+ECHO_T = 
+EGREP = /bin/grep -E
+EXEEXT = 
+FFMPEG = /usr/bin/ffmpeg
+FGREP = /bin/grep -F
+FIREWIRE_CPPFLAGS = 
+FIREWIRE_LDFLAGS = -ldc1394 -lraw1394
+FREENECT_CPPFLAGS = 
+FREENECT_LDFLAGS = 
+GAZEBO_CFLAGS = -I/usr/local/include  
+GAZEBO_CPPFLAGS = -I/usr/include
+GAZEBO_LDFLAGS = -L/usr/local/lib -lgazebo  
+GAZEBO_LIBS = -L/usr/local/lib -lgazebo  
+GEARBOX_CPPFLAGS = -I/usr//include/gearbox
+GEARBOX_LDFLAGS = -L/usr//lib/gearbox -lGbxUtilAcfr -lGbxIceUtilAcfr
+GREP = /bin/grep
+GSL_CFLAGS =  
+GSL_CPPFLAGS =  
+GSL_LDFLAGS = -lgsl -lgslcblas -lm  
+GSL_LIBS = -lgsl -lgslcblas -lm  
+GSTREAMER_CFLAGS = -pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2  
+GSTREAMER_CPPFLAGS = -pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2  
+GSTREAMER_LDFLAGS = -pthread -lgstapp-0.10 -lgstbase-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lxml2 -lgthread-2.0 -lrt -lglib-2.0  
+GSTREAMER_LIBS = -pthread -lgstapp-0.10 -lgstbase-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lxml2 -lgthread-2.0 -lrt -lglib-2.0  
+GTKGLEXTMM_CFLAGS = -pthread -D_REENTRANT -I/usr/include/gtkglextmm-1.2 -I/usr/lib/gtkglextmm-1.2/include -I/usr/include/gtkglext-1.0 -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/lib/gtkglext-1.0/include -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/lib/pangomm-1.4/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/giomm-2.4 -I/usr/lib/giomm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/cairomm-1.0 -I/usr/lib/cairomm-1.0/include -I/usr/include/atk-1.0 -I/usr/include/gtk-unix-print-2.0 -I/usr/include/atkmm-1.6  
+GTKGLEXTMM_CPPFLAGS = -pthread -D_REENTRANT -I/usr/include/gtkglextmm-1.2 -I/usr/lib/gtkglextmm-1.2/include -I/usr/include/gtkglext-1.0 -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/lib/gtkglext-1.0/include -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/lib/pangomm-1.4/include -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/include/giomm-2.4 -I/usr/lib/giomm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/cairomm-1.0 -I/usr/lib/cairomm-1.0/include -I/usr/include/atk-1.0 -I/usr/include/gtk-unix-print-2.0 -I/usr/include/atkmm-1.6  
+GTKGLEXTMM_LDFLAGS = -Wl,--export-dynamic -pthread -lgtkglextmm-x11-1.2 -lgdkglextmm-x11-1.2 -lgtkglext-x11-1.0 -lgtkmm-2.4 -lgdkglext-x11-1.0 -lGLU -lGL -lXmu -lXt -lSM -lICE -lpangox-1.0 -lX11 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-x11-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0  
+GTKGLEXTMM_LIBS = -Wl,--export-dynamic -pthread -lgtkglextmm-x11-1.2 -lgdkglextmm-x11-1.2 -lgtkglext-x11-1.0 -lgtkmm-2.4 -lgdkglext-x11-1.0 -lGLU -lGL -lXmu -lXt -lSM -lICE -lpangox-1.0 -lX11 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lgtk-x11-2.0 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0  
+GTKMM_CFLAGS = -pthread -D_REENTRANT -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/include/giomm-2.4 -I/usr/lib/giomm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/lib/pangomm-1.4/include -I/usr/include/gtk-2.0 -I/usr/include/gtk-unix-print-2.0 -I/usr/include/atkmm-1.6 -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/cairomm-1.0 -I/usr/lib/cairomm-1.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/libglademm-2.4 -I/usr/lib/libglademm-2.4/include -I/usr/include/libglade-2.0 -I/usr/include/libxml2  
+GTKMM_CPPFLAGS = -pthread -D_REENTRANT -I/usr/include/gtkmm-2.4 -I/usr/lib/gtkmm-2.4/include -I/usr/include/giomm-2.4 -I/usr/lib/giomm-2.4/include -I/usr/include/pangomm-1.4 -I/usr/lib/pangomm-1.4/include -I/usr/include/gtk-2.0 -I/usr/include/gtk-unix-print-2.0 -I/usr/include/atkmm-1.6 -I/usr/include/gdkmm-2.4 -I/usr/lib/gdkmm-2.4/include -I/usr/include/glibmm-2.4 -I/usr/lib/glibmm-2.4/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/usr/include/cairomm-1.0 -I/usr/lib/cairomm-1.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/libglademm-2.4 -I/usr/lib/libglademm-2.4/include -I/usr/include/libglade-2.0 -I/usr/include/libxml2  
+GTKMM_LDFLAGS = -pthread -lglademm-2.4 -lgtkmm-2.4 -lglade-2.0 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgtk-x11-2.0 -lxml2 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0  
+GTKMM_LIBS = -pthread -lglademm-2.4 -lgtkmm-2.4 -lglade-2.0 -latkmm-1.6 -lgdkmm-2.4 -lgiomm-2.4 -lpangomm-1.4 -lglibmm-2.4 -lcairomm-1.0 -lsigc-2.0 -lgtk-x11-2.0 -lxml2 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0  
+ICE_CPPFLAGS = 
+ICE_LDFLAGS = -lIce -lIceUtil -lIceGrid -lIceBox -lIceStorm -lIceStormService
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+JDEROBOTICE_CPPFLAGS =  -I/usr//include/gearbox -I${top_srcdir}/src/libs -I${top_srcdir}/src/interfaces/cpp
+JDEROBOTICE_LDFLAGS = -lIce -lIceUtil -lIceGrid -lIceBox -lIceStorm -lIceStormService -L/usr//lib/gearbox -lGbxUtilAcfr -lGbxIceUtilAcfr
+JDEROBOTUTIL_CPPFLAGS = -I${top_srcdir}/src/libs
+JDEROBOTUTIL_LDFLAGS = 
+LD = /usr/bin/ld
+LDFLAGS = 
+LIBDC1394 = -ldc1394
+LIBFREENECT_CFLAGS = 
+LIBFREENECT_LIBS = 
+LIBGBXICEUTILACFR = -lGbxIceUtilAcfr
+LIBGBXUTILACFR = -lGbxUtilAcfr
+LIBICE = -lIce
+LIBICEBOX = -lIceBox
+LIBICEGRID = -lIceGrid
+LIBICESTORM = -lIceStorm
+LIBICESTORMSERVICE = -lIceStormService
+LIBICEUTIL = -lIceUtil
+LIBOBJS = 
+LIBRAW1394 = -lraw1394
+LIBS = -lm 
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIBTOOL_DEPS = config/ltmain.sh
+LIPO = 
+LN_S = ln -s
+LTLIBOBJS = 
+MAKEINFO = ${SHELL} /home/mikel/Escritorio/PFC/jderobot/trunk/config/missing --run makeinfo
+MKDIR_P = /bin/mkdir -p
+NM = /usr/bin/nm -B
+NMEDIT = 
+OBJDUMP = objdump
+OBJEXT = o
+OPENCV_CFLAGS = -I/usr/include/opencv  
+OPENCV_CPPFLAGS = -I/usr/include/opencv  
+OPENCV_LDFLAGS = -lcv -lhighgui -lcvaux -lml -lcxcore  
+OPENCV_LIBS = -lcv -lhighgui -lcvaux -lml -lcxcore  
+OPENGL_CFLAGS =  
+OPENGL_CPPFLAGS =  
+OPENGL_LDFLAGS = -lGLU -lGL   -lglut
+OPENGL_LIBS = -lGLU -lGL  
+OTOOL = 
+OTOOL64 = 
+PACKAGE = jderobot
+PACKAGE_BUGREPORT = 
+PACKAGE_NAME = jderobot
+PACKAGE_STRING = jderobot 5.0
+PACKAGE_TARNAME = jderobot
+PACKAGE_URL = 
+PACKAGE_VERSION = 5.0
+PATH_SEPARATOR = :
+PKG_CONFIG = /usr/bin/pkg-config
+PKG_CONFIG_PATH = :/usr/lib/pkgconfig:/usr/lib/pkgconfig:/usr/lib/pkgconfig
+PLAYER_CFLAGS = -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -I/usr/local/include/player-2.1  
+PLAYER_CPPFLAGS = -I/usr/include/player-2.1
+PLAYER_LDFLAGS = -L/usr/local/lib -lplayerc++ -lboost_signals -lboost_thread -lplayerc -lm -lplayerxdr -lplayererror  
+PLAYER_LIBS = -L/usr/local/lib -lplayerc++ -lboost_signals -lboost_thread -lplayerc -lm -lplayerxdr -lplayererror  
+RANLIB = ranlib
+RECORDER_LIBS = 
+RECORDINGSERVER_LIBS = 
+SED = /bin/sed
+SET_MAKE = 
+SHELL = /bin/bash
+SLICE2CPP = /usr/bin/slice2cpp
+SLICE2JAVA = /usr/bin/slice2java
+SLICE2PYTHON = /usr/bin/slice2py
+SLICEDIR = /usr/share/slice
+SLICESRCDIR = $(top_srcdir)/src/interfaces/slice
+STRIP = strip
+SURVEILLANCE_LIBS = 
+VERSION = 5.0
+abs_builddir = /home/mikel/Escritorio/PFC/jderobot/trunk/src/components/mycomponent
+abs_srcdir = /home/mikel/Escritorio/PFC/jderobot/trunk/src/components/mycomponent
+abs_top_builddir = /home/mikel/Escritorio/PFC/jderobot/trunk
+abs_top_srcdir = /home/mikel/Escritorio/PFC/jderobot/trunk
+ac_ct_CC = gcc
+ac_ct_CXX = g++
+ac_ct_DUMPBIN = 
+am__include = include
+am__leading_dot = .
+am__quote = 
+am__tar = ${AMTAR} chof - "$$tardir"
+am__untar = ${AMTAR} xf -
+bindir = ${exec_prefix}/bin
+build = i686-pc-linux-gnu
+build_alias = 
+build_cpu = i686
+build_os = linux-gnu
+build_vendor = pc
+builddir = .
+confdir = ${pkgdatadir}/conf
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+gladedir = ${pkgdatadir}/glade
+host = i686-pc-linux-gnu
+host_alias = 
+host_cpu = i686
+host_os = linux-gnu
+host_vendor = pc
+htmldir = ${docdir}
+included = ${libdir}
+includedir = ${prefix}/include/jderobot
+includes = ${includedir}
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /home/mikel/Escritorio/PFC/jderobot/trunk/config/install-sh
+interfacedir = ${includedir}/slice
+libdir = ${exec_prefix}/lib/jderobot
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+lt_ECHO = echo
+mandir = ${datarootdir}/man
+mkdir_p = /bin/mkdir -p
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = 
+program_transform_name = s,x,x,
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target_alias = 
+top_build_prefix = ../../../
+top_builddir = ../../..
+top_srcdir = ../../..
+mycomponent_SOURCES = control_class.cpp \
+			control_class.h \
+			gui.h \
+			gui.cpp \
+			camera.cpp \
+			camera.h \
+			canvasTeleoperateControl.h \
+			canvasTeleoperateControl.cpp \
+			canvasTeleoperateCameras.h \
+			canvasTeleoperateCameras.cpp
+
+mycomponent_CPPFLAGS = $(GTKMM_CPPFLAGS) $(OPENCV_CPPFLAGS) $(COLORSPACESMM_CPPFLAGS) \
+			$(GSL_CPPFLAGS) $(OPENGL_CPPFLAGS) $(GTKGLEXTMM_CPPFLAGS) $(JDEROBOTICE_CPPFLAGS) -DGLADE_DIR=\""$(gladedir)"\"
+
+mycomponent_LDFLAGS = $(JDEROBOTICE_LDFLAGS) $(GTKMM_LDFLAGS) $(OPENCV_LDFLAGS) $(COLORSPACESMM_LDFLAGS) $(GTKGLEXTMM_LDFLAGS) $(OPENGL_LDFLAGS) $(GSL_LDFLAGS)
+mycomponent_LDADD = $(top_srcdir)/src/libs/jderobotice/libJderobotIce.la \
+			$(top_srcdir)/src/libs/jderobotutil/libJderobotUtil.la \
+			$(top_srcdir)/src/libs/colorspaces/libcolorspaces.la \
+			$(top_srcdir)/src/libs/colorspaces/libcolorspacesmm.la \
+			$(top_srcdir)/src/interfaces/cpp/jderobot/libJderobotInterfaces.la
+
+dist_conf_DATA = mycomponent.cfg
+dist_glade_DATA = mycomponent.glade
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/components/mycomponent/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu src/components/mycomponent/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+mycomponent$(EXEEXT): $(mycomponent_OBJECTS) $(mycomponent_DEPENDENCIES) 
+	@rm -f mycomponent$(EXEEXT)
+	$(mycomponent_LINK) $(mycomponent_OBJECTS) $(mycomponent_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+include ./$(DEPDIR)/mycomponent-camera.Po
+include ./$(DEPDIR)/mycomponent-canvasTeleoperateCameras.Po
+include ./$(DEPDIR)/mycomponent-canvasTeleoperateControl.Po
+include ./$(DEPDIR)/mycomponent-control_class.Po
+include ./$(DEPDIR)/mycomponent-gui.Po
+
+.cpp.o:
+	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+#	source='$<' object='$@' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+#	source='$<' object='$@' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+#	source='$<' object='$@' libtool=yes \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(LTCXXCOMPILE) -c -o $@ $<
+
+mycomponent-control_class.o: control_class.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-control_class.o -MD -MP -MF $(DEPDIR)/mycomponent-control_class.Tpo -c -o mycomponent-control_class.o `test -f 'control_class.cpp' || echo '$(srcdir)/'`control_class.cpp
+	$(am__mv) $(DEPDIR)/mycomponent-control_class.Tpo $(DEPDIR)/mycomponent-control_class.Po
+#	source='control_class.cpp' object='mycomponent-control_class.o' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-control_class.o `test -f 'control_class.cpp' || echo '$(srcdir)/'`control_class.cpp
+
+mycomponent-control_class.obj: control_class.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-control_class.obj -MD -MP -MF $(DEPDIR)/mycomponent-control_class.Tpo -c -o mycomponent-control_class.obj `if test -f 'control_class.cpp'; then $(CYGPATH_W) 'control_class.cpp'; else $(CYGPATH_W) '$(srcdir)/control_class.cpp'; fi`
+	$(am__mv) $(DEPDIR)/mycomponent-control_class.Tpo $(DEPDIR)/mycomponent-control_class.Po
+#	source='control_class.cpp' object='mycomponent-control_class.obj' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-control_class.obj `if test -f 'control_class.cpp'; then $(CYGPATH_W) 'control_class.cpp'; else $(CYGPATH_W) '$(srcdir)/control_class.cpp'; fi`
+
+mycomponent-gui.o: gui.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-gui.o -MD -MP -MF $(DEPDIR)/mycomponent-gui.Tpo -c -o mycomponent-gui.o `test -f 'gui.cpp' || echo '$(srcdir)/'`gui.cpp
+	$(am__mv) $(DEPDIR)/mycomponent-gui.Tpo $(DEPDIR)/mycomponent-gui.Po
+#	source='gui.cpp' object='mycomponent-gui.o' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-gui.o `test -f 'gui.cpp' || echo '$(srcdir)/'`gui.cpp
+
+mycomponent-gui.obj: gui.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-gui.obj -MD -MP -MF $(DEPDIR)/mycomponent-gui.Tpo -c -o mycomponent-gui.obj `if test -f 'gui.cpp'; then $(CYGPATH_W) 'gui.cpp'; else $(CYGPATH_W) '$(srcdir)/gui.cpp'; fi`
+	$(am__mv) $(DEPDIR)/mycomponent-gui.Tpo $(DEPDIR)/mycomponent-gui.Po
+#	source='gui.cpp' object='mycomponent-gui.obj' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-gui.obj `if test -f 'gui.cpp'; then $(CYGPATH_W) 'gui.cpp'; else $(CYGPATH_W) '$(srcdir)/gui.cpp'; fi`
+
+mycomponent-camera.o: camera.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-camera.o -MD -MP -MF $(DEPDIR)/mycomponent-camera.Tpo -c -o mycomponent-camera.o `test -f 'camera.cpp' || echo '$(srcdir)/'`camera.cpp
+	$(am__mv) $(DEPDIR)/mycomponent-camera.Tpo $(DEPDIR)/mycomponent-camera.Po
+#	source='camera.cpp' object='mycomponent-camera.o' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-camera.o `test -f 'camera.cpp' || echo '$(srcdir)/'`camera.cpp
+
+mycomponent-camera.obj: camera.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-camera.obj -MD -MP -MF $(DEPDIR)/mycomponent-camera.Tpo -c -o mycomponent-camera.obj `if test -f 'camera.cpp'; then $(CYGPATH_W) 'camera.cpp'; else $(CYGPATH_W) '$(srcdir)/camera.cpp'; fi`
+	$(am__mv) $(DEPDIR)/mycomponent-camera.Tpo $(DEPDIR)/mycomponent-camera.Po
+#	source='camera.cpp' object='mycomponent-camera.obj' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-camera.obj `if test -f 'camera.cpp'; then $(CYGPATH_W) 'camera.cpp'; else $(CYGPATH_W) '$(srcdir)/camera.cpp'; fi`
+
+mycomponent-canvasTeleoperateControl.o: canvasTeleoperateControl.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-canvasTeleoperateControl.o -MD -MP -MF $(DEPDIR)/mycomponent-canvasTeleoperateControl.Tpo -c -o mycomponent-canvasTeleoperateControl.o `test -f 'canvasTeleoperateControl.cpp' || echo '$(srcdir)/'`canvasTeleoperateControl.cpp
+	$(am__mv) $(DEPDIR)/mycomponent-canvasTeleoperateControl.Tpo $(DEPDIR)/mycomponent-canvasTeleoperateControl.Po
+#	source='canvasTeleoperateControl.cpp' object='mycomponent-canvasTeleoperateControl.o' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-canvasTeleoperateControl.o `test -f 'canvasTeleoperateControl.cpp' || echo '$(srcdir)/'`canvasTeleoperateControl.cpp
+
+mycomponent-canvasTeleoperateControl.obj: canvasTeleoperateControl.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-canvasTeleoperateControl.obj -MD -MP -MF $(DEPDIR)/mycomponent-canvasTeleoperateControl.Tpo -c -o mycomponent-canvasTeleoperateControl.obj `if test -f 'canvasTeleoperateControl.cpp'; then $(CYGPATH_W) 'canvasTeleoperateControl.cpp'; else $(CYGPATH_W) '$(srcdir)/canvasTeleoperateControl.cpp'; fi`
+	$(am__mv) $(DEPDIR)/mycomponent-canvasTeleoperateControl.Tpo $(DEPDIR)/mycomponent-canvasTeleoperateControl.Po
+#	source='canvasTeleoperateControl.cpp' object='mycomponent-canvasTeleoperateControl.obj' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-canvasTeleoperateControl.obj `if test -f 'canvasTeleoperateControl.cpp'; then $(CYGPATH_W) 'canvasTeleoperateControl.cpp'; else $(CYGPATH_W) '$(srcdir)/canvasTeleoperateControl.cpp'; fi`
+
+mycomponent-canvasTeleoperateCameras.o: canvasTeleoperateCameras.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-canvasTeleoperateCameras.o -MD -MP -MF $(DEPDIR)/mycomponent-canvasTeleoperateCameras.Tpo -c -o mycomponent-canvasTeleoperateCameras.o `test -f 'canvasTeleoperateCameras.cpp' || echo '$(srcdir)/'`canvasTeleoperateCameras.cpp
+	$(am__mv) $(DEPDIR)/mycomponent-canvasTeleoperateCameras.Tpo $(DEPDIR)/mycomponent-canvasTeleoperateCameras.Po
+#	source='canvasTeleoperateCameras.cpp' object='mycomponent-canvasTeleoperateCameras.o' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-canvasTeleoperateCameras.o `test -f 'canvasTeleoperateCameras.cpp' || echo '$(srcdir)/'`canvasTeleoperateCameras.cpp
+
+mycomponent-canvasTeleoperateCameras.obj: canvasTeleoperateCameras.cpp
+	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-canvasTeleoperateCameras.obj -MD -MP -MF $(DEPDIR)/mycomponent-canvasTeleoperateCameras.Tpo -c -o mycomponent-canvasTeleoperateCameras.obj `if test -f 'canvasTeleoperateCameras.cpp'; then $(CYGPATH_W) 'canvasTeleoperateCameras.cpp'; else $(CYGPATH_W) '$(srcdir)/canvasTeleoperateCameras.cpp'; fi`
+	$(am__mv) $(DEPDIR)/mycomponent-canvasTeleoperateCameras.Tpo $(DEPDIR)/mycomponent-canvasTeleoperateCameras.Po
+#	source='canvasTeleoperateCameras.cpp' object='mycomponent-canvasTeleoperateCameras.obj' libtool=no \
+#	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) \
+#	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-canvasTeleoperateCameras.obj `if test -f 'canvasTeleoperateCameras.cpp'; then $(CYGPATH_W) 'canvasTeleoperateCameras.cpp'; else $(CYGPATH_W) '$(srcdir)/canvasTeleoperateCameras.cpp'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-dist_confDATA: $(dist_conf_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(confdir)" || $(MKDIR_P) "$(DESTDIR)$(confdir)"
+	@list='$(dist_conf_DATA)'; test -n "$(confdir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(confdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(confdir)" || exit $$?; \
+	done
+
+uninstall-dist_confDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_conf_DATA)'; test -n "$(confdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(confdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(confdir)" && rm -f $$files
+install-dist_gladeDATA: $(dist_glade_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(gladedir)" || $(MKDIR_P) "$(DESTDIR)$(gladedir)"
+	@list='$(dist_glade_DATA)'; test -n "$(gladedir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(gladedir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(gladedir)" || exit $$?; \
+	done
+
+uninstall-dist_gladeDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_glade_DATA)'; test -n "$(gladedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(gladedir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(gladedir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(confdir)" "$(DESTDIR)$(gladedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_confDATA install-dist_gladeDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-dist_confDATA \
+	uninstall-dist_gladeDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am \
+	install-dist_confDATA install-dist_gladeDATA install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-binPROGRAMS uninstall-dist_confDATA \
+	uninstall-dist_gladeDATA
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile-mycomponent
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile-mycomponent	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile-mycomponent	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,17 @@
+JDEROBOTDIR = /usr/local
+CXXFLAGS = -I $(JDEROBOTDIR)/include/jderobot `pkg-config --cflags opencv` `pkg-config --cflags gtkmm-2.4 libglademm-2.4 gthread-2.0 libgnomecanvas-2.0 libgnomecanvasmm-2.6` `pkg-config --cflags gtkglextmm-1.2`
+LDFLAGS = `pkg-config --libs gtkmm-2.4 libglademm-2.4 gthread-2.0 libgnomecanvas-2.0 libgnomecanvasmm-2.6` `pkg-config --libs opencv` -lgsl -lgslcblas `pkg-config --libs gtkglextmm-1.2` -lGL -lGLU -lglut
+LDADD = $(JDEROBOTDIR)/lib/jderobot/libJderobotIce.la \
+	$(JDEROBOTDIR)/lib/jderobot/libJderobotUtil.la \
+	$(JDEROBOTDIR)/lib/jderobot/libcolorspacesmm.la \
+	$(JDEROBOTDIR)/lib/jderobot/libJderobotInterfaces.la \
+	$(JDEROBOTDIR)/lib/jderobot/libprogeo.la \
+	$(JDEROBOTDIR)/lib/jderobot/libpioneer.la
+
+introrob: control_class.o gui.o camera.o canvasTeleoperateControl.o canvasTeleoperateCameras.o
+	libtool --mode=link g++ -g -O -o mycomponent control_class.o gui.o camera.o canvasTeleoperateCameras.o canvasTeleoperateControl.o $(LDADD) $(LDFLAGS)
+
+clean:
+	rm -f *.o mycomponent
+
+

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile.am
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile.am	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile.am	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,26 @@
+if ENABLE_COMPONENT_MYCOMPONENT
+bin_PROGRAMS = mycomponent
+endif
+
+mycomponent_SOURCES = 	control_class.cpp \
+			control_class.h \
+			gui.h \
+			gui.cpp \
+			camera.cpp \
+			camera.h \
+			canvasTeleoperateControl.h \
+			canvasTeleoperateControl.cpp \
+			canvasTeleoperateCameras.h \
+			canvasTeleoperateCameras.cpp
+						
+mycomponent_CPPFLAGS =  $(GTKMM_CPPFLAGS) $(OPENCV_CPPFLAGS) $(COLORSPACESMM_CPPFLAGS) \
+			$(GSL_CPPFLAGS) $(OPENGL_CPPFLAGS) $(GTKGLEXTMM_CPPFLAGS) $(JDEROBOTICE_CPPFLAGS) -DGLADE_DIR=\""$(gladedir)"\"
+mycomponent_LDFLAGS = $(JDEROBOTICE_LDFLAGS) $(GTKMM_LDFLAGS) $(OPENCV_LDFLAGS) $(COLORSPACESMM_LDFLAGS) $(GTKGLEXTMM_LDFLAGS) $(OPENGL_LDFLAGS) $(GSL_LDFLAGS)
+mycomponent_LDADD = $(top_srcdir)/src/libs/jderobotice/libJderobotIce.la \
+			$(top_srcdir)/src/libs/jderobotutil/libJderobotUtil.la \
+			$(top_srcdir)/src/libs/colorspaces/libcolorspaces.la \
+			$(top_srcdir)/src/libs/colorspaces/libcolorspacesmm.la \
+			$(top_srcdir)/src/interfaces/cpp/jderobot/libJderobotInterfaces.la
+
+dist_conf_DATA = mycomponent.cfg
+dist_glade_DATA = mycomponent.glade

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile.in
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile.in	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/Makefile.in	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,806 @@
+# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation,
+# Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ en SET_MAKE@
+
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+ en ENABLE_COMPONENT_MYCOMPONENT_TRUE@bin_PROGRAMS =  \
+ en ENABLE_COMPONENT_MYCOMPONENT_TRUE@	mycomponent$(EXEEXT)
+subdir = src/components/mycomponent
+DIST_COMMON = $(dist_conf_DATA) $(dist_glade_DATA) \
+	$(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/m4/ac_pkg_swig.m4 \
+	$(top_srcdir)/m4/ac_python_devel.m4 \
+	$(top_srcdir)/m4/swig_python.m4 $(top_srcdir)/m4/libice.m4 \
+	$(top_srcdir)/m4/libgearbox.m4 $(top_srcdir)/m4/libopencv.m4 \
+	$(top_srcdir)/m4/libgtkmm.m4 $(top_srcdir)/m4/libgstreamer.m4 \
+	$(top_srcdir)/m4/lib1394.m4 $(top_srcdir)/m4/libgazebo.m4 \
+	$(top_srcdir)/m4/libplayer.m4 \
+	$(top_srcdir)/m4/libgtkglextmm.m4 \
+	$(top_srcdir)/m4/libopengl.m4 $(top_srcdir)/m4/libgsl.m4 \
+	$(top_srcdir)/m4/libfreenect.m4 \
+	$(top_srcdir)/m4/jderobotutil.m4 \
+	$(top_srcdir)/m4/jderobotice.m4 \
+	$(top_srcdir)/m4/colorspacesmm.m4 \
+	$(top_srcdir)/m4/bgfgsegmentation.m4 \
+	$(top_srcdir)/m4/component_mycomponent.m4 \
+	$(top_srcdir)/m4/component_cameraserver.m4 \
+	$(top_srcdir)/m4/component_cameraview.m4 \
+	$(top_srcdir)/m4/component_cameraview_icestorm.m4 \
+	$(top_srcdir)/m4/component_recordingserver.m4 \
+	$(top_srcdir)/m4/component_opencvdemo.m4 \
+	$(top_srcdir)/m4/component_colortuner.m4 \
+	$(top_srcdir)/m4/component_alarmgenerator.m4 \
+	$(top_srcdir)/m4/component_motiondetection.m4 \
+	$(top_srcdir)/m4/component_recorder.m4 \
+	$(top_srcdir)/m4/component_surveillance.m4 \
+	$(top_srcdir)/m4/component_gazeboserver.m4 \
+	$(top_srcdir)/m4/component_giraffeclient.m4 \
+	$(top_srcdir)/m4/component_introrob.m4 \
+	$(top_srcdir)/m4/component_bgfglab.m4 \
+	$(top_srcdir)/m4/component_teleoperator.m4 \
+	$(top_srcdir)/m4/component_calibrator.m4 \
+	$(top_srcdir)/m4/component_naooperator.m4 \
+	$(top_srcdir)/m4/component_jdenect.m4 \
+	$(top_srcdir)/m4/component_visornect.m4 \
+	$(top_srcdir)/m4/component_playerserver.m4 \
+	$(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(confdir)" \
+	"$(DESTDIR)$(gladedir)"
+PROGRAMS = $(bin_PROGRAMS)
+am_mycomponent_OBJECTS = mycomponent-control_class.$(OBJEXT) \
+	mycomponent-gui.$(OBJEXT) mycomponent-camera.$(OBJEXT) \
+	mycomponent-canvasTeleoperateControl.$(OBJEXT) \
+	mycomponent-canvasTeleoperateCameras.$(OBJEXT)
+mycomponent_OBJECTS = $(am_mycomponent_OBJECTS)
+mycomponent_DEPENDENCIES =  \
+	$(top_srcdir)/src/libs/jderobotice/libJderobotIce.la \
+	$(top_srcdir)/src/libs/jderobotutil/libJderobotUtil.la \
+	$(top_srcdir)/src/libs/colorspaces/libcolorspaces.la \
+	$(top_srcdir)/src/libs/colorspaces/libcolorspacesmm.la \
+	$(top_srcdir)/src/interfaces/cpp/jderobot/libJderobotInterfaces.la
+mycomponent_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(mycomponent_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. en am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(mycomponent_SOURCES)
+DIST_SOURCES = $(mycomponent_SOURCES)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+DATA = $(dist_conf_DATA) $(dist_glade_DATA)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BGFGSEGMENTATION_CPPFLAGS = @BGFGSEGMENTATION_CPPFLAGS@
+BGFGSEGMENTATION_LDFLAGS = @BGFGSEGMENTATION_LDFLAGS@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COLORSPACESMM_CPPFLAGS = @COLORSPACESMM_CPPFLAGS@
+COLORSPACESMM_LDFLAGS = @COLORSPACESMM_LDFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FFMPEG = @FFMPEG@
+FGREP = @FGREP@
+FIREWIRE_CPPFLAGS = @FIREWIRE_CPPFLAGS@
+FIREWIRE_LDFLAGS = @FIREWIRE_LDFLAGS@
+FREENECT_CPPFLAGS = @FREENECT_CPPFLAGS@
+FREENECT_LDFLAGS = @FREENECT_LDFLAGS@
+GAZEBO_CFLAGS = @GAZEBO_CFLAGS@
+GAZEBO_CPPFLAGS = @GAZEBO_CPPFLAGS@
+GAZEBO_LDFLAGS = @GAZEBO_LDFLAGS@
+GAZEBO_LIBS = @GAZEBO_LIBS@
+GEARBOX_CPPFLAGS = @GEARBOX_CPPFLAGS@
+GEARBOX_LDFLAGS = @GEARBOX_LDFLAGS@
+GREP = @GREP@
+GSL_CFLAGS = @GSL_CFLAGS@
+GSL_CPPFLAGS = @GSL_CPPFLAGS@
+GSL_LDFLAGS = @GSL_LDFLAGS@
+GSL_LIBS = @GSL_LIBS@
+GSTREAMER_CFLAGS = @GSTREAMER_CFLAGS@
+GSTREAMER_CPPFLAGS = @GSTREAMER_CPPFLAGS@
+GSTREAMER_LDFLAGS = @GSTREAMER_LDFLAGS@
+GSTREAMER_LIBS = @GSTREAMER_LIBS@
+GTKGLEXTMM_CFLAGS = @GTKGLEXTMM_CFLAGS@
+GTKGLEXTMM_CPPFLAGS = @GTKGLEXTMM_CPPFLAGS@
+GTKGLEXTMM_LDFLAGS = @GTKGLEXTMM_LDFLAGS@
+GTKGLEXTMM_LIBS = @GTKGLEXTMM_LIBS@
+GTKMM_CFLAGS = @GTKMM_CFLAGS@
+GTKMM_CPPFLAGS = @GTKMM_CPPFLAGS@
+GTKMM_LDFLAGS = @GTKMM_LDFLAGS@
+GTKMM_LIBS = @GTKMM_LIBS@
+ICE_CPPFLAGS = @ICE_CPPFLAGS@
+ICE_LDFLAGS = @ICE_LDFLAGS@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JDEROBOTICE_CPPFLAGS = @JDEROBOTICE_CPPFLAGS@
+JDEROBOTICE_LDFLAGS = @JDEROBOTICE_LDFLAGS@
+JDEROBOTUTIL_CPPFLAGS = @JDEROBOTUTIL_CPPFLAGS@
+JDEROBOTUTIL_LDFLAGS = @JDEROBOTUTIL_LDFLAGS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBDC1394 = @LIBDC1394@
+LIBFREENECT_CFLAGS = @LIBFREENECT_CFLAGS@
+LIBFREENECT_LIBS = @LIBFREENECT_LIBS@
+LIBGBXICEUTILACFR = @LIBGBXICEUTILACFR@
+LIBGBXUTILACFR = @LIBGBXUTILACFR@
+LIBICE = @LIBICE@
+LIBICEBOX = @LIBICEBOX@
+LIBICEGRID = @LIBICEGRID@
+LIBICESTORM = @LIBICESTORM@
+LIBICESTORMSERVICE = @LIBICESTORMSERVICE@
+LIBICEUTIL = @LIBICEUTIL@
+LIBOBJS = @LIBOBJS@
+LIBRAW1394 = @LIBRAW1394@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENCV_CFLAGS = @OPENCV_CFLAGS@
+OPENCV_CPPFLAGS = @OPENCV_CPPFLAGS@
+OPENCV_LDFLAGS = @OPENCV_LDFLAGS@
+OPENCV_LIBS = @OPENCV_LIBS@
+OPENGL_CFLAGS = @OPENGL_CFLAGS@
+OPENGL_CPPFLAGS = @OPENGL_CPPFLAGS@
+OPENGL_LDFLAGS = @OPENGL_LDFLAGS@
+OPENGL_LIBS = @OPENGL_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PLAYER_CFLAGS = @PLAYER_CFLAGS@
+PLAYER_CPPFLAGS = @PLAYER_CPPFLAGS@
+PLAYER_LDFLAGS = @PLAYER_LDFLAGS@
+PLAYER_LIBS = @PLAYER_LIBS@
+RANLIB = @RANLIB@
+RECORDER_LIBS = @RECORDER_LIBS@
+RECORDINGSERVER_LIBS = @RECORDINGSERVER_LIBS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SLICE2CPP = @SLICE2CPP@
+SLICE2JAVA = @SLICE2JAVA@
+SLICE2PYTHON = @SLICE2PYTHON@
+SLICEDIR = @SLICEDIR@
+SLICESRCDIR = @SLICESRCDIR@
+STRIP = @STRIP@
+SURVEILLANCE_LIBS = @SURVEILLANCE_LIBS@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+confdir = @confdir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+gladedir = @gladedir@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+included = @included@
+includedir = @includedir@
+includes = @includes@
+infodir = @infodir@
+install_sh = @install_sh@
+interfacedir = @interfacedir@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lt_ECHO = @lt_ECHO@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+mycomponent_SOURCES = control_class.cpp \
+			control_class.h \
+			gui.h \
+			gui.cpp \
+			camera.cpp \
+			camera.h \
+			canvasTeleoperateControl.h \
+			canvasTeleoperateControl.cpp \
+			canvasTeleoperateCameras.h \
+			canvasTeleoperateCameras.cpp
+
+mycomponent_CPPFLAGS = $(GTKMM_CPPFLAGS) $(OPENCV_CPPFLAGS) $(COLORSPACESMM_CPPFLAGS) \
+			$(GSL_CPPFLAGS) $(OPENGL_CPPFLAGS) $(GTKGLEXTMM_CPPFLAGS) $(JDEROBOTICE_CPPFLAGS) -DGLADE_DIR=\""$(gladedir)"\"
+
+mycomponent_LDFLAGS = $(JDEROBOTICE_LDFLAGS) $(GTKMM_LDFLAGS) $(OPENCV_LDFLAGS) $(COLORSPACESMM_LDFLAGS) $(GTKGLEXTMM_LDFLAGS) $(OPENGL_LDFLAGS) $(GSL_LDFLAGS)
+mycomponent_LDADD = $(top_srcdir)/src/libs/jderobotice/libJderobotIce.la \
+			$(top_srcdir)/src/libs/jderobotutil/libJderobotUtil.la \
+			$(top_srcdir)/src/libs/colorspaces/libcolorspaces.la \
+			$(top_srcdir)/src/libs/colorspaces/libcolorspacesmm.la \
+			$(top_srcdir)/src/interfaces/cpp/jderobot/libJderobotInterfaces.la
+
+dist_conf_DATA = mycomponent.cfg
+dist_glade_DATA = mycomponent.glade
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/components/mycomponent/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu src/components/mycomponent/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+mycomponent$(EXEEXT): $(mycomponent_OBJECTS) $(mycomponent_DEPENDENCIES) 
+	@rm -f mycomponent$(EXEEXT)
+	$(mycomponent_LINK) $(mycomponent_OBJECTS) $(mycomponent_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ en AMDEP_TRUE@@am__include@ @am__quote en ./$(DEPDIR)/mycomponent-camera.Po en am__quote@
+ en AMDEP_TRUE@@am__include@ @am__quote en ./$(DEPDIR)/mycomponent-canvasTeleoperateCameras.Po en am__quote@
+ en AMDEP_TRUE@@am__include@ @am__quote en ./$(DEPDIR)/mycomponent-canvasTeleoperateControl.Po en am__quote@
+ en AMDEP_TRUE@@am__include@ @am__quote en ./$(DEPDIR)/mycomponent-control_class.Po en am__quote@
+ en AMDEP_TRUE@@am__include@ @am__quote en ./$(DEPDIR)/mycomponent-gui.Po en am__quote@
+
+.cpp.o:
+ en am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ en am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ en am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ en am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ en am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ en am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ en am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ en am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ en am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mycomponent-control_class.o: control_class.cpp
+ en am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-control_class.o -MD -MP -MF $(DEPDIR)/mycomponent-control_class.Tpo -c -o mycomponent-control_class.o `test -f 'control_class.cpp' || echo '$(srcdir)/'`control_class.cpp
+ en am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/mycomponent-control_class.Tpo $(DEPDIR)/mycomponent-control_class.Po
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='control_class.cpp' object='mycomponent-control_class.o' libtool=no @AMDEPBACKSLASH@
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ en am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-control_class.o `test -f 'control_class.cpp' || echo '$(srcdir)/'`control_class.cpp
+
+mycomponent-control_class.obj: control_class.cpp
+ en am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-control_class.obj -MD -MP -MF $(DEPDIR)/mycomponent-control_class.Tpo -c -o mycomponent-control_class.obj `if test -f 'control_class.cpp'; then $(CYGPATH_W) 'control_class.cpp'; else $(CYGPATH_W) '$(srcdir)/control_class.cpp'; fi`
+ en am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/mycomponent-control_class.Tpo $(DEPDIR)/mycomponent-control_class.Po
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='control_class.cpp' object='mycomponent-control_class.obj' libtool=no @AMDEPBACKSLASH@
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ en am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-control_class.obj `if test -f 'control_class.cpp'; then $(CYGPATH_W) 'control_class.cpp'; else $(CYGPATH_W) '$(srcdir)/control_class.cpp'; fi`
+
+mycomponent-gui.o: gui.cpp
+ en am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-gui.o -MD -MP -MF $(DEPDIR)/mycomponent-gui.Tpo -c -o mycomponent-gui.o `test -f 'gui.cpp' || echo '$(srcdir)/'`gui.cpp
+ en am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/mycomponent-gui.Tpo $(DEPDIR)/mycomponent-gui.Po
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='gui.cpp' object='mycomponent-gui.o' libtool=no @AMDEPBACKSLASH@
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ en am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-gui.o `test -f 'gui.cpp' || echo '$(srcdir)/'`gui.cpp
+
+mycomponent-gui.obj: gui.cpp
+ en am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-gui.obj -MD -MP -MF $(DEPDIR)/mycomponent-gui.Tpo -c -o mycomponent-gui.obj `if test -f 'gui.cpp'; then $(CYGPATH_W) 'gui.cpp'; else $(CYGPATH_W) '$(srcdir)/gui.cpp'; fi`
+ en am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/mycomponent-gui.Tpo $(DEPDIR)/mycomponent-gui.Po
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='gui.cpp' object='mycomponent-gui.obj' libtool=no @AMDEPBACKSLASH@
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ en am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-gui.obj `if test -f 'gui.cpp'; then $(CYGPATH_W) 'gui.cpp'; else $(CYGPATH_W) '$(srcdir)/gui.cpp'; fi`
+
+mycomponent-camera.o: camera.cpp
+ en am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-camera.o -MD -MP -MF $(DEPDIR)/mycomponent-camera.Tpo -c -o mycomponent-camera.o `test -f 'camera.cpp' || echo '$(srcdir)/'`camera.cpp
+ en am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/mycomponent-camera.Tpo $(DEPDIR)/mycomponent-camera.Po
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='camera.cpp' object='mycomponent-camera.o' libtool=no @AMDEPBACKSLASH@
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ en am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-camera.o `test -f 'camera.cpp' || echo '$(srcdir)/'`camera.cpp
+
+mycomponent-camera.obj: camera.cpp
+ en am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-camera.obj -MD -MP -MF $(DEPDIR)/mycomponent-camera.Tpo -c -o mycomponent-camera.obj `if test -f 'camera.cpp'; then $(CYGPATH_W) 'camera.cpp'; else $(CYGPATH_W) '$(srcdir)/camera.cpp'; fi`
+ en am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/mycomponent-camera.Tpo $(DEPDIR)/mycomponent-camera.Po
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='camera.cpp' object='mycomponent-camera.obj' libtool=no @AMDEPBACKSLASH@
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ en am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-camera.obj `if test -f 'camera.cpp'; then $(CYGPATH_W) 'camera.cpp'; else $(CYGPATH_W) '$(srcdir)/camera.cpp'; fi`
+
+mycomponent-canvasTeleoperateControl.o: canvasTeleoperateControl.cpp
+ en am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-canvasTeleoperateControl.o -MD -MP -MF $(DEPDIR)/mycomponent-canvasTeleoperateControl.Tpo -c -o mycomponent-canvasTeleoperateControl.o `test -f 'canvasTeleoperateControl.cpp' || echo '$(srcdir)/'`canvasTeleoperateControl.cpp
+ en am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/mycomponent-canvasTeleoperateControl.Tpo $(DEPDIR)/mycomponent-canvasTeleoperateControl.Po
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='canvasTeleoperateControl.cpp' object='mycomponent-canvasTeleoperateControl.o' libtool=no @AMDEPBACKSLASH@
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ en am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-canvasTeleoperateControl.o `test -f 'canvasTeleoperateControl.cpp' || echo '$(srcdir)/'`canvasTeleoperateControl.cpp
+
+mycomponent-canvasTeleoperateControl.obj: canvasTeleoperateControl.cpp
+ en am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-canvasTeleoperateControl.obj -MD -MP -MF $(DEPDIR)/mycomponent-canvasTeleoperateControl.Tpo -c -o mycomponent-canvasTeleoperateControl.obj `if test -f 'canvasTeleoperateControl.cpp'; then $(CYGPATH_W) 'canvasTeleoperateControl.cpp'; else $(CYGPATH_W) '$(srcdir)/canvasTeleoperateControl.cpp'; fi`
+ en am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/mycomponent-canvasTeleoperateControl.Tpo $(DEPDIR)/mycomponent-canvasTeleoperateControl.Po
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='canvasTeleoperateControl.cpp' object='mycomponent-canvasTeleoperateControl.obj' libtool=no @AMDEPBACKSLASH@
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ en am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-canvasTeleoperateControl.obj `if test -f 'canvasTeleoperateControl.cpp'; then $(CYGPATH_W) 'canvasTeleoperateControl.cpp'; else $(CYGPATH_W) '$(srcdir)/canvasTeleoperateControl.cpp'; fi`
+
+mycomponent-canvasTeleoperateCameras.o: canvasTeleoperateCameras.cpp
+ en am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-canvasTeleoperateCameras.o -MD -MP -MF $(DEPDIR)/mycomponent-canvasTeleoperateCameras.Tpo -c -o mycomponent-canvasTeleoperateCameras.o `test -f 'canvasTeleoperateCameras.cpp' || echo '$(srcdir)/'`canvasTeleoperateCameras.cpp
+ en am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/mycomponent-canvasTeleoperateCameras.Tpo $(DEPDIR)/mycomponent-canvasTeleoperateCameras.Po
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='canvasTeleoperateCameras.cpp' object='mycomponent-canvasTeleoperateCameras.o' libtool=no @AMDEPBACKSLASH@
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ en am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-canvasTeleoperateCameras.o `test -f 'canvasTeleoperateCameras.cpp' || echo '$(srcdir)/'`canvasTeleoperateCameras.cpp
+
+mycomponent-canvasTeleoperateCameras.obj: canvasTeleoperateCameras.cpp
+ en am__fastdepCXX_TRUE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT mycomponent-canvasTeleoperateCameras.obj -MD -MP -MF $(DEPDIR)/mycomponent-canvasTeleoperateCameras.Tpo -c -o mycomponent-canvasTeleoperateCameras.obj `if test -f 'canvasTeleoperateCameras.cpp'; then $(CYGPATH_W) 'canvasTeleoperateCameras.cpp'; else $(CYGPATH_W) '$(srcdir)/canvasTeleoperateCameras.cpp'; fi`
+ en am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/mycomponent-canvasTeleoperateCameras.Tpo $(DEPDIR)/mycomponent-canvasTeleoperateCameras.Po
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='canvasTeleoperateCameras.cpp' object='mycomponent-canvasTeleoperateCameras.obj' libtool=no @AMDEPBACKSLASH@
+ en AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ en am__fastdepCXX_FALSE@	$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mycomponent_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o mycomponent-canvasTeleoperateCameras.obj `if test -f 'canvasTeleoperateCameras.cpp'; then $(CYGPATH_W) 'canvasTeleoperateCameras.cpp'; else $(CYGPATH_W) '$(srcdir)/canvasTeleoperateCameras.cpp'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-dist_confDATA: $(dist_conf_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(confdir)" || $(MKDIR_P) "$(DESTDIR)$(confdir)"
+	@list='$(dist_conf_DATA)'; test -n "$(confdir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(confdir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(confdir)" || exit $$?; \
+	done
+
+uninstall-dist_confDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_conf_DATA)'; test -n "$(confdir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(confdir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(confdir)" && rm -f $$files
+install-dist_gladeDATA: $(dist_glade_DATA)
+	@$(NORMAL_INSTALL)
+	test -z "$(gladedir)" || $(MKDIR_P) "$(DESTDIR)$(gladedir)"
+	@list='$(dist_glade_DATA)'; test -n "$(gladedir)" || list=; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(gladedir)'"; \
+	  $(INSTALL_DATA) $$files "$(DESTDIR)$(gladedir)" || exit $$?; \
+	done
+
+uninstall-dist_gladeDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(dist_glade_DATA)'; test -n "$(gladedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	test -n "$$files" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(gladedir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(gladedir)" && rm -f $$files
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(DATA)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(confdir)" "$(DESTDIR)$(gladedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_confDATA install-dist_gladeDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-dist_confDATA \
+	uninstall-dist_gladeDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am \
+	install-dist_confDATA install-dist_gladeDATA install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-binPROGRAMS uninstall-dist_confDATA \
+	uninstall-dist_gladeDATA
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/Ogre.log
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/Ogre.log	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/Ogre.log	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,238 @@
+22:44:26: Creating resource group General
+22:44:26: Creating resource group Internal
+22:44:26: Creating resource group Autodetect
+22:44:26: SceneManagerFactory for type 'DefaultSceneManager' registered.
+22:44:26: Registering ResourceManager for type Material
+22:44:26: Registering ResourceManager for type Mesh
+22:44:26: Registering ResourceManager for type Skeleton
+22:44:26: MovableObjectFactory for type 'ParticleSystem' registered.
+22:44:26: OverlayElementFactory for type Panel registered.
+22:44:26: OverlayElementFactory for type BorderPanel registered.
+22:44:26: OverlayElementFactory for type TextArea registered.
+22:44:26: Registering ResourceManager for type Font
+22:44:26: ArchiveFactory for archive type FileSystem registered.
+22:44:26: ArchiveFactory for archive type Zip registered.
+22:44:26: FreeImage version: 3.10.0
+22:44:26: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
+22:44:26: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2
+22:44:26: DDS codec registering
+22:44:26: Registering ResourceManager for type HighLevelGpuProgram
+22:44:26: Registering ResourceManager for type Compositor
+22:44:26: MovableObjectFactory for type 'Entity' registered.
+22:44:26: MovableObjectFactory for type 'Light' registered.
+22:44:26: MovableObjectFactory for type 'BillboardSet' registered.
+22:44:26: MovableObjectFactory for type 'ManualObject' registered.
+22:44:26: MovableObjectFactory for type 'BillboardChain' registered.
+22:44:26: MovableObjectFactory for type 'RibbonTrail' registered.
+22:44:26: OGRE EXCEPTION(6:FileNotFoundException): 'plugins.cfg' file not found! in ConfigFile::load at OgreConfigFile.cpp (line 84)
+22:44:26: plugins.cfg not found, automatic plugin loading disabled.
+22:44:26: *-*-* OGRE Initialising
+22:44:26: *-*-* Version 1.6.4 (Shoggoth)
+22:44:26: Loading library /usr/lib/OGRE/RenderSystem_GL.so
+22:44:26: Installing plugin: GL RenderSystem
+22:44:26: OpenGL Rendering Subsystem created.
+22:44:26: Plugin successfully installed
+22:44:26: Loading library /usr/lib/OGRE/Plugin_ParticleFX.so
+22:44:26: Installing plugin: ParticleFX
+22:44:26: Particle Emitter Type 'Point' registered
+22:44:26: Particle Emitter Type 'Box' registered
+22:44:26: Particle Emitter Type 'Ellipsoid' registered
+22:44:26: Particle Emitter Type 'Cylinder' registered
+22:44:26: Particle Emitter Type 'Ring' registered
+22:44:26: Particle Emitter Type 'HollowEllipsoid' registered
+22:44:26: Particle Affector Type 'LinearForce' registered
+22:44:26: Particle Affector Type 'ColourFader' registered
+22:44:26: Particle Affector Type 'ColourFader2' registered
+22:44:26: Particle Affector Type 'ColourImage' registered
+22:44:26: Particle Affector Type 'ColourInterpolator' registered
+22:44:26: Particle Affector Type 'Scaler' registered
+22:44:26: Particle Affector Type 'Rotator' registered
+22:44:26: Particle Affector Type 'DirectionRandomiser' registered
+22:44:26: Particle Affector Type 'DeflectorPlane' registered
+22:44:26: Plugin successfully installed
+22:44:26: Added resource location '/usr/local/share/gazebo/Media' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/fonts' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/materials/programs' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/materials/scripts' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/materials/textures' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/models' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/sets' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/maps' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/sets/..' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/sets/.' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/sets/pioneer2at' of type 'FileSystem' to resource group 'General'
+22:44:26: Added resource location '/usr/local/share/gazebo/Media/sets/pioneer2dx' of type 'FileSystem' to resource group 'General'
+22:44:26: CPU Identifier & Features
+22:44:26: -------------------------
+22:44:26:  *   CPU ID: GenuineIntel: Intel(R) Core(TM)2 Quad  CPU   Q8200  @ 2.33GHz
+22:44:26:  *      SSE: yes
+22:44:26:  *     SSE2: yes
+22:44:26:  *     SSE3: yes
+22:44:26:  *      MMX: yes
+22:44:26:  *   MMXEXT: yes
+22:44:26:  *    3DNOW: no
+22:44:26:  * 3DNOWEXT: no
+22:44:26:  *     CMOV: yes
+22:44:26:  *      TSC: yes
+22:44:26:  *      FPU: yes
+22:44:26:  *      PRO: yes
+22:44:26:  *       HT: no
+22:44:26: -------------------------
+22:44:26: ******************************
+*** Starting GLX Subsystem ***
+******************************
+22:44:26: GLRenderSystem::_createRenderWindow "OgreWindow(0)", 548x480 windowed  miscParams: FSAA=2 externalWindowHandle=90177567 
+22:44:26: GLXWindow::create: The externalWindowHandle parameter is deprecated.
+Use the parentWindowHandle or currentGLContext parameter instead.
+22:44:26: GLXWindow::create used FBConfigID = 125
+22:44:26: GL_VERSION = 3.3.0 NVIDIA 290.10
+22:44:26: GL_VENDOR = NVIDIA Corporation
+22:44:26: GL_RENDERER = GeForce 9600 GT/PCI/SSE2
+22:44:26: GL_EXTENSIONS = GL_ARB_base_instance GL_ARB_blend_func_extended GL_ARB_color_buffer_float GL_ARB_compatibility GL_ARB_compressed_texture_pixel_storage GL_ARB_conservative_depth GL_ARB_copy_buffer GL_ARB_depth_buffer_float GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers GL_ARB_draw_elements_base_vertex GL_ARB_draw_instanced GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_framebuffer_object GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4 GL_ARB_get_program_binary GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_map_buffer_alignment GL_ARB_map_buffer_range GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_occlusion_query2 GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex GL_ARB_robustness GL_AR!
 B_sampler_objects GL_ARB_seamless_cube_map GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_objects GL_ARB_shading_language_100 GL_ARB_shading_language_420pack GL_ARB_shading_language_include GL_ARB_shading_language_packing GL_ARB_shadow GL_ARB_sync GL_ARB_texture_border_clamp GL_ARB_texture_buffer_object GL_ARB_texture_compression GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample GL_ARB_texture_non_power_of_two GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_swizzle GL_ARB_timer_query GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_vertex_type_2_10_10_10_rev GL_ARB_viewport_ar!
 ray GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_texture_float!
  GL_ATI_texture_mirror_once GL_S3_s3tc GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color GL_EXT_blend_equation_separate GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_Cg_shader GL_EXT_depth_bounds_test GL_EXT_direct_state_access GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXTX_framebuffer_mixed_formats GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters GL_EXT_gpu_shader4 GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_shader_objects GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EX!
 T_texture_array GL_EXT_texture_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_latc GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_mirror_clamp GL_EXT_texture_object GL_EXT_texture_shared_exponent GL_EXT_texture_sRGB GL_EXT_texture_sRGB_decode GL_EXT_texture_storage GL_EXT_texture_swizzle GL_EXT_texture_type_2_10_10_10_REV GL_EXT_timer_query GL_EXT_vertex_array GL_EXT_vertex_array_bgra GL_EXT_x11_sync_object GL_EXT_import_sync_object GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_alpha_test GL_NV_blend_minmax GL_NV_blend_square GL_NV_complex_primitives GL_NV_conditional_render GL_NV_copy_depth_to_color GL_NV_copy_image GL_NV_depth_buffer_float GL_NV_depth_cl!
 amp GL_NV_explicit_multisample GL_NV_fbo_color_attachments GL_NV_fence !
 GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragdepth GL_NV_fragment_program GL_NV_fragment_program_option GL_NV_fragment_program2 GL_NV_framebuffer_multisample_coverage GL_NV_geometry_shader4 GL_NV_gpu_program4 GL_NV_half_float GL_NV_light_max_exponent GL_NV_multisample_coverage GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_parameter_buffer_object GL_NV_parameter_buffer_object2 GL_NV_path_rendering GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_shader_buffer_load GL_NV_texgen_reflection GL_NV_texture_barrier GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_expand_normal GL_NV_texture_lod_clamp GL_NV_texture_multisample GL_NV_texture_rectangle GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_transform_feedback GL_NV_vdpau_interop GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_buffer_unified_memory GL_!
 NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_NV_vertex_program3 GL_NVX_conditional_render GL_NVX_gpu_memory_info GL_OES_depth24 GL_OES_depth32 GL_OES_depth_texture GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_get_program_binary GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_array_object GL_OES_vertex_half_float GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum 
+22:44:26: Supported GLX extensions: GLX_EXT_visual_info GLX_EXT_visual_rating GLX_SGIX_fbconfig GLX_SGIX_pbuffer GLX_SGI_video_sync GLX_SGI_swap_control GLX_EXT_swap_control GLX_EXT_texture_from_pixmap GLX_ARB_create_context GLX_ARB_create_context_profile GLX_EXT_create_context_es2_profile GLX_ARB_create_context_robustness GLX_ARB_multisample GLX_NV_float_buffer GLX_ARB_fbconfig_float GLX_EXT_framebuffer_sRGB GLX_ARB_get_proc_address 
+22:44:26: ***************************
+22:44:26: *** GL Renderer Started ***
+22:44:26: ***************************
+22:44:26: Registering ResourceManager for type GpuProgram
+22:44:26: GLSL support detected
+22:44:26: GL: Using GL_EXT_framebuffer_object for rendering to textures (best)
+22:44:26: FBO PF_UNKNOWN depth/stencil support: D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_L8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A4L4 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_BYTE_LA depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_R5G6B5 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_B5G6R5 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A4R4G4B4 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A1R5G5B5 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_R8G8B8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_B8G8R8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A8R8G8B8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_B8G8R8A8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A2R10G10B10 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_A2B10G10R10 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT16_RGB depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT16_RGBA depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT32_RGB depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT32_RGBA depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_X8R8G8B8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_X8B8G8R8 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_SHORT_RGBA depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_R3G3B2 depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT16_R depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT32_R depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT16_GR depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_FLOAT32_GR depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: FBO PF_SHORT_RGB depth/stencil support: D0S0 D16S0 D24S0 D32S0 Packed-D24S8 
+22:44:26: [GL] : Valid FBO targets PF_UNKNOWN PF_L8 PF_A8 PF_A4L4 PF_BYTE_LA PF_R5G6B5 PF_B5G6R5 PF_A4R4G4B4 PF_A1R5G5B5 PF_R8G8B8 PF_B8G8R8 PF_A8R8G8B8 PF_B8G8R8A8 PF_A2R10G10B10 PF_A2B10G10R10 PF_FLOAT16_RGB PF_FLOAT16_RGBA PF_FLOAT32_RGB PF_FLOAT32_RGBA PF_X8R8G8B8 PF_X8B8G8R8 PF_SHORT_RGBA PF_R3G3B2 PF_FLOAT16_R PF_FLOAT32_R PF_FLOAT16_GR PF_FLOAT32_GR PF_SHORT_RGB 
+22:44:26: RenderSystem capabilities
+22:44:26: -------------------------
+22:44:26: RenderSystem Name: OpenGL Rendering Subsystem
+22:44:26: GPU Vendor: nvidia
+22:44:26: Device Name: GeForce 9600 GT/PCI/SSE2
+22:44:26: Driver Version: 3.3.0.0
+22:44:26:  * Fixed function pipeline: yes
+22:44:26:  * Hardware generation of mipmaps: yes
+22:44:26:  * Texture blending: yes
+22:44:26:  * Anisotropic texture filtering: yes
+22:44:26:  * Dot product texture operation: yes
+22:44:26:  * Cube mapping: yes
+22:44:26:  * Hardware stencil buffer: no
+22:44:26:  * Hardware vertex / index buffers: yes
+22:44:26:  * Vertex programs: yes
+22:44:26:  * Fragment programs: yes
+22:44:26:  * Geometry programs: yes
+22:44:26:  * Supported Shader Profiles: arbfp1 arbvp1 fp20 fp30 fp40 glsl gp4gp gpu_gp nvgp4 vp30 vp40
+22:44:26:  * Texture Compression: yes
+22:44:26:    - DXT: yes
+22:44:26:    - VTC: yes
+22:44:26:  * Scissor Rectangle: yes
+22:44:26:  * Hardware Occlusion Query: yes
+22:44:26:  * User clip planes: yes
+22:44:26:  * VET_UBYTE4 vertex element type: yes
+22:44:26:  * Infinite far plane projection: yes
+22:44:26:  * Hardware render-to-texture: yes
+22:44:26:  * Floating point textures: yes
+22:44:26:  * Non-power-of-two textures: yes
+22:44:26:  * Volume textures: yes
+22:44:26:  * Multiple Render Targets: 8
+22:44:26:    - With different bit depths: yes
+22:44:26:  * Point Sprites: yes
+22:44:26:  * Extended point parameters: yes
+22:44:26:  * Max Point Size: 63.375
+22:44:26:  * Vertex texture fetch: yes
+22:44:26:    - Max vertex textures: 32
+22:44:26:    - Vertex textures shared: yes
+22:44:26:  * Render to Vertex Buffer : yes
+22:44:26:  * GL 1.5 without VBO workaround: no
+22:44:26:  * Frame Buffer objects: yes
+22:44:26:  * Frame Buffer objects (ARB extension): no
+22:44:26:  * Frame Buffer objects (ATI extension): no
+22:44:26:  * PBuffer suppport: no
+22:44:26:  * GL 1.5 without HW-occlusion workaround: no
+22:44:26: Registering ResourceManager for type Texture
+22:44:26: ResourceBackgroundQueue - threading disabled
+22:44:26: Particle Renderer Type 'billboard' registered
+22:44:26: Parsing scripts for resource group Autodetect
+22:44:26: Finished parsing scripts for resource group Autodetect
+22:44:26: Parsing scripts for resource group General
+22:44:26: Parsing script Gazebo.material
+22:44:26: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DepthMap.vert in resource group General or any other group. in ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line 763)
+22:44:26: High-level program Gazebo/DepthMapVS encountered an error during loading and is thus not supported.
+OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DepthMap.vert in resource group General or any other group. in ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line 763)
+22:44:26: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at OgreGpuProgram.cpp (line 1087)
+22:44:26: Compiler error: invalid parameters in Gazebo.material(9): setting of constant failed
+22:44:26: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at OgreGpuProgram.cpp (line 1087)
+22:44:26: Compiler error: invalid parameters in Gazebo.material(10): setting of constant failed
+22:44:26: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at OgreGpuProgram.cpp (line 1087)
+22:44:26: Compiler error: invalid parameters in Gazebo.material(11): setting of constant failed
+22:44:26: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DepthMap.frag in resource group General or any other group. in ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line 763)
+22:44:26: High-level program Gazebo/DepthMapFS encountered an error during loading and is thus not supported.
+OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DepthMap.frag in resource group General or any other group. in ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line 763)
+22:44:26: Compiler error: unknown error in Gazebo.material(58): token "lightning" is not recognized
+22:44:26: Compiler error: invalid parameters in Gazebo.material(59)
+22:44:26: GLSL compiling: Gazebo/PointLightFS
+22:44:26: GLSL compiled : Gazebo/PointLightFS
+22:44:26: GLSL compiling: Gazebo/PointLightVS
+22:44:26: GLSL compiled : Gazebo/PointLightVS
+22:44:26: Compiler error: invalid parameters in Gazebo.material(360): depth_write third argument must be "true", "false", "yes", "no", "on", or "off"
+22:44:26: Compiler error: invalid parameters in Gazebo.material(377): depth_write third argument must be "true", "false", "yes", "no", "on", or "off"
+22:44:26: Parsing script Gazebo.fontdef
+22:44:26: Parsing script sample.fontdef
+22:44:26: Bad attribute line: glyph	 	0.152344	0.125	0.160156	0.1875 in font Ogre
+22:44:26: Finished parsing scripts for resource group General
+22:44:26: Parsing scripts for resource group Internal
+22:44:26: Finished parsing scripts for resource group Internal
+22:44:26: WARNING: Stencil shadows were requested, but this device does not have a hardware stencil. Shadows disabled.
+22:44:26: Texture: clouds.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
+22:44:26: Font Arialusing texture size 512x512
+22:44:26: Info: Freetype returned null for character 160 in font Arial
+22:44:26: Texture: ArialTexture: Loading 1 faces(PF_BYTE_LA,512x512x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,512x512x1.
+22:44:27: Texture: sigueLineas.png: Loading 1 faces(PF_R8G8B8,299x234x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,299x234x1.
+22:44:27: Texture: lightwood.png: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
+22:44:27: Mesh: Loading Pioneer2dx/chassis.mesh.
+22:44:27: Can't assign material Material.002 to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_949_VISUAL_950_VISUAL_951 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading Pioneer2at/chassis_top.mesh.
+22:44:27: Can't assign material Material.003 to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_949_VISUAL_950_VISUAL_952 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading Pioneer2at/sonarbank.mesh.
+22:44:27: Can't assign material default to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_949_VISUAL_950_VISUAL_953 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material default to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_949_VISUAL_950_VISUAL_954 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading Pioneer2dx/tire.mesh.
+22:44:27: Can't assign material Material.004 to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_956_VISUAL_957_VISUAL_958 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading Pioneer2at/wheel.mesh.
+22:44:27: Can't assign material Material.010 to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_956_VISUAL_957_VISUAL_959 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material.004 to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_962_VISUAL_963_VISUAL_964 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material.010 to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_962_VISUAL_963_VISUAL_965 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading sicklms200.mesh.
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_975_VISUAL_976_VISUAL_977_VISUAL_978 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading sonyvid30/sonyvid30_bottom.mesh.
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_982_VISUAL_983_VISUAL_984_VISUAL_985 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading sonyvid30/sonyvid30_mid.mesh.
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_982_VISUAL_987_VISUAL_988_VISUAL_989 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Mesh: Loading sonyvid30/sonyvid30_top.mesh.
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_982_VISUAL_991_VISUAL_992_VISUAL_993 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material.001/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_982_VISUAL_991_VISUAL_992_VISUAL_993 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_1001_VISUAL_1002_VISUAL_1003_VISUAL_1004 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_1001_VISUAL_1006_VISUAL_1007_VISUAL_1008 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_1001_VISUAL_1010_VISUAL_1011_VISUAL_1012 because this Material does not exist. Have you forgotten to define it in a .material script?
+22:44:27: Can't assign material Material.001/SOLID to SubEntity of ENTITY_Ogre/SceneRoot_VISUAL_948_VISUAL_1001_VISUAL_1010_VISUAL_1011_VISUAL_1012 because this Material does not exist. Have you forgotten to define it in a .material script?

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/camera.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/camera.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/camera.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,378 @@
+/*  
+ * Copyright (C) 2008 Roberto Calvo Palomino
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *   
+ *   Authors : Roberto Calvo Palomino <rocapal en gsyc.escet.urjc.es>,
+ * 			   Jose María Cañas Plaza <jmplaza en gsyc.es>
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include "camera.h"
+
+#define DEBUG(x...) printf(x)
+#define N_LINES_CAM 16
+#define DESVIACIONY 0
+#define DESVIACIONZ 0
+
+
+camera::camera (char* configFile): m_nameFile(NULL),
+								   m_R (NULL),
+								   m_RES (NULL),
+								   m_RT (NULL),
+								   m_T (NULL),
+								   m_K (NULL),
+								   m_pos (NULL)
+{
+	if (configFile!=NULL)
+	{
+		m_nameFile = (char*) malloc (sizeof(char)*(strlen(configFile)+1));
+		if (m_nameFile)
+		{
+			strncpy(m_nameFile,configFile,strlen(configFile));
+			m_nameFile[strlen(configFile)]='\0';
+		}
+	}
+	
+	m_R = gsl_matrix_alloc(3,3);	
+	m_K = gsl_matrix_alloc(3,3);
+  	m_T = gsl_matrix_alloc(3,4);
+  	m_RT = gsl_matrix_alloc(4,4);
+  	m_RES = gsl_matrix_alloc(3,4);
+  	
+	m_pos = gsl_vector_alloc(3);	
+	
+}
+
+/// \brief Destructor
+camera::~camera()
+{
+	if (m_nameFile)
+		free(m_nameFile);
+	
+	if (m_R)
+		gsl_matrix_free(m_R);
+		
+	if (m_RES)
+		gsl_matrix_free(m_RES);
+		
+	if (m_RT)
+		gsl_matrix_free(m_RT);
+		
+	if (m_T)
+		gsl_matrix_free(m_T);
+		
+	if (m_K)
+		gsl_matrix_free(m_K);
+		
+	if (m_pos)
+		gsl_vector_free(m_pos);
+		
+}
+
+TPinHoleCamera& camera::readConfig()
+{
+	
+	const int limit = 256;	
+	char word1[limit],word2[limit];
+	int i=0;
+	char buffer_file[limit];  
+	int number;
+	FILE *myfile;
+	int k=0;
+	int counter=0;
+
+	if ((myfile=fopen(m_nameFile,"r"))==NULL){
+		printf("Cannot find camera configuration file\n");
+		//return -1;
+	}
+
+
+	DEBUG("camera::readConfig: %s\n",m_nameFile);	
+
+	do{
+		again:
+		i=0;
+		buffer_file[0]=fgetc(myfile);
+		if (feof(myfile)) 
+			k=EOF;
+		if (buffer_file[0]==(char)255) 
+			k=EOF; 
+		if (buffer_file[0]==' '){
+			while(buffer_file[0]==' ') 
+				buffer_file[0]=fgetc(myfile);
+		}
+		if (buffer_file[0]=='#'){
+			while(buffer_file[0]=fgetc(myfile)!='\n'); 
+			goto again;
+		}
+		if (buffer_file[0]==' '){
+			while(buffer_file[0]==' ') 
+				buffer_file[0]=fgetc(myfile);
+		}
+	  	if (buffer_file[0]=='\t'){
+			while(buffer_file[0]=='\t') 
+				buffer_file[0]=fgetc(myfile);
+		}
+
+	
+
+
+ /* Captures a line and then we will process it with sscanf checking that the last character is \n. We can't doit with fscanf because this function does not difference \n from blank space. */
+		while ((buffer_file[i]!='\n')&&(buffer_file[i] != (char)255) && (i<limit-1)) {
+			buffer_file[++i]=fgetc(myfile);
+		}
+		buffer_file[i]='\n';
+	
+	  
+		if (i >= limit-1) { 
+			printf("%s...\n", buffer_file); 
+			printf ("Line too long in config file!\n"); 
+			exit(-1);
+		}
+		buffer_file[++i]='\0';
+	
+		if (sscanf(buffer_file,"%s",word1)!=1){
+		}
+		else {
+			number=sscanf(buffer_file,"%s %s ",word1,word2);
+			if (strcmp(word1,"positionX")==0){
+				cam.position.X=atof(word2);
+				counter++;
+			}
+			else if (strcmp(word1,"positionY")==0){
+				cam.position.Y=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"positionZ")==0){
+				cam.position.Z=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"positionH")==0){
+				cam.position.H=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"FOApositionX")==0){
+				cam.foa.X=atof(word2);
+				counter++;;
+			} 
+			else if (strcmp(word1,"FOApositionY")==0){
+				cam.foa.Y=atof(word2)-DESVIACIONY;
+				counter++;
+			} 
+			else if (strcmp(word1,"FOApositionZ")==0){
+				cam.foa.Z=atof(word2)-DESVIACIONZ;
+				counter++;
+			} 
+			else if (strcmp(word1,"FOApositionH")==0){
+				cam.foa.H=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"roll")==0){
+				cam.roll=atof(word2);
+				//cam.roll=3.14/2;
+				counter++;
+			} 
+			else if (strcmp(word1,"fx")==0){
+				cam.fdistx=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"fy")==0){
+				cam.fdisty=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"skew")==0){
+				cam.skew=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"u0")==0){
+				cam.u0=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"v0")==0){
+				cam.v0=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"columns")==0){
+				cam.columns=atof(word2);
+				counter++;
+			} 
+			else if (strcmp(word1,"rows")==0){
+				cam.rows=atof(word2);
+				counter++;
+			} 
+			else{
+				printf("NaoVision: line: %s not valid in camera configuration file\n",buffer_file);
+			}
+		}
+	} while(k!=EOF);	
+
+	update_camera_matrix(&cam);
+	//if (counter==N_LINES_CAM){
+		//return 1;
+	//}
+
+	
+	//updateMatrix();
+	
+	//return true;
+	return cam;
+}
+
+void camera::updateMatrix()
+{
+/*
+	// Fill matrix T 
+	gsl_matrix_set(m_T, 0,0,1);
+	gsl_matrix_set(m_T, 1,1,1);
+	gsl_matrix_set(m_T, 2,2,1);
+	
+	gsl_matrix_set(m_T,0,3,gsl_vector_get(m_pos,0));
+	gsl_matrix_set(m_T,1,3,gsl_vector_get(m_pos,1));
+	gsl_matrix_set(m_T,2,3,gsl_vector_get(m_pos,2));	
+	
+	// Multiplicate R * T  = RES 
+	gsl_linalg_matmult (m_R,m_T,m_RES);	
+	
+	
+	for (int i=0;i<3;i++)
+    	for (int j=0;j<4;j++)
+      		gsl_matrix_set(m_RT,i,j,gsl_matrix_get(m_RES,i,j));
+      		
+	// set 0001 in the last row of RT 
+	gsl_matrix_set(m_RT,3,0,0);
+	gsl_matrix_set(m_RT,3,1,0);
+	gsl_matrix_set(m_RT,3,2,0);
+	gsl_matrix_set(m_RT,3,3,1);
+	
+	//gsl_matrix_set(m_K,0,2,142.60000610);
+	//gsl_matrix_set(m_K,1,2,150.39999390);
+	
+	//gsl_matrix_set(m_K,1,1,gsl_matrix_get(m_K,0,0));
+	gsl_matrix_set(m_K,0,1,0.0);
+ */   
+	
+}
+
+TPinHoleCamera& camera::getProgeoCam()
+{
+/*	
+	HPoint3D positionCam;
+	
+	positionCam.X= -gsl_vector_get(m_pos,0);
+	positionCam.Y= -gsl_vector_get(m_pos,1);
+	positionCam.Z= -gsl_vector_get(m_pos,2);
+	positionCam.H= 0.0;	
+	
+	m_progeoCam.position = positionCam;
+	
+	// Seting intrensic matrix
+	m_progeoCam.k11 = gsl_matrix_get(m_K,0,0);
+	m_progeoCam.k12 = gsl_matrix_get(m_K,0,1);
+	m_progeoCam.k13 = gsl_matrix_get(m_K,0,2);
+	m_progeoCam.k14 = 0;
+	
+	m_progeoCam.k21 = gsl_matrix_get(m_K,1,0);
+	m_progeoCam.k22 = gsl_matrix_get(m_K,1,1);
+	m_progeoCam.k23 = gsl_matrix_get(m_K,1,2);
+	m_progeoCam.k24 = 0;
+	
+	m_progeoCam.k31 = gsl_matrix_get(m_K,2,0);
+	m_progeoCam.k32 = gsl_matrix_get(m_K,2,1);
+	m_progeoCam.k33 = gsl_matrix_get(m_K,2,2);
+	m_progeoCam.k34 = 0;
+	
+	// Seting extrensic
+	m_progeoCam.rt11 = gsl_matrix_get(m_RT,0,0);
+	m_progeoCam.rt12 = gsl_matrix_get(m_RT,0,1);
+	m_progeoCam.rt13 = gsl_matrix_get(m_RT,0,2);
+	m_progeoCam.rt14 = gsl_matrix_get(m_RT,0,3);
+
+	m_progeoCam.rt21 = gsl_matrix_get(m_RT,1,0);
+	m_progeoCam.rt22 = gsl_matrix_get(m_RT,1,1);
+	m_progeoCam.rt23 = gsl_matrix_get(m_RT,1,2);
+	m_progeoCam.rt24 = gsl_matrix_get(m_RT,1,3);
+
+	m_progeoCam.rt31 = gsl_matrix_get(m_RT,2,0);
+	m_progeoCam.rt32 = gsl_matrix_get(m_RT,2,1);
+	m_progeoCam.rt33 = gsl_matrix_get(m_RT,2,2);
+	m_progeoCam.rt34 = gsl_matrix_get(m_RT,2,3);
+
+	m_progeoCam.rt41 = gsl_matrix_get(m_RT,3,0);
+	m_progeoCam.rt42 = gsl_matrix_get(m_RT,3,1);
+	m_progeoCam.rt43 = gsl_matrix_get(m_RT,3,2);
+	m_progeoCam.rt44 = gsl_matrix_get(m_RT,3,3);
+	
+	return m_progeoCam;
+*/	
+}
+
+void camera::test()
+{
+	
+	HPoint3D point3D;
+	HPoint2D point2D;
+	
+	point3D.X = 10;
+	point3D.Y = 10;
+	point3D.Z = 10;
+	point3D.H = 1;
+	
+	printf ("======== TEST 1 ========\n");	
+	
+	if (project(point3D, &point2D, cam))
+		printf("Project a 2D: %2.2f,%2.2f,%2.2f \n",point2D.x,point2D.y,point2D.h);	
+	else
+		printf("Error in project\n");
+	
+    point2D.h=1.0;
+	if (backproject(&point3D,point2D,cam)!=-1)
+		printf("Backproject a 3D (de nuevo): %.2f,%.2f,%.2f,%.2f \n",point3D.X, point3D.Y, point3D.Z, point3D.H);
+	else
+		printf("Error in backproject\n");
+		
+	printf ("======== TEST 2 ========\n");
+	
+	point2D.x = 85.;
+	point2D.y = 154.;
+	point2D.h = 1.;
+	
+	printf ("Pto en 2D: %2.2f,%2.2f,%2.2f \n",point2D.x,point2D.y,point2D.h);
+	
+	if (backproject(&point3D,point2D,cam)!=-1)
+		printf("Backproject a 3D: %.2f,%.2f,%.2f,%.2f \n",point3D.X, point3D.Y, point3D.Z, point3D.H);
+	else
+		printf("Error in backproject\n");
+			
+	if (project(point3D, &point2D, cam))
+		printf("Project a 2D (de nuevo): %2.2f,%2.2f,%2.2f \n",point2D.x,point2D.y,point2D.h);	
+	else
+		printf("Error in project\n");
+
+
+}
+
+
+
+
+
+
+
+
+
+
+
+

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/camera.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/camera.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/camera.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,88 @@
+
+/*  
+ * Copyright (C) 2008 Roberto Calvo Palomino
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, either version 3 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *   
+ *   Authors : Roberto Calvo Palomino <rocapal en gsyc.escet.urjc.es>,
+ * 			   Jose María Cañas Plaza <jmplaza en gsyc.es>
+ *
+ */
+ 
+#ifndef CAMERA_H_
+#define CAMERA_H_
+
+/**
+	\class camera
+	\brief This class implement a camera instance  
+	\autor Roberto Calvo <rocapal en gsyc.es>
+	\date  17/05/2008
+**/
+
+#include <gsl/gsl_linalg.h>
+#include <gsl/gsl_multifit.h>
+
+extern "C"
+{
+#include "progeo/progeo.h"
+}
+
+class camera
+{
+	public:
+		/// \brief Constructor
+		camera (char* configFile);
+		
+		/// \brief Destructor
+		~camera();
+		
+		/// \brief Reaf file config and fill the matrix R and K
+		TPinHoleCamera& readConfig();
+		
+		/// \brief Return a progeo camera with configurated matrix
+		TPinHoleCamera& getProgeoCam();
+		
+		/// \brief Do test of cams
+		void test();
+
+	private:
+	
+		/// \brief Update Matrix
+		void updateMatrix();
+		
+		/// \brief 
+		//TPinHoleCamera m_progeoCam;
+		TPinHoleCamera cam;
+		/// \brief name file
+		char* m_nameFile;
+		
+		/// \brief R Matrix
+		gsl_matrix	*m_R; 
+
+		/// \brief aux Matrix
+		gsl_matrix	*m_RES; 
+
+		/// \brief RT Matrix
+		gsl_matrix	*m_RT;
+
+		/// \brief T Matrix
+		gsl_matrix	*m_T;
+
+		/// \brief K Matrix
+		gsl_matrix	*m_K;
+	
+		/// \brief Position vector of cam (x,y,z) 
+		gsl_vector *m_pos;
+};
+#endif /*CAMERA_H_*/

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasLaser.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasLaser.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasLaser.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,189 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#include "canvasLaser.h"
+
+namespace mycomponent {
+
+	class Control;
+	class Gui;
+	
+	    
+        void CanvasLaser::UpdateLaser(Control *control){
+            this->control=control;
+	    //this->gui=gui;
+            
+            
+        }
+
+	CanvasLaser::CanvasLaser(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& builder)
+  		: Gnome::Canvas::CanvasAA(cobject),m_canvasgroup(*(root()), 0, 0)
+	{
+            
+			
+		// create some elements there
+                Gnome::Canvas::Points m_points_green;
+		Gnome::Canvas::Points m_points_black;
+                int i,j;
+                double x1,y1,x2,y2;
+                bool borde=false;
+		this->previous_x=50;
+		this->previous_y=50;
+  		m_points_green.push_back(Gnome::Art::Point(-50, -50));
+  		m_points_green.push_back(Gnome::Art::Point(-50, 150));
+  		m_points_green.push_back(Gnome::Art::Point(-50, -50));
+  		m_points_green.push_back(Gnome::Art::Point(150, -50));
+  		m_points_green.push_back(Gnome::Art::Point(150, 150));
+  		m_points_green.push_back(Gnome::Art::Point(-50, 150));
+		
+		m_points_black.push_back(Gnome::Art::Point(50,-50));
+		m_points_black.push_back(Gnome::Art::Point(50,150));
+		m_points_black.push_back(Gnome::Art::Point(50,50));
+		
+		m_points_black.push_back(Gnome::Art::Point(-50,50));
+		m_points_black.push_back(Gnome::Art::Point(150,50));
+		
+		
+                j=0;
+                for(i=-50;i<=150;i=i+20){
+                            if(borde){
+                                m_points_green.push_back(Gnome::Art::Point(i, -50));
+                                
+                                m_points_green.push_back(Gnome::Art::Point(i, 150));
+                                borde=false;
+                            }else{
+                                m_points_green.push_back(Gnome::Art::Point(i, 150));                        
+                                
+                                m_points_green.push_back(Gnome::Art::Point(i, -50));
+                                borde=true;
+                            }
+                }
+                
+                for(i=-50;i<=150;i=i+20){
+                        
+                            if(borde){
+                                m_points_green.push_back(Gnome::Art::Point(-50, i));
+                                
+                                m_points_green.push_back(Gnome::Art::Point(150, i));
+                                borde=false;
+                            }else{
+                                m_points_green.push_back(Gnome::Art::Point(150, i));                        
+                                
+                                m_points_green.push_back(Gnome::Art::Point(-50, i));
+                                borde=true;
+                            }
+                }
+		        //pthread_mutex_lock(&control->controlGui);
+
+	//printf("%d\n",this->control->laserDataGui->distanceData[90]);
+		        //pthread_mutex_unlock(&control->controlGui);
+
+
+
+  		// we want to use the stream like interface
+  		using namespace Gnome::Canvas;
+                
+  		m_line_green = new Gnome::Canvas::Line(m_canvasgroup, m_points_green);
+  		*m_line_green << Properties::fill_color("gray")
+		  		<< Properties::width_pixels(1);
+				
+		m_line_black = new Gnome::Canvas::Line(m_canvasgroup, m_points_black);
+  		*m_line_black << Properties::fill_color("Black")
+		  		<< Properties::width_pixels(1);
+                                
+                               
+                
+		m_text = new Gnome::Canvas::Ellipse(m_canvasgroup,35, 35,60,60);
+  		*m_text << Properties::fill_color("black");
+ 		
+		//Connecting events
+		m_text->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &CanvasLaser::on_canvas_event),m_text));
+
+                
+
+	}
+
+	CanvasLaser::~CanvasLaser()
+	{
+  		delete m_line_green;
+		delete m_line_black;
+  		delete m_text;
+	}
+
+	bool CanvasLaser::on_canvas_event(GdkEvent * event, Gnome::Canvas::Item * item)
+	{
+		/* Static variables for drag-and-drop */
+  		static gboolean dragging = FALSE;
+  		//static double this->previous_x, this->previous_y;
+ 		double event_x = event->button.x;
+  		double event_y = event->button.y;
+		
+		
+		
+/*
+		switch (event->type)
+  		{
+  			case GDK_BUTTON_PRESS:
+    			if (event->button.button == 1)
+    			{
+      				GdkCursor *cursor;
+
+      				// Store these coordinates for later... 
+      				this->previous_x = event_x;
+      				this->previous_y = event_y;
+      				cursor = gdk_cursor_new(GDK_FLEUR);
+      				item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, event->button.time);
+      				gdk_cursor_destroy(cursor);
+      				dragging = TRUE;
+    			}
+    			break;
+
+  			case GDK_MOTION_NOTIFY:
+    			if (dragging && (event->motion.state & GDK_BUTTON1_MASK))
+    			{
+      				item->move(event_x - this->previous_x,
+        			event_y - this->previous_y);
+
+      				// Remember these for the next pass 
+      				this->previous_x = event_x;
+      				this->previous_y = event_y;
+				this->moved=1;
+
+    			}
+    			break;
+
+  			case GDK_BUTTON_RELEASE:
+    			item->ungrab(event->button.time);
+    			dragging = FALSE;
+    			break;
+
+  			default:
+    			break;
+  		}
+		
+ */		
+
+  		return FALSE;
+	}
+	
+
+
+}//namespace

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasLaser.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasLaser.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasLaser.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,62 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#ifndef MYCOMPONENT_CANVASLASER_H
+#define MYCOMPONENT_CANVASLASER_H
+
+#include <string>
+#include <iostream>
+#include <gtkmm.h>
+#include <libglademm.h>
+#include <IceUtil/Thread.h>
+#include <IceUtil/Time.h>
+#include <jderobot/camera.h>
+#include <colorspaces/colorspacesmm.h>
+#include <libgnomecanvasmm.h>
+#include "control_class.h"
+#include "gui.h"
+
+
+namespace mycomponent {
+	
+	class CanvasLaser : public Gnome::Canvas::CanvasAA 
+		{
+			public:
+                                void UpdateLaser(Control *control);
+				CanvasLaser(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& builder);
+				virtual ~CanvasLaser();
+				double previous_x;
+				double previous_y;
+				Gnome::Canvas::Ellipse *m_text;
+				bool moved;
+                                Control* control;
+			protected:
+				bool on_canvas_event(GdkEvent * event, Gnome::Canvas::Item * item);
+	
+				Gnome::Canvas::Group m_canvasgroup;
+				Gnome::Canvas::Line *m_line_green;
+				Gnome::Canvas::Line *m_line_black;
+		};
+
+
+} // namespace
+
+#endif /*MYCOMPONENT_CANVASLASER_H*/

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateCameras.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateCameras.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateCameras.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,168 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#include "canvasTeleoperateCameras.h"
+
+namespace mycomponent {
+
+	
+
+	CanvasControlCameras::CanvasControlCameras(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& builder)
+  		: Gnome::Canvas::CanvasAA(cobject),m_canvasgroup(*(root()), 0, 0)
+	{ 		
+		// create some elements there
+                Gnome::Canvas::Points m_points_green;
+		Gnome::Canvas::Points m_points_black;
+                int i,j;
+                double x1,y1,x2,y2;
+                bool borde=false;
+		this->previous_x=50;
+		this->previous_y=50;
+  		m_points_green.push_back(Gnome::Art::Point(-50, -50));
+  		m_points_green.push_back(Gnome::Art::Point(-50, 150));
+  		m_points_green.push_back(Gnome::Art::Point(-50, -50));
+  		m_points_green.push_back(Gnome::Art::Point(150, -50));
+  		m_points_green.push_back(Gnome::Art::Point(150, 150));
+  		m_points_green.push_back(Gnome::Art::Point(-50, 150));
+		
+		m_points_black.push_back(Gnome::Art::Point(50,-50));
+		m_points_black.push_back(Gnome::Art::Point(50,150));
+		m_points_black.push_back(Gnome::Art::Point(50,50));
+		
+		m_points_black.push_back(Gnome::Art::Point(-50,50));
+		m_points_black.push_back(Gnome::Art::Point(150,50));
+		
+		
+                j=0;
+                for(i=-50;i<=150;i=i+20){
+                            if(borde){
+                                m_points_green.push_back(Gnome::Art::Point(i, -50));
+                                
+                                m_points_green.push_back(Gnome::Art::Point(i, 150));
+                                borde=false;
+                            }else{
+                                m_points_green.push_back(Gnome::Art::Point(i, 150));                        
+                                
+                                m_points_green.push_back(Gnome::Art::Point(i, -50));
+                                borde=true;
+                            }
+                }
+                
+                for(i=-50;i<=150;i=i+20){
+                        
+                            if(borde){
+                                m_points_green.push_back(Gnome::Art::Point(-50, i));
+                                
+                                m_points_green.push_back(Gnome::Art::Point(150, i));
+                                borde=false;
+                            }else{
+                                m_points_green.push_back(Gnome::Art::Point(150, i));                        
+                                
+                                m_points_green.push_back(Gnome::Art::Point(-50, i));
+                                borde=true;
+                            }
+                }
+
+
+  		// we want to use the stream like interface
+  		using namespace Gnome::Canvas;
+                
+  		m_line_green = new Gnome::Canvas::Line(m_canvasgroup, m_points_green);
+  		*m_line_green << Properties::fill_color("gray")
+		  		<< Properties::width_pixels(1);
+				
+		m_line_black = new Gnome::Canvas::Line(m_canvasgroup, m_points_black);
+  		*m_line_black << Properties::fill_color("Black")
+		  		<< Properties::width_pixels(1);
+                                
+                               
+                
+  		m_text = new Gnome::Canvas::Ellipse(m_canvasgroup,35, 35,60,60);
+  		*m_text << Properties::fill_color("black");
+                
+		m_text->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &CanvasControlCameras::on_canvas_event),m_text));
+
+                
+
+	}
+
+	CanvasControlCameras::~CanvasControlCameras()
+	{
+  		delete m_line_green;
+		delete m_line_black;
+  		delete m_ellipse;
+  		delete m_text;
+	}
+
+	bool CanvasControlCameras::on_canvas_event(GdkEvent * event, Gnome::Canvas::Item * item)
+	{
+		/* Static variables for drag-and-drop */
+  		static gboolean dragging = FALSE;
+  		//static double this->previous_x, this->previous_y;
+  		double event_x = event->button.x;
+  		double event_y = event->button.y;
+		
+
+		switch (event->type)
+  		{
+  			case GDK_BUTTON_PRESS:
+    			if (event->button.button == 1)
+    			{
+      				GdkCursor *cursor;
+
+      				/* Store these coordinates for later... */
+      				this->previous_x = event_x;
+      				this->previous_y = event_y;
+      				cursor = gdk_cursor_new(GDK_FLEUR);
+      				item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, event->button.time);
+      				gdk_cursor_destroy(cursor);
+      				dragging = TRUE;
+    			}
+    			break;
+
+  			case GDK_MOTION_NOTIFY:
+    			if (dragging && (event->motion.state & GDK_BUTTON1_MASK))
+    			{
+      				item->move(event_x - this->previous_x,
+        			event_y - this->previous_y);
+
+      				/* Remember these for the next pass */
+      				this->previous_x = event_x;
+      				this->previous_y = event_y;
+				this->moved=1;
+
+    			}
+    			break;
+
+  			case GDK_BUTTON_RELEASE:
+    			item->ungrab(event->button.time);
+    			dragging = FALSE;
+    			break;
+
+  			default:
+    			break;
+  		}
+		
+		
+
+  		return FALSE;
+	}
+}//namespace

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateCameras.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateCameras.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateCameras.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,59 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#ifndef MYCOMPONENT_CANVASTELEOPERATECAMERAS_H
+#define MYCOMPONENT_CANVASTELEOPERATECAMERAS_H
+
+#include <string>
+#include <iostream>
+#include <gtkmm.h>
+#include <libglademm.h>
+#include <IceUtil/Thread.h>
+#include <IceUtil/Time.h>
+#include <jderobot/camera.h>
+#include <colorspaces/colorspacesmm.h>
+#include <libgnomecanvasmm.h>
+
+
+namespace mycomponent {
+
+	class CanvasControlCameras : public Gnome::Canvas::CanvasAA 
+		{
+			public:
+  				CanvasControlCameras(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& builder);
+  				virtual ~CanvasControlCameras();
+				double previous_x;
+				double previous_y;
+  				Gnome::Canvas::Ellipse *m_text;
+				bool moved;
+			protected:
+  				bool on_canvas_event(GdkEvent * event, Gnome::Canvas::Item * item);
+
+				Gnome::Canvas::Group m_canvasgroup;
+				Gnome::Canvas::Ellipse *m_ellipse;
+ 				Gnome::Canvas::Line *m_line_green;
+				Gnome::Canvas::Line *m_line_black;
+		};
+
+
+} // namespace
+
+#endif /*MYCOMPONENT_CANVASTELEOPERATECAMERAS_H*/

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateControl.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateControl.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateControl.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,171 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#include "canvasTeleoperateControl.h"
+
+namespace mycomponent {
+
+	
+
+	CanvasControl::CanvasControl(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& builder)
+  		: Gnome::Canvas::CanvasAA(cobject),m_canvasgroup(*(root()), 0, 0)
+	{ 		
+		// create some elements there
+                Gnome::Canvas::Points m_points_green;
+		Gnome::Canvas::Points m_points_black;
+                int i,j;
+                double x1,y1,x2,y2;
+                bool borde=false;
+		this->previous_x=50;
+		this->previous_y=50;
+  		m_points_green.push_back(Gnome::Art::Point(-50, -50));
+  		m_points_green.push_back(Gnome::Art::Point(-50, 150));
+  		m_points_green.push_back(Gnome::Art::Point(-50, -50));
+  		m_points_green.push_back(Gnome::Art::Point(150, -50));
+  		m_points_green.push_back(Gnome::Art::Point(150, 150));
+  		m_points_green.push_back(Gnome::Art::Point(-50, 150));
+		
+		m_points_black.push_back(Gnome::Art::Point(50,-50));
+		m_points_black.push_back(Gnome::Art::Point(50,150));
+		m_points_black.push_back(Gnome::Art::Point(50,50));
+		
+		m_points_black.push_back(Gnome::Art::Point(-50,50));
+		m_points_black.push_back(Gnome::Art::Point(150,50));
+		
+		
+                j=0;
+                for(i=-50;i<=150;i=i+20){
+                            if(borde){
+                                m_points_green.push_back(Gnome::Art::Point(i, -50));
+                                
+                                m_points_green.push_back(Gnome::Art::Point(i, 150));
+                                borde=false;
+                            }else{
+                                m_points_green.push_back(Gnome::Art::Point(i, 150));                        
+                                
+                                m_points_green.push_back(Gnome::Art::Point(i, -50));
+                                borde=true;
+                            }
+                }
+                
+                for(i=-50;i<=150;i=i+20){
+                        
+                            if(borde){
+                                m_points_green.push_back(Gnome::Art::Point(-50, i));
+                                
+                                m_points_green.push_back(Gnome::Art::Point(150, i));
+                                borde=false;
+                            }else{
+                                m_points_green.push_back(Gnome::Art::Point(150, i));                        
+                                
+                                m_points_green.push_back(Gnome::Art::Point(-50, i));
+                                borde=true;
+                            }
+                }
+
+
+  		// we want to use the stream like interface
+  		using namespace Gnome::Canvas;
+                
+  		m_line_green = new Gnome::Canvas::Line(m_canvasgroup, m_points_green);
+  		*m_line_green << Properties::fill_color("gray")
+		  		<< Properties::width_pixels(1);
+				
+		m_line_black = new Gnome::Canvas::Line(m_canvasgroup, m_points_black);
+  		*m_line_black << Properties::fill_color("Black")
+		  		<< Properties::width_pixels(1);
+                                
+                               
+                
+		m_text = new Gnome::Canvas::Ellipse(m_canvasgroup,35, 35,60,60);
+  		*m_text << Properties::fill_color("black");
+ 		
+		//Connecting events
+		m_text->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &CanvasControl::on_canvas_event),m_text));
+
+                
+
+	}
+
+	CanvasControl::~CanvasControl()
+	{
+  		delete m_line_green;
+		delete m_line_black;
+  		delete m_text;
+	}
+
+	bool CanvasControl::on_canvas_event(GdkEvent * event, Gnome::Canvas::Item * item)
+	{
+		/* Static variables for drag-and-drop */
+  		static gboolean dragging = FALSE;
+  		//static double this->previous_x, this->previous_y;
+ 		double event_x = event->button.x;
+  		double event_y = event->button.y;
+		
+
+		switch (event->type)
+  		{
+  			case GDK_BUTTON_PRESS:
+    			if (event->button.button == 1)
+    			{
+      				GdkCursor *cursor;
+
+      				/* Store these coordinates for later... */
+      				this->previous_x = event_x;
+      				this->previous_y = event_y;
+      				cursor = gdk_cursor_new(GDK_FLEUR);
+      				item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, event->button.time);
+      				gdk_cursor_destroy(cursor);
+      				dragging = TRUE;
+    			}
+    			break;
+
+  			case GDK_MOTION_NOTIFY:
+    			if (dragging && (event->motion.state & GDK_BUTTON1_MASK))
+    			{
+      				item->move(event_x - this->previous_x,
+        			event_y - this->previous_y);
+
+      				/* Remember these for the next pass */
+      				this->previous_x = event_x;
+      				this->previous_y = event_y;
+				this->moved=1;
+
+    			}
+    			break;
+
+  			case GDK_BUTTON_RELEASE:
+    			item->ungrab(event->button.time);
+    			dragging = FALSE;
+    			break;
+
+  			default:
+    			break;
+  		}
+		
+		
+
+  		return FALSE;
+	}
+	
+
+
+}//namespace

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateControl.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateControl.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/canvasTeleoperateControl.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,58 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#ifndef MYCOMPONENT_CANVASTELEOPERATECONTROL_H
+#define MYCOMPONENT_CANVASTELEOPERATECONTROL_H
+
+#include <string>
+#include <iostream>
+#include <gtkmm.h>
+#include <libglademm.h>
+#include <IceUtil/Thread.h>
+#include <IceUtil/Time.h>
+#include <jderobot/camera.h>
+#include <colorspaces/colorspacesmm.h>
+#include <libgnomecanvasmm.h>
+
+
+namespace mycomponent {
+
+	class CanvasControl : public Gnome::Canvas::CanvasAA 
+		{
+			public:
+  				CanvasControl(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& builder);
+  				virtual ~CanvasControl();
+				double previous_x;
+				double previous_y;
+  				Gnome::Canvas::Ellipse *m_text;
+				bool moved;
+			protected:
+  				bool on_canvas_event(GdkEvent * event, Gnome::Canvas::Item * item);
+
+				Gnome::Canvas::Group m_canvasgroup;
+				Gnome::Canvas::Line *m_line_green;
+				Gnome::Canvas::Line *m_line_black;
+		};
+
+
+} // namespace
+
+#endif /*MYCOMPONENT_CANVASTELEOPERATECONTROL_H*/

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/canvas_main.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/canvas_main.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/canvas_main.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,350 @@
+#include "canvas_main.h"
+#include <gtkmm.h>
+
+namespace mycomponent {
+
+	
+
+	CanvasWin::CanvasWin(BaseObjectType* cobject, /*BaseObjectType* cobject_menu,*/ const Glib::RefPtr<Gnome::Glade::Xml>& builder)
+  		: Gnome::Canvas::CanvasAA(cobject), /*Gtk::Menu::Menu(cobject_menu),*/ m_canvasgroup(*(root()), 0, 0)/*, m_pMenuPopup*/
+	{ 		
+		// create some elements there
+  		Gnome::Canvas::Points m_points;
+
+  		m_points.push_back(Gnome::Art::Point(0, 0));
+  		m_points.push_back(Gnome::Art::Point(100, 0));
+  		m_points.push_back(Gnome::Art::Point(0, 100));
+  		m_points.push_back(Gnome::Art::Point(100, 100));
+
+  		// we want to use the stream like interface
+  		using namespace Gnome::Canvas;
+
+  		m_line = new Gnome::Canvas::Line(m_canvasgroup, m_points);
+  		*m_line << Properties::fill_color("Green")
+		  		<< Properties::width_pixels(5);
+
+  		m_ellipse = new Gnome::Canvas::Ellipse(m_canvasgroup, 0, 0, 100, 100);
+  		*m_ellipse << Properties::fill_color("red");
+
+  		//m_rect = new Gnome::Canvas::Rect(m_canvasgroup, 10, 10, 50, 100);
+  		//*m_rect << Properties::width_pixels(2)
+  		//        << Properties::fill_color("white");
+
+  		//m_image = new Gnome::Canvas::Image(m_canvasgroup, 0, 0, Gdk_Imlib::Image("example.png"));
+  		//The width and height are set from the information in the image file.
+
+  		m_text = new Gnome::Canvas::Text(m_canvasgroup, 0, 0, "Funciona!!");
+  		*m_text << Properties::font("-Adobe-Helvetica-Medium-R-Normal--*-100-*-*-*-*-*-*")
+          		<< Properties::fill_color("blue"); //Changes the color of the text.
+		
+		//Connecting events
+		m_line->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_canvas_event_transition),m_line));
+		m_ellipse->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_canvas_event_state),m_ellipse));
+		m_text->signal_event().connect(sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_canvas_event_state),m_text));
+		
+				
+		//Menu contextual
+		/*m_pMenuPopup = new Gtk::Menu::Menu();
+		
+		m_refActionGroup = Gtk::ActionGroup::create();
+
+		//File|New sub menu:
+		  //These menu actions would normally already exist for a main menu, because a
+		  //context menu should not normally contain menu items that are only available
+		  //via a context menu.
+		  m_refActionGroup->add(Gtk::Action::create("ContextMenu", "Context Menu"));
+
+		  m_refActionGroup->add(Gtk::Action::create("ContextEdit", "Edit"),
+				  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic_2),m_ellipse));
+
+		  m_refActionGroup->add(Gtk::Action::create("ContextProcess", "Process"),
+				  sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic));
+
+		  m_refActionGroup->add(Gtk::Action::create("ContextRemove", "Remove"),
+				  sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic));
+
+
+		  m_refUIManager = Gtk::UIManager::create();
+		  m_refUIManager->insert_action_group(m_refActionGroup);
+
+
+		  //Layout the actions in a menubar and toolbar:
+		  Glib::ustring ui_info =
+				"<ui>"
+				"  <popup name='PopupMenu'>"
+				"    <menuitem action='ContextEdit'/>"
+				"    <menuitem action='ContextProcess'/>"
+				"    <menuitem action='ContextRemove'/>"
+				"  </popup>"
+				"</ui>";
+
+		  try
+		  {
+			m_refUIManager->add_ui_from_string(ui_info);
+		  }
+		  catch(const Glib::Error& ex)
+		  {
+			std::cerr << "building menus failed: " <<  ex.what();
+		  }
+
+		  //Get the menu:
+		  m_pMenuPopup = dynamic_cast<Gtk::Menu*>(
+				  m_refUIManager->get_widget("/PopupMenu")); 
+		  if(!m_pMenuPopup)
+			g_warning("menu not found");*/
+
+	}
+
+	CanvasWin::~CanvasWin()
+	{
+  		delete m_line;
+  		delete m_ellipse;
+  		//delete m_rect;
+		//delete m_image;
+  		delete m_text;
+
+	}
+
+	bool CanvasWin::on_canvas_event_state(GdkEvent * event, Gnome::Canvas::Item * item)
+	{
+		/* Static variables for drag-and-drop */
+  		static gboolean dragging = FALSE;
+  		static double previous_x, previous_y;
+
+  		double event_x = event->button.x;
+  		double event_y = event->button.y;
+
+		switch (event->type)
+  		{
+  			case GDK_BUTTON_PRESS:
+    			if (event->button.button == 1)
+    			{
+      				GdkCursor *cursor;
+
+      				/* Store these coordinates for later... */
+      				previous_x = event_x;
+      				previous_y = event_y;
+
+      				cursor = gdk_cursor_new(GDK_FLEUR);
+      				item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, event->button.time);
+      				gdk_cursor_destroy(cursor);
+      				dragging = TRUE;
+    			}
+				if (event->button.button == 3)
+    			{
+      				
+					/*********************************************/
+
+					//Menu contextual
+					m_pMenuPopup = new Gtk::Menu::Menu();
+		
+					m_refActionGroup = Gtk::ActionGroup::create();
+
+					//File|New sub menu:
+					  //These menu actions would normally already exist for a main menu, because a
+					  //context menu should not normally contain menu items that are only available
+					  //via a context menu.
+					  m_refActionGroup->add(Gtk::Action::create("ContextMenu", "Context Menu"));
+
+					  m_refActionGroup->add(Gtk::Action::create("ContextEdit", "Editar"),
+							  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic_2),item));
+
+					  m_refActionGroup->add(Gtk::Action::create("ContextProcess", "Codigo"),
+							  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic_2),item));
+
+					  m_refActionGroup->add(Gtk::Action::create("ContextRemove", "Eliminar"),
+							  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic_2),item));
+
+
+					  m_refUIManager = Gtk::UIManager::create();
+					  m_refUIManager->insert_action_group(m_refActionGroup);
+
+
+					  //Layout the actions in a menubar and toolbar:
+					  Glib::ustring ui_info =
+							"<ui>"
+							"  <popup name='PopupMenu'>"
+							"    <menuitem action='ContextEdit'/>"
+							"    <menuitem action='ContextProcess'/>"
+							"    <menuitem action='ContextRemove'/>"
+							"  </popup>"
+							"</ui>";
+
+					  try
+					  {
+						m_refUIManager->add_ui_from_string(ui_info);
+					  }
+					  catch(const Glib::Error& ex)
+					  {
+						std::cerr << "building menus failed: " <<  ex.what();
+					  }
+
+					  //Get the menu:
+					  m_pMenuPopup = dynamic_cast<Gtk::Menu*>(
+							  m_refUIManager->get_widget("/PopupMenu")); 
+					  if(!m_pMenuPopup)
+						g_warning("menu not found");
+
+					/**********************************************/
+
+					if(m_pMenuPopup)
+      					m_pMenuPopup->popup(event->button.button, event->button.time);
+				}
+    			break;
+
+  			case GDK_MOTION_NOTIFY:
+    			if (dragging && (event->motion.state & GDK_BUTTON1_MASK))
+    			{
+      				item->move(event_x - previous_x,
+        			event_y - previous_y);
+
+      				/* Remember these for the next pass */
+      				previous_x = event_x;
+      				previous_y = event_y;
+    			}
+    			break;
+
+  			case GDK_BUTTON_RELEASE:
+    			item->ungrab(event->button.time);
+    			dragging = FALSE;
+    			break;
+
+  			default:
+    			break;
+  		}
+
+  		return FALSE;
+	}
+
+	bool CanvasWin::on_canvas_event_transition(GdkEvent * event, Gnome::Canvas::Item * item)
+	{
+		/* Static variables for drag-and-drop */
+  		static gboolean dragging = FALSE;
+  		static double previous_x, previous_y;
+
+  		double event_x = event->button.x;
+  		double event_y = event->button.y;
+
+		switch (event->type)
+  		{
+  			case GDK_BUTTON_PRESS:
+    			if (event->button.button == 1)
+    			{
+      				GdkCursor *cursor;
+
+      				/* Store these coordinates for later... */
+      				previous_x = event_x;
+      				previous_y = event_y;
+
+      				cursor = gdk_cursor_new(GDK_FLEUR);
+      				item->grab(GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, event->button.time);
+      				gdk_cursor_destroy(cursor);
+      				dragging = TRUE;
+    			}
+				if (event->button.button == 3)
+    			{
+      				
+					/*********************************************/
+
+					//Menu contextual
+					m_pMenuPopup = new Gtk::Menu::Menu();
+		
+					m_refActionGroup = Gtk::ActionGroup::create();
+
+					//File|New sub menu:
+					  //These menu actions would normally already exist for a main menu, because a
+					  //context menu should not normally contain menu items that are only available
+					  //via a context menu.
+					  m_refActionGroup->add(Gtk::Action::create("ContextMenu", "Context Menu"));
+
+					  m_refActionGroup->add(Gtk::Action::create("ContextEdit", "Editar"),
+							  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic),item));
+
+					  m_refActionGroup->add(Gtk::Action::create("ContextProcess", "Condicional"),
+							  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic),item));
+
+					  m_refActionGroup->add(Gtk::Action::create("ContextRemove", "Eliminar"),
+							  sigc::bind(sigc::mem_fun(*this, &CanvasWin::on_menu_file_popup_generic),item));
+
+
+					  m_refUIManager = Gtk::UIManager::create();
+					  m_refUIManager->insert_action_group(m_refActionGroup);
+
+
+					  //Layout the actions in a menubar and toolbar:
+					  Glib::ustring ui_info =
+							"<ui>"
+							"  <popup name='PopupMenu'>"
+							"    <menuitem action='ContextEdit'/>"
+							"    <menuitem action='ContextProcess'/>"
+							"    <menuitem action='ContextRemove'/>"
+							"  </popup>"
+							"</ui>";
+
+					  try
+					  {
+						m_refUIManager->add_ui_from_string(ui_info);
+					  }
+					  catch(const Glib::Error& ex)
+					  {
+						std::cerr << "building menus failed: " <<  ex.what();
+					  }
+
+					  //Get the menu:
+					  m_pMenuPopup = dynamic_cast<Gtk::Menu*>(
+							  m_refUIManager->get_widget("/PopupMenu")); 
+					  if(!m_pMenuPopup)
+						g_warning("menu not found");
+
+					/**********************************************/
+
+					if(m_pMenuPopup)
+      					m_pMenuPopup->popup(event->button.button, event->button.time);
+				}
+    			break;
+
+  			case GDK_MOTION_NOTIFY:
+    			if (dragging && (event->motion.state & GDK_BUTTON1_MASK))
+    			{
+      				item->move(event_x - previous_x,
+        			event_y - previous_y);
+
+      				/* Remember these for the next pass */
+      				previous_x = event_x;
+      				previous_y = event_y;
+    			}
+    			break;
+
+  			case GDK_BUTTON_RELEASE:
+    			item->ungrab(event->button.time);
+    			dragging = FALSE;
+    			break;
+
+  			default:
+    			break;
+  		}
+
+  		return FALSE;
+	}
+
+
+	void CanvasWin::on_menu_file_popup_generic(Gnome::Canvas::Item * item)
+	{
+    	std::cout << "Opcion de transicion seleccionada." << std::endl;
+	}
+
+	void CanvasWin::on_menu_file_popup_generic_2(Gnome::Canvas::Item * item)
+	{
+    	std::cout << "Opcion de estado seleccionada." << std::endl;
+	}
+
+	/*CanvasLaserWin::CanvasLaserWin()
+	{
+  		set_title ("ventana canvas laser");
+  		add(laser_canvas);
+
+  		show_all();
+	}
+	/*-----FIN CANVAS LASER------*/
+
+}//namespace

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/canvas_main.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/canvas_main.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/canvas_main.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,70 @@
+#ifndef INTROROB_CANVASLASERWIN_H
+#define INTROROB_CANVASLASERWIN_H
+
+#include <string>
+#include <iostream>
+#include <gtkmm.h>
+#include <libglademm.h>
+#include <IceUtil/Thread.h>
+#include <IceUtil/Time.h>
+#include <jderobot/camera.h>
+#include <colorspaces/colorspacesmm.h>
+//#include "controller.h"
+//#include "drawarea.h"
+//#include "navegacion.h"
+#include <libgnomecanvasmm.h>
+//#include "menudesplegable.h"
+
+
+namespace mycomponent {
+
+	//class Navega;
+	//class MenuDesp;
+
+	class CanvasWin : public Gnome::Canvas::CanvasAA//, public Gtk::Menu::Menu
+		{
+			public:
+  				CanvasWin(BaseObjectType* cobject,/* BaseObjectType* cobject_menu,*/ const Glib::RefPtr<Gnome::Glade::Xml>& builder);
+  				virtual ~CanvasWin();
+
+				Gtk::Menu* m_pMenuPopup;
+
+			protected:
+  				bool on_canvas_event_state(GdkEvent * event, Gnome::Canvas::Item * item);
+				bool on_canvas_event_transition(GdkEvent * event, Gnome::Canvas::Item * item);
+
+				Gnome::Canvas::Group m_canvasgroup;
+				Gnome::Canvas::Ellipse *m_ellipse;
+  				//Gnome::Canvas::Rect *m_rect;
+  				//  Gnome::Canvas::Image *m_image;
+  				Gnome::Canvas::Text *m_text;
+				Gnome::Canvas::Line *m_line;
+
+				  void on_menu_file_popup_generic(Gnome::Canvas::Item * item);
+				  void on_menu_file_popup_generic_2(Gnome::Canvas::Item * item);
+
+				  //Child widgets:
+				  //Gtk::VBox m_Box;
+				  //Gtk::EventBox m_EventBox;
+				  //Gtk::Label m_Label;
+
+				  Glib::RefPtr<Gtk::UIManager> m_refUIManager;
+				  Glib::RefPtr<Gtk::ActionGroup> m_refActionGroup;
+
+				  
+
+		};
+
+	/*class CanvasLaserWin : public Gtk::Window
+		{
+			public:
+  				CanvasLaserWin();
+	
+			protected:
+  				//Member widgets:
+  				CanvasLaser laser_canvas;
+		};*/
+
+} // namespace
+
+#endif /*INTROROB_CANVASLASERWIN_H*/

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/control_class.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/control_class.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/control_class.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,580 @@
+#include "control_class.h"
+#include "gui.h"
+
+
+mycomponent::Control *control;
+
+typedef enum Estado_Sub_1 {
+	ChocaGira,
+	Vueltas
+}Estado_Sub_1;
+
+const char *Nombres_Sub_1[] = {
+	"ChocaGira",
+	"Vueltas"
+};
+
+typedef enum Estado_Sub_2 {
+	aIzquierda,
+	aIzquierda_ghost,
+	aDerecha,
+	aDerecha_ghost
+}Estado_Sub_2;
+
+const char *Nombres_Sub_2[] = {
+	"aIzquierda",
+	"aDerecha"
+};
+
+typedef enum Estado_Sub_3 {
+	avanzando,
+	avanzando_ghost,
+	parando,
+	parando_ghost,
+	marcha_atras,
+	marcha_atras_ghost,
+	girando,
+	girando_ghost
+}Estado_Sub_3;
+
+const char *Nombres_Sub_3[] = {
+	"avanzando",
+	"parando",
+	"marcha_atras",
+	"girando"
+};
+
+
+Estado_Sub_1 Sub_1=ChocaGira;
+Estado_Sub_2 Sub_2=aIzquierda_ghost;
+Estado_Sub_3 Sub_3=avanzando_ghost;
+
+
+namespace mycomponent {
+
+void Control::handleCameras(){
+
+		this->data1 = cprx1->getImageData();
+		colorspaces::Image::FormatPtr fmt1 = colorspaces::Image::Format::searchFormat(this->data1->description->format);
+		if (!fmt1)
+		    throw "Format not supported";
+
+		this->image1 = new colorspaces::Image (this->data1->description->width, this->data1->description->height, fmt1, &(this->data1->pixelData[0])); // Prepare the image to use with openCV 
+
+		this->data2 = cprx2->getImageData();
+		colorspaces::Image::FormatPtr fmt2 = colorspaces::Image::Format::searchFormat(this->data2->description->format);
+		if (!fmt2)
+			throw "Format not supported";
+
+		this->image2 = new colorspaces::Image (this->data2->description->width, this->data2->description->height, fmt2, &(this->data2->pixelData[0])); // Prepare the image to use with openCV
+
+}
+
+void Control::resetControl(){
+
+this->mprx->setV(0);
+this->mprx->setW(0);
+this->mprx->setL(0);
+
+}
+
+Control::~Control() {}
+
+}
+
+void *showGui(void*){
+		mycomponent::Gui *gui;
+		struct timeval a, b;	
+		int cycle = 100;
+		long totalb,totala;
+		long diff;
+
+using namespace std;
+		string tab="";
+
+		gui = new mycomponent::Gui(control);
+
+		while(true){
+
+			gettimeofday(&a,NULL);
+			totala=a.tv_sec*1000000+a.tv_usec;
+
+			system("clear");
+
+			printf("%s\n", Nombres_Sub_1[Sub_1]);
+			tab = tab+"   ";
+
+			if (Sub_2%2 == 0){
+				printf("%s%s\n", tab.c_str(), Nombres_Sub_2[Sub_2/2]);
+				tab = tab+"   ";
+			}
+
+			if (Sub_3%2 == 0){
+				printf("%s%s\n", tab.c_str(), Nombres_Sub_3[Sub_3/2]);
+				tab = tab+"   ";
+			}
+
+			tab = "";
+			gettimeofday(&b,NULL);
+			totalb=b.tv_sec*1000000+b.tv_usec;
+			diff = (totalb-totala)/1000;
+
+			if(diff < 0 || diff > cycle)
+				diff = cycle;
+			else
+				diff = cycle-diff;
+
+			usleep(diff*1000);
+			if(diff < 33)
+				usleep(33*1000);
+		}
+}
+
+
+
+
+void *motor_sub_1(void*){
+
+		struct timeval a, b;
+		int cycle=200;
+		long totalb,totala;
+		long diff;
+		time_t t_ini;
+		time_t t_fin;
+		double secs;
+		bool t_activated;
+
+		int i;
+
+
+		while(true){
+		gettimeofday(&a,NULL);
+		totala=a.tv_sec*1000000+a.tv_usec;
+
+		//Switch de evaluación de transiciones
+		switch (Sub_1){
+			case ChocaGira:
+			{
+					if (!t_activated){
+						t_ini = time(NULL);
+						t_activated = true;
+					}else{
+						t_fin = time(NULL);
+						secs = difftime(t_fin, t_ini);
+						if (secs > (double) 30){
+							Sub_1=Vueltas;
+							t_activated = false;
+						}
+					}
+				break;
+			}
+			case Vueltas:
+			{
+					if (!t_activated){
+						t_ini = time(NULL);
+						t_activated = true;
+					}else{
+						t_fin = time(NULL);
+						secs = difftime(t_fin, t_ini);
+						if (secs > (double) 30){
+							Sub_1=ChocaGira;
+							t_activated = false;
+						}
+					}
+				break;
+			}
+		}
+		//Switch de actuacion
+		switch (Sub_1){
+			case ChocaGira:
+			{
+			i=0;
+				break;
+			}
+			case Vueltas:
+			{
+			i=0;
+				break;
+			}
+		}
+
+
+//Motor temporal del subautomata
+
+		gettimeofday(&b,NULL);
+		totalb=b.tv_sec*1000000+b.tv_usec;
+		diff = (totalb-totala)/1000;
+		if(diff < 0 || diff > cycle)
+			diff = cycle;
+		else
+			diff = cycle-diff;
+
+		//Sleep Algorithm
+			usleep(diff*1000);
+		if(diff < 33)
+			usleep(33*1000);
+	 }
+}
+
+
+
+void *motor_sub_2(void*){
+
+		struct timeval a, b;
+		int cycle=100;
+		long totalb,totala;
+		long diff;
+		time_t t_ini;
+		time_t t_fin;
+		double secs;
+		bool t_activated;
+
+		
+
+
+		while(true){
+		gettimeofday(&a,NULL);
+		totala=a.tv_sec*1000000+a.tv_usec;
+
+		if (Sub_1==Vueltas){
+			if(Sub_2==aIzquierda_ghost || Sub_2==aDerecha_ghost){
+			Sub_2= (Estado_Sub_2)(Sub_2-1);
+		}
+		//Switch de evaluación de transiciones
+		switch (Sub_2){
+			case aIzquierda:
+			{
+					if (!t_activated){
+						t_ini = time(NULL);
+						t_activated = true;
+					}else{
+						t_fin = time(NULL);
+						secs = difftime(t_fin, t_ini);
+						if (secs > (double) 10){
+							Sub_2=aDerecha;
+							t_activated = false;
+						}
+					}
+				break;
+			}
+			case aDerecha:
+			{
+					if (!t_activated){
+						t_ini = time(NULL);
+						t_activated = true;
+					}else{
+						t_fin = time(NULL);
+						secs = difftime(t_fin, t_ini);
+						if (secs > (double) 10){
+							Sub_2=aIzquierda;
+							t_activated = false;
+						}
+					}
+				break;
+			}
+		}
+		//Switch de actuacion
+		switch (Sub_2){
+			case aIzquierda:
+			{
+			control->mprx->setW(20);
+				break;
+			}
+			case aDerecha:
+			{
+			control->mprx->setW(-20);
+				break;
+			}
+		}
+}else{
+		if(Sub_2==aIzquierda || Sub_2==aDerecha){
+			Sub_2= (Estado_Sub_2)(Sub_2+1);
+		}
+	}
+
+
+//Motor temporal del subautomata
+
+		gettimeofday(&b,NULL);
+		totalb=b.tv_sec*1000000+b.tv_usec;
+		diff = (totalb-totala)/1000;
+		if(diff < 0 || diff > cycle)
+			diff = cycle;
+		else
+			diff = cycle-diff;
+
+		//Sleep Algorithm
+			usleep(diff*1000);
+		if(diff < 33)
+			usleep(33*1000);
+	 }
+}
+
+
+
+void *motor_sub_3(void*){
+
+		struct timeval a, b;
+		int cycle=100;
+		long totalb,totala;
+		long diff;
+		time_t t_ini;
+		time_t t_fin;
+		double secs;
+		bool t_activated;
+
+		float v;
+
+v=control->mprx->getV();
+control->ld=control->lprx->getLaserData();
+
+
+		while(true){
+		gettimeofday(&a,NULL);
+		totala=a.tv_sec*1000000+a.tv_usec;
+
+		if (Sub_1==ChocaGira){
+			if(Sub_3==avanzando_ghost || Sub_3==parando_ghost || Sub_3==marcha_atras_ghost || Sub_3==girando_ghost){
+			Sub_3= (Estado_Sub_3)(Sub_3-1);
+		}
+		//Switch de evaluación de transiciones
+		switch (Sub_3){
+			case avanzando:
+			{
+					if (control->ld->distanceData[45] <= 1000.0){
+						Sub_3=parando;
+					}
+				break;
+			}
+			case parando:
+			{
+					if (v <= 0.1){
+						Sub_3=marcha_atras;
+					}
+				break;
+			}
+			case marcha_atras:
+			{
+					if (control->ld->distanceData[45] > 1300.0){
+						Sub_3=girando;
+					}
+				break;
+			}
+			case girando:
+			{
+					if (!t_activated){
+						t_ini = time(NULL);
+						t_activated = true;
+					}else{
+						t_fin = time(NULL);
+						secs = difftime(t_fin, t_ini);
+						if (secs > (double) 3){
+							Sub_3=avanzando;
+							t_activated = false;
+						}
+					}
+				break;
+			}
+		}
+		//Switch de actuacion
+		switch (Sub_3){
+			case avanzando:
+			{
+			control->mprx->setW(0.);
+control->mprx->setV(60.);
+
+control->ld=control->lprx->getLaserData();
+				break;
+			}
+			case parando:
+			{
+			control->mprx->setV(0.);
+
+v=control->mprx->getV();
+				break;
+			}
+			case marcha_atras:
+			{
+			control->mprx->setV(-30.);
+
+control->ld=control->lprx->getLaserData();
+				break;
+			}
+			case girando:
+			{
+			control->mprx->setW(30);
+				break;
+			}
+		}
+}else{
+		if(Sub_3==avanzando || Sub_3==parando || Sub_3==marcha_atras || Sub_3==girando){
+			Sub_3= (Estado_Sub_3)(Sub_3+1);
+		}
+	}
+
+
+//Motor temporal del subautomata
+
+		gettimeofday(&b,NULL);
+		totalb=b.tv_sec*1000000+b.tv_usec;
+		diff = (totalb-totala)/1000;
+		if(diff < 0 || diff > cycle)
+			diff = cycle;
+		else
+			diff = cycle-diff;
+
+		//Sleep Algorithm
+			usleep(diff*1000);
+		if(diff < 33)
+			usleep(33*1000);
+	 }
+}
+
+
+int main(int argc, char** argv){
+
+
+		int status;
+		Ice::CommunicatorPtr ic;
+		struct timeval a, b;
+		int cycle = 300;
+		long totalb,totala;
+		long diff;
+		bool guiActivated=0;
+		bool controlActivated=0;
+
+		control = new mycomponent::Control();
+
+		pthread_mutex_init(&control->controlGui, NULL);
+		controlActivated=1;
+	    guiActivated=1;
+		pthread_create(&control->thr_gui, NULL, &showGui, NULL);
+	  try{
+
+		ic = Ice::initialize(argc,argv);
+			//-----------------ICE----------------//
+		// Contact to LASER interface
+		Ice::ObjectPrx baseLaser = ic->propertyToProxy("Mycomponent.Laser.Proxy");
+		if (0==baseLaser)
+		throw "Could not create proxy with laser";
+
+		// Cast to laser
+		control->lprx = jderobot::LaserPrx::checkedCast(baseLaser);
+		if (0== control->lprx)
+			throw "Invalid proxy Mycomponent.Laser.Proxy";
+
+		// Contact to MOTORS interface
+		Ice::ObjectPrx baseMotors = ic->propertyToProxy("Mycomponent.Motors.Proxy");
+		if (0==baseMotors)
+			throw "Could not create proxy with motors";
+
+		// Cast to motors
+		 control->mprx = jderobot::MotorsPrx::checkedCast(baseMotors);
+		if (0== control->mprx)
+			throw "Invalid proxy Mycomponent.Motors.Proxy";
+
+		// Contact to ENCODERS interface
+		Ice::ObjectPrx baseEncoders = ic->propertyToProxy("Mycomponent.Encoders.Proxy");
+		if (0==baseEncoders)
+			throw "Could not create proxy with encoders";
+
+		// Cast to encoders
+		control->eprx = jderobot::EncodersPrx::checkedCast(baseEncoders);
+		if (0== control->eprx)
+			throw "Invalid proxy Mycomponent.Encoders.Proxy";
+
+		// Contact to PTMOTORS interface
+		Ice::ObjectPrx ptmotors1 = ic->propertyToProxy("Mycomponent.PTMotors1.Proxy");
+		if (0==ptmotors1)
+			throw "Could not create proxy with motors";
+
+		// Cast to ptmotors
+		control->ptmprx1 = jderobot::PTMotorsPrx::checkedCast(ptmotors1);
+		if (0== control->ptmprx1)
+			throw "Invalid proxy Mycomponent.PTMotors1.Proxy";
+
+		// Contact to PTMOTORS interface
+		Ice::ObjectPrx ptmotors2 = ic->propertyToProxy("Mycomponent.PTMotors2.Proxy");
+		if (0==ptmotors2)
+			throw "Could not create proxy with motors";
+		// Cast to ptmotors
+
+		control->ptmprx2 = jderobot::PTMotorsPrx::checkedCast(ptmotors2);
+		if (0== control->ptmprx2)
+			throw "Invalid proxy Mycomponent.PTMotors2.Proxy";
+
+		// Get driver camera
+		Ice::ObjectPrx camara1 = ic->propertyToProxy("Mycomponent.Camera1.Proxy");
+		if (0==camara1)
+			throw "Could not create proxy to camera1 server";
+
+		// cast to CameraPrx
+		control->cprx1 = jderobot::CameraPrx::checkedCast(camara1);
+		if (0== control->cprx1)
+			throw "Invalid proxy";
+
+		// Get driver camera
+		Ice::ObjectPrx camara2 = ic->propertyToProxy("Mycomponent.Camera2.Proxy");
+		if (0==camara2)
+			throw "Could not create proxy to camera2 server";
+
+		// cast to CameraPrx
+		control->cprx2 = jderobot::CameraPrx::checkedCast(camara2);
+		if (0== control->cprx2)
+			throw "Invalid proxy";
+
+		// Contact to PTENCODERS interface
+		Ice::ObjectPrx ptencoders1 = ic->propertyToProxy("Mycomponent.PTEncoders1.Proxy");
+		if (0==ptencoders1)
+			throw "Could not create proxy with encoders";
+
+		// Cast to encoders
+		control->pteprx1 = jderobot::PTEncodersPrx::checkedCast(ptencoders1);
+		if (0== control->pteprx1)
+			throw "Invalid proxy Mycomponent.PTEncoders1.Proxy";
+
+		// Contact to PTENCODERS interface
+		Ice::ObjectPrx ptencoders2 = ic->propertyToProxy("Mycomponent.PTEncoders2.Proxy");
+		if (0==ptencoders2)
+			throw "Could not create proxy with encoders";
+
+		// Cast to encoders
+		control->pteprx2 = jderobot::PTEncodersPrx::checkedCast(ptencoders2);
+		if (0== control->pteprx2)
+			throw "Invalid proxy Mycomponent.PTEncoders2.Proxy";
+
+				//-----------------ICE----------------//
+//****************************** Processing the Control ******************************///
+			//---------------- ITERATIONS CONTROL -----------//
+
+
+//Inicializacion de datos para los distintos hilos de control y creacion de hilos
+		pthread_create(&control->thr_sub_1,NULL, &motor_sub_1, NULL);
+		pthread_create(&control->thr_sub_2,NULL, &motor_sub_2, NULL);
+		pthread_create(&control->thr_sub_3,NULL, &motor_sub_3, NULL);
+
+
+		pthread_join(control->thr_gui, NULL);
+
+		pthread_join(control->thr_sub_1,NULL);
+		pthread_join(control->thr_sub_2,NULL);
+		pthread_join(control->thr_sub_3,NULL);
+
+
+	 }//del try
+	 catch (const Ice::Exception& ex) {
+		std::cerr << ex << std::endl;
+		status = 1;
+	 }
+  catch (const char* msg) {
+		std::cerr << msg << std::endl;
+		status = 1;
+  }
+
+if (ic)
+	 ic->destroy();
+
+return 0;
+
+}
+

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/control_class.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/control_class.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/control_class.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,59 @@
+#ifndef MYCOMPONENT_CONTROL_H
+#define MYCOMPONENT_CONTROL_H
+
+
+#include <iostream>
+#include <Ice/Ice.h>
+#include <IceUtil/IceUtil.h>
+#include <jderobot/camera.h>
+#include <jderobot/motors.h>
+#include <jderobot/ptmotors.h>
+#include <jderobot/laser.h>
+#include <jderobot/encoders.h>
+#include <jderobot/ptencoders.h>
+#include <colorspaces/colorspacesmm.h>
+#include <pthread.h>
+
+
+namespace mycomponent {
+		class Gui;
+		class Control {
+		public:
+
+		virtual ~Control();
+
+			//FUNCTIONS
+			void handleCameras();
+			void resetControl();
+			//HANDLE THREADS
+			pthread_t thr_gui;
+			pthread_t thr_sub_1;
+			pthread_t thr_sub_2;
+			pthread_t thr_sub_3;
+			pthread_mutex_t controlGui;
+
+			// INTERFACES DATA
+			jderobot::EncodersDataPtr ed;
+			jderobot::LaserDataPtr ld;
+			jderobot::ImageDataPtr data1; // Contains the image info
+			jderobot::ImageDataPtr data2; // Contains the image info
+			jderobot::PTEncodersDataPtr pted1;
+			jderobot::PTEncodersDataPtr pted2;
+
+			// INTERFACES
+			jderobot::MotorsPrx mprx;
+			jderobot::EncodersPrx eprx;
+			jderobot::LaserPrx lprx;
+			jderobot::CameraPrx cprx1;
+			jderobot::CameraPrx cprx2;
+			jderobot::PTMotorsPrx ptmprx1;
+			jderobot::PTEncodersPrx pteprx1;
+			jderobot::PTMotorsPrx ptmprx2;
+			jderobot::PTEncodersPrx pteprx2;
+
+			colorspaces::Image* image1;	// Prepare the image to use with openCV
+			colorspaces::Image* image2;
+
+		};//class
+	} // namespace
+#endif /*MYCOMPONENT_Control_H*/

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/gui.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/gui.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/gui.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,200 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#include "gui.h"
+
+namespace mycomponent {
+    Gui::Gui (Control* control): gtkmain(0,0) {
+        
+        this->yourCode_button_isPressed=false;
+	this->control=control;
+        this->showCanvasWin = false; 
+	    /*Init OpenGL*/
+	if(!Gtk::GL::init_check(NULL, NULL))	{
+	    std::cerr << "Couldn't initialize GL\n";
+	    std::exit(1);
+	}
+        Gnome::Canvas::init(); 
+
+	std::cout << "Loading glade\n";
+	this->gladepath=std::string("./mycomponent.glade");
+	refXml = Gnome::Glade::Xml::create("./mycomponent.glade");
+
+	//Get widgets
+        
+        refXml->get_widget("secondarywindow", secondarywindow);
+
+
+        // Button, area and window canvas teleoperate robot
+       	refXml->get_widget("windowTeleoperate", windowTeleoperate);
+        refXml->get_widget("stop_button", stop_button); //canvas
+       	refXml->get_widget_derived("canvas_control", this->canvas_control); //canvas
+        canvas_control->moved=1;
+
+        // Button, area and window canvas teleoperate cameras
+       	refXml->get_widget_derived("canvas_control_cameras", this->canvas_control_cameras); //canvas
+        
+
+
+	refXml->get_widget("yourCodeButton", yourCodeButton);
+	refXml->get_widget("stopCodeButton", stopCodeButton);
+	refXml->get_widget("exitButton", exitButton);
+
+	// Camera images
+	refXml->get_widget("image1",gtk_image1);
+	refXml->get_widget("image2",gtk_image2);
+
+
+	yourCodeButton->signal_clicked().connect(sigc::mem_fun(this,&Gui::yourCodeButton_clicked));
+	stopCodeButton->signal_clicked().connect(sigc::mem_fun(this,&Gui::stopCodeButton_clicked));
+	exitButton->signal_clicked().connect(sigc::mem_fun(this,&Gui::exitButton_clicked));
+        stop_button->signal_clicked().connect(sigc::mem_fun(this,&Gui::stop_button_clicked));
+
+	stopCodeButton->hide();
+        windowTeleoperate->show();
+        secondarywindow->show();
+        
+        camera *mycameraA = new camera("cameras/calibA");
+        myCamA= mycameraA->readConfig();
+        camera *mycameraB = new camera("cameras/calibB");
+	myCamB= mycameraB->readConfig();
+
+    }
+
+	Gui::~Gui() {
+/*	 
+		delete this->controller;
+		delete this->world;
+*/	
+	}
+
+
+
+    void Gui::display(const colorspaces::Image& image1, const colorspaces::Image& image2) {
+
+	setCamara(image1, 1);
+	setCamara(image2, 2);
+        
+        if(!(this->yourCode_button_isPressed))
+            this->teleOperate();
+        //else
+            //control->iterationControl(1);
+
+            
+        this->teleOperateCameras();
+	while (gtkmain.events_pending())
+	    gtkmain.iteration();
+    }
+    
+    void Gui::teleOperate(){
+        double k=-0.01;
+        double p=0.5;
+        double v,w,v_normalized,w_normalized;
+        
+        
+        w=canvas_control->previous_x;
+        v=canvas_control->previous_y;
+        
+        v_normalized=400*(k*v+p);
+        w_normalized=20*(k*w+p);
+        this->control->mprx->setV(v_normalized);
+        this->control->mprx->setW(w_normalized);
+    }
+    
+        void Gui::teleOperateCameras(){
+        double k=-0.01;
+        double p=0.5;
+        double v,w,v_normalized,w_normalized;
+        jderobot::PTMotorsData* myData;
+        jderobot::PTMotorsData* myData2;
+      
+        
+        w=canvas_control_cameras->previous_x;
+        v=canvas_control_cameras->previous_y;
+        v_normalized=28*(k*v+p);
+        w_normalized=-45*(k*w+p);
+        myData = new jderobot::PTMotorsData ();
+        myData2 = new jderobot::PTMotorsData ();
+        myData->latitude = v_normalized;
+        myData->longitude = w_normalized;
+        myData2->latitude = v_normalized;
+        myData2->longitude = w_normalized;
+        this->control->ptmprx1->setPTMotorsData (myData);
+        this->control->ptmprx2->setPTMotorsData (myData2);
+}
+
+    void Gui::setCamara (const colorspaces::Image& image, int id) {
+	    // Set image
+	    IplImage src; // conversión a IplImage
+	    src = image;
+
+	    colorspaces::ImageRGB8 img_rgb888(image); // conversion will happen if needed
+
+	    Glib::RefPtr<Gdk::Pixbuf> imgBuff = Gdk::Pixbuf::create_from_data((const guint8*)img_rgb888.data,
+				Gdk::COLORSPACE_RGB,
+				false,
+				8,
+				img_rgb888.width,
+				img_rgb888.height,
+				img_rgb888.step);
+
+	    if (id == 1) {
+	      gtk_image1->clear();
+	      gtk_image1->set(imgBuff);
+	    } else {
+	      gtk_image2->clear();
+	      gtk_image2->set(imgBuff);
+	    }
+    }
+
+    bool Gui::isVisible() {
+	return windowTeleoperate->is_visible();
+    }
+    void Gui::yourCodeButton_clicked() {
+	    yourCodeButton->hide();
+	    stopCodeButton->show();
+            yourCode_button_isPressed=true;
+    }
+
+    void Gui::stopCodeButton_clicked() {
+            control->resetControl();
+	    yourCodeButton->show();
+	    stopCodeButton->hide();
+                        yourCode_button_isPressed=false;
+
+            
+    }
+
+    void Gui::exitButton_clicked() {
+	    windowTeleoperate->hide();
+	    exit (0);
+    }
+    void Gui::stop_button_clicked(){
+        if(canvas_control->moved)
+            this->canvas_control->m_text->move(50-canvas_control->previous_x,50-canvas_control->previous_y);
+        canvas_control->moved=0;
+        this->control->mprx->setV(0);
+        this->control->mprx->setW(0);
+        canvas_control->previous_x=50;
+        canvas_control->previous_y=50;
+        yourCode_button_isPressed=false;
+    }
+} // namespace

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/gui.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/gui.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/gui.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,104 @@
+/*
+ *  Copyright (C) 1997-2011 JDERobot Developers Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU Library General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ *  Authors : Maikel González <m.gonzalezbai en gmail.com>
+ *
+ */
+
+#ifndef MYCOMPONENT_GUI_H
+#define MYCOMPONENT_GUI_H
+
+#include <cv.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include <GL/glut.h>
+#include <string>
+#include <iostream>
+#include <gtkmm.h>
+#include <gtkglmm.h>
+#include <gdkglmm.h>
+#include <libglademm.h>
+#include <IceUtil/Thread.h>
+#include <IceUtil/Time.h>
+#include <jderobot/camera.h>
+#include <pthread.h>
+#include <colorspaces/colorspacesmm.h>
+#include "control_class.h"
+#include "camera.h"
+#include <libgnomecanvasmm.h> 
+#include "canvasTeleoperateControl.h" 
+#include "canvasTeleoperateCameras.h"
+
+namespace mycomponent {
+    class CanvasWin; 
+    class CanvasControl;
+    class CanvasControlCameras;
+    class Control;
+    class Gui {
+      
+	public:
+	  
+	    Gui(Control *control);	
+	    virtual ~Gui();
+	    
+	    bool isVisible();
+	    void display(const colorspaces::Image& image1, const colorspaces::Image& image2);
+	    CanvasControl* canvas_control;
+	    CanvasControlCameras* canvas_control_cameras;
+ 	    
+	private:
+	  //Private Attributes
+	    
+	    TPinHoleCamera myCamA, myCamB;	    
+	    std::string gladepath; 
+	    
+	    // Canvas
+	    bool showCanvasWin; 
+	    Gtk::CheckButton * canvas_button; 
+	    Gtk::Window * canvaswindow; 
+	    Gtk::Window * windowTeleoperate; 
+	    Gtk::Button *stop_button; 
+	    bool press_stop_button;
+		    
+	    Glib::RefPtr<Gnome::Glade::Xml> refXml;
+	    Gtk::Main gtkmain;
+
+	    Gtk::Window *secondarywindow;
+	    Gtk::Button *yourCodeButton;
+	    Gtk::Button *stopCodeButton;
+	    Gtk::Button *exitButton;
+	    Gtk::Image *gtk_image1;
+	    Gtk::Image *gtk_image2;
+    	    Control* control;
+
+	    bool yourCode_button_isPressed;
+
+	  // Private Methods
+	    void initCameras();
+	    void setCamara (const colorspaces::Image& image, int id);
+	    void yourCodeButton_clicked();
+	    void stopCodeButton_clicked();
+	    void exitButton_clicked();
+	    void teleOperate();
+	    void teleOperateCameras();
+	    void canvas_button_toggled(); 
+	    void stop_button_clicked();
+
+	    
+    };//class
+}//namespace
+#endif //MYCOMPONENT_GUI_H
\ No newline at end of file

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/mycomponent
===================================================================
(Binary files differ)


Property changes on: trunk/src/components/visualHFSM-3.1/ejemplos/src/mycomponent
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/mycomponent.cfg
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/mycomponent.cfg	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/mycomponent.cfg	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,9 @@
+Mycomponent.Motors.Proxy=motors1:tcp -h localhost -p 9999
+Mycomponent.Camera1.Proxy=cameraA:tcp -h localhost -p 9999
+Mycomponent.Camera2.Proxy=cameraB:tcp -h localhost -p 9999
+Mycomponent.Encoders.Proxy=encoders1:tcp -h localhost -p 9999
+Mycomponent.PTMotors1.Proxy=ptmotors1:tcp -h localhost -p 9999
+Mycomponent.PTMotors2.Proxy=ptmotors2:tcp -h localhost -p 9999
+Mycomponent.Laser.Proxy=laser1:tcp -h localhost -p 9999
+Mycomponent.PTEncoders1.Proxy=ptencoders1:tcp -h localhost -p 9999
+Mycomponent.PTEncoders2.Proxy=ptencoders2:tcp -h localhost -p 9999

Added: trunk/src/components/visualHFSM-3.1/ejemplos/src/mycomponent.glade
===================================================================
--- trunk/src/components/visualHFSM-3.1/ejemplos/src/mycomponent.glade	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ejemplos/src/mycomponent.glade	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,223 @@
+<?xml version="1.0"?>
+<glade-interface>
+  <!-- interface-requires gtk+ 2.6 -->
+  <!-- interface-requires canvas 0.0 -->
+  <!-- interface-requires canvas 0.0 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <widget class="GtkWindow" id="secondarywindow">
+    <property name="title" translatable="yes">TELEOPERATE CAMERAS</property>
+    <child>
+      <widget class="GtkFixed" id="fixed1">
+        <property name="visible">True</property>
+        <child>
+          <widget class="GtkEventBox" id="eventbox_left">
+            <property name="width_request">320</property>
+            <property name="height_request">240</property>
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkImage" id="image1">
+                <property name="width_request">320</property>
+                <property name="height_request">240</property>
+                <property name="visible">True</property>
+                <property name="stock">gtk-missing-image</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="x">1</property>
+            <property name="y">1</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkEventBox" id="eventbox_right">
+            <property name="width_request">320</property>
+            <property name="height_request">240</property>
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkImage" id="image2">
+                <property name="width_request">320</property>
+                <property name="height_request">240</property>
+                <property name="visible">True</property>
+                <property name="stock">gtk-missing-image</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="x">328</property>
+            <property name="y">1</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GnomeCanvas" id="canvas_control_cameras">
+            <property name="width_request">200</property>
+            <property name="height_request">200</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="double_buffered">False</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+            <property name="aa">True</property>
+          </widget>
+          <packing>
+            <property name="x">230</property>
+            <property name="y">248</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+  <widget class="GtkWindow" id="windowTeleoperate">
+    <property name="title" translatable="yes">TELEOPERATE ROBOT</property>
+    <child>
+      <widget class="GtkFixed" id="fixed1">
+        <property name="visible">True</property>
+        <property name="extension_events">all</property>
+        <child>
+          <widget class="GtkButton" id="stop_button">
+            <property name="label" translatable="yes">STOP</property>
+            <property name="width_request">75</property>
+            <property name="height_request">53</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="has_tooltip">True</property>
+            <property name="tooltip" translatable="yes">W=0 &amp; V=0</property>
+            <property name="image_position">bottom</property>
+          </widget>
+          <packing>
+            <property name="x">262</property>
+            <property name="y">100</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="label1">
+            <property name="width_request">28</property>
+            <property name="height_request">28</property>
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">+W</property>
+          </widget>
+          <packing>
+            <property name="y">208</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="label2">
+            <property name="width_request">28</property>
+            <property name="height_request">28</property>
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">W-</property>
+          </widget>
+          <packing>
+            <property name="x">179</property>
+            <property name="y">208</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="label3">
+            <property name="width_request">28</property>
+            <property name="height_request">28</property>
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">V+</property>
+          </widget>
+          <packing>
+            <property name="x">206</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="label4">
+            <property name="width_request">28</property>
+            <property name="height_request">28</property>
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">V-</property>
+          </widget>
+          <packing>
+            <property name="x">206</property>
+            <property name="y">184</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GnomeCanvas" id="canvas_control">
+            <property name="width_request">200</property>
+            <property name="height_request">200</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="double_buffered">False</property>
+            <property name="aa">True</property>
+          </widget>
+          <packing>
+            <property name="x">4</property>
+            <property name="y">6</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkButton" id="exitButton">
+            <property name="width_request">80</property>
+            <property name="height_request">80</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="has_tooltip">True</property>
+            <property name="tooltip" translatable="yes">EXIT GUI</property>
+            <property name="image_position">bottom</property>
+            <child>
+              <widget class="GtkImage" id="image10">
+                <property name="visible">True</property>
+                <property name="stock">gtk-quit</property>
+                <property name="icon-size">6</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="x">262</property>
+            <property name="y">6</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkButton" id="yourCodeButton">
+            <property name="width_request">80</property>
+            <property name="height_request">80</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="has_tooltip">True</property>
+            <property name="tooltip" translatable="yes">RUN ITERATION CONTROL</property>
+            <child>
+              <widget class="GtkImage" id="image8">
+                <property name="visible">True</property>
+                <property name="stock">gtk-media-play</property>
+                <property name="icon-size">6</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="x">355</property>
+            <property name="y">6</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkButton" id="stopCodeButton">
+            <property name="width_request">80</property>
+            <property name="height_request">80</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="receives_default">True</property>
+            <property name="has_tooltip">True</property>
+            <property name="tooltip" translatable="yes">STOP ITERATION CONTROL</property>
+            <property name="xalign">0.50999999046325684</property>
+            <child>
+              <widget class="GtkImage" id="image9">
+                <property name="visible">True</property>
+                <property name="stock">gtk-media-stop</property>
+                <property name="icon-size">6</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="x">355</property>
+            <property name="y">6</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>

Added: trunk/src/components/visualHFSM-3.1/errores.txt
===================================================================
--- trunk/src/components/visualHFSM-3.1/errores.txt	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/errores.txt	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,13 @@
+interfaz.h:68: warning: ‘GtkTreeModel* create_and_fill_model()’ declared ‘static’ but never defined
+interfaz.h:68: warning: ‘GtkTreeModel* create_and_fill_model()’ declared ‘static’ but never defined
+imprimir.cpp: In function ‘void guardarPixmapImagenPng(GtkWidget*, gchar*)’:
+imprimir.cpp:250: warning: unused variable ‘imagen’
+imprimir.cpp: In function ‘int sp_png_write_rgba(const unsigned char*, const unsigned char*, int, int, int)’:
+imprimir.cpp:409: warning: comparison between signed and unsigned integer expressions
+imprimir.cpp:411: warning: comparison between signed and unsigned integer expressions
+imprimir.cpp: In function ‘void exportar2(GnomeCanvas*)’:
+imprimir.cpp:458: warning: unused variable ‘widget’
+imprimir.cpp:467: warning: unused variable ‘imagen’
+interfaz.cpp:1184: warning: ‘gint motion_notify_event(GtkWindow*, GdkEventMotion*, void*)’ defined but not used
+interfaz.cpp:2197: warning: ‘gint item_event_linea(GnomeCanvasItem*, GdkEvent*, void*)’ defined but not used
+interfaz.cpp:2529: warning: ‘gint box_event(GnomeCanvasItem*, GdkEvent*, void*)’ defined but not used

Added: trunk/src/components/visualHFSM-3.1/generate
===================================================================
(Binary files differ)


Property changes on: trunk/src/components/visualHFSM-3.1/generate
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: trunk/src/components/visualHFSM-3.1/generate.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/generate.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/generate.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,1606 @@
+
+//#include <string.h>
+
+#include <stdio.h>
+
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <dirent.h>
+#include <ctype.h>
+#include <sys/stat.h>
+//#include <boost/filesystem.hpp>
+
+
+
+#include <sstream>
+#include <iostream>
+#include <string>
+#include <cstring>
+#include <fstream>
+#include <list>
+
+/*#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <libgnomecanvas/libgnomecanvas.h>
+#include <libglade-2.0/glade/glade.h>
+#include <libxml/tree.h>*/
+
+#include <gdk/gdk.h>
+/*#include <gdkmm-3.0/gdkmm.h> */
+#include <gtk/gtk.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+/*#include <gdk-pixbuf-2.0/gdkmm.h> */
+#include <libgnomecanvas/libgnomecanvas.h>
+#include <glade/glade.h>
+#include <libxml/tree.h>
+
+/*
+#include <gdk.h>
+#include <gtk.h>
+#include <gdk-pixbuf.h>
+#include <libgnomecanvas.h>
+#include <glade/glade.h>
+#include <tree.h>
+*/
+
+//extern "C" {		// Incluir ficheros de C
+   #include "reemplazar.h"
+// }
+
+
+//#define filename ""
+
+using namespace std;
+
+
+typedef struct nombre_id {
+	string id;
+	string nombre;
+} nombre_id; 
+
+
+typedef struct interfaces {
+	bool laser;
+	bool motor;
+	bool radar;
+	bool encoders;
+	bool lat_lon;
+	bool camara;
+	bool ptencoders;
+} interfaces;
+
+list <nombre_id> ListaNombres;
+
+interfaces interIce;
+
+int def = 0; 	// contador de estados sin identificar (nombre).  //Ya no se usa, se concatena el id del estado 'RSB'
+
+//string varAux, funAux;//**********************Comentado por RSB
+
+ofstream fs; 
+
+string directorio, esquema, tiempo_esquema, estado_inicial;
+
+
+
+string int2string(int n){
+	std::stringstream flujo;
+
+	flujo << n;
+
+	return (flujo.str());
+}
+
+string DameNombre(string id){
+
+	list<nombre_id>::iterator pos;
+
+	pos = ListaNombres.begin();
+
+	while ( (pos != ListaNombres.end()) & (pos->id != id) )
+	{
+		pos++;
+	}
+	return pos->nombre;
+}
+
+
+string DameNombrePadre(xmlDocPtr doc,int idPadre,int idSub){
+	
+	xmlNodePtr root, nodeS, nodeE, nodeN;
+
+	root = xmlDocGetRootElement (doc);
+
+	nodeS = root->xmlChildrenNode;
+
+	bool encontrado;
+
+	string nombrePadre;
+
+	int idEstado;
+
+
+	encontrado = FALSE;
+
+	while (strcmp((const char*)nodeS->name, "SubAutomata")==0 and encontrado == FALSE) {
+
+		nodeE = nodeS->xmlChildrenNode;
+
+		if (atoi((const char*)xmlNodeGetContent (nodeE)) == idPadre) {
+		
+			while (strcmp((const char*)nodeE->name, "Estado")!=0){
+				nodeE = nodeE->next;
+			}
+
+			while (strcmp((const char*)nodeE->name, "Estado")==0 and encontrado == FALSE){
+
+				nodeN = nodeE->xmlChildrenNode;
+
+				while (strcmp((const char*)nodeN->name, "hijo")!=0){
+					nodeN = nodeN->next;
+				}
+
+				if (atoi((const char*)xmlNodeGetContent (nodeN)) == idSub) {
+					nodeN = nodeN->prev;
+
+					nombrePadre = (const char*)xmlNodeGetContent (nodeN);
+
+					if (nombrePadre == ""){
+
+						nodeN = nodeE->xmlChildrenNode;
+						
+						idEstado = atoi((const char*)xmlNodeGetContent (nodeN));
+					
+						nombrePadre = "default_"+int2string(idEstado);
+
+					}
+
+					encontrado = TRUE;
+				}
+				nodeE = nodeE->next;
+			}
+		}
+		nodeS = nodeS->next;
+	}	
+
+	return nombrePadre;
+
+}
+
+void 
+variablesH(xmlDocPtr doc){
+
+	xmlNodePtr root;
+	xmlNodePtr node;
+	xmlNodePtr nodeL;
+	char *libreria;
+
+	root = xmlDocGetRootElement (doc);
+
+	node = root->xmlChildrenNode;
+
+	while (strcmp((const char*)node->name, "Librerias")!=0) 
+
+	 	node = node->next;
+
+	nodeL = node->xmlChildrenNode;
+
+	while (nodeL!=NULL) {
+
+		libreria = (char*)xmlNodeGetContent (nodeL);
+		
+		if (strcmp((const char*)libreria, "laser")==0){
+			
+			fs << "extern float laser[NUM_LASER];" << endl;
+			
+		} 
+		else if (strcmp((const char*)libreria, "motor")==0){
+			
+				fs << "extern float v;" << endl;
+				fs << "extern float w;" << endl;
+
+			}
+			else if (strcmp((const char*)libreria, "radar")==0){
+
+				}	
+				else if (strcmp((const char*)libreria, "ptencoders")==0){
+
+					}		
+					else if (strcmp((const char*)libreria, "encoders")==0){
+
+							fs << "float robot[5];" << endl;
+
+						}
+						else if (strcmp((const char*)libreria, "lat_lon")==0){
+
+							}		
+							else if (strcmp((const char*)libreria, "camara")==0){	
+
+									fs << "extern char imagenRGB[SIFNTSC_COLUMNS*SIFNTSC_ROWS*3];" << endl;
+
+								}
+		//}//añadido
+
+			nodeL = nodeL->next;
+	}
+	
+	fs << endl;
+}
+
+
+int
+generar_lista_nombres(xmlDocPtr doc, fstream *fs)
+{
+	xmlNodePtr root;
+	xmlNodePtr nodeS;
+	xmlNodePtr nodeE;
+	xmlNodePtr nodeN;
+
+	string id;
+	string nombre; 
+
+	int idSub;
+	int idPadre;
+
+	list<nombre_id>::iterator pos;
+
+	root = xmlDocGetRootElement (doc);
+
+	nodeS = root->xmlChildrenNode;
+
+	while (strcmp((const char*)nodeS->name, "SubAutomata")==0) {
+
+	   	nodeE = nodeS->xmlChildrenNode;
+
+		idSub = atoi((const char*)xmlNodeGetContent (nodeE));
+
+		nodeE = nodeE->next;
+
+		idPadre = atoi((const char*)xmlNodeGetContent (nodeE));
+
+		nodeE = nodeE->next;//nos posicionamos en el primer estado
+
+		if (idPadre == 0) {
+
+			nombre_id t;
+
+			while (strcmp((const char*)nodeE->name, "Estado")==0){
+
+				nodeN = nodeE->xmlChildrenNode;
+
+				id = (const char*)xmlNodeGetContent (nodeN);
+
+				t.id = id;
+
+				while (strcmp((const char *)nodeN->name, (const char *)("nombre")) != 0){
+					nodeN = nodeN->next;
+				}
+
+				nombre = (const char*)xmlNodeGetContent (nodeN);
+
+				if (nombre != "")
+				{
+					t.nombre = nombre;
+				}
+				else{
+					t.nombre = "default_" + id;
+				}
+				
+				nodeE = nodeE->next;
+
+				ListaNombres.push_back(t);
+
+			}
+
+			//Componemos el struct de este subAutomata y borramos la lista para componer el siguiente
+			pos = ListaNombres.begin();			
+
+			*fs << "typedef enum Estado_Sub_"+int2string(idSub)+" {" << endl;
+			*fs << "	"+pos->nombre;
+			pos++;				
+
+			while (pos != ListaNombres.end()){
+			
+				*fs << "," << endl;
+				*fs << "	"+pos->nombre;
+				
+				pos++;				
+			}
+		
+			*fs << endl;					
+			*fs << "}Estado_Sub_"+int2string(idSub)+";" << endl;
+			*fs << endl;
+
+			//Antes de borrar la lista componemos un array con los nombres para luego poder mostrarlos en el GUI
+			pos = ListaNombres.begin();
+
+			*fs << "const char *Nombres_Sub_"+int2string(idSub)+"[] = {" << endl;
+			*fs << "	\""+pos->nombre+"\"";
+			pos++;		
+
+			while (pos != ListaNombres.end()){
+			
+				*fs << "," << endl;
+				*fs << "	\""+pos->nombre+"\"";
+				
+				pos++;				
+			}
+
+			*fs << endl;
+			*fs << "};" << endl;
+			*fs << endl;
+
+			//****************************************************************************************************************************
+
+			/*const char *myEnumTypeNames[] =
+			{
+				"enum1",
+				"enum2",
+				"enum3"
+			};*/
+
+			//****************************************************************************************************************************
+
+			ListaNombres.clear();
+
+		}
+		else{//Si no es el nodo padre tenemos que hacer estados "Ghost"
+			
+			nombre_id t;
+
+			while (strcmp((const char*)nodeE->name, "Estado")==0){
+
+				nodeN = nodeE->xmlChildrenNode;
+
+				id = (const char*)xmlNodeGetContent (nodeN);
+
+				t.id = id;
+
+				while (strcmp((const char *)nodeN->name, (const char *)("nombre")) != 0){
+					nodeN = nodeN->next;
+				}
+
+				nombre = (const char*)xmlNodeGetContent (nodeN);
+
+				if (nombre != "")
+				{
+					t.nombre = nombre;
+				}
+				else{
+					t.nombre = "default_" + id;
+				}
+
+				nodeE = nodeE->next;
+
+				ListaNombres.push_back(t);
+
+			}
+
+			//Componemos el struct de este subAutomata y borramos la lista para componer el siguiente
+			pos = ListaNombres.begin();			
+
+			*fs << "typedef enum Estado_Sub_"+int2string(idSub)+" {" << endl;
+			*fs << "	"+pos->nombre+"," << endl;
+			*fs << "	"+pos->nombre+"_ghost";
+			pos++;				
+
+			while (pos != ListaNombres.end()){
+			
+				//Al no ser el subautomata padre hacemos estados ghost
+				*fs << "," << endl;			
+				*fs << "	"+pos->nombre+"," << endl;
+				*fs << "	"+pos->nombre+"_ghost";				
+				pos++;				
+			}
+		
+			*fs << endl;					
+			*fs << "}Estado_Sub_"+int2string(idSub)+";" << endl;
+			*fs << endl;
+
+			//Antes de borrar la lista componemos un array con los nombres para luego poder mostrarlos en el GUI
+			pos = ListaNombres.begin();
+
+			*fs << "const char *Nombres_Sub_"+int2string(idSub)+"[] = {" << endl;
+			*fs << "	\""+pos->nombre+"\"";
+			pos++;		
+
+			while (pos != ListaNombres.end()){
+			
+				*fs << "," << endl;
+				*fs << "	\""+pos->nombre+"\"";
+				
+				pos++;				
+			}
+
+			*fs << endl;
+			*fs << "};" << endl;
+			*fs << endl;
+
+			ListaNombres.clear();
+
+		}	
+
+		nodeS = nodeS->next;
+    				
+	}
+	return 0;
+}
+
+
+char InvierteMayusculas(char c)
+{
+	return c^0x20;
+}
+
+string s_toupper(string cadena)
+{
+   unsigned int i;
+   
+   for(i = 0; i<cadena.length(); i++) 
+      cadena.at(i) = toupper(cadena.at(i)); //<--convierte a minusculas la cadena
+
+   return cadena;
+}
+
+string s_reemplazar(string cadena, string subcadena, string reemplazo)
+{
+
+   int indice;
+
+   for(;;)
+   {
+     indice = posicion((char *)cadena.c_str(), (char *)subcadena.c_str());
+     if(indice==-1)
+   	break;
+     else
+	cadena.replace(indice,subcadena.length(),reemplazo); 
+   }
+
+   return cadena;
+}
+
+string get_file_name (string file)
+{
+	size_t found;
+
+	found=file.rfind("/");
+	
+	return file.substr (++found);
+
+}
+
+
+int cfg (string path, xmlDocPtr doc)
+{
+	fstream fs; 
+	
+	fs.open(path.c_str(), ofstream::out);
+	if (fs.is_open()){
+		xmlNodePtr root;
+		xmlNodePtr node;
+		xmlNodePtr nodeL;
+		char *libreria;
+
+		root = xmlDocGetRootElement (doc);
+
+		node = root->xmlChildrenNode;
+
+		while (strcmp((const char*)node->name, "Librerias")!=0) 
+
+	 		node = node->next;
+
+		nodeL = node->xmlChildrenNode;
+
+		while (nodeL!=NULL) {
+
+			libreria = (char*)xmlNodeGetContent (nodeL);
+		
+			if (strcmp((const char*)libreria, "laser")==0){
+			
+				fs << "Introrob.Laser.Proxy=laser1:tcp -h localhost -p 9999" << endl;
+			
+			} 
+			else if (strcmp((const char*)libreria, "motor")==0){
+			
+				fs << "Introrob.Motors.Proxy=motors1:tcp -h localhost -p 9999" << endl;
+
+			}
+			else if (strcmp((const char*)libreria, "radar")==0){
+				fs << "Introrob.Sonars.Proxy=sonar1:tcp -h localhost -p 9999" << endl;
+			}	
+			else if (strcmp((const char*)libreria, "ptencoders")==0){
+				fs << "Introrob.PTEncoders1.Proxy=ptencoders1:tcp -h localhost -p 9999" << endl;
+				fs << "Introrob.PTEncoders2.Proxy=ptencoders2:tcp -h localhost -p 9999" << endl;
+			}		
+			else if (strcmp((const char*)libreria, "encoders")==0){
+
+				fs << "Introrob.Encoders.Proxy=encoders1:tcp -h localhost -p 9999" << endl;
+
+			}
+			else if (strcmp((const char*)libreria, "lat_lon")==0){
+				fs << "Introrob.PTMotors1.Proxy=ptmotors1:tcp -h localhost -p 9999" << endl;
+				fs << "Introrob.PTMotors2.Proxy=ptmotors2:tcp -h localhost -p 9999" << endl;
+			}		
+			else if (strcmp((const char*)libreria, "camara")==0){	
+
+				fs << "Introrob.Camera1.Proxy=cameraA:tcp -h localhost -p 9999" << endl;
+				fs << "Introrob.Camera2.Proxy=cameraB:tcp -h localhost -p 9999" << endl;
+
+
+			}
+	
+		nodeL = nodeL ->next;
+		}
+	
+		fs << endl;
+		fs.close();
+		
+		return 0;
+	}else{
+		return 1;
+	}
+	
+}
+
+
+int navegaH (string path, xmlDocPtr doc)
+{
+	fstream fs; 
+	xmlNodePtr root, nodeS, nodeE;
+	int idSub;
+	
+	fs.open(path.c_str(), ofstream::out);
+	if (fs.is_open()){									
+
+		fs << "#ifndef MYCOMPONENT_CONTROL_H"<< endl;
+		fs << "#define MYCOMPONENT_CONTROL_H"<< endl;
+		fs << endl;
+		fs << endl;
+		fs << "#include <iostream>" << endl;
+		fs << "#include <Ice/Ice.h>" << endl;
+		fs << "#include <IceUtil/IceUtil.h>" << endl;
+		fs << "#include <jderobot/camera.h>" << endl;
+		fs << "#include <jderobot/motors.h>" << endl;
+		fs << "#include <jderobot/ptmotors.h>" << endl;
+		fs << "#include <jderobot/laser.h>" << endl;
+		fs << "#include <jderobot/encoders.h>" << endl;
+		fs << "#include <jderobot/ptencoders.h>" << endl;
+		fs << "#include <colorspaces/colorspacesmm.h>" << endl;
+		fs << "#include <pthread.h>" << endl;
+		fs << endl;
+		fs << endl;		
+		fs << "namespace mycomponent {" << endl; 						
+		fs << "		class Gui;" << endl;
+		fs << "		class Control {" << endl;
+		fs << "		public:" << endl;
+		fs << endl;
+		fs << "		virtual ~Control();" << endl;
+		fs << endl;
+
+		fs << "			//FUNCTIONS" << endl;
+		fs << "			void handleCameras();" << endl;
+		fs << "			void resetControl();" << endl;
+	
+		fs << "			//HANDLE THREADS" << endl;
+		fs << "			pthread_t thr_gui;" << endl;
+
+
+		root = xmlDocGetRootElement (doc);
+
+		nodeS = root->xmlChildrenNode;
+
+		while (strcmp((const char*)nodeS->name, "SubAutomata")==0) {
+			
+			nodeE = nodeS->xmlChildrenNode;
+
+			idSub = atoi((const char*)xmlNodeGetContent (nodeE));
+
+			fs << "			pthread_t thr_sub_"+int2string(idSub)+";" << endl;
+
+			nodeS = nodeS->next;
+			
+		}
+
+		fs << "			pthread_mutex_t controlGui;" << endl;
+
+		fs << endl;
+		fs << "			// INTERFACES DATA" << endl;
+		fs << "			jderobot::EncodersDataPtr ed;" << endl;
+		fs << "			jderobot::LaserDataPtr ld;" << endl;
+		fs << "			jderobot::ImageDataPtr data1; // Contains the image info" << endl;
+		fs << "			jderobot::ImageDataPtr data2; // Contains the image info" << endl;
+		fs << "			jderobot::PTEncodersDataPtr pted1;" << endl;
+		fs << "			jderobot::PTEncodersDataPtr pted2;" << endl;
+		fs << endl;
+		fs << "			// INTERFACES" << endl;
+		fs << "			jderobot::MotorsPrx mprx;" << endl;
+		fs << "			jderobot::EncodersPrx eprx;" << endl;
+		fs << "			jderobot::LaserPrx lprx;" << endl;
+		fs << "			jderobot::CameraPrx cprx1;" << endl;
+		fs << "			jderobot::CameraPrx cprx2;" << endl;
+		fs << "			jderobot::PTMotorsPrx ptmprx1;" << endl;
+		fs << "			jderobot::PTEncodersPrx pteprx1;" << endl;
+		fs << "			jderobot::PTMotorsPrx ptmprx2;" << endl;
+		fs << "			jderobot::PTEncodersPrx pteprx2;" << endl;
+	    fs << endl;
+		fs << "			colorspaces::Image* image1;	// Prepare the image to use with openCV" << endl;
+		fs << "			colorspaces::Image* image2;" << endl;
+	 	fs << endl;
+		fs << "		};//class" << endl;
+		fs << "	} // namespace" << endl;
+		fs << "#endif /*MYCOMPONENT_Control_H*/" << endl;
+		
+		return 0;
+	}else{
+		return 1;
+	}
+	
+}
+
+
+int navegaCPP (string path, xmlDocPtr doc)
+{
+	list<nombre_id>::iterator pos;
+	fstream fs; 
+	xmlNodePtr root, nodeS, nodeE, nodeN, nodeT;
+	string id, codigo, nombre;using namespace std;
+
+	int idSub;
+	int idPadre;
+	bool escrito_inicial = false;
+
+	int ciclo;
+	string varAux, funAux;
+	
+	fs.open(path.c_str(), ofstream::out);
+	if (fs.is_open()){
+
+
+		fs << "#include \"control_class.h\"" <<endl;
+		fs << "#include \"gui.h\"" << endl;
+		fs << endl;
+		fs << endl;
+		fs << "mycomponent::Control *control;" << endl;
+		fs << endl;
+
+		//ITERAR PARA DEFINIR LOS STRUCT DE LOS ESTADOS
+		//...
+		generar_lista_nombres(doc, &fs);
+		fs << endl;
+		//...
+
+		//Variables para los automatas
+		//...
+
+		//fs << "		" << funAux << endl;
+		//fs << endl;
+		//fs << endl;
+		//fs << "		" << varAux << endl;
+		//fs << endl;
+		//fs << endl;
+		//...
+
+		//DEFINIR ESTADOS INICIALES
+		//...
+		root = xmlDocGetRootElement (doc);
+
+		nodeS = root->xmlChildrenNode;
+
+		while (strcmp((const char*)nodeS->name, "SubAutomata")==0) {
+
+		   	nodeE = nodeS->xmlChildrenNode;
+
+			idSub = atoi((const char*)xmlNodeGetContent (nodeE));
+
+			nodeE = nodeE->next;
+			idPadre = atoi((const char*)xmlNodeGetContent (nodeE));
+			nodeE = nodeE->next;//nos posicionamos en el primer estado
+
+			escrito_inicial = false;
+
+			while ((strcmp((const char*)nodeE->name, "Estado")==0) and (escrito_inicial == false)){
+				if (strcmp((const char*)xmlGetProp (nodeE, (const xmlChar*)"estado_inicial"), (const char*)"true")==0){
+				
+					nombre_id t;	
+
+					nodeN = nodeE->xmlChildrenNode;
+
+					id = (const char*)xmlNodeGetContent (nodeN);
+
+					t.id = id;
+
+					while (strcmp((const char *)nodeN->name, (const char *)("nombre")) != 0){
+						nodeN = nodeN->next;
+					}
+
+					nombre = (const char*)xmlNodeGetContent (nodeN);
+
+					if (nombre != "")
+					{
+						t.nombre = nombre;
+					}
+					else{
+						t.nombre = "default_" + id;
+					}				
+					
+					//Si es un subautómata hijo tiene que empezar en estado "_ghost"
+					if (idPadre == 0) {
+						fs << "Estado_Sub_"+int2string(idSub)+" Sub_"+int2string(idSub)+"="+t.nombre+";" << endl;
+					}else{
+						fs << "Estado_Sub_"+int2string(idSub)+" Sub_"+int2string(idSub)+"="+t.nombre+"_ghost;" << endl;
+					}					
+
+					escrito_inicial = true;
+
+				}
+
+				nodeE = nodeE->next;
+			}
+
+			if (escrito_inicial == false){//Si el usuario no definió estado inicial para el nivel ponemos como inicial al primero
+				nodeE = nodeS->xmlChildrenNode;
+				nodeE = nodeE->next;
+				nodeE = nodeE->next;//nos posicionamos en el primer estado
+
+				nombre_id t;	
+
+				nodeN = nodeE->xmlChildrenNode;
+
+				id = (const char*)xmlNodeGetContent (nodeN);
+
+				t.id = id;
+
+				while (strcmp((const char *)nodeN->name, (const char *)("nombre")) != 0){
+					nodeN = nodeN->next;
+				}
+
+				nombre = (const char*)xmlNodeGetContent (nodeN);
+
+				if (nombre != "")
+				{
+					t.nombre = nombre;
+				}
+				else{
+					t.nombre = "default_" + id;
+				}				
+
+				//Si es un subautómata hijo tiene que empezar en estado "_ghost"
+				if (idPadre == 0) {
+					fs << "Estado_Sub_"+int2string(idSub)+" Sub_"+int2string(idSub)+"="+t.nombre+";" << endl;
+				}else{
+					fs << "Estado_Sub_"+int2string(idSub)+" Sub_"+int2string(idSub)+"="+t.nombre+"_ghost;" << endl;
+				}
+
+			}
+
+			nodeS = nodeS->next;			
+			
+		}
+
+		fs << endl;
+		fs << endl;
+
+		fs << "namespace mycomponent {" << endl;
+		fs << endl;
+
+		//Comentar handleCameras?? si no selecciona camara fallará-----##############################################################################
+		fs << "void Control::handleCameras(){" << endl;
+   		fs << endl;
+		fs << "		this->data1 = cprx1->getImageData();" << endl;
+		fs << "		colorspaces::Image::FormatPtr fmt1 = colorspaces::Image::Format::searchFormat(this->data1->description->format);" << endl;
+		fs << "		if (!fmt1)" << endl;
+		fs << "		    throw \"Format not supported\";" << endl;
+		fs << endl;
+		fs << "		this->image1 = new colorspaces::Image (this->data1->description->width, this->data1->description->height, fmt1, &(this->data1->pixelData[0])); // Prepare the image to use with openCV " << endl;
+		fs << endl;
+		fs << "		this->data2 = cprx2->getImageData();" << endl;
+		fs << "		colorspaces::Image::FormatPtr fmt2 = colorspaces::Image::Format::searchFormat(this->data2->description->format);" << endl;
+		fs << "		if (!fmt2)" << endl;
+		fs << "			throw \"Format not supported\";" << endl;
+		fs << endl;  
+		fs << "		this->image2 = new colorspaces::Image (this->data2->description->width, this->data2->description->height, fmt2, &(this->data2->pixelData[0])); // Prepare the image to use with openCV" << endl;
+	    fs << endl;
+	    fs << "}" << endl;
+		fs << endl;
+
+		fs << "void Control::resetControl(){" << endl;
+		fs << endl;
+      	fs << "this->mprx->setV(0);" << endl;
+        fs << "this->mprx->setW(0);" << endl;
+		fs << "this->mprx->setL(0);" << endl;
+		fs << endl;
+		fs << "}" << endl;
+		fs << endl;
+   		
+      	fs << "Control::~Control() {}" << endl;
+		fs << endl;
+      	fs << "}" << endl;
+		fs << endl;
+
+		fs << "void *showGui(void*){" << endl;
+   		fs << "		mycomponent::Gui *gui;" << endl;
+   		fs << "		struct timeval a, b;	" << endl;
+   		fs << "		int cycle = 100;" << endl;
+   		fs << "		long totalb,totala;" << endl;
+   		fs << "		long diff;" << endl;
+		fs << endl;
+		fs << "using namespace std;" << endl;
+		fs << "		string tab=\"\";" << endl;
+		fs << endl;
+
+   		fs << "		gui = new mycomponent::Gui(control);" << endl;
+		fs << endl;
+
+   		fs << "		while(true){" << endl;
+		fs << endl;
+		fs << "			gettimeofday(&a,NULL);" << endl;
+      	fs << "			totala=a.tv_sec*1000000+a.tv_usec;" << endl;
+      	fs << endl;
+		fs << "			system(\"clear\");" << endl;
+      	fs << endl;
+//**********************Se genera el gui automatico**********************************************************************************************
+
+		root = xmlDocGetRootElement (doc);
+
+		nodeS = root->xmlChildrenNode;
+
+		while (strcmp((const char*)nodeS->name, "SubAutomata")==0) {
+
+		   	nodeE = nodeS->xmlChildrenNode;
+			idSub = atoi((const char*)xmlNodeGetContent (nodeE));
+
+			nodeE = nodeE->next;
+			idPadre = atoi((const char*)xmlNodeGetContent (nodeE));
+
+			if (idPadre == 0){
+				fs << "			printf(\"%s\\n\", Nombres_Sub_"+int2string(idSub)+"[Sub_"+int2string(idSub)+"]);" << endl;
+				fs << "			tab = tab+\"   \";" << endl;
+				fs << endl;
+			}else{
+				fs << "			if (Sub_"+int2string(idSub)+"%2 == 0){" << endl; //Si no esta en un estado "_ghost"
+				fs << "				printf(\"%s%s\\n\", tab.c_str(), Nombres_Sub_"+int2string(idSub)+"[Sub_"+int2string(idSub)+"/2]);" << endl;
+				fs << "				tab = tab+\"   \";" << endl;
+				fs << "			}" << endl;
+				fs << endl;
+			}
+
+			nodeS = nodeS->next;
+		}
+
+      	fs << "			tab = \"\";" << endl;
+	
+      //Controll->update();
+      //fs << "			control->handleCameras();" << endl;
+      //fs << "			gui->display(*control->image1,*control->image2);" << endl;
+      //fs << endl;
+//**********************FIN Se genera el gui automatico******************************************************************************************
+
+      
+      	fs << "			gettimeofday(&b,NULL);" << endl;
+      	fs << "			totalb=b.tv_sec*1000000+b.tv_usec;" << endl;
+      //std::cout << "Introrob takes " << (totalb-totala)/1000 << " ms" << std::endl;
+      	fs << "			diff = (totalb-totala)/1000;" << endl;
+		fs << endl;
+
+      	fs << "			if(diff < 0 || diff > cycle)" << endl;
+        fs << "				diff = cycle;" << endl;
+        fs << "			else" << endl;
+        fs << "				diff = cycle-diff;" << endl;
+		fs << endl;
+      
+      //Sleep Algorithm
+      	fs << "			usleep(diff*1000);" << endl;
+      	fs << "			if(diff < 33)" << endl;
+        fs << "				usleep(33*1000);" << endl;
+   		fs << "		}" << endl;
+		fs << "}" << endl;
+		fs << endl;
+		fs << endl;
+		fs << endl;
+
+//---------------ITERAR PARA CREAR EL MOTOR TEMPORAL/CONTROL DE CADA HILO**********************************
+
+	root = xmlDocGetRootElement (doc);
+
+	nodeS = root->xmlChildrenNode;
+
+	while (strcmp((const char*)nodeS->name, "SubAutomata")==0) {
+
+		ListaNombres.clear();		
+
+		nodeE = nodeS->xmlChildrenNode;
+
+		idSub = atoi((const char*)xmlNodeGetContent (nodeE));
+
+		nodeE = nodeE->next;
+
+		idPadre = atoi((const char*)xmlNodeGetContent (nodeE));
+
+		nodeE = nodeE->next;//Nos posicionamos en el primer estado
+
+		//Saltamos todos los estados
+		while (strcmp((const char*)nodeE->name, "Estado")==0){
+			nodeE = nodeE->next;
+		}
+
+		nodeE = nodeE->next;//Pasamos los interfaces ICE
+		nodeE = nodeE->next;//Pasamos las variables auxiliares
+		nodeE = nodeE->next;//Nos colocamos en las funciones auxiliares
+		
+		funAux = (char*)xmlNodeGetContent (nodeE);
+
+		//Hemos ido hasta las funciones aux porque hay que ponerlas antes del motor del hilo, sino no compilará
+		fs << funAux <<endl;
+
+		//Despues de eso volvemos a la posición adecuada para continuar componiento el motor de cada hilo
+		nodeE = nodeS->xmlChildrenNode;//Saltamos idSub...
+		nodeE = nodeE->next;//... y idPadre
+		nodeE = nodeE->next;//Nos posicionamos en el primer estado y ya podemos continuar
+
+		fs << "void *motor_sub_"+int2string(idSub)+"(void*){" << endl;//Cabecera del motor del subautomata
+		fs << endl;
+
+		nombre_id t;
+
+		while (strcmp((const char*)nodeE->name, "Estado")==0){
+
+			nodeN = nodeE->xmlChildrenNode;
+
+			id = (const char*)xmlNodeGetContent (nodeN);
+
+			t.id = id;
+
+			while (strcmp((const char *)nodeN->name, (const char *)("nombre")) != 0){
+				nodeN = nodeN->next;
+			}
+
+			nombre = (const char*)xmlNodeGetContent (nodeN);
+
+			if (nombre != "")
+			{
+				t.nombre = nombre;
+			}
+			else{
+				t.nombre = "default_" + id;
+			}
+			
+			nodeE = nodeE->next;
+
+			ListaNombres.push_back(t);
+
+		}
+
+		//Salimos posicionados en el tiempo de iteración
+
+		ciclo = atoi((const char*)xmlNodeGetContent (nodeE)); //Ciclo de iteracion del subautomata
+
+		nodeE = nodeE->next;//Pasamos los interfaces ICE
+		nodeE = nodeE->next;//Nos colocamos en las variables auxiliares
+
+		varAux = (char*)xmlNodeGetContent (nodeE);
+
+		nodeE = nodeE->next;//Nos colocamos en las funciones auxiliares
+		
+		//funAux = (char*)xmlNodeGetContent (nodeE);
+
+		fs << "		struct timeval a, b;" << endl;
+	    fs << "		int cycle="+int2string(ciclo)+";" << endl;
+	    fs << "		long totalb,totala;" << endl;
+	    fs << "		long diff;" << endl;
+		fs << "		time_t t_ini;"<< endl;
+		fs << "		time_t t_fin;"<< endl;
+		fs << "		double secs;" << endl;
+		fs << "		bool t_activated;" << endl;
+		fs << endl;
+		fs << "		" << varAux << endl;
+		fs << endl;
+		fs << endl;
+		fs << "		while(true){" << endl;
+		fs << "		gettimeofday(&a,NULL);" << endl;
+		fs << "		totala=a.tv_sec*1000000+a.tv_usec;" << endl;
+		fs << endl;
+		
+
+		if (idPadre != 0) { //Si es el subautomata raiz
+
+			fs << "		if (Sub_"+int2string(idPadre)+"=="+DameNombrePadre(doc,idPadre,idSub)+"){" << endl;
+			fs << "			if(";
+
+			pos = ListaNombres.begin();	
+
+			fs << "Sub_"+int2string(idSub)+"=="+pos->nombre+"_ghost";
+
+			pos++;
+
+			while (pos != ListaNombres.end()) {
+
+				fs << " || Sub_"+int2string(idSub)+"=="+pos->nombre+"_ghost";
+				pos++;
+
+			}
+
+			fs << "){" << endl;
+			fs << "			Sub_"+int2string(idSub)+"= (Estado_Sub_"+int2string(idSub)+")(Sub_"+int2string(idSub)+"-1);" << endl;
+			fs << "		}" << endl;
+
+		}	
+		
+			
+		fs << "		//Switch de evaluación de transiciones" << endl;
+		fs << "		switch (Sub_"+int2string(idSub)+"){" << endl;
+
+		pos = ListaNombres.begin();	
+
+		nodeE = nodeS->xmlChildrenNode;//Volvemos a recorrer el subautomata		
+		nodeE = nodeE->next;
+		nodeE = nodeE->next;//Nos posicionamos en el primer estado					
+
+		while (pos != ListaNombres.end()){
+			fs << "			case "+pos->nombre+":" << endl;
+			fs << "			{" << endl;
+			
+			nodeN = nodeE->xmlChildrenNode;
+
+			while (strcmp((const char *)nodeN->name, (const char *)("transiciones")) != 0){
+				nodeN = nodeN->next;
+			}//Nos colocamos en las transiciones del estado
+
+			nodeT = nodeN->xmlChildrenNode;
+
+			if (nodeT!=NULL){
+		
+				while (nodeT!=NULL){
+					id = (const char*)xmlNodeGetContent (nodeT->xmlChildrenNode->next->next);
+					if (nodeT->xmlChildrenNode->next->next->next != NULL){
+						if(strcmp((const char*)nodeT->xmlChildrenNode->next->next->next->name,"codigo") == 0)
+						{
+							codigo = (const char*)xmlNodeGetContent (nodeT->xmlChildrenNode->next->next->next);
+							fs << "					if (" << codigo << "){" << endl;
+						//	fs << "						this->ventana->change_nodo_color (Estado_Actual, 3);" << endl;
+						//	fs << "						Estado_Anterior = Estado_Actual;" << endl;
+							fs << "						Sub_"+int2string(idSub)+"="<<  DameNombre(id) << ";" << endl;
+							fs << "					}" << endl;
+						}else if (strcmp((const char*)nodeT->xmlChildrenNode->next->next->next->name,"tiempo") == 0){
+							int tiempoTrans = atoi((const char*)xmlNodeGetContent (nodeT->xmlChildrenNode->next->next->next));
+		
+							fs << "					if (!t_activated){" << endl;
+							fs << "						t_ini = time(NULL);" << endl;
+	  		
+							fs << "						t_activated = true;" << endl;
+							fs << "					}else{" << endl;
+							fs << "						t_fin = time(NULL);" << endl;
+							fs << "						secs = difftime(t_fin, t_ini);" << endl;
+							fs << "						if (secs > (double) "<< ((double)tiempoTrans/1000) <<"){" << endl;
+						//	fs << "							this->ventana->change_nodo_color (Estado_Actual, 3);" << endl;
+						//	fs << "							Estado_Anterior = Estado_Actual;" << endl;
+							fs << "							Sub_"+int2string(idSub)+"="<<  DameNombre(id) << ";" << endl;
+							fs << "							t_activated = false;" << endl;
+						
+							fs << "						}" << endl;
+							fs << "					}" << endl;
+						
+						}
+					}
+					nodeT = nodeT->next;
+				}//fin while de transiciones
+			
+			}
+
+			fs << "				break;" << endl;
+			fs << "			}" << endl;
+
+			pos++;
+			nodeE = nodeE->next;				
+
+		}//fin while listaNombres para switch de evaluacion de transiciones
+
+		fs << "		}" << endl; //Para cerrar el switch
+
+
+		//Volvemos al principio del subautomata para hacer el switch de actuacion
+		pos = ListaNombres.begin();	
+
+		nodeE = nodeS->xmlChildrenNode;//Volvemos a recorrer el subautomata		
+		nodeE = nodeE->next;
+		nodeE = nodeE->next;//Nos posicionamos en el primer estado
+
+		fs << "		//Switch de actuacion" << endl;
+		fs << "		switch (Sub_"+int2string(idSub)+"){" << endl;
+
+		while (pos != ListaNombres.end()){
+
+			fs << "			case "+pos->nombre+":" << endl;
+			fs << "			{" << endl;
+
+			nodeN = nodeE->xmlChildrenNode;
+
+			while (strcmp((const char *)nodeN->name, (const char *)("codigo")) != 0){
+				nodeN = nodeN->next;
+			}//Nos colocamos en el codigo del estado
+		
+			codigo = (const char*)xmlNodeGetContent (nodeN);
+
+			fs << "			" << codigo << endl;
+
+			fs << "				break;" << endl;
+			fs << "			}" << endl;		
+
+			pos++;
+			nodeE = nodeE->next;		
+
+		}//fin while listaNombres para el switch de actuacion
+
+		fs << "		}" << endl; //Para cerrar el switch
+			
+			
+		if (idPadre != 0) {
+		
+			fs << "}else{" << endl;
+			fs << "		if(";
+
+			pos = ListaNombres.begin();	
+
+			fs << "Sub_"+int2string(idSub)+"=="+pos->nombre;
+
+			pos++;
+
+			while (pos != ListaNombres.end()) {
+
+				fs << " || Sub_"+int2string(idSub)+"=="+pos->nombre;
+				pos++;
+
+			}
+
+			fs << "){" << endl;
+			fs << "			Sub_"+int2string(idSub)+"= (Estado_Sub_"+int2string(idSub)+")(Sub_"+int2string(idSub)+"+1);" << endl;
+			fs << "		}" << endl;
+			fs << "	}" << endl;
+
+		}
+
+		fs << endl;
+		fs << endl;
+		fs << "//Motor temporal del subautomata" << endl;
+		fs << endl;
+
+		fs << "		gettimeofday(&b,NULL);" << endl;
+		fs << "		totalb=b.tv_sec*1000000+b.tv_usec;" << endl;
+		fs << "		diff = (totalb-totala)/1000;" << endl;
+		fs << "		if(diff < 0 || diff > cycle)" << endl;
+		fs << "			diff = cycle;" << endl;
+		fs << "		else" << endl;
+		fs << "			diff = cycle-diff;" << endl;
+		fs << endl;
+		fs << "		//Sleep Algorithm" << endl;
+		fs << "			usleep(diff*1000);" << endl;
+		fs << "		if(diff < 33)" << endl;
+		fs << "			usleep(33*1000);" << endl;
+		fs << "	 }" << endl;
+		fs << "}" << endl; 
+		fs << endl;
+		fs << endl;
+		
+		nodeS = nodeS->next;
+
+	}//fin while subautomata
+
+
+//---------------FIN DE ITERAR PARA CREAR EL MOTOR TEMPORAL/CONTROL DE CADA HILO***************************
+
+		fs << "int main(int argc, char** argv){" << endl;
+		fs << endl;
+
+		fs << endl;
+
+		fs << "		int status;" << endl;
+		fs << "		Ice::CommunicatorPtr ic;" << endl;
+ 	    fs << "		struct timeval a, b;" << endl;
+		fs << "		int cycle = 300;" << endl;
+		fs << "		long totalb,totala;" << endl;
+		fs << "		long diff;" << endl;
+		fs << "		bool guiActivated=0;" << endl;
+		fs << "		bool controlActivated=0;" << endl;
+		fs << endl;
+
+
+			//th_data data_1;
+			//th_data data_2;
+			//th_data data_3;
+		   
+		fs << "		control = new mycomponent::Control();" << endl;
+		fs << endl;
+		fs << "		pthread_mutex_init(&control->controlGui, NULL);" << endl;
+
+		fs << "		controlActivated=1;" << endl;
+		fs << "	    guiActivated=1;" << endl;
+
+		//if(guiActivated){
+      	fs << "		pthread_create(&control->thr_gui, NULL, &showGui, NULL);" << endl;//OBJETIVo2  
+   		//}
+		
+		fs << "	  try{" << endl;
+		fs << endl;
+      
+		fs << "		ic = Ice::initialize(argc,argv);" << endl;
+		fs << "			//-----------------ICE----------------//" << endl;
+
+//--------Se cargan los interfaces que usen todos los subautomatas en conjunto********
+
+		
+		interIce.laser = false;
+		interIce.motor = false;
+		interIce.radar = false;
+		interIce.encoders = false;
+		interIce.lat_lon = false;
+		interIce.camara = false;
+		interIce.ptencoders = false;
+
+		root = xmlDocGetRootElement (doc);
+
+		nodeS = root->xmlChildrenNode;
+
+		while (strcmp((const char*)nodeS->name, "SubAutomata")==0) {
+
+			nodeE = nodeS->xmlChildrenNode;
+
+			while (strcmp((const char*)nodeE->name, "Librerias")!=0) {
+				nodeE = nodeE->next;
+			}
+
+			nodeT = nodeE->xmlChildrenNode;
+			
+			string interface;
+			while (nodeT != NULL){
+				interface = (const char*)xmlNodeGetContent (nodeT);	
+				if (interface == "laser")
+					interIce.laser = true;
+				if (interface == "motor")
+					interIce.motor = true;
+				if (interface == "radar")
+					interIce.radar = true;
+				if (interface == "encoders")
+					interIce.encoders = true;
+				if (interface == "lat_lon")
+					interIce.lat_lon = true;
+				if (interface == "camara")
+					interIce.camara = true;
+				if (interface == "ptencoders")
+					interIce.ptencoders = true;
+		
+				nodeT = nodeT->next;
+			}
+
+			nodeS = nodeS->next;
+
+		}
+
+		//Añadimos los interfaces que hemos detectado como necesarios
+		if (interIce.laser == true){
+			fs << "		// Contact to LASER interface" << endl;
+			fs << "		Ice::ObjectPrx baseLaser = ic->propertyToProxy(\"Mycomponent.Laser.Proxy\");" << endl;
+			fs << "		if (0==baseLaser)" << endl;
+			fs << "		throw \"Could not create proxy with laser\";" << endl;
+			fs << endl;
+			fs << "		// Cast to laser" << endl;
+			fs << "		control->lprx = jderobot::LaserPrx::checkedCast(baseLaser);" << endl;
+			fs << "		if (0== control->lprx)" << endl;
+			fs << "			throw \"Invalid proxy Mycomponent.Laser.Proxy\";" << endl;
+			fs << endl;
+		}
+
+		if (interIce.motor == true){
+			fs << "		// Contact to MOTORS interface" << endl;
+			fs << "		Ice::ObjectPrx baseMotors = ic->propertyToProxy(\"Mycomponent.Motors.Proxy\");" << endl;
+			fs << "		if (0==baseMotors)" << endl;
+			fs << "			throw \"Could not create proxy with motors\";" << endl;
+			fs << endl;
+			fs << "		// Cast to motors" << endl;
+			fs << "		 control->mprx = jderobot::MotorsPrx::checkedCast(baseMotors);" << endl;
+			fs << "		if (0== control->mprx)" << endl;
+			fs << "			throw \"Invalid proxy Mycomponent.Motors.Proxy\";" << endl;
+			fs << endl;
+		}
+
+		//if (interIce.radar == true){
+		//}
+
+		if (interIce.encoders == true){
+			fs << "		// Contact to ENCODERS interface" << endl;
+			fs << "		Ice::ObjectPrx baseEncoders = ic->propertyToProxy(\"Mycomponent.Encoders.Proxy\");" << endl;
+			fs << "		if (0==baseEncoders)" << endl;
+			fs << "			throw \"Could not create proxy with encoders\";" << endl;
+			fs << endl;
+			fs << "		// Cast to encoders" << endl;
+			fs << "		control->eprx = jderobot::EncodersPrx::checkedCast(baseEncoders);" << endl;
+			fs << "		if (0== control->eprx)" << endl;
+			fs << "			throw \"Invalid proxy Mycomponent.Encoders.Proxy\";" << endl;
+			fs << endl;
+		}
+
+		if (interIce.lat_lon == true){
+			fs << "		// Contact to PTMOTORS interface" << endl;
+			fs << "		Ice::ObjectPrx ptmotors1 = ic->propertyToProxy(\"Mycomponent.PTMotors1.Proxy\");" << endl;
+			fs << "		if (0==ptmotors1)" << endl;
+			fs << "			throw \"Could not create proxy with motors\";" << endl;
+			fs << endl;
+			fs << "		// Cast to ptmotors" << endl;
+			fs << "		control->ptmprx1 = jderobot::PTMotorsPrx::checkedCast(ptmotors1);" << endl;
+			fs << "		if (0== control->ptmprx1)" << endl;
+			fs << "			throw \"Invalid proxy Mycomponent.PTMotors1.Proxy\";" << endl;
+			fs << endl;
+			fs << "		// Contact to PTMOTORS interface" << endl;
+			fs << "		Ice::ObjectPrx ptmotors2 = ic->propertyToProxy(\"Mycomponent.PTMotors2.Proxy\");" << endl;
+			fs << "		if (0==ptmotors2)" << endl;
+			fs << "			throw \"Could not create proxy with motors\";" << endl;
+			fs << "		// Cast to ptmotors" << endl;
+			fs << endl;
+			fs << "		control->ptmprx2 = jderobot::PTMotorsPrx::checkedCast(ptmotors2);" << endl;
+			fs << "		if (0== control->ptmprx2)" << endl;
+			fs << "			throw \"Invalid proxy Mycomponent.PTMotors2.Proxy\";" << endl;
+			fs << endl;
+		}
+
+		if (interIce.camara == true){
+			fs << "		// Get driver camera" << endl;
+			fs << "		Ice::ObjectPrx camara1 = ic->propertyToProxy(\"Mycomponent.Camera1.Proxy\");" << endl;
+			fs << "		if (0==camara1)" << endl;
+			fs << "			throw \"Could not create proxy to camera1 server\";" << endl;
+			fs << endl;
+			fs << "		// cast to CameraPrx" << endl;
+			fs << "		control->cprx1 = jderobot::CameraPrx::checkedCast(camara1);" << endl;
+			fs << "		if (0== control->cprx1)" << endl;
+			fs << "			throw \"Invalid proxy\";" << endl;
+			fs << endl;
+			fs << "		// Get driver camera" << endl;
+			fs << "		Ice::ObjectPrx camara2 = ic->propertyToProxy(\"Mycomponent.Camera2.Proxy\");" << endl;
+			fs << "		if (0==camara2)" << endl;
+			fs << "			throw \"Could not create proxy to camera2 server\";" << endl;
+			fs << endl;
+			fs << "		// cast to CameraPrx" << endl;
+			fs << "		control->cprx2 = jderobot::CameraPrx::checkedCast(camara2);" << endl;
+			fs << "		if (0== control->cprx2)" << endl;
+			fs << "			throw \"Invalid proxy\";" << endl;
+			fs << endl;
+		}
+
+		if (interIce.ptencoders == true){
+			fs << "		// Contact to PTENCODERS interface" << endl;
+			fs << "		Ice::ObjectPrx ptencoders1 = ic->propertyToProxy(\"Mycomponent.PTEncoders1.Proxy\");" << endl;
+			fs << "		if (0==ptencoders1)" << endl;
+			fs << "			throw \"Could not create proxy with encoders\";" << endl;
+			fs << endl;
+			fs << "		// Cast to encoders" << endl;
+			fs << "		control->pteprx1 = jderobot::PTEncodersPrx::checkedCast(ptencoders1);" << endl;
+			fs << "		if (0== control->pteprx1)" << endl;
+			fs << "			throw \"Invalid proxy Mycomponent.PTEncoders1.Proxy\";" << endl;
+			fs << endl;
+			fs << "		// Contact to PTENCODERS interface" << endl;
+			fs << "		Ice::ObjectPrx ptencoders2 = ic->propertyToProxy(\"Mycomponent.PTEncoders2.Proxy\");" << endl;
+			fs << "		if (0==ptencoders2)" << endl;
+			fs << "			throw \"Could not create proxy with encoders\";" << endl;
+			fs << endl;
+			fs << "		// Cast to encoders" << endl;
+			fs << "		control->pteprx2 = jderobot::PTEncodersPrx::checkedCast(ptencoders2);" << endl;
+		  	fs << "		if (0== control->pteprx2)" << endl;
+			fs << "			throw \"Invalid proxy Mycomponent.PTEncoders2.Proxy\";" << endl;
+			fs << endl;
+		}
+		
+
+//------------------------------fin carga interfaces ICE *****************************
+
+		
+		fs << "				//-----------------ICE----------------//" << endl;
+		fs << "//****************************** Processing the Control ******************************///" << endl;
+		fs << "			//---------------- ITERATIONS CONTROL -----------//" << endl;
+		fs << endl;		
+		fs << endl;
+      	fs << "//Inicializacion de datos para los distintos hilos de control y creacion de hilos" << endl;
+
+
+		root = xmlDocGetRootElement (doc);
+
+		nodeS = root->xmlChildrenNode;
+
+		while (strcmp((const char*)nodeS->name, "SubAutomata")==0) {
+			
+			nodeE = nodeS->xmlChildrenNode;
+
+			idSub = atoi((const char*)xmlNodeGetContent (nodeE));
+
+			fs << "		pthread_create(&control->thr_sub_"+int2string(idSub)+",NULL, &motor_sub_"+int2string(idSub)+", NULL);" << endl;
+
+			nodeS = nodeS->next;
+			
+		}
+
+		fs << endl;
+		fs << endl;
+		fs << "		pthread_join(control->thr_gui, NULL);" << endl;
+		fs << endl;
+
+		root = xmlDocGetRootElement (doc);
+
+		nodeS = root->xmlChildrenNode;
+
+		while (strcmp((const char*)nodeS->name, "SubAutomata")==0) {
+			
+			nodeE = nodeS->xmlChildrenNode;
+
+			idSub = atoi((const char*)xmlNodeGetContent (nodeE));
+
+			fs << "		pthread_join(control->thr_sub_"+int2string(idSub)+",NULL);" << endl;
+
+			nodeS = nodeS->next;
+			
+		}
+
+		fs << endl;		
+		fs << endl;
+      	fs << "	 }//del try" << endl;
+		fs << "	 catch (const Ice::Exception& ex) {" << endl;
+		fs << "		std::cerr << ex << std::endl;" << endl;
+		fs << "		status = 1;" << endl;
+		fs << "	 }" << endl;
+		fs << "  catch (const char* msg) {" << endl;
+      	fs << "		std::cerr << msg << std::endl;" << endl;
+		fs << "		status = 1;" << endl;
+		fs << "  }" << endl;
+		fs << endl;
+		fs << "if (ic)" << endl;
+		fs << "	 ic->destroy();" << endl;
+		fs << endl;
+		fs << "return 0;" << endl;
+		fs << endl;
+      	fs << "}" << endl;
+		fs << endl;
+
+		
+		fs.close();
+		
+		return 0;
+	}else{
+		return 1;
+	}
+	
+}
+
+int configuracionICE (string path)
+{
+	fstream fs; 
+	
+	fs.open(path.c_str(), ofstream::out);
+	if (fs.is_open()){
+
+		if (interIce.motor == true){
+			fs << "Mycomponent.Motors.Proxy=motors1:tcp -h localhost -p 9999" << endl;
+		}
+
+		if (interIce.camara == true){
+			fs << "Mycomponent.Camera1.Proxy=cameraA:tcp -h localhost -p 9999" << endl;
+			fs << "Mycomponent.Camera2.Proxy=cameraB:tcp -h localhost -p 9999" << endl;				
+		}
+
+		//if (interIce.radar == true){
+		//}
+
+		if (interIce.encoders == true){
+			fs << "Mycomponent.Encoders.Proxy=encoders1:tcp -h localhost -p 9999" << endl;
+		}
+
+		if (interIce.lat_lon == true){
+			fs << "Mycomponent.PTMotors1.Proxy=ptmotors1:tcp -h localhost -p 9999" << endl;
+			fs << "Mycomponent.PTMotors2.Proxy=ptmotors2:tcp -h localhost -p 9999" << endl;
+		}
+
+		if (interIce.laser == true){
+			fs << "Mycomponent.Laser.Proxy=laser1:tcp -h localhost -p 9999" << endl;
+		}
+
+		if (interIce.ptencoders == true){
+			fs << "Mycomponent.PTEncoders1.Proxy=ptencoders1:tcp -h localhost -p 9999" << endl;
+			fs << "Mycomponent.PTEncoders2.Proxy=ptencoders2:tcp -h localhost -p 9999" << endl;	
+		}				
+
+		fs.close();
+
+		return 0;
+	}else{
+		return 1;
+	}
+}
+
+
+int main( int argc, char *argv[])
+{
+	xmlDocPtr doc; 
+//	xmlNodePtr root;
+//	xmlNodePtr node;
+//	xmlNodePtr nodeE;
+//	xmlNodePtr nodeT, nodeTT;
+
+	string rutaAcopiar="";
+
+
+	
+	
+	string path;
+
+	char *filename = argv[1];
+
+	//strcpy(filename, "EstoEsUnaPrueba3.xml");
+	
+	printf("ARG: %s %s\n", argv[0], argv[1]);
+
+	doc = xmlParseFile (argv[1]);
+	
+
+
+	/* Nombre y Directorio Esquema */
+
+
+ 	printf("Fichero abierto: %s\n",filename);
+
+
+	string fich = filename;
+	int i;
+	size_t pos;
+	for (i=0; i < (int)fich.length(); i++)
+  	{
+   		if (fich.at(i) == '/')
+			pos = i;
+ 	}	
+	string fichero = fich.substr (++pos);	// Nombre del fichero (ejemplo.xml)
+
+	directorio = fich.substr (0,pos);	// Directorio del fichero (/home/usuario/.../)
+
+	printf("Directorio: %s\n",directorio.c_str());
+
+	for (i=0; i < (int)fichero.length(); i++)
+  	{
+   		if (fichero.at(i) == '.')
+			pos = i;
+ 	}	
+		
+	esquema = fichero.substr (0,pos);	// Nombre del fichero sin extension
+	printf("Esquema: %s\n",esquema.c_str());	
+
+	if (!doc) {
+	  	printf("Error al cargar documento XML\n");
+	}
+	else{
+		printf("Antes de importar codigo\n");
+		//importarCodigoAux(doc);
+		printf("Despues de importar codigo\n");
+		path = directorio+ "src";
+
+		mkdir(path.c_str(), 0777);
+		printf("Creado path\n");
+		//char* aCopiar = "";
+		//strcpy (aCopiar,"cp -R ./datos_esquemas/my_component/* ");
+  		//strcat (aCopiar,path.c_str());
+		//printf ("Orden cp: %s",aCopiar);
+
+		rutaAcopiar = "cp -R ./datos_esquemas/my_component/* "+directorio+"src";
+
+		system(rutaAcopiar.c_str());
+
+		//copiar_ficheros ("./datos_esquemas/my_component/", directorio+"src/");//-------------------------------------cambiada ubicacion
+		
+		path = directorio+ "src/control_class.h"; //----------------------------------------------------------------cambiado el nombre del .h
+		navegaH (path, doc);
+		
+		path = directorio+ "/src/control_class.cpp";//----------------------------------------------------------cambiado nombre del .cpp
+		navegaCPP (path, doc);
+
+		path = directorio+ "/src/mycomponent.cfg";
+		configuracionICE (path);
+		
+		printf("Ficheros Generados \n");
+
+	}	
+	
+	return 0;
+}

Added: trunk/src/components/visualHFSM-3.1/generate_old.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/generate_old.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/generate_old.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,780 @@
+
+//#include <string.h>
+
+#include <stdio.h>
+
+#include <stdlib.h>
+#include <math.h>
+#include <sys/types.h>
+#include <dirent.h>
+#include <ctype.h>
+#include <sys/stat.h>
+//#include <boost/filesystem.hpp>
+
+
+
+#include <sstream>
+#include <iostream>
+#include <string>
+#include <cstring>
+#include <fstream>
+#include <list>
+
+/*#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <libgnomecanvas/libgnomecanvas.h>
+#include <libglade-2.0/glade/glade.h>
+#include <libxml/tree.h>*/
+
+#include <gdk.h>
+#include <gtk.h>
+#include <gdk-pixbuf.h>
+#include <libgnomecanvas.h>
+#include <glade/glade.h>
+#include <tree.h>
+
+
+//extern "C" {		// Incluir ficheros de C
+   #include "reemplazar.h"
+// }
+
+
+//#define filename ""
+
+using namespace std;
+
+
+typedef struct nombre_id {
+	string id;
+	string nombre;
+} nombre_id; 
+
+list <nombre_id> ListaNombres;
+
+int def = 0; 	// contador de estados sin identificar (nombre).
+
+string varAux, funAux;
+
+ofstream fs; 
+
+string directorio, esquema, tiempo_esquema, estado_inicial;
+
+string int2string(int n){
+	std:: stringstream flujo;
+
+	flujo << n;
+
+	return (flujo.str());
+}
+
+string
+DameNombre(string id){
+
+	list<nombre_id>::iterator pos;
+
+	pos = ListaNombres.begin();
+
+	while ( (pos != ListaNombres.end()) & (pos->id != id) )
+	{
+		pos++;
+	}
+	return pos->nombre;
+}
+
+void
+variablesH(xmlDocPtr doc){
+
+	xmlNodePtr root;
+	xmlNodePtr node;
+	xmlNodePtr nodeL;
+	char *libreria;
+
+	root = xmlDocGetRootElement (doc);
+
+	node = root->xmlChildrenNode;
+
+	while (strcmp((const char*)node->name, "Librerias")!=0) 
+
+	 	node = node->next;
+
+	nodeL = node->xmlChildrenNode;
+
+	while (nodeL!=NULL) {
+
+		libreria = (char*)xmlNodeGetContent (nodeL);
+		
+		if (strcmp((const char*)libreria, "laser")==0){
+			
+			fs << "extern float laser[NUM_LASER];" << endl;
+			
+		} 
+		else if (strcmp((const char*)libreria, "motor")==0){
+			
+			fs << "extern float v;" << endl;
+			fs << "extern float w;" << endl;
+
+		}
+		else if (strcmp((const char*)libreria, "radar")==0){
+
+		}	
+		else if (strcmp((const char*)libreria, "ptencoders")==0){
+
+		}		
+		else if (strcmp((const char*)libreria, "encoders")==0){
+
+			fs << "float robot[5];" << endl;
+
+		}
+		else if (strcmp((const char*)libreria, "lat_lon")==0){
+
+		}		
+		else if (strcmp((const char*)libreria, "camara")==0){	
+
+			fs << "extern char imagenRGB[SIFNTSC_COLUMNS*SIFNTSC_ROWS*3];" << endl;
+
+		}
+	
+
+		nodeL = nodeL ->next;
+	}
+	
+	fs << endl;
+}
+
+void
+importarCodigoAux(xmlDocPtr doc){
+
+	xmlNodePtr root;
+	xmlNodePtr node, nodeE;
+	string id, nombre;
+
+	root = xmlDocGetRootElement (doc);
+
+	node = root->xmlChildrenNode;
+	
+	while (strcmp((const char*)node->name, "Estado")==0) {
+		if ( strcmp((const char*)xmlGetProp (node, (const xmlChar*)"estado_inicial"), (const char*)"true") == 0 ){
+			nodeE = node->xmlChildrenNode;
+	     			
+			id = (const char*)xmlNodeGetContent (nodeE);
+		
+			while (strcmp((const char *)nodeE->name, (const char *)("nombre")) != 0) 		  				
+				nodeE = nodeE->next;
+			
+			nombre = (const char*)xmlNodeGetContent (nodeE);
+
+			if (nombre != "")
+			{
+				estado_inicial = nombre;
+			}
+			else{
+				estado_inicial = DameNombre(id);
+			}
+			break;
+		}
+	 	node = node->next;
+	}
+
+	while (strcmp((const char*)node->name, "tiempoIteracion")!=0) 
+
+	 	node = node->next;
+	 	
+	tiempo_esquema = (char*)xmlNodeGetContent (node);
+	
+
+
+	while (strcmp((const char*)node->name, "variables_aux")!=0) 
+
+	 	node = node->next;
+	
+	varAux = (char*)xmlNodeGetContent (node);
+	
+	while (strcmp((const char*)node->name, "funciones_aux")!=0) 
+
+	 	node = node->next;
+	 	
+	funAux = (char*)xmlNodeGetContent (node);
+}
+
+
+int
+generar_lista_nombres(xmlDocPtr doc, fstream *fs)
+{
+	xmlNodePtr root;
+	xmlNodePtr node;
+	xmlNodePtr nodeE;
+
+	string id;
+	string nombre; 
+
+	root = xmlDocGetRootElement (doc);
+
+	node = root->xmlChildrenNode;
+
+	while (strcmp((const char*)node->name, "Estado")==0) {
+
+	   	nombre_id t;
+
+		printf("Encontrado nodo %s\n", node->name);
+		
+		nodeE = node->xmlChildrenNode;
+
+		id= (const char*)xmlNodeGetContent (nodeE);
+		
+		t.id = id;
+
+		nodeE = nodeE->next;
+		
+		/*Cogemos el nombre del estado origen*/
+		while (strcmp((const char *)nodeE->name, (const char *)("nombre")) != 0) 		  				
+			nodeE = nodeE->next;
+
+		nombre = (const char*)xmlNodeGetContent (nodeE);
+
+		if (nombre != "")
+		{
+			t.nombre = nombre;
+		}
+		else{
+			t.nombre = "default_" + int2string(def);
+			def++;
+		}
+
+		*fs << "				"<< t.nombre;
+
+		node = node->next;
+
+		if (strcmp((const char*)node->name, "Estado")==0) 
+			*fs << "," << endl;
+		else
+			*fs << "," << endl << "				fin"<< endl;
+
+		ListaNombres.push_back(t);		
+    				
+	}
+	return 0;
+}
+
+
+char InvierteMayusculas(char c)
+{
+	return c^0x20;
+}
+
+string s_toupper(string cadena)
+{
+   unsigned int i;
+   
+   for(i = 0; i<cadena.length(); i++) 
+      cadena.at(i) = toupper(cadena.at(i)); //<--convierte a minusculas la cadena
+
+   return cadena;
+}
+
+string s_reemplazar(string cadena, string subcadena, string reemplazo)
+{
+
+   int indice;
+
+   for(;;)
+   {
+     indice = posicion((char *)cadena.c_str(), (char *)subcadena.c_str());
+     if(indice==-1)
+   	break;
+     else
+	cadena.replace(indice,subcadena.length(),reemplazo); 
+   }
+
+   return cadena;
+}
+
+string get_file_name (string file)
+{
+	size_t found;
+
+	found=file.rfind("/");
+	
+	return file.substr (++found);
+
+}
+
+int copiar_ficheros (string dir_origen, string dir_destino)
+{
+	string files_dir,buff, sCadena, sfile;
+	//char *file, *introrob = (char *)"introrob";
+	char cadena[500];
+	fstream fo,fs;
+	DIR *dir;
+	struct dirent * fichero;
+	/*
+	 * fichero->d_name 				Nombre del fichero
+	 * fichero->d_type 				determina el tipo de fichero
+	 */
+
+	//abrimos una instancia al directorio
+	//files_dir = "/home/dyunta/Automatas/src/datos_esquemas/introrob/";
+	dir=opendir(dir_origen.c_str());		//  n = scandir("dir", &namelist, 0, alphasort);
+
+	//si devuelve null, es que ha habido algun error
+	if (dir!=NULL)
+	{
+		//bucle para leer todos los archivos del directorio
+		while ((fichero=readdir(dir)) != NULL )
+		{
+			//si NO es un directorio...
+			if(fichero->d_type!=DT_DIR)
+			{
+				sfile = fichero->d_name;
+				//file = (char*)malloc(15 + 1);
+				//strcpy(file, sfile.c_str());
+				//reemplazar(file, introrob, (char *)esquema.c_str());
+				sfile = s_reemplazar(sfile, "introrob", esquema);
+				sfile = dir_destino + sfile;
+				fs.open(sfile.c_str(), ofstream::out);
+			
+				
+				sfile = dir_origen + fichero->d_name;
+				fo.open(sfile.c_str(), ifstream::in);
+	
+				fo.getline(cadena, 500);
+				sCadena = cadena;
+				//fo >> cadena;
+				while (!fo.eof())
+				{
+		
+					sCadena = s_reemplazar(sCadena, "introrob", esquema);
+					sCadena = s_reemplazar(sCadena, "INTROROB", s_toupper(esquema));
+					sCadena = s_reemplazar(sCadena, "int cycle = 100;//", "int cycle = "+ tiempo_esquema +";");
+
+					fs << sCadena << endl;
+
+					fo.getline(cadena, 500);
+
+					sCadena = cadena;
+				}
+
+				fs.close();
+				fo.close();
+			}	
+			else  
+				if (*fichero->d_name!= '.'){	// Si no es un archivo oculto
+					files_dir = dir_destino + fichero->d_name + "/";
+					mkdir(files_dir.c_str(), 0777);
+					//boost::filesystem::create_directory(files_dir.c_str());
+					copiar_ficheros (dir_origen + fichero->d_name + "/", files_dir);
+					//cout << fichero->d_name << endl;	
+				}			
+		}
+		closedir(dir);
+		
+		return 1;
+	}else{
+		closedir(dir);
+		cout << "no se ha podido abrir el directorio: " << dir_origen << endl;
+		return 0;
+	}
+
+}
+int cfg (string path, xmlDocPtr doc)
+{
+	fstream fs; 
+	
+	fs.open(path.c_str(), ofstream::out);
+	if (fs.is_open()){
+		xmlNodePtr root;
+		xmlNodePtr node;
+		xmlNodePtr nodeL;
+		char *libreria;
+
+		root = xmlDocGetRootElement (doc);
+
+		node = root->xmlChildrenNode;
+
+		while (strcmp((const char*)node->name, "Librerias")!=0) 
+
+	 		node = node->next;
+
+		nodeL = node->xmlChildrenNode;
+
+		while (nodeL!=NULL) {
+
+			libreria = (char*)xmlNodeGetContent (nodeL);
+		
+			if (strcmp((const char*)libreria, "laser")==0){
+			
+				fs << "Introrob.Laser.Proxy=laser1:tcp -h localhost -p 9999" << endl;
+			
+			} 
+			else if (strcmp((const char*)libreria, "motor")==0){
+			
+				fs << "Introrob.Motors.Proxy=motors1:tcp -h localhost -p 9999" << endl;
+
+			}
+			else if (strcmp((const char*)libreria, "radar")==0){
+				fs << "Introrob.Sonars.Proxy=sonar1:tcp -h localhost -p 9999" << endl;
+			}	
+			else if (strcmp((const char*)libreria, "ptencoders")==0){
+				fs << "Introrob.PTEncoders1.Proxy=ptencoders1:tcp -h localhost -p 9999" << endl;
+				fs << "Introrob.PTEncoders2.Proxy=ptencoders2:tcp -h localhost -p 9999" << endl;
+			}		
+			else if (strcmp((const char*)libreria, "encoders")==0){
+
+				fs << "Introrob.Encoders.Proxy=encoders1:tcp -h localhost -p 9999" << endl;
+
+			}
+			else if (strcmp((const char*)libreria, "lat_lon")==0){
+				fs << "Introrob.PTMotors1.Proxy=ptmotors1:tcp -h localhost -p 9999" << endl;
+				fs << "Introrob.PTMotors2.Proxy=ptmotors2:tcp -h localhost -p 9999" << endl;
+			}		
+			else if (strcmp((const char*)libreria, "camara")==0){	
+
+				fs << "Introrob.Camera1.Proxy=cameraA:tcp -h localhost -p 9999" << endl;
+				fs << "Introrob.Camera2.Proxy=cameraB:tcp -h localhost -p 9999" << endl;
+
+
+			}
+	
+		nodeL = nodeL ->next;
+		}
+	
+		fs << endl;
+		fs.close();
+		
+		return 0;
+	}else{
+		return 1;
+	}
+	
+}
+
+int navegaH (string path, xmlDocPtr doc)
+{
+	fstream fs; 
+	
+	fs.open(path.c_str(), ofstream::out);
+	if (fs.is_open()){
+		fs << "#ifndef SIGUE_LINEA_NAVEGA_H"<< endl;
+		fs << "#define SIGUE_LINEA_NAVEGA_H"<< endl;
+		fs << ""<< endl;
+		fs << "#include <string>"<< endl;
+		fs << "#include <iostream>"<< endl;
+		fs << "#include <cv.h>"<< endl;
+		fs << "#include \"ventana.h\""<< endl;
+		fs << "#include \"navegacion.h\""<< endl;
+		fs << "#include \"controller.h\""<< endl;
+		fs << ""<< endl;
+		fs << "namespace " << esquema << "{" << endl; 
+		fs << ""<< endl;
+		fs << "	class Controller;"<< endl;
+		fs << "	class Navegacion;"<< endl;
+		fs << ""<< endl;
+		fs << "	class Navega {"<< endl;
+		fs << "		private:"<< endl;
+		
+		/* Enumeracion de los estados */	
+		fs << "			typedef enum Estado {" << endl;
+		generar_lista_nombres(doc, &fs);
+		fs << "			}Estado;" << endl;
+		
+		fs << "			int cont;"<< endl;
+		fs << "			Estado Estado_Actual;"<< endl;
+		fs << "			Estado Estado_Anterior;"<< endl;
+		fs << "			int Estado_Final;"<< endl;
+		fs << ""<< endl;
+		fs << "			//Var Estados Temporales"<< endl;
+		fs << "			time_t t_ini;"<< endl;
+		fs << "			time_t t_fin;"<< endl;
+		fs << "			double secs;"<< endl;
+		fs << "			bool t_activated;"<< endl;
+		fs << ""<< endl;
+		fs << "			CvPoint2D32f destino;"<< endl;
+		fs << "			Controller* controller;"<< endl;
+		fs << "			Navegacion* navegacion;"<< endl;
+		fs << "			Ventana* ventana;"<< endl;
+		fs << ""<< endl;
+		fs << "		public:"<< endl;
+		fs << "			Navega (Controller* controller, Navegacion* navegacion);"<< endl;
+		fs << "			~Navega ();"<< endl;
+		fs << "			void iteracionGrafica();"<< endl;
+		fs << "			void iteracionControl();"<< endl;
+		fs << "	};"<< endl;
+		fs << "} // namespace"<< endl;
+		fs << ""<< endl;
+		fs << "#endif /*SIGUE_LINEA_NAVEGA_H*/"<< endl;
+		fs.close();
+		
+		return 0;
+	}else{
+		return 1;
+	}
+	
+}
+
+
+int navegaCPP (string path, xmlDocPtr doc)
+{
+	list<nombre_id>::iterator pos;
+	fstream fs; 
+	xmlNodePtr root, node, nodeE, nodeT;
+	string id, codigo, nombre;
+	
+	fs.open(path.c_str(), ofstream::out);
+	if (fs.is_open()){
+	
+		fs << "#include \"navega.h\""<< endl;
+		fs << endl;
+		fs << "namespace " << esquema << "{" << endl; 
+		
+		/* Añadimos Funciones Auxiliares a los estados y transiciones*/
+		fs << "		" << funAux << endl;
+		
+		/* FUNCION iteracion principal */
+		fs << "		void Navega::iteracionControl () {" << endl; 
+
+		/* Añadimos Variables Auxiliares a los estados y transiciones*/
+		fs << "			" << varAux << endl;
+
+		fs << "			if (Estado_Actual!= Estado_Final){" << endl;
+		fs << endl;
+		fs << "				switch (Estado_Actual) {" << endl;
+	
+		root = xmlDocGetRootElement (doc);
+
+		node = root->xmlChildrenNode;
+
+		while (strcmp((const char*)node->name, "Estado") == 0) {
+	    			
+//			printf("Encontrado nodo %s\n", node->name);
+
+		//	xml_get_entry (node);
+			nodeE = node->xmlChildrenNode;
+	     			
+			id = (const char*)xmlNodeGetContent (nodeE);
+		
+			while (strcmp((const char *)nodeE->name, (const char *)("nombre")) != 0) 		  				
+				nodeE = nodeE->next;
+			
+			nombre = (const char*)xmlNodeGetContent (nodeE);
+
+			if (nombre != "")
+			{
+				fs << "				case " << nombre << ":" << endl;
+			}
+			else{
+				fs << "				case " << DameNombre(id) << ":" << endl;
+			}
+			//fs << "					this->ventana->change_nodo_color (Estado_Actual, 0);"<< endl;
+			nodeE = nodeE->next;
+			
+			codigo = (const char*)xmlNodeGetContent (nodeE);
+		
+			fs << "					" << codigo << endl;
+
+			nodeE = nodeE->next;
+
+			nodeT = nodeE->xmlChildrenNode;
+
+			if (nodeT!=NULL){
+
+				//nodeT = nodeE->xmlChildrenNode;
+
+				while (nodeT!=NULL){
+					id = (const char*)xmlNodeGetContent (nodeT->xmlChildrenNode->next->next);
+					if (nodeT->xmlChildrenNode->next->next->next != NULL){
+						if(strcmp((const char*)nodeT->xmlChildrenNode->next->next->next->name,"codigo") == 0)
+						{
+							codigo = (const char*)xmlNodeGetContent (nodeT->xmlChildrenNode->next->next->next);
+							fs << "					if (" << codigo << " ){" << endl;
+						//	fs << "						this->ventana->change_nodo_color (Estado_Actual, 3);" << endl;
+						//	fs << "						Estado_Anterior = Estado_Actual;" << endl;
+							fs << "						Estado_Actual = "<<  DameNombre(id) << ";" << endl;
+							fs << "					}" << endl;
+						}else if (strcmp((const char*)nodeT->xmlChildrenNode->next->next->next->name,"tiempo") == 0){
+							int tiempoTrans = atoi((const char*)xmlNodeGetContent (nodeT->xmlChildrenNode->next->next->next));
+			
+							fs << "					if (!t_activated){" << endl;
+							fs << "						t_ini = time(NULL);" << endl;
+	  		
+							fs << "						t_activated = true;" << endl;
+							fs << "					}else{" << endl;
+							fs << "						t_fin = time(NULL);" << endl;
+							fs << "						secs = difftime(t_fin, t_ini);" << endl;
+							fs << "						if (secs > (double) "<< ((double)tiempoTrans/1000) <<"){" << endl;
+						//	fs << "							this->ventana->change_nodo_color (Estado_Actual, 3);" << endl;
+						//	fs << "							Estado_Anterior = Estado_Actual;" << endl;
+							fs << "							Estado_Actual = "<<  DameNombre(id) << ";" << endl;
+							fs << "							t_activated = false;" << endl;
+							
+							fs << "						}" << endl;
+							fs << "					}" << endl;
+							
+						}
+					}
+					nodeT = nodeT->next;
+				}	
+							
+
+			}//else{
+			//	fs << "					Estado_Actual = -1;" << endl;
+			//}
+	
+			fs << "					break;" << endl;
+			node = node->next;
+
+	  	}
+
+	
+		fs << "				}" << endl;
+		fs << "			}" << endl;
+		fs << "		}" << endl;
+
+		fs << "		void Navega::iteracionGrafica () {" << endl;
+		fs << "			/* TODO: ADD YOUR GRAPHIC CODE HERE */" << endl;
+		fs << "			CvPoint3D32f aa,bb;" << endl;
+		fs << "			CvPoint2D32f destino;" << endl;
+		fs << "			CvPoint3D32f a,b;" << endl;
+		fs << "			CvPoint3D32f c,d;" << endl;
+		fs << "			CvPoint3D32f color;" << endl;
+
+		fs << "			this->navegacion->drawProjectionLines();" << endl;
+		fs << "	" << endl;
+
+		/* Código Ejecución Grafica. */
+
+		fs << "			if (Estado_Actual != Estado_Anterior){" << endl;
+		fs << "				this->ventana->change_nodo_color (Estado_Anterior, 3);" << endl;
+		fs << "			}" << endl;
+		fs << "	" << endl;
+		fs << "			this->ventana->change_nodo_color (Estado_Actual, 0);" << endl;
+		fs << "			Estado_Anterior = Estado_Actual;" << endl;
+
+		fs << "		}" << endl;
+		fs << "		Navega::Navega (Controller* controller, Navegacion* navegacion) {" << endl;
+		fs << "			this->controller = controller;" << endl;
+		fs << "			this->navegacion = navegacion;" << endl;
+		
+		fs << "			Estado_Actual = "<< estado_inicial <<";" << endl;
+		fs << "			Estado_Anterior = "<< estado_inicial <<";" << endl;
+		fs << "			Estado_Final = fin; "<< endl;
+		fs << "			this->ventana = new Ventana(\"" << directorio+esquema+".xml" << "\");"<< endl;
+		
+		fs << "		}" << endl;
+		fs << "" << endl;
+		fs << "		Navega::~Navega () {}" << endl;
+		fs << "}" << endl;
+		
+		fs.close();
+		
+		return 0;
+	}else{
+		return 1;
+	}
+	
+}
+
+
+int main( int argc, char *argv[])
+{
+	xmlDocPtr doc; 
+//	xmlNodePtr root;
+//	xmlNodePtr node;
+//	xmlNodePtr nodeE;
+//	xmlNodePtr nodeT, nodeTT;
+
+
+	
+	
+	string path;
+	
+//argv[0] = (char *)"/home/dyunta/Automatas/src/Ejemplos/sigue_linea/sigue_linea.xml";
+//argv[1] = (char *)"/home/dyunta/Automatas/src/Ejemplos/sigue_linea/sigue_linea.c";
+	char *filename = argv[1];
+
+	//strcpy(filename, "EstoEsUnaPrueba3.xml");
+	
+	printf("ARG: %s %s\n", argv[0], argv[1]);
+
+	doc = xmlParseFile (argv[1]);
+	
+
+
+	/* Nombre y Directorio Esquema */
+
+
+ 	printf("Fichero abierto: %s\n",filename);
+
+	printf("Fichero abierto: %s\n",filename);
+
+	string fich = filename;
+	int i;
+	size_t pos;
+	for (i=0; i < (int)fich.length(); i++)
+  	{
+   		if (fich.at(i) == '/')
+			pos = i;
+ 	}	
+	string fichero = fich.substr (++pos);	// Nombre del fichero (ejemplo.xml)
+
+	directorio = fich.substr (0,pos);	// Directorio del fichero (/home/usuario/.../)
+
+	
+
+	for (i=0; i < (int)fichero.length(); i++)
+  	{
+   		if (fichero.at(i) == '.')
+			pos = i;
+ 	}	
+		
+	esquema = fichero.substr (0,pos);	// Nombre del fichero sin extension
+		
+	
+	
+	
+	//fs << codigo << endl;
+	//fs << "using namespace std;" << endl << endl;
+	
+	
+	//switch (event->type) {
+
+	//case GDK_BUTTON_RELEASE:
+	
+//	char cadena[500];
+
+//	string sCadena;
+
+//	char *subcadena = (char *)"introrob"; 
+//	//const char* intr = "introrob";
+//	//strcpy(subcadena, intr);
+//	cout << subcadena << endl;
+//	cout << esquema << endl;
+//	
+//	
+	if (!doc) {
+	  	printf("Error al cargar documento XML\n");
+	}
+	else{
+		importarCodigoAux(doc);
+		path = directorio+ "src";
+//		char *c = (char *) directorio.c_str();
+//		strcat (c, "src");
+//		mkdir((const char *)c, 0777);
+		mkdir(path.c_str(), 0777);
+		copiar_ficheros ("./datos_esquemas/introrob/", directorio+"src/");
+		
+		path = directorio+ "src/navega.h";
+		navegaH (path, doc);
+		
+		path = directorio+ "src/navega.cpp";
+		navegaCPP (path, doc);
+		
+		//path = directorio + "src/" + esquema + ".cfg";
+		//cfg (path, doc);
+		
+		printf("Ficheros Generados \n");
+
+	}	
+	//g_free (filename);
+	
+	return 0;
+}


Property changes on: trunk/src/components/visualHFSM-3.1/generate_old.cpp
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/gui/EdicionNodo.glade
===================================================================
--- trunk/src/components/visualHFSM-3.1/gui/EdicionNodo.glade	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/gui/EdicionNodo.glade	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
+<glade-interface>
+  <widget class="GtkDialog" id="dialog1">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Inserción Código</property>
+    <property name="window_position">GTK_WIN_POS_CENTER</property>
+    <property name="default_width">640</property>
+    <property name="default_height">480</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkFrame" id="frame1">
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">GTK_SHADOW_IN</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="bottom_padding">5</property>
+                <property name="left_padding">12</property>
+                <property name="right_padding">12</property>
+                <child>
+                  <widget class="GtkEventBox" id="eventbox1">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkScrolledWindow" id="scrolledwindow">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                        <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                        <child>
+                          <placeholder/>
+                        </child>
+                      </widget>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">&lt;b&gt;  Código:&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="type">label_item</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <widget class="GtkButton" id="cancelar">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="label">gtk-cancel</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkButton" id="aceptar">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="label">gtk-ok</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>


Property changes on: trunk/src/components/visualHFSM-3.1/gui/EdicionNodo.glade
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/gui/EdicionTransicion.glade
===================================================================
--- trunk/src/components/visualHFSM-3.1/gui/EdicionTransicion.glade	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/gui/EdicionTransicion.glade	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,185 @@
+<?xml version="1.0"?>
+<glade-interface>
+  <!-- interface-requires gtk+ 2.6 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <widget class="GtkWindow" id="window1">
+    <property name="window_position">center</property>
+    <property name="gravity">center</property>
+    <child>
+      <widget class="GtkVBox" id="vbox2">
+        <property name="visible">True</property>
+        <property name="border_width">5</property>
+        <child>
+          <widget class="GtkHBox" id="hbox1">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkRadioButton" id="rbTexto">
+                <property name="label" translatable="yes">Condicional</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="relief">half</property>
+                <property name="active">True</property>
+                <property name="draw_indicator">True</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkRadioButton" id="rbTiempo">
+                <property name="label" translatable="yes">Temporal</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="relief">half</property>
+                <property name="draw_indicator">True</property>
+                <property name="group">rbTexto</property>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkHSeparator" id="hseparator">
+            <property name="visible">True</property>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkVBox" id="vbox1">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkHBox" id="hbox4">
+                <property name="visible">True</property>
+                <child>
+                  <widget class="GtkFrame" id="frameN">
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment1">
+                        <property name="visible">True</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <widget class="GtkEntry" id="entry1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                          </widget>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label">
+                        <property name="width_request">0</property>
+                        <property name="height_request">0</property>
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Tiempo de Iteracion (ms): &lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="type">label_item</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkFrame" id="frameT">
+                    <property name="visible">True</property>
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment2">
+                        <property name="visible">True</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <widget class="GtkEntry" id="entryCond">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                          </widget>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label4">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Condici&#xF3;n: &lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="type">label_item</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkHButtonBox" id="hbuttonbox2">
+                <property name="visible">True</property>
+                <property name="spacing">10</property>
+                <property name="homogeneous">True</property>
+                <property name="layout_style">end</property>
+                <child>
+                  <widget class="GtkButton" id="cancelar">
+                    <property name="label">gtk-cancel</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="can_default">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="use_stock">True</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkButton" id="aceptar">
+                    <property name="label">gtk-ok</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="use_stock">True</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>


Property changes on: trunk/src/components/visualHFSM-3.1/gui/EdicionTransicion.glade
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/gui/EdicionTransicion2.glade
===================================================================
--- trunk/src/components/visualHFSM-3.1/gui/EdicionTransicion2.glade	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/gui/EdicionTransicion2.glade	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,228 @@
+<?xml version="1.0"?>
+<glade-interface>
+  <!-- interface-requires gtk+ 2.6 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <widget class="GtkWindow" id="window1">
+    <property name="window_position">center</property>
+    <child>
+      <widget class="GtkVBox" id="vbox2">
+        <property name="visible">True</property>
+        <property name="border_width">5</property>
+        <child>
+          <widget class="GtkHBox" id="hbox1">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkRadioButton" id="rbTexto">
+                <property name="label" translatable="yes">Texto</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="relief">half</property>
+                <property name="active">True</property>
+                <property name="draw_indicator">True</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkRadioButton" id="rbTiempo">
+                <property name="label" translatable="yes">Tiempo</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">False</property>
+                <property name="relief">half</property>
+                <property name="draw_indicator">True</property>
+                <property name="group">rbTexto</property>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkHSeparator" id="hseparator">
+            <property name="visible">True</property>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkVBox" id="vbox1">
+            <property name="visible">True</property>
+            <child>
+              <widget class="GtkHBox" id="hbox4">
+                <property name="visible">True</property>
+                <child>
+                  <widget class="GtkFrame" id="frameN">
+                    <property name="label_xalign">0</property>
+                    <property name="shadow_type">none</property>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment1">
+                        <property name="visible">True</property>
+                        <property name="left_padding">12</property>
+                        <child>
+                          <widget class="GtkEntry" id="entry1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                          </widget>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label">
+                        <property name="width_request">0</property>
+                        <property name="height_request">0</property>
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Tiempo de Iteracion: &lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="type">label_item</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkVBox" id="vbox3">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkFrame" id="frameT">
+                        <property name="visible">True</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">out</property>
+                        <child>
+                          <widget class="GtkScrolledWindow" id="scrolledwindow">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="hscrollbar_policy">automatic</property>
+                            <property name="vscrollbar_policy">automatic</property>
+                            <child>
+                              <placeholder/>
+                            </child>
+                          </widget>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label4">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">&lt;b&gt;Percepci&#xF3;n: &lt;/b&gt;</property>
+                            <property name="use_markup">True</property>
+                          </widget>
+                          <packing>
+                            <property name="type">label_item</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkFrame" id="frameC">
+                        <property name="visible">True</property>
+                        <property name="label_xalign">0</property>
+                        <property name="shadow_type">out</property>
+                        <child>
+                          <widget class="GtkScrolledWindow" id="scrolledwindow1">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="hscrollbar_policy">automatic</property>
+                            <property name="vscrollbar_policy">automatic</property>
+                            <child>
+                              <widget class="GtkEntry" id="entry2">
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="invisible_char">&#x25CF;</property>
+                              </widget>
+                            </child>
+                          </widget>
+                        </child>
+                        <child>
+                          <widget class="GtkLabel" id="label1">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">&lt;b&gt;Condici&#xF3;n: &lt;/b&gt;</property>
+                            <property name="use_markup">True</property>
+                          </widget>
+                          <packing>
+                            <property name="type">label_item</property>
+                          </packing>
+                        </child>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkHButtonBox" id="hbuttonbox2">
+                <property name="visible">True</property>
+                <property name="spacing">10</property>
+                <property name="homogeneous">True</property>
+                <property name="layout_style">end</property>
+                <child>
+                  <widget class="GtkButton" id="cancelar">
+                    <property name="label">gtk-cancel</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="can_default">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="use_stock">True</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkButton" id="aceptar">
+                    <property name="label">gtk-ok</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">True</property>
+                    <property name="use_stock">True</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>


Property changes on: trunk/src/components/visualHFSM-3.1/gui/EdicionTransicion2.glade
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/gui/Importar.glade
===================================================================
--- trunk/src/components/visualHFSM-3.1/gui/Importar.glade	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/gui/Importar.glade	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,364 @@
+<?xml version="1.0"?>
+<glade-interface>
+  <!-- interface-requires gtk+ 2.6 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <widget class="GtkWindow" id="window1">
+    <property name="visible">True</property>
+    <property name="border_width">5</property>
+    <property name="resizable">False</property>
+    <property name="window_position">center</property>
+    <property name="type_hint">dialog</property>
+    <child>
+      <widget class="GtkVBox" id="vbox1">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkFrame" id="Sensores">
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">out</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment6">
+                <property name="visible">True</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <widget class="GtkVBox" id="vbox5">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbLaser">
+                        <property name="label" translatable="yes">Laser</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbRadar">
+                        <property name="label" translatable="yes">Sonar</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbCamara">
+                        <property name="label" translatable="yes">Camara (varColorA, VarColorB)</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbEncoders">
+                        <property name="label" translatable="yes">Encoders</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbPtencoders">
+                        <property name="label" translatable="yes">Ptencoders</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">4</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label6">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">&lt;b&gt;Sensores&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="type">label_item</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkFrame" id="Actuadores">
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">out</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment3">
+                <property name="visible">True</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <widget class="GtkVBox" id="vbox3">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbMotor">
+                        <property name="label" translatable="yes">Motor</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbLat_lon">
+                        <property name="label" translatable="yes">Ptmotor (Latitud, longitud)</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label3">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">&lt;b&gt;Actuadores&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="type">label_item</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkHButtonBox" id="hbuttonbox1">
+            <property name="visible">True</property>
+            <property name="spacing">10</property>
+            <property name="layout_style">end</property>
+            <child>
+              <widget class="GtkButton" id="cancelar">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkButton" id="aceptar">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+                <accelerator key="KP_Enter" signal="clicked"/>
+                <accelerator key="Return" signal="clicked"/>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+  <widget class="GtkWindow" id="window2">
+    <child>
+      <widget class="GtkFrame" id="frame2">
+        <property name="visible">True</property>
+        <property name="label_xalign">0</property>
+        <property name="shadow_type">none</property>
+        <child>
+          <widget class="GtkAlignment" id="alignment2">
+            <property name="visible">True</property>
+            <property name="left_padding">12</property>
+            <child>
+              <widget class="GtkVBox" id="vbox2">
+                <property name="visible">True</property>
+                <child>
+                  <widget class="GtkVBox" id="vbox4">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbLaser1">
+                        <property name="label" translatable="yes">Laser</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbMotor1">
+                        <property name="label" translatable="yes">Motor</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbRadar1">
+                        <property name="label" translatable="yes">Radar</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbEncoders1">
+                        <property name="label" translatable="yes">Encoders</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">3</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbLat_lon1">
+                        <property name="label" translatable="yes">Latitud, longitud</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">4</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbCamara1">
+                        <property name="label" translatable="yes">Camara (varColorA, VarColorB)</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">5</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="cbPtencoders1">
+                        <property name="label" translatable="yes">Ptencoders</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="position">6</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkHButtonBox" id="hbuttonbox2">
+                    <property name="visible">True</property>
+                    <property name="spacing">10</property>
+                    <property name="layout_style">end</property>
+                    <child>
+                      <widget class="GtkButton" id="aceptar1">
+                        <property name="label">gtk-ok</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkButton" id="cancelar1">
+                        <property name="label">gtk-cancel</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">True</property>
+                        <property name="use_stock">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+            </child>
+          </widget>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="label2">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">&lt;b&gt;Importar:&lt;/b&gt;</property>
+            <property name="use_markup">True</property>
+          </widget>
+          <packing>
+            <property name="type">label_item</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>


Property changes on: trunk/src/components/visualHFSM-3.1/gui/Importar.glade
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/gui/nombre.glade
===================================================================
--- trunk/src/components/visualHFSM-3.1/gui/nombre.glade	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/gui/nombre.glade	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,91 @@
+<?xml version="1.0"?>
+<glade-interface>
+  <!-- interface-requires gtk+ 2.6 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <widget class="GtkDialog" id="nombre">
+    <property name="border_width">5</property>
+    <property name="window_position">center</property>
+    <property name="type_hint">tooltip</property>
+    <property name="has_separator">False</property>
+    <signal name="delete_event" handler="gtk_widget_destroy"/>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkFrame" id="frame1">
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <widget class="GtkEntry" id="entry1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">&lt;b&gt;Nombre:&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="type">label_item</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <widget class="GtkButton" id="BotonCancelar">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkButton" id="BotonAplicar">
+                <property name="label">gtk-apply</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+                <accelerator key="KP_Enter" signal="clicked"/>
+                <accelerator key="Return" signal="clicked"/>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>


Property changes on: trunk/src/components/visualHFSM-3.1/gui/nombre.glade
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/gui/timer.glade
===================================================================
--- trunk/src/components/visualHFSM-3.1/gui/timer.glade	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/gui/timer.glade	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,94 @@
+<?xml version="1.0"?>
+<glade-interface>
+  <!-- interface-requires gtk+ 2.6 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <widget class="GtkDialog" id="timer">
+    <property name="width_request">350</property>
+    <property name="border_width">5</property>
+    <property name="window_position">center-on-parent</property>
+    <property name="type_hint">dialog</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkFrame" id="frame1">
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <widget class="GtkEntry" id="entry1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="max_length">50</property>
+                    <property name="text" translatable="yes">100 </property>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">&lt;b&gt;Tiempo en milisegundos: &lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+                <property name="use_underline">True</property>
+              </widget>
+              <packing>
+                <property name="type">label_item</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <widget class="GtkButton" id="BotonCancelar">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkButton" id="BotonAplicar">
+                <property name="label">gtk-apply</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+                <accelerator key="Return" signal="clicked"/>
+                <accelerator key="KP_Enter" signal="clicked"/>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>


Property changes on: trunk/src/components/visualHFSM-3.1/gui/timer.glade
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/gui/variables.glade
===================================================================
--- trunk/src/components/visualHFSM-3.1/gui/variables.glade	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/gui/variables.glade	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
+<!--*- mode: xml -*-->
+<glade-interface>
+  <widget class="GtkDialog" id="dialog1">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Inserción Código</property>
+    <property name="default_width">640</property>
+    <property name="default_height">480</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox1">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <widget class="GtkNotebook" id="notebook1">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="homogeneous">True</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="bottom_padding">5</property>
+                <property name="left_padding">5</property>
+                <property name="right_padding">5</property>
+                <child>
+                  <widget class="GtkFrame" id="frameV">
+                    <property name="visible">True</property>
+                    <property name="label_xalign">0.05000000074505806</property>
+                    <property name="shadow_type">GTK_SHADOW_IN</property>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment2">
+                        <property name="visible">True</property>
+                        <property name="bottom_padding">5</property>
+                        <property name="left_padding">12</property>
+                        <property name="right_padding">12</property>
+                        <child>
+                          <widget class="GtkScrolledWindow" id="scrolledwindowV">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                            <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                            <child>
+                              <placeholder/>
+                            </child>
+                          </widget>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label5">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Variables:&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="type">label_item</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label3">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Variables</property>
+              </widget>
+              <packing>
+                <property name="type">tab</property>
+                <property name="tab_expand">True</property>
+                <property name="tab_fill">False</property>
+                <property name="reorderable">True</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkAlignment" id="alignment3">
+                <property name="visible">True</property>
+                <property name="bottom_padding">5</property>
+                <property name="left_padding">5</property>
+                <property name="right_padding">5</property>
+                <child>
+                  <widget class="GtkFrame" id="frameF">
+                    <property name="visible">True</property>
+                    <property name="label_xalign">0.05000000074505806</property>
+                    <property name="shadow_type">GTK_SHADOW_IN</property>
+                    <child>
+                      <widget class="GtkAlignment" id="alignment4">
+                        <property name="visible">True</property>
+                        <property name="bottom_padding">5</property>
+                        <property name="left_padding">12</property>
+                        <property name="right_padding">12</property>
+                        <child>
+                          <widget class="GtkScrolledWindow" id="scrolledwindowF">
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                            <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+                            <child>
+                              <placeholder/>
+                            </child>
+                          </widget>
+                        </child>
+                      </widget>
+                    </child>
+                    <child>
+                      <widget class="GtkLabel" id="label6">
+                        <property name="visible">True</property>
+                        <property name="label" translatable="yes">&lt;b&gt;Funciones:&lt;/b&gt;</property>
+                        <property name="use_markup">True</property>
+                      </widget>
+                      <packing>
+                        <property name="type">label_item</property>
+                      </packing>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label4">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Funciones</property>
+              </widget>
+              <packing>
+                <property name="type">tab</property>
+                <property name="position">1</property>
+                <property name="tab_expand">True</property>
+                <property name="tab_fill">False</property>
+                <property name="reorderable">True</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <widget class="GtkButton" id="cancelar">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="label">gtk-cancel</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+                <signal name="clicked" handler="gtk_widget_destroy" object="dialog1"/>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkButton" id="aceptar">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="label">gtk-ok</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+                <signal name="destroy" handler="gtk_widget_destroy" object="dialog1"/>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+  <widget class="GtkWindow" id="window1">
+    <child>
+      <widget class="GtkNotebook" id="notebook">
+        <property name="visible">True</property>
+        <property name="can_focus">True</property>
+        <property name="show_border">False</property>
+        <property name="scrollable">True</property>
+        <property name="tab_hborder">1</property>
+        <property name="tab_vborder">1</property>
+        <property name="enable_popup">True</property>
+        <property name="homogeneous">True</property>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="label1">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Variables</property>
+          </widget>
+          <packing>
+            <property name="type">tab</property>
+            <property name="tab_fill">False</property>
+            <property name="reorderable">True</property>
+          </packing>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+        <child>
+          <widget class="GtkLabel" id="label2">
+            <property name="visible">True</property>
+            <property name="label" translatable="yes">Funciones</property>
+            <property name="wrap">True</property>
+          </widget>
+          <packing>
+            <property name="type">tab</property>
+            <property name="position">1</property>
+            <property name="tab_fill">False</property>
+            <property name="reorderable">True</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>


Property changes on: trunk/src/components/visualHFSM-3.1/gui/variables.glade
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/gui/ventana.glade
===================================================================
--- trunk/src/components/visualHFSM-3.1/gui/ventana.glade	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/gui/ventana.glade	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,110 @@
+<?xml version="1.0"?>
+<glade-interface>
+  <requires lib="canvas"/>
+  <!-- interface-requires canvas 2151.7112 -->
+  <!-- interface-requires gtk+ 2.6 -->
+  <!-- interface-naming-policy toplevel-contextual -->
+  <widget class="GtkWindow" id="window1">
+    <property name="width_request">640</property>
+    <property name="height_request">480</property>
+    <property name="visible">True</property>
+    <property name="title" translatable="yes">Visualizador Estados</property>
+    <property name="window_position">center</property>
+    <child>
+      <widget class="GtkHBox" id="hbox1">
+        <property name="visible">True</property>
+        <property name="border_width">10</property>
+        <property name="spacing">20</property>
+        <child>
+          <widget class="GtkFrame" id="frame1">
+            <property name="visible">True</property>
+            <property name="label_xalign">0</property>
+            <property name="label_yalign">0.69999998807907104</property>
+            <property name="shadow_type">in</property>
+            <child>
+              <widget class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <child>
+                  <widget class="GtkEventBox" id="eventbox1">
+                    <property name="visible">True</property>
+                    <child>
+                      <widget class="GtkScrolledWindow" id="scrolledwindow1">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <child>
+                          <widget class="GnomeCanvas" id="canvas1">
+                            <property name="width_request">1000</property>
+                            <property name="height_request">1000</property>
+                            <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="width">1000000</property>
+                            <property name="height">1000000</property>
+                            <property name="aa">True</property>
+                            <property name="pixels_per_unit">1</property>
+                          </widget>
+                        </child>
+                      </widget>
+                    </child>
+                  </widget>
+                </child>
+              </widget>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="type">label_item</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="GtkVButtonBox" id="vbuttonbox1">
+            <property name="visible">True</property>
+            <property name="spacing">33</property>
+            <property name="homogeneous">True</property>
+            <property name="layout_style">start</property>
+            <child>
+              <widget class="GtkToggleButton" id="togglebutton1">
+                <property name="label" translatable="yes">Show</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="toggled" handler="gtk_widget_show" object="window1"/>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkToggleButton" id="togglebutton2">
+                <property name="label" translatable="yes">Hide</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <signal name="toggled" handler="gtk_widget_hide" object="window1"/>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
+</glade-interface>


Property changes on: trunk/src/components/visualHFSM-3.1/gui/ventana.glade
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/imagenes/compilar.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/src/components/visualHFSM-3.1/imagenes/compilar.jpg
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: trunk/src/components/visualHFSM-3.1/imagenes/images.jpg
===================================================================
(Binary files differ)


Property changes on: trunk/src/components/visualHFSM-3.1/imagenes/images.jpg
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: trunk/src/components/visualHFSM-3.1/imprimir.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/imprimir.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/imprimir.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,484 @@
+
+#include <libgnomecanvas/libgnomecanvas.h>
+
+
+#include <gtk/gtk.h>
+//#include <gdk_imlib_types.h>
+#include <gtk/gtkprintunixdialog.h>
+#include <gtk/gtkpagesetupunixdialog.h>
+#include <string.h>
+#include <png.h>
+#include <gdk/gdk.h>
+//#include <gdk_imlib.h>
+//#include <gdk_imlib_types.h>
+#include <sys/stat.h>
+#ifndef __G_LIB_H__
+#  include <glib.h>
+#endif
+
+#ifndef __GDK_H__
+#  include <gdk/gdk.h>
+#endif
+
+#ifndef __GTK_H__
+#  define GTK_ENABLE_BROKEN 1
+#  include <gtk/gtk.h>
+#endif
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <stdio.h>
+#include "imprimir.h"
+
+
+
+void
+cerrarDialogoImprimir(GtkWidget *widget)
+{
+	gtk_widget_destroy(widget);
+}
+
+
+void
+imprimirResponse (GtkWidget *widget, gint response, gpointer data)
+{
+	GtkPrintSettings *configImprimir;
+	GtkPageSetup *configPage;
+	GtkPrintJob *job;
+	GtkPrinter *printer;
+	gboolean resultado;
+	gchar *file = (gchar*)data;
+
+
+	switch(response){
+		case GTK_RESPONSE_OK:
+			configImprimir = gtk_print_unix_dialog_get_settings((GtkPrintUnixDialog*)widget); 
+			configPage = gtk_print_unix_dialog_get_page_setup((GtkPrintUnixDialog*)widget);
+			printer = gtk_print_unix_dialog_get_selected_printer((GtkPrintUnixDialog*)widget);
+			job = gtk_print_job_new("Imprimir autómata", printer, configImprimir, configPage);
+			resultado =  gtk_print_job_set_source_file (job, file, NULL);
+			gtk_print_job_send(job, NULL, NULL, NULL);
+			cerrarDialogoImprimir(widget);
+			break;
+
+		case GTK_RESPONSE_APPLY:
+			break;
+
+		case GTK_RESPONSE_CANCEL:
+			cerrarDialogoImprimir(widget);
+			break;
+	}
+}
+
+void
+dialogoImpresion(gchar *file)
+{
+	GtkPrintUnixDialog *windowPrint;
+
+
+	windowPrint =  (GtkPrintUnixDialog *)gtk_print_unix_dialog_new("Imprimir Autómata",NULL);
+	gtk_print_unix_dialog_set_manual_capabilities (windowPrint,  GtkPrintCapabilities (GTK_PRINT_CAPABILITY_PAGE_SET | GTK_PRINT_CAPABILITY_COPIES | GTK_PRINT_CAPABILITY_COLLATE | GTK_PRINT_CAPABILITY_REVERSE |  GTK_PRINT_CAPABILITY_SCALE | GTK_PRINT_CAPABILITY_GENERATE_PDF | GTK_PRINT_CAPABILITY_NUMBER_UP));
+
+	g_signal_connect(windowPrint, "response", G_CALLBACK(imprimirResponse), file);	
+	gtk_widget_show((GtkWidget*)windowPrint);
+}
+
+
+/* **** *** ** * VALORES MÍNIMOS Y MÁXIMOS UTILIZADOS * ** *** **** */
+void
+calcularRangoUtilizadoPixmap(GtkWidget *canvas, int *xMin, int *xMax, int *yMin, int *yMax)
+{
+	GdkColormap *cmap;
+	GdkPixbuf *pixbuf;
+	GdkColor *colorPixel, *colorWhite;
+	int i;
+	int minX, maxX;
+	int minY, maxY;
+	int width, height, rowstride, n_channels;
+	guchar *pixels, *p;
+	int maximo, x, y;
+	int indiceSize = 1500;
+
+
+	//Establecemos los parametros del Máx y Mín
+	minX = indiceSize;
+	maxX = 0;
+	minY = indiceSize;
+	maxY = 0;
+
+	//Establecemos el color Rgb del blanco
+	colorWhite = (GdkColor*)g_malloc(sizeof(GdkColor));
+	colorWhite->red = 240;
+	colorWhite->green = 235;
+	colorWhite->blue = 226;
+	colorPixel = (GdkColor*)g_malloc(sizeof(GdkColor));
+
+	//Recogemos el pixbuf
+	cmap =  gdk_drawable_get_colormap(((GnomeCanvas *)canvas)->layout.bin_window);
+	cmap =  gdk_gc_get_colormap (((GnomeCanvas *)canvas)->pixmap_gc);
+
+	pixbuf = gdk_pixbuf_get_from_drawable (NULL, ((GnomeCanvas *)canvas)->layout.bin_window, cmap, 0, 0, 0, 0, indiceSize, indiceSize);
+	g_assert(GDK_IS_PIXBUF(pixbuf));
+	
+	//Recogemos los valores para sacer el pixel y los verificamos
+	n_channels = gdk_pixbuf_get_n_channels (pixbuf);
+	g_assert (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB);
+	g_assert (gdk_pixbuf_get_bits_per_sample (pixbuf) == 8);
+
+	//Sacamos las medidas del pixbuf
+	width = gdk_pixbuf_get_width (pixbuf);
+	height = gdk_pixbuf_get_height (pixbuf);
+	rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+
+	//Sacamos la dirección de los pixeles
+	pixels = gdk_pixbuf_get_pixels (pixbuf);
+	p = pixels;
+			
+	maximo = indiceSize * indiceSize;
+	for (i=0; i<maximo; i++){	
+			
+		// Por motivos de eficiencia --> no utilizmos --> *red = p[0];*green = p[1];*blue = p[2];*alpha = p[3];
+		colorPixel->red = *p;
+		colorPixel->green = *(p +1);
+		colorPixel->blue = *(p +2);
+		p = p + n_channels;
+
+		if (!gdk_color_equal(colorPixel, colorWhite)){
+			y = (i / indiceSize);
+			x = (i % indiceSize);
+			if (minX > x) {
+				minX = x;
+			}
+			if (maxX < x){
+				maxX = x;
+			}
+			if (minY > y){
+				minY = y;
+			}
+			if (maxY < y){
+				maxY = y;
+			}	 
+		}
+	}
+
+	if (minX == indiceSize) {
+		minX = 0;
+	}
+	if (maxX == 0) {
+		maxX = indiceSize;
+	}
+	if (minY == indiceSize) {
+		minY = 0;
+	}
+	if (maxY == 0){
+		maxY = indiceSize;
+	}
+
+	*xMin = minX;
+	*xMax = maxX;
+	*yMin = minY;
+	*yMax = maxY;
+}
+GtkWidget *
+can()
+{
+        GtkWidget *window;
+        GtkWidget *canvas;
+        GnomeCanvasGroup *root;
+
+        /* inicializamos las librer&iacute;as */
+    //    gnome_init("basic-canvas", "0.1", argc, argv);
+
+        /* crear una ventana que contenga al canvas */
+        window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+      //  g_signal_connect(G_OBJECT(window), "destroy", gtk_main_quit, 0);
+
+        /* canvas en modo RGB */
+        canvas = gnome_canvas_new_aa();
+        gtk_container_add(GTK_CONTAINER(window), canvas);
+gnome_canvas_set_scroll_region(GNOME_CANVAS(canvas), 0, 0, 1500, 1500);
+
+        root = gnome_canvas_root(GNOME_CANVAS(canvas));
+
+        /* poner un c&iacute;rculo, con fondo verde y borde azul */
+        gnome_canvas_item_new(root,
+                        gnome_canvas_ellipse_get_type(),
+                        "x1", 0.0,
+                        "y1", 0.0,
+                        "x2", 100.0,
+                        "y2", 100.0,
+                        "fill_color_rgba", 0x00ff00ff,
+                        "outline_color_rgba", 0x0000ffff,
+                        "width_units", 3.0,
+                        NULL);
+
+        /* mostrar los widgets creados y entrar en el bucle gtk_main */
+        gtk_widget_show_all(window);
+
+	return canvas;
+     
+}
+
+/* **** *** ** * GUARDAR PIXMAP EN IMAGEN * ** *** **** */
+void
+guardarPixmapImagenPng(GtkWidget *canvas, gchar*ruta)
+{
+	GdkPixbuf *buffer;
+	GdkPixbuf *bufferScale;
+	GdkColormap *cmap;
+
+	GtkWidget *canvas2=can();
+	gnome_canvas_update_now (GNOME_CANVAS(canvas2));
+	int xMin, xMax, yMin, yMax;
+	int anchura, altura;
+
+	calcularRangoUtilizadoPixmap(canvas, &xMin, &xMax, &yMin, &yMax);
+
+	anchura = xMax-xMin;
+	altura = yMax-yMin;
+
+	//redibujarObjetosContenidoOculto();
+
+
+
+	cmap =  gdk_drawable_get_colormap(((GnomeCanvas *)canvas2)->layout.bin_window);
+	cmap =  gdk_gc_get_colormap (((GnomeCanvas *)canvas2)->pixmap_gc);
+	buffer = gdk_pixbuf_get_from_drawable (NULL,  ((GnomeCanvas *)canvas2)->layout.bin_window, cmap, xMin, yMin, 0, 0, anchura, altura); //0, 0, 0, 0,2500, 2500
+	//buffer = (GdkPixbuf *)((GnomeCanvasBuf *)canvas)->buf;
+GdkImage * imagen = gdk_image_get  (((GnomeCanvas *)canvas)->layout.bin_window,
+                                                         0,
+                                                         0,
+                                                         1500,
+                                                         1500);
+// GdkImlibImage      *img = gdk_imlib_create_image_from_drawable(((GnomeCanvas *)canvas)->layout.bin_window, NULL, 0, 0, 1500, 1500);
+//gdk_imlib_save_image_to_ppm (img, "./imagen.ppm");
+
+//buffer = gdk_pixbuf_new(GdkColorspace colorspace,   TRUE, 8,   1500, 1500);
+//gtk_layout_get_bin_window(&((GnomeCanvas *)canvas)->layout)
+//((GnomeCanvas *)canvas)->layout->layout.container.widget.window
+//canvas->window
+	if ((altura >= 1500) || (anchura >= 1500)){
+		if ((altura>= 1500) && (anchura >= 1500)){
+			altura = 1500;
+			anchura = 1500;
+		}else if (altura >= 1500) {
+			anchura = (1500*anchura)/altura;
+			altura = 1500;
+		} else if (anchura >= 1500) {
+			altura = (1500*altura)/anchura;
+			anchura = 1500;
+		}
+		bufferScale = gdk_pixbuf_scale_simple(buffer, anchura, altura, GDK_INTERP_HYPER); //GKD_INTERP_BILINEAR
+		gdk_pixbuf_save (bufferScale, ruta, "png", NULL, "compression", "0", NULL); //quality -> jpeg
+	}
+	else {
+		gdk_pixbuf_save (buffer, ruta, "png", NULL, "compression", "0", NULL); //quality -> jpeg
+	}
+	//redibujarObjetosContenido();
+
+	//dialogoImpresion(ruta);
+}
+
+
+int
+sp_png_write_rgba (const unsigned char *filename, const unsigned char *px, int width, int height, int rowstride)
+{
+	FILE *fp;
+	png_structp png_ptr;
+	png_infop info_ptr;
+	png_color_8 sig_bit;
+	png_text text_ptr[3];
+	png_uint_32 k;
+	png_bytep *row_pointers;
+
+	g_return_val_if_fail (filename != NULL, FALSE);
+
+	/* open the file */
+
+	fp = fopen ((const char*)filename, "wb");
+	g_return_val_if_fail (fp != NULL, FALSE);
+
+	/* Create and initialize the png_struct with the desired error handler
+	 * functions.  If you want to use the default stderr and longjump method,
+	 * you can supply NULL for the last three parameters.  We also check that
+	 * the library version is compatible with the one used at compile time,
+	 * in case we are using dynamically linked libraries.  REQUIRED.
+	 */
+	png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+
+	if (png_ptr == NULL) {
+		fclose(fp);
+		return FALSE;
+	}
+
+	/* Allocate/initialize the image information data.  REQUIRED */
+	info_ptr = png_create_info_struct(png_ptr);
+	if (info_ptr == NULL) {
+		fclose(fp);
+		png_destroy_write_struct(&png_ptr, NULL);
+		return FALSE;
+	}
+
+	/* Set error handling.  REQUIRED if you aren't supplying your own
+	 * error hadnling functions in the png_create_write_struct() call.
+	 */
+	if (setjmp(png_ptr->jmpbuf)) {
+		/* If we get here, we had a problem reading the file */
+		fclose(fp);
+		png_destroy_write_struct(&png_ptr, &info_ptr);
+		return FALSE;
+	}
+
+	/* set up the output control if you are using standard C streams */
+	png_init_io(png_ptr, fp);
+
+	/* Set the image information here.  Width and height are up to 2^31,
+	 * bit_depth is one of 1, 2, 4, 8, or 16, but valid values also depend on
+	 * the color_type selected. color_type is one of PNG_COLOR_TYPE_GRAY,
+	 * PNG_COLOR_TYPE_GRAY_ALPHA, PNG_COLOR_TYPE_PALETTE, PNG_COLOR_TYPE_RGB,
+	 * or PNG_COLOR_TYPE_RGB_ALPHA.  interlace is either PNG_INTERLACE_NONE or
+	 * PNG_INTERLACE_ADAM7, and the compression_type and filter_type MUST
+	 * currently be PNG_COMPRESSION_TYPE_BASE and PNG_FILTER_TYPE_BASE. REQUIRED
+	 */
+	png_set_IHDR(png_ptr, info_ptr,
+		     width,
+		     height,
+		     8, /* bit_depth */
+		     PNG_COLOR_TYPE_RGB_ALPHA,
+		     PNG_INTERLACE_NONE,
+		     PNG_COMPRESSION_TYPE_BASE,
+		     PNG_FILTER_TYPE_BASE);
+
+	/* otherwise, if we are dealing with a color image then */
+	sig_bit.red = 8;
+	sig_bit.green = 8;
+	sig_bit.blue = 8;
+	/* if the image has an alpha channel then */
+	sig_bit.alpha = 8;
+	png_set_sBIT(png_ptr, info_ptr, &sig_bit);
+
+#if 0
+	/* Optional gamma chunk is strongly suggested if you have any guess
+	 * as to the correct gamma of the image.
+	 */
+//	png_set_gAMA(png_ptr, info_ptr, gamma);
+
+#endif
+	/* Optionally write comments into the image */
+	text_ptr[0].key = (char*)"Software";
+	text_ptr[0].text = (char*)"Sodipodi";
+	text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE;
+#if 0
+	text_ptr[1].key = (char*)"Author";
+	text_ptr[1].text = (char*)"Unknown";
+	text_ptr[1].compression = PNG_TEXT_COMPRESSION_NONE;
+	text_ptr[2].key = (char*)"Description";
+	text_ptr[2].text = (char*)"a picture";
+	text_ptr[2].compression = PNG_TEXT_COMPRESSION_zTXt;
+#endif
+	png_set_text(png_ptr, info_ptr, text_ptr, 1);
+
+	/* other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs, */
+	/* note that if sRGB is present the cHRM chunk must be ignored
+	 * on read and must be written in accordance with the sRGB profile */
+
+	/* Write the file header information.  REQUIRED */
+	png_write_info(png_ptr, info_ptr);
+
+	/* Once we write out the header, the compression type on the text
+	 * chunks gets changed to PNG_TEXT_COMPRESSION_NONE_WR or
+	 * PNG_TEXT_COMPRESSION_zTXt_WR, so it doesn't get written out again
+	 * at the end.
+	 */
+
+	/* set up the transformations you want.  Note that these are
+	 * all optional.  Only call them if you want them.
+	 */
+
+	/* --- CUT --- */
+
+	/* The easiest way to write the image (you may have a different memory
+	 * layout, however, so choose what fits your needs best).  You need to
+	 * use the first method if you aren't handling interlacing yourself.
+	 */
+
+	row_pointers = g_new (png_bytep, height);
+
+	for (k = 0; k < height; k += 64) {
+		int ke, kk;
+		ke = MIN (k + 64, height);
+		for (kk = k; kk < ke; kk++) {
+			row_pointers[kk] = (png_bytep) px + kk * rowstride;
+		}
+		png_write_rows (png_ptr, &row_pointers[k], ke - k);
+	}
+
+	g_free (row_pointers);
+
+	/* You can write optional chunks like tEXt, zTXt, and tIME at the end
+	 * as well.
+	 */
+
+	/* It is REQUIRED to call this to finish writing the rest of the file */
+	png_write_end(png_ptr, info_ptr);
+
+	/* if you allocated any text comments, free them here */
+
+	/* clean up after the write, and free any memory allocated */
+	png_destroy_write_struct(&png_ptr, &info_ptr);
+
+	/* close the file */
+	fclose(fp);
+
+	/* that's it */
+	return TRUE;
+}
+
+//void exportar (GnomeCanvas *canvas)
+//{
+//GdkImlibImage *imagen;
+//GdkPixmap *pixmap = gtk_pixmap_new (canvas->layout.bin_window,
+//ANCHO_IMAGEN, 
+//ALTO_IMAGEN, 
+//gtk_widget_get_visual (GTK_WIDGET (canvas))->depth);
+
+//imagen = gdk_imlib_create_image_from_drawable (pixmap, 
+//NULL, 
+//x, y, 
+//width, height);
+
+//gdk_imlib_save_image_to_ppm (imagen, "imagen.ppm");
+//gdk_imlib_kill_image (imagen);
+//}
+
+void exportar2 (GnomeCanvas *canvas)
+{
+  GtkWidget *widget;
+//gnome_canvas_paint_rect
+//GdkPixmap *pixmap = gtk_pixmap_new (canvas->layout.bin_window,
+//				1500, 
+//				1500, 
+//				-1);
+GdkPixmap *pixmap = gdk_pixmap_new (canvas->layout.bin_window, 1500,1500, //IMAGE_WIDTH, IMAGE_HEIGHT,
+-                                    	24);		// gtk_widget_get_visual (GTK_WIDGET(canvas))->depth);
+
+GdkImage *   imagen =       gdk_image_new                       (GDK_IMAGE_FASTEST,
+                                                         gtk_widget_get_visual (GTK_WIDGET (canvas)),
+                                                         1500,
+                                                         1500);
+// GdkPixbuf *buffer = gdk_pixbuf_get_from_image           (NULL,
+//                                                         imagen,
+//                                                         gdk_gc_get_colormap (canvas->pixmap_gc),
+//                                                         0, 0, 0, 0,1500, 1500);
+
+
+GdkPixbuf *buffer = gdk_pixbuf_get_from_drawable          (NULL,
+                                                         pixmap,
+                                                         gdk_gc_get_colormap (canvas->pixmap_gc),
+                                                         0, 0, 0, 0,1500, 1500);
+ gdk_pixbuf_save (buffer, "./prueba.png", "png", NULL, "compression", "0", NULL);
+}
+
+

Added: trunk/src/components/visualHFSM-3.1/imprimir.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/imprimir.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/imprimir.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,15 @@
+#include <gtk/gtk.h>
+
+//void
+//dialogoImpresion(gchar *file);
+
+/* **** *** ** * GUARDAR PIXMAP EN IMAGEN * ** *** **** */
+void
+guardarPixmapImagenPng(GtkWidget *canvas, gchar*ruta);
+
+
+int
+sp_png_write_rgba (const unsigned char *filename, const unsigned char *px, int width, int height, int rowstride);
+void exportar (GnomeCanvas *canvas);
+void exportar2 (GnomeCanvas *canvas);
+

Added: trunk/src/components/visualHFSM-3.1/int2string.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/int2string.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/int2string.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,11 @@
+#include <sstream>
+
+using namespace std;
+
+string int2string(int n){
+	std:: stringstream flujo;
+
+	flujo << n;
+
+	return (flujo.str());
+}


Property changes on: trunk/src/components/visualHFSM-3.1/int2string.cpp
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/int2string.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/int2string.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/int2string.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,5 @@
+#include <sstream>
+
+
+
+string int2string(int n);


Property changes on: trunk/src/components/visualHFSM-3.1/int2string.h
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/interfaz.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/interfaz.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/interfaz.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,3984 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+#include <sstream>
+#include <iostream>
+#include <string>
+#include <fstream>
+#include <list>
+
+#include <gdk/gdkkeysyms.h>	//NOMBRES TECLAS
+
+#include <gtk/gtk.h>
+#include <gtksourceview/gtksourceview.h>
+#include <gtksourceview/gtksourcebuffer.h>
+#include <gtksourceview/gtksourcelanguage.h>
+#include <gtksourceview/gtksourcelanguagemanager.h>
+
+#include <libgnomecanvas/libgnomecanvas.h>
+#include <libglade-2.0/glade/glade.h>
+#include <libxml/tree.h>
+
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "transicion.h"
+#include "recta.h"
+//#include "nodo.h"
+//#include "ventanas.h"
+#include "xml.h"
+#include "int2string.h"
+#include "imprimir.h"
+#include "interfaz.h"
+
+//#include <gtkmm.h>
+//#include <gtkmm/main.h>
+
+#define FICH_GLADE "insercion.glade"
+
+GladeXML *prog = NULL;
+
+
+
+#define CANVAS_SIZE 1500
+
+using namespace std;
+
+//------------AÑADIDO ESTRUCTURA SUBAUTOMATA
+
+
+
+tSubAut reg_sub;
+list <tSubAut> ListaSubAutomatas;
+int idSubGlobal = 1; //Id máximo de subautomata en el esquema abierto, se usa para ir asignando id's correlativos en la creacion de nuevos niveles
+
+int subautomata_mostrado = 1; //Id del subautomata que se esta mostrando en el canvas
+
+GtkWidget* menu_estado;
+GtkWidget* menu_transicion;
+GtkWidget* menu_pegar;
+
+GtkWidget* nombrar_estado;
+GtkWidget* editar_estado;
+GtkWidget* marcar_inicial_estado;
+GtkWidget* copiar_estado;
+GtkWidget* eliminar_estado;
+GtkWidget* nombrar_transicion;
+GtkWidget* editar_transicion;
+GtkWidget* eliminar_transicion;
+GtkWidget* pegar_estado;
+
+GnomeCanvasItem *item_menu_estado;
+GnomeCanvasItem *item_group_menu_estado;
+GnomeCanvasItem *item_menu_transicion;
+GnomeCanvasItem *item_menu_pegar;
+
+GtkWidget *tree_view;
+
+enum
+{
+  COLUMN = 0,
+  NUM_COLS
+} ;
+
+GtkTreePath * arbolPath;
+
+bool estado_clipboard = FALSE;
+string estado_clipboard_codigo;
+int estado_clipboard_idHijo;
+
+bool estado_nombrado = FALSE;
+
+//------------FIN AÑADIDO ESTRUCTURA SUBAUTOMATA
+
+
+typedef struct reg {
+	GnomeCanvasGroup *root;
+	char *figura;
+} reg; 
+
+typedef struct aux {
+	
+	GnomeCanvasItem * origen;
+	GnomeCanvasItem * destino;
+	string codigo;
+	int tiempo;
+} aux;
+ 
+
+typedef enum TYPE_WIDGET {
+	TEXT_VIEW,
+	ENTRY,
+	SOURCE_VIEW
+}Estado;
+
+const string ayuda[5] = {"Para mover un estado (item), seleccionar el boton mover,\ny posteriormente arrastrar el estado. Para copiar, pulse el boton copiar y selecciona un estado.\nSe copiara automaticamenteen una posicion cercana al estado pulasado.\nPara eliminar un estado, seleccionar el boton y posteriormente pulsar con el boton izquierdo sobre el item.","Boton Estado: pinta un estado en el canvas. Selecionar y pinchar en el lugar donde se quiera posicionar\nBoton Transicion: pinta una transicion entre dos estados. Selecionar boton y selecionar los estados que conecta.","Guarda/Carga el automata en/desde un fichero xml.\nEstado inicial: marca que estado es el inicial.","Estado inicial: marca que estado es el inicial.\nNombrar: nombra el estado.\nEditar: inserta codigo en el estado/transicion.", "Generar C: genera fichero .c\nCompilar: genera ejecutable"};
+
+string codigo = "";
+
+string variables = "";
+string funciones = "";
+
+int tiempo = -1;
+
+int id = 0;
+ 
+list <tNodo> ListaElementos;
+
+list <tTransicion> ListaTransiciones;
+
+list <transicion_aux> ListaTransicionesTemporales;	// Lista de transiciones temporales. Usadas para pintar las transiciones despues de cargar un fichero.
+
+list <GtkWidget *> ListaBotones;
+
+//string fichero = "";		
+
+string directorio = "";	// directorio donde se guarda el esquema
+
+string nombreEsquema = "";	//nombre del esquema guardado
+
+int tiempoIteracion = 100;
+
+importar imp;
+
+//tNodo *TListaFiguras;
+
+tNodo registro;
+
+static GtkWidget *window;	//ventana principal
+
+GtkWidget *canvas;	// canvas principal
+
+GnomeCanvasGroup *root;
+
+GnomeCanvasGroup*  	new_group;
+
+//Movemos estos dos botones aqui para poder acceder a su estado desde todo el programa
+GtkWidget *botonLinea;
+GtkWidget *botonEstado;
+
+string botonPulsado = "Nada";	//Boton pulsado. Para diferenciar operaciones.
+
+GnomeCanvasPoints* points; /* 2 puntos */
+
+GnomeCanvasPoints* points2; /* 2 puntos */
+
+GnomeCanvasItem *item_guardado;	// item guardado para operaciones
+
+GnomeCanvasItem *item_transicion_saved;	// item guardado para operaciones
+
+int origenX, origenY;	// Puntos (x,y) del canvas
+
+int pinta_linea;
+
+int color;	// Guarda Color de la figura editada
+
+const char * compile_file;
+
+char* probar;
+
+double zoom = 1.0;
+
+extern int cont_transiciones;
+
+
+/* Prototipo de la funciónes que capturan las señales de los item */
+gint
+item_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data);
+
+
+void
+cuadro_informacion (char *szMessage)
+{
+	GtkWidget *label;
+	GtkWidget *dialog;
+
+	dialog = gtk_dialog_new_with_buttons ("Information",
+                                                 GTK_WINDOW (window),
+                                                 GTK_DIALOG_MODAL,
+                                                 GTK_STOCK_OK,
+                                                 GTK_RESPONSE_ACCEPT,                                            
+                                                 NULL);
+	gtk_window_set_title (GTK_WINDOW (dialog),"Information");
+	gtk_container_border_width(GTK_CONTAINER (dialog),5);
+
+	//Creamos el mensaje
+	label = gtk_label_new(szMessage);
+	gtk_misc_set_padding(GTK_MISC(label), 10, 10);
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)-> vbox), label, TRUE, TRUE, 0);
+	gtk_widget_show (label);
+		
+	if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
+			gtk_widget_destroy (dialog);
+}
+
+
+
+void
+compilar (GtkWindow *window, gpointer data){
+
+	pid_t pid;
+
+	if (nombreEsquema ==""){
+
+		cuadro_informacion ((char*)"You must generate the code before you could compile it.");
+
+	}else {
+ 		if ((pid = fork()) == -1) {
+   			printf("Error al crear proceso hijo\n");
+    			exit(1);
+ 		}
+		else {
+			if (pid == 0){
+				printf("Compiling..\n");
+				execl("/usr/bin/cmake", "cmake", (const char*)strcat ((char*)directorio.c_str(), "src/build"));
+				execl("/usr/bin/make", "make", (const char*)strcat ((char*)directorio.c_str(), "src/build"));
+//				execl("/usr/bin/make", "make", "-C", (const char*)strcat ((char*)directorio.c_str(), "src/"), "-f", "Makefile-mycomponent", NULL);		
+			}
+		}
+	}
+}
+
+void
+generar_c (GtkWindow *windows, gpointer data){
+
+	pid_t pid;
+
+	const char *filename = "";
+
+
+	if (nombreEsquema ==""){
+
+		cuadro_informacion ((char*)"You must save the project before you could generate the code.");
+
+	}
+
+	else {
+		filename = (directorio + nombreEsquema + ".c").c_str();
+
+  		
+ 		if ((pid = fork()) == -1) {
+   			printf("Error al crear proceso hijo\n");
+    			exit(1);
+ 		}
+	
+		if (pid == 0){
+			printf("Generando Codigo.. %s\n", filename);
+			execl("./generate", "generate",(directorio + nombreEsquema + ".xml").c_str(), (directorio + nombreEsquema + ".c").c_str(), NULL);
+
+		}
+	
+	}
+}
+
+void
+marcar_estado_inicial (GnomeCanvasItem *item)
+{
+	list<tNodo>::iterator pos;
+	GnomeCanvasItem *estado_inicial;
+	tNodo n;
+
+	pos = ListaElementos.begin();
+
+	if (pos->estado_inicial != NULL){
+		gtk_object_destroy(GTK_OBJECT(pos->estado_inicial)); 
+		pos->estado_inicial = NULL;
+	}
+
+	while (pos->item != item){
+		pos++;
+	}
+	
+
+	estado_inicial = pinta_estado_inicial (GNOME_CANVAS_GROUP(item->parent), item);
+	pos->estado_inicial=estado_inicial;
+
+	n = *pos;
+
+	ListaElementos.erase(pos);
+	ListaElementos.push_front (n);
+}
+
+void cargar_transiciones ()
+{
+	GList * list_items;
+	GnomeCanvasGroup *group, *group_parent ;
+	GnomeCanvasItem *box, *item_nombre;
+	double x1, x2, y1, y2;
+	list<transicion_aux>::iterator pos;
+	list<tTransicion>::iterator pos2;
+	list<tNodo>::iterator posNodos;
+
+	pos = ListaTransicionesTemporales.begin();
+
+
+	while (pos != ListaTransicionesTemporales.end())
+	{
+		if (pos->origen == pos->destino){
+			gtk_object_destroy (GTK_OBJECT (pos->item));
+			group = GNOME_CANVAS_GROUP (pinta_autotransicion (pos->origen));
+			goto NOMBRE;
+		}
+
+		group_parent = GNOME_CANVAS_GROUP(pos->item);
+
+		list_items = group_parent->item_list;
+
+		box = (GnomeCanvasItem *) g_list_nth_data (list_items, 0);  
+
+		get_bounds (box, &x1, &y1, &x2, &y2);
+		
+		group = repintar_transicion (GNOME_CANVAS_GROUP (root), pos->origen, pos->destino, (x1+x2)/2, (y1+y2)/2);		
+
+		gnome_canvas_item_reparent (box, group);
+
+		NOMBRE:
+		/* Nombre Transicion */
+		if (pos->nombre.empty())
+			item_nombre = NULL;
+			
+		else
+			item_nombre = gnome_canvas_item_new (root,
+		             gnome_canvas_text_get_type (),
+	             			            "text", pos->nombre.c_str(),
+	             			            "x", (x2+x1)/2,
+	             			            "y", (y2+y1)/2 + 5,
+	             			            "font", "Sans 28",
+					    	    		"anchor", GTK_ANCHOR_N,
+	     			                    "fill_color", "black",
+	    			                     NULL); 
+		
+
+		add_transicion_lista (GNOME_CANVAS_ITEM(group),pos->origen, pos->destino, item_nombre, pos->codigo, pos->tiempo);
+
+		posNodos = ListaElementos.begin();
+
+		while( (posNodos != ListaElementos.end()) && (posNodos->item != pos->origen) )
+			posNodos++;
+
+		posNodos->listaAdyacentes.push_back(GNOME_CANVAS_ITEM(group));
+
+		if (pos->origen != pos->destino){
+			posNodos = ListaElementos.begin();
+
+			while( (posNodos != ListaElementos.end()) && (posNodos->item != pos->destino) )
+				posNodos++;
+
+			posNodos->listaAdyacentes.push_back(GNOME_CANVAS_ITEM(group));
+		}
+
+		pos++;
+	}	
+
+}
+
+
+
+bool ventana_timer (GtkWindow *window, GdkEventMotion *event, gpointer data){
+
+	GtkWidget *ventana;
+
+	ventana = comprobar_ventana_abierta (NULL, TIMER);
+
+	if (ventana != NULL) 
+		gtk_window_present (GTK_WINDOW(ventana));
+	else{
+		ventana = tiempo_iteracion();
+		add_ventana (ventana, NULL, TIMER);
+	}
+	
+	return TRUE;
+
+}
+
+
+bool ventana_importar (GtkWindow *window, GdkEventMotion *event, gpointer data){
+
+	GtkWidget *ventana;
+
+	ventana = comprobar_ventana_abierta (NULL, LIBRERIAS);
+
+	if (ventana != NULL) 
+		gtk_window_present (GTK_WINDOW(ventana));
+	else{
+		ventana = importar_librerias();
+		add_ventana (ventana, NULL, LIBRERIAS);
+	}
+	
+	return TRUE;
+
+}
+
+
+
+bool codigo_esquema (GtkWindow *window, GdkEventMotion *event, gpointer data)
+{
+	GtkWidget *ventana;
+
+	ventana = comprobar_ventana_abierta (NULL, CODIGO);
+
+	if (ventana != NULL) 
+		gtk_window_present (GTK_WINDOW(ventana));
+	else{
+		ventana = new_code_windows ();
+		add_ventana (ventana, NULL, CODIGO);
+	}
+	
+	return TRUE;
+
+}
+
+
+
+void new_windows (GtkWindow *window, GdkEventMotion *event, gpointer data)
+{
+	
+	static GtkWidget *window2;
+	GtkWidget *label;
+
+
+
+	/*Creamos Ventana*/
+	window2 = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+
+	/*Situamos la ventana en el medio*/
+	gtk_window_set_position(GTK_WINDOW(window2), GTK_WIN_POS_CENTER);
+
+	/*Ponemos borde a la ventana*/
+	gtk_container_set_border_width (GTK_CONTAINER (window2), 50);
+
+	/*Ponemos el titulo*/
+	gtk_window_set_title(GTK_WINDOW(window2), "Ayuda");
+
+	/* An option menu to change the position of the value */
+	label = gtk_label_new ((const char*)data);
+
+	gtk_container_add (GTK_CONTAINER(window2), label);
+
+	gtk_widget_show_all(window2);
+
+}
+
+
+
+/* Crea una Caja de Botones con los parámetros específicos */
+GtkWidget *create_bbox( gint  horizontal,
+                        char *title,
+                        gint  espacio,
+                        gint  child_w,
+                        gint  child_h,
+                        gint  layout,
+			gpointer data,
+			gpointer text)
+{
+  GtkWidget *frame;
+  GtkWidget *bbox;
+  GtkWidget *button;
+
+  frame = gtk_frame_new (title);
+	gtk_container_set_border_width (GTK_CONTAINER (frame), 0);
+
+  if (horizontal)
+    bbox = gtk_hbutton_box_new ();
+  else
+    bbox = gtk_vbutton_box_new ();
+
+  gtk_container_set_border_width (GTK_CONTAINER (bbox), 0);
+  gtk_container_add (GTK_CONTAINER (frame), bbox);
+
+  /* Establece la apariencia de la Caja de Botones */
+
+  gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox),  GtkButtonBoxStyle(layout));
+
+  gtk_box_set_spacing (GTK_BOX (bbox), espacio);
+
+	list <GtkWidget *> ::iterator pos;
+
+	pos = ListaBotones.begin();
+	while (pos!=ListaBotones.end()){
+  		gtk_container_add (GTK_CONTAINER (bbox), *pos);
+		pos++;
+	}
+
+	button = gtk_button_new_from_stock (GTK_STOCK_HELP);
+	gtk_signal_connect(GTK_OBJECT(button), "button_release_event", GTK_SIGNAL_FUNC(new_windows), text); 
+
+  return frame;
+}
+
+
+void frame_callback(GtkWindow *window, 
+      GdkEvent *event, gpointer data)
+{
+	int x, y;
+	char buf[10];
+	x = event->configure.x;
+	y = event->configure.y;
+	sprintf(buf, "%d, %d", x, y);
+	printf("Mover %d, %d\n", x, y);
+	gtk_window_set_title(window, buf);
+}
+
+void guardar(GtkWindow *windows, gpointer data)
+{
+	xmlDocPtr doc;	
+
+	GtkWidget *dialog;
+  	GtkFileFilter *filter;
+
+	cout << directorio << endl;
+	cout << (int)data << endl;
+
+	if ( (((int)data ==0) && (directorio == "")) || ((int)data == 1) ){
+  		dialog = gtk_file_chooser_dialog_new ("Save File", NULL, 
+                              GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                              GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
+
+		gtk_window_set_title(GTK_WINDOW(dialog), "Save File");
+		
+  		gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER(dialog), TRUE);
+
+  		filter = gtk_file_filter_new();
+  		gtk_file_filter_set_name (filter, "xml");
+  		gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
+  		gtk_file_filter_add_pattern (filter, "*.[x][m][l]");
+
+  		filter = gtk_file_filter_new();
+  		gtk_file_filter_set_name (filter, "All files");
+  		gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
+  		gtk_file_filter_add_pattern (filter, "*");
+
+  	}
+	if (((int)data ==0) & (directorio != "")){
+
+		doc = xml_new_doc ("VisualHFSM");
+
+		//**************************************************Antes de llamar a guardar ponemos en las variables del nodo del nivel en el que nos 
+		//**************************************************encontremos las variables globales que estuviesemos usando en ese momento.
+		list<tSubAut>::iterator posNodoSub;	
+		posNodoSub = ListaSubAutomatas.begin();
+		
+		while (posNodoSub->idSub != subautomata_mostrado and posNodoSub != ListaSubAutomatas.end())
+			posNodoSub++;
+
+		posNodoSub->ListaElementosSub = ListaElementos;		
+		posNodoSub->ListaTransicionesSub = ListaTransiciones;
+		posNodoSub->tiempoIteracionSub = tiempoIteracion;
+		posNodoSub->variablesSub = variables;
+		posNodoSub->funcionesSub = funciones;
+		posNodoSub->impSub = imp;
+		//**************************************************************************************************************************************
+
+		xml_new_entry (doc);
+
+		xmlSaveFile      ((directorio + nombreEsquema + ".xml").c_str(), doc);
+	}
+  	else if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
+    		char *filename;
+    
+    		filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+
+    		printf("File open: %s\n",filename);
+
+		compile_file = filename;
+
+		// Nombre y directorio fichero
+
+		string fich = filename;
+		int i;
+		size_t pos;
+  		for (i=0; i < (signed)fich.length(); i++)
+  		{
+   			if (fich.at(i) == '/')
+				pos = i;
+ 		}	
+		string fichero = fich.substr (++pos);
+
+		directorio = fich.substr (0,pos);
+
+		string nombre;
+
+		for (i=0; i < (signed)fichero.length(); i++)
+  		{
+   			if (fichero.at(i) == '.')
+				pos = i;
+ 		}	
+		
+		nombre = fichero.substr (0,pos);
+		
+		nombreEsquema = nombre;
+
+		/*Ponemos el titulo*/
+		gtk_window_set_title(GTK_WINDOW(window), nombre.c_str());
+
+		doc = xml_new_doc ("VisualHFSM");
+
+		//**************************************************Antes de llamar a guardar ponemos en las variables del nodo del nivel en el que nos 
+		//**************************************************encontremos las variables globales que estuviesemos usando en ese momento.
+		list<tSubAut>::iterator posNodoSub;	
+		posNodoSub = ListaSubAutomatas.begin();
+		
+		while (posNodoSub->idSub != subautomata_mostrado and posNodoSub != ListaSubAutomatas.end())
+			posNodoSub++;
+
+		posNodoSub->ListaElementosSub = ListaElementos;		
+		posNodoSub->ListaTransicionesSub = ListaTransiciones;
+		posNodoSub->tiempoIteracionSub = tiempoIteracion;
+		posNodoSub->variablesSub = variables;
+		posNodoSub->funcionesSub = funciones;
+		posNodoSub->impSub = imp;
+		//**************************************************************************************************************************************
+
+		xml_new_entry (doc);
+
+		xmlSaveFile      (filename, doc);
+
+    		g_free (filename);
+
+ 		gtk_widget_destroy (dialog);
+
+	}
+	else 
+		gtk_widget_destroy (dialog);
+
+}
+
+void remarcar_boton (GtkFileChooser *window, gpointer data)
+	{
+		gtk_widget_grab_focus ((GtkWidget *)data);
+	}
+
+void  borrar_canvas ()
+{
+
+	list<tTransicion>::iterator posTransiciones;
+
+	posTransiciones = ListaTransiciones.begin();
+		
+	while (posTransiciones != ListaTransiciones.end())
+	{
+		gtk_object_destroy (GTK_OBJECT ((posTransiciones->item_nombre)));
+		gtk_object_destroy (GTK_OBJECT ((posTransiciones->item)));
+		posTransiciones++;			
+	}	
+
+	ListaTransiciones.clear();
+
+	list<tNodo>::iterator posNodos;
+
+	posNodos = ListaElementos.begin();
+		
+	while (posNodos != ListaElementos.end())
+	{
+		gtk_object_destroy (GTK_OBJECT ((posNodos->item->parent)));
+		posNodos++;			
+	}	
+
+	ListaElementos.clear();	
+
+	gnome_canvas_update_now (GNOME_CANVAS(canvas));
+
+}
+
+
+void cargar(GtkWindow *windows, gpointer data)
+{
+	xmlDocPtr doc; 
+	
+	xmlNodePtr root;
+
+	xmlNodePtr nodeSub;
+
+	xmlNodePtr node;
+
+	list<tSubAut>::iterator posSub;//Añadido para luego poder cargar en las variables globales la primera posicion de la lista de subAut.
+
+	GtkFileFilter *filter;
+
+	GtkWidget *dialog;
+
+	dialog = gtk_file_chooser_dialog_new ("Open File",
+				      NULL,
+				      GTK_FILE_CHOOSER_ACTION_OPEN,
+				      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+				      GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+				      NULL);
+
+	filter = gtk_file_filter_new();
+	gtk_file_filter_set_name (filter, "xml");
+	gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
+	gtk_file_filter_add_pattern (filter, "*.[x][m][l]");
+
+	filter = gtk_file_filter_new();
+	gtk_file_filter_set_name (filter, "All files");
+	gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter);
+	gtk_file_filter_add_pattern (filter, "*");
+
+	gtk_window_set_title(GTK_WINDOW(dialog), "Open File");
+
+	if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
+  	{
+		/* Dirección del fichero */
+   		char *filename;
+
+    		filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+
+    		printf("Fichero abierto: %s\n",filename);
+
+		/* Abrir XML */
+
+		doc = xmlParseFile (filename);
+
+		if (!doc) {
+	  		g_print("Error al cargar documento XML\n");
+	  	}
+		else{
+			item_guardado = NULL;
+			root = xmlDocGetRootElement (doc);
+	 		nodeSub = root->xmlChildrenNode;
+			//node = nodeSub->xmlChildrenNode;
+			
+			
+			/* Borrar Canvas */
+			
+			if (!ListaSubAutomatas.empty()){
+
+				posSub = ListaSubAutomatas.begin();
+		
+				while (posSub != ListaSubAutomatas.end()){
+
+					ListaElementos = posSub->ListaElementosSub;
+					ListaTransiciones = posSub->ListaTransicionesSub;
+
+					borrar_canvas();
+					printf("Borrado nivel \n");
+
+					posSub++;
+
+				}
+
+			}
+			else
+				borrar_canvas();
+
+			ListaSubAutomatas.clear();
+			
+			/* Recuperamos los datos */
+
+			while (nodeSub != NULL){
+				g_print("Encontrado Sub: %s\n", nodeSub->name);//*****************************************************************
+				
+				node = nodeSub->xmlChildrenNode;				
+
+				if (strcmp((const char *)nodeSub->name, "nombreEsquema")==0){
+
+					string fich = (const char*)xmlNodeGetContent (nodeSub);
+					if (fich != ""){
+						size_t pos;
+
+						pos = fich.rfind('/');
+						printf("fich: %s\n",fich.c_str());//**********************************************************************
+						nombreEsquema = fich.substr (++pos);
+
+						printf("nombreEsquema: %s\n",nombreEsquema.c_str());//****************************************************
+
+
+						directorio = filename;
+						pos = directorio.rfind('/');
+						directorio = directorio.substr (0,++pos);
+
+						/*Ponemos el titulo*/
+						gtk_window_set_title(GTK_WINDOW(window), nombreEsquema.c_str());
+					}else{
+						/*Ponemos el titulo*/
+						gtk_window_set_title(GTK_WINDOW(window),"Default");
+					}	
+
+				}else if (strcmp((const char *)nodeSub->name, "SubAutomata")==0){
+
+					g_print("Entra por subautomata\n");//**************************************************************
+					
+					while (node != NULL) {
+						
+			   			g_print("Encontrado nodo %s\n", node->name);
+
+						if (strcmp((const char *)node->name, "idSub")==0){
+							reg_sub.idSub = atoi((const char*)xmlNodeGetContent (node));
+							if (reg_sub.idSub > idSubGlobal){
+								idSubGlobal = reg_sub.idSub;
+							}
+						}
+						else if (strcmp((const char *)node->name, "idPadre")==0)
+							reg_sub.idPadre = atoi((const char*)xmlNodeGetContent (node));
+						else if (strcmp((const char *)node->name, "tiempoIteracion")==0)
+							reg_sub.tiempoIteracionSub = atoi((const char*)xmlNodeGetContent (node));
+						else if (strcmp((const char *)node->name, "variables_aux")==0)
+							reg_sub.variablesSub = (const char*)xmlNodeGetContent (node);
+						else if (strcmp((const char *)node->name, "funciones_aux")==0)
+							reg_sub.funcionesSub = (const char*)xmlNodeGetContent (node);
+						else if (strcmp((const char *)node->name, "Librerias")==0){
+							xmlNodePtr child = node->xmlChildrenNode;	
+							string lib;				
+							while (child != NULL){
+								lib = (const char*)xmlNodeGetContent (child);	
+								if (lib == "laser")
+									reg_sub.impSub.laser = true;
+								if (lib == "motor")
+									reg_sub.impSub.motor = true;
+								if (lib == "radar")
+									reg_sub.impSub.radar = true;
+								if (lib == "encoders")
+									reg_sub.impSub.encoders = true;
+								if (lib == "lat_lon")
+									reg_sub.impSub.lat_lon = true;
+								if (lib == "camara")
+									reg_sub.impSub.camara = true;
+								if (lib == "ptencoders")
+									reg_sub.impSub.ptencoders = true;
+						
+								child = child->next;
+							}
+						}else//Aqui se extraen los datos de cada estado concreto
+							xml_get_entry (node);
+										
+						node = node->next;
+
+			  		}//While node
+
+
+					/* Pintado de Transiciones */
+
+					list<transicion_aux>::iterator pos, pos2;
+
+					pos = ListaTransicionesTemporales.begin();
+	
+					while (pos != ListaTransicionesTemporales.end())
+					{
+						if (pos->destino == NULL) 
+						{
+							pos2 = ListaTransicionesTemporales.begin();
+							while (pos2 != ListaTransicionesTemporales.end()){
+								if (pos->destino_id == pos2->origen_xml)
+									pos->destino = pos2->origen;
+								pos2++;
+							}
+						}	
+						pos++;
+					}
+
+					gnome_canvas_update_now (GNOME_CANVAS(canvas));
+
+					cout << "item_guardado   " << item_guardado << endl;
+
+					item_guardado = NULL;
+
+					cargar_transiciones ();
+
+					ListaTransicionesTemporales.clear();
+
+					reg_sub.ListaElementosSub = ListaElementos;
+					reg_sub.ListaTransicionesSub = ListaTransiciones;
+					
+					//Borramos el canvas a cada iteracion para que no se pinte todo a la vez, la información para poder
+					//restaurar cada nivel en el canvas ya la tenemos guardada en cada nodo de la lista de subAutómatas
+					//borrar_canvas();
+
+					ListaElementos.clear();
+					ListaTransiciones.clear();
+				
+					ListaSubAutomatas.push_back(reg_sub);
+
+					//Borramos el subautomata que acabamos de pintar para al final de la carga pintar solo el primer nivel.
+					ocultar_subautomata(reg_sub.idSub);
+
+
+				}//else de SubAutomata
+
+				nodeSub = nodeSub->next;
+
+			}//While nodeSub
+
+		}
+
+		g_free (filename);
+
+  	}	
+
+	gtk_widget_destroy (dialog);
+	
+	//Pintamos el canvas con los elementos del subautomata 1, la raiz.
+	printf("Antes de pintar sub\n");
+	mostrar_subautomata(1);
+	printf("Despues de pintar sub\n");
+
+	//Cargamos en las variables "globales" las correspondientes al primer nodo de la lista de subautómatas.
+	posSub = ListaSubAutomatas.begin();
+	
+	imp = posSub->impSub;
+	funciones = posSub->funcionesSub;
+	variables = posSub->variablesSub;
+	tiempoIteracion = posSub->tiempoIteracionSub;
+
+	ListaElementos = posSub->ListaElementosSub;
+	ListaTransiciones = posSub->ListaTransicionesSub;
+
+	//Dejamos preparada la variable idSubGlobal con un numero correlativo mayor al máximo cargado.
+	idSubGlobal++;
+
+	//Recargamos el tree view con los nuevos datos cargados
+	actualizar_tree_view();	
+
+}
+
+
+void mostrar_subautomata(int pidSub)
+{
+
+	list<tSubAut>::iterator posSub;
+
+	list <tNodo>::iterator Elem;
+	list <tTransicion>::iterator Trans;
+
+
+	posSub = ListaSubAutomatas.begin();
+	
+	while(posSub->idSub != pidSub){
+		posSub++;
+	}
+
+	Elem = posSub->ListaElementosSub.begin();
+	Trans = posSub->ListaTransicionesSub.begin();
+
+	/*group = GNOME_CANVAS_GROUP (gnome_canvas_item_new (root,  
+                                gnome_canvas_group_get_type (),
+                                "x", 0,
+                                "y", 0,
+                                NULL));*/
+	if (!posSub->ListaElementosSub.empty()){
+		while(Elem != posSub->ListaElementosSub.end()){
+		
+			if (Elem->item != NULL) 
+				gnome_canvas_item_show(Elem->item);	
+
+			if (Elem->estado_inicial != NULL)
+				gnome_canvas_item_show(Elem->estado_inicial);	
+
+			if (Elem->item_nombre != NULL)
+				gnome_canvas_item_show(Elem->item_nombre);	
+	
+			printf("Pintado nodo en el canvas\n");
+		
+			Elem++;
+		
+		}
+
+		while (Trans != posSub->ListaTransicionesSub.end()){
+		
+			if(Trans->item != NULL)
+				gnome_canvas_item_show(Trans->item);
+		
+			if(Trans->item_nombre != NULL)
+				gnome_canvas_item_show(Trans->item_nombre);
+	
+			Trans++;
+		
+		}
+	}
+
+
+	printf("Antes de update en el mostrar\n");
+	//gnome_canvas_update_now (GNOME_CANVAS(canvas));
+	printf("Despues de update en el mostrar\n");
+	subautomata_mostrado = pidSub;
+
+}
+
+
+void ocultar_subautomata(int pidSub)
+{
+
+	list<tSubAut>::iterator posSub;
+
+	list <tNodo>::iterator Elem;
+	list <tTransicion>::iterator Trans;
+
+
+	posSub = ListaSubAutomatas.begin();
+	
+	while(posSub->idSub != pidSub){
+		posSub++;
+	}
+
+	Elem = posSub->ListaElementosSub.begin();
+	Trans = posSub->ListaTransicionesSub.begin();
+
+	/*group = GNOME_CANVAS_GROUP (gnome_canvas_item_new (root,  
+                                gnome_canvas_group_get_type (),
+                                "x", 0,
+                                "y", 0,
+                                NULL));*/
+
+	while(Elem != posSub->ListaElementosSub.end()){
+		
+		if (Elem->item != NULL) 
+			gnome_canvas_item_hide(Elem->item);	
+
+		if (Elem->estado_inicial != NULL)
+			gnome_canvas_item_hide(Elem->estado_inicial);	
+
+		if (Elem->item_nombre != NULL)
+			gnome_canvas_item_hide(Elem->item_nombre);	
+		
+		Elem++;
+		
+	}
+
+	while (Trans != posSub->ListaTransicionesSub.end()){
+		
+		if(Trans->item != NULL)
+			gnome_canvas_item_hide(Trans->item);
+		
+		if(Trans->item_nombre != NULL)
+			gnome_canvas_item_hide(Trans->item_nombre);
+	
+		Trans++;
+		
+	}
+
+	gnome_canvas_update_now (GNOME_CANVAS(canvas));
+
+
+}
+
+
+void coordenadas(GtkWindow *window, GdkEvent *event, gpointer data)
+{
+
+	origenX = event->button.x;
+	origenY = event->button.y;
+	printf("Click Press %d, %d\n", origenX, origenY);
+
+	if (event->button.button == 3){
+
+		gtk_menu_popup(GTK_MENU(menu_pegar),NULL,NULL,NULL,NULL,event->button.button,event->button.time);	
+
+	}
+	
+}
+
+
+void pinta_nodo(GtkWindow *window, GdkEventMotion *event, gpointer data)
+{
+	int x, y;
+	
+	GnomeCanvasItem *item;
+	GnomeCanvasGroup *group;
+
+	list<tSubAut>::iterator posSub; //Añadido para poder iterar en la lista de subautomatas y actulizar el treeview con cada nuevo estado
+
+	//GtkWidget *button;
+
+	x = event->x;
+	y = event->y;
+
+	points = gnome_canvas_points_new(2); /* 2 puntos */
+	points->coords[0]  = origenX;
+	points->coords[1]  = origenY;
+	points->coords[2]  = x;
+	points->coords[3]  = y;
+
+	printf("Click %d, %d\n", x, y);
+	//printf("Pintamos Nodo \n");
+
+	if ((strcmp(botonPulsado.c_str(), "Cuadrado")==0) and (event->state & GDK_BUTTON1_MASK)) 
+	{
+
+		group = GNOME_CANVAS_GROUP (gnome_canvas_item_new (root,  
+                                        gnome_canvas_group_get_type (),
+                                        "x", 0,
+                                        "y", 0,
+                                        NULL));
+
+		item = gnome_canvas_item_new(group,
+                        gnome_canvas_ellipse_get_type(),
+                        "x1", (double) origenX-20,
+                        "y1", (double) origenY-20,
+                        "x2", (double) (origenX + 20),
+                        "y2", (double) (origenY + 20),
+                        "fill_color_rgba", 0x00ffffff,
+                        "outline_color", "black",
+                        "width_units", 1.0,
+                        NULL);
+	  
+
+		registro.item = item;
+		registro.item_nombre = NULL;
+		registro.estado_inicial = NULL;
+		registro.nombre = "";
+		registro.codigo = "";
+		registro.idHijo = 0;//***********Por defecto un estado no tiene hijos
+		id ++;
+	
+		ListaElementos.push_back(registro);
+
+		/*Añadimos control (señal) al item creado*/
+		g_signal_connect (group, "event",
+			    (GtkSignalFunc) item_event,
+			    NULL);
+
+		//Actualizamos datos necesarios para mostrar cambios en el tree view
+		posSub = ListaSubAutomatas.begin();
+
+		while(posSub->idSub != subautomata_mostrado)
+		{
+			posSub++;
+		}
+
+		//guardamos el estado de la lista de elementos en el nodo del subautomata para poder recargar bien el tree view
+		posSub->ListaElementosSub = ListaElementos;
+
+		actualizar_tree_view();
+		
+		gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view), arbolPath);		
+
+	}
+
+}
+
+static gint nodo(GtkWindow *window, GdkEventMotion *event, gpointer data)
+{
+	int x, y;
+
+	x = event->x;
+	y = event->y;
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(botonLinea),FALSE);
+
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(botonEstado))){
+		
+		botonPulsado="Nada";
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(botonEstado),FALSE);
+
+	}
+	else{
+		botonPulsado="Cuadrado";
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(botonEstado),TRUE);
+	}
+
+
+	/*if ((int)data == 1)
+	{
+		botonPulsado="EstadoInicial";
+	}
+	else{
+		printf("Click %d, %d\n", x, y);
+
+		botonPulsado="Cuadrado";
+		
+	}*/
+
+	return TRUE;
+}
+
+
+static gint motion_notify_event(GtkWindow *window, GdkEventMotion *event, gpointer data)
+{
+	int x, y;
+
+	x = event->x;
+	y = event->y;
+
+	printf("Click %d, %d\n", x, y);
+
+	return TRUE;
+}
+
+void transicion(GtkWindow *window, GdkEventMotion *event, gpointer data)
+{
+	item_transicion_saved = NULL;
+
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(botonEstado),FALSE);
+
+	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(botonLinea))){
+		
+		botonPulsado="Nada";
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(botonLinea),FALSE);
+
+	}
+	else{
+		botonPulsado="Linea";
+		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(botonLinea),TRUE);
+	}
+
+}
+
+
+void mover(GtkWindow *window, GdkEventMotion *event, gpointer data)
+{
+	botonPulsado = "Mover";
+}
+
+void eliminar(GtkWindow *window, GdkEventMotion *event, gpointer data)
+{	
+	botonPulsado = "Eliminar";
+}
+
+void copiar(GtkWindow *window, GdkEventMotion *event, gpointer data)
+{
+	botonPulsado = "Copiar";
+}
+
+void editar(GtkWindow *window, GdkEventMotion *event, gpointer data)
+{
+	botonPulsado = "Editar";
+}
+
+void nombrar(GtkWindow *window, GdkEventMotion *event, gpointer data)
+{
+	botonPulsado = "Nombrar";
+}
+
+void set_zoom (GtkWidget *window, GdkEvent *event, gpointer data){
+
+	double incremento = 0.1;
+
+	cout  <<  gdk_keyval_name  (event->key.keyval) << endl;
+	cout  <<  event->key.keyval << endl;
+
+	if (event->key.keyval == GDK_Up)
+		zoom += incremento;
+	if (event->key.keyval == GDK_Down)
+		zoom -= incremento;
+	if (event->key.keyval == GDK_KP_0)
+		zoom = 1.0;
+
+	gnome_canvas_set_pixels_per_unit ((GnomeCanvas*)canvas, zoom);
+
+}
+
+
+//------------Funcion arriba añadida para navegacion entre niveles jerarquicos
+void arriba(GtkWindow *window, GdkEventMotion *event, gpointer data)
+{
+
+	list<tSubAut>::iterator posSub;
+
+	list <tNodo>::iterator posNodo;
+	//list <tTransicion>::iterator Trans;
+	
+	int idPadre;
+
+	printf("Entra ARRIBA\n");
+
+	botonPulsado = "Nada";//Para evitar interferencias con los eventos detectados en el canvas
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(botonEstado),FALSE);
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(botonLinea),FALSE);
+
+	posSub = ListaSubAutomatas.begin();
+
+	while(posSub->idSub != subautomata_mostrado){
+		posSub++;
+	}
+
+	idPadre = posSub->idPadre;
+
+	if (idPadre != 0){
+		printf("idPadre distinto de 0\n");
+		if (!ListaElementos.empty()){
+
+			printf("La lista NO esta vacia\n");
+		
+			//Guardamos el nivel actual
+			posSub->ListaElementosSub = ListaElementos;		
+			posSub->ListaTransicionesSub = ListaTransiciones;
+			posSub->tiempoIteracionSub = tiempoIteracion;
+			posSub->variablesSub = variables;
+			posSub->funcionesSub = funciones;
+			posSub->impSub = imp;
+
+			ocultar_subautomata(subautomata_mostrado);
+
+			posSub = ListaSubAutomatas.begin();
+	
+			while (posSub->idSub != idPadre and posSub != ListaSubAutomatas.end())
+				posSub++;
+
+			mostrar_subautomata(idPadre);
+
+			ListaElementos.clear();
+			ListaTransiciones.clear();
+
+			//Cargamos el nivel que vamos a mostrar
+			ListaElementos = posSub->ListaElementosSub;		
+			ListaTransiciones = posSub->ListaTransicionesSub;
+			tiempoIteracion = posSub->tiempoIteracionSub;
+			variables = posSub->variablesSub;
+			funciones = posSub->funcionesSub;
+			imp = posSub->impSub;	
+
+		}
+		else
+		{
+			printf("La lista esta vacia\n");
+		
+			posSub = ListaSubAutomatas.begin();
+	
+			while (posSub->idSub != subautomata_mostrado and posSub != ListaSubAutomatas.end())
+				posSub++;
+			
+			//Borramos el nodo que se había creado
+			ListaSubAutomatas.erase(posSub);
+
+			posSub = ListaSubAutomatas.begin();
+	
+			while (posSub->idSub != idPadre and posSub != ListaSubAutomatas.end())
+				posSub++;
+
+			posNodo = posSub->ListaElementosSub.begin();
+
+			while (posNodo->idHijo != subautomata_mostrado and posNodo != posSub->ListaElementosSub.end())
+				posNodo++;
+
+			//Ponemos a 0 el hijo del estado que tenia como hijo al subautomata que se ha borrado.
+			posNodo->idHijo = 0;
+
+			change_item_color(posNodo->item, 3);
+
+			mostrar_subautomata(idPadre);
+
+			ListaElementos.clear();
+			ListaTransiciones.clear();
+
+			//Cargamos el nivel que vamos a mostrar
+			ListaElementos = posSub->ListaElementosSub;		
+			ListaTransiciones = posSub->ListaTransicionesSub;
+			tiempoIteracion = posSub->tiempoIteracionSub;
+			variables = posSub->variablesSub;
+			funciones = posSub->funcionesSub;
+			imp = posSub->impSub;
+
+		}
+
+		actualizar_tree_view();
+
+		gtk_tree_path_up (arbolPath);	
+
+		gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view), arbolPath);
+
+	}
+	else{
+
+		printf("idPadre igual a 0\n");
+
+		actualizar_tree_view();
+
+		gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view), arbolPath);
+
+	}
+
+	printf("Se ejecuta ARRIBA\n");
+
+
+}
+//------------FIN Funcion arriba añadida para navegacion entre niveles jerarquicos
+
+void actualizar_tree_view()
+{
+
+	list<tSubAut>::iterator posNodoSub;
+
+	//Guardamos los datos del nivel en el que estamos
+	posNodoSub = ListaSubAutomatas.begin();
+		
+	while (posNodoSub->idSub != subautomata_mostrado and posNodoSub != ListaSubAutomatas.end())
+		posNodoSub++;
+	
+	//Guardamos el nivel actual
+	posNodoSub->ListaElementosSub = ListaElementos;		
+	posNodoSub->ListaTransicionesSub = ListaTransiciones;
+	posNodoSub->tiempoIteracionSub = tiempoIteracion;
+	posNodoSub->variablesSub = variables;
+	posNodoSub->funcionesSub = funciones;
+	posNodoSub->impSub = imp;
+
+	//actualizamos los datos del modelo del tree_view
+	gtk_tree_view_set_model(GTK_TREE_VIEW(tree_view), create_and_fill_model());
+
+}
+
+
+void rellenar_arbol_recursivo(GtkTreeStore *treestore, GtkTreeIter toplevel, int idSubautomata)
+{
+	GtkTreeIter child;
+	list<tSubAut>::iterator posNodoSub;
+	list<tNodo>::iterator posEst;
+
+	string cadena = "";
+
+	int contSinNombre = 1;
+
+	posNodoSub = ListaSubAutomatas.begin();
+
+	while (posNodoSub->idSub != idSubautomata and posNodoSub != ListaSubAutomatas.end())
+	{
+		posNodoSub++;
+	}
+
+	if (!posNodoSub->ListaElementosSub.empty())
+	{
+
+		posEst = posNodoSub->ListaElementosSub.begin();
+
+		while (posEst != posNodoSub->ListaElementosSub.end())
+		{
+
+			if (posEst->nombre != "")
+			{
+				cadena = posEst->nombre;
+			}
+			else
+			{
+				cadena = "NoName_"+int2string(contSinNombre);
+				contSinNombre++;
+			}
+
+			gtk_tree_store_append(treestore, &child, &toplevel);
+		    gtk_tree_store_set(treestore, &child, COLUMN, cadena.c_str(),-1);
+
+			if (posEst->idHijo != 0)
+			{
+				//Con esta función recorreremos la lista de subautomatas recursivamente para ir añadiendo los datos correspondientes
+				//en el treeview
+				rellenar_arbol_recursivo(treestore, child, posEst->idHijo);
+
+			}
+
+			posEst++;		
+
+		}	
+
+	}
+	
+}
+
+static GtkTreeModel *
+create_and_fill_model (void)
+{
+  	GtkTreeStore *treestore;
+  	GtkTreeIter toplevel;
+
+  	list<tSubAut>::iterator posNodoSub;
+	list<tNodo>::iterator posEst;
+
+	string cadena = "";
+
+	int contSinNombre = 1;
+
+  	treestore = gtk_tree_store_new(NUM_COLS, G_TYPE_STRING);
+
+	if (!ListaSubAutomatas.empty())
+	{ 
+		posNodoSub = ListaSubAutomatas.begin();
+
+		if (!posNodoSub->ListaElementosSub.empty())
+		{
+			posEst = posNodoSub->ListaElementosSub.begin();
+
+			while (posEst != posNodoSub->ListaElementosSub.end())
+			{
+
+				if (posEst->nombre != "")
+				{
+					cadena = posEst->nombre;
+				}
+				else
+				{
+					cadena = "NoName_"+int2string(contSinNombre);
+					contSinNombre++;
+				}
+
+				gtk_tree_store_append(treestore, &toplevel, NULL);
+			    gtk_tree_store_set(treestore, &toplevel,
+                 COLUMN, cadena.c_str(),
+                 -1);
+
+				if (posEst->idHijo != 0)
+				{
+					//Con esta función recorreremos la lista de subautomatas recursivamente para ir añadiendo los datos correspondientes
+					//en el treeview
+					rellenar_arbol_recursivo(treestore, toplevel, posEst->idHijo);
+
+				}
+
+				posEst++;		
+
+			}		
+
+		}
+
+	}
+
+  return GTK_TREE_MODEL(treestore);
+}
+
+void treeview_onRowActivated(GtkTreeView *treeview,
+							 GtkTreePath *path,
+							 GtkTreeViewColumn *col,
+							 gpointer userdata){
+
+	list<tSubAut>::iterator posSub;
+
+	list<tNodo>::iterator posNodo;
+
+	gint* indices;
+
+	int prof_path;
+
+	int niveles_restantes=0;
+	int i=0;
+
+	int sub_a_buscar = 1;
+	int sub_a_mostrar = 1;
+
+	int indice_leido = 0;
+	int contNodo = 0;
+
+	bool expandir = FALSE;
+
+
+	botonPulsado = "Nada";//Para evitar interferencias con los eventos detectados en el canvas
+
+	prof_path = gtk_tree_path_get_depth(path);
+
+	
+
+	if (prof_path == 1) {//hemos seleccionado el primer nivel con lo cual mostramos la raiz
+
+		sub_a_mostrar = 1;
+
+		printf("Selecionado el raiz*********\n");
+
+		arbolPath = gtk_tree_path_new_first();
+		expandir = FALSE;
+
+	}
+	else{
+
+		//Quitamos el ultimo elemento del path porque queremos mostrar el subautomata con el ID que nos indique su padre
+		//con lo cual solo necesitaremos recorrer la lista de subautomatas hasta su padre.
+		gtk_tree_path_up (path);
+
+		arbolPath = gtk_tree_path_copy(path);
+
+		printf("path del doble click: %s\n", gtk_tree_path_to_string(path));
+
+		//Obtenemos sus indices en un array
+		indices = gtk_tree_path_get_indices(path);
+
+		//Obtenemos su profundidad para saber hasta cuando iterar al recorrer la lista de subautomatas
+		prof_path = gtk_tree_path_get_depth(path);
+
+		niveles_restantes = prof_path;
+
+		while (niveles_restantes != 0) {
+
+			printf("Niveles restantes: %d\n", niveles_restantes);			
+			indice_leido = indices[i];		
+
+			printf("Indice leido: %d\n", indice_leido);
+
+			posSub = ListaSubAutomatas.begin();
+	
+			printf("Se busca por: %d\n", sub_a_buscar);
+
+			while(posSub->idSub != sub_a_buscar){
+				posSub++;
+			}
+
+			posNodo = posSub->ListaElementosSub.begin();
+
+			while(contNodo != indice_leido){
+				posNodo++;
+				contNodo++;
+
+				printf("Contador: %d\n", contNodo);
+			}
+
+			sub_a_buscar = posNodo->idHijo;
+
+			printf("Proxima busqueda: %d\n", sub_a_buscar);
+
+			contNodo = 0;
+			i++;
+			niveles_restantes--;
+
+		}
+
+		sub_a_mostrar = sub_a_buscar;
+
+		sub_a_buscar = 1;
+
+		printf("Sub a mostrar: %d\n", sub_a_mostrar);
+
+		expandir = TRUE;
+
+	}
+
+
+	//Ahora viene una gestion equivalente a la de el boton "UP"
+	int idPadre;
+
+	posSub = ListaSubAutomatas.begin();
+
+	while(posSub->idSub != subautomata_mostrado){
+		posSub++;
+	}
+
+	idPadre = posSub->idPadre;
+	
+	if (!ListaElementos.empty()){
+	
+		//Guardamos el nivel actual
+		posSub->ListaElementosSub = ListaElementos;		
+		posSub->ListaTransicionesSub = ListaTransiciones;
+		posSub->tiempoIteracionSub = tiempoIteracion;
+		posSub->variablesSub = variables;
+		posSub->funcionesSub = funciones;
+		posSub->impSub = imp;
+
+		ocultar_subautomata(subautomata_mostrado);
+
+		posSub = ListaSubAutomatas.begin();
+
+		while (posSub->idSub != sub_a_mostrar and posSub != ListaSubAutomatas.end())
+			posSub++;
+
+		mostrar_subautomata(sub_a_mostrar);
+
+		ListaElementos.clear();
+		ListaTransiciones.clear();
+
+		//Cargamos el nivel que vamos a mostrar
+		ListaElementos = posSub->ListaElementosSub;		
+		ListaTransiciones = posSub->ListaTransicionesSub;
+		tiempoIteracion = posSub->tiempoIteracionSub;
+		variables = posSub->variablesSub;
+		funciones = posSub->funcionesSub;
+		imp = posSub->impSub;	
+
+	}
+	else
+	{
+	
+		posSub = ListaSubAutomatas.begin();
+
+		while (posSub->idSub != subautomata_mostrado and posSub != ListaSubAutomatas.end())
+			posSub++;
+		
+		//Borramos el nodo que se había creado
+		ListaSubAutomatas.erase(posSub);
+
+		posSub = ListaSubAutomatas.begin();
+
+		while (posSub->idSub != idPadre and posSub != ListaSubAutomatas.end())
+			posSub++;
+
+		posNodo = posSub->ListaElementosSub.begin();
+
+		while (posNodo->idHijo != subautomata_mostrado and posNodo != posSub->ListaElementosSub.end())
+			posNodo++;
+
+		//Ponemos a 0 el hijo del estado que tenia como hijo al subautomata que se ha borrado.
+		posNodo->idHijo = 0;
+
+		change_item_color(posNodo->item, 3);
+
+		posSub = ListaSubAutomatas.begin();
+
+		while (posSub->idSub != sub_a_mostrar and posSub != ListaSubAutomatas.end())
+			posSub++;
+
+		mostrar_subautomata(sub_a_mostrar);
+
+		ListaElementos.clear();
+		ListaTransiciones.clear();
+
+		//Cargamos el nivel que vamos a mostrar
+		ListaElementos = posSub->ListaElementosSub;		
+		ListaTransiciones = posSub->ListaTransicionesSub;
+		tiempoIteracion = posSub->tiempoIteracionSub;
+		variables = posSub->variablesSub;
+		funciones = posSub->funcionesSub;
+		imp = posSub->impSub;
+
+	}
+
+	actualizar_tree_view();	
+
+	if (expandir){ //Solo hacemos la expansion si no hemos hecho doble click en el raiz
+		
+		gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view), arbolPath);
+	}
+
+}
+
+static GtkWidget *
+create_view_and_model (void)
+{
+  GtkTreeViewColumn *col;
+  GtkCellRenderer *renderer;
+  GtkWidget *view;
+  GtkTreeModel *model;
+
+  view = gtk_tree_view_new();
+
+  col = gtk_tree_view_column_new();
+  //gtk_tree_view_column_set_title(col, (const gchar *)nombreEsquema);
+  gtk_tree_view_append_column(GTK_TREE_VIEW(view), col);
+
+  renderer = gtk_cell_renderer_text_new();
+  gtk_tree_view_column_pack_start(col, renderer, TRUE);
+  gtk_tree_view_column_add_attribute(col, renderer, 
+      "text", COLUMN);
+
+  model = create_and_fill_model();
+  gtk_tree_view_set_model(GTK_TREE_VIEW(view), model);
+  g_object_unref(model); 
+
+  g_signal_connect(view,"row-activated", (GCallback) treeview_onRowActivated, NULL);
+
+  return view;
+}
+
+void borrar_subautomata_recursivo(int sub_a_borrar){
+
+	list<tSubAut>::iterator posNodoSub;
+	list<tNodo>::iterator posEst;
+
+	posNodoSub = ListaSubAutomatas.begin();
+
+	while (posNodoSub->idSub != sub_a_borrar and posNodoSub != ListaSubAutomatas.end())
+	{
+		posNodoSub++;
+	}
+
+	posEst = posNodoSub->ListaElementosSub.begin();
+
+	while (posEst != posNodoSub->ListaElementosSub.end())
+	{
+
+		if (posEst->idHijo != 0){
+			borrar_subautomata_recursivo(posEst->idHijo);
+		}
+
+		posEst++;
+
+	}
+
+	ListaSubAutomatas.erase(posNodoSub);
+
+}
+
+
+
+int main( int argc, char *argv[])
+{
+	
+	GtkWidget *boton;
+	//GtkWidget *botonLinea;
+	//GtkWidget *botonEstado;
+	GtkWidget *botonGuardar;
+	GtkWidget *botonCargar;
+	GtkWidget *caja1;
+	GtkWidget *scrolled;
+	GtkWidget *scrolled_tree;
+	GtkWidget *separator;
+
+	GtkWidget *frame_horz;
+	GtkWidget *vbox;
+	const char * text = "Spread (espacio 40)";
+
+	/*Inicializar parametros*/
+	gtk_init(&argc, &argv);
+
+	/*######################### Creacion de menus desplegables #############################*/
+
+	menu_estado = gtk_menu_new();
+
+	nombrar_estado = gtk_menu_item_new_with_label("Rename");	
+	editar_estado = gtk_menu_item_new_with_label("Edit");
+	marcar_inicial_estado = gtk_menu_item_new_with_label("Mark as initial");	
+	copiar_estado = gtk_menu_item_new_with_label("Copy");
+	eliminar_estado = gtk_menu_item_new_with_label("Delete");		
+
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu_estado), nombrar_estado);
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu_estado), editar_estado);
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu_estado), marcar_inicial_estado);
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu_estado), copiar_estado);
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu_estado), eliminar_estado);
+
+	g_signal_connect_swapped (nombrar_estado, "activate", G_CALLBACK (on_menu_estado_nombrar), menu_estado);//Movido desde handler
+	g_signal_connect_swapped (editar_estado, "activate", G_CALLBACK (on_menu_estado_editar), menu_estado);
+	g_signal_connect_swapped (marcar_inicial_estado, "activate", G_CALLBACK (on_menu_estado_marcar_inicial), menu_estado);
+	g_signal_connect_swapped (copiar_estado, "activate", G_CALLBACK (on_menu_estado_copiar), menu_estado);
+	g_signal_connect_swapped (eliminar_estado, "activate", G_CALLBACK (on_menu_estado_eliminar), menu_estado);
+
+	gtk_widget_show (nombrar_estado);
+	gtk_widget_show (editar_estado);
+	gtk_widget_show (marcar_inicial_estado);
+	gtk_widget_show (copiar_estado);
+	gtk_widget_show (eliminar_estado);
+
+
+	menu_transicion = gtk_menu_new();
+
+	nombrar_transicion = gtk_menu_item_new_with_label("Rename");	
+	editar_transicion = gtk_menu_item_new_with_label("Edit");
+	eliminar_transicion = gtk_menu_item_new_with_label("Delete");
+
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu_transicion), nombrar_transicion);
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu_transicion), editar_transicion);
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu_transicion), eliminar_transicion);
+
+	g_signal_connect_swapped (nombrar_transicion, "activate", G_CALLBACK (on_menu_transicion_nombrar), menu_transicion);//Movido desde handler
+	g_signal_connect_swapped (editar_transicion, "activate", G_CALLBACK (on_menu_transicion_editar), menu_transicion);
+	g_signal_connect_swapped (eliminar_transicion, "activate", G_CALLBACK (on_menu_transicion_eliminar), menu_transicion);
+
+	gtk_widget_show (nombrar_transicion);
+	gtk_widget_show (editar_transicion);
+	gtk_widget_show (eliminar_transicion);
+
+
+	menu_pegar = gtk_menu_new();
+
+	pegar_estado = gtk_menu_item_new_with_label("Paste");
+
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu_pegar), pegar_estado);
+
+	g_signal_connect_swapped (pegar_estado, "activate", G_CALLBACK (on_menu_pegar), menu_pegar);
+
+	gtk_widget_show (pegar_estado);
+
+	/*####################### FIN Creacion de menus desplegables ############################*/
+
+
+  	/*Creamos Ventana*/
+	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+
+	/*Situamos la ventana en el medio*/
+	gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_NONE);
+
+	/*Ponemos tamaño a la ventana*/
+	gtk_window_set_default_size(GTK_WINDOW(window), 1024, 768);
+	gtk_window_maximize (GTK_WINDOW(window));
+	
+	/*Ponemos el titulo*/
+	gtk_window_set_title(GTK_WINDOW(window), "Default");
+
+	/*  gtk_window_set_decorated(GTK_WINDOW (window), FALSE);*/
+	gtk_widget_add_events(window, GDK_BUTTON_PRESS_MASK);
+
+	/*Accion (motion_notify_event) asignada al pulsar el boton*/
+	gtk_signal_connect(GTK_OBJECT(window), "button_press_event", GTK_SIGNAL_FUNC(coordenadas), (gpointer)botonPulsado.c_str()); 
+	gtk_signal_connect(GTK_OBJECT(window), "button_release_event", GTK_SIGNAL_FUNC(pinta_nodo), (gpointer)botonPulsado.c_str());
+	//gtk_signal_connect(GTK_OBJECT(window), "2button_press_event", GTK_SIGNAL_FUNC(pegar), NULL); 
+        gtk_signal_connect(GTK_OBJECT(window), "key-press-event", GTK_SIGNAL_FUNC(set_zoom), (gpointer)canvas);
+
+	/*Accion (gtk_main_quit) asignada al pulsar el boton X (salir)*/
+	gtk_signal_connect_object(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(gtk_main_quit), GTK_OBJECT(window));
+
+	/*Creamos el boton*/
+	botonLinea = gtk_toggle_button_new_with_label ("Transition");
+	botonEstado = gtk_toggle_button_new_with_label ("Estate");
+	botonGuardar = gtk_button_new_with_label ("Save");
+	botonCargar = gtk_button_new_with_label ("Open");
+//	botonGuardar = gtk_button_new_from_stock (GTK_STOCK_SAVE);
+//	botonCargar = gtk_button_new_from_stock (GTK_STOCK_OPEN);
+	
+	/*Al pulsar el boton, muestra las coordenadas x,y por pantalla*/
+	
+	gtk_signal_connect(GTK_OBJECT(botonLinea), "button_release_event", GTK_SIGNAL_FUNC(transicion), (gpointer)botonPulsado.c_str()); 
+	gtk_signal_connect(GTK_OBJECT(botonEstado), "button_release_event", GTK_SIGNAL_FUNC(nodo), (gpointer)0); 
+
+	gtk_signal_connect(GTK_OBJECT(botonGuardar), "released", GTK_SIGNAL_FUNC(guardar), (gpointer)0); 
+	gtk_signal_connect(GTK_OBJECT(botonCargar), "button_release_event", GTK_SIGNAL_FUNC(cargar), NULL); 
+
+	
+	gtk_container_border_width (GTK_CONTAINER (window), 25);
+
+	
+	/* ventana para tener barras de desplazamiento */
+        scrolled = gtk_scrolled_window_new(NULL, NULL);
+	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS);
+
+
+	/* canvas en modo RGB */
+        canvas = gnome_canvas_new_aa();
+	
+        gtk_container_add(GTK_CONTAINER(scrolled), canvas);
+
+        gnome_canvas_set_scroll_region(GNOME_CANVAS(canvas),
+                        0, 0, CANVAS_SIZE, CANVAS_SIZE);
+	
+	root = gnome_canvas_root(GNOME_CANVAS(canvas));
+
+	/*######################################################### AÑADIENDO TREE VIEW ##########################################################*/
+
+	/* ventana para tener barras de desplazamiento */
+    scrolled_tree = gtk_scrolled_window_new(NULL, NULL);
+	gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_tree), GTK_POLICY_ALWAYS, GTK_POLICY_ALWAYS);
+
+	tree_view = create_view_and_model();
+
+	gtk_container_add(GTK_CONTAINER(scrolled_tree), tree_view);
+
+	arbolPath = gtk_tree_path_new_first();
+
+	printf("*********************************** Profundidad del path: %d \n", gtk_tree_path_get_depth (arbolPath));
+
+	//gtk_tree_view_expand_all(GTK_TREE_VIEW(tree_view));
+
+	/*######################################################FIN DE AÑADIENDO TREE VIEW#######################################################*/
+	
+
+	/*Creamos una caja, contenemos el botons y la imagen en la caja y la caja en la ventana*/
+
+
+	caja1 = gtk_hbox_new(FALSE, 0);
+
+	separator = gtk_vseparator_new ();
+
+
+	/*Cambiar color canvas*/
+	
+	GtkWidget *frame = gtk_frame_new (NULL);
+
+	gtk_widget_set_size_request (frame, 650, 300);//el 150 era 300
+
+	gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
+
+	gtk_container_add(GTK_CONTAINER(frame), scrolled);
+
+	GtkWidget *frame_tree = gtk_frame_new (NULL);
+
+	gtk_widget_set_size_request (frame_tree, 150, 300);
+
+	gtk_container_add(GTK_CONTAINER(frame_tree), scrolled_tree);
+
+	
+	gtk_container_add(GTK_CONTAINER(caja1), frame_tree);
+
+	gtk_container_add(GTK_CONTAINER(caja1), frame);
+
+	
+	frame_horz = gtk_frame_new ("Options");
+
+
+	/* Redimensionar Frame */
+	gtk_widget_set_size_request (frame_horz,300, -1);
+
+ 	gtk_box_pack_start (GTK_BOX (caja1), frame_horz, TRUE, TRUE, 10);
+	
+
+	vbox = gtk_vbox_new (FALSE, 0);
+	gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
+ 	gtk_container_add (GTK_CONTAINER (frame_horz), vbox);
+
+	
+	text = "Navigation";
+	
+	string textAyuda = "Esto es una prueba";
+
+	/*boton = gtk_button_new_with_label ("Mover");
+	gtk_signal_connect(GTK_OBJECT(boton), "button_release_event", GTK_SIGNAL_FUNC(mover), 0); 
+	ListaBotones.push_back(boton);
+
+	boton = gtk_button_new_from_stock (GTK_STOCK_DELETE);
+	gtk_signal_connect(GTK_OBJECT(boton), "button_release_event", GTK_SIGNAL_FUNC(eliminar), 0); 
+	ListaBotones.push_back(boton);*/
+
+	
+	//###################Añadido boton Arriba
+	boton = gtk_button_new_with_label ("UP");
+	gtk_signal_connect(GTK_OBJECT(boton), "button_release_event", GTK_SIGNAL_FUNC(arriba), NULL); 
+	ListaBotones.push_back(boton);
+
+
+  	gtk_box_pack_start (GTK_BOX (vbox),
+        create_bbox (TRUE, (char *)text, 40, 85, 20, GTK_BUTTONBOX_SPREAD,(gpointer)botonLinea , (gpointer)ayuda[0].c_str()), TRUE, TRUE, 0);
+
+	ListaBotones.erase( ListaBotones.begin(), ListaBotones.end());
+	
+
+	text = "Figures";
+	
+	ListaBotones.push_back(botonLinea);
+	ListaBotones.push_back(botonEstado);
+//	boton = gtk_button_new_with_label ("Copy");
+//	boton = gtk_button_new_from_stock (GTK_STOCK_COPY);
+//	gtk_signal_connect(GTK_OBJECT(boton), "button_release_event", GTK_SIGNAL_FUNC(copiar), 0); 
+//	ListaBotones.push_back(boton);	
+
+	textAyuda  = "aa";
+  	gtk_box_pack_start (GTK_BOX (vbox),
+        create_bbox (TRUE, (char *)text, 40, 85, 20, GTK_BUTTONBOX_SPREAD,(gpointer)botonLinea, (gpointer)ayuda[1].c_str()), TRUE, TRUE, 0);
+
+	ListaBotones.erase( ListaBotones.begin(), ListaBotones.end());
+
+	text = "Save/Open";
+
+	ListaBotones.push_back(botonGuardar);
+
+	boton = gtk_button_new_with_label ("Save as");
+//	boton = gtk_button_new_from_stock (GTK_STOCK_SAVE_AS);
+	gtk_signal_connect(GTK_OBJECT(boton), "released", GTK_SIGNAL_FUNC(guardar), (gpointer)1); 
+
+	ListaBotones.push_back(boton);
+
+	ListaBotones.push_back(botonCargar);
+
+  	gtk_box_pack_start (GTK_BOX (vbox),
+        create_bbox (TRUE, (char *)text, 40, 85, 20, GTK_BUTTONBOX_SPREAD,(gpointer)botonLinea, (gpointer)ayuda[2].c_str()), TRUE, TRUE, 0);
+
+	ListaBotones.erase( ListaBotones.begin(), ListaBotones.end());
+
+/*	text = "Edicion Estados";
+
+	//Creamos el boton
+	
+	boton = gtk_button_new_with_label ("EstadoInicial");
+	gtk_signal_connect(GTK_OBJECT(boton), "button_release_event", GTK_SIGNAL_FUNC(nodo), (gpointer)1); 
+	ListaBotones.push_back(boton);
+
+	boton = gtk_button_new_with_label ("Nombrar");
+	gtk_signal_connect(GTK_OBJECT(boton), "button_release_event", GTK_SIGNAL_FUNC(nombrar), NULL); 
+	ListaBotones.push_back(boton);
+
+	boton = gtk_button_new_from_stock (GTK_STOCK_EDIT);		
+	gtk_signal_connect(GTK_OBJECT(boton), "button_release_event", GTK_SIGNAL_FUNC(editar), NULL); 
+	ListaBotones.push_back(boton);
+
+  	gtk_box_pack_start (GTK_BOX (vbox),
+        create_bbox (TRUE, (char *)text, 40, 85, 20, GTK_BUTTONBOX_SPREAD,(gpointer)botonLinea, (gpointer)ayuda[3].c_str()), TRUE, TRUE, 0);
+
+	ListaBotones.erase( ListaBotones.begin(), ListaBotones.end());
+*/
+	text = "Subautomata data";
+
+	boton = gtk_button_new_with_label ("Intefaces");
+	ListaBotones.push_back(boton);
+	gtk_signal_connect(GTK_OBJECT(boton), "button_release_event", GTK_SIGNAL_FUNC(ventana_importar), NULL);
+
+	boton = gtk_button_new_with_label ("Timer");
+	ListaBotones.push_back(boton);
+	gtk_signal_connect(GTK_OBJECT(boton), "button_release_event", GTK_SIGNAL_FUNC(ventana_timer), NULL);
+
+	boton = gtk_button_new_with_label ("Variables");
+	ListaBotones.push_back(boton);
+	gtk_signal_connect(GTK_OBJECT(boton), "button_release_event", GTK_SIGNAL_FUNC(codigo_esquema), NULL); 
+
+
+	gtk_box_pack_start (GTK_BOX (vbox),
+        create_bbox (TRUE, (char *)text, 40, 85, 20, GTK_BUTTONBOX_SPREAD,(gpointer)botonLinea, (gpointer)ayuda[4].c_str()), TRUE, TRUE, 0);
+
+	ListaBotones.erase( ListaBotones.begin(), ListaBotones.end());
+
+	text = "Code and Compile";
+
+	GtkWidget* img1= gtk_image_new_from_file("./imagenes/compilar.jpg"); 
+	boton = gtk_button_new_with_label ("Generate code");
+	gtk_button_set_image((GtkButton*)boton,img1); 
+	ListaBotones.push_back(boton);
+	gtk_signal_connect(GTK_OBJECT(boton), "button_release_event", GTK_SIGNAL_FUNC(generar_c), NULL);
+
+	boton = gtk_button_new_with_label ("Compile"); // Compilar
+	ListaBotones.push_back(boton);
+	gtk_signal_connect(GTK_OBJECT(boton), "button_release_event", GTK_SIGNAL_FUNC(compilar), NULL); 
+
+	gtk_box_pack_start (GTK_BOX (vbox),
+        create_bbox (TRUE, (char *)text, 40, 85, 20, GTK_BUTTONBOX_SPREAD,(gpointer)botonLinea, (gpointer)ayuda[4].c_str()), TRUE, TRUE, 0);
+
+	ListaBotones.erase( ListaBotones.begin(), ListaBotones.end());
+
+	gtk_container_add(GTK_CONTAINER(window), caja1);
+
+	gtk_widget_show_all(window);
+
+	//**********************************************************************Creamos el primer nodo en la lista de subautomatas
+	//**********************************************************************Habra que eliminarlo, hacer este guardado en cambios
+	//**********************************************************************de nivel o cuando se guarde el esquema.
+	reg_sub.ListaElementosSub = ListaElementos;
+	reg_sub.ListaTransicionesSub = ListaTransiciones;
+	reg_sub.idSub = idSubGlobal;
+	reg_sub.idPadre = 0;
+
+	ListaSubAutomatas.push_back(reg_sub);
+
+	idSubGlobal++;
+    //************************************************************************************************************************
+
+
+	/*Bucle*/
+	gtk_main();
+
+	return 0;
+}
+
+
+void desconectarLinea (GnomeCanvasItem *transicion, GnomeCanvasItem *estado)
+{
+	list<tNodo>::iterator pos;
+
+	list<GnomeCanvasItem *>::iterator pos2;
+
+
+				
+	pos = ListaElementos.begin();
+
+	while(pos->item != estado)
+	{
+  		pos++;
+	}
+				
+	pos2 = pos->listaAdyacentes.begin();
+
+	while((*pos2) != transicion)
+	{
+  		pos2++;
+	}
+	pos->listaAdyacentes.erase(pos2);
+
+}
+
+
+void eliminarLinea (GnomeCanvasItem *item, gpointer data)
+{
+	if ((botonPulsado == "Eliminar") || (botonPulsado == "Mover")) {
+		list<tTransicion>::iterator pos;
+
+		pos = ListaTransiciones.begin();
+
+			
+
+		while(pos != ListaTransiciones.end())
+		{
+  					pos++;
+		}
+
+		pos = ListaTransiciones.begin();
+		
+		while(pos->item != item)
+		{
+  			pos++;
+		}
+		GnomeCanvasItem * origen = pos->origen;
+	
+		GnomeCanvasItem * destino = pos->destino;
+
+		desconectarLinea (item,origen);
+				
+		desconectarLinea (item,destino);
+
+		ListaTransiciones.erase(pos);
+
+		gtk_object_destroy (GTK_OBJECT (item));
+
+	}
+}
+void
+change_item_width (gpointer data, gpointer user_data)
+{
+	gnome_canvas_item_set (GNOME_CANVAS_ITEM (data),
+			      "width_units", (double)(int)user_data,
+			       NULL);
+}
+
+static gint
+item_event_linea (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
+{
+	GList * list_items;
+	
+	switch (event->type) {
+	case GDK_2BUTTON_PRESS:
+		if ((event->button.button == 1) & (botonPulsado == "Editar")){
+			/* Cambia el color del item */	
+			cout << "Cambiar color: " << endl;	
+			id = (int)item;	
+			change_item_color (item,0);
+			new_text_windows (item,(gchar*)"transicion");
+			return TRUE;
+		}
+		break;
+	case GDK_BUTTON_PRESS:
+		if ((event->button.button == 3) & (botonPulsado == "Eliminar")){
+			eliminarLinea(item, NULL);	
+			cout << "Eliminado: " << endl;
+			return TRUE;
+		} 
+		break;
+	case GDK_ENTER_NOTIFY:
+		/* Establece la linea ancha */	
+		if (botonPulsado != "Nombrar"){	
+			list_items = GNOME_CANVAS_GROUP (item)->item_list;
+			g_list_foreach (list_items, change_item_width,  (gpointer) 3);
+		}
+		return TRUE;
+
+	case GDK_LEAVE_NOTIFY:
+		/* Establece la linea estrecha */
+		if (botonPulsado != "Nombrar"){	
+			list_items = GNOME_CANVAS_GROUP (item)->item_list;
+			g_list_foreach (list_items, change_item_width,  (gpointer) 1);
+		}
+		return TRUE;
+
+	default:
+		break;
+	}
+
+	return FALSE;
+
+}
+
+
+
+gint
+highlight_box (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
+{
+      GdkCursor *fleur;
+      static double x, y; /* used to keep track of motion coordinates */
+      double new_x, new_y;
+      double x1,x2,y1,y2;      
+      list<tTransicion>::iterator posLinea;
+      GnomeCanvasItem *origen, *destino, *arrow, *box;
+      GnomeCanvasGroup *group, *group_parent;
+      GList * list_items;
+      GtkWidget *ventana;
+      bool b;
+
+      switch (event->type) {
+      case GDK_ENTER_NOTIFY:
+            gnome_canvas_item_set (item,
+                               "fill_color", "red",
+                               NULL);
+
+            break;
+
+      case GDK_LEAVE_NOTIFY:
+            if (!(event->crossing.state & GDK_BUTTON1_MASK))
+                  gnome_canvas_item_set (item,
+                                     "fill_color_rgba", NULL,
+                                     NULL);
+            break;
+
+      case GDK_BUTTON_PRESS:
+	    		
+	    if ((event->button.button == 1) && (botonPulsado == "Nombrar")) {
+			
+			change_item_color (item,0);
+
+			ventana = comprobar_ventana_abierta (item->parent, NOMBRAR);
+		
+			if (ventana != NULL) 
+				gtk_window_present (GTK_WINDOW(ventana));
+			else{
+					ventana = new_name_windows (item->parent);
+				add_ventana (ventana, item->parent, NOMBRAR);
+			}
+			
+	    }else if (event->button.button == 1) {
+		/* Recuerda la posición inicial */			
+	    	x = event->button.x;
+	    	y = event->button.y;
+
+	    }else if (event->button.button == 3) { //*******************************añadido menu contextual con boton derecho.
+			
+			printf("Entra con boton derecho transicion\n");
+
+			gtk_menu_popup(GTK_MENU(menu_transicion),NULL,NULL,NULL,NULL,event->button.button,event->button.time);
+
+			item_menu_transicion = item;
+
+			return TRUE;
+		} 
+		break;
+
+      case GDK_MOTION_NOTIFY:
+	    //if (botonPulsado == "Mover"){
+
+		if (event->motion.state & GDK_BUTTON1_MASK) { // Si está pulsado el botón 1
+
+			botonPulsado = "Nada";
+			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(botonEstado),FALSE);
+			gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(botonLinea),FALSE);
+
+	          	fleur = gdk_cursor_new (GDK_FLEUR);
+           		 gnome_canvas_item_grab (item,
+                 	             GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+                 	             fleur,
+                  	            event->button.time);
+            		gdk_cursor_unref (fleur);
+	
+			new_x = event->motion.x;
+			new_y = event->motion.y;
+		
+			group_parent = GNOME_CANVAS_GROUP(item->parent);
+
+			list_items = group_parent->item_list;
+
+			box = (GnomeCanvasItem *) g_list_nth_data (list_items, g_list_length (list_items)-1);  
+
+			g_object_get (G_OBJECT (box), "x1", &x1, NULL);
+			g_object_get (G_OBJECT (box), "y1", &y1, NULL);
+			g_object_get (G_OBJECT (box), "x2", &x2, NULL);
+			g_object_get (G_OBJECT (box), "y2", &y2, NULL);
+
+			cout << "Puntos item: " << x1 << "," << y1 << "," << x2 << "," << y2 <<endl;
+			
+			gnome_canvas_item_set (box,
+						"x1", x1 + (new_x - x),
+                        			"y1", y1 + (new_y - y),
+                        			"x2", x2 + (new_x - x),
+                        			"y2", y2 + (new_y - y),
+                				NULL);
+
+		
+			
+			posLinea = ListaTransiciones.begin();
+
+			while((posLinea->item != GNOME_CANVAS_ITEM(group_parent) ))	//cogemos el padre (grupo) del item (box)
+			{
+					posLinea++;
+			}
+
+			origen = posLinea->origen;
+			destino = posLinea->destino;
+
+			/* Mover Item_Nombre Estado */
+			if ( posLinea->item_nombre != NULL )
+				gnome_canvas_item_move ((posLinea->item_nombre), new_x - x, new_y - y);
+			
+			/* Actualizar Posición */
+			x = new_x;
+			y = new_y;
+			
+
+			/* Eliminamos Lineas de la Transicion  Previa */
+					
+			while (g_list_length (list_items) > 1){
+			
+				arrow = (GnomeCanvasItem *) g_list_nth_data (list_items, 0);
+				list_items=g_list_next(list_items);
+				gtk_object_destroy (GTK_OBJECT (arrow));
+				
+			}
+
+
+			group = repintar_transicion (GNOME_CANVAS_GROUP (item->canvas->root), origen, destino, (x1+x2)/2, (y1+y2)/2);		
+
+			gnome_canvas_item_reparent (box, group);
+
+			b = cambiar_item_transicion (GNOME_CANVAS_ITEM (group_parent), GNOME_CANVAS_ITEM (group));
+
+			cambiar_item_adyacentes (origen, GNOME_CANVAS_ITEM (group_parent), GNOME_CANVAS_ITEM (group));
+
+			cambiar_item_adyacentes (destino, GNOME_CANVAS_ITEM (group_parent), GNOME_CANVAS_ITEM (group));
+		}
+
+	    //}
+            break;
+      case GDK_BUTTON_RELEASE:
+            gnome_canvas_item_ungrab (item, event->button.time);
+
+	    if ((event->button.button == 1) & (botonPulsado == "Eliminar"))
+	    {
+		group_parent = GNOME_CANVAS_GROUP(item->parent);
+		
+		eliminar_nombre(GNOME_CANVAS_ITEM(group_parent));
+		
+		t_eliminar_transicion_lista (GNOME_CANVAS_ITEM(group_parent));
+		
+		gtk_object_destroy (GTK_OBJECT (group_parent));
+
+	    }
+	    else if ((event->button.button == 1) & (botonPulsado == "Mover")) 
+			 gnome_canvas_item_ungrab (item, event->button.time);
+            break;
+      case GDK_2BUTTON_PRESS:
+	    if ((event->button.button == 1) & (botonPulsado == "Editar")){
+
+		/* Cambia el color del item */	
+	    	change_item_color (item,0);
+
+			ventana = comprobar_ventana_abierta (item->parent, EDITAR);
+		
+			if (ventana != NULL) 
+				gtk_window_present (GTK_WINDOW(ventana));
+			else{
+					ventana = new_text_windows (item->parent ,(gchar*)"transicion");
+				add_ventana (ventana, item->parent, EDITAR);
+			}
+	    }
+	    break;
+
+      default:
+            break;
+      }
+
+      return FALSE;
+}
+
+gint
+highlight_box_edit (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
+{
+      static double x, y; /* used to keep track of motion coordinates */
+      list<tTransicion>::iterator posLinea;
+      GnomeCanvasGroup *group_parent;
+      GtkWidget *ventana;
+
+      switch (event->type) {
+      case GDK_ENTER_NOTIFY:
+            gnome_canvas_item_set (item,
+                               "fill_color", "red",
+                               NULL);
+
+            break;
+
+      case GDK_LEAVE_NOTIFY:
+            if (!(event->crossing.state & GDK_BUTTON1_MASK))
+                  gnome_canvas_item_set (item,
+                                     "fill_color_rgba", NULL,
+                                     NULL);
+            break;
+
+      case GDK_BUTTON_PRESS:
+	    		
+	    if ((event->button.button == 1) && (botonPulsado == "Nombrar")) {
+			
+		change_item_color (item,0);
+
+		ventana = comprobar_ventana_abierta (item->parent, NOMBRAR);
+		
+		if (ventana != NULL) 
+			gtk_window_present (GTK_WINDOW(ventana));
+		else{
+	    		ventana = new_name_windows (item->parent);
+			add_ventana (ventana, item->parent, NOMBRAR);
+		}
+			
+	    }else if (event->button.button == 1) {
+		/* Recuerda la posición inicial */			
+	    	x = event->button.x;
+	    	y = event->button.y;
+
+	    }else if (event->button.button == 3) { //*******************************añadido menu contextual con boton derecho.
+			
+			printf("Entra con boton derecho autotransicion\n");
+
+			gtk_menu_popup(GTK_MENU(menu_transicion),NULL,NULL,NULL,NULL,event->button.button,event->button.time);
+
+			item_menu_transicion = item;
+
+			return TRUE;
+		} 
+            break;
+      case GDK_MOTION_NOTIFY:
+	   
+            break;
+      case GDK_BUTTON_RELEASE:
+            gnome_canvas_item_ungrab (item, event->button.time);
+
+	    if ((event->button.button == 1) & (botonPulsado == "Eliminar"))
+	    {
+		group_parent = GNOME_CANVAS_GROUP(item->parent);
+
+		eliminar_nombre(GNOME_CANVAS_ITEM(group_parent));
+
+		t_eliminar_transicion_lista (GNOME_CANVAS_ITEM(group_parent));
+		
+		gtk_object_destroy (GTK_OBJECT (group_parent));
+
+	    }
+	   
+            break;
+      case GDK_2BUTTON_PRESS:
+	    if ((event->button.button == 1) & (botonPulsado == "Editar")){
+
+		/* Cambia el color del item */	
+	    	change_item_color (item,0);
+
+		ventana = comprobar_ventana_abierta (item->parent, EDITAR);
+		
+		if (ventana != NULL) 
+			gtk_window_present (GTK_WINDOW(ventana));
+		else{
+	    		ventana = new_text_windows (item->parent ,(gchar*)"transicion");
+			add_ventana (ventana, item->parent, EDITAR);
+		}
+	    }
+	    break;
+
+      default:
+            break;
+      }
+
+      return FALSE;
+}
+
+static gint
+box_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
+{
+
+      if ((event->type != GDK_MOTION_NOTIFY) || !(event->motion.state & GDK_BUTTON1_MASK))
+            return FALSE;
+
+      return FALSE;
+}
+
+void
+create_drag_box (GnomeCanvasGroup *group, char *box_name, double x1, double y1, GCallback callback)
+{
+	GnomeCanvasItem *box;
+
+	box = gnome_canvas_item_new (group,
+                             gnome_canvas_rect_get_type (),
+                             "fill_color", NULL,
+                             "outline_color", "black",
+                             "width_pixels", 0,
+                             NULL);
+ 
+	gnome_canvas_item_set (box,
+                         "x1", x1 - 3,
+                         "y1", y1 - 3,
+                         "x2", x1 + 3,
+                         "y2", y1 + 3,
+                         NULL);
+
+	g_signal_connect (box, "event",
+                    callback,
+                    NULL);
+
+	g_object_set_data (G_OBJECT (group), box_name, box);
+}
+
+/***** Pintar Transicion *****/
+/* modo indica si la transición existe y se repinta la transicion o no existe y se pinta una transición nueva  */
+GnomeCanvasItem *
+pinta_transicion (GnomeCanvasItem *origen, GnomeCanvasItem *destino)
+{
+	GnomeCanvasPoints *pointsPoligono = gnome_canvas_points_new (2);
+	GnomeCanvasGroup *group;
+	GnomeCanvasItem *item1, *item2;
+	
+
+	// Puntos del orgien
+	double I1x1;
+	double I1x2;
+	double I1y1;
+	double I1y2;
+				
+//	gnome_canvas_item_get_bounds (origen,&I1x1,&I1y1,&I1x2,&I1y2);
+	g_object_get (G_OBJECT (origen), "x1", &I1x1, NULL);
+	g_object_get (G_OBJECT (origen), "y1", &I1y1, NULL);
+	g_object_get (G_OBJECT (origen), "x2", &I1x2, NULL);
+	g_object_get (G_OBJECT (origen), "y2", &I1y2, NULL);
+
+	printf("origen, x1: %f, y1: %f, x2: %f, y2: %f \n", I1x1, I1y1, I1x2, I1y2);
+				
+	/* Resolver desequilibrio */
+			
+	I1x1 += 1.5;
+	I1y1 += 1.5;
+	I1x2 -= 1.5;
+	I1y2 -= 1.5;
+	
+	// Puntos del destino
+	double I2x1;
+	double I2x2;
+	double I2y1;
+	double I2y2;
+				
+//	gnome_canvas_item_get_bounds (destino,&I2x1,&I2y1,&I2x2,&I2y2);
+	g_object_get (G_OBJECT (destino), "x1", &I2x1, NULL);
+	g_object_get (G_OBJECT (destino), "y1", &I2y1, NULL);
+	g_object_get (G_OBJECT (destino), "x2", &I2x2, NULL);
+	g_object_get (G_OBJECT (destino), "y2", &I2y2, NULL);
+	printf("destino, x1: %f, y1: %f, x2: %f, y2: %f \n", I2x1, I2y1, I2x2, I2y2);
+				
+	/* Resolver desequilibrio */
+			
+	I2x1 += 1.5;
+	I2y1 += 1.5;
+	I2x2 -= 1.5;
+	I2y2 -= 1.5;
+
+	//Punto medio circulo origen
+	double Xm1 = ((I1x2 + I1x1) / 2);
+	double Ym1 = ((I1y2 + I1y1) / 2);
+	punto pCirculoOrigen = crear_punto (Xm1, Ym1);
+
+	//Punto medio circulo destino
+	double Xm2 = ((I2x2 + I2x1) / 2);
+	double Ym2 = ((I2y2 + I2y1) / 2);
+	punto pCirculoDestino = crear_punto (Xm2, Ym2);
+
+	// Ecuacion Recta Ax + By + C =0 
+	recta recta_origen_destino = crear_recta (pCirculoOrigen, pCirculoDestino);
+
+	// Ecuacion Recta Perpendicular que pasa por el punto medio del circulo origen
+	recta recta_perpendicular_circulo_origen = recta_perpendicular (recta_origen_destino, pCirculoOrigen);
+
+
+	// Ecuacion Recta Paralela1	d=(ax+by+c)/(a^2 + b^2)^1/2
+	recta recta_paralela1 = recta_paralela (recta_perpendicular_circulo_origen, pCirculoOrigen, -20);
+
+	// Intersecciones 1 entre recta perpendicular y paralela
+	double YI1;
+	double XI1;
+
+	punto pInterseccion = interseccion_rectas (recta_origen_destino, recta_paralela1);
+	punto_get_values (pInterseccion, &XI1, &YI1);
+
+	// Ecuacion Recta Perpendicular que pasa por el punto medio del circulo destino
+	recta recta_perpendicular_circulo_destino = recta_perpendicular (recta_origen_destino, pCirculoDestino);
+
+	// Ecuacion Recta Paralela2
+	recta_paralela1 = recta_paralela (recta_perpendicular_circulo_origen, pCirculoDestino, 20);
+
+	// Intersecciones 2
+	double YI2;
+	double XI2;
+	pInterseccion = interseccion_rectas (recta_origen_destino, recta_paralela1);
+	punto_get_values (pInterseccion, &XI2, &YI2);
+
+	GnomeCanvas *canvas = origen->canvas;
+
+	group = GNOME_CANVAS_GROUP (gnome_canvas_item_new (GNOME_CANVAS_GROUP(canvas->root),  
+                                        gnome_canvas_group_get_type (),
+                                        "x", 0,
+                                        "y", 0,
+                                        NULL));
+	double pMedioX, pMedioY;
+	// Punto medio de la recta que uno los estados
+	punto pMedioRecta = punto_medio (pCirculoOrigen, pCirculoDestino);
+	punto_get_values (pMedioRecta, &pMedioX, &pMedioY);
+
+	pointsPoligono->coords[0] = XI1;
+	pointsPoligono->coords[1] = YI1;
+	pointsPoligono->coords[2] = pMedioX;
+	pointsPoligono->coords[3] = pMedioY;
+
+	item1 = gnome_canvas_item_new(group, gnome_canvas_line_get_type (),
+                	"points", pointsPoligono,
+			"fill_color", "orange", 
+			"width_units", 1.0,
+			NULL);
+
+	pointsPoligono->coords[0] = pMedioX;
+	pointsPoligono->coords[1] = pMedioY;
+	pointsPoligono->coords[2] = XI2;
+	pointsPoligono->coords[3] = YI2;
+
+
+	item2 = gnome_canvas_item_new(group, gnome_canvas_line_get_type (),
+                	"points", pointsPoligono,
+			"fill_color", "orange", 
+			"width_units", 1.0,  
+            "last_arrowhead", TRUE,
+			"arrow_shape_a", 8.0, 
+			"arrow_shape_b", 8.0,
+			"arrow_shape_c", 8.0, 
+			NULL);
+
+	gnome_canvas_points_free (pointsPoligono);
+
+	printf("pMedioX: %f, pMedioY: %f \n", pMedioX, pMedioY);
+
+	create_drag_box (group, (char *)"box", pMedioX, pMedioY, G_CALLBACK (highlight_box));
+
+	return GNOME_CANVAS_ITEM(group);
+
+}
+
+
+/* Llamada para la señales de eventos de los items del canvas. Si el
+ * usuario arrastra el item con el botón 1, esté se moverá en consecuencia.
+ * Si el usuario hace doble click sobre el item, su color cambiará
+ * aleatoriamente. Si el usuario pulsa el botón 3 sobre un item, entoces 
+ * el item será destruido. 
+ * Cuando el puntero del ratón entra en un item, su ancho de linea se
+ * establece a 3 unidades.
+ * Cuando el puntero del ratón abandona un item, su ancho de linea se 
+ * reestablece a 1 unidad.
+ */
+
+
+gint
+item_event (GnomeCanvasItem *item_group, GdkEvent *event, gpointer data)
+{
+	//static double x, y; /* used to keep track of motion coordinates */
+	//double new_x, new_y;
+	
+	GdkCursor *fleur; /* Usado para cambiar el dibujo del cursor */
+
+	GnomeCanvasItem *item, *item2, *item_transicion;
+	GnomeCanvasGroup *group;
+	GtkWidget *ventana;
+	
+	list<tTransicion>::iterator posLinea;
+	list<tNodo>::iterator posNodo;
+	list<tSubAut>::iterator posNodoSub;
+	list<GnomeCanvasItem *>::iterator posAdy;
+	list<GnomeCanvasItem *>::iterator posAux;
+
+	int idHijo_aux;
+
+	static gboolean dragging = FALSE;
+	double event_x = event->button.x;
+	double event_y = event->button.y;
+	static double previous_x, previous_y;
+
+	int idPath=0;
+				
+	aux ln;
+
+	list <aux> ListaAux;
+	
+	list<aux>::iterator posRec;
+	
+	item = (GnomeCanvasItem *)g_list_nth_data (GNOME_CANVAS_GROUP(item_group)->item_list, 0);  
+
+	switch (event->type) {
+
+	case GDK_2BUTTON_PRESS:
+		/*if ((event->button.button == 1) & (botonPulsado == "Editar")){
+			
+			// Cambia el color del item
+			change_item_color (item,0);
+
+			ventana = comprobar_ventana_abierta (item, EDITAR);
+		
+			if (ventana != NULL) 
+				gtk_window_present (GTK_WINDOW(ventana));
+			else{
+	    			ventana = new_text_windows (item ,(gchar*)"estado");
+				add_ventana (ventana, item, EDITAR);
+			}
+			
+			return TRUE;
+		}*/
+		printf("Doble click en item.\n");
+
+		posNodo = ListaElementos.begin();
+	
+		while (posNodo->item != item and posNodo != ListaElementos.end())
+		{
+			posNodo++;
+			idPath++;
+		}
+
+		idHijo_aux = posNodo->idHijo;
+
+
+		posNodoSub = ListaSubAutomatas.begin();
+		
+		while (posNodoSub->idSub != subautomata_mostrado and posNodoSub != ListaSubAutomatas.end())
+			posNodoSub++;
+
+		/* Gestion para navegacion en el tree view */
+
+		if (posNodoSub->idPadre == 0){	
+			printf("idPath: %d \n", idPath);	
+			gtk_tree_path_free (arbolPath);	
+			arbolPath = gtk_tree_path_new_from_string ((const char*)int2string(idPath).c_str());
+			printf("Path con padre = 0 -- %s \n", gtk_tree_path_to_string (arbolPath));
+		}
+		else{
+			gtk_tree_path_append_index (arbolPath, idPath);
+			printf("Path con padre <> 0 -- %s \n", gtk_tree_path_to_string (arbolPath));
+		}		
+
+		/* FIN Gestion para navegacion en el tree view */
+
+		if (idHijo_aux != 0){
+
+			gnome_canvas_item_set (item,			       
+			"fill_color", "green", // 0x00ff66ff,
+	     		NULL);
+			gnome_canvas_update_now (GNOME_CANVAS(canvas));
+
+			posNodoSub = ListaSubAutomatas.begin();
+		
+			while (posNodoSub->idSub != subautomata_mostrado and posNodoSub != ListaSubAutomatas.end())
+				posNodoSub++;
+			
+			//Guardamos el nivel actual
+			posNodoSub->ListaElementosSub = ListaElementos;		
+			posNodoSub->ListaTransicionesSub = ListaTransiciones;
+			posNodoSub->tiempoIteracionSub = tiempoIteracion;
+			posNodoSub->variablesSub = variables;
+			posNodoSub->funcionesSub = funciones;
+			posNodoSub->impSub = imp;
+
+			ocultar_subautomata(subautomata_mostrado);
+
+			posNodoSub = ListaSubAutomatas.begin();
+		
+			while (posNodoSub->idSub != idHijo_aux and posNodoSub != ListaSubAutomatas.end())
+				posNodoSub++;
+
+			mostrar_subautomata(posNodo->idHijo);
+
+			ListaElementos.clear();
+			ListaTransiciones.clear();
+
+			//Cargamos el nivel que vamos a mostrar
+			ListaElementos = posNodoSub->ListaElementosSub;		
+			ListaTransiciones = posNodoSub->ListaTransicionesSub;
+			tiempoIteracion = posNodoSub->tiempoIteracionSub;
+			variables = posNodoSub->variablesSub;
+			funciones = posNodoSub->funcionesSub;
+			imp = posNodoSub->impSub;			
+			
+		}
+		else{
+			
+			posNodo->idHijo = idSubGlobal;
+			printf("id del hijo creado : %d \n", posNodo->idHijo);
+
+			gnome_canvas_item_set (item,			       
+			"fill_color", "green", // 0x00ff66ff,
+	     		NULL);
+			gnome_canvas_update_now (GNOME_CANVAS(canvas));
+
+			posNodoSub = ListaSubAutomatas.begin();
+		
+			while (posNodoSub->idSub != subautomata_mostrado and posNodoSub != ListaSubAutomatas.end())
+				posNodoSub++;
+
+			//Guardamos el nivel actual
+			posNodoSub->ListaElementosSub = ListaElementos;		
+			posNodoSub->ListaTransicionesSub = ListaTransiciones;
+			posNodoSub->tiempoIteracionSub = tiempoIteracion;
+			posNodoSub->variablesSub = variables;
+			posNodoSub->funcionesSub = funciones;
+			posNodoSub->impSub = imp;
+			ocultar_subautomata(subautomata_mostrado);
+
+			ListaElementos.clear();
+			ListaTransiciones.clear();
+
+			tSubAut sub_aux;
+			
+			sub_aux.ListaElementosSub = ListaElementos;
+			sub_aux.ListaTransicionesSub = ListaTransiciones;
+			sub_aux.tiempoIteracionSub = 100;	
+			sub_aux.variablesSub = "";
+			sub_aux.funcionesSub = "";
+			sub_aux.impSub.laser= FALSE;
+			sub_aux.impSub.motor= FALSE;
+			sub_aux.impSub.radar= FALSE;
+			sub_aux.impSub.encoders= FALSE;
+			sub_aux.impSub.lat_lon= FALSE;
+			sub_aux.impSub.camara= FALSE;
+			sub_aux.impSub.ptencoders= FALSE;
+			sub_aux.idSub = idSubGlobal;
+			sub_aux.idPadre = subautomata_mostrado;
+
+			ListaSubAutomatas.push_back(sub_aux);
+
+			posNodoSub = ListaSubAutomatas.begin();
+		
+			while (posNodoSub->idSub != idSubGlobal and posNodoSub != ListaSubAutomatas.end())
+				posNodoSub++;
+
+			//Cargamos el nivel que vamos a mostrar
+			ListaElementos = posNodoSub->ListaElementosSub;		
+			ListaTransiciones = posNodoSub->ListaTransicionesSub;
+			tiempoIteracion = posNodoSub->tiempoIteracionSub;
+			variables = posNodoSub->variablesSub;
+			funciones = posNodoSub->funcionesSub;
+			imp = posNodoSub->impSub;
+			//mostrar_subautomata(idSubGlobal);
+			subautomata_mostrado = idSubGlobal;
+			
+			idSubGlobal++;
+		}
+
+		actualizar_tree_view();
+		gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view), arbolPath);
+
+		break;
+
+	case GDK_BUTTON_RELEASE:
+
+		 //if ((event->button.button == 1) && dragging /*&& (botonPulsado == "Mover")*/) 
+			 gnome_canvas_item_ungrab (item, event->button.time);
+			 dragging = FALSE;
+		
+		break;
+
+	case GDK_BUTTON_PRESS:
+
+		dragging = TRUE;
+		previous_x = event_x;
+		previous_y = event_y;
+		
+		if ((event->button.button == 1) && (botonPulsado == "EstadoInicial")) {
+
+			marcar_estado_inicial (item);
+		}
+		/*Pintamos Linea*/
+		else if ((event->button.button == 1) && (botonPulsado == "Linea")) {
+			
+			if (item_transicion_saved == NULL){
+
+				item_transicion_saved=item;		//Si es en el primer item que pulsamos lo guardamos
+				
+				break;
+			}
+			else if(item != item_transicion_saved)		//Si es en el segundo item que pulsamos y es distinto que el primero
+			{		
+				/* Cogemos los dos item pulsados, congemos sus puntos (coordenadas)
+				   miranos que puntos tienen menor distancia.
+				   pintamos una recta con esos puntos
+				*/
+			
+				item2 = pinta_transicion (item_transicion_saved, item);
+				
+			}else if(item == item_transicion_saved){
+			
+				item2 = pinta_autotransicion (item);			
+				
+			}
+			gnome_canvas_update_now (GNOME_CANVAS(canvas));
+
+			g_object_set_data (G_OBJECT (item2), "id", (void*)(int)item2);
+
+			// Guardamos que elementos conecta la linea
+			tTransicion l;
+			l.item = item2;
+			l.origen = item_transicion_saved;
+			l.destino = item;
+			l.codigo = codigo;
+			l.tiempo = tiempo;
+			l.item_nombre = NULL;
+			l.nombre = "";
+			ListaTransiciones.push_back(l);
+	
+
+			// Guardamos en los elementos, las lineas que tienen conectadas.
+			list<tNodo>::iterator pos;
+	
+			pos = ListaElementos.begin();
+
+			while(pos->item != item_transicion_saved)
+				pos++;
+			pos->listaAdyacentes.push_back(item2);
+		
+			if(item != item_transicion_saved){
+				pos = ListaElementos.begin();
+
+				while(pos->item != item)
+					pos++;
+		
+				pos->listaAdyacentes.push_back(item2);
+			}
+			
+			item_transicion_saved = NULL;
+
+		}
+		else if ((event->button.button == 1) && (botonPulsado == "Nombrar")) {
+			
+
+			change_item_color (item,0);
+	
+			ventana = comprobar_ventana_abierta (item, NOMBRAR);
+		
+			if (ventana != NULL) 
+				gtk_window_present (GTK_WINDOW(ventana));
+			else{
+	    		ventana = new_name_windows (item);
+				add_ventana (ventana, item, NOMBRAR);
+			}
+			
+			return TRUE;
+
+		}else if ((event->button.button == 1) && (botonPulsado == "Copiar")) {
+		
+			
+			cout << "Copiando: " << endl;
+			
+			double x1,x2,y1,y2;
+
+			g_object_get (G_OBJECT (item), "x1", &x1, NULL);
+			g_object_get (G_OBJECT (item), "y1", &y1, NULL);
+			g_object_get (G_OBJECT (item), "x2", &x2, NULL);
+			g_object_get (G_OBJECT (item), "y2", &y2, NULL);
+			
+			group = GNOME_CANVAS_GROUP (gnome_canvas_item_new (root,  
+                                        gnome_canvas_group_get_type (),
+                                        "x", 0,
+                                        "y", 0,
+                                        NULL));
+	
+			item2 = gnome_canvas_item_new(group,
+                        	gnome_canvas_ellipse_get_type(),
+                        	"x1", x1+50,
+                        	"x2", x2+50,
+                        	"y1", y1,
+                        	"y2", y2,
+                        	"fill_color_rgba", 0x00ffffff,
+                        	"outline_color", "black",
+                        	"width_units", 1.0,
+                        	NULL);
+
+			copiar_nodo (item, item2);
+
+			g_signal_connect (group, "event",
+			    (GtkSignalFunc) item_event,
+			    NULL);
+
+
+			return TRUE;
+
+		} else if ((event->button.button == 3) & (botonPulsado == "Eliminar")){
+			
+			/* Destruye el item */			
+			
+			// Eliminar Transiciones
+			posNodo = ListaElementos.begin();
+
+			while((posNodo->item != item) & ( posNodo != ListaElementos.end() ))
+  				posNodo++;
+
+			
+			if (posNodo != ListaElementos.end()) {
+			
+				posAdy = posNodo->listaAdyacentes.begin();
+
+				while(posAdy != (posNodo->listaAdyacentes.end()))
+				{
+
+					posAux = posAdy;			
+
+					posAdy++;
+
+					eliminar_nombre(*posAux);
+					t_eliminar_transicion_lista (*posAux);	
+
+					gtk_object_destroy (GTK_OBJECT (*posAux));	
+  				
+				}
+
+ 				ListaElementos.erase(posNodo);
+
+				cout << (int)*(posNodo->listaAdyacentes.begin()) << endl;
+
+				gtk_object_destroy (GTK_OBJECT (item_group));
+			}
+
+			
+
+			cout << "Eliminado: " << endl;
+			return TRUE;
+		} 
+
+		else if ((event->button.button == 1) & (botonPulsado == "Editar")){//********************añadido evento editar con click simple
+			
+			// Cambia el color del item
+			change_item_color (item,0);
+
+			ventana = comprobar_ventana_abierta (item, EDITAR);
+		
+			if (ventana != NULL) 
+				gtk_window_present (GTK_WINDOW(ventana));
+			else{
+	    		ventana = new_text_windows (item ,(gchar*)"estado");
+				add_ventana (ventana, item, EDITAR);
+			}
+			
+			return TRUE;
+		}
+
+		else if (event->button.button == 3) { //*******************************añadido menu contextual con boton derecho.
+			
+			printf("Entra con boton derecho estado\n");
+
+			gtk_menu_popup(GTK_MENU(menu_estado),NULL,NULL,NULL,NULL,event->button.button,event->button.time);
+
+			item_menu_estado = item;
+			item_group_menu_estado = item_group;
+
+			return TRUE;
+		} 
+		break;
+
+	
+	case GDK_MOTION_NOTIFY:
+		
+		//if (botonPulsado == "Mover"){
+		if (estado_nombrado){
+
+			actualizar_tree_view();
+			
+			if (subautomata_mostrado != 1)
+				gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view), arbolPath);
+			
+			estado_nombrado=FALSE;
+		}
+
+			if ((event->motion.state & GDK_BUTTON1_MASK) && dragging) { // Si está pulsado el botón 1
+				//Para eliminar el efecto de cualquier posible boton puslado
+
+				botonPulsado = "Nada";
+				gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(botonEstado),FALSE);
+				gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(botonLinea),FALSE);
+
+				/* cambiar la imagen del cursor*/
+				fleur = gdk_cursor_new (GDK_FLEUR);
+				/*gnome_canvas_item_grab (item,
+                              		GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK,
+                              		fleur,
+                              		event->button.time);*/
+   				gnome_canvas_item_grab(item,GDK_POINTER_MOTION_MASK | GDK_BUTTON_RELEASE_MASK, fleur, event->button.time);				
+            			gdk_cursor_unref (fleur);
+
+
+
+				/*gnome_canvas_item_move(item, event_x - previous_x,
+        			event_y - previous_y);*/
+
+				/* Obten la nueva posición y muevete por la
+				 * diferencia  */
+				
+				/*new_x = event->motion.x;
+				new_y = event->motion.y;*/
+
+				double x1,x2,y1,y2;
+				g_object_get (G_OBJECT (item), "x1", &x1, NULL);
+				g_object_get (G_OBJECT (item), "y1", &y1, NULL);
+				g_object_get (G_OBJECT (item), "x2", &x2, NULL);
+				g_object_get (G_OBJECT (item), "y2", &y2, NULL);
+
+				/*cout << "Puntos item: " << x1 << "," << y1 << "," << x2 << "," << y2 <<endl;
+				
+				gnome_canvas_item_set (item,
+							"x1", x1 + (new_x - x),
+                         				"y1", y1 + (new_y - y),
+                         				"x2", x2 + (new_x - x),
+                         				"y2", y2 + (new_y - y),
+                        				NULL);*/
+
+				gnome_canvas_item_set (item,
+							"x1", x1 + (event_x - previous_x),
+                         				"y1", y1 + (event_y - previous_y),
+                         				"x2", x2 + (event_x- previous_x),
+                         				"y2", y2 + (event_y- previous_y),
+                        				NULL);
+
+			
+				/* Mover Item_Nombre Estado */
+				posNodo = ListaElementos.begin();
+
+				while((posNodo->item != item))
+				{
+  					posNodo++;
+				}
+				
+				if ( posNodo->item_nombre != NULL )
+					gnome_canvas_item_move ((posNodo->item_nombre), event_x - previous_x, event_y - previous_y);
+
+				if ( posNodo->estado_inicial != NULL )
+					gnome_canvas_item_move ((posNodo->estado_inicial), event_x - previous_x, event_y - previous_y);
+			
+					
+				/* Repintar Transiciones */
+				posAdy = posNodo->listaAdyacentes.begin();
+
+				
+				while(posAdy != (posNodo->listaAdyacentes.end()))
+				{
+					
+					posLinea = ListaTransiciones.begin();
+
+					while(posLinea->item != (*posAdy))
+  						posLinea++;
+								
+				
+					posAdy++;
+
+					GnomeCanvasItem * origen;
+
+					GnomeCanvasItem * destino;
+					
+					if ( posLinea->origen == posLinea->destino ){
+						gnome_canvas_item_move ((posLinea->item), event_x - previous_x, event_y - previous_y);
+						if (posLinea->nombre.compare("") != 0)
+							gnome_canvas_item_move ((posLinea->item_nombre), event_x - previous_x, event_y - previous_y);
+					}	
+					else if ( posLinea->origen == item)
+					{	
+
+						origen = item;
+						destino = posLinea->destino;
+
+						item_transicion = (GnomeCanvasItem *) repintar_transicion_nodo (root, posLinea->item, item, (char *)"origen");
+				
+					} 
+					else
+					{
+						origen = posLinea->origen;
+						destino = item;
+						item_transicion = (GnomeCanvasItem *) repintar_transicion_nodo (root, posLinea->item, item, (char *)"destino");
+					}
+					
+				}
+
+				/* Actualizar Posición */
+				//x = new_x;
+				//y = new_y;
+
+				previous_x = event_x;
+      			previous_y = event_y;
+				
+				return TRUE;
+			}
+
+		//}
+		break;
+
+	case GDK_ENTER_NOTIFY:
+		/* Establece la linea ancha */	
+		gnome_canvas_item_set (item,
+			       "width_units", 3.0,
+			       NULL);
+		return TRUE;
+
+	case GDK_LEAVE_NOTIFY:
+		/* Establece la linea estrecha */
+		gnome_canvas_item_set (item,
+			       "width_units", 1.0,
+			       NULL);
+		return TRUE;
+
+	default:
+		break;
+	}
+
+	return FALSE;
+}
+
+
+void on_menu_estado_nombrar(){
+
+	GtkWidget *ventana;
+
+	change_item_color (item_menu_estado,0);
+
+	ventana = comprobar_ventana_abierta (item_menu_estado, NOMBRAR);
+
+	if (ventana != NULL) 
+	{
+		gtk_window_present (GTK_WINDOW(ventana));
+	}
+	else{
+		ventana = new_name_windows (item_menu_estado);
+		add_ventana (ventana, item_menu_estado, NOMBRAR);
+	}	
+
+	estado_nombrado = TRUE;	
+
+}
+
+void 
+on_menu_estado_editar(){
+
+	GtkWidget *ventana;
+
+	change_item_color (item_menu_estado,0);
+
+	ventana = comprobar_ventana_abierta (item_menu_estado, EDITAR);
+
+	if (ventana != NULL) 
+		gtk_window_present (GTK_WINDOW(ventana));
+	else{
+		ventana = new_text_windows (item_menu_estado ,(gchar*)"estado");
+		add_ventana (ventana, item_menu_estado, EDITAR);
+	}
+
+}
+
+void 
+on_menu_estado_marcar_inicial(){
+
+	marcar_estado_inicial (item_menu_estado);
+
+}
+
+void 
+on_menu_estado_copiar(){
+
+	list<tNodo>::iterator posNodo;
+
+	posNodo = ListaElementos.begin();
+
+	while((posNodo->item != item_menu_estado) & ( posNodo != ListaElementos.end() ))
+		posNodo++;
+
+	estado_clipboard = TRUE;
+	estado_clipboard_codigo = posNodo->codigo;
+	estado_clipboard_idHijo = posNodo->idHijo;
+
+}
+
+void 
+on_menu_estado_eliminar(){
+	
+	list<tNodo>::iterator posNodo;
+	list<GnomeCanvasItem *>::iterator posAdy;
+	list<GnomeCanvasItem *>::iterator posAux;
+
+
+	/* Destruye el item */			
+			
+	// Eliminar Transiciones
+	posNodo = ListaElementos.begin();
+
+	while((posNodo->item != item_menu_estado) & ( posNodo != ListaElementos.end() ))
+		posNodo++;
+
+	
+	if (posNodo != ListaElementos.end()) {
+	
+		posAdy = posNodo->listaAdyacentes.begin();
+
+		while(posAdy != (posNodo->listaAdyacentes.end()))
+		{
+
+			posAux = posAdy;			
+
+			posAdy++;
+
+			eliminar_nombre(*posAux);
+			t_eliminar_transicion_lista (*posAux);	
+
+			gtk_object_destroy (GTK_OBJECT (*posAux));	
+		
+		}
+
+		if (posNodo->idHijo != 0){
+			borrar_subautomata_recursivo(posNodo->idHijo);
+		}
+
+		ListaElementos.erase(posNodo);
+
+		cout << (int)*(posNodo->listaAdyacentes.begin()) << endl;
+
+		gtk_object_destroy (GTK_OBJECT (item_group_menu_estado));
+	}
+
+	
+
+	cout << "Eliminado: " << endl;
+
+	actualizar_tree_view();
+		
+	gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view), arbolPath);
+
+}
+
+
+void 
+on_menu_transicion_nombrar(){
+
+	GtkWidget *ventana;
+
+	change_item_color (item_menu_transicion,0);
+
+	ventana = comprobar_ventana_abierta (item_menu_transicion->parent, NOMBRAR);
+
+	if (ventana != NULL) 
+		gtk_window_present (GTK_WINDOW(ventana));
+	else{
+		ventana = new_name_windows (item_menu_transicion->parent);
+		add_ventana (ventana, item_menu_transicion->parent, NOMBRAR);
+	}
+
+}
+
+
+void 
+on_menu_transicion_editar(){
+
+	GtkWidget *ventana;
+
+	change_item_color (item_menu_transicion,0);
+
+	ventana = comprobar_ventana_abierta (item_menu_transicion->parent, EDITAR);
+
+	if (ventana != NULL) 
+		gtk_window_present (GTK_WINDOW(ventana));
+	else{
+		ventana = new_text_windows (item_menu_transicion->parent ,(gchar*)"transicion");
+		add_ventana (ventana, item_menu_transicion->parent, EDITAR);
+	}
+
+}
+
+
+void 
+on_menu_transicion_eliminar(){
+
+	GnomeCanvasGroup *group_parent;
+
+	group_parent = GNOME_CANVAS_GROUP(item_menu_transicion->parent);
+
+	eliminar_nombre(GNOME_CANVAS_ITEM(group_parent));
+
+	t_eliminar_transicion_lista (GNOME_CANVAS_ITEM(group_parent));
+	
+	gtk_object_destroy (GTK_OBJECT (group_parent));
+
+}
+
+
+void 
+reemplazar_nodo_subautomata(int idSub, GnomeCanvasItem *item_buscar, GnomeCanvasItem* item_nuevo){
+
+	list<tSubAut>::iterator posNodoSub;
+	list<tNodo>::iterator posNodo;
+	list<tTransicion>::iterator posTrans;
+	
+
+	posNodoSub = ListaSubAutomatas.begin();
+
+	//Nos posicionamos en el subautomata en el que queremos hacer el cambio
+	while(posNodoSub->idSub != idSub)
+	{
+		posNodoSub++;
+	}
+
+	posNodo = posNodoSub->ListaElementosSub.begin();
+
+	while(posNodo!= posNodoSub->ListaElementosSub.end())
+	{
+		if(posNodo->item == item_buscar){
+			posNodo->item = item_nuevo;
+		}
+
+		posNodo++;
+
+	}
+
+	posTrans = posNodoSub->ListaTransicionesSub.begin();
+
+	while(posTrans!= posNodoSub->ListaTransicionesSub.end())
+	{
+		if(posTrans->origen == item_buscar){
+			posTrans->origen = item_nuevo;
+		}
+
+		if(posTrans->destino == item_buscar){
+			posTrans->destino = item_nuevo;
+		}
+
+		posTrans++;
+	}
+}
+
+
+void 
+reemplazar_nombre_nodo_subautomata(int idSub, GnomeCanvasItem* nombre_buscar, GnomeCanvasItem* nombre_nuevo){
+
+	list<tSubAut>::iterator posNodoSub;
+	list<tNodo>::iterator posNodo;
+
+	posNodoSub = ListaSubAutomatas.begin();
+
+	//Nos posicionamos en el subautomata en el que queremos hacer el cambio
+	while(posNodoSub->idSub != idSub)
+	{
+		posNodoSub++;
+	}
+
+	posNodo = posNodoSub->ListaElementosSub.begin();
+
+	while(posNodo!= posNodoSub->ListaElementosSub.end())
+	{
+		if(posNodo->item_nombre == nombre_buscar){
+			posNodo->item_nombre = nombre_nuevo;
+		}
+		posNodo++;
+	}
+}
+
+
+void
+reemplazar_estado_inicial_subautomata(int idSub, GnomeCanvasItem* inicial_buscar, GnomeCanvasItem* inicial_nuevo){
+
+	list<tSubAut>::iterator posNodoSub;
+	list<tNodo>::iterator posNodo;
+
+	posNodoSub = ListaSubAutomatas.begin();
+
+	//Nos posicionamos en el subautomata en el que queremos hacer el cambio
+	while(posNodoSub->idSub != idSub)
+	{
+		posNodoSub++;
+	}
+
+	posNodo = posNodoSub->ListaElementosSub.begin();
+
+	while(posNodo!= posNodoSub->ListaElementosSub.end())
+	{
+		if(posNodo->estado_inicial == inicial_buscar){
+			posNodo->estado_inicial = inicial_nuevo;
+		}
+		posNodo++;
+	}
+}
+
+
+void
+reemplazar_transicion_subautomata(int idSub, GnomeCanvasItem* trans_buscar, GnomeCanvasItem* trans_nueva){
+
+	list<tSubAut>::iterator posNodoSub;
+	list<tNodo>::iterator posNodo;
+	list<tTransicion>::iterator posTrans;
+	list<GnomeCanvasItem*>::iterator posAdy;
+
+	posNodoSub = ListaSubAutomatas.begin();
+
+	//Nos posicionamos en el subautomata en el que queremos hacer el cambio
+	while(posNodoSub->idSub != idSub)
+	{
+		posNodoSub++;
+	}
+
+	//Sustituimos la transicion en las listas de adyacentes de los estados
+	posNodo = posNodoSub->ListaElementosSub.begin();
+
+	while(posNodo != posNodoSub->ListaElementosSub.end()){
+		
+		posAdy = posNodo->listaAdyacentes.begin();
+		while(posAdy != posNodo->listaAdyacentes.end()){
+			
+			if(*posAdy == trans_buscar){
+				*posAdy = trans_nueva;
+			}
+			posAdy++;
+		}
+
+		posNodo++;
+	}
+
+	//Sustituimos la transicion en la lista de transiciones del subautomata
+	posTrans = posNodoSub->ListaTransicionesSub.begin();
+
+	while(posTrans != posNodoSub->ListaTransicionesSub.end()){
+		
+		if(posTrans->item == trans_buscar){
+			posTrans->item = trans_nueva;
+		}
+		posTrans++;
+	}
+}
+
+
+void
+reemplazar_nombre_trans_subautomata(int idSub, GnomeCanvasItem* nombre_buscar, GnomeCanvasItem* nombre_nuevo){
+
+	list<tSubAut>::iterator posNodoSub;
+	list<tTransicion>::iterator posTrans;
+
+	posNodoSub = ListaSubAutomatas.begin();
+
+	//Nos posicionamos en el subautomata en el que queremos hacer el cambio
+	while(posNodoSub->idSub != idSub)
+	{
+		posNodoSub++;
+	}
+
+	posTrans = posNodoSub->ListaTransicionesSub.begin();
+
+	while(posTrans != posNodoSub->ListaTransicionesSub.end()){
+
+		if(posTrans->item_nombre == nombre_buscar){
+			posTrans->item_nombre = nombre_nuevo;
+		}
+
+		posTrans++;
+
+	}
+
+}
+
+
+void pegado_recursivo(int sub_a_copiar, int sub_padre){
+
+	tSubAut nuevo_sub;
+	list<tSubAut>::iterator posNodoSub;
+	list<tNodo>::iterator posNodo;
+	list<tTransicion>::iterator posTrans;
+
+	GnomeCanvasItem *item, *item_nombre, *inicial; 
+	GnomeCanvasGroup *group;
+	
+	//Para obtener el box de una transicion y poder copiar el nombre en caso de haberlo
+	GnomeCanvasItem *box;
+	GList * list_items;
+
+	//estas variables son necesarias si tenemos que llamar a pegado_recursivo mas veces
+	int padre = 0;
+	int hijo = 0;
+
+	double x1, y1, x2, y2;
+
+	posNodoSub = ListaSubAutomatas.begin();
+
+	while(posNodoSub->idSub != sub_a_copiar)
+	{
+		posNodoSub++;
+	}
+
+	//Asi copiamos las listas
+	list <tNodo> listE (posNodoSub->ListaElementosSub);
+	list <tTransicion> listT( posNodoSub->ListaTransicionesSub);
+
+	nuevo_sub.ListaElementosSub = listE;
+	nuevo_sub.ListaTransicionesSub = listT;
+	nuevo_sub.tiempoIteracionSub = posNodoSub->tiempoIteracionSub;
+	nuevo_sub.variablesSub = posNodoSub->variablesSub;
+	nuevo_sub.funcionesSub = posNodoSub->funcionesSub;
+	nuevo_sub.impSub = posNodoSub->impSub;
+	nuevo_sub.idSub = idSubGlobal;
+	nuevo_sub.idPadre = sub_padre;
+
+	ListaSubAutomatas.push_back(nuevo_sub);
+
+	posNodoSub = ListaSubAutomatas.begin();
+
+	while(posNodoSub->idSub != idSubGlobal)
+	{
+		posNodoSub++;
+	}
+
+	posNodo = posNodoSub->ListaElementosSub.begin();
+
+	//Recorremos la lista de elementos para duplicar todos los nodos y asi tener la copia
+	//hacemos lo mismo con el item de estado inicial y con el item del nombre si fuera necesario
+	while(posNodo != posNodoSub->ListaElementosSub.end())
+	{
+		get_bounds (posNodo->item, &x1, &y1, &x2, &y2);
+
+		group = GNOME_CANVAS_GROUP (gnome_canvas_item_new (root,  
+                                        gnome_canvas_group_get_type (),
+                                        "x", 0,
+                                        "y", 0,
+                                        NULL));
+
+		if (posNodo->idHijo == 0){						
+
+			item = gnome_canvas_item_new(group,
+							gnome_canvas_ellipse_get_type(),
+							"x1", x1,
+							"y1", y1,
+							"x2", x2,
+							"y2", y2,
+							"fill_color_rgba", 0x00ffffff,
+							"outline_color", "black",
+							"width_units", 1.0,
+							NULL);
+		}else{
+
+			item = gnome_canvas_item_new(group,
+							gnome_canvas_ellipse_get_type(),
+							"x1", x1,
+							"y1", y1,
+							"x2", x2,
+							"y2", y2,
+							"fill_color_rgba", 0x00ff66ff,
+							"outline_color", "black",
+							"width_units", 1.0,
+							NULL);
+		}
+
+		/*Añadimos control (señal) al item creado*/
+		g_signal_connect (group, "event",
+			    (GtkSignalFunc) item_event,
+			    NULL);
+
+		//Lo ocultamos
+		gnome_canvas_item_hide(item);
+
+		//Sustituimos el item copiado por el recien creado en todas las referencias que haya
+		//dentro de su subautomata
+		reemplazar_nodo_subautomata(posNodoSub->idSub, posNodo->item, item);
+
+		//Repetimos el proceso para el item_nombre y para el estado_inicial
+		if (posNodo->item_nombre != NULL){
+			item_nombre = gnome_canvas_item_new (group,
+		             gnome_canvas_text_get_type (),
+	             			            "text", posNodo->nombre.c_str(),
+	             			            "x", (x2+x1)/2,
+	             			            "y", (y2+y1)/2,
+	             			            "font", "Sans 28",
+					    	    "anchor", GTK_ANCHOR_CENTER,
+	     			                    "fill_color", "black",
+	    			                     NULL);
+
+			gnome_canvas_item_raise_to_top (item_nombre);
+
+			gnome_canvas_item_hide(item_nombre);
+
+			reemplazar_nombre_nodo_subautomata(posNodoSub->idSub, posNodo->item_nombre, item_nombre);
+		}
+
+		if (posNodo->estado_inicial != NULL){
+			inicial = gnome_canvas_item_new(group,
+                        gnome_canvas_ellipse_get_type(),
+                        "x1", x1 + 5,
+                        "y1", y1 + 5,
+                        "x2", x2 - 5,
+                        "y2", y2 - 5,
+                        "fill_color_rgba", NULL,
+                        "outline_color", "black",
+                        "width_units", 1.0,
+                        NULL);
+
+			gnome_canvas_item_hide(inicial);
+
+			reemplazar_estado_inicial_subautomata(posNodoSub->idSub, posNodo->estado_inicial, inicial);
+		}
+		
+		posNodo++;
+	}//Terminamos de recorrer la lista de elementos
+
+
+	posNodoSub = ListaSubAutomatas.begin();
+
+	while(posNodoSub->idSub != idSubGlobal)
+	{
+		posNodoSub++;
+	}
+
+	//Ahora tenemos que hacer un proceso de sustitucion equivalente para las transiciones
+	posTrans = posNodoSub->ListaTransicionesSub.begin();
+
+	while(posTrans != posNodoSub->ListaTransicionesSub.end())
+	{
+		if(posTrans->origen == posTrans->destino){
+
+			item = pinta_autotransicion(posTrans->destino);
+			//La ocultamos
+			gnome_canvas_item_hide(item);
+
+		}else{
+
+			item = pinta_transicion(posTrans->origen,posTrans->destino);
+			//La ocultamos
+			gnome_canvas_item_hide(item);
+
+		}	
+
+		reemplazar_transicion_subautomata(posNodoSub->idSub, posTrans->item, item);
+
+		//Repetimos el proceso para el item_nombre
+		if (posTrans->item_nombre != NULL){
+
+			list_items = GNOME_CANVAS_GROUP(item)->item_list;
+			box = (GnomeCanvasItem *) g_list_nth_data (list_items, g_list_length (list_items)-1);
+
+			get_bounds (box, &x1, &y1, &x2, &y2);
+
+			item_nombre = gnome_canvas_item_new (root,
+						gnome_canvas_text_get_type (),
+             			            "text", posTrans->nombre.c_str(),
+             			            "x", (x2+x1)/2,
+             			            "y", (y2+y1)/2 + 5 ,
+             			            "font", "Sans 28",
+				    	    "anchor", GTK_ANCHOR_N,
+     			                    "fill_color", "black",
+    			                     NULL);
+
+			gnome_canvas_item_raise_to_top (item_nombre);
+			gnome_canvas_item_hide(item_nombre);
+
+			reemplazar_nombre_trans_subautomata(posNodoSub->idSub, posTrans->item_nombre, item_nombre);
+		}
+
+		posTrans++;
+	}//Terminamos de recorrer la lista de transiciones
+
+	//Terminadas las gestiones en el nivel hay que comprobar si hay más subautómatas hijos que se
+	//desplieguen a partir de este nivel
+	posNodo = posNodoSub->ListaElementosSub.begin();
+
+	while(posNodo != posNodoSub->ListaElementosSub.end()){
+
+		if (posNodo->idHijo != 0){
+
+			padre = idSubGlobal;
+
+			hijo = posNodo->idHijo;
+
+			idSubGlobal++;
+
+			printf("Entra por pegado recursivo, idsubglobal: %d\n",idSubGlobal);
+
+			//El hijo es este porque ahora llamaremos al proceso de pegado recursivo que creará un
+			//subautomata con esta ID
+			posNodo->idHijo = idSubGlobal;
+
+			pegado_recursivo(hijo, padre);
+
+			//posNodo->idHijo = padre;
+			printf("Entra por pegado recursivo, posNodo->idHijo: %d\n",posNodo->idHijo);
+
+		}
+
+		posNodo++;
+	}
+
+	//Aumentamos la variable idSubGlobal por si no se desplegaron hijos en la llamada
+	//para que quede con un valor válido
+	idSubGlobal++;
+
+	printf("termina un pegado recursivo, idsubglobal: %d\n",idSubGlobal);
+
+}
+
+void
+on_menu_pegar(){
+
+	GnomeCanvasItem *item; 
+	GnomeCanvasGroup *group;
+
+	tNodo reg;
+
+	list<tSubAut>::iterator posSub; //Añadido para poder iterar en la lista de subautomatas y actulizar el treeview con cada nuevo estado
+
+	points = gnome_canvas_points_new(2); /* 2 puntos */
+	
+
+	printf("menu pegar\n");
+	printf("codigo: %s \n", estado_clipboard_codigo.c_str());
+	printf("idHijo: %d \n", estado_clipboard_idHijo);
+	
+	
+	points->coords[0]  = origenX;
+	points->coords[1]  = origenY;
+	points->coords[2]  = origenX;
+	points->coords[3]  = origenY;
+
+	printf("Click %d, %d\n", origenX, origenY);
+	//printf("Pintamos Nodo \n");
+
+	if (estado_clipboard) 
+	{
+
+		printf("Antes de group\n");	
+		group = GNOME_CANVAS_GROUP (gnome_canvas_item_new (root,  
+                                        gnome_canvas_group_get_type (),
+                                        "x", 0,
+                                        "y", 0,
+                                        NULL));
+		printf("despues de group\n");	
+		if (estado_clipboard_idHijo == 0){
+			
+			printf("entra por el if\n");	
+
+			item = gnome_canvas_item_new(group,
+							gnome_canvas_ellipse_get_type(),
+							"x1", (double) origenX-20,
+							"y1", (double) origenY-20,
+							"x2", (double) (origenX + 20),
+							"y2", (double) (origenY + 20),
+							"fill_color_rgba", 0x00ffffff,
+							"outline_color", "black",
+							"width_units", 1.0,
+							NULL);
+			printf("despues de crear item\n");
+
+			reg.idHijo = estado_clipboard_idHijo;
+			printf("despues de reg.idHijo\n");
+
+		}else{
+
+			printf("entra por el else\n");	
+
+			item = gnome_canvas_item_new(group,
+							gnome_canvas_ellipse_get_type(),
+							"x1", (double) origenX-20,
+							"y1", (double) origenY-20,
+							"x2", (double) (origenX + 20),
+							"y2", (double) (origenY + 20),
+							"fill_color_rgba", 0x00ff66ff,
+							"outline_color", "black",
+							"width_units", 1.0,
+							NULL);
+
+			//Si el estado que habiamos copiado tenia hijos hay que hacer copia de toda la estructura que enlazase por debajo
+			//Asignamos como hijo al nodo copiado la variable idSubGlobal porque ahora llamaremos a una funcion recursiva que empezará
+			//creando un nuevo nodo en la lista de subautomatas y lo hará con esa idSubGlobal
+			reg.idHijo = idSubGlobal;
+			
+	
+			printf("Antes de llamar a pegado recursivo\n");
+			//Las dos variables que el procedimiento necesita son el subautomata a buscar en la lista para poder copiartlo y cual será su padre
+			pegado_recursivo(estado_clipboard_idHijo, subautomata_mostrado);
+			printf("Despues de llamar a pegado recursivo\n");
+
+		}		
+
+		
+
+		reg.item = item;
+		reg.item_nombre = NULL;
+		reg.estado_inicial = NULL;
+		reg.nombre = "";
+		reg.codigo = estado_clipboard_codigo;
+		id ++;
+	
+		ListaElementos.push_back(reg);
+
+		printf("Despues de añadir nuevo nodo en el nivel \n");
+
+		/*Añadimos control (señal) al item creado*/
+		g_signal_connect (group, "event",
+			    (GtkSignalFunc) item_event,
+			    NULL);
+
+		estado_clipboard = FALSE;
+		estado_clipboard_codigo = "";
+		estado_clipboard_idHijo = 0;
+
+
+		//Actualizamos datos necesarios para mostrar cambios en el tree view
+		posSub = ListaSubAutomatas.begin();
+
+		while(posSub->idSub != subautomata_mostrado)
+		{
+			posSub++;
+		}
+
+		//guardamos el estado de la lista de elementos en el nodo del subautomata para poder recargar bien el tree view
+		posSub->ListaElementosSub = ListaElementos;
+
+		actualizar_tree_view();
+		
+		gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view), arbolPath);		
+
+	}
+
+	printf("Pasa del if\n");
+
+	estado_clipboard = FALSE;
+	estado_clipboard_codigo = "";
+	estado_clipboard_idHijo = 0;
+
+}
+


Property changes on: trunk/src/components/visualHFSM-3.1/interfaz.cpp
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/interfaz.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/interfaz.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/interfaz.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,74 @@
+#include <iostream>
+#include <list>
+#include "nodo.h"
+#include "ventanas.h"
+//#include <gtk/gtk.h>
+
+using namespace std;
+
+typedef struct tSubAut {
+	list <tNodo> ListaElementosSub;
+	list <tTransicion> ListaTransicionesSub;
+	int tiempoIteracionSub;	
+	string variablesSub;
+	string funcionesSub;
+	importar impSub;
+	int idSub;
+	int idPadre;
+} tSubAut; 
+
+
+void
+create_drag_box (GnomeCanvasGroup *group, char *box_name, double x1, double y1, GCallback callback);
+
+gint
+item_event (GnomeCanvasItem *item_group, GdkEvent *event, gpointer data);
+
+gint
+highlight_box (GnomeCanvasItem *item, GdkEvent *event, gpointer data);
+
+gint
+highlight_box_edit (GnomeCanvasItem *item, GdkEvent *event, gpointer data);
+
+void 
+mostrar_subautomata(int pidSub);
+
+void 
+ocultar_subautomata(int pidSub);
+
+void 
+on_menu_estado_nombrar();
+
+void 
+on_menu_estado_editar();
+
+void 
+on_menu_estado_marcar_inicial();
+
+void 
+on_menu_estado_copiar();
+
+void 
+on_menu_estado_eliminar();
+
+void 
+on_menu_transicion_nombrar();
+
+void 
+on_menu_transicion_editar();
+
+void 
+on_menu_transicion_eliminar();
+
+void 
+on_menu_pegar();
+
+
+static GtkTreeModel *
+create_and_fill_model ();
+
+void
+actualizar_tree_view();
+/*
+static GtkWidget *
+create_view_and_model();*/


Property changes on: trunk/src/components/visualHFSM-3.1/interfaz.h
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/nodo.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/nodo.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/nodo.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,146 @@
+#include <iostream>
+#include <list>
+
+#include "recta.h"
+#include "nodo.h"
+#include "transicion.h"
+ 
+#include <gtk/gtk.h>
+#include <libgnomecanvas/libgnomecanvas.h>
+//int cont_nodos = 0;
+
+
+extern list <tNodo> ListaElementos;
+extern GnomeCanvasGroup *root;
+
+void copiar_nodo (GnomeCanvasItem * item, GnomeCanvasItem * item_cp)
+{
+	tNodo nodo;
+	list<tNodo>::iterator posNodos;
+	//GnomeCanvasItem * item_nombre;
+	//double x2,x1,y2,y1;
+
+	posNodos = ListaElementos.begin();
+
+	while( (posNodos != ListaElementos.end()) && (posNodos->item != item) )
+		posNodos++;
+
+	nodo.item = item_cp;
+	nodo.nombre = "";
+	nodo.codigo = posNodos->codigo;
+	nodo.estado_inicial = NULL;
+
+//	g_object_get (G_OBJECT (item_cp), "x1", &x1, NULL);
+//	g_object_get (G_OBJECT (item_cp), "y1", &y1, NULL);
+//	g_object_get (G_OBJECT (item_cp), "x2", &x2, NULL);
+//	g_object_get (G_OBJECT (item_cp), "y2", &y2, NULL);
+
+	/*item_nombre = gnome_canvas_item_new (root,
+	            gnome_canvas_text_get_type (),
+             	    "text", posNodos->nombre.c_str(),
+		    "x", (x2+x1)/2,
+		    "y", (y2+y1)/2,
+		    "font", "Sans 12",
+		    "size", 32000,
+		    "size_set", (gboolean)TRUE,
+		    "scale",  (gdouble) 3,
+		    "scale_set", (gboolean)TRUE,
+	    	    "anchor", GTK_ANCHOR_N,
+	            "fill_color", "black",
+	                     NULL); */
+	
+	nodo.item_nombre = NULL;
+
+	ListaElementos.push_back(nodo);
+}
+
+bool cambiar_item_adyacentes (GnomeCanvasItem * id_item, GnomeCanvasItem * old_item, GnomeCanvasItem * new_item)
+{
+
+	list<tNodo>::iterator posNodos;
+	list<GnomeCanvasItem *>::iterator posAdy;
+	bool b = false;
+
+	posNodos = ListaElementos.begin();
+
+	while( (posNodos != ListaElementos.end()) && (posNodos->item != id_item) )
+		
+		posNodos++;
+
+
+	posAdy = posNodos->listaAdyacentes.begin();
+	
+	while( (posAdy != posNodos->listaAdyacentes.end()) && (*posAdy != old_item) )
+
+		posAdy++;
+	
+	if (*posAdy == old_item){ 
+		
+		*posAdy = new_item;
+		b = true;
+	}
+
+
+	return b;
+}
+
+
+void n_borrar_transicion_lista (GnomeCanvasItem * nodo, GnomeCanvasItem * transicion)
+{
+	list<tNodo>::iterator posNodo;
+	list<GnomeCanvasItem *>::iterator posAdy;
+		
+	posNodo = ListaElementos.begin();
+
+	while(posNodo->item != nodo)
+  		posNodo++;
+				
+	posAdy = posNodo->listaAdyacentes.begin();
+
+	while((*posAdy) != transicion)
+  		posAdy++;
+
+	posNodo->listaAdyacentes.erase(posAdy);
+
+}
+
+GnomeCanvasItem * pinta_estado_inicial (GnomeCanvasGroup *group, GnomeCanvasItem *item) {
+
+	double x1,x2,y1,y2;
+	GnomeCanvasItem * estado_inicial;
+
+	g_object_get (G_OBJECT (item), "x1", &x1, NULL);
+	g_object_get (G_OBJECT (item), "y1", &y1, NULL);
+	g_object_get (G_OBJECT (item), "x2", &x2, NULL);
+	g_object_get (G_OBJECT (item), "y2", &y2, NULL);
+
+	estado_inicial = gnome_canvas_item_new(group,
+                        gnome_canvas_ellipse_get_type(),
+                        "x1", (double) x1 + 5,
+                        "y1", (double) y1 + 5,
+                        "x2", (double) x2 - 5,
+                        "y2", (double) y2 - 5,
+                        "fill_color_rgba", NULL,
+                        "outline_color", "black",
+                        "width_units", 1.0,
+                        NULL);
+
+	return estado_inicial;
+}
+
+void get_bounds (GnomeCanvasItem *nodo, double *x1, double *y1, double *x2, double *y2) {
+
+	g_object_get (G_OBJECT (nodo), "x1", x1, NULL);
+	g_object_get (G_OBJECT (nodo), "y1", y1, NULL);
+	g_object_get (G_OBJECT (nodo), "x2", x2, NULL);
+	g_object_get (G_OBJECT (nodo), "y2", y2, NULL);
+
+
+}
+
+gint item_event2 (GnomeCanvasItem *item_group, GdkEvent *event, gpointer data)
+{
+	cout << ""<< endl;
+	return true;
+}
+


Property changes on: trunk/src/components/visualHFSM-3.1/nodo.cpp
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/nodo.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/nodo.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/nodo.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,40 @@
+#include <iostream>
+#include <list>
+
+#include <gtk/gtk.h>
+#include <libgnomecanvas/libgnomecanvas.h>
+
+using namespace std;
+
+
+typedef struct tipoNodo {
+
+	GnomeCanvasItem * item;	
+	GnomeCanvasItem * estado_inicial;		
+//	int origenX, origenY;		// Punto (x,y) donde se dibujara en el canvas
+//	int destinoX, destinoY;		// Punto (x,y) donde se dibujara en el canvas
+	string nombre;			// Nombre del nodo. "" por defecto
+	string codigo;		// Codigo del estado
+	GnomeCanvasItem * item_nombre;		// item que muestra el nombre del estado
+	list <GnomeCanvasItem *> listaAdyacentes;  // Para estados -- Lista de lineas adyacentes 
+	int idHijo;  //Id. que indica el subautomata dentro de la lista de subautomatas que se corresponde con el hijo de este estado
+} tNodo; 
+
+/*	Copia y añade un nodo a la lista	*/
+void copiar_nodo (GnomeCanvasItem * item, GnomeCanvasItem * item_cp);
+
+/*	cambia la transicion asociada	*/
+void cambiar_transicion (int id, GnomeCanvasItem * old_item, GnomeCanvasItem * new_item);
+
+/*	Cambia la transicion adyacente al nodo "id_item"	*/
+bool cambiar_item_adyacentes (GnomeCanvasItem * id_item, GnomeCanvasItem * old_item, GnomeCanvasItem * new_item);
+
+/*	borrar transicion de la lista	*/
+void n_borrar_transicion_lista (GnomeCanvasItem * nodo, GnomeCanvasItem * transicion);
+
+/*		*/
+GnomeCanvasItem * pinta_estado_inicial (GnomeCanvasGroup *group, GnomeCanvasItem *item);
+
+void get_bounds (GnomeCanvasItem *nodo, double *x1, double *y1, double *x2, double *y2);
+
+gint item_event2 (GnomeCanvasItem *item_group, GdkEvent *event, gpointer data);


Property changes on: trunk/src/components/visualHFSM-3.1/nodo.h
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/prueba_navegacion.xml
===================================================================
--- trunk/src/components/visualHFSM-3.1/prueba_navegacion.xml	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/prueba_navegacion.xml	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<VisualHFSM><SubAutomata><idSub>1</idSub><idPadre>0</idPadre><Estado estado_inicial="false"><id>1</id><origenX>291</origenX><origenY>280</origenY><destinoX>331</destinoX><destinoY>320</destinoY><nombre></nombre><hijo>2</hijo><codigo></codigo><transiciones><transicion><box x1="384" y1="377" x2="390" y2="383"/><nombre></nombre><destino>3</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>172</origenX><origenY>545</origenY><destinoX>212</destinoX><destinoY>585</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones><transicion><box x1="325" y1="509" x2="331" y2="515"/><nombre></nombre><destino>3</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>3</id><origenX>444</origenX><origenY>440</origenY><destinoX>484</destinoX><destinoY>480</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><tiempoIteracion>100</tiempoIteracion><Librerias/><variables_aux></variables!
 _aux><funciones_aux></funciones_aux></SubAutomata><SubAutomata><idSub>2</idSub><idPadre>1</idPadre><Estado estado_inicial="false"><id>1</id><origenX>409</origenX><origenY>212</origenY><destinoX>449</destinoX><destinoY>252</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones><transicion><box x1="363" y1="331" x2="369" y2="337"/><nombre></nombre><destino>2</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>284</origenX><origenY>416</origenY><destinoX>324</destinoX><destinoY>456</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones><transicion><box x1="254" y1="369" x2="260" y2="375"/><nombre></nombre><destino>3</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>3</id><origenX>190</origenX><origenY>288</origenY><destinoX>230</destinoX><destinoY>328</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><tiempoIteracion>100</tiempoIteracion>!
 <Librerias><lib>laser</lib><lib>motor</lib><lib>radar</lib><li!
 b>encoders</lib><lib>lat_lon</lib></Librerias><variables_aux></variables_aux><funciones_aux></funciones_aux></SubAutomata><nombreEsquema>/home/rubensb/PFC/pfc-itis/trunk/visualHFSM/prueba_navegacion</nombreEsquema></VisualHFSM>

Added: trunk/src/components/visualHFSM-3.1/prueba_navegacion_full.xml
===================================================================
--- trunk/src/components/visualHFSM-3.1/prueba_navegacion_full.xml	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/prueba_navegacion_full.xml	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<VisualHFSM><SubAutomata><idSub>1</idSub><idPadre>0</idPadre><Estado estado_inicial="false"><id>1</id><origenX>169</origenX><origenY>198</origenY><destinoX>209</destinoX><destinoY>238</destinoY><nombre></nombre><hijo>3</hijo><codigo></codigo><transiciones><transicion><box x1="178" y1="337" x2="184" y2="343"/><nombre></nombre><destino>2</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>153</origenX><origenY>443</origenY><destinoX>193</destinoX><destinoY>483</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones><transicion><box x1="254" y1="467" x2="260" y2="473"/><nombre></nombre><destino>3</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>3</id><origenX>321</origenX><origenY>458</origenY><destinoX>361</destinoX><destinoY>498</destinoY><nombre></nombre><hijo>2</hijo><codigo></codigo><transiciones/></Estado><tiempoIteracion>100</tiempoIteracion><Librerias/><variables_aux></variables!
 _aux><funciones_aux></funciones_aux></SubAutomata><SubAutomata><idSub>2</idSub><idPadre>1</idPadre><Estado estado_inicial="false"><id>1</id><origenX>532</origenX><origenY>211</origenY><destinoX>572</destinoX><destinoY>251</destinoY><nombre></nombre><hijo>4</hijo><codigo></codigo><transiciones><transicion><box x1="413" y1="361" x2="419" y2="367"/><nombre></nombre><destino>2</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>261</origenX><origenY>477</origenY><destinoX>301</destinoX><destinoY>517</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><tiempoIteracion>100</tiempoIteracion><Librerias><lib>laser</lib><lib>motor</lib><lib>radar</lib><lib>encoders</lib><lib>lat_lon</lib><lib>camara</lib><lib>ptencoders</lib></Librerias><variables_aux></variables_aux><funciones_aux></funciones_aux></SubAutomata><SubAutomata><idSub>3</idSub><idPadre>1</idPadre><Estado estado_inicial="false"><id>1</id><origenX>26!
 6</origenX><origenY>200</origenY><destinoX>306</destinoX><dest!
 inoY>240</destinoY><nombre></nombre><hijo>6</hijo><codigo></codigo><transiciones><transicion><box x1="386" y1="328" x2="392" y2="334"/><nombre></nombre><destino>3</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>180</origenX><origenY>370</origenY><destinoX>220</destinoX><destinoY>410</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><Estado estado_inicial="false"><id>3</id><origenX>473</origenX><origenY>423</origenY><destinoX>513</destinoX><destinoY>463</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones><transicion><box x1="343" y1="413" x2="349" y2="419"/><nombre></nombre><destino>2</destino></transicion></transiciones></Estado><tiempoIteracion>100</tiempoIteracion><Librerias><lib>laser</lib><lib>motor</lib><lib>radar</lib><lib>encoders</lib><lib>lat_lon</lib><lib>camara</lib><lib>ptencoders</lib></Librerias><variables_aux></variables_aux><funciones_aux></funciones_aux></Sub!
 Automata><SubAutomata><idSub>4</idSub><idPadre>2</idPadre><Estado estado_inicial="false"><id>1</id><origenX>398</origenX><origenY>225</origenY><destinoX>438</destinoX><destinoY>265</destinoY><nombre></nombre><hijo>5</hijo><codigo></codigo><transiciones><transicion><box x1="296" y1="404" x2="302" y2="410"/><nombre></nombre><destino>2</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>161</origenX><origenY>550</origenY><destinoX>201</destinoX><destinoY>590</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><tiempoIteracion>100</tiempoIteracion><Librerias><lib>laser</lib><lib>motor</lib><lib>radar</lib><lib>encoders</lib><lib>lat_lon</lib><lib>camara</lib><lib>ptencoders</lib></Librerias><variables_aux></variables_aux><funciones_aux></funciones_aux></SubAutomata><SubAutomata><idSub>5</idSub><idPadre>4</idPadre><Estado estado_inicial="false"><id>1</id><origenX>33</origenX><origenY>209</origenY><destinoX!
 >73</destinoX><destinoY>249</destinoY><nombre></nombre><hijo>0</hijo><c!
 odigo></codigo><transiciones><transicion><box x1="215" y1="341" x2="221" y2="347"/><nombre></nombre><destino>2</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>364</origenX><origenY>440</origenY><destinoX>404</destinoX><destinoY>480</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones><transicion><box x1="457" y1="352" x2="463" y2="358"/><nombre></nombre><destino>3</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>3</id><origenX>516</origenX><origenY>230</origenY><destinoX>556</destinoX><destinoY>270</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><tiempoIteracion>100</tiempoIteracion><Librerias><lib>laser</lib><lib>motor</lib><lib>radar</lib><lib>encoders</lib><lib>lat_lon</lib><lib>camara</lib><lib>ptencoders</lib></Librerias><variables_aux></variables_aux><funciones_aux></funciones_aux></SubAutomata><SubAutomata><idSub>6</idSub><idPadre>3</id!
 Padre><Estado estado_inicial="false"><id>1</id><origenX>370</origenX><origenY>258</origenY><destinoX>410</destinoX><destinoY>298</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones><transicion><box x1="347" y1="391" x2="353" y2="397"/><nombre></nombre><destino>2</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>290</origenX><origenY>491</origenY><destinoX>330</destinoX><destinoY>531</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><tiempoIteracion>100</tiempoIteracion><Librerias><lib>laser</lib><lib>motor</lib><lib>radar</lib><lib>encoders</lib><lib>lat_lon</lib><lib>camara</lib><lib>ptencoders</lib></Librerias><variables_aux></variables_aux><funciones_aux></funciones_aux></SubAutomata><nombreEsquema>/home/rubensb/PFC/pfc-itis/trunk/visualHFSM/prueba_navegacion_full</nombreEsquema></VisualHFSM>

Added: trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml.xml
===================================================================
--- trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml.xml	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml.xml	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<VisualHFSM><SubAutomata><idSub>1</idSub><idPadre>0</idPadre><Estado estado_inicial="false"><id>1</id><origenX>211</origenX><origenY>219</origenY><destinoX>251</destinoX><destinoY>259</destinoY><nombre>nuev1</nombre><hijo>0</hijo><codigo>codigo del nuev1</codigo><transiciones><transicion><box x1="399" y1="221" x2="405" y2="227"/><nombre></nombre><destino>2</destino><codigo>cond 1-2</codigo></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>553</origenX><origenY>189</origenY><destinoX>593</destinoX><destinoY>229</destinoY><nombre>nuev2</nombre><hijo>0</hijo><codigo>codigo del nuev2</codigo><transiciones><transicion><box x1="497" y1="321" x2="503" y2="327"/><nombre></nombre><destino>3</destino><codigo>cond 3-4</codigo></transicion></transiciones></Estado><Estado estado_inicial="false"><id>3</id><origenX>408</origenX><origenY>419</origenY><destinoX>448</destinoX><destinoY>459</destinoY><nombre>nuev4</nombre><hijo>0</hijo><codigo>codigo del n!
 uev4</codigo><transiciones><transicion><box x1="297" y1="504" x2="303" y2="510"/><nombre></nombre><destino>4</destino><tiempo>200</tiempo></transicion></transiciones></Estado><Estado estado_inicial="false"><id>4</id><origenX>153</origenX><origenY>555</origenY><destinoX>193</destinoX><destinoY>595</destinoY><nombre>nuev3</nombre><hijo>0</hijo><codigo>codigo del nuev3</codigo><transiciones><transicion><box x1="199" y1="404" x2="205" y2="410"/><nombre></nombre><destino>1</destino><codigo>cond 3-1</codigo></transicion></transiciones></Estado><tiempoIteracion>175</tiempoIteracion><Librerias><lib>laser</lib><lib>radar</lib><lib>camara</lib></Librerias><variables_aux>var nuev</variables_aux><funciones_aux>func nuev</funciones_aux></SubAutomata><nombreEsquema>/home/rubensb/PFC/pfc-itis/trunk/visualHFSM/prueba_nuevo_xml</nombreEsquema></VisualHFSM>

Added: trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml_2.xml
===================================================================
--- trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml_2.xml	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml_2.xml	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<VisualHFSM><SubAutomata><idSub>1</idSub><idPadre>0</idPadre><Estado estado_inicial="false"><id>1</id><origenX>225</origenX><origenY>275</origenY><destinoX>265</destinoX><destinoY>315</destinoY><nombre>estado 1</nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><Estado estado_inicial="false"><id>2</id><origenX>157</origenX><origenY>426</origenY><destinoX>197</destinoX><destinoY>466</destinoY><nombre>estado 3</nombre><hijo>3</hijo><codigo></codigo><transiciones/></Estado><Estado estado_inicial="false"><id>3</id><origenX>382</origenX><origenY>452</origenY><destinoX>422</destinoX><destinoY>492</destinoY><nombre>estado 2</nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><Estado estado_inicial="false"><id>4</id><origenX>406</origenX><origenY>211</origenY><destinoX>446</destinoX><destinoY>251</destinoY><nombre></nombre><hijo>2</hijo><codigo></codigo><transiciones/></Estado><Estado estado_inicial="false"><id>5</id><origenX>249</origenX><origenY>590</origen!
 Y><destinoX>289</destinoX><destinoY>630</destinoY><nombre></nombre><hijo>4</hijo><codigo></codigo><transiciones/></Estado><tiempoIteracion>100</tiempoIteracion><Librerias/><variables_aux></variables_aux><funciones_aux></funciones_aux></SubAutomata><SubAutomata><idSub>2</idSub><idPadre>1</idPadre><Estado estado_inicial="false"><id>1</id><origenX>180</origenX><origenY>276</origenY><destinoX>220</destinoX><destinoY>316</destinoY><nombre>hola</nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><Estado estado_inicial="false"><id>2</id><origenX>187</origenX><origenY>563</origenY><destinoX>227</destinoX><destinoY>603</destinoY><nombre>adios</nombre><hijo>0</hijo><codigo>cod adios</codigo><transiciones/></Estado><Estado estado_inicial="false"><id>3</id><origenX>397</origenX><origenY>348</origenY><destinoX>437</destinoX><destinoY>388</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><tiempoIteracion>100</tiempoIteracion><Librerias><lib>lase!
 r</lib></Librerias><variables_aux></variables_aux><funciones_a!
 ux></funciones_aux></SubAutomata><SubAutomata><idSub>3</idSub><idPadre>1</idPadre><Estado estado_inicial="false"><id>1</id><origenX>261</origenX><origenY>288</origenY><destinoX>301</destinoX><destinoY>328</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><Estado estado_inicial="false"><id>2</id><origenX>156</origenX><origenY>466</origenY><destinoX>196</destinoX><destinoY>506</destinoY><nombre>lvl1</nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><Estado estado_inicial="false"><id>3</id><origenX>389</origenX><origenY>482</origenY><destinoX>429</destinoX><destinoY>522</destinoY><nombre>lvlv2</nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><tiempoIteracion>100</tiempoIteracion><Librerias><lib>laser</lib><lib>ptencoders</lib></Librerias><variables_aux></variables_aux><funciones_aux></funciones_aux></SubAutomata><SubAutomata><idSub>4</idSub><idPadre>1</idPadre><Estado estado_inicial="false"><id>1</id><origenX>180</orig!
 enX><origenY>276</origenY><destinoX>220</destinoX><destinoY>316</destinoY><nombre>hola</nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><Estado estado_inicial="false"><id>2</id><origenX>187</origenX><origenY>563</origenY><destinoX>227</destinoX><destinoY>603</destinoY><nombre>adios</nombre><hijo>0</hijo><codigo>cod adios</codigo><transiciones/></Estado><Estado estado_inicial="false"><id>3</id><origenX>397</origenX><origenY>348</origenY><destinoX>437</destinoX><destinoY>388</destinoY><nombre></nombre><hijo>0</hijo><codigo></codigo><transiciones/></Estado><tiempoIteracion>100</tiempoIteracion><Librerias><lib>laser</lib></Librerias><variables_aux></variables_aux><funciones_aux></funciones_aux></SubAutomata><nombreEsquema>/home/rubensb/PFC/pfc-itis/trunk/visualHFSM/prueba_nuevo_xml_2</nombreEsquema></VisualHFSM>

Added: trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml_varios.xml
===================================================================
--- trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml_varios.xml	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml_varios.xml	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<VisualHFSM><SubAutomata><idSub>1</idSub><idPadre>0</idPadre><Estado estado_inicial="true"><id>1</id><origenX>90</origenX><origenY>286</origenY><destinoX>130</destinoX><destinoY>326</destinoY><nombre>JARL1</nombre><hijo>2</hijo><codigo>adfasd1</codigo><transiciones><transicion><box x1="325" y1="181" x2="331" y2="187"/><nombre></nombre><destino>2</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>464</origenX><origenY>178</origenY><destinoX>504</destinoX><destinoY>218</destinoY><nombre>JARL2</nombre><hijo>0</hijo><codigo>dfafgdg
+hola que tal
+jarl2
+lololo</codigo><transiciones><transicion><box x1="562" y1="256" x2="568" y2="262"/><nombre></nombre><destino>4</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>3</id><origenX>238</origenX><origenY>466</origenY><destinoX>278</destinoX><destinoY>506</destinoY><nombre>oleee4</nombre><hijo>0</hijo><codigo>dfdsgdf3</codigo><transiciones><transicion><box x1="216" y1="349" x2="222" y2="355"/><nombre></nombre><destino>1</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>4</id><origenX>554</origenX><origenY>374</origenY><destinoX>594</destinoX><destinoY>414</destinoY><nombre>jare3</nombre><hijo>0</hijo><codigo>asdfasdfffffsd4</codigo><transiciones><transicion><box x1="417" y1="490" x2="423" y2="496"/><nombre></nombre><destino>3</destino></transicion></transiciones></Estado><tiempoIteracion>156</tiempoIteracion><Librerias><lib>laser</lib><lib>motor</lib><lib>radar</lib><lib>encoders</lib></Librerias><variables_aux>dfsgsdfg!
  var</variables_aux><funciones_aux>func</funciones_aux></SubAutomata><SubAutomata><idSub>2</idSub><idPadre>1</idPadre><Estado estado_inicial="false"><id>1</id><origenX>128</origenX><origenY>337</origenY><destinoX>168</destinoX><destinoY>377</destinoY><nombre>est1</nombre><hijo>0</hijo><codigo></codigo><transiciones><transicion><box x1="236" y1="388" x2="242" y2="394"/><nombre></nombre><destino>3</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>320</origenX><origenY>234</origenY><destinoX>360</destinoX><destinoY>274</destinoY><nombre>estaaa2</nombre><hijo>0</hijo><codigo>hola q tal estado 2 nivel 2
+</codigo><transiciones><transicion><box x1="241" y1="302" x2="247" y2="308"/><nombre></nombre><destino>1</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>3</id><origenX>311</origenX><origenY>405</origenY><destinoX>351</destinoX><destinoY>445</destinoY><nombre>est3</nombre><hijo>0</hijo><codigo></codigo><transiciones><transicion><box x1="332" y1="336" x2="338" y2="342"/><nombre></nombre><destino>2</destino></transicion></transiciones></Estado><tiempoIteracion>200</tiempoIteracion><Librerias><lib>laser</lib><lib>motor</lib><lib>radar</lib><lib>encoders</lib></Librerias><variables_aux>varrr</variables_aux><funciones_aux></funciones_aux></SubAutomata><nombreEsquema>/home/rubensb/PFC/pfc-itis/trunk/visualHFSM/prueba_nuevo_xml_varios</nombreEsquema></VisualHFSM>

Added: trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml_varios_save.xml
===================================================================
--- trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml_varios_save.xml	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/prueba_nuevo_xml_varios_save.xml	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<VisualHFSM><SubAutomata><idSub>1</idSub><Estado estado_inicial="false"><id>1</id><origenX>178</origenX><origenY>226</origenY><destinoX>218</destinoX><destinoY>266</destinoY><nombre></nombre><hijo>2</hijo><codigo>adfasd1</codigo><transiciones><transicion><box x1="325" y1="181" x2="331" y2="187"/><nombre></nombre><destino>2</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><origenX>464</origenX><origenY>178</origenY><destinoX>504</destinoX><destinoY>218</destinoY><nombre></nombre><hijo>0</hijo><codigo>dfafgdg</codigo><transiciones><transicion><box x1="562" y1="256" x2="568" y2="262"/><nombre></nombre><destino>4</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>3</id><origenX>238</origenX><origenY>466</origenY><destinoX>278</destinoX><destinoY>506</destinoY><nombre></nombre><hijo>0</hijo><codigo>dfdsgdf3</codigo><transiciones><transicion><box x1="216" y1="349" x2="222" y2="355"/><nombre></nombre><destino>1</d!
 estino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>4</id><origenX>554</origenX><origenY>374</origenY><destinoX>594</destinoX><destinoY>414</destinoY><nombre></nombre><hijo>0</hijo><codigo>asdfasdfffffsd4</codigo><transiciones><transicion><box x1="417" y1="490" x2="423" y2="496"/><nombre></nombre><destino>3</destino></transicion></transiciones></Estado><tiempoIteracion>156</tiempoIteracion><Librerias><lib>laser</lib><lib>radar</lib><lib>encoders</lib></Librerias><variables_aux>dfsgsdfg var</variables_aux><funciones_aux>func</funciones_aux></SubAutomata><SubAutomata><idSub>2</idSub><Estado estado_inicial="false"><id>1</id><origenX>128</origenX><origenY>337</origenY><destinoX>168</destinoX><destinoY>377</destinoY><nombre>est1</nombre><hijo>0</hijo><codigo></codigo><transiciones><transicion><box x1="236" y1="388" x2="242" y2="394"/><nombre></nombre><destino>3</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>2</id><orig!
 enX>320</origenX><origenY>234</origenY><destinoX>360</destinoX!
 ><destinoY>274</destinoY><nombre>est2</nombre><hijo>0</hijo><codigo></codigo><transiciones><transicion><box x1="241" y1="302" x2="247" y2="308"/><nombre></nombre><destino>1</destino></transicion></transiciones></Estado><Estado estado_inicial="false"><id>3</id><origenX>311</origenX><origenY>405</origenY><destinoX>351</destinoX><destinoY>445</destinoY><nombre>est3</nombre><hijo>0</hijo><codigo></codigo><transiciones><transicion><box x1="332" y1="336" x2="338" y2="342"/><nombre></nombre><destino>2</destino></transicion></transiciones></Estado><tiempoIteracion>200</tiempoIteracion><Librerias><lib>laser</lib><lib>motor</lib><lib>radar</lib><lib>encoders</lib></Librerias><variables_aux>varrr</variables_aux><funciones_aux></funciones_aux></SubAutomata><nombreEsquema>/home/rubensb/PFC/pfc-itis/trunk/visualHFSM/prueba_nuevo_xml_varios_save</nombreEsquema></VisualHFSM>

Added: trunk/src/components/visualHFSM-3.1/recta/recta.c
===================================================================
--- trunk/src/components/visualHFSM-3.1/recta/recta.c	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/recta/recta.c	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,94 @@
+#include <stdlib.h>
+#include "recta.h"
+#include <math.h>
+
+punto 
+crear_punto (double x, double y)
+{
+	punto p;
+	p.x = x;
+	p.y = y;
+
+	return p;
+}
+
+punto punto_medio (punto p1, punto p2)
+{
+	punto p;
+	p.x = (p1.x + p2.x)/2;
+	p.y = (p1.y + p2.y)/2;
+
+	return p;
+}
+
+void 
+punto_get_values (punto p, double *x, double *y)
+{
+	
+	*x = p.x;
+	*y = p.y;
+
+}
+
+recta crear_recta (punto p1, punto p2)
+{	
+	recta r; 
+
+	r.A = p2.y - p1.y;
+	r.B = -(p2.x - p1.x);
+	r.C = -(r.A * p1.x) - (r.B * p1.y);
+
+	return r;
+}
+recta recta_perpendicular (recta r1, punto p1)
+{
+	recta r;
+	
+	r.A = -r1.B;
+	r.B = r1.A;
+	r.C = -((r.A * p1.x)+(r.B * p1.y));
+
+	return r;
+	
+}
+recta recta_paralela (recta r1, punto p, double distancia)
+{	
+	recta r;
+
+	r.A = r1.A;
+	r.B = r1.B;
+	r.C = (distancia*(sqrt((r1.A*r1.A)+(r1.B*r1.B))))-((r1.A*p.x)+ (r1.B * p.y));
+	if (r1.A == 0)
+	{
+		r.B = 1;
+		r.C = r1.C/r1.B + 10;
+	}else if (r1.B == 0)
+	{	
+		r.A = 1;
+		r.C = r1.C/r1.A + 10;
+	} 
+	
+	return r;
+}
+punto interseccion_rectas (recta r1, recta r2)
+{
+	punto p;
+	
+	if (r1.A == 0)
+	{
+		p.y = -r1.C/r1.B;
+		p.x = -r2.C;
+	}
+	else if (r1.B == 0)
+	{
+		p.y = -r2.C;
+		p.x = -r1.C/r1.A;
+	}
+	else
+	{
+		p.y = (-(r2.A * r1.C - r1.A * r2.C))/ (r2.A * r1.B - r1.A * r2.B);
+		p.x = ((-r2.B * p.y)-r2.C)/r2.A;
+	}
+	
+	return p;
+}


Property changes on: trunk/src/components/visualHFSM-3.1/recta/recta.c
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/recta/recta.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/recta/recta.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/recta/recta.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,34 @@
+#include <stdio.h>
+
+
+typedef struct punto {
+	double x;
+	double y;
+} punto; 
+
+typedef struct recta {
+	double A;
+	double B;
+	double C;
+} recta; 
+
+punto crear_punto (double x, double y);
+punto punto_medio (punto p1, punto p2);
+void punto_get_values (punto p, double *x, double *y);
+
+/*Ax + By + C = 0
+A=y2-y1 B=x2-x1  C=((y2-y1)*x1)+((x2-x1)*y1) */
+recta crear_recta (punto p1, punto p2);
+
+/* Recta perpendicular a otra y que pase por un punto
+ A'=-B B=A C=-((A*x)+(B*y));*/
+recta recta_perpendicular (recta r1, punto p1);
+
+/* Recta paralela a otra a una distancia 
+ d(p,R)=|Ax+By+C|/((A^2)+(B^2))^1/2 // A'=A B'=B*/
+recta recta_paralela (recta r1, punto p1, double distancia);
+
+punto interseccion_rectas (recta r1, recta r2);
+
+
+


Property changes on: trunk/src/components/visualHFSM-3.1/recta/recta.h
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/recta.c
===================================================================
--- trunk/src/components/visualHFSM-3.1/recta.c	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/recta.c	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,94 @@
+#include <stdlib.h>
+#include "recta.h"
+#include <math.h>
+
+punto 
+crear_punto (double x, double y)
+{
+	punto p;
+	p.x = x;
+	p.y = y;
+
+	return p;
+}
+
+punto punto_medio (punto p1, punto p2)
+{
+	punto p;
+	p.x = (p1.x + p2.x)/2;
+	p.y = (p1.y + p2.y)/2;
+
+	return p;
+}
+
+void 
+punto_get_values (punto p, double *x, double *y)
+{
+	
+	*x = p.x;
+	*y = p.y;
+
+}
+
+recta crear_recta (punto p1, punto p2)
+{	
+	recta r; 
+
+	r.A = p2.y - p1.y;
+	r.B = -(p2.x - p1.x);
+	r.C = -(r.A * p1.x) - (r.B * p1.y);
+
+	return r;
+}
+recta recta_perpendicular (recta r1, punto p1)
+{
+	recta r;
+	
+	r.A = -r1.B;
+	r.B = r1.A;
+	r.C = -((r.A * p1.x)+(r.B * p1.y));
+
+	return r;
+	
+}
+recta recta_paralela (recta r1, punto p, double distancia)
+{	
+	recta r;
+
+	r.A = r1.A;
+	r.B = r1.B;
+	r.C = (distancia*(sqrt((r1.A*r1.A)+(r1.B*r1.B))))-((r1.A*p.x)+ (r1.B * p.y));
+	if (r1.A == 0)
+	{
+		r.B = 1;
+		r.C = r1.C/r1.B + 10;
+	}else if (r1.B == 0)
+	{	
+		r.A = 1;
+		r.C = r1.C/r1.A + 10;
+	} 
+	
+	return r;
+}
+punto interseccion_rectas (recta r1, recta r2)
+{
+	punto p;
+	
+	if (r1.A == 0)
+	{
+		p.y = -r1.C/r1.B;
+		p.x = -r2.C;
+	}
+	else if (r1.B == 0)
+	{
+		p.y = -r2.C;
+		p.x = -r1.C/r1.A;
+	}
+	else
+	{
+		p.y = (-(r2.A * r1.C - r1.A * r2.C))/ (r2.A * r1.B - r1.A * r2.B);
+		p.x = ((-r2.B * p.y)-r2.C)/r2.A;
+	}
+	
+	return p;
+}


Property changes on: trunk/src/components/visualHFSM-3.1/recta.c
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/recta.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/recta.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/recta.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,34 @@
+#include <stdio.h>
+
+
+typedef struct punto {
+	double x;
+	double y;
+} punto; 
+
+typedef struct recta {
+	double A;
+	double B;
+	double C;
+} recta; 
+
+punto crear_punto (double x, double y);
+punto punto_medio (punto p1, punto p2);
+void punto_get_values (punto p, double *x, double *y);
+
+/*Ax + By + C = 0
+A=y2-y1 B=x2-x1  C=((y2-y1)*x1)+((x2-x1)*y1) */
+recta crear_recta (punto p1, punto p2);
+
+/* Recta perpendicular a otra y que pase por un punto
+ A'=-B B=A C=-((A*x)+(B*y));*/
+recta recta_perpendicular (recta r1, punto p1);
+
+/* Recta paralela a otra a una distancia 
+ d(p,R)=|Ax+By+C|/((A^2)+(B^2))^1/2 // A'=A B'=B*/
+recta recta_paralela (recta r1, punto p1, double distancia);
+
+punto interseccion_rectas (recta r1, recta r2);
+
+
+


Property changes on: trunk/src/components/visualHFSM-3.1/recta.h
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/reemplazar.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/reemplazar.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/reemplazar.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,96 @@
+
+
+#include "reemplazar.h"
+
+
+
+/* Halla la longitud de una cadena, hace las veces de strlen */
+int longitud(char *cadena)
+{
+   int i;
+   for(i=0; ;i++)
+     if(cadena[i]=='\0')
+       break;
+   return i;
+}
+
+/* Halla la posicion de aparicion de una subcadena en una cadena */
+int posicion(char *cadena, char *subcadena)
+{
+   int i, j;
+
+   for(i=0; i<longitud(cadena); i++)
+   {
+       if(cadena[i]==subcadena[0])
+       {
+     //if(longitud(cadena)-i < longitud(subcadena))
+     //   return -1;
+
+     for(j=0; j<longitud(subcadena); j++)
+     {
+        if(cadena[i+j]!=subcadena[j])
+      break;
+     }
+     if(j==longitud(subcadena))
+       return i;
+       }
+   }
+
+   return -1;
+}
+
+/*
+   Busca una subcadena en una cadena, y la reemplaza por otra;
+   retorna el numero de veces que se hizo el reemplazo
+*/
+int reemplazar2(char *cadena, char *subcadena, char *reemplazo)
+{
+   int ocurrencias = 0;
+   int i, indice, posiciones, temp, l_cadena, l_subcadena, l_reemplazo;
+   int tam;
+   char * cadena_aux;
+
+   l_cadena = longitud(cadena);
+   l_reemplazo = longitud(reemplazo);
+   l_subcadena = longitud(subcadena);
+
+   for(;;)
+   {
+     indice = posicion(cadena, subcadena);
+     if(indice==-1)
+   	break;
+     else
+     {
+	printf("NO -1");
+	tam = l_subcadena-l_reemplazo;
+	if (tam < 0)
+	{
+		printf("0");
+		for(i=indice; i<indice+l_subcadena; i++)
+       			cadena_aux[i-indice] = cadena[i];
+		cadena_aux[i] = '\0';
+		printf("1");
+		for(i=indice; i<indice+l_reemplazo; i++)
+       			cadena[i]=reemplazo[i-indice];
+		printf("2");
+		for(i=indice+l_reemplazo; i<longitud(cadena_aux); i++)
+       			cadena[i]=cadena_aux[i-indice-l_reemplazo];
+	}else
+   	{
+	for(i=indice; i<indice+l_reemplazo; i++)
+       		cadena[i]=reemplazo[i-indice];
+
+   	/* Si la longitud del reemplazo es menor que la de la subcadena,
+     	recorre caracteres siguientes, posiciones a la izquierda */
+  	 posiciones=l_subcadena-l_reemplazo;
+   	if(posiciones>0)
+      		for(temp=i; temp<=l_cadena; temp++)
+         		cadena[temp]=cadena[temp+posiciones];
+	}
+   	ocurrencias++;
+     }
+   }
+
+   return ocurrencias;
+}
+


Property changes on: trunk/src/components/visualHFSM-3.1/reemplazar.cpp
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/reemplazar.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/reemplazar.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/reemplazar.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,32 @@
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined __REEMPLAZAR_H
+#define __REEMPLAZAR_H
+
+
+#include <stdio.h>
+
+
+
+/* Halla la longitud de una cadena, hace las veces de strlen */
+int longitud(char *cadena);
+
+/* Halla la posicion de aparicion de una subcadena en una cadena */
+int posicion(char *cadena, char *subcadena);
+
+/*
+   Busca una subcadena en una cadena, y la reemplaza por otra;
+   retorna el numero de veces que se hizo el reemplazo
+*/
+int reemplazar(char *cadena, char *subcadena, char *reemplazo);
+
+
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif


Property changes on: trunk/src/components/visualHFSM-3.1/reemplazar.h
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/transicion.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/transicion.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/transicion.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,502 @@
+#include <iostream>
+#include <list>
+#include <cstring>
+
+#include "transicion.h"
+#include "interfaz.h"
+#include "recta.h"
+
+//#include "nodo.h"
+
+#include <gtk/gtk.h>
+#include <libgnomecanvas/libgnomecanvas.h>
+
+int cont_transiciones = 0;
+
+
+extern list <tNodo> ListaElementos;
+extern list <tTransicion> ListaTransiciones;
+//extern list <transicion_aux> ListaTransicionesTemporales;
+//extern list <GtkWidget *> ListaBotones;
+//extern GnomeCanvasGroup *root;
+
+GnomeCanvasItem * get_box (GnomeCanvasItem * item)
+{
+	GList * list_items;
+
+	list_items = GNOME_CANVAS_GROUP (item)->item_list;
+	
+	return (GnomeCanvasItem *) g_list_nth_data (list_items, g_list_length(list_items)-1);
+}
+
+/*   Cambia el id dela transicion   */
+bool cambiar_item_transicion (GnomeCanvasItem * item, GnomeCanvasItem * new_item)
+{
+	list<tTransicion>::iterator posLinea;
+	bool b = false;
+
+	posLinea = ListaTransiciones.begin();
+
+	while( (posLinea != ListaTransiciones.end()) && (posLinea->item != item) )
+	{
+
+		posLinea++;
+
+	}
+
+	if (posLinea->item == item){
+
+		posLinea->item = new_item;
+		b = true;
+
+	}
+
+	return b;
+}
+
+/***** Pintar AutoTransicion *****/
+/*   */
+
+int num_autotransiciones (GnomeCanvasItem *nodo)
+{
+	list<tTransicion>::iterator posLinea;
+	int n = 0;
+
+	posLinea = ListaTransiciones.begin();
+
+	while( posLinea != ListaTransiciones.end() )
+	
+	{
+		if ((posLinea->origen == nodo) && (posLinea->destino == nodo))
+			n++;
+
+		posLinea++;
+		
+	}
+
+	return n;
+}
+
+GnomeCanvasItem *
+pinta_autotransicion (GnomeCanvasItem *nodo)
+{
+	double I1x1, I1x2, I1y1, I1y2; // Puntos del orgien
+	double x1,y1;
+	int n;
+	GnomeCanvasPoints *points = gnome_canvas_points_new (4);
+	GnomeCanvasItem * item;
+	GnomeCanvasGroup * group;
+	GnomeCanvas *canvas;
+	
+	g_object_get (G_OBJECT (nodo), "x1", &I1x1, NULL);
+	g_object_get (G_OBJECT (nodo), "y1", &I1y1, NULL);
+	g_object_get (G_OBJECT (nodo), "x2", &I1x2, NULL);
+	g_object_get (G_OBJECT (nodo), "y2", &I1y2, NULL);
+	
+	x1 = (I1x1 + I1x2)/2;
+	y1 = (I1y1 + I1y2)/2 + abs(I1y1 - I1y2)/2;
+	
+	canvas = nodo->canvas;
+
+	group = GNOME_CANVAS_GROUP (gnome_canvas_item_new (GNOME_CANVAS_GROUP(canvas->root),  
+                                        gnome_canvas_group_get_type (),
+                                        "x", 0,
+                                        "y", 0,
+                                        NULL));
+
+	/*item = gnome_canvas_item_new(group,
+                        	gnome_canvas_ellipse_get_type(),
+                        	"x1", x1-7,
+                        	"y1", y1,
+                        	"x2", x1+7,
+                        	"y2", y1+14,
+                        	//"fill_color_rgba", 0x00ffffff,
+                        	"outline_color", "black",
+                        	"width_units", 1.0,
+                        	NULL);
+                	
+        points->coords[0] = x1-0.5;
+	points->coords[1] = y1+14;
+	points->coords[2] = x1+0.5;
+	points->coords[3] = y1+14 + 0.75;
+	
+        gnome_canvas_item_new(group, gnome_canvas_line_get_type (),
+                	"points", points,
+			"fill_color", NULL, 
+			"width_units", 1.0,  
+			//"smooth", TRUE,
+			//"first_arrowhead", TRUE,
+                        "last_arrowhead", TRUE,
+			"arrow_shape_a", 3.0, 
+			"arrow_shape_b", 8.0,
+			"arrow_shape_c", 3.0, 
+			NULL);*/
+	n = num_autotransiciones (nodo);
+
+	points->coords[0] = x1-8;
+	points->coords[1] = y1-1;
+	points->coords[2] = x1-8;
+	points->coords[3] = y1+20 + (n*20);
+	points->coords[4] = x1+8;
+	points->coords[5] = y1+20 + (n*20);
+	points->coords[6] = x1+8;
+	points->coords[7] = y1-1;
+	item = gnome_canvas_item_new(group, gnome_canvas_line_get_type (),
+                	"points", points,
+			"fill_color", "orange", 
+			"width_units", 1.0,  
+			"smooth", TRUE,
+			"join-style", GDK_JOIN_BEVEL,
+			//"first_arrowhead", TRUE,
+                        "last_arrowhead", TRUE,
+			"arrow_shape_a", 3.0, 
+			"arrow_shape_b", 8.0,
+			"arrow_shape_c", 3.0, 
+			NULL);
+        create_drag_box (group, (char *)"box", x1+1, y1+20+(n*20), G_CALLBACK (highlight_box_edit));
+        
+        return GNOME_CANVAS_ITEM(group);
+}
+
+
+GnomeCanvasGroup * repintar_transicion (GnomeCanvasGroup *root, GnomeCanvasItem *origen, GnomeCanvasItem *destino, double x, double y)
+{
+	GnomeCanvasItem *item1,*item2;
+	GnomeCanvasGroup *group;
+	
+	double I1x1, I1x2, I1y1, I1y2; // Puntos del orgien
+	double I2x1, I2x2, I2y1, I2y2; // Puntos del destino
+	
+
+	g_object_get (G_OBJECT (origen), "x1", &I1x1, NULL);
+	g_object_get (G_OBJECT (origen), "y1", &I1y1, NULL);
+	g_object_get (G_OBJECT (origen), "x2", &I1x2, NULL);
+	g_object_get (G_OBJECT (origen), "y2", &I1y2, NULL);
+
+	g_object_get (G_OBJECT (destino), "x1", &I2x1, NULL);
+	g_object_get (G_OBJECT (destino), "y1", &I2y1, NULL);
+	g_object_get (G_OBJECT (destino), "x2", &I2x2, NULL);
+	g_object_get (G_OBJECT (destino), "y2", &I2y2, NULL);
+
+	//Punto medio circulo origen
+	double Xm1 = ((I1x2 + I1x1) / 2);
+	double Ym1 = ((I1y2 + I1y1) / 2);
+	punto pCirculoOrigen = crear_punto (Xm1, Ym1);
+
+	//Punto medio circulo destino
+	double Xm2 = ((I2x2 + I2x1) / 2);
+	double Ym2 = ((I2y2 + I2y1) / 2);
+	punto pCirculoDestino = crear_punto (Xm2, Ym2);
+
+	// Punto Medio Transicion
+	punto pMedioTransicion = crear_punto (x, y);
+
+	recta recta_origen_pm = crear_recta (pCirculoOrigen, pMedioTransicion);
+
+	recta recta_destino_pm = crear_recta (pCirculoDestino, pMedioTransicion);
+
+	// Ecuacion Recta Perpendicular que pasa por el punto medio del circulo origen
+	recta recta_perpendicular_circulo_origen = recta_perpendicular (recta_origen_pm, pCirculoOrigen);
+	
+	// Ecuacion Recta Paralela	d=(ax+by+c)/(a^2 + b^2)^1/2
+	recta recta_paralela1 = recta_paralela (recta_perpendicular_circulo_origen, pCirculoOrigen, -20);
+
+
+	// Ecuacion Recta Perpendicular que pasa por el punto medio del circulo destino
+	recta recta_perpendicular_circulo_destino = recta_perpendicular (recta_destino_pm, pCirculoDestino);
+	
+	// Ecuacion Recta Paralela	d=(ax+by+c)/(a^2 + b^2)^1/2
+	recta recta_paralela2 = recta_paralela (recta_perpendicular_circulo_destino, pCirculoDestino, -20);
+
+	double YI1, XI1; 
+	punto pInterseccion = interseccion_rectas (recta_origen_pm, recta_paralela1);
+	punto_get_values (pInterseccion, &XI1, &YI1);
+	
+	double YI2, XI2;
+	pInterseccion = interseccion_rectas (recta_destino_pm, recta_paralela2);
+	punto_get_values (pInterseccion, &XI2, &YI2);
+
+	group = GNOME_CANVAS_GROUP (gnome_canvas_item_new (root,
+                                             gnome_canvas_group_get_type (),
+                                             "x", 0,
+                                             "y", 0,
+                                             NULL));
+
+	GnomeCanvasPoints *points = gnome_canvas_points_new (2);
+	
+
+
+	points->coords[0] = XI1;
+	points->coords[1] = YI1;
+	points->coords[2] = x;
+	points->coords[3] = y;
+
+	item1 = gnome_canvas_item_new(group, gnome_canvas_line_get_type (),
+                        	"points", points,
+				"fill_color", "orange", 
+				"width_units", 1.0,  
+				//"first_arrowhead", TRUE,
+                              	//"last_arrowhead", TRUE,
+				//"arrow_shape_a", 8.0, 
+				//"arrow_shape_b", 8.0,
+				//"arrow_shape_c", 8.0, 
+				NULL);
+
+	points->coords[0] = x;
+	points->coords[1] = y;
+	points->coords[2] = XI2;
+	points->coords[3] = YI2;
+
+	item2 = gnome_canvas_item_new(group, gnome_canvas_line_get_type (),
+                        	"points", points,
+				"fill_color", "orange", 
+				"width_units", 1.0,  
+				//"first_arrowhead", TRUE,
+                              	"last_arrowhead", TRUE,
+				"arrow_shape_a", 8.0, 
+				"arrow_shape_b", 8.0,
+				"arrow_shape_c", 8.0, 
+				NULL);
+
+	gnome_canvas_points_free (points);
+
+
+	return group;
+
+}
+
+GnomeCanvasGroup * repintar_transicion_nodo (GnomeCanvasGroup *root, GnomeCanvasItem *transicion, GnomeCanvasItem *nodo, char * direccion)
+{
+	GList * list_items, *list_aux;	
+	GnomeCanvasItem *item, *box, *arrow;
+	GnomeCanvasGroup *group;
+	GnomeCanvasPoints *points;
+	double x1,y1,x2,y2, x, y;
+
+	group = GNOME_CANVAS_GROUP (transicion);
+	list_items = group->item_list;
+
+	box = GNOME_CANVAS_ITEM(g_list_nth_data (list_items, 2));
+	
+
+	g_object_get (G_OBJECT (box), "x1", &x1, NULL);
+	g_object_get (G_OBJECT (box), "y1", &y1, NULL);
+	g_object_get (G_OBJECT (box), "x2", &x2, NULL);
+	g_object_get (G_OBJECT (box), "y2", &y2, NULL);
+
+	x = (x1+x2)/2;
+	y = (y1+y2)/2;
+		
+
+	double I1x1, I1x2, I1y1, I1y2; // Puntos del nodo
+	
+	g_object_get (G_OBJECT (nodo), "x1", &I1x1, NULL);
+	g_object_get (G_OBJECT (nodo), "y1", &I1y1, NULL);
+	g_object_get (G_OBJECT (nodo), "x2", &I1x2, NULL);
+	g_object_get (G_OBJECT (nodo), "y2", &I1y2, NULL);
+			
+	//Punto medio nodo
+	double Xm1 = ((I1x2 + I1x1) / 2);
+	double Ym1 = ((I1y2 + I1y1) / 2);
+	punto pNodo = crear_punto (Xm1, Ym1);
+
+	// Punto Medio Transicion
+	punto pMedioTransicion = crear_punto (x, y);
+
+	recta recta_nodo_pm = crear_recta (pNodo, pMedioTransicion);
+
+	// Ecuacion Recta Perpendicular que pasa por el punto medio del circulo origen
+	recta recta_perpendicular_nodo = recta_perpendicular (recta_nodo_pm, pNodo);
+	
+	// Ecuacion Recta Paralela	d=(ax+by+c)/(a^2 + b^2)^1/2
+	recta recta_paralela_nodo = recta_paralela (recta_perpendicular_nodo, pNodo, -20);
+
+	double YI1, XI1; 
+	punto pInterseccion = interseccion_rectas (recta_nodo_pm, recta_paralela_nodo);
+	punto_get_values (pInterseccion, &XI1, &YI1);
+
+	points = gnome_canvas_points_new (2);
+
+	if (strcmp ( direccion, (char *) "origen" ) == 0)
+	{
+		arrow = (GnomeCanvasItem *) g_list_nth_data (list_items, 0);
+		list_items=g_list_next(list_items);
+		gtk_object_destroy (GTK_OBJECT (arrow));
+				
+
+		points->coords[0] = XI1;
+		points->coords[1] = YI1;
+		points->coords[2] = x;
+		points->coords[3] = y;
+
+		item = gnome_canvas_item_new(group, gnome_canvas_line_get_type (),	// Si se define el "parent" del item como root da fallo de segmentacion
+	                        	"points", points,				
+					"fill_color", "orange", 
+					"width_units", 1.0,  
+					NULL);
+
+		//list_items = g_list_insert (list_items, (gpointer)item, 0);	
+		list_aux = g_list_nth  (list_items, 2);					// Reordenar los elementos dentro del grupo
+		list_items = g_list_remove_link (list_items, list_aux);
+		list_items = g_list_insert (list_items, (gpointer)item, 0);
+	}
+	else if (strcmp ( direccion, (char *) "destino" ) == 0)
+	{
+		arrow = (GnomeCanvasItem *) g_list_nth_data (list_items, 1);
+		//list_aux = g_list_nth  (list_items, 2);	
+		gtk_object_destroy (GTK_OBJECT (arrow));
+		//list_items = g_list_concat (list_items, list_aux);
+		
+
+		points->coords[0] = x;
+		points->coords[1] = y;
+		points->coords[2] = XI1;
+		points->coords[3] = YI1;
+
+		item = gnome_canvas_item_new(group, gnome_canvas_line_get_type (),
+	                        	"points", points,
+					"fill_color", "orange", 
+					"width_units", 1.0,  
+	                              	"last_arrowhead", TRUE,
+					"arrow_shape_a", 8.0, 
+					"arrow_shape_b", 8.0,
+					"arrow_shape_c", 8.0, 
+					NULL);
+
+		//list_items = g_list_insert (list_items, (gpointer)item, 1);
+		list_aux = g_list_nth  (list_items, 2);
+		list_items = g_list_remove_link (list_items, list_aux);
+		list_items = g_list_insert (list_items, (gpointer)item, 1);
+	}
+	
+	group->item_list = list_items;
+
+	//gnome_canvas_item_reparent (box, transicion);
+
+	return GNOME_CANVAS_GROUP (group);
+}
+
+
+void borrar_transicion (GnomeCanvasItem *origen, GnomeCanvasItem *destino, char * type)
+{
+	list<tTransicion>::iterator posLinea;
+	list<tNodo>::iterator pos2;
+	list<GnomeCanvasItem *>::iterator pos3;
+	list<GnomeCanvasItem *>::iterator posAux;
+
+	posLinea = ListaTransiciones.begin();
+
+	while( (posLinea != ListaTransiciones.end()) && (posLinea->origen != origen) && (posLinea->destino != destino))
+	{
+
+		posLinea++;
+
+	}
+
+
+	if (strcmp ( type, (char *) "total" ) == 0){
+		
+		gtk_object_destroy (GTK_OBJECT (origen));
+		gtk_object_destroy (GTK_OBJECT (destino));
+
+	}
+	else if (strcmp ( type, (char *) "origen" ) == 0){
+
+		gtk_object_destroy (GTK_OBJECT (origen));
+
+	}
+	else if (strcmp ( type, (char *) "destino" ) == 0){
+
+		gtk_object_destroy (GTK_OBJECT (destino));
+
+	}else
+		cout << "tipo incorrecto" << endl;
+
+	
+
+
+}
+void add_transicion_lista (GnomeCanvasItem *transicion, GnomeCanvasItem *origen, GnomeCanvasItem *destino, GnomeCanvasItem * nombre, string codigo, int tiempo)
+{
+
+	tTransicion l;
+	gchararray name;
+	//char *name;
+
+	l.item = transicion;
+	l.origen = origen;
+	l.destino = destino;
+	l.codigo = codigo;
+	l.tiempo = tiempo;
+	l.item_nombre = nombre;
+	if (nombre != NULL){
+		g_object_get (G_OBJECT (nombre), "text", &name, NULL);
+		l.nombre = name;
+	}else
+		l.nombre = "";
+
+	ListaTransiciones.push_back(l);
+
+
+
+
+
+
+
+}
+
+/***	Eliminar la transicion de la lista	***/
+void t_eliminar_transicion_lista (GnomeCanvasItem *transicion)
+{
+	list<tTransicion>::iterator posLinea;
+
+	posLinea = ListaTransiciones.begin();
+
+	while( (posLinea != ListaTransiciones.end()) && (posLinea->item != transicion) )
+		posLinea++;
+
+	n_borrar_transicion_lista (posLinea->origen,transicion);
+	
+	if (posLinea->destino != posLinea->origen)
+		n_borrar_transicion_lista (posLinea->destino,transicion);
+
+	ListaTransiciones.erase(posLinea);
+
+
+}
+
+
+int 
+numero_transiciones (GnomeCanvasItem *estado1, GnomeCanvasItem *estado2)
+{
+	list<tTransicion>::iterator pos;
+	int contador = 0;
+
+	pos = ListaTransiciones.begin();
+
+	while ( pos !=  ListaTransiciones.end() )
+	{	
+		if (((pos->origen == estado1) && (pos->destino == estado2)) || ((pos->origen == estado2) && (pos->destino == estado1)))
+			contador++;
+		pos++;
+	}
+	return contador;
+
+}
+
+void eliminar_nombre (GnomeCanvasItem *transicion)
+{
+	list<tTransicion>::iterator posLinea;
+
+	posLinea = ListaTransiciones.begin();
+
+	while( (posLinea != ListaTransiciones.end()) && (posLinea->item != transicion) )
+		posLinea++;
+
+	posLinea->nombre="";
+	
+	gtk_object_destroy (GTK_OBJECT (posLinea->item_nombre));
+
+
+}
+


Property changes on: trunk/src/components/visualHFSM-3.1/transicion.cpp
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/transicion.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/transicion.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/transicion.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,77 @@
+#include <iostream>
+
+#include <gtk/gtk.h>
+#include <libgnomecanvas/libgnomecanvas.h>
+
+
+
+using namespace std;
+
+
+typedef struct tipoTransicion {
+	//int id;
+	GnomeCanvasItem * item;	// Item que representa la transición. Está formado a su vez por 3 item: 2 líneas y un punto de acción en la unión de ambas (box).
+				// Posicion 0 inicio recta, posicion 1 final recta, posicion 2 box.
+	//int origenX, origenY;		
+	//int destinoX, destinoY;
+	//double pMedioX, pMedioY;	// Posición del punto de acción de la transición.
+	GnomeCanvasItem * origen;	// Nodo origen
+	GnomeCanvasItem * destino;	// Nodo destino
+	string nombre;			// Nombre de la transicion. "" por defecto
+	GnomeCanvasItem * item_nombre;	// Item del nombre de la transición.
+	//GnomeCanvasItem * orientacion;	// Triangulo flecha
+	string codigo;
+	int tiempo;
+} tTransicion; 
+
+typedef struct transicion_aux {		// Transiciones temporales. Usadas para pintar las transiciones despues de cargar un fichero.
+	GnomeCanvasItem *origen;
+	GnomeCanvasItem *destino;
+	int origen_xml;
+	int destino_id;
+	int tiempo;
+	string codigo;
+	string nombre;
+	GnomeCanvasItem *item;
+} transicion_aux;
+
+/*   Devuelve el identificador de la transición   */
+int id_transicion ();
+
+/*      */
+GnomeCanvasItem * get_box (GnomeCanvasItem * item);
+
+/*   Cambia el id dela transicion   */
+bool cambiar_item_transicion (GnomeCanvasItem * item, GnomeCanvasItem * new_item);
+
+/***** Pintar Transiciones *****/
+
+/*** Pintar AutoTransicion ***/
+GnomeCanvasItem *pinta_autotransicion (GnomeCanvasItem *item);
+
+/***	Repintar transicion al mover elementos	***/
+// origen_ref hace referencia al nodo que se está moviendo. Si se está moviendo el centro de la transicion poner origen_ref a NULL.
+// Devuelve el grupo que hace referencia a los elementos de la transicion. Si origen_ref es NULL sólo se devuelven las lineas que componen la transicion.
+GnomeCanvasGroup * repintar_transicion (GnomeCanvasGroup *root, GnomeCanvasItem *origen, GnomeCanvasItem *destino, double x, double y);
+
+// Al mover nodos
+// Devuelve el grupo completo de la transicion
+GnomeCanvasGroup * repintar_transicion_nodo (GnomeCanvasGroup *root, GnomeCanvasItem *transicion, GnomeCanvasItem *nodo, char * direccion);
+
+/***   Borra la transicion   ***/
+
+//	type puede ser "origen", "destino" o "total". Depnde de si se quiere borrar toda la transcicion o la mitad de ella
+void borrar_transicion (GnomeCanvasItem *origen, GnomeCanvasItem *destino, char * type);
+
+//void borrar_transicion (GnomeCanvasItem *transicion, char * type);
+
+/***	Lista Transiciones	***/
+void add_transicion_lista (GnomeCanvasItem *transicion, GnomeCanvasItem *origen, GnomeCanvasItem *destino, GnomeCanvasItem * nombre, string codigo, int tiempo);
+
+//	Eliminar transicion lista	//
+void t_eliminar_transicion_lista (GnomeCanvasItem *transicion);
+
+/***	Otros	***/
+int numero_transiciones (GnomeCanvasItem *estado1, GnomeCanvasItem *estado2);
+
+void eliminar_nombre (GnomeCanvasItem *transicion);


Property changes on: trunk/src/components/visualHFSM-3.1/transicion.h
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/ventanas.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/ventanas.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ventanas.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,1008 @@
+#include <iostream>
+#include <list>
+#include <string.h>
+
+#include "nodo.h"
+#include "transicion.h"
+#include "ventanas.h"
+#include "int2string.h"
+ 
+#include <gtk/gtk.h>
+#include <libgnomecanvas/libgnomecanvas.h>
+#include <libglade-2.0/glade/glade.h>
+
+#include <gtksourceview/gtksourceview.h>
+#include <gtksourceview/gtksourcebuffer.h>
+#include <gtksourceview/gtksourcelanguage.h>
+#include <gtksourceview/gtksourcelanguagemanager.h>
+
+
+list <nVentana> ListaVentanas;
+
+extern list <tNodo> ListaElementos;
+extern list <tTransicion> ListaTransiciones;
+extern int color;
+
+extern string variables;
+extern string funciones;
+extern importar imp;
+extern int tiempoIteracion;
+
+extern GnomeCanvasGroup *root;
+
+extern GladeXML *prog;
+
+void destroy (GtkWidget *widget, gpointer data)
+{
+
+	gtk_widget_destroy (gtk_widget_get_toplevel(widget));
+
+}
+
+void restaurar_color (GtkWidget *widget, gpointer data)
+{
+	GnomeCanvasItem *item, *box;
+	list<tNodo>::iterator posNodo;
+
+	item = GNOME_CANVAS_ITEM (g_object_get_data (G_OBJECT (gtk_widget_get_toplevel(widget)), "item"));
+
+	if (GNOME_IS_CANVAS_GROUP (item)){
+		box = get_box (item);
+		//gnome_canvas_item_set (box,			       
+		//		"fill_color", NULL,
+		//	       	NULL);		
+		change_item_color (box,7);			
+
+	}else{
+
+		posNodo = ListaElementos.begin();
+
+		while( (posNodo != ListaElementos.end()) && (posNodo->item != item))
+	  		posNodo++;
+
+		if (posNodo->idHijo !=0){
+			
+			change_item_color (item,2);
+
+		}else{
+
+			change_item_color (item,3);
+
+		}
+
+	}
+
+}
+
+
+void aplicar (GtkButton *button, gpointer data)
+{
+	double x1, x2, y1, y2;
+	double x,y;
+
+	list<tNodo>::iterator posNodo;
+	list<tTransicion>::iterator posTransicion;
+
+	GnomeCanvasItem *item, *box;
+	GnomeCanvasItem *item_nombre;
+
+	GList * list_items;
+
+	GtkWidget *entry = GTK_WIDGET (g_object_get_data (G_OBJECT (button), "entry"));
+                                           
+	const char *texto = gtk_entry_get_text(GTK_ENTRY(entry));
+
+	item = GNOME_CANVAS_ITEM (g_object_get_data (G_OBJECT (button), "item"));
+	
+	
+
+	//cout << "Centro: " << x << " " << y << endl;
+	
+	posNodo = ListaElementos.begin();
+
+	while( (posNodo != ListaElementos.end()) && (posNodo->item != item))
+  		posNodo++;
+
+	if (posNodo == ListaElementos.end()){
+
+		posTransicion = ListaTransiciones.begin();
+
+		while( (posTransicion != ListaTransiciones.end()) && (posTransicion->item != item) )
+			posTransicion++;
+
+		if (posTransicion->nombre != "")	
+			gtk_object_destroy (GTK_OBJECT (posTransicion->item_nombre));
+
+		list_items = GNOME_CANVAS_GROUP(item)->item_list;
+
+		box = (GnomeCanvasItem *) g_list_nth_data (list_items, g_list_length (list_items)-1);  
+
+		g_object_get (G_OBJECT (box), "x1", &x1, NULL);
+		g_object_get (G_OBJECT (box), "y1", &y1, NULL);
+		g_object_get (G_OBJECT (box), "x2", &x2, NULL);
+		g_object_get (G_OBJECT (box), "y2", &y2, NULL);
+
+		x = (x2+x1)/2;
+		y = (y2+y1)/2;
+
+		item_nombre = gnome_canvas_item_new (root,
+	             gnome_canvas_text_get_type (),
+             			            "text", texto,
+             			            "x", (x2+x1)/2,
+             			            "y", (y2+y1)/2 + 5 ,
+             			            "font", "Sans 28",
+				    	    "anchor", GTK_ANCHOR_N,
+     			                    "fill_color", "black",
+    			                     NULL); 
+
+		posTransicion->nombre = texto;
+
+		posTransicion->item_nombre = item_nombre;
+
+	}
+	else {
+		if (posNodo->nombre != "")	
+			gtk_object_destroy (GTK_OBJECT (posNodo->item_nombre));
+
+		g_object_get (G_OBJECT (item), "x1", &x1, NULL);
+		g_object_get (G_OBJECT (item), "y1", &y1, NULL);
+		g_object_get (G_OBJECT (item), "x2", &x2, NULL);
+		g_object_get (G_OBJECT (item), "y2", &y2, NULL);
+			
+
+		x = (x2+x1)/2;
+		y = (y2+y1)/2;
+
+		item_nombre = gnome_canvas_item_new (GNOME_CANVAS_GROUP(item->parent),
+		             gnome_canvas_text_get_type (),
+	             			            "text", texto,
+	             			            "x", (x2+x1)/2,
+	             			            "y", (y2+y1)/2,
+	             			            "font", "Sans 28",
+					    	    "anchor", GTK_ANCHOR_CENTER,
+	     			                    "fill_color", "black",
+	    			                     NULL); 
+
+
+		posNodo->nombre = texto;
+
+		posNodo->item_nombre = item_nombre;
+
+	}
+
+	gnome_canvas_item_raise_to_top (item_nombre);
+
+	gtk_widget_destroy (gtk_widget_get_toplevel(GTK_WIDGET(button)));
+
+
+
+}
+
+
+GtkWidget * new_name_windows (GnomeCanvasItem *item)
+{
+	GladeXML *xml;
+	GtkWidget *win; /*Main window*/
+	GtkWidget *botonAplicar, *botonCancelar;
+
+	//GladeInterface *inter;
+
+	/*Inicializamos Glade*/
+   	glade_init();
+
+	/*Cargamos fichero .Glade donde esta guardada la estructura de la nueva ventana*/
+  	xml = glade_xml_new("gui/nombre.glade", NULL, NULL);
+
+	if (xml == NULL)
+	{
+		printf ("NO");
+		return 0;
+	}
+	
+	/*Cargamos la nueva ventana*/
+	win = glade_xml_get_widget(xml, "nombre");
+
+	/*Conectamos Señales*/	
+	//glade_xml_signal_autoconnect(xml);
+
+	/*Ponemos Titulo a la ventana*/	
+	gtk_window_set_title(GTK_WINDOW(win), "Nombrar elemento");
+
+
+	//xml = glade_get_widget_tree (win);
+
+	/*Cargamos el boton*/	
+	botonCancelar = glade_xml_get_widget(xml, "BotonCancelar");	
+	botonAplicar = glade_xml_get_widget(xml, "BotonAplicar");
+	
+	/*Asignamos item*/ 
+	g_object_set_data (G_OBJECT (botonAplicar), "item", item);
+	g_object_set_data (G_OBJECT (win), "item", item);
+
+	/*Asignamos Señal al boton*/
+	//g_signal_connect (G_OBJECT (botonAplicar), "clicked", G_CALLBACK (on_button_clicked), NULL);
+	g_signal_connect (G_OBJECT (botonAplicar), "clicked", G_CALLBACK (aplicar), 0);
+
+	//g_signal_connect (G_OBJECT (botonCancelar), "clicked", G_CALLBACK (restaurar_color), 0);
+
+	g_signal_connect (G_OBJECT (botonCancelar), "clicked", G_CALLBACK (destroy), 0);
+
+	g_signal_connect (G_OBJECT (win), "destroy", G_CALLBACK (restaurar_color),0);
+	
+	g_signal_connect (G_OBJECT (win), "destroy", G_CALLBACK (eliminar_ventana),0);
+	
+
+	GtkWidget *entry = glade_xml_get_widget(xml, "entry1");
+
+	g_object_set_data (G_OBJECT (botonAplicar), "entry", entry);
+
+
+	/*  */
+	list<tNodo>::iterator posNodo;
+	list<tTransicion>::iterator posTransicion;
+	
+	posNodo = ListaElementos.begin();
+
+	color = 3;
+
+	while( (posNodo != ListaElementos.end()) && (posNodo->item != item) )
+  		posNodo++;
+
+	if (posNodo == ListaElementos.end()){
+
+		posTransicion = ListaTransiciones.begin();
+
+		while( (posTransicion != ListaTransiciones.end()) && (posTransicion->item != item) )
+			posTransicion++;
+
+		gtk_entry_set_text(GTK_ENTRY(entry), posTransicion->nombre.c_str());
+
+		color = 7;
+	}else
+		gtk_entry_set_text(GTK_ENTRY(entry), posNodo->nombre.c_str());
+
+
+
+	gtk_widget_show_all(win);
+
+  	
+	return win;
+
+}
+
+ 
+
+
+void cambiar_a (GtkWidget *widget, gpointer data){
+
+	GtkWidget *tiempo = GTK_WIDGET (g_object_get_data (G_OBJECT (widget), "frameN"));
+	GtkWidget *texto = GTK_WIDGET (g_object_get_data (G_OBJECT (widget), "frameT"));
+ 	//gint width, height;
+
+	if (strcmp((gchar *)data, "texto")==0){
+				
+		gtk_widget_show (GTK_WIDGET (texto));
+
+		gtk_widget_hide (GTK_WIDGET (tiempo));
+
+		//width = (gint) (g_object_get_data (G_OBJECT (gtk_widget_get_toplevel(widget)), "width"));
+		//height = (gint) (g_object_get_data (G_OBJECT (gtk_widget_get_toplevel(widget)), "height"));
+
+		//gtk_window_resize (GTK_WINDOW(gtk_widget_get_toplevel(widget)),width,height);
+
+	//	//GtkWidget *windowAux = gtk_window_new(GTK_WINDOW_POPUP);
+
+	//	//gtk_widget_set_tooltip_window (GTK_WIDGET (tiempo), GTK_WINDOW(windowAux));
+	//	//window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+	}
+	else{
+		gtk_widget_show (GTK_WIDGET (tiempo));
+
+		gtk_widget_hide (GTK_WIDGET (texto));
+
+		//gtk_window_get_size (GTK_WINDOW(gtk_widget_get_toplevel(widget)),&width, &height);
+
+		//g_object_set_data (G_OBJECT (gtk_widget_get_toplevel(widget)), "width", (gpointer)width);
+		//g_object_set_data (G_OBJECT (gtk_widget_get_toplevel(widget)), "height", (gpointer)height);
+
+		//gtk_window_resize (GTK_WINDOW(gtk_widget_get_toplevel(widget)),250,1);
+	}
+
+}
+
+void aceptar (GtkWidget *widget, gpointer data)
+{
+	GtkTextIter start, end;
+	GtkSourceBuffer *sBuf;
+	GnomeCanvasItem *item;
+	const char * texto;
+
+	
+	if (strcmp((gchar*)data, "variables")==0) {
+
+		
+		sBuf = GTK_SOURCE_BUFFER (g_object_get_data (G_OBJECT (widget), "bufferVar"));
+		gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER(sBuf), &start);
+		gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER(sBuf), &end);
+		texto = gtk_text_buffer_get_text (GTK_TEXT_BUFFER(sBuf), &start, &end, true); 	
+		variables = texto;
+
+		sBuf = GTK_SOURCE_BUFFER (g_object_get_data (G_OBJECT (widget), "bufferFun"));
+		gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER(sBuf), &start);
+		gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER(sBuf), &end);
+		texto = gtk_text_buffer_get_text (GTK_TEXT_BUFFER(sBuf), &start, &end, true); 
+		funciones = texto;
+		
+
+
+	}else{
+		item = GNOME_CANVAS_ITEM (g_object_get_data (G_OBJECT (widget), "item"));
+
+		if (strcmp((gchar*)data, "estado")==0) {
+			sBuf = GTK_SOURCE_BUFFER (g_object_get_data (G_OBJECT (widget), "buffer"));
+			//gtk_text_buffer_get_selection_bounds (textbuffer, &start, &end);
+
+			gtk_text_buffer_get_start_iter (GTK_TEXT_BUFFER(sBuf), &start);
+
+			gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER(sBuf), &end);
+
+			texto = gtk_text_buffer_get_text (GTK_TEXT_BUFFER(sBuf), &start, &end, true); 
+
+		
+
+			list<tNodo>::iterator pos;
+		
+			pos = ListaElementos.begin();
+
+			while( (pos != ListaElementos.end()) & (pos->item != item) )
+			{
+	  			pos++;
+			}
+			pos->codigo = texto;
+			
+			//change_item_color (item, 3);
+		}else if (strcmp((gchar*)data, "transicion")==0) {
+			list<tTransicion>::iterator pos;
+		
+			pos = ListaTransiciones.begin();
+
+			while( (pos != ListaTransiciones.end()) & (pos->item != item) )
+			{
+	  				pos++;
+			}
+
+			GtkWidget *toggle_button = GTK_WIDGET (g_object_get_data (G_OBJECT (widget), "rbTiempo"));
+
+			if (GTK_TOGGLE_BUTTON (toggle_button)->active){
+				GtkWidget *entry = GTK_WIDGET (g_object_get_data (G_OBJECT (widget), "entryTemp"));
+	                                           
+				texto = gtk_entry_get_text(GTK_ENTRY(entry));
+				
+				pos->tiempo = atoi(texto); 
+				pos->codigo = "";
+
+			}else{
+				GtkWidget *entry = GTK_WIDGET (g_object_get_data (G_OBJECT (widget), "entryCond"));
+	                                           
+				texto = gtk_entry_get_text(GTK_ENTRY(entry));
+				
+				pos->codigo = texto;
+				pos->tiempo = -1; 
+			}
+
+			//change_item_color (get_box (item), 7);
+		}
+	}
+	
+	gtk_widget_destroy (gtk_widget_get_toplevel(GTK_WIDGET(widget)));
+	//g_signal_emit_by_name (GTK_OBJECT (window), "delete_event");
+
+}
+
+GtkWidget * new_text_windows (GnomeCanvasItem *item, gchar *type)
+{
+	GladeXML *xml;
+	GtkWidget *win;	/*Main window*/
+	GtkWidget *botonAceptar, *botonCancelar, *toggle_button_texto, *toggle_button_tiempo, *entry; 
+
+	/*SourveView variables*/
+	GtkWidget *pScrollWin, *sView;
+ 	PangoFontDescription *font_desc;
+  	GtkSourceLanguageManager *lm;
+  	GtkSourceBuffer *sBuf;
+	GtkSourceLanguage *language = NULL;
+
+	//GladeInterface *inter;
+
+	/*Inicializamos Glade*/
+   	glade_init();
+
+	/*Cargamos fichero .Glade donde esta guardada la estructura de la nueva ventana*/
+	if (strcmp((const char *)type, "transicion") == 0){
+		xml=glade_xml_new("gui/EdicionTransicion.glade", NULL, NULL);
+
+		if (xml == NULL)
+		{
+			printf ("NO");
+		return 0;
+		}
+		/*Conectamos Señales*/	
+
+		win = glade_xml_get_widget(xml, "window1");
+
+		/*Ponemos Titulo a la ventana*/	
+		gtk_window_set_title(GTK_WINDOW(win), "Código Transicion ");
+
+		g_signal_connect (G_OBJECT (glade_xml_get_widget(xml,"rbTexto")), "released", G_CALLBACK (cambiar_a), (gpointer)"texto");
+
+		g_object_set_data (G_OBJECT (glade_xml_get_widget(xml,"rbTexto")), "frameN", glade_xml_get_widget(xml, "frameN"));
+		g_object_set_data (G_OBJECT (glade_xml_get_widget(xml,"rbTexto")), "frameT", glade_xml_get_widget(xml, "frameT"));
+
+		g_signal_connect (G_OBJECT (glade_xml_get_widget(xml,"rbTiempo")), "released", G_CALLBACK (cambiar_a), (gpointer)"tiempo");
+
+		g_object_set_data (G_OBJECT (glade_xml_get_widget(xml,"rbTiempo")), "frameN", glade_xml_get_widget(xml, "frameN"));
+		g_object_set_data (G_OBJECT (glade_xml_get_widget(xml,"rbTiempo")), "frameT", glade_xml_get_widget(xml, "frameT"));
+		
+	}else {
+  		xml=glade_xml_new("gui/EdicionNodo.glade", NULL, NULL);
+
+		if (xml == NULL)
+		{
+			printf ("NO");
+		return 0;
+		}
+	
+		/*Cargamos la nueva ventana*/
+		win = glade_xml_get_widget(xml, "dialog1");
+
+		/*Ponemos Titulo a la ventana*/	
+		gtk_window_set_title(GTK_WINDOW(win), "Código Estado");
+		
+		/*Cargamos el boton*/	
+		//GtkWidget *numero = glade_xml_get_widget(xml, "button1");
+
+		
+	
+
+		/*Conectamos Señales*/	
+		glade_xml_signal_autoconnect(xml);
+
+		/*Situamos la ventana en el medio*/
+		//gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER);
+	
+		/*** Incorporar GtkSourceView ***/
+
+		pScrollWin = glade_xml_get_widget(xml, "scrolledwindow");
+
+		/* Now create a GtkSourceLanguagesManager */
+		lm = gtk_source_language_manager_new();
+
+		/* and a GtkSourceBuffer to hold text (similar to GtkTextBuffer) */
+		sBuf = GTK_SOURCE_BUFFER (gtk_source_buffer_new (NULL));
+
+		/* Create the GtkSourceView and associate it with the buffer */
+		sView = gtk_source_view_new_with_buffer(sBuf);
+		gtk_source_view_set_show_line_numbers ((GtkSourceView*)sView, TRUE);
+	
+		/* Set default Font name,size */
+		font_desc = pango_font_description_from_string ("mono 10");
+		gtk_widget_modify_font (sView, font_desc);
+		pango_font_description_free (font_desc);
+
+		/* get the Language for C source mimetype */
+//		language = gtk_source_languages_manager_get_language_from_mime_type (lm,"text/x-c++src");
+        language = gtk_source_language_manager_get_language(lm, "text/x-c++src");
+		if (language == NULL)
+		{
+			g_print ("No language found for mime type `%s'\n", "text/x-c++src");
+			g_object_set (G_OBJECT (sBuf), "highlight", FALSE, NULL);
+		}
+		else
+		{
+			gtk_source_buffer_set_language (sBuf, language);
+			g_object_set (G_OBJECT (sBuf), "highlight", TRUE, NULL);
+		}
+		
+		/* Attach the GtkSourceView to the scrolled Window */
+		gtk_container_add (GTK_CONTAINER (glade_xml_get_widget(xml, "scrolledwindow")), sView);
+		
+		
+	}
+	/* Attach the GtkSourceView to the scrolled Window */
+	//if (strcmp((const char *)type, "transicion") == 0)
+	//	gtk_container_add (GTK_CONTAINER (glade_xml_get_widget(xml, "frameT")), sView);
+	//else
+	//	gtk_container_add (GTK_CONTAINER (glade_xml_get_widget(xml, "scrolledwindow")), sView);
+
+	/*Cargamos el boton*/	
+	botonCancelar = glade_xml_get_widget(xml, "cancelar");	
+	botonAceptar = glade_xml_get_widget(xml,"aceptar");
+	
+	/*Asignamos elementos*/ 
+	g_object_set_data (G_OBJECT (botonAceptar), "item", item);
+	g_object_set_data (G_OBJECT (win), "item", item);
+
+	/*Asignamos Señal al boton*/
+	g_signal_connect (G_OBJECT (botonAceptar), "clicked", G_CALLBACK (aceptar), type);
+	//g_signal_connect (G_OBJECT (botonCancelar), "clicked", G_CALLBACK (restaurar_color), 0);
+	g_signal_connect (G_OBJECT (botonCancelar), "clicked", G_CALLBACK (destroy), 0);
+	g_signal_connect (G_OBJECT (win), "destroy", G_CALLBACK (restaurar_color),0);
+	g_signal_connect (G_OBJECT (win), "destroy", G_CALLBACK (eliminar_ventana),0);
+
+	/* Visualizamo la ventana y establecemos el tamaño de la ventana*/
+	//gtk_window_set_position(GTK_WINDOW(win),GTK_WIN_POS_CENTER);
+	gtk_widget_show_all(win);
+	//gtk_window_resize (GTK_WINDOW(win),640,480);
+	//g_object_set_data (G_OBJECT (win), "width", (gpointer)640);
+	//g_object_set_data (G_OBJECT (win), "height", (gpointer)480);
+	
+	//gtk_window_move (GTK_WINDOW(win), (gdk_screen_width ()/2) - (640/2), (gdk_screen_height ()/2) - (480/2));
+	/* Cargamos Texto */
+
+	if (strcmp(type, "estado")==0){
+
+		
+		list<tNodo>::iterator pos;
+	
+		pos = ListaElementos.begin();
+
+		while(pos->item != item)
+			pos++;
+	
+		color = 3;
+
+		if (pos->codigo != ""){
+			gtk_source_buffer_begin_not_undoable_action (sBuf);
+			gtk_text_buffer_set_text (GTK_TEXT_BUFFER(sBuf), pos->codigo.c_str(),  (int)pos->codigo.length());
+			gtk_source_buffer_end_not_undoable_action (sBuf);
+		}
+		
+		/*Asignamos elementos*/ 
+		g_object_set_data (G_OBJECT (botonAceptar), "buffer", sBuf);
+	}
+	else if (strcmp(type, "transicion")==0){
+		list<tTransicion>::iterator pos;
+	
+		pos = ListaTransiciones.begin();
+
+		while(pos->item != item)
+	  		pos++;
+
+		color = 7;
+
+		GtkWidget *numero = glade_xml_get_widget(xml, "frameN");
+		GtkWidget *texto = glade_xml_get_widget(xml, "frameT");
+
+		gtk_widget_show (GTK_WIDGET (texto));
+		gtk_widget_hide (GTK_WIDGET (numero));
+
+
+		toggle_button_tiempo = glade_xml_get_widget(xml, "rbTiempo");
+		g_object_set_data (G_OBJECT (botonAceptar), "rbTiempo", toggle_button_tiempo);
+
+		toggle_button_texto = glade_xml_get_widget(xml, "rbTexto");
+		g_object_set_data (G_OBJECT (botonAceptar), "rbTexto", toggle_button_texto);
+
+		entry = glade_xml_get_widget(xml, "entry1");
+		g_object_set_data (G_OBJECT (botonAceptar), "entryTemp", entry);
+		
+		entry = glade_xml_get_widget(xml, "entryCond");
+		g_object_set_data (G_OBJECT (botonAceptar), "entryCond", entry);
+
+		if (pos->codigo != "")
+			gtk_entry_set_text(GTK_ENTRY(glade_xml_get_widget(xml, "entryCond")), pos->codigo.c_str());
+
+		if (pos->tiempo != -1){
+
+			gtk_widget_show (GTK_WIDGET (numero));
+			gtk_widget_hide (GTK_WIDGET (texto));
+		
+			GTK_TOGGLE_BUTTON (toggle_button_tiempo)->active = true;
+
+			GTK_TOGGLE_BUTTON (toggle_button_texto)->active = false;
+
+			gtk_entry_set_text(GTK_ENTRY(glade_xml_get_widget(xml, "entry1")), int2string(pos->tiempo).c_str());
+			
+			gtk_window_resize (GTK_WINDOW(win),250,1);
+
+		}
+
+	}else{
+		return false;
+	}
+
+	//gtk_widget_show_all(win);
+
+  	//glade_xml_signal_autoconnect(xml);
+
+	return win;
+}
+
+GtkSourceBuffer *crear_source_view (GtkWidget * scroll)
+{
+	/*SourveView variables*/
+	GtkWidget *sView;
+ 	PangoFontDescription *font_desc;
+  	GtkSourceLanguageManager *lm;
+  	GtkSourceBuffer *sBuf;
+	GtkSourceLanguage *language = NULL;
+
+	/*** GtkSourceView ***/
+
+	/* Now create a GtkSourceLanguagesManager */
+	lm = gtk_source_language_manager_new();
+
+	/* and a GtkSourceBuffer to hold text (similar to GtkTextBuffer) */
+	sBuf = GTK_SOURCE_BUFFER (gtk_source_buffer_new (NULL));
+
+	/* Create the GtkSourceView and associate it with the buffer */
+	sView = gtk_source_view_new_with_buffer(sBuf);
+	gtk_source_view_set_show_line_numbers ((GtkSourceView*)sView, TRUE);
+
+	/* Set default Font name,size */
+	font_desc = pango_font_description_from_string ("mono 10");
+	gtk_widget_modify_font (sView, font_desc);
+	pango_font_description_free (font_desc);
+
+	/* get the Language for C source mimetype */
+	//language = gtk_source_languages_manager_get_language_from_mime_type (lm,"text/x-c++src");
+	language = gtk_source_language_manager_get_language(lm, "text/x-c++src");
+	if (language == NULL)
+	{
+		g_print ("No language found for mime type `%s'\n", "text/x-c++src");
+		g_object_set (G_OBJECT (sBuf), "highlight", FALSE, NULL);
+	}
+	else
+	{
+		gtk_source_buffer_set_language (sBuf, language);
+		g_object_set (G_OBJECT (sBuf), "highlight", TRUE, NULL);
+	}
+
+	/* Attach the GtkSourceView to the scrolled Window */
+	gtk_container_add (GTK_CONTAINER (scroll), sView);
+
+	return sBuf;
+
+}
+
+GtkWidget * new_code_windows ()
+{
+	GladeXML *xml;
+	GtkWidget *win; /*Main window*/
+	GtkWidget *pScrollWinVar, *pScrollWinFun;
+	GtkSourceBuffer *sBufVar, *sBufFun;
+	GtkWidget *botonAceptar, *botonCancelar;
+	
+	xml = glade_xml_new("gui/variables.glade", NULL, NULL);
+
+	if (xml == NULL)
+	{
+		printf ("NO");
+	return 0;
+	}
+	
+	/*Cargamos la nueva ventana*/
+	win = glade_xml_get_widget(xml, "dialog1");
+
+	/*Conectamos Señales*/	
+	glade_xml_signal_autoconnect(xml);
+
+	/*Ponemos Titulo a la ventana*/	
+	gtk_window_set_title(GTK_WINDOW(win), "Código Componente");
+
+	/*Situamos la ventana en el medio*/
+	gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER);
+
+	/* scrolled Window */
+	
+	pScrollWinVar = glade_xml_get_widget(xml, "scrolledwindowV");
+	pScrollWinFun = glade_xml_get_widget(xml, "scrolledwindowF");
+	
+	sBufVar = crear_source_view (pScrollWinVar);
+	sBufFun = crear_source_view (pScrollWinFun);
+
+	/*Añadimos texto variables a la ventana*/
+	gtk_text_buffer_set_text (GTK_TEXT_BUFFER(sBufVar), variables.c_str(), (int)variables.length());
+	gtk_text_buffer_set_text (GTK_TEXT_BUFFER(sBufFun), funciones.c_str(), (int)funciones.length());
+
+	/*Cargamos el boton*/	
+	botonCancelar = glade_xml_get_widget(xml, "cancelar");	
+	botonAceptar = glade_xml_get_widget(xml,"aceptar");
+	
+	/*Asignamos elementos*/ 
+	g_object_set_data (G_OBJECT (botonAceptar), "bufferVar", sBufVar);	
+	g_object_set_data (G_OBJECT (botonAceptar), "bufferFun", sBufFun);
+
+	/*Asignamos Señal al boton*/
+	g_signal_connect (G_OBJECT (botonCancelar), "clicked", G_CALLBACK (aceptar), (gchar *)"variables");
+	g_signal_connect (G_OBJECT (botonAceptar), "clicked", G_CALLBACK (aceptar), (gchar *)"variables");
+	//NO hace falta asignar esta señal. Ya esta la señal asignada al crear la ventana con glade*/
+	//g_signal_connect (G_OBJECT (botonCancelar), "clicked", G_CALLBACK (destroy), 0);
+
+	g_signal_connect (G_OBJECT (win), "destroy", G_CALLBACK (eliminar_ventana),0);
+
+
+	/*Asignamos Señal al boton*/
+//	g_signal_connect (G_OBJECT (glade_xml_get_widget(prog,"aceptar")), "clicked", G_CALLBACK (aceptar), (gchar *)"variables");
+
+	/*NO hace falta asignar esta señal. Ya esta la señal asignada al crear la ventana con glade*/
+	//g_signal_connect (G_OBJECT (glade_xml_get_widget(prog,"aceptar")), "destroy", G_CALLBACK (cancelar), (gpointer)win);
+
+	gtk_widget_show_all(win);
+
+	return win;
+}
+
+void
+set_importar(GtkButton *button, gpointer data){
+
+	GladeXML *xml = GLADE_XML (g_object_get_data (G_OBJECT (button), "xml"));
+	// Actualizamos 
+	GtkWidget *toggle_button = glade_xml_get_widget(xml, "cbLaser");
+
+	imp.laser = GTK_TOGGLE_BUTTON (toggle_button)->active;
+
+	toggle_button = glade_xml_get_widget(xml, "cbMotor");
+
+	imp.motor = GTK_TOGGLE_BUTTON (toggle_button)->active;
+
+	toggle_button = glade_xml_get_widget(xml, "cbRadar");
+
+	imp.radar = GTK_TOGGLE_BUTTON (toggle_button)->active;
+
+	toggle_button = glade_xml_get_widget(xml, "cbEncoders");
+
+	imp.encoders = GTK_TOGGLE_BUTTON (toggle_button)->active;
+
+	toggle_button = glade_xml_get_widget(xml, "cbLat_lon");
+
+	imp.lat_lon = GTK_TOGGLE_BUTTON (toggle_button)->active;
+
+	toggle_button = glade_xml_get_widget(xml, "cbCamara");
+
+	imp.camara = GTK_TOGGLE_BUTTON (toggle_button)->active;
+
+	toggle_button = glade_xml_get_widget(xml, "cbPtencoders");
+
+	imp.ptencoders = GTK_TOGGLE_BUTTON (toggle_button)->active;
+
+
+	gtk_widget_destroy (gtk_widget_get_toplevel(GTK_WIDGET(button)));
+	//gtk_widget_destroy(GTK_WIDGET(data));
+}
+
+GtkWidget *
+importar_librerias(){
+	
+	GladeXML *xml;	
+	GtkWidget *win; /*Main window*/
+
+	//GladeInterface *inter;
+
+	/*Inicializamos Glade*/
+   	glade_init();
+
+	/*Cargamos fichero .Glade donde esta guardada la estructura de la nueva ventana*/
+  	xml=glade_xml_new("gui/Importar.glade", NULL, NULL);
+
+	if (xml == NULL)
+	{
+		printf ("NO");
+		return NULL;
+	}
+	
+	/*Cargamos la nueva ventana*/
+	win = glade_xml_get_widget(xml, "window1");
+
+	/*Conectamos Señales*/	
+	glade_xml_signal_autoconnect(xml);
+
+//	 g_signal_connect (G_OBJECT (glade_xml_get_widget(prog,"button1")),
+  //                        "clicked", G_CALLBACK (gtk_main_quit), NULL);
+
+	/*Ponemos Titulo a la ventana*/	
+	gtk_window_set_title(GTK_WINDOW(win), "Actuadores y Sensores");
+
+	/*Situamos la ventana en el medio*/
+	gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER);
+	
+	
+	/*Cargamos el boton*/	
+	GtkWidget *botonAceptar = glade_xml_get_widget(xml, "aceptar");
+	GtkWidget *botonCancelar = glade_xml_get_widget(xml, "cancelar");
+	
+	g_signal_connect (G_OBJECT (botonAceptar), "clicked", G_CALLBACK (set_importar),(gpointer)win);
+	g_signal_connect (G_OBJECT (botonCancelar), "clicked", G_CALLBACK (destroy), 0);
+	g_signal_connect (G_OBJECT (win), "destroy", G_CALLBACK (eliminar_ventana),0);
+
+	/*Asignamos elementos*/ 
+	g_object_set_data (G_OBJECT (botonAceptar), "xml", xml);	
+
+
+	// Actualizamos 
+	GtkWidget *toggle_button = glade_xml_get_widget(xml, "cbLaser");
+
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle_button), imp.laser);
+
+	toggle_button = glade_xml_get_widget(xml, "cbMotor");
+
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle_button), imp.motor);
+
+	toggle_button = glade_xml_get_widget(xml, "cbRadar");
+
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle_button), imp.radar);
+
+	toggle_button = glade_xml_get_widget(xml, "cbEncoders");
+
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle_button), imp.encoders);
+
+	toggle_button = glade_xml_get_widget(xml, "cbLat_lon");
+
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle_button), imp.lat_lon);
+		
+	toggle_button = glade_xml_get_widget(xml, "cbCamara");
+
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle_button), imp.camara);
+
+	toggle_button = glade_xml_get_widget(xml, "cbPtencoders");
+
+	gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(toggle_button), imp.ptencoders);
+
+	gtk_widget_show_all(win);
+
+	return win;
+}
+
+
+void set_timer (GtkWindow *button, gpointer data){
+
+	GtkWidget *entry = GTK_WIDGET (g_object_get_data (G_OBJECT (button), "entry"));
+                                           
+	const char *texto = gtk_entry_get_text(GTK_ENTRY(entry));
+
+	tiempoIteracion = atoi(texto);
+
+	/* Nombre asignado
+	* Para cerrar la ventana, y dejar el estado del canvas como estaba, llamamos a la funcion cancelar con la ventana como parámetro, 
+	* o emitimos una señal "clicked" por el boton cancelar. */
+
+
+	//cancelar (window, data2);
+
+	//gtk_signal_emit (GTK_OBJECT (data2), "clicked");
+	gtk_widget_destroy (gtk_widget_get_toplevel(GTK_WIDGET(button)));
+	//g_signal_emit_by_name (GTK_OBJECT ((GtkWidget *)data), "clicked");
+}
+
+GtkWidget *
+tiempo_iteracion(){
+
+	GladeXML *xml;
+	GtkWidget *win; /*Main window*/
+
+	//GladeInterface *inter;
+
+	/*Inicializamos Glade*/
+   	glade_init();
+
+	/*Cargamos fichero .Glade donde esta guardada la estructura de la nueva ventana*/
+  	xml=glade_xml_new("gui/timer.glade", NULL, NULL);
+
+	if (xml == NULL)
+	{
+		printf ("NO");
+		return NULL;
+	}
+	
+	/*Cargamos la nueva ventana*/
+	win = glade_xml_get_widget(xml, "timer");
+
+	/*Conectamos Señales*/	
+	glade_xml_signal_autoconnect(xml);
+
+	/*Ponemos Titulo a la ventana*/	
+	gtk_window_set_title(GTK_WINDOW(win), "Tiempo iteracion componente");
+
+	prog = glade_get_widget_tree (win);
+
+	/*Cargamos el boton*/	
+	GtkWidget *botonAceptar = glade_xml_get_widget(xml, "BotonAplicar");
+	GtkWidget *botonCancelar = glade_xml_get_widget(xml, "BotonCancelar");
+	//GtkWidget *button = glade_xml_get_widget(xml, "BotonCancelar");
+	
+	/*Asignamos Señal al boton*/
+	g_signal_connect (G_OBJECT (botonAceptar), "clicked", G_CALLBACK (set_timer), (gpointer)botonCancelar);
+	g_signal_connect (G_OBJECT (botonCancelar), "clicked", G_CALLBACK (destroy), 0);
+	g_signal_connect (G_OBJECT (win), "destroy", G_CALLBACK (eliminar_ventana),0);
+
+//	g_signal_connect (G_OBJECT (glade_xml_get_widget(xml,"BotonCancelar")), "clicked", G_CALLBACK (cancelar), (gpointer)win);
+
+	GtkWidget *entry = glade_xml_get_widget(xml, "entry1");
+
+	/*Asignamos elementos*/ 
+	g_object_set_data (G_OBJECT (botonAceptar), "entry", entry);
+
+	gtk_entry_set_text(GTK_ENTRY(entry), int2string(tiempoIteracion).c_str());
+	
+	gtk_widget_show_all(win);
+
+  	
+	return win;
+
+
+}
+
+void eliminar_ventana (GtkWidget *ventana, gpointer data)
+{
+	list<nVentana>::iterator posVentana;
+
+	posVentana = ListaVentanas.begin();
+	printf ("VENTANA: %d \n", (int)posVentana->ventana);
+	while( (posVentana != ListaVentanas.end()) && (posVentana->ventana != ventana) )
+  		posVentana++;
+
+	if (posVentana != ListaVentanas.end())
+		 ListaVentanas.erase(posVentana);
+
+}
+
+void add_ventana (GtkWidget *ventana, GnomeCanvasItem * item, tVentana tipo)
+{
+
+	nVentana nodo;
+
+	nodo.ventana = ventana;
+	nodo.item = item;
+	nodo.tipo = tipo;
+
+	ListaVentanas.push_back (nodo);
+}
+
+
+GtkWidget * comprobar_ventana_abierta (GnomeCanvasItem * item, tVentana tipo)
+{
+	list<nVentana>::iterator posVentana;
+
+	posVentana = ListaVentanas.begin();
+
+	while( posVentana != ListaVentanas.end() ){
+		if ((posVentana->tipo == tipo) && (posVentana->item == item))
+			return posVentana->ventana;
+		else 
+  			posVentana++;
+  	}
+
+	return NULL;
+
+	
+}
+
+
+/* Función útil a la hora de cambiar el color de relleno de un item
+ * del canvas aleatoriamente
+ */
+void change_item_color (GnomeCanvasItem *item, int color)
+{
+	static const char *color_specs[] = {
+		"red",
+		"yellow",
+		"green",
+		"cyan",
+		"blue",
+		"magenta",
+		"orange",
+		NULL
+	};
+
+	//int n;
+
+	//item_guardado = item;
+
+	/* Coge un color aleatoriamente de la lista */
+
+	//n = rand () % (sizeof (color_specs) / sizeof (color_specs[0]));
+
+	gnome_canvas_item_set (item,			       
+			"fill_color", color_specs[color],
+	     		NULL);		
+}


Property changes on: trunk/src/components/visualHFSM-3.1/ventanas.cpp
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/ventanas.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/ventanas.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/ventanas.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,63 @@
+
+
+typedef struct importar {
+	bool laser;
+	bool motor;
+	bool radar;
+	bool encoders;
+	bool lat_lon;
+	bool camara;
+	bool ptencoders;
+} importar; 
+
+
+typedef enum TYPE_VENTANA {
+	NOMBRAR,
+	EDITAR,
+	CODIGO,
+	LIBRERIAS,
+	TIMER
+}tVentana;
+
+typedef struct nodoVentana {
+	GnomeCanvasItem * item;		// item correspondiente a la ventana
+	tVentana tipo;			// Nombre del nodo. "" por defecto
+	GtkWidget *ventana;		// Ventana
+} nVentana; 
+
+
+
+/****EDICION DE ESTADOS****/
+
+void cancelar (GtkWidget *widget, gpointer data);
+
+void aplicar (GtkButton *button, gpointer data);
+
+/*	Cambiar nombre		*/
+GtkWidget * new_name_windows (GnomeCanvasItem *item);
+
+/*	Edicion de elementos		*/
+GtkWidget * new_text_windows (GnomeCanvasItem *item, gchar *type);
+
+/****EDICION DEL ESQUEMA****/
+GtkWidget *  new_code_windows ();
+
+void set_importar(GtkButton *Button, gpointer data);
+GtkWidget * importar_librerias();
+
+void set_timer (GtkWindow *window, gpointer data);
+GtkWidget * tiempo_iteracion();
+
+/****LISTA VENTANAS****/
+
+void add_ventana (GtkWidget *ventana, GnomeCanvasItem * item, tVentana tipo);
+void eliminar_ventana (GtkWidget *ventana, gpointer data);
+
+/*	Comprueba si la ventana correspondiente esta abierta	*/
+GtkWidget * comprobar_ventana_abierta (GnomeCanvasItem * item, tVentana tipo);
+
+
+/* Función útil a la hora de cambiar el color de relleno de un item
+ * del canvas aleatoriamente
+ */
+void change_item_color (GnomeCanvasItem *item, int color);


Property changes on: trunk/src/components/visualHFSM-3.1/ventanas.h
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/visualHFSM
===================================================================
(Binary files differ)


Property changes on: trunk/src/components/visualHFSM-3.1/visualHFSM
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: trunk/src/components/visualHFSM-3.1/xml.cpp
===================================================================
--- trunk/src/components/visualHFSM-3.1/xml.cpp	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/xml.cpp	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,474 @@
+
+#include <iostream>
+#include <string>
+#include <list>
+#include <string.h>
+
+//#include "nodo.h"
+#include "transicion.h"
+//#include "ventanas.h"
+#include "int2string.h"
+#include "xml.h"
+#include "interfaz.h"
+
+
+#include <libxml/tree.h>
+
+int cont_nodos = 0;
+//************************Añadida lista de subautomatas
+extern list <tSubAut> ListaSubAutomatas;
+//*****************************************************
+
+extern list <tNodo> ListaElementos;
+extern list <tTransicion> ListaTransiciones;
+extern list <transicion_aux> ListaTransicionesTemporales;
+
+extern string variables;
+extern string funciones;
+extern importar imp;
+extern int tiempoIteracion;
+
+extern string directorio;	
+extern string nombreEsquema;
+
+extern GnomeCanvasGroup *root;
+
+extern GnomeCanvasItem *item_guardado;	// item guardado para operaciones
+
+void actualizar_array_id (tId *array)
+{
+	list<tNodo>::iterator posNodo;
+
+	posNodo = ListaElementos.begin();
+
+	while(posNodo != ListaElementos.end()){		
+ 		array[cont_nodos].id = cont_nodos;
+		array[cont_nodos].item = posNodo->item;
+		cont_nodos++;
+		posNodo++;
+	}
+			
+
+}
+
+int posicion (GnomeCanvasItem *nodo)
+{
+	int cont = 1; 
+	list<tNodo>::iterator posNodos;	
+
+	posNodos = ListaElementos.begin();
+
+	while(posNodos->item != nodo){
+		cont++;
+  		posNodos++;
+	}
+	return cont;
+}	
+
+
+xmlDocPtr xml_new_doc (const gchar *name) {
+
+	xmlNodePtr root;
+	xmlDocPtr doc;
+
+	doc = xmlNewDoc ((const xmlChar*)"1.0");
+
+	root = xmlNewDocNode (doc, NULL, (const xmlChar*)name, NULL);
+	
+	xmlDocSetRootElement (doc, root);
+
+	return doc;
+}
+
+void xml_new_entry (xmlDocPtr doc) {//****************Creado xml_new_entry_sub, trasladando el xml_new_entry original para cada uno de los subautomatas
+									//****************de ListaSubAutomatas
+
+	xmlNodePtr root;
+	xmlNodePtr nodeSub;
+	string cadena;
+	list<tSubAut>::iterator posNodoSub;	
+	
+	root = xmlDocGetRootElement (doc);
+		
+
+	if (!ListaSubAutomatas.empty())
+	{ 
+		posNodoSub = ListaSubAutomatas.begin();
+	
+		while( posNodoSub != ListaSubAutomatas.end())
+		{	
+			/* nodo raiz */
+			nodeSub = xmlNewChild (root, NULL, (const xmlChar*)"SubAutomata", NULL);
+
+			cadena = int2string(posNodoSub->idSub);
+
+			xmlNewChild (nodeSub, NULL, (const xmlChar*)"idSub", (const xmlChar*)cadena.c_str());
+
+			cadena = int2string(posNodoSub->idPadre);
+
+			xmlNewChild (nodeSub, NULL, (const xmlChar*)"idPadre", (const xmlChar*)cadena.c_str());
+
+
+			//cargamos en las "listas globales" las listas del subautomata que estamos tratando, de este modo el procedimiento 
+			//que habia antes para generar el xml a partir de esas listas puede seguir funcionando igual
+			ListaElementos = posNodoSub->ListaElementosSub;
+			ListaTransiciones = posNodoSub->ListaTransicionesSub;
+			tiempoIteracion = posNodoSub->tiempoIteracionSub;
+			variables = posNodoSub->variablesSub;
+			funciones = posNodoSub->funcionesSub;
+			imp = posNodoSub->impSub;
+			
+			
+			//Llamamos al procedimiento que habia antes para componer la estructura del xml
+			xml_new_entry_sub (doc, nodeSub);
+
+  			posNodoSub++;
+
+		}		
+		
+		//cont_nodos = 0;//***************************************************************Comentado por mi rsb
+	}
+
+	xmlNewChild (root, NULL, (const xmlChar*)"nombreEsquema", (const xmlChar*)(directorio + nombreEsquema).c_str());
+
+}
+
+//Para componer cada subautomata
+void xml_new_entry_sub (xmlDocPtr doc, xmlNodePtr ptrSub) {
+
+	xmlNodePtr node, nodeTransicion, nodeTransiciones, nodeBox;
+	string cadena;
+	double x1, x2, y1, y2;
+	list<tNodo>::iterator posNodos;	
+	list<GnomeCanvasItem *>::iterator posAdy;
+	list<tTransicion>::iterator posTransiciones;
+	GnomeCanvasItem *box;
+
+	if (!ListaElementos.empty())
+	{ 
+		posNodos = ListaElementos.begin();
+	
+		while( posNodos != ListaElementos.end())
+		{	
+			/* nodo raiz */
+			node = xmlNewChild (ptrSub, NULL, (const xmlChar*)"Estado", NULL);
+
+			if (posNodos->estado_inicial != NULL)
+				xmlSetProp (node, (const xmlChar*)"estado_inicial", (const xmlChar*)"true");
+			else
+				xmlSetProp (node, (const xmlChar*)"estado_inicial", (const xmlChar*)"false");
+
+			cadena = int2string(++cont_nodos);
+
+			xmlNewChild (node, NULL, (const xmlChar*)"id", (const xmlChar*)cadena.c_str());
+			
+			/* Guardamos las coordenadas */
+			get_bounds (posNodos->item, &x1,&y1,&x2,&y2);
+		
+			cadena = int2string(x1);
+			
+			xmlNewChild (node, NULL, (const xmlChar*)"origenX", (const xmlChar*)cadena.c_str());
+
+			cadena = int2string(y1);
+
+			xmlNewChild (node, NULL, (const xmlChar*)"origenY", (const xmlChar*)cadena.c_str());
+
+			cadena = int2string(x2);
+
+			xmlNewChild (node, NULL, (const xmlChar*)"destinoX", (const xmlChar*)cadena.c_str());
+
+			cadena = int2string(y2); 
+
+			xmlNewChild (node, NULL, (const xmlChar*)"destinoY", (const xmlChar*)cadena.c_str());
+	
+			/* Guardamos el nombre */
+			xmlNewChild (node, NULL, (const xmlChar*)"nombre", (const xmlChar*)(char *)posNodos->nombre.c_str());
+
+			/*Guardamos el ID del hijo*/
+			//if (posNodos->idHijo != 0 )
+				cadena = int2string(posNodos->idHijo);
+				xmlNewChild (node, NULL, (const xmlChar*)"hijo", (const xmlChar*)(char *)cadena.c_str());
+		
+			/* Guardamos el codigo del estado */
+			const xmlChar * code = xmlEncodeSpecialChars (doc,  (const xmlChar*)posNodos->codigo.c_str());	// Parseamos el código por 																caracteres especiales.		
+			
+			xmlNewChild (node, NULL, (const xmlChar*)"codigo", code);
+
+			/* Guardamos las transiciones */
+			nodeTransiciones = xmlNewChild (node, NULL, (const xmlChar*)"transiciones", NULL);
+
+			posAdy = posNodos->listaAdyacentes.begin();
+
+			while( posAdy != posNodos->listaAdyacentes.end())
+			{
+				posTransiciones = ListaTransiciones.begin();
+
+				while( posTransiciones != ListaTransiciones.end())
+				{
+					if ((*posAdy == posTransiciones->item) & (posNodos->item == posTransiciones->origen))
+					{
+						nodeTransicion = xmlNewChild (nodeTransiciones, NULL, (const xmlChar*)"transicion", NULL);
+						
+						/* Guardamos puntos Box */
+						box = get_box (posTransiciones->item);
+
+						get_bounds (box, &x1,&y1,&x2,&y2);
+					
+						nodeBox = xmlNewChild (nodeTransicion, NULL, (const xmlChar*)"box", NULL);
+						xmlSetProp (nodeBox, (const xmlChar*)"x1", (const xmlChar*)int2string(x1).c_str());
+						xmlSetProp (nodeBox, (const xmlChar*)"y1", (const xmlChar*)int2string(y1).c_str());
+						xmlSetProp (nodeBox, (const xmlChar*)"x2", (const xmlChar*)int2string(x2).c_str());
+						xmlSetProp (nodeBox, (const xmlChar*)"y2", (const xmlChar*)int2string(y2).c_str());
+						
+						xmlNewChild (nodeTransicion , NULL, (const xmlChar*)"nombre", (const xmlChar*)posTransiciones->nombre.c_str());
+
+						cadena = int2string(posicion(posTransiciones->destino));
+
+						xmlNewChild (nodeTransicion , NULL, (const xmlChar*)"destino", (const xmlChar*)cadena.c_str());
+
+						if (posTransiciones->codigo != ""){
+							code = xmlEncodeSpecialChars (doc,  (const xmlChar*)posTransiciones->codigo.c_str());	// Parseamos el código por 																caracteres especiales.
+							xmlNewChild (nodeTransicion , NULL, (const xmlChar*)"codigo", code);
+						}else if (posTransiciones->tiempo != -1){
+							cadena = int2string(posTransiciones->tiempo);
+							xmlNewChild (nodeTransicion , NULL, (const xmlChar*)"tiempo", (const xmlChar*)cadena.c_str());
+						}
+					}	
+					posTransiciones++;
+				}	
+				posAdy++;
+			}	
+  			posNodos++;
+
+		}		
+		cont_nodos = 0;
+	}
+
+	/* Guardamos datos del Subautomata */
+
+	cadena = int2string(tiempoIteracion);
+
+	xmlNewChild (ptrSub, NULL, (const xmlChar*)"tiempoIteracion", (const xmlChar*)cadena.c_str());
+
+	node = xmlNewChild (ptrSub, NULL, (const xmlChar*)"Librerias", NULL);
+
+	if (imp.laser)
+		xmlNewChild (node, NULL, (const xmlChar*)"lib", (const xmlChar*)"laser");
+	if (imp.motor)
+		xmlNewChild (node, NULL, (const xmlChar*)"lib", (const xmlChar*)"motor");
+	if (imp.radar)
+		xmlNewChild (node, NULL, (const xmlChar*)"lib", (const xmlChar*)"radar");
+	if (imp.encoders)
+		xmlNewChild (node, NULL, (const xmlChar*)"lib", (const xmlChar*)"encoders");
+	if (imp.lat_lon)
+		xmlNewChild (node, NULL, (const xmlChar*)"lib", (const xmlChar*)"lat_lon");
+	if (imp.camara)
+		xmlNewChild (node, NULL, (const xmlChar*)"lib", (const xmlChar*)"camara");
+	if (imp.ptencoders)
+		xmlNewChild (node, NULL, (const xmlChar*)"lib", (const xmlChar*)"ptencoders");
+
+	xmlNewChild (ptrSub, NULL, (const xmlChar*)"variables_aux", (const xmlChar*)variables.c_str());
+		
+	xmlNewChild (ptrSub, NULL, (const xmlChar*)"funciones_aux", (const xmlChar*)funciones.c_str());
+
+}
+
+
+void xml_get_entry (xmlNodePtr child) {
+	
+	tNodo figura;
+	
+	GnomeCanvasItem *item, *item2;
+	GnomeCanvasGroup *group, *groupT;
+
+	double x1,x2,y1,y2;
+	//const xmlChar* str;
+	//const char* c_str;
+
+	xmlNodePtr node;  //nodo pincipal
+	xmlNodePtr nodeT; //nodo transiciones
+
+	transicion_aux t;
+
+	list<transicion_aux>::iterator pos;
+
+	node = child->xmlChildrenNode;
+
+	int id= atoi((const char*)xmlNodeGetContent (node));
+
+	node = node->next;
+
+//	str = xmlNodeGetContent (node);
+//	c_str = (const char*)str;
+//	
+//	cout << "FIGURA: " << c_str << endl;
+//	figura.figura = c_str;
+//	node = node->next;
+
+	/* Cargamos Puntos Nodo */
+	x1= atoi((const char*)xmlNodeGetContent (node));
+	node = node->next;
+	y1 = atoi((const char*)xmlNodeGetContent (node));
+	node = node->next;
+	x2 = atoi((const char*)xmlNodeGetContent (node));
+	node = node->next;
+	y2 = atoi((const char*)xmlNodeGetContent (node));
+	node = node->next;
+
+	/* Cargamos Nombre y Código */
+	figura.nombre = (const char*)xmlNodeGetContent (node);	
+	node = node->next;
+	figura.idHijo = atoi((const char*)xmlNodeGetContent (node));
+	node = node->next;
+	figura.codigo = (const char*)xmlNodeGetContent (node);
+	node = node->next;
+	
+	group = GNOME_CANVAS_GROUP (gnome_canvas_item_new (root,  
+                                gnome_canvas_group_get_type (),
+                                "x", 0,
+                                "y", 0,
+                                NULL));
+	if (figura.idHijo == 0) {
+
+		item = gnome_canvas_item_new(group,
+                        gnome_canvas_ellipse_get_type(),
+                        "x1", x1,
+                        "y1", y1,
+                        "x2", x2,
+                        "y2", y2,
+                        "fill_color_rgba", 0x00ffffff,
+                        "outline_color", "black",
+                        "width_units", 1.0,
+                        NULL);
+
+	}
+	else{
+
+		item = gnome_canvas_item_new(group,
+                        gnome_canvas_ellipse_get_type(),
+                        "x1", x1,
+                        "y1", y1,
+                        "x2", x2,
+                        "y2", y2,
+                        "fill_color_rgba", 0x00ff66ff,
+                        "outline_color", "black",
+                        "width_units", 1.0,
+                        NULL);
+
+	}
+
+	if ( strcmp((const char*)xmlGetProp (child, (const xmlChar*)"estado_inicial"), (const char*)"true") == 0 )
+	{
+		figura.estado_inicial = pinta_estado_inicial (group, item);
+	}
+	else 
+		figura.estado_inicial = NULL;
+	
+	
+
+	if (figura.nombre != ""){
+		item2 = gnome_canvas_item_new (group,
+	             gnome_canvas_text_get_type (),
+             			            "text", figura.nombre.c_str(),
+             			            "x", (x1 + x2)/2,
+             			            "y", (y1 + y2)/2,
+             			            "font", "Sans 28",
+					    //"size", 32000,
+					    //"size_set", (gboolean)TRUE,
+					    //"scale",  (gdouble) 3,
+					    //"scale_set", (gboolean)TRUE,
+         			            "anchor", GTK_ANCHOR_CENTER,
+     			                    "fill_color", "black",
+    			                     NULL); 
+
+		figura.item_nombre = item2;
+
+	}else{
+		figura.item_nombre = NULL;
+	}	
+	
+	// guardamos el primer item pintado, para asignarlo despues al destino de algunas transiciones.
+	if (item_guardado == NULL) 
+		item_guardado = item;
+
+
+ 	/*Añadimos control (señal) al item creado*/
+	g_signal_connect (group, "event",
+			    G_CALLBACK (item_event),
+			    NULL);
+
+	//figura.id = (int)item;
+	figura.item = item;
+
+	if (node != NULL) {
+	    			
+		nodeT = node->xmlChildrenNode;
+		
+		while (nodeT != NULL)
+		{
+			t.origen = item; 
+			t.destino = NULL; 
+			cout << "ORIGEN: " << (int)item << endl;
+
+			/*Recuperamos Puntos Box*/
+			x1= atoi((const char*)xmlGetProp (nodeT->xmlChildrenNode, (const xmlChar*)"x1"));
+
+			y1 = atoi((const char*)xmlGetProp (nodeT->xmlChildrenNode, (const xmlChar*)"y1"));
+
+			x2 = atoi((const char*)xmlGetProp (nodeT->xmlChildrenNode, (const xmlChar*)"x2"));
+
+			y2 = atoi((const char*)xmlGetProp (nodeT->xmlChildrenNode, (const xmlChar*)"y2"));
+
+
+			groupT = GNOME_CANVAS_GROUP (gnome_canvas_item_new (root,  
+                                        gnome_canvas_group_get_type (),
+                                        "x", 0,
+                                        "y", 0,
+                                        NULL));
+
+			create_drag_box (groupT, (char *)"box", (x1+x2)/2, (y1+y2)/2,  G_CALLBACK (highlight_box));
+			t.item = GNOME_CANVAS_ITEM(groupT);
+
+			t.nombre = (const char*)xmlNodeGetContent (nodeT->xmlChildrenNode->next);
+
+			t.destino_id = atoi((const char*)xmlNodeGetContent (nodeT->xmlChildrenNode->next->next));
+			cout << "Destino ID: " << t.destino_id << endl;
+
+			if (nodeT->xmlChildrenNode->next->next->next != NULL){
+				if (strcmp((const char*)nodeT->xmlChildrenNode->next->next->next->name,"tiempo") == 0){
+					t.tiempo = atoi((const char*)xmlNodeGetContent (nodeT->xmlChildrenNode->next->next->next));
+					t.codigo = (const char*)"";
+				}
+				else if(strcmp((const char*)nodeT->xmlChildrenNode->next->next->next->name,"codigo") == 0) {
+					t.tiempo = -1;
+					t.codigo = (const char*)xmlNodeGetContent (nodeT->xmlChildrenNode->next->next->next);
+				}
+			}else{
+				t.tiempo = -1;
+				t.codigo = "";
+			}
+			t.origen_xml = id;
+
+			ListaTransicionesTemporales.push_back(t);
+
+			/* añadimos transicion adyacente */
+			//figura.listaAdyacentes.push_back(GNOME_CANVAS_ITEM(groupT));
+
+			nodeT = nodeT->next;
+
+		}
+	}
+	
+	pos = ListaTransicionesTemporales.begin();
+	
+	while (pos != ListaTransicionesTemporales.end())
+	{
+		if (id == pos->destino_id) 
+			pos->destino = item;
+	
+		pos++;
+	}	
+
+	ListaElementos.push_back(figura);
+
+}


Property changes on: trunk/src/components/visualHFSM-3.1/xml.cpp
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/src/components/visualHFSM-3.1/xml.h
===================================================================
--- trunk/src/components/visualHFSM-3.1/xml.h	                        (rev 0)
+++ trunk/src/components/visualHFSM-3.1/xml.h	2013-02-28 22:43:53 UTC (rev 867)
@@ -0,0 +1,24 @@
+
+#include <libxml/tree.h>
+
+
+typedef struct tipoId {
+	
+	int id;
+	GnomeCanvasItem * item;	
+
+} tId; 
+
+
+
+void actualizar_array_id (tId *array);
+
+/* crea la estructura xmlDoc con nodo raiz "name" */
+xmlDocPtr xml_new_doc (const gchar *name);
+
+/* Guarda la informaicon en un xml del esquema */
+void xml_new_entry (xmlDocPtr doc);
+void xml_new_entry_sub (xmlDocPtr doc, xmlNodePtr ptrSub);
+
+/* Recupera la informacion de un estado y lo representa en el canvas */
+void xml_get_entry (xmlNodePtr child);


Property changes on: trunk/src/components/visualHFSM-3.1/xml.h
___________________________________________________________________
Added: svn:executable
   + *



More information about the Jderobot-admin mailing list