diff --git a/rowers/forms.py b/rowers/forms.py index c69e3720..f28ed65d 100644 --- a/rowers/forms.py +++ b/rowers/forms.py @@ -1859,12 +1859,13 @@ class FlexOptionsForm(forms.Form): class ForceCurveOptionsForm(forms.Form): includereststrokes = forms.BooleanField(initial=False, required=False, - label='Include Rest Strokes') + label='Include Rest Strokes', + widget=forms.CheckboxInput(attrs={'class':'hidden'})) spm_min = forms.FloatField(initial=15.0,label='SPM Min',widget=HiddenInput,required=False) spm_max = forms.FloatField(initial=55.0,label='SPM Max',widget=HiddenInput,required=False) dist_min = forms.IntegerField(initial=0,label='Dist Min',widget=HiddenInput,required=False) - dist_max = forms.IntegerField(initial=0,label='Dist Max',widget=HiddenInput,required=False) + dist_max = forms.IntegerField(initial=150000,label='Dist Max',widget=HiddenInput,required=False) work_min = forms.IntegerField(initial=0,label='Work Min',widget=HiddenInput,required=False) work_max = forms.IntegerField(initial=1500,label='Work Max',widget=HiddenInput,required=False) @@ -1872,6 +1873,13 @@ class ForceCurveOptionsForm(forms.Form): name = forms.CharField(initial="", label='Name',required=False) + plotcircles = forms.BooleanField(initial=False, + widget=forms.CheckboxInput(attrs={'class':'hidden'}), + required=False) + plotlines = forms.BooleanField(initial=False, + widget=forms.CheckboxInput(attrs={'class':'hidden'}), + required=False) + axchoices = list( (ax[0], ax[1]) for ax in axes if ax[0] not in ['cumdist', 'None'] diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index f8f8a5e0..54ce2b5b 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -521,11 +521,7 @@ def interactive_activitychart2(workouts, startdate, enddate, stack='type', return script, div -def interactive_forcecurve(theworkouts, workstrokesonly=True, plottype='scatter', - spm_min=15, spm_max=45, - notes='', - dist_min=0,dist_max=0, - work_min=0,work_max=1500): +def interactive_forcecurve(theworkouts): TOOLS = 'save,pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair' ids = [int(w.id) for w in theworkouts] @@ -537,19 +533,11 @@ def interactive_forcecurve(theworkouts, workstrokesonly=True, plottype='scatter' 'workoutstate', 'driveenergy', 'cumdist'] rowdata = dataprep.getsmallrowdata_db(columns, ids=ids, - workstrokesonly=workstrokesonly) + workstrokesonly=False) rowdata.dropna(axis=1, how='all', inplace=True) rowdata.dropna(axis=0, how='any', inplace=True) - workoutstatesrest = [3] - - if workstrokesonly: - try: - rowdata = rowdata[~rowdata['workoutstate'].isin(workoutstatesrest)] - except KeyError: # pragma: no cover - pass - if rowdata.empty: return "", "No Valid Data Available", "", "" diff --git a/rowers/models.py b/rowers/models.py index 28fce46e..b8cfeda2 100644 --- a/rowers/models.py +++ b/rowers/models.py @@ -5249,6 +5249,8 @@ class ForceCurveAnalysis(models.Model): average_spm = models.FloatField(default=23) average_boatspeed = models.FloatField(default=4.0) include_rest_strokes = models.BooleanField(default=False) + plotcircles = models.BooleanField(default=False) + plotlines = models.BooleanField(default=False) def __str__(self): s = 'Force Curve Analysis {name} ({date})'.format(name = self.name, diff --git a/rowers/templates/forcecurve_single.html b/rowers/templates/forcecurve_single.html index f3251dba..1d95d9a9 100644 --- a/rowers/templates/forcecurve_single.html +++ b/rowers/templates/forcecurve_single.html @@ -14,6 +14,7 @@