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