Geo lib: Do not hardcode assumptions about process name.

This commit is contained in:
Lorenz Meier
2015-10-25 14:52:47 +01:00
parent aafb11ae92
commit 352b1692d1
+6 -16
View File
@@ -86,12 +86,7 @@ __EXPORT uint64_t map_projection_timestamp(const struct map_projection_reference
__EXPORT int map_projection_global_init(double lat_0, double lon_0,
uint64_t timestamp) //lat_0, lon_0 are expected to be in correct format: -> 47.1234567 and not 471234567
{
if (strcmp("commander", getprogname()) == 0) {
return map_projection_init_timestamped(&mp_ref, lat_0, lon_0, timestamp);
} else {
return -1;
}
return map_projection_init_timestamped(&mp_ref, lat_0, lon_0, timestamp);
}
__EXPORT int map_projection_init_timestamped(struct map_projection_reference_s *ref, double lat_0, double lon_0,
@@ -217,19 +212,14 @@ __EXPORT int map_projection_global_getref(double *lat_0, double *lon_0)
}
__EXPORT int globallocalconverter_init(double lat_0, double lon_0, float alt_0, uint64_t timestamp)
{
if (strcmp("commander", getprogname()) == 0) {
gl_ref.alt = alt_0;
gl_ref.alt = alt_0;
if (!map_projection_global_init(lat_0, lon_0, timestamp)) {
gl_ref.init_done = true;
return 0;
} else {
gl_ref.init_done = false;
return -1;
}
if (!map_projection_global_init(lat_0, lon_0, timestamp)) {
gl_ref.init_done = true;
return 0;
} else {
gl_ref.init_done = false;
return -1;
}
}