Permalink
Browse files

Cleanup

  • Loading branch information...
1 parent 1c5f2ed commit bcc15661dc094833700fa849e210f163a89b7ea4 @mlt committed Aug 3, 2012
Showing with 60 additions and 36 deletions.
  1. +8 −0 debian/changelog
  2. +1 −1 debian/control
  3. +16 −0 debian/install
  4. +1 −0 linux/schwinn810
  5. +15 −6 src/babelize.cmd
  6. +5 −1 src/babelize.sh
  7. +0 −12 src/schwinn810
  8. +10 −9 src/schwinn810.cmd
  9. +4 −7 src/settings.py
  10. 0 src/web/tcx2web.py
View
@@ -1,3 +1,11 @@
+schwinn810 (0.2) oneiric; urgency=low
+
+ * modular design
+ * initial support for Cresta/Mio
+ * GTK progress
+
+ -- Mikhail Titov <mlt@gmx.us> Thu, 02 Aug 2012 21:37:38 -0500
+
schwinn810 (0.1.1) oneiric; urgency=low
* Cleanup to be standards compliant
View
@@ -11,7 +11,7 @@ Vcs-Browser: https://github.com/mlt/schwinn810
Package: schwinn810
Architecture: all
Depends: ucf, python-tz, python-serial, ${misc:Depends}, ${python:Depends}
-Recommends: gpsbabel, libnotify-bin
+Recommends: python-gi, gpsbabel, libnotify-bin
Description: Software for Schwinn 810 GPS sport watch with heart rate monitor
Set of a command line tools to extract data and convert into common formats,
e.g. GPX, TCX, KML.
View
@@ -1,3 +1,19 @@
+src/core/commands.py usr/share/schwinn810/core/
+src/core/device.py usr/share/schwinn810/core/
+src/core/__init__.py usr/share/schwinn810/core/
+src/core/progress_gtk.py usr/share/schwinn810/core/
+src/core/progress_text.py usr/share/schwinn810/core/
+src/core/reader_cresta.py usr/share/schwinn810/core/
+src/core/reader.py usr/share/schwinn810/core/
+src/core/reader_schwinn.py usr/share/schwinn810/core/
+src/core/utils.py usr/share/schwinn810/core/
+src/core/writer_csv.py usr/share/schwinn810/core/
+src/web/mmf.py usr/share/schwinn810/web/
+src/web/tcx2web.py usr/share/schwinn810/web/
+src/web/antd/connect.py usr/share/schwinn810/web/antd/
+src/web/antd/__init__.py usr/share/schwinn810/web/antd/
+src/web/antd/plugin.py usr/share/schwinn810/web/antd/
+src/web/antd/LICENSE usr/share/schwinn810/web/antd/
src/download.py usr/share/schwinn810/
src/settings.py usr/share/schwinn810/
src/csv2tcx.py usr/share/schwinn810/
View
@@ -16,5 +16,6 @@ mkdir -p -m 2775 "$DIR/$YEAR"
/usr/share/schwinn810/download.py $DEBUG $HOOK \
--port $PORT \
+ --progress gtk \
--dir "$DIR/$YEAR" && \
[ "$NOTIFY" ] && notify-send -u low -c transfer.complete "Schwinn 810 GPS watch" "Data extracted"
View
@@ -1,12 +1,21 @@
@echo off
+cd /d "%~dp0"
+
SET "GPSBABEL=C:\Program Files\GPSBabel\gpsbabel.exe"
SET "Z7=C:\Program Files\7-Zip\7z.exe"
-"%GPSBABEL%" -i unicsv,utc=5 -f %1.points ^
- -o gpx -F %1.gpx ^
- -o gtrnctr,sport=Running,course=0 -x transform,trk=wpt,del -F %1.tcx ^
- -o kml,lines=1,points=0,track=1,trackdirection=1 -F %1.kml
+rem Get GPX & KML
+"%GPSBABEL%" -i unicsv,utc=5 -f "%1.points" ^
+ -x transform,trk=wpt,del ^
+ -o gpx -F "%1.gpx" ^
+ -o kml,lines=1,points=0,track=1,trackdirection=1 -F "%1.kml"
+
+rem Compress KML into KMZ
+DEL /Q /F "%1.kmz"
+"%Z7%" a -tzip "%1.kmz" "%1.kml" > nul
-%COMSPEC% /C DEL /Q /F %1.kmz
+rem Get TCX
+csv2tcx.exe "%1" > "%1.tcx"
-"%Z7%" a -tzip %1.kmz %1.kml > nul
+rem Upload TCX to web. See source code for details
+rem web\tcx2web.exe "%1.tcx"
View
@@ -2,11 +2,15 @@
. /etc/schwinn810/schwinn810.conf
+# Get KML & GPX if we have gpsbabel installed
if command -v gpsbabel &> /dev/null ; then
gpsbabel -i unicsv,utc=$OFFSET -f "$1.points" \
- -x transform,trk=wpt \
+ -x transform,trk=wpt,del \
-o gpx -F "$1.gpx" \
-o kml,lines=1,points=0,track=1,trackdirection=1 -F "$1.kml"
fi
/usr/share/schwinn810/csv2tcx.py "$1" > "$1.tcx"
+
+# Upload TCX to web. See source code for details
+# /usr/share/schwinn810/web/tcx2web.py "%1.tcx"
View
@@ -1,12 +0,0 @@
-#!/bin/sh
-
- /usr/bin/python3.2 \
- /home/mlt/workspace/schwinn810/src/download.py \
- --debug \
- --port /dev/schwinn810 \
- --dir /home/mlt/Documents/My\ Runs \
- --hook /home/mlt/workspace/schwinn810/src/babelize.sh
-# --port /dev/schwinn810 \
-# --hook /home/mlt/workspace/schwinn810/src/babelize.sh \
-# --port schwinn810.bin \
-
View
@@ -1,19 +1,20 @@
@echo off
+cd /d "%~dp0"
+
+SET "DIR=%USERPROFILE%\Documents\My Runs"
-rem start
download.exe ^
- --port schwinn810.bin ^
+ --port COM1 ^
--hook %~dp0\babelize.cmd ^
- --dir "%HOME%\Documents\My Runs"
-rem --port COM6 ^
+ --dir "%DIR%"
SET "GPSBABEL=C:\Program Files\GPSBabel\gpsbabel.exe"
SET "Z7=C:\Program Files\7-Zip\7z.exe"
-"%GPSBABEL%" -i unicsv,utc=5 -f "%HOME%\Documents\My Runs\waypoints.csv" ^
- -o gpx -F "%HOME%\Documents\My Runs\waypoints.gpx" ^
- -o kml,lines=1,points=0,track=1,trackdirection=1 -F "%HOME%\Documents\My Runs\waypoints.kml"
+"%GPSBABEL%" -i unicsv,utc=5 -f "%DIR%\waypoints.csv" ^
+ -o gpx -F "%DIR%\waypoints.gpx" ^
+ -o kml,lines=1,points=0,track=1,trackdirection=1 -F "%DIR%\waypoints.kml"
-%COMSPEC% /C DEL /Q /F "%HOME%\Documents\My Runs\waypoints.kmz" > nul
+%COMSPEC% /C DEL /Q /F "%DIR%\waypoints.kmz" > nul
-"%Z7%" a -tzip "%HOME%\Documents\My Runs\waypoints.kmz" "%HOME%\Documents\My Runs\waypoints.kml" > nul
+"%Z7%" a -tzip "%DIR%\waypoints.kmz" "%DIR%\waypoints.kml" > nul
View
@@ -8,6 +8,7 @@
import serial
import re
from sys import exit
+from commands import *
#from yaml import load, dump
parser = argparse.ArgumentParser(description='Download tracks from Schwinn 810 GPS sport watches with HRM.')
@@ -33,10 +34,6 @@
args = parser.parse_args()
-connect = bytearray.fromhex("EEEE000000000000000000000000000000000000000000000000000000000000")
-disconnect = bytearray.fromhex("FFFFFFFF00000000000000000000000000000000000000000000000000000000")
-settings_read = bytearray.fromhex("000000000000000000000000000000000000000000000000000000000000EEEE")
-
def unpackBCD(x0):
x00 = x0
x = 0
@@ -61,7 +58,7 @@ def unpackBCD(x0):
except serial.SerialException as e:
print("Port can't be opened :(", file=sys.stderr)
exit(-1)
- port.write(connect)
+ port.write(CONNECT)
else:
print("Parsing existing dump in {:s}".format(args.port[0]))
port = open(args.port[0], "rb")
@@ -88,7 +85,7 @@ def unpackBCD(x0):
if args.save:
pass
else:
- if not reg: port.write(settings_read)
+ if not reg: port.write(READ_SETTINGS)
raw = port.read(0x24)
if args.debug:
@@ -109,7 +106,7 @@ def unpackBCD(x0):
if args.debug:
dump.close()
-if not reg: port.write(disconnect)
+if not reg: port.write(DISCONNECT)
port.close()
print("Done")
View
0 src/web/tcx2web.py 100644 → 100755
No changes.

0 comments on commit bcc1566

Please sign in to comment.