mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-27 12:25:17 +00:00
Fix bug in NMEA messages. Fixes #45
Add a new test for the NMEA printer
This commit is contained in:
committed by
Damian Miralles
parent
8bbe4edc64
commit
5530352e8a
@@ -236,9 +236,10 @@ std::string Nmea_Printer::latitude_to_hm(double lat)
|
||||
out_string.fill('0');
|
||||
out_string.width(2);
|
||||
out_string << deg;
|
||||
out_string.width(6);
|
||||
out_string.precision(4);
|
||||
out_string << mins;
|
||||
out_string.width(2);
|
||||
out_string << static_cast<int>(mins) << ".";
|
||||
out_string.width(4);
|
||||
out_string << static_cast<int>((mins - static_cast<double>(static_cast<int>(mins))) * 1e4);
|
||||
|
||||
if (north == true)
|
||||
{
|
||||
@@ -273,9 +274,10 @@ std::string Nmea_Printer::longitude_to_hm(double longitude)
|
||||
out_string.width(3);
|
||||
out_string.fill('0');
|
||||
out_string << deg;
|
||||
out_string.width(6);
|
||||
out_string.precision(4);
|
||||
out_string << mins;
|
||||
out_string.width(2);
|
||||
out_string << static_cast<int>(mins) << ".";
|
||||
out_string.width(4);
|
||||
out_string << static_cast<int>((mins - static_cast<double>(static_cast<int>(mins))) * 1e4);
|
||||
|
||||
if (east == true)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user