kopia lustrzana https://github.com/inmcm/micropyGPS
Made default empty timestamps conform to parsed timestamps to better enable timestamp diff detection.
rodzic
95b739381c
commit
7024c27cea
|
@ -72,7 +72,7 @@ class MicropyGPS(object):
|
||||||
#####################
|
#####################
|
||||||
# Data From Sentences
|
# Data From Sentences
|
||||||
# Time
|
# Time
|
||||||
self.timestamp = [0, 0, 0]
|
self.timestamp = [0, 0, 0.0]
|
||||||
self.date = [0, 0, 0]
|
self.date = [0, 0, 0]
|
||||||
self.local_offset = local_offset
|
self.local_offset = local_offset
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ class MicropyGPS(object):
|
||||||
seconds = float(utc_string[4:])
|
seconds = float(utc_string[4:])
|
||||||
self.timestamp = (hours, minutes, seconds)
|
self.timestamp = (hours, minutes, seconds)
|
||||||
else: # No Time stamp yet
|
else: # No Time stamp yet
|
||||||
self.timestamp = (0, 0, 0)
|
self.timestamp = [0, 0, 0.0]
|
||||||
|
|
||||||
except ValueError: # Bad Timestamp value present
|
except ValueError: # Bad Timestamp value present
|
||||||
return False
|
return False
|
||||||
|
@ -285,7 +285,7 @@ class MicropyGPS(object):
|
||||||
seconds = float(utc_string[4:])
|
seconds = float(utc_string[4:])
|
||||||
self.timestamp = (hours, minutes, seconds)
|
self.timestamp = (hours, minutes, seconds)
|
||||||
else: # No Time stamp yet
|
else: # No Time stamp yet
|
||||||
self.timestamp = (0, 0, 0)
|
self.timestamp = [0, 0, 0.0]
|
||||||
|
|
||||||
except ValueError: # Bad Timestamp value present
|
except ValueError: # Bad Timestamp value present
|
||||||
return False
|
return False
|
||||||
|
|
Ładowanie…
Reference in New Issue