mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
nmea_gps: Added str method for coordinate struct
Provide a method to print out a coordinate structure which can be dropped into online mapping pages. Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
parent
cdfb68c381
commit
9a959b578c
@ -616,3 +616,10 @@ std::string NMEAGPS::__str__()
|
|||||||
|
|
||||||
return oss.str();
|
return oss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string coord_DD::__str__()
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << latitude << ", " << longitude;
|
||||||
|
return oss.str();
|
||||||
|
}
|
||||||
|
@ -79,6 +79,11 @@ namespace upm {
|
|||||||
double latitude = 0.0;
|
double latitude = 0.0;
|
||||||
/** Longitude in decimal degrees */
|
/** Longitude in decimal degrees */
|
||||||
double longitude = 0.0;
|
double longitude = 0.0;
|
||||||
|
/**
|
||||||
|
* Provide a string representation of this structure.
|
||||||
|
* @return String representing coordinates
|
||||||
|
*/
|
||||||
|
std::string __str__();
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Satellite structure definition */
|
/** Satellite structure definition */
|
||||||
|
@ -13,6 +13,7 @@ JAVA_JNI_LOADLIBRARY(javaupm_nmea_gps)
|
|||||||
%feature("python:slot", "tp_str", functype="reprfunc") upm::satellite::__str__;
|
%feature("python:slot", "tp_str", functype="reprfunc") upm::satellite::__str__;
|
||||||
%feature("python:slot", "tp_str", functype="reprfunc") upm::nmeatxt::__str__;
|
%feature("python:slot", "tp_str", functype="reprfunc") upm::nmeatxt::__str__;
|
||||||
%feature("python:slot", "tp_str", functype="reprfunc") upm::NMEAGPS::__str__;
|
%feature("python:slot", "tp_str", functype="reprfunc") upm::NMEAGPS::__str__;
|
||||||
|
%feature("python:slot", "tp_str", functype="reprfunc") upm::coord_DD::__str__;
|
||||||
#endif
|
#endif
|
||||||
/* END Python syntax */
|
/* END Python syntax */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user