I've created a simpleDataField using the VSCode plugin and only changed the following:
function compute(info as Activity.Info) as Numeric or Duration or String or Null {
// See Activity.Info in the documentation for available information.
if(Activity has :getCurrentWorkoutStep)
{
var cStep = Activity.getCurrentWorkoutStep();
if(cStep != null)
{
System.println("HERE");
}
}
return info.elapsedDistance;
}
I am then trying to simulate a FIT file I've downloaded from Garmin Connect, https://drive.google.com/file/d/1HfVsizWhuQzrQmNJ7pOg95Hkq29ZVm1Q/view?usp=sharing
It has four workout steps.
I'm using the VSCode extension, SDK v4.1.7 (min ver 3.3.0) for a Forerunner 945
I start the debugger (F5) and insert a breakpoint on the println, to see if there is ever a valid workout step.
In the simulator I click: Simulation -> Activity Data
Change the drop down to either "FIT/GPX Playable File" or "Workout FIT File" (Anyone know what the difference is between these?
Click "Load File" and select the file as above
Then hit the big triangle play button, then press "Start"
You can then see the distance incrementing in the simulation display, but it never hits the breakpoint. In other words there is never a valid workoutstep.
Has anyone had this working recently?
I also tried running the code that Travis supplied here to dump the contents of the workouts but that never output anything unless I hit the "Workout Step" button at which point it just said that currentWorkoutStep:null