Ticket Created
over 2 years ago

CIQQA-1326

HR zones are not working in simulator

In the simulator the following code:

var currentSport = UserProfile.getCurrentSport();
var heartRateZones = UserProfile.getHeartRateZones(currentSport);
Syste.println("HR zones:" + heartRateZones);

Always prints the following:
HR zones:[128, 153, 179, 204, 230, 185]

This itself has a bug: max_z5 < max_z4

However when I'm trying to set the HR zones in the simulator: Settings > Set User Profile > Heart Rate Zones:
The default values are: 94, 110, 130, 148, 167, 185
Which look OK, but when saving (or doing any changes and saving) doesn't have any effect on the output of the above code.

Parents
  • BTW there's another issue in the simulator HR zone editor: The header of the table looks like:

    Which is inconsistent with the documentation: https://developer.garmin.com/connect-iq/api-docs/Toybox/UserProfile.html#getHeartRateZones-instance_function where it has the following:

    The returned Array contains zone values as follows:

    • min zone 1 - The minimum heart rate threshold for zone 1

    • max zone 1 - The maximum heart rate threshold for zone 1

    • max zone 2 - The maximum heart rate threshold for zone 2

    • max zone 3 - The maximum heart rate threshold for zone 3

    • max zone 4 - The maximum heart rate threshold for zone 4

    • max zone 5 - The maximum heart rate threshold for zone 5

    So the simulator's table headers are 1 less than they should be: Instead of "Zone 0 min" it should be "Zone 1 min", etc...

Comment
  • BTW there's another issue in the simulator HR zone editor: The header of the table looks like:

    Which is inconsistent with the documentation: https://developer.garmin.com/connect-iq/api-docs/Toybox/UserProfile.html#getHeartRateZones-instance_function where it has the following:

    The returned Array contains zone values as follows:

    • min zone 1 - The minimum heart rate threshold for zone 1

    • max zone 1 - The maximum heart rate threshold for zone 1

    • max zone 2 - The maximum heart rate threshold for zone 2

    • max zone 3 - The maximum heart rate threshold for zone 3

    • max zone 4 - The maximum heart rate threshold for zone 4

    • max zone 5 - The maximum heart rate threshold for zone 5

    So the simulator's table headers are 1 less than they should be: Instead of "Zone 0 min" it should be "Zone 1 min", etc...

Children