Adding PVT UTC time string in rfc 3339 format to protobuf PVT monitor output

This commit is contained in:
Javier Arribas 2023-09-19 13:10:56 +02:00
parent 4105765637
commit 5f5e861822
4 changed files with 20 additions and 0 deletions

View File

@ -42,4 +42,5 @@ double hdop = 27; // Horizontal Dilution of Precision
double vdop = 28; // Vertical Dilution of Precision
double user_clk_drift_ppm = 29; // User clock drift [ppm]
string utc_time = 30; // PVT UTC time (rfc 3339 datetime string)
}

View File

@ -19,6 +19,7 @@
#include <boost/serialization/nvp.hpp>
#include <cstdint>
#include <string>
/** \addtogroup PVT
* \{ */
@ -84,6 +85,10 @@ public:
// User clock 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
* Monitor_Pvt objects from a byte stream.
@ -131,6 +136,7 @@ public:
ar& BOOST_SERIALIZATION_NVP(vdop);
ar& BOOST_SERIALIZATION_NVP(user_clk_drift_ppm);
ar& BOOST_SERIALIZATION_NVP(utc_time);
}
};

View File

@ -1686,6 +1686,17 @@ bool Rtklib_Solver::get_PVT(const std::map<int, Gnss_Synchro> &gnss_observables_
// User 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 #########
if (d_flag_dump_enabled == true)
{

View File

@ -112,6 +112,7 @@ public:
monitor_.set_hdop(monitor->hdop);
monitor_.set_vdop(monitor->vdop);
monitor_.set_user_clk_drift_ppm(monitor->user_clk_drift_ppm);
monitor_.set_utc_time(monitor->utc_time);
monitor_.SerializeToString(&data);
return data;
@ -150,6 +151,7 @@ public:
monitor.hdop = mon.hdop();
monitor.vdop = mon.vdop();
monitor.user_clk_drift_ppm = mon.user_clk_drift_ppm();
monitor.utc_time = mon.utc_time();
return monitor;
}