From 282691da60ec526772f713a63fa0b8f43aea7acb Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 22 Sep 2014 14:50:03 -0400 Subject: Refactor representation of satellite data into an array of structs... ...from a set of parallel arrays. This change flushed out a longstanding bug in the computation of DOPs for estimated error bars. Some test-load rebuilds were required: geostar-geos1m-binary.log.chk: With this change error estimates are computed and reported. trimble-lassen_iq-3dfix.log, trimble-lassen_iq-3dfix.log: the change revealed a bug in the computation of satellite-seen bits. Error estimates did not change. navcom.log: Error estimates changed. With these rebuilds, all regression tests pass. --- libgps_core.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'libgps_core.c') diff --git a/libgps_core.c b/libgps_core.c index d481e699..9baeefd4 100644 --- a/libgps_core.c +++ b/libgps_core.c @@ -346,20 +346,17 @@ void libgps_dump_state(struct gps_data_t *collect) collect->policy.split24 ? "true" : "false", collect->policy.devpath); if (collect->set & SATELLITE_SET) { - int i; + struct satellite_t *sp; (void)fprintf(debugfp, "SKY: satellites in view: %d\n", collect->satellites_visible); - for (i = 0; i < collect->satellites_visible; i++) { - bool used_in_solution = false; - int j; - for (j = 0; j < MAXCHANNELS; j++) - if (collect->used[j] == i) - used_in_solution = true; + for (sp = collect->skyview; + sp < collect->skyview + collect->satellites_visible; + sp++) { (void)fprintf(debugfp, " %2.2d: %2.2d %3.3d %3.0f %c\n", - collect->PRN[i], collect->elevation[i], - collect->azimuth[i], collect->ss[i], - used_in_solution ? 'Y' : 'N'); + sp->PRN, sp->elevation, + sp->azimuth, sp->ss, + sp->used ? 'Y' : 'N'); } } if (collect->set & DEVICE_SET) -- cgit v1.2.1