Para Juan
NAVDATA.h@11:c802de4a6b13, 2017-07-30 (annotated)
- Committer:
- gstedile
- Date:
- Sun Jul 30 15:38:25 2017 +0000
- Revision:
- 11:c802de4a6b13
- Parent:
- 10:45e3c7f30950
V9_UI
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gstedile | 11:c802de4a6b13 | 1 | /* NAVDATA Module Library*/ |
gstedile | 0:9370c06bf7f3 | 2 | |
gstedile | 11:c802de4a6b13 | 3 | /** NAVDATA manage and store last navigation data */ |
gstedile | 0:9370c06bf7f3 | 4 | |
gstedile | 0:9370c06bf7f3 | 5 | |
gstedile | 0:9370c06bf7f3 | 6 | #include "mbed.h" |
gstedile | 0:9370c06bf7f3 | 7 | #include <string> |
gstedile | 4:400b92fb528c | 8 | #include <vector> |
gstedile | 4:400b92fb528c | 9 | using namespace std; |
gstedile | 4:400b92fb528c | 10 | #include <math.h> |
gstedile | 0:9370c06bf7f3 | 11 | |
gstedile | 1:48e2f1194609 | 12 | #ifndef MBED_NAVDATA_H |
gstedile | 1:48e2f1194609 | 13 | #define MBED_NAVDATA_H |
gstedile | 11:c802de4a6b13 | 14 | enum datavars{longitude_f=0, longitude_i, latitude_f, latitude_i, time_f, time_i, distance_p, speed_p, consumption_i, consumption_f, consumption_p, cons_mile_p, cons_hour_p, cons_interpolated, CANT_DATA_VARS }; // Contiene las variables de navegacion de inicio y fin del último período muestreado. (distance_p in nautic miles, speed_p in knots). 0-> real ; 1->interpolated; 2->smoothed; -1-> initial padding. |
gstedile | 5:ae5dfda6b0ab | 15 | |
gstedile | 0:9370c06bf7f3 | 16 | |
gstedile | 11:c802de4a6b13 | 17 | |
gstedile | 0:9370c06bf7f3 | 18 | |
gstedile | 0:9370c06bf7f3 | 19 | |
gstedile | 1:48e2f1194609 | 20 | class NAVDATA { |
gstedile | 3:de86e5eb7a8a | 21 | private: |
gstedile | 10:45e3c7f30950 | 22 | |
gstedile | 10:45e3c7f30950 | 23 | double Klong, Klat, Ksen; //Default value is set to obtain distance in nautic miles and consumption in litres. |
gstedile | 3:de86e5eb7a8a | 24 | |
gstedile | 3:de86e5eb7a8a | 25 | int ZH; |
gstedile | 11:c802de4a6b13 | 26 | |
gstedile | 0:9370c06bf7f3 | 27 | public: |
gstedile | 10:45e3c7f30950 | 28 | int np_concat; // Cantidad máxima de períodos que combinan en uno solo a velocidad constante antes de almacenar los datos.(ver VCODATA::store_data); |
gstedile | 4:400b92fb528c | 29 | |
gstedile | 10:45e3c7f30950 | 30 | float max_period_time; // Maximo tiempo aceptado entre muestras consecutivas para validar los períodos en horas (hh,hhhh). SETEAR en NAVDATA.cpp |
gstedile | 10:45e3c7f30950 | 31 | |
gstedile | 10:45e3c7f30950 | 32 | double time_NMEA2hours (float timetickNMEA); // Convierte formato de hora NMEA a horas con decimales. (hhmmss,ss ---> hh,hhhh) |
gstedile | 10:45e3c7f30950 | 33 | |
gstedile | 10:45e3c7f30950 | 34 | NAVDATA(double Klongitud, double Klatitud, float Ksensor, int ZoneHour, float max_period_time); // Constantes de latitud, longitud, del sensor, zona horaria y tiempo de periodo maximo. |
gstedile | 0:9370c06bf7f3 | 35 | |
gstedile | 4:400b92fb528c | 36 | NAVDATA(); // Sin argumentos |
gstedile | 4:400b92fb528c | 37 | |
gstedile | 10:45e3c7f30950 | 38 | |
gstedile | 10:45e3c7f30950 | 39 | void paddata(); |
gstedile | 10:45e3c7f30950 | 40 | |
gstedile | 10:45e3c7f30950 | 41 | /** Rotacion de los datos almacenados con los entrantes. |
gstedile | 10:45e3c7f30950 | 42 | * @return 0 si hubo una rotacion con datos validados, else -1. |
gstedile | 0:9370c06bf7f3 | 43 | */ |
gstedile | 0:9370c06bf7f3 | 44 | |
gstedile | 10:45e3c7f30950 | 45 | int rotate_data(double x, double y, double t, float c, int v_max); // Longitud, Latitud, Timestamp, Consumption, Velocidad Maxima; |
gstedile | 3:de86e5eb7a8a | 46 | |
gstedile | 11:c802de4a6b13 | 47 | double LAST_NAV_DATA[CANT_DATA_VARS]; // Arrays de datos de navegacion del último período. En caso de agregar variables, modificar enum datavars. |
gstedile | 11:c802de4a6b13 | 48 | |
gstedile | 3:de86e5eb7a8a | 49 | |
gstedile | 0:9370c06bf7f3 | 50 | }; |
gstedile | 0:9370c06bf7f3 | 51 | #endif |
gstedile | 1:48e2f1194609 | 52 |