Some code formatting changes

This commit is contained in:
Pierrick C 2018-08-25 11:44:35 +02:00
parent 67b7fdce68
commit eeaa78869c

View File

@ -63,6 +63,7 @@ import neopixel
##########
# config #
##########
print_data_flag = True # Print data on USB UART / REPL output ?
send_json_flag = True # Send data as JSON on second UART ?
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())
if gps.has_fix:
self._gps_last_fix = self._gps_current_fix
self.data['GPS']['time'] = TIME_FORMAT.format(gps.timestamp_utc.tm_year,
gps.timestamp_utc.tm_mon,
gps.timestamp_utc.tm_mday,
gps.timestamp_utc.tm_hour,
gps.timestamp_utc.tm_min,
gps.timestamp_utc.tm_sec)
self.data['GPS']['time'] = TIME_FORMAT.format(
gps.timestamp_utc.tm_year,
gps.timestamp_utc.tm_mon,
gps.timestamp_utc.tm_mday,
gps.timestamp_utc.tm_hour,
gps.timestamp_utc.tm_min,
gps.timestamp_utc.tm_sec)
self.data['GPS']['lat'] = gps.latitude
self.data['GPS']['lon'] = gps.longitude
self.data['GPS']['alt'] = gps.altitude_m
self.data['GPS']['qual'] = gps.fix_quality
self.data['GPS']['age'] = 0
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:
self.data['GPS'] = None