Skip to content

Step counter history added - #2120

Merged
mark9064 merged 26 commits into
InfiniTimeOrg:mainfrom
Hunman:step-counter-history
Nov 8, 2025
Merged

Step counter history added#2120
mark9064 merged 26 commits into
InfiniTimeOrg:mainfrom
Hunman:step-counter-history

Conversation

@Hunman

@Hunman Hunman commented Sep 8, 2024

Copy link
Copy Markdown
Contributor

I changed the MotionController to remember the past N (currently 2) day's step counter history after the midnight reset. And I also changed the Steps screen to display (and update) yesterday's step count in addition to today's.

I didn't feel comfortable changing the return type of MotionService::NbSteps() yet without feedback, instead I wrote a new method to return the whole history.

I've tested this only using InfiniSim, testing with devkits would be welcome!

In the future I would like to increase the history size from 2 to 7 and transfer the whole history to the companion applications, but I haven't really looked into how bluetooth communication or "API"s work, so feedback would be most appreciated!

@github-actions

github-actions Bot commented Sep 8, 2024

Copy link
Copy Markdown

Build checks have not completed. Possible reasons for this are:

  1. The checks need to be approved by a maintainer
  2. The branch has conflicts
  3. The firmware build has failed

@minacode

minacode commented Sep 9, 2024

Copy link
Copy Markdown
Contributor

Nice! You should be able to test this on your sealed watch without problems. As long as you don't verify the firmware, a reboot will be enough to get it back to working. And if you do verify it, a force reboot into the backup firmware still enables you to install another firmware.

@mark9064 mark9064 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool feature, looking good :) haven't tried it yet on my PT yet but hopefully will soon

Comment thread src/components/motion/MotionController.cpp Outdated
Comment thread src/components/motion/MotionController.h Outdated
Comment thread src/components/motion/MotionController.h Outdated
Comment thread src/components/motion/MotionController.h Outdated
Comment thread src/systemtask/SystemTask.cpp Outdated
Comment thread src/displayapp/screens/Steps.h Outdated
Comment thread src/components/motion/MotionController.h Outdated
@mark9064

Copy link
Copy Markdown
Member

Sorry for the seemingly endless review! It's looking really good now, almost there

@Hunman

Hunman commented Sep 12, 2024

Copy link
Copy Markdown
Contributor Author

It's alright, I'm actually enjoying this opportunity to "nerd out" with people on a project 😄

@Hunman
Hunman force-pushed the step-counter-history branch from 20168fa to 7f7189e Compare September 16, 2024 06:30
@Hunman
Hunman force-pushed the step-counter-history branch from 7f7189e to 85c1f4e Compare September 23, 2024 12:54
@Hunman
Hunman force-pushed the step-counter-history branch from 85c1f4e to e973125 Compare October 28, 2024 10:47
@mark9064 mark9064 added the enhancement Enhancement to an existing app/feature label Nov 18, 2024
@tituscmd

Copy link
Copy Markdown
Contributor

Very nice! Do you have any InfiniSim screenshots or pictures of it on a real watch?

@mark9064 mark9064 added this to the 1.16.0 milestone Nov 19, 2024
@Hunman

Hunman commented Nov 19, 2024

Copy link
Copy Markdown
Contributor Author

Yes, I have some pictures both in InfiniSim and on the real watch

Nothing fancy, so far. If there's demand, I'm thinking about storing the past 7 or so days and displaying it in a table (like the tasks in the Settings > About menu's 4th screen).

Eventually I'd also like to tell companion applications the step history count, but I'll need to look more into how BLE communication works for that.

image
SAM_1147

@mark9064
mark9064 self-requested a review February 14, 2025 01:08
@WhyNotHugo

Copy link
Copy Markdown
Contributor

Been testing this a while, work fine so far.

The halo which fills up as one approaches the goal is an unusual pick, especially for a square device.

The menu to check the amount of steps taken and configure the step goals seem very disconnected from one another—but I think that can be refined later and doesn't need to be a blocker for this patch.

@mark9064 mark9064 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it's taken ages for me to look at this

Looking really good :)

Comment thread src/components/motion/MotionController.h Outdated
@mark9064

mark9064 commented Aug 7, 2025

Copy link
Copy Markdown
Member

Been testing this a while, work fine so far.

The halo which fills up as one approaches the goal is an unusual pick, especially for a square device.

The menu to check the amount of steps taken and configure the step goals seem very disconnected from one another—but I think that can be refined later and doesn't need to be a blocker for this patch.

Circular progress dial looks nice to me. Do you think a square dial would be better then?

Agreed on the app configuration. This is a broader problem in InfiniTime where app settings and apps themselves live in different places, and worse the settings pages are not modular while the apps are. More in #2314 (and probably other tracking issues I've forgotten)

This patch only concerns step history though, so I think your points are probably better addressed elsewhere :) Please do feel free to open new issues to track them (if there isn't a ticket already)

Separate getter and setter instead of returning a mutable reference
@mark9064

mark9064 commented Nov 7, 2025

Copy link
Copy Markdown
Member

If you rebase this onto main and resolve the conflicts, I can trigger CI

Comment thread src/displayapp/screens/Steps.h Outdated
Comment thread src/components/motion/MotionController.h Outdated

@mark9064 mark9064 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pulling this together on short notice :) all LGTM

Not tested on hardware yet but hope to soon

@NeroBurner NeroBurner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was confused about the circular buffer index for some time in AdvanceDay, but looking at its documentation/implementation made it clear. Good job!

lv_obj_set_style_local_text_color(lSteps, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_LIME);
lv_obj_set_style_local_text_font(lSteps, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42);
lv_label_set_text_fmt(lSteps, "%li", stepsCount);
lv_label_set_text_fmt(lSteps, "%lu", stepsCount);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one finding a wrong formatter. it has always been unsigned. now it is right!

@mark9064
mark9064 merged commit 716deff into InfiniTimeOrg:main Nov 8, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement to an existing app/feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants