Private
Public Access
1
0

recognize C2 Logbook summary

This commit is contained in:
Sander Roosendaal
2016-12-20 15:31:10 +01:00
parent 18ccda0924
commit 660bc2ebf3
4 changed files with 30 additions and 5 deletions

View File

@@ -178,36 +178,50 @@ def interactive_forcecurve(theworkouts):
plot.add_layout(avf)
avflabel = Label(x=450,y=500,x_units='screen',y_units='screen',
peakflabel = Label(x=455,y=530,x_units='screen',y_units='screen',
text="Fpeak: {peakforceav:6.2f}".format(peakforceav=peakforceav),
background_fill_alpha=.7,
text_color='blue',
)
avflabel = Label(x=465,y=500,x_units='screen',y_units='screen',
text="Favg: {averageforceav:6.2f}".format(averageforceav=averageforceav),
background_fill_alpha=.7,
text_color='blue',
)
catchlabel = Label(x=450,y=470,x_units='screen',y_units='screen',
catchlabel = Label(x=460,y=470,x_units='screen',y_units='screen',
text="Catch: {catchav:6.2f}".format(catchav=catchav),
background_fill_alpha=0.7,
text_color='red',
)
finishlabel = Label(x=450,y=440,x_units='screen',y_units='screen',
peakforceanglelabel = Label(x=420,y=440,x_units='screen',y_units='screen',
text="Peak angle: {peakforceangleav:6.2f}".format(peakforceangleav=peakforceangleav),
background_fill_alpha=0.7,
text_color='red',
)
finishlabel = Label(x=455,y=410,x_units='screen',y_units='screen',
text="Finish: {finishav:6.2f}".format(finishav=finishav),
background_fill_alpha=0.7,
text_color='red',
)
sliplabel = Label(x=450,y=410,x_units='screen',y_units='screen',
sliplabel = Label(x=470,y=380,x_units='screen',y_units='screen',
text="Slip: {slipav:6.2f}".format(slipav=slipav),
background_fill_alpha=0.7,
text_color='red',
)
washlabel = Label(x=450,y=380,x_units='screen',y_units='screen',
washlabel = Label(x=460,y=350,x_units='screen',y_units='screen',
text="Wash: {washav:6.2f}".format(washav=washav),
background_fill_alpha=0.7,
text_color='red',
)
plot.add_layout(peakflabel)
plot.add_layout(peakforceanglelabel)
plot.add_layout(avflabel)
plot.add_layout(catchlabel)
plot.add_layout(sliplabel)
@@ -234,6 +248,8 @@ def interactive_forcecurve(theworkouts):
finishlabel=finishlabel,
sliplabel=sliplabel,
washlabel=washlabel,
peakflabel=peakflabel,
peakforceanglelabel=peakforceanglelabel,
), code="""
var data = source.data
var data2 = source2.data
@@ -300,6 +316,8 @@ def interactive_forcecurve(theworkouts):
finishlabel.text = 'Finish: '+finishav.toFixed(2)
sliplabel.text = 'Slip: '+slipav.toFixed(2)
washlabel.text = 'Wash: '+washav.toFixed(2)
peakflabel.text = 'Fpeak: '+peakforceav.toFixed(2)
peakforceanglelabel.text = 'Peak angle: '+peakforceangleav.toFixed(2)
source.trigger('change');
""")

View File

@@ -3733,6 +3733,13 @@ def workout_upload_view(request,message=""):
f2 = z.extract(z.namelist()[0],path='media/')
fileformat = fileformat[2]
os.remove(f_to_be_deleted)
if fileformat == 'c2log':
message = "This C2 logbook summary does not contain stroke data. Please download the Export Stroke Data file from the workout details on the C2 logbook."
url = reverse(workout_upload_view,
args=[str(message)])
response = HttpResponseRedirect(url)
return response
if fileformat == 'unknown':
message = "We couldn't recognize the file type"