Browse Source

Increment date when B record time wraps.

master
Tom Payne 13 years ago
parent
commit
245aac1f02
  1. 4
      igc2kmz/igc.py

4
igc2kmz/igc.py

@ -90,6 +90,10 @@ class BRecord(Record):
setattr(result, key, int(line[value]))
time = datetime.time(*map(int, m.group(1, 2, 3)))
result.dt = datetime.datetime.combine(igc.hfdterecord.date, time)
if igc.b and result.dt < igc.b[-1].dt:
igc.hfdterecord.date = datetime.date.fromordinal(
igc.hfdterecord.date.toordinal() + 1)
result.dt = datetime.datetime.combine(igc.hfdterecord.date, time)
result.lat = int(m.group(4)) + int(m.group(5)) / 60000.0
if 'lad' in igc.i:
result.lat += int(line[igc.i['lad']]) / 6000000.0

Loading…
Cancel
Save