Some code formatting changes
This commit is contained in:
parent
67b7fdce68
commit
eeaa78869c
@ -63,6 +63,7 @@ import neopixel
|
|||||||
##########
|
##########
|
||||||
# config #
|
# config #
|
||||||
##########
|
##########
|
||||||
|
|
||||||
print_data_flag = True # Print data on USB UART / REPL output ?
|
print_data_flag = True # Print data on USB UART / REPL output ?
|
||||||
send_json_flag = True # Send data as JSON on second UART ?
|
send_json_flag = True # Send data as JSON on second UART ?
|
||||||
backup_data_flag = True # Write data as CSV files on onboard SPI Flash ?
|
backup_data_flag = True # Write data as CSV files on onboard SPI Flash ?
|
||||||
@ -114,19 +115,21 @@ class Data:
|
|||||||
self._gps_current_fix = int(time.monotonic())
|
self._gps_current_fix = int(time.monotonic())
|
||||||
if gps.has_fix:
|
if gps.has_fix:
|
||||||
self._gps_last_fix = self._gps_current_fix
|
self._gps_last_fix = self._gps_current_fix
|
||||||
self.data['GPS']['time'] = TIME_FORMAT.format(gps.timestamp_utc.tm_year,
|
self.data['GPS']['time'] = TIME_FORMAT.format(
|
||||||
gps.timestamp_utc.tm_mon,
|
gps.timestamp_utc.tm_year,
|
||||||
gps.timestamp_utc.tm_mday,
|
gps.timestamp_utc.tm_mon,
|
||||||
gps.timestamp_utc.tm_hour,
|
gps.timestamp_utc.tm_mday,
|
||||||
gps.timestamp_utc.tm_min,
|
gps.timestamp_utc.tm_hour,
|
||||||
gps.timestamp_utc.tm_sec)
|
gps.timestamp_utc.tm_min,
|
||||||
|
gps.timestamp_utc.tm_sec)
|
||||||
self.data['GPS']['lat'] = gps.latitude
|
self.data['GPS']['lat'] = gps.latitude
|
||||||
self.data['GPS']['lon'] = gps.longitude
|
self.data['GPS']['lon'] = gps.longitude
|
||||||
self.data['GPS']['alt'] = gps.altitude_m
|
self.data['GPS']['alt'] = gps.altitude_m
|
||||||
self.data['GPS']['qual'] = gps.fix_quality
|
self.data['GPS']['qual'] = gps.fix_quality
|
||||||
self.data['GPS']['age'] = 0
|
self.data['GPS']['age'] = 0
|
||||||
else:
|
else:
|
||||||
self.data['GPS']['age'] = int(self._gps_current_fix - self._gps_last_fix)
|
self.data['GPS']['age'] = int(self._gps_current_fix
|
||||||
|
- self._gps_last_fix)
|
||||||
else:
|
else:
|
||||||
self.data['GPS'] = None
|
self.data['GPS'] = None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user