mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-10-31 15:16:22 +00:00
Adding PVT UTC time string in rfc 3339 format to protobuf PVT monitor output
This commit is contained in:
parent
4105765637
commit
5f5e861822
@ -42,4 +42,5 @@ double hdop = 27; // Horizontal Dilution of Precision
|
|||||||
double vdop = 28; // Vertical Dilution of Precision
|
double vdop = 28; // Vertical Dilution of Precision
|
||||||
|
|
||||||
double user_clk_drift_ppm = 29; // User clock drift [ppm]
|
double user_clk_drift_ppm = 29; // User clock drift [ppm]
|
||||||
|
string utc_time = 30; // PVT UTC time (rfc 3339 datetime string)
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <boost/serialization/nvp.hpp>
|
#include <boost/serialization/nvp.hpp>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
/** \addtogroup PVT
|
/** \addtogroup PVT
|
||||||
* \{ */
|
* \{ */
|
||||||
@ -84,6 +85,10 @@ public:
|
|||||||
// User clock drift [ppm]
|
// User clock drift [ppm]
|
||||||
double user_clk_drift_ppm;
|
double user_clk_drift_ppm;
|
||||||
|
|
||||||
|
// PVT UTC Time (rfc 3339 datetime string)
|
||||||
|
std::string utc_time;
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief This member function serializes and restores
|
* \brief This member function serializes and restores
|
||||||
* Monitor_Pvt objects from a byte stream.
|
* Monitor_Pvt objects from a byte stream.
|
||||||
@ -131,6 +136,7 @@ public:
|
|||||||
ar& BOOST_SERIALIZATION_NVP(vdop);
|
ar& BOOST_SERIALIZATION_NVP(vdop);
|
||||||
|
|
||||||
ar& BOOST_SERIALIZATION_NVP(user_clk_drift_ppm);
|
ar& BOOST_SERIALIZATION_NVP(user_clk_drift_ppm);
|
||||||
|
ar& BOOST_SERIALIZATION_NVP(utc_time);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1686,6 +1686,17 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
|
|||||||
// User clock drift [ppm]
|
// User clock drift [ppm]
|
||||||
d_monitor_pvt.user_clk_drift_ppm = clock_drift_ppm;
|
d_monitor_pvt.user_clk_drift_ppm = clock_drift_ppm;
|
||||||
|
|
||||||
|
//write UTC time string
|
||||||
|
|
||||||
|
// Use a facet to display time in a custom format (only hour and minutes).
|
||||||
|
boost::posix_time::time_facet *facet = new boost::posix_time::time_facet();
|
||||||
|
facet->format("%Y-%m-%dT%H:%M:%S%F");
|
||||||
|
std::stringstream stream;
|
||||||
|
stream.imbue(std::locale(std::locale::classic(), facet));
|
||||||
|
stream << p_time;
|
||||||
|
stream << 'Z';
|
||||||
|
d_monitor_pvt.utc_time = stream.str();
|
||||||
|
|
||||||
// ######## LOG FILE #########
|
// ######## LOG FILE #########
|
||||||
if (d_flag_dump_enabled == true)
|
if (d_flag_dump_enabled == true)
|
||||||
{
|
{
|
||||||
|
@ -112,6 +112,7 @@ public:
|
|||||||
monitor_.set_hdop(monitor->hdop);
|
monitor_.set_hdop(monitor->hdop);
|
||||||
monitor_.set_vdop(monitor->vdop);
|
monitor_.set_vdop(monitor->vdop);
|
||||||
monitor_.set_user_clk_drift_ppm(monitor->user_clk_drift_ppm);
|
monitor_.set_user_clk_drift_ppm(monitor->user_clk_drift_ppm);
|
||||||
|
monitor_.set_utc_time(monitor->utc_time);
|
||||||
|
|
||||||
monitor_.SerializeToString(&data);
|
monitor_.SerializeToString(&data);
|
||||||
return data;
|
return data;
|
||||||
@ -150,6 +151,7 @@ public:
|
|||||||
monitor.hdop = mon.hdop();
|
monitor.hdop = mon.hdop();
|
||||||
monitor.vdop = mon.vdop();
|
monitor.vdop = mon.vdop();
|
||||||
monitor.user_clk_drift_ppm = mon.user_clk_drift_ppm();
|
monitor.user_clk_drift_ppm = mon.user_clk_drift_ppm();
|
||||||
|
monitor.utc_time = mon.utc_time();
|
||||||
|
|
||||||
return monitor;
|
return monitor;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user