Para Juan

Dependents:   SNOCC_V1 SNOCC_V2

Committer:
gstedile
Date:
Sun Apr 02 19:26:20 2017 +0000
Revision:
3:de86e5eb7a8a
Parent:
2:86e9ac5dcacc
Child:
4:400b92fb528c
VCODATA.h sin errrores

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gstedile 1:48e2f1194609 1 /* mbed NAVDATA Module Library
gstedile 0:9370c06bf7f3 2 * Copyright (c) 2008-2010, sford
gstedile 0:9370c06bf7f3 3 *
gstedile 0:9370c06bf7f3 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
gstedile 0:9370c06bf7f3 5 * of this software and associated documentation files (the "Software"), to deal
gstedile 0:9370c06bf7f3 6 * in the Software without restriction, including without limitation the rights
gstedile 0:9370c06bf7f3 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
gstedile 0:9370c06bf7f3 8 * copies of the Software, and to permit persons to whom the Software is
gstedile 0:9370c06bf7f3 9 * furnished to do so, subject to the following conditions:
gstedile 0:9370c06bf7f3 10 *
gstedile 0:9370c06bf7f3 11 * The above copyright notice and this permission notice shall be included in
gstedile 0:9370c06bf7f3 12 * all copies or substantial portions of the Software.
gstedile 0:9370c06bf7f3 13 *
gstedile 0:9370c06bf7f3 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
gstedile 0:9370c06bf7f3 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
gstedile 0:9370c06bf7f3 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
gstedile 0:9370c06bf7f3 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
gstedile 0:9370c06bf7f3 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
gstedile 0:9370c06bf7f3 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
gstedile 0:9370c06bf7f3 20 * THE SOFTWARE.
gstedile 0:9370c06bf7f3 21 */
gstedile 0:9370c06bf7f3 22
gstedile 0:9370c06bf7f3 23 /*############################################################################
gstedile 0:9370c06bf7f3 24 ##############################################################################
gstedile 0:9370c06bf7f3 25
gstedile 0:9370c06bf7f3 26 EDITAR ESTE HEADER PARA QUE SE ADAPTE AL SENSOR
gstedile 0:9370c06bf7f3 27
gstedile 0:9370c06bf7f3 28 */
gstedile 0:9370c06bf7f3 29
gstedile 0:9370c06bf7f3 30 #include "mbed.h"
gstedile 0:9370c06bf7f3 31 #include <string>
gstedile 0:9370c06bf7f3 32
gstedile 1:48e2f1194609 33 #ifndef MBED_NAVDATA_H
gstedile 1:48e2f1194609 34 #define MBED_NAVDATA_H
gstedile 0:9370c06bf7f3 35
gstedile 1:48e2f1194609 36 /** NAVDATA manage and store last navigation data */
gstedile 0:9370c06bf7f3 37
gstedile 0:9370c06bf7f3 38
gstedile 1:48e2f1194609 39 class NAVDATA {
gstedile 3:de86e5eb7a8a 40 private:
gstedile 3:de86e5eb7a8a 41
gstedile 3:de86e5eb7a8a 42 enum datavars{longitude_f=0, longitude_i, latitude_f, latitude_i, time_f, time_i, distance_p, speed_p, consumption_p, cons_mile_p, cons_hour_p, 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)
gstedile 3:de86e5eb7a8a 43
gstedile 3:de86e5eb7a8a 44
gstedile 3:de86e5eb7a8a 45 float time_NMEA2hours (float timestickNMEA);
gstedile 3:de86e5eb7a8a 46
gstedile 3:de86e5eb7a8a 47 float Klong, Klat, Ksen; //Default value is set to obtain distance in nautic miles and consumption in litres.
gstedile 3:de86e5eb7a8a 48
gstedile 3:de86e5eb7a8a 49 int ZH;
gstedile 0:9370c06bf7f3 50 public:
gstedile 0:9370c06bf7f3 51
gstedile 0:9370c06bf7f3 52 /** Create the GPS interface, connected to the specified serial port
gstedile 0:9370c06bf7f3 53 */
gstedile 0:9370c06bf7f3 54
gstedile 1:48e2f1194609 55
gstedile 0:9370c06bf7f3 56
gstedile 3:de86e5eb7a8a 57 NAVDATA(float Klongitud, float Klatitud, float Ksensor, int ZoneHour); // Constantes de latitud, longitud, del sensor y zona horaria.
gstedile 0:9370c06bf7f3 58
gstedile 1:48e2f1194609 59
gstedile 2:86e9ac5dcacc 60 /** Rotation of the stored with incoming data
gstedile 0:9370c06bf7f3 61 *
gstedile 1:48e2f1194609 62 * @return 1 if there was a rotation with valid data, else 0
gstedile 0:9370c06bf7f3 63 */
gstedile 0:9370c06bf7f3 64
gstedile 0:9370c06bf7f3 65
gstedile 2:86e9ac5dcacc 66 int rotate_data(float x, float y, float t, float c); // Longitud, Latitud, Timestamp, Consumption;
gstedile 2:86e9ac5dcacc 67
gstedile 3:de86e5eb7a8a 68
gstedile 3:de86e5eb7a8a 69 float LAST_NAV_DATA [CANT_DATA_VARS]; // Arrays de datos de navegacion del último período. En caso de agregar variables, modificar enum datavars.
gstedile 3:de86e5eb7a8a 70
gstedile 3:de86e5eb7a8a 71
gstedile 1:48e2f1194609 72 /** Export last navigation data array */
gstedile 0:9370c06bf7f3 73
gstedile 1:48e2f1194609 74
gstedile 3:de86e5eb7a8a 75 //void data_export (float NAV_DATA[]); // En caso de que LAST_NAV_DATA sea private
gstedile 0:9370c06bf7f3 76
gstedile 0:9370c06bf7f3 77
gstedile 1:48e2f1194609 78
gstedile 3:de86e5eb7a8a 79 // Zone Hour
gstedile 0:9370c06bf7f3 80
gstedile 0:9370c06bf7f3 81 };
gstedile 0:9370c06bf7f3 82 #endif
gstedile 1:48e2f1194609 83