InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

Watch faces display obviously bogus 0 as heart rate

Open Andersama opened this issue 2 months ago • 3 comments

Verification

  • [x] I searched for similar issues (including closed issues) and found none was relevant.

Introduce the issue

In the source code it appears that 0 bpm is being used as part of the state machine for the heart rate tracker, and also an error value. However this ends up translating into the value returned and displayed on screen (at least of 1.15). See: https://github.com/InfiniTimeOrg/InfiniTime/blob/075e02a33e7a362197f279edc015b596c4f9cd4e/src/components/heartrate/Ppg.cpp#L156 and: https://github.com/InfiniTimeOrg/InfiniTime/blob/075e02a33e7a362197f279edc015b596c4f9cd4e/src/heartratetask/HeartRateTask.cpp#L201

The code should probably be reworked such that 0 is a valid state (although ideally NONE of us should see such a number for real). Also a visual indicator that the heart rate tracker "needs to collect more information" would also make sense. Maybe a pulsing heart icon, piece of text like dots . .. ... etc.

This likely means watch face code should be able to check enoughData in addition to whether the tracker is running. https://github.com/InfiniTimeOrg/InfiniTime/blob/075e02a33e7a362197f279edc015b596c4f9cd4e/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp#L295

Preferred solution

No response

Version

No response

Andersama avatar Nov 07 '25 06:11 Andersama

#2342 might be of interest to you

Agree that zero isn't the best placeholder, personally I think what works best depends on the watchface design and they should choose themselves how to render the nullopt value

mark9064 avatar Nov 07 '25 14:11 mark9064

That'd also be a way to handle it. I don't tend to program with std::optional or std::variant. I think the api's a bit jarring.

Andersama avatar Nov 07 '25 14:11 Andersama

Ah, I see I didn't quite catch that you just changed the source code in the tracker two days ago. I guess I'd just suggest bringing in that new enoughData bool into use for the faces. I'd assume that'd pretty much handle the visuals.

Andersama avatar Nov 07 '25 15:11 Andersama