diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2004-11-10 01:46:09 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2004-11-10 01:46:09 +0000 |
commit | 8cf26f6c639f5de56ea5ddb1df754cc5bb2d1539 (patch) | |
tree | 8ed0a6c1c76d08d69dd5fcdff79a70953fe917f7 /gpsd.py | |
parent | 24144c6ce5c5ab74d3b8072ecc4edc50f31de232 (diff) | |
download | gpsd-8cf26f6c639f5de56ea5ddb1df754cc5bb2d1539.tar.gz |
Empty-field check for altitude.
Diffstat (limited to 'gpsd.py')
-rwxr-xr-x | gpsd.py | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -125,15 +125,17 @@ class NMEA: def processGPGGA(self,words): self.update_timestamp(None, words[0]) self.__do_lat_lon(words[1:]) - newstatus = int(words[5]) - self.data.status_stamp.changed = (self.data.status != newstatus) - self.data.status = newstatus - self.data.status_stamp.refresh() - newaltitude = float(words[8]) - self.data.altitude_stamp.changed = (self.data.altitude != newaltitude) - self.data.altitude = newaltitude - self.data.altitude_stamp.refresh() - self.logger(3, "GPGGA sets status %d\n" % self.data.status); + if words[8]: + newaltitude = float(words[8]) + self.data.altitude_stamp.changed = (self.data.altitude != newaltitude) + self.data.altitude = newaltitude + self.data.altitude_stamp.refresh() + if words[5]: + newstatus = int(words[5]) + self.data.status_stamp.changed = (self.data.status != newstatus) + self.data.status = newstatus + self.data.status_stamp.refresh() + self.logger(3, "GPGGA sets status %d\n" % self.data.status); def processGPGSA(self,words): newmode = int(words[1]) |