Private
Public Access
1
0

made metrics and strokedata model dynamic

This commit is contained in:
Sander Roosendaal
2017-09-21 16:47:39 +02:00
parent 79d2c7490a
commit 6db8b17ad6
4 changed files with 292 additions and 80 deletions

View File

@@ -1,32 +1,236 @@
from utils import lbstoN
axes = (
('time','Time',0,1e5,'basic'),
('distance', 'Distance (m)',0,1e5,'basic'),
('cumdist', 'Cumulative Distance (m)',0,1e5,'basic'),
('hr','Heart Rate (bpm)',100,200,'basic'),
('spm', 'Stroke Rate (spm)',15,45,'basic'),
('pace', 'Pace (/500m)',1.0e3*210,1.0e3*75,'basic'),
('power', 'Power (Watt)',0,600,'basic'),
('averageforce', 'Average Drive Force (N)',0,900,'pro'),
('drivelength', 'Drive Length (m)',0.5,2.0,'pro'),
('peakforce', 'Peak Drive Force (N)',0,900,'pro'),
('forceratio', 'Average/Peak Force Ratio',0,1,'pro'),
('driveenergy', 'Work per Stroke (J)',0,1000,'pro'),
('drivespeed', 'Drive Speed (m/s)',0,4,'pro'),
('slip', 'Slip (degrees)',0,20,'pro'),
('catch', 'Catch (degrees)',-40,-75,'pro'),
('finish', 'Finish (degrees)',20,55,'pro'),
('wash', 'Wash (degrees)',0,30,'pro'),
('peakforceangle', 'Peak Force Angle (degrees)',-20,20,'pro'),
('totalangle', 'Drive Length (deg)',40,140,'pro'),
('effectiveangle', 'Effective Drive Length (deg)',40,140,'pro'),
('rhythm', 'Stroke Rhythm (%)',20,55,'pro'),
('efficiency', 'OTW efficiency (%)',0,110,'pro'),
('distanceperstroke','Distance per Stroke (m)',0,15,'pro'),
('None', 'None',0,1,'basic'),
rowingmetrics = (
('time',{
'numtype':'float',
'null':True,
'verbose_name': 'Time',
'ax_min': 0,
'ax_max': 1e5,
'mode':'both',
'type': 'basic'}),
('hr',{
'numtype':'integer',
'null':True,
'verbose_name': 'Heart Rate (bpm)',
'ax_min': 100,
'ax_max': 200,
'mode':'both',
'type': 'basic'}),
('pace',{
'numtype':'float',
'null':True,
'verbose_name': 'Pace (/500m)',
'ax_min': 1.0e3*210,
'ax_max': 1.0e3*75,
'mode':'both',
'type': 'basic'}),
('spm',{
'numtype':'float',
'null':True,
'verbose_name': 'Stroke Rate (spm)',
'ax_min': 15,
'ax_max': 45,
'mode':'both',
'type': 'basic'}),
('driveenergy',{
'numtype':'float',
'null':True,
'verbose_name': 'Work Per Stroke (J)',
'ax_min': 0,
'ax_max': 1000,
'mode':'both',
'type': 'pro'}),
('power',{
'numtype':'float',
'null':True,
'verbose_name': 'Power (W)',
'ax_min': 0,
'ax_max': 600,
'mode':'both',
'type': 'basic'}),
('averageforce',{
'numtype':'float',
'null':True,
'verbose_name': 'Average Drive Force (N)',
'ax_min': 0,
'ax_max': 900,
'mode':'both',
'type': 'pro'}),
('peakforce',{
'numtype':'float',
'null':True,
'verbose_name': 'Peak Drive Force (N)',
'ax_min': 0,
'ax_max': 900,
'mode':'both',
'type': 'pro'}),
('drivelength',{
'numtype':'float',
'null':True,
'verbose_name': 'Drive Length (m)',
'ax_min': 15,
'ax_max': 45,
'mode':'both',
'type': 'pro'}),
('forceratio',{
'numtype':'float',
'null':True,
'verbose_name': 'Average/Peak Force Ratio',
'ax_min': 0,
'ax_max': 1,
'mode':'both',
'type': 'pro'}),
('distance',{
'numtype':'float',
'null':True,
'verbose_name': 'Distance (m)',
'ax_min': 0,
'ax_max': 1e5,
'mode':'both',
'type': 'basic'}),
('cumdist',{
'numtype':'float',
'null':True,
'verbose_name': 'Cumulative Distance (m)',
'ax_min': 0,
'ax_max': 1e5,
'mode':'both',
'type': 'basic'}),
('drivespeed',{
'numtype':'float',
'null':True,
'verbose_name': 'Drive Speed (m/s)',
'ax_min': 0,
'ax_max': 4,
'default': 0,
'mode':'both',
'type': 'pro'}),
('catch',{
'numtype':'float',
'null':True,
'verbose_name': 'Catch Angle (degrees)',
'ax_min': -40,
'ax_max': -75,
'default': 0,
'mode':'water',
'type': 'pro'}),
('slip',{
'numtype':'float',
'null':True,
'verbose_name': 'Slip (degrees)',
'ax_min': 0,
'ax_max': 20,
'default': 0,
'mode':'water',
'type': 'pro'}),
('finish',{
'numtype':'float',
'null':True,
'verbose_name': 'Finish Angle (degrees)',
'ax_min': 20,
'ax_max': 55,
'default': 0,
'mode':'water',
'type': 'pro'}),
('wash',{
'numtype':'float',
'null':True,
'verbose_name': 'Wash (degrees)',
'ax_min': 0,
'ax_max': 30,
'default': 0,
'mode':'water',
'type': 'pro'}),
('peakforceangle',{
'numtype':'float',
'null':True,
'verbose_name': 'Peak Force Angle',
'ax_min': -20,
'ax_max': 20,
'default': 0,
'mode':'water',
'type': 'pro'}),
('totalangle',{
'numtype':'float',
'null':True,
'verbose_name': 'Drive Length (deg)',
'ax_min': 40,
'ax_max': 140,
'default': 0,
'mode':'water',
'type': 'pro'}),
('effectiveangle',{
'numtype':'float',
'null':True,
'verbose_name': 'Effective Drive Length (deg)',
'ax_min': 40,
'ax_max': 140,
'default': 0,
'mode':'water',
'type': 'pro'}),
('rhythm',{
'numtype':'float',
'null':True,
'verbose_name': 'Stroke Rhythm',
'ax_min': 20,
'ax_max': 55,
'default': 1.0,
'mode':'erg',
'type': 'pro'}),
('efficiency',{
'numtype':'float',
'null':True,
'verbose_name': 'OTW Efficiency (%)',
'ax_min': 0,
'ax_max': 110,
'default': 0,
'mode':'water',
'type': 'pro'}),
('distanceperstroke',{
'numtype':'float',
'null':True,
'verbose_name': 'Distance per Stroke (m)',
'ax_min': 0,
'ax_max': 15,
'default': 0,
'mode':'both',
'type': 'pro'}),
)
axesnew = [
(name,d['verbose_name'],d['ax_min'],d['ax_max'],d['type']) for name,d in rowingmetrics
]
axes = tuple(axesnew+[('None','None',0,1,'basic')])
axlabels = {ax[0]:ax[1] for ax in axes}
yaxminima = {ax[0]:ax[2] for ax in axes}