including time range
This commit is contained in:
@@ -2934,26 +2934,40 @@ def instroke_chart_interactive(request, id=0):
|
||||
spm_min = 15
|
||||
spm_max = 45
|
||||
|
||||
activeminutesmax = int(rowdata.duration/60.)
|
||||
activeminutesmin = 0
|
||||
maxminutes = activeminutesmax
|
||||
|
||||
if request.method == 'POST':
|
||||
form = InstrokeForm(request.POST,choices=instrokemetrics)
|
||||
if form.is_valid():
|
||||
metric = form.cleaned_data['metric']
|
||||
spm_min = form.cleaned_data['spm_min']
|
||||
spm_max = form.cleaned_data['spm_max']
|
||||
activeminutesmin = form.cleaned_data['activeminutesmin']
|
||||
activeminutesmax = form.cleaned_data['activeminutesmax']
|
||||
|
||||
|
||||
activesecondsmin = 60.*activeminutesmin
|
||||
activesecondsmax = 60.*activeminutesmax
|
||||
|
||||
data = rowdata.get_instroke_data(metric,
|
||||
spm_min=spm_min,
|
||||
spm_max=spm_max)
|
||||
data = rowdata.get_instroke_data(
|
||||
metric,
|
||||
spm_min=spm_min,
|
||||
spm_max=spm_max,
|
||||
)
|
||||
|
||||
script, div = instroke_interactive_chart(data, metric, w,
|
||||
spm_min,
|
||||
spm_max)
|
||||
script, div = instroke_interactive_chart(
|
||||
data, metric, w,
|
||||
spm_min,
|
||||
spm_max,
|
||||
)
|
||||
|
||||
# change to range spm_min to spm_max
|
||||
vals, units, typ = rowdata.updateinterval_metric(
|
||||
' Cadence (stokes/min)', spm_min, mode='larger',
|
||||
debug=False, smoothwindow=2.,)
|
||||
vals, units, typ = rowdata.updateinterval_range(
|
||||
' Cadence (stokes/min)', spm_min, spm_max,
|
||||
debug=False, smoothwindow=2.,
|
||||
activewindow=[activesecondsmin, activesecondsmax])
|
||||
|
||||
intervalstats = rowdata.allstats()
|
||||
itime, idist, itype = rowdata.intervalstats_values()
|
||||
@@ -3013,6 +3027,9 @@ def instroke_chart_interactive(request, id=0):
|
||||
'spm_max': spm_max,
|
||||
'ds': ds,
|
||||
'dd': dd,
|
||||
'activeminutesmin': activeminutesmin,
|
||||
'activeminutesmax': activeminutesmax,
|
||||
'maxminutes': maxminutes,
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user