Add the missing <workout> tag :)

This commit is contained in:
Rene Saarsoo 2020-10-01 20:04:21 +03:00
parent ac126f36da
commit 7f35a9a6b1
2 changed files with 179 additions and 169 deletions

View File

@ -105,7 +105,7 @@ export const generateZwo = ({ name, author, description, intervals }: Workout):
{ author: author }, { author: author },
{ description: description }, { description: description },
{ sportType: "bike" }, { sportType: "bike" },
...detectRepeats(intervals).map(generateInterval), { workout: detectRepeats(intervals).map(generateInterval) },
], ],
}, },
{ indent: " " }, { indent: " " },

View File

@ -6,60 +6,62 @@ exports[`Generate ZWO examples/comments.txt 1`] = `
<author></author> <author></author>
<description></description> <description></description>
<sportType>bike</sportType> <sportType>bike</sportType>
<Warmup Duration=\\"600\\" PowerLow=\\"0.25\\" PowerHigh=\\"0.75\\"> <workout>
<textevent timeoffset=\\"10\\" message=\\"Welcome to: #8\\"> <Warmup Duration=\\"600\\" PowerLow=\\"0.25\\" PowerHigh=\\"0.75\\">
</textevent> <textevent timeoffset=\\"10\\" message=\\"Welcome to: #8\\">
<textevent timeoffset=\\"360\\" message=\\"Let&apos;s talk about today&apos;s workout\\"> </textevent>
</textevent> <textevent timeoffset=\\"360\\" message=\\"Let&apos;s talk about today&apos;s workout\\">
<textevent timeoffset=\\"370\\" message=\\"We&apos;ll be doing 5 blocks of VO2max work\\"> </textevent>
</textevent> <textevent timeoffset=\\"370\\" message=\\"We&apos;ll be doing 5 blocks of VO2max work\\">
<textevent timeoffset=\\"380\\" message=\\"Each block 2 minutes and 30 seconds\\"> </textevent>
</textevent> <textevent timeoffset=\\"380\\" message=\\"Each block 2 minutes and 30 seconds\\">
<textevent timeoffset=\\"390\\" message=\\"30 seconds more than last time :)\\"> </textevent>
</textevent> <textevent timeoffset=\\"390\\" message=\\"30 seconds more than last time :)\\">
<textevent timeoffset=\\"400\\" message=\\"Finally we finish off with 10 minutes of threshold work\\"> </textevent>
</textevent> <textevent timeoffset=\\"400\\" message=\\"Finally we finish off with 10 minutes of threshold work\\">
<textevent timeoffset=\\"410\\" message=\\"Easy as that :)\\"> </textevent>
</textevent> <textevent timeoffset=\\"410\\" message=\\"Easy as that :)\\">
</Warmup> </textevent>
<SteadyState Duration=\\"30\\" Power=\\"0.95\\" Cadence=\\"95\\"> </Warmup>
<textevent timeoffset=\\"0\\" message=\\"Spin to 95 RPM if you&apos;re not already there\\"> <SteadyState Duration=\\"30\\" Power=\\"0.95\\" Cadence=\\"95\\">
</textevent> <textevent timeoffset=\\"0\\" message=\\"Spin to 95 RPM if you&apos;re not already there\\">
</SteadyState> </textevent>
<SteadyState Duration=\\"30\\" Power=\\"0.5\\" Cadence=\\"85\\"> </SteadyState>
<textevent timeoffset=\\"0\\" message=\\"Rest a bit\\"> <SteadyState Duration=\\"30\\" Power=\\"0.5\\" Cadence=\\"85\\">
</textevent> <textevent timeoffset=\\"0\\" message=\\"Rest a bit\\">
</SteadyState> </textevent>
<SteadyState Duration=\\"150\\" Power=\\"1.15\\" Cadence=\\"105\\"> </SteadyState>
<textevent timeoffset=\\"0\\" message=\\"Here we go!\\"> <SteadyState Duration=\\"150\\" Power=\\"1.15\\" Cadence=\\"105\\">
</textevent> <textevent timeoffset=\\"0\\" message=\\"Here we go!\\">
<textevent timeoffset=\\"60\\" message=\\"First minute done\\"> </textevent>
</textevent> <textevent timeoffset=\\"60\\" message=\\"First minute done\\">
<textevent timeoffset=\\"120\\" message=\\"Just 30 seconds more\\"> </textevent>
</textevent> <textevent timeoffset=\\"120\\" message=\\"Just 30 seconds more\\">
<textevent timeoffset=\\"140\\" message=\\"Finish it!\\"> </textevent>
</textevent> <textevent timeoffset=\\"140\\" message=\\"Finish it!\\">
</SteadyState> </textevent>
<SteadyState Duration=\\"180\\" Power=\\"0.5\\" Cadence=\\"85\\"> </SteadyState>
<textevent timeoffset=\\"0\\" message=\\"Good!\\"> <SteadyState Duration=\\"180\\" Power=\\"0.5\\" Cadence=\\"85\\">
</textevent> <textevent timeoffset=\\"0\\" message=\\"Good!\\">
<textevent timeoffset=\\"10\\" message=\\"Rest for 3 minutes\\"> </textevent>
</textevent> <textevent timeoffset=\\"10\\" message=\\"Rest for 3 minutes\\">
<textevent timeoffset=\\"170\\" message=\\"Ready for next round?\\"> </textevent>
</textevent> <textevent timeoffset=\\"170\\" message=\\"Ready for next round?\\">
</SteadyState> </textevent>
<Cooldown Duration=\\"450\\" PowerLow=\\"0.9\\" PowerHigh=\\"0.25\\"> </SteadyState>
<textevent timeoffset=\\"0\\" message=\\"We&apos;ll now gradually decrease the power\\"> <Cooldown Duration=\\"450\\" PowerLow=\\"0.9\\" PowerHigh=\\"0.25\\">
</textevent> <textevent timeoffset=\\"0\\" message=\\"We&apos;ll now gradually decrease the power\\">
<textevent timeoffset=\\"10\\" message=\\"It&apos;s all downhill from here :)\\"> </textevent>
</textevent> <textevent timeoffset=\\"10\\" message=\\"It&apos;s all downhill from here :)\\">
<textevent timeoffset=\\"20\\" message=\\"until you&apos;re cooled down\\"> </textevent>
</textevent> <textevent timeoffset=\\"20\\" message=\\"until you&apos;re cooled down\\">
<textevent timeoffset=\\"430\\" message=\\"Thanks for participating\\"> </textevent>
</textevent> <textevent timeoffset=\\"430\\" message=\\"Thanks for participating\\">
<textevent timeoffset=\\"440\\" message=\\"Until next time!\\"> </textevent>
</textevent> <textevent timeoffset=\\"440\\" message=\\"Until next time!\\">
</Cooldown> </textevent>
</Cooldown>
</workout>
</workout_file>" </workout_file>"
`; `;
@ -69,12 +71,14 @@ exports[`Generate ZWO examples/darth-vader.txt 1`] = `
<author>HumanPowerPerformance.com</author> <author>HumanPowerPerformance.com</author>
<description>Sign up for coaching with HumanPowerPerformance.com and get custom workouts and training plans</description> <description>Sign up for coaching with HumanPowerPerformance.com and get custom workouts and training plans</description>
<sportType>bike</sportType> <sportType>bike</sportType>
<SteadyState Duration=\\"300\\" Power=\\"0.55\\"> <workout>
</SteadyState> <SteadyState Duration=\\"300\\" Power=\\"0.55\\">
<IntervalsT Repeat=\\"10\\" OnDuration=\\"180\\" OnPower=\\"0.82\\" OffDuration=\\"20\\" OffPower=\\"1.3\\"> </SteadyState>
</IntervalsT> <IntervalsT Repeat=\\"10\\" OnDuration=\\"180\\" OnPower=\\"0.82\\" OffDuration=\\"20\\" OffPower=\\"1.3\\">
<SteadyState Duration=\\"300\\" Power=\\"0.55\\"> </IntervalsT>
</SteadyState> <SteadyState Duration=\\"300\\" Power=\\"0.55\\">
</SteadyState>
</workout>
</workout_file>" </workout_file>"
`; `;
@ -90,54 +94,56 @@ you will be scored on the final 20 minute segment.
Upon saving your ride, you will be notified if your FTP improved.</description> Upon saving your ride, you will be notified if your FTP improved.</description>
<sportType>bike</sportType> <sportType>bike</sportType>
<Warmup Duration=\\"300\\" PowerLow=\\"0.3\\" PowerHigh=\\"0.7\\"> <workout>
<textevent timeoffset=\\"20\\" message=\\"Welcome to the FTP test\\"> <Warmup Duration=\\"300\\" PowerLow=\\"0.3\\" PowerHigh=\\"0.7\\">
</textevent> <textevent timeoffset=\\"20\\" message=\\"Welcome to the FTP test\\">
<textevent timeoffset=\\"35\\" message=\\"Time to get warmed up and get your cadence up to 90-100rpm\\"> </textevent>
</textevent> <textevent timeoffset=\\"35\\" message=\\"Time to get warmed up and get your cadence up to 90-100rpm\\">
</Warmup> </textevent>
<SteadyState Duration=\\"20\\" Power=\\"0.9\\"> </Warmup>
</SteadyState> <SteadyState Duration=\\"20\\" Power=\\"0.9\\">
<SteadyState Duration=\\"20\\" Power=\\"1.1\\"> </SteadyState>
</SteadyState> <SteadyState Duration=\\"20\\" Power=\\"1.1\\">
<SteadyState Duration=\\"20\\" Power=\\"1.3\\"> </SteadyState>
</SteadyState> <SteadyState Duration=\\"20\\" Power=\\"1.3\\">
<SteadyState Duration=\\"180\\" Power=\\"0.6\\"> </SteadyState>
</SteadyState> <SteadyState Duration=\\"180\\" Power=\\"0.6\\">
<SteadyState Duration=\\"180\\" Power=\\"1.1\\"> </SteadyState>
</SteadyState> <SteadyState Duration=\\"180\\" Power=\\"1.1\\">
<SteadyState Duration=\\"120\\" Power=\\"1.2\\"> </SteadyState>
</SteadyState> <SteadyState Duration=\\"120\\" Power=\\"1.2\\">
<SteadyState Duration=\\"360\\" Power=\\"0.55\\"> </SteadyState>
<textevent timeoffset=\\"10\\" message=\\"In 6 minutes the FTP test begins\\"> <SteadyState Duration=\\"360\\" Power=\\"0.55\\">
</textevent> <textevent timeoffset=\\"10\\" message=\\"In 6 minutes the FTP test begins\\">
<textevent timeoffset=\\"300\\" message=\\"Prepare for your max 20 minute effort\\"> </textevent>
</textevent> <textevent timeoffset=\\"300\\" message=\\"Prepare for your max 20 minute effort\\">
</SteadyState> </textevent>
<FreeRide Duration=\\"1200\\"> </SteadyState>
<textevent timeoffset=\\"10\\" message=\\"Bring your power up to what you think you can hold for 20 minutes\\"> <FreeRide Duration=\\"1200\\">
</textevent> <textevent timeoffset=\\"10\\" message=\\"Bring your power up to what you think you can hold for 20 minutes\\">
<textevent timeoffset=\\"300\\" message=\\"How ya doin?\\"> </textevent>
</textevent> <textevent timeoffset=\\"300\\" message=\\"How ya doin?\\">
<textevent timeoffset=\\"600\\" message=\\"Half way done! If it&apos;s feeling easy now might be time to add 10 watts.\\"> </textevent>
</textevent> <textevent timeoffset=\\"600\\" message=\\"Half way done! If it&apos;s feeling easy now might be time to add 10 watts.\\">
<textevent timeoffset=\\"900\\" message=\\"5 minutes left!\\"> </textevent>
</textevent> <textevent timeoffset=\\"900\\" message=\\"5 minutes left!\\">
<textevent timeoffset=\\"960\\" message=\\"4 minutes left. Increase your power if you&apos;re feeling strong.\\"> </textevent>
</textevent> <textevent timeoffset=\\"960\\" message=\\"4 minutes left. Increase your power if you&apos;re feeling strong.\\">
<textevent timeoffset=\\"1020\\" message=\\"3 minutes left\\"> </textevent>
</textevent> <textevent timeoffset=\\"1020\\" message=\\"3 minutes left\\">
<textevent timeoffset=\\"1080\\" message=\\"2 minutes left\\"> </textevent>
</textevent> <textevent timeoffset=\\"1080\\" message=\\"2 minutes left\\">
<textevent timeoffset=\\"1140\\" message=\\"1 minute left. Go all in!\\"> </textevent>
</textevent> <textevent timeoffset=\\"1140\\" message=\\"1 minute left. Go all in!\\">
<textevent timeoffset=\\"1170\\" message=\\"30 sec. Go for it.\\"> </textevent>
</textevent> <textevent timeoffset=\\"1170\\" message=\\"30 sec. Go for it.\\">
<textevent timeoffset=\\"1190\\" message=\\"10 seconds.\\"> </textevent>
</textevent> <textevent timeoffset=\\"1190\\" message=\\"10 seconds.\\">
</FreeRide> </textevent>
<Cooldown Duration=\\"300\\" PowerLow=\\"0.5\\" PowerHigh=\\"0.3\\"> </FreeRide>
</Cooldown> <Cooldown Duration=\\"300\\" PowerLow=\\"0.5\\" PowerHigh=\\"0.3\\">
</Cooldown>
</workout>
</workout_file>" </workout_file>"
`; `;
@ -149,58 +155,60 @@ exports[`Generate ZWO examples/halvfems.txt 1`] = `
This pairs with Devedeset (90 in Croatian) and Novanta (90 in Italian) to make up the sweet spot trifecta in this plan. This pairs with Devedeset (90 in Croatian) and Novanta (90 in Italian) to make up the sweet spot trifecta in this plan.
The workouts are alphabetically ordered from easiest to hardest, so enjoy the middle of these three challenging workouts today...</description> The workouts are alphabetically ordered from easiest to hardest, so enjoy the middle of these three challenging workouts today...</description>
<sportType>bike</sportType> <sportType>bike</sportType>
<Warmup Duration=\\"420\\" PowerLow=\\"0.25\\" PowerHigh=\\"0.75\\"> <workout>
</Warmup> <Warmup Duration=\\"420\\" PowerLow=\\"0.25\\" PowerHigh=\\"0.75\\">
<SteadyState Duration=\\"30\\" Power=\\"0.95\\" Cadence=\\"95\\"> </Warmup>
</SteadyState> <SteadyState Duration=\\"30\\" Power=\\"0.95\\" Cadence=\\"95\\">
<SteadyState Duration=\\"30\\" Power=\\"0.5\\" Cadence=\\"85\\"> </SteadyState>
</SteadyState> <SteadyState Duration=\\"30\\" Power=\\"0.5\\" Cadence=\\"85\\">
<SteadyState Duration=\\"30\\" Power=\\"1.05\\" Cadence=\\"105\\"> </SteadyState>
</SteadyState> <SteadyState Duration=\\"30\\" Power=\\"1.05\\" Cadence=\\"105\\">
<SteadyState Duration=\\"30\\" Power=\\"0.5\\" Cadence=\\"85\\"> </SteadyState>
</SteadyState> <SteadyState Duration=\\"30\\" Power=\\"0.5\\" Cadence=\\"85\\">
<SteadyState Duration=\\"30\\" Power=\\"1.15\\" Cadence=\\"115\\"> </SteadyState>
</SteadyState> <SteadyState Duration=\\"30\\" Power=\\"1.15\\" Cadence=\\"115\\">
<SteadyState Duration=\\"30\\" Power=\\"0.5\\" Cadence=\\"85\\"> </SteadyState>
</SteadyState> <SteadyState Duration=\\"30\\" Power=\\"0.5\\" Cadence=\\"85\\">
<SteadyState Duration=\\"120\\" Power=\\"0.5\\" Cadence=\\"85\\"> </SteadyState>
</SteadyState> <SteadyState Duration=\\"120\\" Power=\\"0.5\\" Cadence=\\"85\\">
<SteadyState Duration=\\"720\\" Power=\\"0.9\\" Cadence=\\"90\\"> </SteadyState>
</SteadyState> <SteadyState Duration=\\"720\\" Power=\\"0.9\\" Cadence=\\"90\\">
<SteadyState Duration=\\"240\\" Power=\\"0.55\\" Cadence=\\"85\\"> </SteadyState>
</SteadyState> <SteadyState Duration=\\"240\\" Power=\\"0.55\\" Cadence=\\"85\\">
<IntervalsT Repeat=\\"6\\" OnDuration=\\"60\\" OnPower=\\"0.9\\" Cadence=\\"60\\" OffDuration=\\"60\\" OffPower=\\"0.9\\" CadenceResting=\\"90\\"> </SteadyState>
<textevent timeoffset=\\"0\\" message=\\"Start off at slow cadence\\"> <IntervalsT Repeat=\\"6\\" OnDuration=\\"60\\" OnPower=\\"0.9\\" Cadence=\\"60\\" OffDuration=\\"60\\" OffPower=\\"0.9\\" CadenceResting=\\"90\\">
</textevent> <textevent timeoffset=\\"0\\" message=\\"Start off at slow cadence\\">
<textevent timeoffset=\\"60\\" message=\\"Now bump that cadence up\\"> </textevent>
</textevent> <textevent timeoffset=\\"60\\" message=\\"Now bump that cadence up\\">
<textevent timeoffset=\\"120\\" message=\\"Back to 60 RPM\\"> </textevent>
</textevent> <textevent timeoffset=\\"120\\" message=\\"Back to 60 RPM\\">
<textevent timeoffset=\\"180\\" message=\\"Back to normal cadence\\"> </textevent>
</textevent> <textevent timeoffset=\\"180\\" message=\\"Back to normal cadence\\">
<textevent timeoffset=\\"240\\" message=\\"Grinding...\\"> </textevent>
</textevent> <textevent timeoffset=\\"240\\" message=\\"Grinding...\\">
<textevent timeoffset=\\"300\\" message=\\"Back to normal cadence\\"> </textevent>
</textevent> <textevent timeoffset=\\"300\\" message=\\"Back to normal cadence\\">
<textevent timeoffset=\\"360\\" message=\\"And grind at 60 RPM again\\"> </textevent>
</textevent> <textevent timeoffset=\\"360\\" message=\\"And grind at 60 RPM again\\">
<textevent timeoffset=\\"420\\" message=\\"Back to 90 RPM\\"> </textevent>
</textevent> <textevent timeoffset=\\"420\\" message=\\"Back to 90 RPM\\">
<textevent timeoffset=\\"480\\" message=\\"Lower it again to 60 RPM\\"> </textevent>
</textevent> <textevent timeoffset=\\"480\\" message=\\"Lower it again to 60 RPM\\">
<textevent timeoffset=\\"540\\" message=\\"Increase the cadence to 90 RPM\\"> </textevent>
</textevent> <textevent timeoffset=\\"540\\" message=\\"Increase the cadence to 90 RPM\\">
<textevent timeoffset=\\"600\\" message=\\"Last grinding minute\\"> </textevent>
</textevent> <textevent timeoffset=\\"600\\" message=\\"Last grinding minute\\">
<textevent timeoffset=\\"660\\" message=\\"Last minute... be strong!\\"> </textevent>
</textevent> <textevent timeoffset=\\"660\\" message=\\"Last minute... be strong!\\">
</IntervalsT> </textevent>
<SteadyState Duration=\\"240\\" Power=\\"0.55\\" Cadence=\\"85\\"> </IntervalsT>
</SteadyState> <SteadyState Duration=\\"240\\" Power=\\"0.55\\" Cadence=\\"85\\">
<IntervalsT Repeat=\\"4\\" OnDuration=\\"120\\" OnPower=\\"0.9\\" Cadence=\\"100\\" OffDuration=\\"60\\" OffPower=\\"0.9\\" CadenceResting=\\"65\\"> </SteadyState>
</IntervalsT> <IntervalsT Repeat=\\"4\\" OnDuration=\\"120\\" OnPower=\\"0.9\\" Cadence=\\"100\\" OffDuration=\\"60\\" OffPower=\\"0.9\\" CadenceResting=\\"65\\">
<Cooldown Duration=\\"360\\" PowerLow=\\"0.55\\" PowerHigh=\\"0.25\\"> </IntervalsT>
</Cooldown> <Cooldown Duration=\\"360\\" PowerLow=\\"0.55\\" PowerHigh=\\"0.25\\">
</Cooldown>
</workout>
</workout_file>" </workout_file>"
`; `;
@ -217,14 +225,16 @@ Working predominately aerobic metabolism.
In time your body will become more comfortable at these powers In time your body will become more comfortable at these powers
and your FTP will increase.</description> and your FTP will increase.</description>
<sportType>bike</sportType> <sportType>bike</sportType>
<Warmup Duration=\\"1200\\" PowerLow=\\"0.45\\" PowerHigh=\\"0.75\\"> <workout>
</Warmup> <Warmup Duration=\\"1200\\" PowerLow=\\"0.45\\" PowerHigh=\\"0.75\\">
<SteadyState Duration=\\"300\\" Power=\\"0.52\\"> </Warmup>
</SteadyState> <SteadyState Duration=\\"300\\" Power=\\"0.52\\">
<IntervalsT Repeat=\\"2\\" OnDuration=\\"720\\" OnPower=\\"1\\" Cadence=\\"90\\" OffDuration=\\"600\\" OffPower=\\"0.52\\"> </SteadyState>
</IntervalsT> <IntervalsT Repeat=\\"2\\" OnDuration=\\"720\\" OnPower=\\"1\\" Cadence=\\"90\\" OffDuration=\\"600\\" OffPower=\\"0.52\\">
<Cooldown Duration=\\"600\\" PowerLow=\\"0.65\\" PowerHigh=\\"0.45\\"> </IntervalsT>
</Cooldown> <Cooldown Duration=\\"600\\" PowerLow=\\"0.65\\" PowerHigh=\\"0.45\\">
</Cooldown>
</workout>
</workout_file>" </workout_file>"
`; `;