mirror of
				https://github.com/eclipse/upm.git
				synced 2025-10-31 07:04:14 +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:
		| @@ -616,3 +616,10 @@ std::string NMEAGPS::__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; | ||||
|         /** Longitude in decimal degrees */ | ||||
|         double longitude = 0.0; | ||||
|         /** | ||||
|          * Provide a string representation of this structure. | ||||
|          * @return String representing coordinates | ||||
|          */ | ||||
|         std::string __str__(); | ||||
|     }; | ||||
|  | ||||
|     /** 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::nmeatxt::__str__; | ||||
| %feature("python:slot", "tp_str", functype="reprfunc") upm::NMEAGPS::__str__; | ||||
| %feature("python:slot", "tp_str", functype="reprfunc") upm::coord_DD::__str__; | ||||
| #endif | ||||
| /* END Python syntax */ | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Noel Eck
					Noel Eck