Private
Public Access
1
0

Merge branch 'release/c2alt'

This commit is contained in:
Sander Roosendaal
2017-01-06 13:14:30 +01:00
7 changed files with 42 additions and 41 deletions

BIN
logos/bcsquare.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 926 B

BIN
logos/boatcoachlogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
logos/boatcoachlogo.xcf Normal file

Binary file not shown.

View File

@@ -16,13 +16,14 @@
<li> CrewNerd (TCX)</li> <li> CrewNerd (TCX)</li>
<li> Rowing In Motion (TCX)</li> <li> Rowing In Motion (TCX)</li>
<li> Speedcoach XL (CSV)</li> <li> Speedcoach XL (CSV)</li>
<li> Speedcoach GPS (FIT)</li></ul></p> <li> Speedcoach GPS (FIT and CSV)</li></ul></p>
<p>Erg <p>Erg
<ul> <ul>
<li> Painsled (CSV)</li> <li> Painsled (CSV)</li>
<li> ErgData (CSV export from Concept2 logbook)</li> <li> ErgData (CSV export from Concept2 logbook)</li>
<li> RowPro (CSV)</li> <li> RowPro (CSV)</li>
<li> BoatCoach (CSV)</li>
<li> ErgStick (CSV)</li></ul></p> <li> ErgStick (CSV)</li></ul></p>
@@ -35,7 +36,7 @@
<h2>Export Compatibility</h2> <h2>Export Compatibility</h2>
<ul> <ul>
<li> Concept2 Logbook: Exports stroke by stroke data for erg and OTW rowing</li> <li> Concept2 Logbook: Exports stroke by stroke data for erg and OTW rowing</li>
<li> Strava: </li> <li> Strava </li>
<li> SportTracks</li> <li> SportTracks</li>
<li> email (TCX or CSV format)</li></ul></p> <li> email (TCX or CSV format)</li></ul></p>
</div> </div>

View File

@@ -22,6 +22,7 @@
<img src="/static/img/rimsquare.png" alt="RiM icon" width="30" height="30"> <img src="/static/img/rimsquare.png" alt="RiM icon" width="30" height="30">
<img src="/static/img/rpsquare.png" alt="RowPro icon" width="30" height="30"> <img src="/static/img/rpsquare.png" alt="RowPro icon" width="30" height="30">
<img src="/static/img/essquare.png" alt="ErgStick icon" width="30" height="30"> <img src="/static/img/essquare.png" alt="ErgStick icon" width="30" height="30">
<img src="/static/img/bcsquare.png" alt="BoatCoach icon" width="30" height="30">
<img src="/static/img/pssquare.png" alt="PainSled icon" width="30" height="30"> <img src="/static/img/pssquare.png" alt="PainSled icon" width="30" height="30">
</p> </p>
</div> </div>

View File

@@ -342,17 +342,6 @@ def add_workout_from_strokedata(user,importid,data,strokedata,source='c2'):
rowdatetime = iso8601.parse_date(data['start_date']) rowdatetime = iso8601.parse_date(data['start_date'])
except ParseError: except ParseError:
rowdatetime = iso8601.parse_date(data['date']) rowdatetime = iso8601.parse_date(data['date'])
# try:
# rowdatetime = datetime.datetime.strptime(data['date_utc'],"%Y-%m-%d %H:%M:%S")
# rowdatetime = thetimezone.localize(rowdatetime).astimezone(utc)
# except KeyError:
# try:
# rowdatetime = dateutil.parser.parse(data['start_date'])
# rowdatetime = thetimezone.localize(rowdatetime).astimezone(utc)
# except:
# rowdatetime = datetime.datetime.strptime(data['date'],"%Y-%m-%d %H:%M:%S")
# rowdatetime = thetimezone.localize(rowdatetime).astimezone(utc)
try: try:
@@ -2337,6 +2326,9 @@ def workout_wind_view(request,id=0,message="",successmessage=""):
except KeyError: except KeyError:
hascoordinates = 0 hascoordinates = 0
if not latitude.std():
hascoordinates = 0
try: try:
bearing = rowdata.df.ix[:,'bearing'].values bearing = rowdata.df.ix[:,'bearing'].values
except KeyError: except KeyError:
@@ -3149,11 +3141,15 @@ def workout_edit_view(request,id=0,message="",successmessage=""):
if rowdata != 0: if rowdata != 0:
try: try:
latitude = rowdata.df[' latitude'] latitude = rowdata.df[' latitude']
if not latitude.std():
hascoordinates = 0
except KeyError,AttributeError: except KeyError,AttributeError:
hascoordinates = 0 hascoordinates = 0
else: else:
hascoordinates = 0 hascoordinates = 0
if hascoordinates: if hascoordinates:
res = googlemap_chart(rowdata.df[' latitude'], res = googlemap_chart(rowdata.df[' latitude'],
rowdata.df[' longitude'], rowdata.df[' longitude'],
@@ -3691,10 +3687,16 @@ def workout_getc2workout_view(request,c2id):
res = c2stuff.get_c2_workout(request.user,c2id) res = c2stuff.get_c2_workout(request.user,c2id)
if (res.status_code == 200): if (res.status_code == 200):
data = res.json()['data'] data = res.json()['data']
if 'stroke_data' in data: if data['stroke_data']:
# test = data['stroke_data']
res2 = c2stuff.get_c2_workout_strokes(request.user,c2id) res2 = c2stuff.get_c2_workout_strokes(request.user,c2id)
# 2016-07-27 added below if statement (balkanboy error report) else:
message = "This workout does not have any stroke data associated with it"
url = reverse(workout_c2import_view,
kwargs={
'message':message,
})
return HttpResponseRedirect(url)
if res2.status_code == 200: if res2.status_code == 200:
strokedata = pd.DataFrame.from_dict(res2.json()['data']) strokedata = pd.DataFrame.from_dict(res2.json()['data'])
id = add_workout_from_strokedata(request.user,c2id,data,strokedata, id = add_workout_from_strokedata(request.user,c2id,data,strokedata,
@@ -3705,17 +3707,14 @@ def workout_getc2workout_view(request,c2id):
url = "/rowers/workout/"+str(id)+"/edit" url = "/rowers/workout/"+str(id)+"/edit"
return HttpResponseRedirect(url) return HttpResponseRedirect(url)
else: else:
message = json.loads(s.text)['message'] # message = json.loads(s.text)['message']
message = json.loads(res2.text)['message']
url = reverse(workout_c2import_view, url = reverse(workout_c2import_view,
kwargs={ kwargs={
'message':message, 'message':message,
}) })
return HttpResponseRedirect(url) return HttpResponseRedirect(url)
else:
message = "This workout doesn't contain stroke data"
if settings.DEBUG:
return HttpResponse(res)
else:
url = reverse(workout_c2import_view, url = reverse(workout_c2import_view,
kwargs={ kwargs={
'message':message, 'message':message,

BIN
static/img/bcsquare.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB