Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+136
@@ -0,0 +1,136 @@
|
||||
/**
|
||||
* Read XDR telegrams from a directory and convert it to EtsTetraIcd structures
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Christian Ehrlicher, SLSE, 2016-04-14
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <TrainingAreaBase/recv_from_tab.h>
|
||||
#include <QObject>
|
||||
#include <memory>
|
||||
#include "logger.h"
|
||||
#include <cmath>
|
||||
|
||||
class QTimer;
|
||||
namespace Nmea
|
||||
{
|
||||
class NmeaHandlerRx : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit NmeaHandlerRx(const std::shared_ptr<TrainingAreaBase::RecvFromTab> &rxHandler);
|
||||
|
||||
bool handleTelegram(const QString &data);
|
||||
|
||||
private:
|
||||
|
||||
struct gpgga_data //Global Positioning System Fix Data
|
||||
{
|
||||
QString A_hour;
|
||||
QString B_latitude;
|
||||
char C_latitude_dir;
|
||||
QString D_longitude;
|
||||
char E_longitude_dir;
|
||||
int F_qualidade_fixa = -1;
|
||||
int G_quantidade_satelites = -1;
|
||||
float H_diluicao_da_precisao_horizontal = -1;
|
||||
float I_altitude = -1;
|
||||
char J_unidade_medida_altura;
|
||||
float K_altura_geoide_acima_elipsoide = -1;
|
||||
char L_unidade_medida_geoide;
|
||||
float M_idade_ultima_atualizacao_dgps = -1;
|
||||
int N_dgps_id = -1;
|
||||
};
|
||||
|
||||
struct battery_state
|
||||
{
|
||||
QString serialNumber;
|
||||
int battery; // 0-5 = 0 = empty, 5 = full bennetec intern
|
||||
int temperature; // Celsius
|
||||
int frequency; // Hertz
|
||||
float generic; // x.x = variable data
|
||||
long current; // mA
|
||||
bool G_velocity; // 1 = ON/ CLOSED, 0 = OFF/ OPEN
|
||||
long voltage; // [mV]
|
||||
};
|
||||
|
||||
struct alarm_state
|
||||
{
|
||||
QString time;
|
||||
int number;
|
||||
bool condition;
|
||||
bool acknowledgeState;
|
||||
QString description;
|
||||
};
|
||||
|
||||
|
||||
struct gpgsa_data //GPS DOP and active satellites
|
||||
{
|
||||
char A_modo = -1;
|
||||
char B_modo_dimensional = -1;
|
||||
int *CN_ids_satelites;
|
||||
float O_PDOP = -1;
|
||||
float P_HDOP = -1;
|
||||
float Q_VDOP = -1;
|
||||
};
|
||||
|
||||
struct satelite
|
||||
{
|
||||
int A_sv_prn = -1;
|
||||
int B_elevacao_graus = -1; //90 max
|
||||
int C_azimuth = -1;
|
||||
int D_snr = -1;
|
||||
};
|
||||
|
||||
struct gpgsv_data //GPS Satellites in view
|
||||
{
|
||||
unsigned A_total_mensagens = -1;
|
||||
unsigned B_numero_desta_mensagem = -1;
|
||||
int C_satelites_visiveis = -1;
|
||||
satelite DS_sats[4];
|
||||
};
|
||||
|
||||
struct gprmc_data //Recommended minimum specific GPS/Transit data
|
||||
{
|
||||
int A_hour = -1;
|
||||
char B_warning = -1;
|
||||
float C_latitude = -1;
|
||||
char D_latitude_coord = -1;
|
||||
float E_longitude = -1;
|
||||
char F_longitude_coord = -1;
|
||||
float G_velocity = -1;
|
||||
float H_CMG = -1;
|
||||
int I_data = -1;
|
||||
float J_variacao_magnetica = -1;
|
||||
char K_variacao_magnetica_coord = -1;
|
||||
|
||||
|
||||
};
|
||||
|
||||
unsigned packagesInvalid = 0;
|
||||
|
||||
|
||||
void GPGGA(const QString &package);
|
||||
void GPRMC(const QString &package);
|
||||
void IIXDR(const QString &package);
|
||||
void IIALR(const QString &package);
|
||||
|
||||
private slots:
|
||||
void sendTestMessages();
|
||||
|
||||
private:
|
||||
template<typename T>
|
||||
void rxData(const T &data);
|
||||
void decode(QString nmeaPackage);
|
||||
bool checksum(QString package);
|
||||
qint64 getDateTime(QString receivedTimeStr);
|
||||
QStringList m_batteries;
|
||||
protected:
|
||||
const std::shared_ptr<TrainingAreaBase::RecvFromTab> m_rxHandler;
|
||||
bool m_bWarnedOnce;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
} // namespace Nmea
|
||||
Reference in new issue
Block a user