From 795908afe3435d3095bb9ceb81c8b35fd1e22805 Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Sun, 28 May 2017 13:51:31 -0700 Subject: gpsprof: accept valid samples only. Signed-off-by: Robin H. Johnson Signed-off-by: Fred Wright TESTED: Verified that gpsprof still produces output. - fw --- gpsprof | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gpsprof') diff --git a/gpsprof b/gpsprof index 23a18c21..a4e58fd6 100755 --- a/gpsprof +++ b/gpsprof @@ -190,9 +190,11 @@ class spaceplot(plotter): def sample(self): # Watch out for the NaN value from gps.py. - self.fixes.append((self.session.fix.latitude, - self.session.fix.longitude, - self.session.fix.altitude)) + if (self.session.valid & + (gps.ONLINE_SET | gps.PACKET_SET | gps.LATLON_SET)): + self.fixes.append((self.session.fix.latitude, + self.session.fix.longitude, + self.session.fix.altitude)) return True def header(self): -- cgit v1.2.1