fix #454
This commit is contained in:
@@ -1193,7 +1193,7 @@ class ForceCurveOptionsForm(forms.Form):
|
|||||||
('scatter','Peak Force Scatter Plot'),
|
('scatter','Peak Force Scatter Plot'),
|
||||||
('none','Only aggregrate data')
|
('none','Only aggregrate data')
|
||||||
)
|
)
|
||||||
plottype = forms.ChoiceField(choices=plotchoices,initial='scatter',
|
plottype = forms.ChoiceField(choices=plotchoices,initial='line',
|
||||||
label='Individual Stroke Chart Type')
|
label='Individual Stroke Chart Type')
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -337,41 +337,8 @@ def interactive_activitychart(workouts,startdate,enddate,stack='type'):
|
|||||||
p.toolbar_location = None
|
p.toolbar_location = None
|
||||||
p.sizing_mode = 'scale_width'
|
p.sizing_mode = 'scale_width'
|
||||||
|
|
||||||
# p = hv.Bars(df,values='duration',
|
|
||||||
# label = CatAttr(columns=['date'], sort=False),
|
|
||||||
# xlabel='Date',
|
|
||||||
# ylabel='Time',
|
|
||||||
# title='Activity {d1} to {d2}'.format(
|
|
||||||
# d1 = startdate.strftime("%Y-%m-%d"),
|
|
||||||
# d2 = enddate.strftime("%Y-%m-%d"),
|
|
||||||
# ),
|
|
||||||
# stack=stack,
|
|
||||||
# plot_width=350,
|
|
||||||
# plot_height=250,
|
|
||||||
# toolbar_location = None,
|
|
||||||
# )
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# for legend in p.legend:
|
|
||||||
# new_items = []
|
|
||||||
# for legend_item in legend.items:
|
|
||||||
# it = legend_item.label['value']
|
|
||||||
# tot = df[df[stack]==it].duration.sum()
|
|
||||||
# if tot != 0:
|
|
||||||
# new_items.append(legend_item)
|
|
||||||
# legend.items = new_items
|
|
||||||
|
|
||||||
|
|
||||||
# p.legend.location = "top_left"
|
|
||||||
# p.legend.background_fill_alpha = 0.7
|
|
||||||
#p.sizing_mode = 'scale_width'
|
|
||||||
#p.sizing_mode = 'stretch_both'
|
|
||||||
|
|
||||||
#p.yaxis.axis_label = 'Minutes'
|
|
||||||
|
|
||||||
script,div = components(p)
|
script,div = components(p)
|
||||||
return script,div
|
return script,div
|
||||||
|
|
||||||
@@ -786,55 +753,69 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
|
|||||||
|
|
||||||
plot.add_layout(avf)
|
plot.add_layout(avf)
|
||||||
|
|
||||||
peakflabel = Label(x=355,y=430,x_units='screen',y_units='screen',
|
peakflabel = Label(x=410,y=460,x_units='screen',y_units='screen',
|
||||||
text="Fpeak: {peakforceav:6.2f}".format(peakforceav=peakforceav),
|
text="Fpeak: {peakforceav:6.2f}".format(peakforceav=peakforceav),
|
||||||
background_fill_alpha=.7,
|
background_fill_alpha=.7,
|
||||||
background_fill_color='white',
|
background_fill_color='white',
|
||||||
text_color='blue',
|
text_color='blue',
|
||||||
)
|
)
|
||||||
|
|
||||||
avflabel = Label(x=365,y=400,x_units='screen',y_units='screen',
|
avflabel = Label(x=420,y=430,x_units='screen',y_units='screen',
|
||||||
text="Favg: {averageforceav:6.2f}".format(averageforceav=averageforceav),
|
text="Favg: {averageforceav:6.2f}".format(averageforceav=averageforceav),
|
||||||
background_fill_alpha=.7,
|
background_fill_alpha=.7,
|
||||||
background_fill_color='white',
|
background_fill_color='white',
|
||||||
text_color='blue',
|
text_color='blue',
|
||||||
)
|
)
|
||||||
|
|
||||||
catchlabel = Label(x=360,y=370,x_units='screen',y_units='screen',
|
catchlabel = Label(x=415,y=400,x_units='screen',y_units='screen',
|
||||||
text="Catch: {catchav:6.2f}".format(catchav=catchav),
|
text="Catch: {catchav:6.2f}".format(catchav=catchav),
|
||||||
background_fill_alpha=0.7,
|
background_fill_alpha=0.7,
|
||||||
background_fill_color='white',
|
background_fill_color='white',
|
||||||
text_color='red',
|
text_color='red',
|
||||||
)
|
)
|
||||||
|
|
||||||
peakforceanglelabel = Label(x=320,y=340,x_units='screen',y_units='screen',
|
peakforceanglelabel = Label(x=375,y=370,x_units='screen',y_units='screen',
|
||||||
text="Peak angle: {peakforceangleav:6.2f}".format(peakforceangleav=peakforceangleav),
|
text="Peak angle: {peakforceangleav:6.2f}".format(peakforceangleav=peakforceangleav),
|
||||||
background_fill_alpha=0.7,
|
background_fill_alpha=0.7,
|
||||||
background_fill_color='white',
|
background_fill_color='white',
|
||||||
text_color='red',
|
text_color='red',
|
||||||
)
|
)
|
||||||
|
|
||||||
finishlabel = Label(x=355,y=310,x_units='screen',y_units='screen',
|
finishlabel = Label(x=410,y=340,x_units='screen',y_units='screen',
|
||||||
text="Finish: {finishav:6.2f}".format(finishav=finishav),
|
text="Finish: {finishav:6.2f}".format(finishav=finishav),
|
||||||
background_fill_alpha=0.7,
|
background_fill_alpha=0.7,
|
||||||
background_fill_color='white',
|
background_fill_color='white',
|
||||||
text_color='red',
|
text_color='red',
|
||||||
)
|
)
|
||||||
|
|
||||||
sliplabel = Label(x=370,y=280,x_units='screen',y_units='screen',
|
sliplabel = Label(x=425,y=310,x_units='screen',y_units='screen',
|
||||||
text="Slip: {slipav:6.2f}".format(slipav=slipav-catchav),
|
text="Slip: {slipav:6.2f}".format(slipav=slipav-catchav),
|
||||||
background_fill_alpha=0.7,
|
background_fill_alpha=0.7,
|
||||||
background_fill_color='white',
|
background_fill_color='white',
|
||||||
text_color='red',
|
text_color='red',
|
||||||
)
|
)
|
||||||
|
|
||||||
washlabel = Label(x=360,y=250,x_units='screen',y_units='screen',
|
washlabel = Label(x=415,y=280,x_units='screen',y_units='screen',
|
||||||
text="Wash: {washav:6.2f}".format(washav=finishav-washav),
|
text="Wash: {washav:6.2f}".format(washav=finishav-washav),
|
||||||
background_fill_alpha=0.7,
|
background_fill_alpha=0.7,
|
||||||
background_fill_color='white',
|
background_fill_color='white',
|
||||||
text_color='red',
|
text_color='red',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
lengthlabel = Label(x=405,y=250, x_units='screen',y_units='screen',
|
||||||
|
text="Length: {length:6.2f}".format(length=finishav-catchav),
|
||||||
|
background_fill_alpha=0.7,
|
||||||
|
background_fill_color='white',
|
||||||
|
text_color='green'
|
||||||
|
)
|
||||||
|
|
||||||
|
efflengthlabel = Label(x=340,y=220, x_units='screen',y_units='screen',
|
||||||
|
text="Effective Length: {length:6.2f}".format(length=washav-slipav),
|
||||||
|
background_fill_alpha=0.7,
|
||||||
|
background_fill_color='white',
|
||||||
|
text_color='green'
|
||||||
|
)
|
||||||
|
|
||||||
annolabel = Label(x=50,y=450,x_units='screen',y_units='screen',
|
annolabel = Label(x=50,y=450,x_units='screen',y_units='screen',
|
||||||
text='',
|
text='',
|
||||||
background_fill_alpha=0.7,
|
background_fill_alpha=0.7,
|
||||||
@@ -859,6 +840,8 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
|
|||||||
plot.add_layout(finishlabel)
|
plot.add_layout(finishlabel)
|
||||||
plot.add_layout(annolabel)
|
plot.add_layout(annolabel)
|
||||||
plot.add_layout(sliderlabel)
|
plot.add_layout(sliderlabel)
|
||||||
|
plot.add_layout(lengthlabel)
|
||||||
|
plot.add_layout(efflengthlabel)
|
||||||
|
|
||||||
plot.xaxis.axis_label = "Angle"
|
plot.xaxis.axis_label = "Angle"
|
||||||
plot.yaxis.axis_label = "Force (N)"
|
plot.yaxis.axis_label = "Force (N)"
|
||||||
@@ -886,6 +869,8 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
|
|||||||
peakforceanglelabel=peakforceanglelabel,
|
peakforceanglelabel=peakforceanglelabel,
|
||||||
annolabel=annolabel,
|
annolabel=annolabel,
|
||||||
sliderlabel=sliderlabel,
|
sliderlabel=sliderlabel,
|
||||||
|
lengthlabel=lengthlabel,
|
||||||
|
efflengthlabel=efflengthlabel,
|
||||||
plottype=plottype,
|
plottype=plottype,
|
||||||
sourcemultiline=sourcemultiline,
|
sourcemultiline=sourcemultiline,
|
||||||
sourcemultiline2=sourcemultiline2
|
sourcemultiline2=sourcemultiline2
|
||||||
@@ -988,6 +973,9 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
|
|||||||
dataslipwash['xslip'] = [catchav+slipav,finishav-washav]
|
dataslipwash['xslip'] = [catchav+slipav,finishav-washav]
|
||||||
dataslipwash['yslip'] = [thresholdforce,thresholdforce]
|
dataslipwash['yslip'] = [thresholdforce,thresholdforce]
|
||||||
|
|
||||||
|
var length = finishav-catchav
|
||||||
|
var efflength = length-slipav-washav
|
||||||
|
|
||||||
avf.location = averageforceav
|
avf.location = averageforceav
|
||||||
avflabel.text = 'Favg: '+averageforceav.toFixed(2)
|
avflabel.text = 'Favg: '+averageforceav.toFixed(2)
|
||||||
catchlabel.text = 'Catch: '+catchav.toFixed(2)
|
catchlabel.text = 'Catch: '+catchav.toFixed(2)
|
||||||
@@ -997,6 +985,8 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
|
|||||||
peakflabel.text = 'Fpeak: '+peakforceav.toFixed(2)
|
peakflabel.text = 'Fpeak: '+peakforceav.toFixed(2)
|
||||||
peakforceanglelabel.text = 'Peak angle: '+peakforceangleav.toFixed(2)
|
peakforceanglelabel.text = 'Peak angle: '+peakforceangleav.toFixed(2)
|
||||||
annolabel.text = annotation
|
annolabel.text = annotation
|
||||||
|
lengthlabel.text = 'Length: '+length.toFixed(2)
|
||||||
|
efflengthlabel.text = 'Effective Length: '+efflength.toFixed(2)
|
||||||
|
|
||||||
console.log(count);
|
console.log(count);
|
||||||
console.log(multilines['x'].length);
|
console.log(multilines['x'].length);
|
||||||
@@ -1033,12 +1023,12 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
|
|||||||
|
|
||||||
distmax = 100+100*int(rowdata['distance'].max()/100.)
|
distmax = 100+100*int(rowdata['distance'].max()/100.)
|
||||||
|
|
||||||
slider_dist_min = Slider(start=0,end=distmax,value=0,step=1,
|
slider_dist_min = Slider(start=0,end=distmax,value=0,step=50,
|
||||||
title="Min Distance",callback=callback)
|
title="Min Distance",callback=callback)
|
||||||
callback.args["mindist"] = slider_dist_min
|
callback.args["mindist"] = slider_dist_min
|
||||||
|
|
||||||
slider_dist_max = Slider(start=0,end=distmax,value=distmax,
|
slider_dist_max = Slider(start=0,end=distmax,value=distmax,
|
||||||
step=1,
|
step=50,
|
||||||
title="Max Distance",callback=callback)
|
title="Max Distance",callback=callback)
|
||||||
callback.args["maxdist"] = slider_dist_max
|
callback.args["maxdist"] = slider_dist_max
|
||||||
|
|
||||||
@@ -3323,12 +3313,12 @@ def interactive_cum_flex_chart2(theworkouts,promember=0,
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
distmax = 1000.
|
distmax = 1000.
|
||||||
|
|
||||||
slider_dist_min = Slider(start=0,end=distmax,value=0,step=1,
|
slider_dist_min = Slider(start=0,end=distmax,value=0,step=50,
|
||||||
title="Min Distance",callback=callback)
|
title="Min Distance",callback=callback)
|
||||||
callback.args["mindist"] = slider_dist_min
|
callback.args["mindist"] = slider_dist_min
|
||||||
|
|
||||||
slider_dist_max = Slider(start=0,end=distmax,value=distmax,
|
slider_dist_max = Slider(start=0,end=distmax,value=distmax,
|
||||||
step=1,
|
step=50,
|
||||||
title="Max Distance",callback=callback)
|
title="Max Distance",callback=callback)
|
||||||
callback.args["maxdist"] = slider_dist_max
|
callback.args["maxdist"] = slider_dist_max
|
||||||
|
|
||||||
@@ -3925,12 +3915,12 @@ def interactive_flex_chart2(id=0,promember=0,
|
|||||||
except (KeyError,ValueError):
|
except (KeyError,ValueError):
|
||||||
distmax = 100
|
distmax = 100
|
||||||
|
|
||||||
slider_dist_min = Slider(start=0,end=distmax,value=0,step=1,
|
slider_dist_min = Slider(start=0,end=distmax,value=0,step=50,
|
||||||
title="Min Distance",callback=callback)
|
title="Min Distance",callback=callback)
|
||||||
callback.args["mindist"] = slider_dist_min
|
callback.args["mindist"] = slider_dist_min
|
||||||
|
|
||||||
slider_dist_max = Slider(start=0,end=distmax,value=distmax,
|
slider_dist_max = Slider(start=0,end=distmax,value=distmax,
|
||||||
step=1,
|
step=50,
|
||||||
title="Max Distance",callback=callback)
|
title="Max Distance",callback=callback)
|
||||||
callback.args["maxdist"] = slider_dist_max
|
callback.args["maxdist"] = slider_dist_max
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,8 @@ def make_new_workout_from_email(rower, datafile, name, cntr=0,testing=False):
|
|||||||
|
|
||||||
if testing:
|
if testing:
|
||||||
print('Fileformat = ',fileformat)
|
print('Fileformat = ',fileformat)
|
||||||
|
|
||||||
|
|
||||||
if fileformat == 'unknown':
|
if fileformat == 'unknown':
|
||||||
# extension = datafilename[-4:].lower()
|
# extension = datafilename[-4:].lower()
|
||||||
# fcopy = "media/"+datafilename[:-4]+"_copy"+extension
|
# fcopy = "media/"+datafilename[:-4]+"_copy"+extension
|
||||||
|
|||||||
Reference in New Issue
Block a user