Página principal | Jerarquía de la clase | Lista alfabética | Lista de componentes | Lista de archivos | Miembros de las clases | Archivos de los miembros | Páginas relacionadas

v_sensor.h

Ir a la documentación de este archivo.
00001 //===========================================================================
00002 //= v_sensor.h                                Julio de 1998, enero del 2000 =
00003 //=-------------------------------------------------------------------------=
00004 //= Definicion de clases de visores de sensores                             =
00005 //=-------------------------------------------------------------------------=
00006 //= ADVERTENCIA: ESTE SOFTWARE NO ESTA CONCEBIDO NI DISENNADO PARA EL USO   =
00007 //= EN EQUIPO DE CONTROL EN LINEA EN ENTORNOS PELIGROSOS QUE REQUIERAN UN   =
00008 //= DESEMPENNO LIBRE DE FALLAS, COMO LA OPERACION DE PLANTAS NUCLEARES,     = 
00009 //= SISTEMAS DE NAVEGACION O COMUNICACION EN AVIONES, TRAFICO AEREO,        =
00010 //= EQUIPO MEDICO DEL CUAL DEPENDAN VIDAS HUMANAS O SISTEMAS DE ARMAMENTO,  =
00011 //= EN LOS CUALES UNA FALLA EN EL SOFTWARE PUEDA IMPLICAR DIRECTAMENTE LA   =
00012 //= MUERTE, DANNOS PERSONALES O DANNOS FISICOS Y/O AMBIENTALES GRAVES       =
00013 //= ("ACTIVIDADES DE ALGO RIESGO").                                         =
00014 //=-------------------------------------------------------------------------=
00015 //= Autor original: Oscar J. Chavarro G.  A.K.A. JEDILINK. Copyright (c),   =
00016 //= 1997 - 2003, oscarchavarro@hotmail.com                                  =
00017 //= AQUYNZA es software libre, y se rige bajo los terminos de la licencia   =
00018 //= LGPL de GNU (http://www.gnu.org). Para mayor informacion respecto a la  =
00019 //= licencia de uso, consulte el archivo ./doc/LICENCIA en la distribucion. =
00020 //===========================================================================
00021 
00022 #include "jed_defs.h"  // Incluir antes que nada, en ese modulo se definen 
00023                        // aspectos importantes para la portabilidad del sistema
00024 #ifndef __V_SENSOR__
00025 #define __V_SENSOR__
00026 
00027 #include "core/control/sensor.h"
00028 #include "toolkits/entorno/camara.h"
00029 
00030 #ifndef __VISOR__
00031     #error "No incluya a v_sensor.h, incluya a visor.h!"
00032 #endif
00033 
00034 #ifdef VEL_ROSITA
00035     #include "framework/visual/visor.h"
00036 #endif
00037 
00038 class VISOR_SENSOR : public VISOR {
00039   protected:
00040     //-----------------------------------------------------------------------
00041     char *_nombre_variable; // Esto referencia a la variable que se visualiza
00042 
00043     //- Elementos de posicionamiento dentro del viewport del VISOR padre -----
00044     int tam_grilla; // Divido el viewport en una grilla de tam * tam cuadritos
00045     int x_grilla;   // Estoy en el cuadrito de coordenadas (x, y) en esa grilla
00046     int y_grilla;
00047     int dx_grilla;  // Este es el tamanno de mi area en unidades de grilla
00048     int dy_grilla;
00049     int cuadre_grilla; // Esto es -1, 0 o 1.  Ver CAMARA::subbillboard_gl.
00050     double _transparencia;
00051 
00052     BOOLEAN leer_sensor(TOKENIZADOR *Sabiondo, char *cad);
00053 
00054   public:
00055     VISOR_SENSOR();
00056 
00057 #ifdef GL_ENABLED
00058     virtual void pintar_gl(void) = 0;
00059 #endif
00060     void posicione(int tam, int i, int j, int cuadre);
00061     virtual int tipo(void) = 0;
00062     virtual BOOLEAN asociar_sensor(SENSOR *S) = 0;
00063     char *nombre_variable(void);
00064 
00065     //- Operaciones de persistencia -----------------------------------------
00066     virtual BOOLEAN leer(TOKENIZADOR *Sabiondo) = 0;
00067 };
00068 
00069 class VISOR_SENSOR_FLOAT : public VISOR_SENSOR {
00070   private:
00071     SENSOR_FLOAT *Sensor;
00072 
00073     //- Vector de estado con los ultimos `tam_data` valores ------------------
00074     float *data;
00075     int tam_data;
00076     int pos;
00077 
00078     //------------------------------------------------------------------------
00079     int _tipo;      // Selecciona el algoritmo de visualizacion
00080     float min_val;
00081     float max_val;
00082 
00083     void configurar_vector_de_estado(int tam);
00084 
00085   public:
00086     VISOR_SENSOR_FLOAT();
00087     VISOR_SENSOR_FLOAT(int nuevo_tipo, float min, float max);
00088     virtual ~VISOR_SENSOR_FLOAT();
00089 
00090   #ifdef GL_ENABLED
00091     void pintar_gl(void);
00092   #endif
00093     int tipo(void);
00094     BOOLEAN asociar_sensor(SENSOR *S);
00095 
00096     //- Operaciones de persistencia -----------------------------------------
00097     BOOLEAN leer(TOKENIZADOR *Sabiondo);
00098 };
00099 
00100 class VISOR_SENSOR_VECTOR : public VISOR_SENSOR {
00101   private:
00102     SENSOR_VECTOR *Sensor;
00103     VECTOR *data;
00104     int tam_data;
00105     int _tipo;
00106     int pos;
00107     int min_pos;
00108 
00109     VECTOR min_val;
00110     VECTOR max_val;
00111 
00112   #ifdef GL_ENABLED
00113     void init_fonts(void);
00114     void pintar_vector_gl(CAMARA *Camara);
00115     void pintar_vistavion1_gl(CAMARA *Camara);
00116     void pintar_vistavion2_gl(CAMARA *Camara);
00117   #endif
00118   public:
00119     VISOR_SENSOR_VECTOR();
00120     VISOR_SENSOR_VECTOR(int nuevo_tipo);
00121     virtual ~VISOR_SENSOR_VECTOR();
00122 
00123 #ifdef GL_ENABLED
00124     void pintar_gl(void);
00125 #endif
00126     int tipo(void);
00127     BOOLEAN asociar_sensor(SENSOR *S);
00128 
00129     //- Operaciones de persistencia -----------------------------------------
00130     BOOLEAN leer(TOKENIZADOR *Sabiondo);
00131 };
00132 
00133 extern void
00134 jvs_cuadro_gl(float x, float y, float x_tam, float y_tam, float percent,
00135     double _transparencia);
00136 extern void
00137 jvs_pintar_paleta(float x, float y, float x_tam, float y_tam,
00138     double _transparencia);
00139 
00140 #endif
00141 //===========================================================================
00142 //= EOF                                                                     =
00143 //===========================================================================
00144 

Este archivo HTML ha sido generado automáticamente a partir del código fuente AQUYNZA. NO LO EDITE. Para mayor información contacte al autor.