Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Code cleanup for issue #8

  • Loading branch information...
commit 03e55e093b8256439064a99bf789f74baa129c7e 1 parent 8316b43
@mlt authored
Showing with 4 additions and 4 deletions.
  1. +1 −1  src/csv2tcx.py
  2. +3 −3 src/download.py
View
2  src/csv2tcx.py
@@ -82,7 +82,7 @@
# print("Point {:s} Over the lap {:s} by distance".format(thePoint["No"], theLap["Lap"]))
lap_start = time
break
- if time > lap_start and not int(theLap["x1"]):
+ if time > lap_start and not int(theLap["autolap"]):
# print("Point {:s} {:s} Over the lap {:s} {:s} by time".format(thePoint["No"], time.isoformat(), theLap["Lap"], lap_start.isoformat()))
lap_start = time
break
View
6 src/download.py
@@ -127,7 +127,7 @@ def pack_coord(c0, hemi):
lapFile = open('%s.laps' % name, "wb", **open_extra)
lapWriter = csv.writer(lapFile)
lapWriter.writerow(["Time", "Speed", "Lap", "Distance", "kcal", "MaxSpeed", \
- "x1", "Beats", "sec", "MaxHeart", "MinHeart", \
+ "autolap", "Beats", "sec", "MaxHeart", "MinHeart", \
"InZone", "y4", "Elevation", "y8", "Track"])
for theLap in range(1,laps):
raw = port.read(0x24)
@@ -137,14 +137,14 @@ def pack_coord(c0, hemi):
(hh, mm, ss, sss, dist, \
cal, speed_max, speed, \
- x1, beats_high, beats_mid, beats_low, sec,heart_max,heart_min, \
+ autolap, beats_high, beats_mid, beats_low, sec,heart_max,heart_min, \
iz_h, iz_m, iz_s, y4, z_low, z_mid, z_high, y8, \
lap, track, sign) = \
struct.unpack(">4BI IxBxB 4BH2B 3BB3BB HBB", raw)
z = z_low | z_mid << 8 | z_high << 16
time=hh*3600 + mm*60 + ss + sss/100.
iz = iz_h*3600 + iz_m*60 + iz_s
- lapWriter.writerow([time, speed/10., lap, dist/1e5, cal/1e4, speed_max/10.,x1, \
+ lapWriter.writerow([time, speed/10., lap, dist/1e5, cal/1e4, speed_max/10., autolap, \
beats_high*65536 + beats_mid*256 + beats_low, \
sec, heart_max, heart_min, iz, y4, z/1e2, y8, track_name])
lapFile.close()
Please sign in to comment.
Something went wrong with that request. Please try again.