summaryrefslogtreecommitdiff
path: root/xgps.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-09-03 10:16:43 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-09-03 10:16:43 +0000
commitff1a623dbdca3fa26de67d88739d9a039b8e39ea (patch)
treee5dd06d01abeba8e9210f65f79d4c19eeeb4cb94 /xgps.c
parentd5755a55b8681c04ee0de3dc683124e581e47a9b (diff)
downloadgpsd-ff1a623dbdca3fa26de67d88739d9a039b8e39ea.tar.gz
Split eph into epx and epy internally...
...but still report eph by re-mixing them in the JSON dumper. This was worth doing because all regression tests still pass, showing that visible behavior for old-protocol users gas not changed.
Diffstat (limited to 'xgps.c')
-rw-r--r--xgps.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/xgps.c b/xgps.c
index 3924b41d..f4b4ddab 100644
--- a/xgps.c
+++ b/xgps.c
@@ -53,6 +53,12 @@
#include "gps.h"
#include "gpsdclient.h"
+/*
+ * FIXME: use here is a minor bug, should report epx and epy separately.
+ * How to mix together epx and epy to get a horizontal circular error.
+ */
+#define EMIX(x, y) (((x) > (y)) ? (x) : (y))
+
/* This code used to live in display.c */
#define RM 20
@@ -950,9 +956,10 @@ update_panel(struct gps_data_t *gpsdata, char *message,
XmTextFieldSetString(text_6, s);
} else
XmTextFieldSetString(text_6, "n/a");
- if (isnan(gpsdata->fix.eph)==0) {
+ /* FIXME: Someday report epx and epy */
+ if (isnan(gpsdata->fix.epx)==0) {
(void)snprintf(s, sizeof(s), "%f %s",
- gpsdata->fix.eph * altunits->factor,
+ EMIX(gpsdata->fix.epx, gpsdata->fix.epy) * altunits->factor,
altunits->legend);
XmTextFieldSetString(text_7, s);
} else