1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-01-05 15:00:33 +00:00

Remove more duplicated code

This commit is contained in:
Carles Fernandez 2021-02-22 10:02:21 +01:00
parent b465f050f0
commit 86d701b628
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
6 changed files with 16 additions and 115 deletions

View File

@ -1,14 +1,15 @@
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- SPDX-License-Identifier: BSD-3-Clause -->
<!-- SPDX-FileCopyrightText: 2018-2021 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
<!-- SPDX-FileCopyrightText: 2018-2021 Carles Fernandez-Prades <carles.fernandez@cttc.es> -->
<xs:element name="boost_serialization">
<xs:complexType>
<xs:sequence>
<xs:element name="GNSS-SDR_cnav_utc_model">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:float" name="A1"/>
<xs:element type="xs:float" name="A0"/>
<xs:element type="xs:float" name="A1"/>
<xs:element type="xs:float" name="A2"/>
<xs:element type="xs:int" name="tot"/>
<xs:element type="xs:short" name="WN_T"/>
<xs:element type="xs:byte" name="DeltaT_LS"/>

View File

@ -7,8 +7,9 @@
<xs:element name="GNSS-SDR_utc_model">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:float" name="A1"/>
<xs:element type="xs:float" name="A0"/>
<xs:element type="xs:float" name="A1"/>
<xs:element type="xs:float" name="A2"/>
<xs:element type="xs:int" name="tot"/>
<xs:element type="xs:short" name="WN_T"/>
<xs:element type="xs:byte" name="DeltaT_LS"/>

View File

@ -18,7 +18,7 @@
#ifndef GNSS_SDR_BEIDOU_DNAV_IONO_H
#define GNSS_SDR_BEIDOU_DNAV_IONO_H
#include <boost/serialization/nvp.hpp>
#include "gps_iono.h"
/** \addtogroup Core
* \{ */
@ -27,45 +27,13 @@
/*!
* \brief This class is a storage for the BEIDOU IONOSPHERIC data as described in ICD v2.1
*
* \brief This class is a storage for the BEIDOU IONOSPHERIC data as described
* in ICD v2.1
*/
class Beidou_Dnav_Iono
class Beidou_Dnav_Iono : public Gps_Iono
{
public:
Beidou_Dnav_Iono() = default; //!< Default constructor
// Ionospheric parameters
double alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s]
double alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle]
double alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2]
double alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3]
double beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s]
double beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle]
double beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2]
double beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3]
bool valid{}; //!< Valid flag
template <class Archive>
/*!
* \brief Serialize is a boost standard method to be called by the boost XML serialization. Here is used to save the ephemeris data on disk file.
*/
void serialize(Archive& archive, const unsigned int version)
{
if (version)
{
};
archive& BOOST_SERIALIZATION_NVP(alpha0);
archive& BOOST_SERIALIZATION_NVP(alpha1);
archive& BOOST_SERIALIZATION_NVP(alpha2);
archive& BOOST_SERIALIZATION_NVP(alpha3);
archive& BOOST_SERIALIZATION_NVP(beta0);
archive& BOOST_SERIALIZATION_NVP(beta1);
archive& BOOST_SERIALIZATION_NVP(beta2);
archive& BOOST_SERIALIZATION_NVP(beta3);
}
};

View File

@ -18,8 +18,7 @@
#ifndef GNSS_SDR_GPS_CNAV_IONO_H
#define GNSS_SDR_GPS_CNAV_IONO_H
#include <boost/serialization/nvp.hpp>
#include "gps_iono.h"
/** \addtogroup Core
* \{ */
@ -32,42 +31,10 @@
*
* See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix III
*/
class Gps_CNAV_Iono
class Gps_CNAV_Iono : public Gps_Iono
{
public:
Gps_CNAV_Iono() = default; //!< Default constructor
// Ionospheric parameters
double alpha0{}; //!< Coefficient 0 of a cubic equation representing the amplitude of the vertical delay [s]
double alpha1{}; //!< Coefficient 1 of a cubic equation representing the amplitude of the vertical delay [s/semi-circle]
double alpha2{}; //!< Coefficient 2 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^2]
double alpha3{}; //!< Coefficient 3 of a cubic equation representing the amplitude of the vertical delay [s(semi-circle)^3]
double beta0{}; //!< Coefficient 0 of a cubic equation representing the period of the model [s]
double beta1{}; //!< Coefficient 1 of a cubic equation representing the period of the model [s/semi-circle]
double beta2{}; //!< Coefficient 2 of a cubic equation representing the period of the model [s(semi-circle)^2]
double beta3{}; //!< Coefficient 3 of a cubic equation representing the period of the model [s(semi-circle)^3]
bool valid{}; //!< Valid flag
template <class Archive>
/*!
* \brief Serialize is a boost standard method to be called by the boost XML
* serialization. Here is used to save the ephemeris data on disk file.
*/
inline void serialize(Archive& archive, const unsigned int version) const
{
if (version)
{
};
archive& BOOST_SERIALIZATION_NVP(alpha0);
archive& BOOST_SERIALIZATION_NVP(alpha1);
archive& BOOST_SERIALIZATION_NVP(alpha2);
archive& BOOST_SERIALIZATION_NVP(alpha3);
archive& BOOST_SERIALIZATION_NVP(beta0);
archive& BOOST_SERIALIZATION_NVP(beta1);
archive& BOOST_SERIALIZATION_NVP(beta2);
archive& BOOST_SERIALIZATION_NVP(beta3);
}
};

View File

@ -18,8 +18,7 @@
#ifndef GNSS_SDR_GPS_CNAV_UTC_MODEL_H
#define GNSS_SDR_GPS_CNAV_UTC_MODEL_H
#include <boost/serialization/nvp.hpp>
#include <cstdint>
#include "gps_utc_model.h"
/** \addtogroup Core
* \{ */
@ -32,46 +31,10 @@
*
* See https://www.gps.gov/technical/icwg/IS-GPS-200L.pdf Appendix III
*/
class Gps_CNAV_Utc_Model
class Gps_CNAV_Utc_Model : public Gps_Utc_Model
{
public:
/*!
* Default constructor
*/
Gps_CNAV_Utc_Model() = default;
// UTC parameters
double A2{}; //!< 2nd order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s]
double A1{}; //!< 1st order term of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s/s]
double A0{}; //!< Constant of a model that relates GPS and UTC time (ref. 20.3.3.5.2.4 IS-GPS-200L) [s]
int32_t tot{}; //!< Reference time for UTC data (reference 20.3.4.5 and 20.3.3.5.2.4 IS-GPS-200L) [s]
int32_t WN_T{}; //!< UTC reference week number [weeks]
int32_t DeltaT_LS{}; //!< Delta time due to leap seconds [s]. Number of leap seconds since 6-Jan-1980 as transmitted by the GPS almanac.
int32_t WN_LSF{}; //!< Week number at the end of which the leap second becomes effective [weeks]
int32_t DN{}; //!< Day number (DN) at the end of which the leap second becomes effective [days]
int32_t DeltaT_LSF{}; //!< Scheduled future or recent past (relative to NAV message upload) value of the delta time due to leap seconds [s]
bool valid{};
template <class Archive>
/*
* \brief Serialize is a boost standard method to be called by the boost XML
* serialization. Here is used to save the ephemeris data on disk file.
*/
inline void serialize(Archive& archive, const uint32_t version)
{
if (version)
{
};
archive& BOOST_SERIALIZATION_NVP(A1);
archive& BOOST_SERIALIZATION_NVP(A0);
archive& BOOST_SERIALIZATION_NVP(tot);
archive& BOOST_SERIALIZATION_NVP(WN_T);
archive& BOOST_SERIALIZATION_NVP(DeltaT_LS);
archive& BOOST_SERIALIZATION_NVP(WN_LSF);
archive& BOOST_SERIALIZATION_NVP(DN);
archive& BOOST_SERIALIZATION_NVP(DeltaT_LSF);
archive& BOOST_SERIALIZATION_NVP(valid);
}
Gps_CNAV_Utc_Model() = default; //!< Default constructor
};

View File

@ -63,8 +63,9 @@ public:
if (version)
{
};
archive& BOOST_SERIALIZATION_NVP(A1);
archive& BOOST_SERIALIZATION_NVP(A0);
archive& BOOST_SERIALIZATION_NVP(A1);
archive& BOOST_SERIALIZATION_NVP(A2);
archive& BOOST_SERIALIZATION_NVP(tot);
archive& BOOST_SERIALIZATION_NVP(WN_T);
archive& BOOST_SERIALIZATION_NVP(DeltaT_LS);