rhino.h

Ir a la documentación de este archivo.
00001 
00002 
00003 
00004 
00005 
00006 
00007 #include <stdio.h>
00008 #include <string.h>
00009 #include <stdlib.h>
00010 
00011 #include "errdef.h"
00012 #include "cmddef.h"
00013 #include "statusdef.h"
00014 
00015 #ifndef RHINO_H
00016 #define RHINO_H
00017 
00018 #define MAX_LOG_LEVEL 3 //  Maximo nivel de logueo
00019 
00020 #define MAX_RB_ERROR_CODES 128 //  Max Rhino Controller Error Codes
00021 #define MAX_RC_ERROR_CODES 32  //  Max Rhino Class Error Codes
00022 
00023 #define MSG_LENGTH 256 //  Max Messages Length
00024 
00025 /*
00026 Por implementar:
00027 -Cargar los mensajes de error y de estado desde un archivo.
00028  (sacarlos del codigo fuente)
00029 -Renombrar las variables globales bajo un mismo criterio.
00030 -Renombrar las variables locales bajo un mismo criterio.
00031 -Homogeneizar un idioma para los nombres de funciones
00032  (o ingles o castellano)
00033 -Implementar la funcion CALLBACK.
00034 -Terminar de codificar el proceso de los comandos restantes.
00035 -Separar en capas lasdistintas tareas:
00036              *Eliminar de la clase toda impresion en pantalla.
00037              *Eliminar de la clase toda escritura en HD.
00038 
00039 Marco AR, 18/04/2008
00040 */
00041 
00042 // CLASE RHINO: Gestion de estado del controlador del Servo Robot XR4 - RHINO
00043 class Rhino{
00044  private:
00045     unsigned int uiLogLevel; 
00046     unsigned int uiErrorCode; 
00047     unsigned int uiStatusCode; 
00048 
00049     // Contenedor de los ultimos datos enviados y recibidos
00050     struct {
00051         unsigned int uiLastCommandtoRhino; 
00052         char         LastCommandtoRhino[MSG_LENGTH]; 
00053         char         LastMessageFromRhino[MSG_LENGTH]; 
00054     }LastCmdAndMsg;
00055 
00056     FILE *pFile; 
00057 
00058     char RhinoBotErrorMsg[MAX_RB_ERROR_CODES][MSG_LENGTH]; 
00059     char RhinoClassErrorMsg[MAX_RC_ERROR_CODES][MSG_LENGTH]; 
00060 
00061     char RhinoBotStatusMsg[MAX_RB_STATUS_CODES][MSG_LENGTH]; 
00062     char RhinoClassStatusMsg[MAX_RC_STATUS_CODES][MSG_LENGTH]; 
00063 
00064     char RhinoMessages[MSG_LENGTH]; 
00065     char cErrorMessage[MSG_LENGTH]; 
00066     char cStatusMessage[MSG_LENGTH]; 
00067 
00068     // Tipo de logueo seleccionado
00069     enum {
00070         LMODisplay, 
00071         LMOFile,    
00072         LMOCBk      
00073     }logType;
00074 
00075     // Para el transpaso de mensajes a la aplicacion principal
00076     struct {
00077         bool bNewMsg; 
00078         char sCBkMessage[MSG_LENGTH]; 
00079     }CallBack;
00080 
00081 
00082     int ProcessErrorMsg(unsigned int); 
00083     int ProcessStatusMsg(unsigned int); 
00084 
00085  public:
00086     Rhino(); 
00087     ~Rhino(); 
00088 
00089     int InitMessageVectors(char [MAX_RB_ERROR_CODES][MSG_LENGTH], char [MAX_RC_ERROR_CODES][MSG_LENGTH], char [MAX_RB_STATUS_CODES][MSG_LENGTH], char [MAX_RC_STATUS_CODES][MSG_LENGTH]); 
00090     
00091     int set_LogLevel(unsigned int); 
00092     int get_LogLevel(unsigned int *); 
00093 
00094     int get_ErrorMsg(char *); 
00095     int get_ErrorMsg(unsigned int, char *); 
00096     int get_ErrorCode(unsigned int *); 
00097 
00098     int get_StatusMsg(char *); 
00099     int get_StatusMsg(unsigned int, char *); 
00100     int get_StatusCode(unsigned int *); 
00101 
00102     int ProcessCommandToRhino(char *); 
00103     int ProcessMessageFromRhino(char *); 
00104     int ProcessCommandToRhino(char *, unsigned int *); 
00105     int ProcessMessageFromRhino(unsigned int, char *, unsigned int *, char *); 
00106 
00107     int CBkMsg(void); 
00108     int get_CBkMsg(char *); 
00109 
00110     int LogMessage(int, char *); 
00111 
00112     int DisplayAllErrorMessages(void); 
00113 };
00114       
00115 #endif //RHINO_H

Generado el Wed Jun 18 19:42:44 2008 para Documentacion de la clase Rhino por  doxygen 1.5.4