Bienvenido: Ingresar
location: attachment:_terminal.cpp de Robotica/ProyectoRhino

Adjunto '_terminal.cpp'

Descargar

   1 /****************************************************************************/
   2 /* terminal.h  (c++)                                                        */
   3 /*------------------------------------------------------------------------- */
   4 /* Licencia GPL                                                             */
   5 /* Programa de prueba de la clase Rhino                                     */
   6 /****************************************************************************/
   7 /* Marco Alvarez Reyna                                                      */
   8 /* CIII UTN-FRC Argentina                                                   */
   9 /* Mayo 2007 / Abril 2008                                                   */
  10 /* mail: marcoalrey@gmail.com                                               */
  11 /****************************************************************************/
  12 
  13 #include <stdio.h>
  14 #include <stdlib.h>
  15 //#include <curses.h>
  16 #include "rhino.h"
  17 
  18 /*****************************/
  19 /*  Declaraciones            */
  20 /*****************************/
  21 
  22 Rhino *RhinoBot = NULL;
  23 unsigned int uiCommandEnumeration;
  24 unsigned int uiCode;
  25 unsigned int uiLogLevel;
  26 char sMessage[MSG_LENGTH];
  27 char sAux[4];
  28 
  29 /*****************************/
  30 /*  Funcion Principal        */
  31 /*****************************/
  32 int main(void){
  33 /*
  34 Prueba general de todos los niveles de logueo de mensajes y todos los mensajes de estado y error de la clase RHINO
  35 */
  36     for(int j=0; j<4; j++){
  37 
  38 	RhinoBot = new(Rhino);
  39 
  40 	for(int i=0; i<256; i++){
  41 	    RhinoBot->set_LogLevel(j);
  42 	    RhinoBot->ProcessCommandToRhino("SS");
  43 	    sprintf(sAux,"%d", i);
  44 	    RhinoBot->ProcessMessageFromRhino(sAux);
  45 
  46 	    if(RhinoBot->CBkMsg()){
  47 		RhinoBot->get_CBkMsg(sMessage);
  48 		printf("CBkMsg:\n%s\n", sMessage);
  49 	    }
  50 	}
  51 
  52 	for(int i=0; i<256; i++){
  53 	    RhinoBot->set_LogLevel(j);
  54 	    RhinoBot->ProcessCommandToRhino("SA");
  55 	    sprintf(sAux,"%d", i);
  56 	    RhinoBot->ProcessMessageFromRhino(sAux); 
  57 
  58 	    if(RhinoBot->CBkMsg()){
  59 		RhinoBot->get_CBkMsg(sMessage);
  60 		printf("CBkMsg:\n%s\n", sMessage);
  61 	    }
  62 	}
  63     
  64 	for(int i=0; i<129; i++){
  65 	    RhinoBot->set_LogLevel(j);
  66 	    RhinoBot->ProcessCommandToRhino("SE");
  67 	    sprintf(sAux,"%d", i);
  68 	    RhinoBot->ProcessMessageFromRhino(sAux);
  69 
  70 	    if(RhinoBot->CBkMsg()){
  71 		RhinoBot->get_CBkMsg(sMessage);
  72 		printf("CBkMsg:\n%s\n", sMessage);
  73 	    }
  74 	}
  75 
  76 	delete(RhinoBot);
  77 
  78     }
  79 
  80 /*
  81 Prueba de las funciones "ProcessCommandToRhino" y "ProcessMessageFromRhino" para el paso de mensajes de la clase al programa principal
  82 */
  83 /*
  84     RhinoBot = new(Rhino);
  85     
  86     for(int i=0; i<8; i++){
  87 
  88 	fprintf(stdout,"%s","Ingrese Log Level: ");
  89 	fscanf(stdin,"%s",sAux);
  90 	RhinoBot->set_LogLevel(atoi(sAux));
  91 	
  92 	fprintf(stdout,"%s","Ingrese comando: ");
  93 	fscanf(stdin,"%s",sAux);
  94 	RhinoBot->ProcessCommandToRhino(sAux, &uiCommandEnumeration);
  95 	
  96 	fprintf(stdout,"%s","Ingrese argumento: ");
  97 	fscanf(stdin,"%s",sAux);
  98 	RhinoBot->ProcessMessageFromRhino(uiCommandEnumeration, sAux, &uiCode, sMessage);
  99 
 100 	RhinoBot->get_LogLevel(&uiLogLevel);
 101 	printf("Terminal->Main:\n\tCode:\t%d\n\tLogLevel:\t%d\n\tMessage:\t%s\n", uiCode, uiLogLevel, sMessage );
 102 
 103     }
 104 
 105     delete(RhinoBot);
 106 */
 107 
 108 /*
 109 Prueba de la funcion CBkMsg para el paso de mensajes de la clase al programa principal
 110 */
 111 /*
 112     RhinoBot = new(Rhino);
 113 
 114     for(int i=0; i<8; i++){
 115 
 116 	fprintf(stdout,"%s","Ingrese Log Level: ");
 117 	fscanf(stdin,"%s",sAux);
 118 	RhinoBot->set_LogLevel(atoi(sAux));
 119 	
 120 	fprintf(stdout,"%s","Ingrese comando: ");
 121 	fscanf(stdin,"%s",sAux);
 122 	RhinoBot->ProcessCommandToRhino(sAux);
 123 	
 124 	fprintf(stdout,"%s","Ingrese argumento: ");
 125 	fscanf(stdin,"%s",sAux);
 126 	RhinoBot->ProcessMessageFromRhino(sAux);
 127 
 128 	if(RhinoBot->CBkMsg()){
 129 	    RhinoBot->get_CBkMsg(sMessage);
 130 	    printf("CBkMsg:\n%s\n", sMessage);
 131 	}
 132     }
 133     
 134     delete(RhinoBot);
 135 */
 136     fprintf(stdout,"%s","\nAUFWIEDERSEHEN\n");
 137     return 0;
 138 }

Archivos adjuntos

Para referirse a los adjuntos de una página, usa attachment:nombredelarchivo, como se muestra abajo en la lista de archivos. NO uses la URL del enlace [get], ya que puede cambiar fácilmente y dejar de funcionar.
  • [obtener | ver] (2010-05-19 15:03:32, 0.4 KB) [[attachment:ChangeLog.txt]]
  • [obtener | ver] (2010-05-19 15:03:33, 76.3 KB) [[attachment:ClienteRhinoVisu.png]]
  • [obtener | ver] (2010-05-19 15:03:33, 4.6 KB) [[attachment:DemoVisu.png]]
  • [obtener | ver] (2010-05-19 15:03:33, 30.9 KB) [[attachment:DiagramaServidorRhino.png]]
  • [obtener | ver] (2010-05-19 15:03:33, 28.2 KB) [[attachment:Diagramas_De_Flujo_Servidor_V3.0.zip]]
  • [obtener | ver] (2010-05-19 15:03:33, 0.9 KB) [[attachment:Dir-Info.txt]]
  • [obtener | ver] (2010-05-19 15:03:33, 423.4 KB) [[attachment:DocClaseRhinoStatus.zip]]
  • [obtener | ver] (2010-05-19 15:03:34, 4.1 KB) [[attachment:EstructuraDirectoriosDesarrollo.png]]
  • [obtener | ver] (2010-05-19 15:03:34, 2.2 KB) [[attachment:HistoricoDeCambios.txt]]
  • [obtener | ver] (2010-05-19 15:03:34, 0.8 KB) [[attachment:Makefile]]
  • [obtener | ver] (2010-05-19 15:03:34, 688.7 KB) [[attachment:Proyecto-Rhino.pdf]]
  • [obtener | ver] (2010-05-19 15:03:37, 5622.6 KB) [[attachment:Rhino-AGV_Fotos.zip]]
  • [obtener | ver] (2010-05-19 15:03:42, 0.2 KB) [[attachment:RhinoLog.txt]]
  • [obtener | ver] (2010-05-19 15:03:42, 364.8 KB) [[attachment:ServidorRhinoVisu.png]]
  • [obtener | ver] (2010-05-19 15:03:43, 0.5 KB) [[attachment:_Makefile]]
  • [obtener | ver] (2010-05-19 15:03:43, 3.8 KB) [[attachment:_terminal.cpp]]
  • [obtener | ver] (2010-05-19 15:03:43, 1.0 KB) [[attachment:change_log.txt]]
  • [obtener | ver] (2010-05-19 15:03:43, 4.6 KB) [[attachment:cmddef.h]]
  • [obtener | ver] (2010-05-19 15:03:43, 11.4 KB) [[attachment:comSerial.cpp]]
  • [obtener | ver] (2010-05-19 15:03:43, 5.5 KB) [[attachment:comSerial.h]]
  • [obtener | ver] (2010-05-19 15:03:43, 5.8 KB) [[attachment:errdef.h]]
  • [obtener | ver] (2010-05-19 15:03:43, 0.5 KB) [[attachment:rc_error_log.txt]]
  • [obtener | ver] (2010-05-19 15:03:43, 30.6 KB) [[attachment:rhino.cpp]]
  • [obtener | ver] (2010-05-19 15:03:43, 5.2 KB) [[attachment:rhino.h]]
  • [obtener | ver] (2010-05-19 15:03:43, 2.5 KB) [[attachment:statusdef.h]]
  • [obtener | ver] (2010-05-19 15:03:43, 0.7 KB) [[attachment:terminal.cpp]]
  • [obtener | ver] (2010-05-19 15:03:43, 0.5 KB) [[attachment:utilities.txt]]
 All files | Selected Files: delete move to page copy to page

No tienes permisos para adjuntar un archivo a esta página.