fixed bug in piece duration (CP chart)
This commit is contained in:
@@ -555,7 +555,7 @@ def cpdata(workouts, options):
|
|||||||
if workouts[0].workouttype == 'bikeerg':
|
if workouts[0].workouttype == 'bikeerg':
|
||||||
# for Mike
|
# for Mike
|
||||||
wtype = 'erg'
|
wtype = 'erg'
|
||||||
|
|
||||||
res = interactive_otwcpchart(powerdf,promember=True,rowername=rowername,r=r,
|
res = interactive_otwcpchart(powerdf,promember=True,rowername=rowername,r=r,
|
||||||
cpfit=cpfit,title=title,type=wtype)
|
cpfit=cpfit,title=title,type=wtype)
|
||||||
script = res[0]
|
script = res[0]
|
||||||
@@ -585,10 +585,14 @@ def cpdata(workouts, options):
|
|||||||
|
|
||||||
minutes = options['piece']
|
minutes = options['piece']
|
||||||
if minutes != 0:
|
if minutes != 0:
|
||||||
|
# minutes = 77
|
||||||
hourvalue,tvalue = divmod(minutes,60)
|
hourvalue,tvalue = divmod(minutes,60)
|
||||||
|
# hourvalue = 1, tvalue = 17
|
||||||
hourvalue = int(hourvalue)
|
hourvalue = int(hourvalue)
|
||||||
minutevalue = int(tvalue)
|
minutevalue = int(tvalue)
|
||||||
|
|
||||||
tvalue = int(60*(tvalue-minutevalue))
|
tvalue = int(60*(tvalue-minutevalue))
|
||||||
|
|
||||||
if hourvalue >= 24:
|
if hourvalue >= 24:
|
||||||
hourvalue = 23
|
hourvalue = 23
|
||||||
pieceduration = datetime.time(
|
pieceduration = datetime.time(
|
||||||
@@ -596,7 +600,8 @@ def cpdata(workouts, options):
|
|||||||
hour = hourvalue,
|
hour = hourvalue,
|
||||||
second = tvalue,
|
second = tvalue,
|
||||||
)
|
)
|
||||||
pieceseconds = 2600.*pieceduration.hour+60.*pieceduration.minute+pieceduration.second
|
|
||||||
|
pieceseconds = 3600.*pieceduration.hour+60.*pieceduration.minute+pieceduration.second
|
||||||
# CP model
|
# CP model
|
||||||
pwr = p1[0]/(1+pieceseconds/p1[2])
|
pwr = p1[0]/(1+pieceseconds/p1[2])
|
||||||
pwr += p1[1]/(1+pieceseconds/p1[3])
|
pwr += p1[1]/(1+pieceseconds/p1[3])
|
||||||
|
|||||||
Reference in New Issue
Block a user