InfiniTime icon indicating copy to clipboard operation
InfiniTime copied to clipboard

StopWatch: add persistence

Open codingjourney opened this issue 1 year ago • 1 comments

This PR solves Issue #303 and is based on previous work by @desttinghim (PR #783 ) and @pptime02 (PR #1410 ). Well, it's actually just a re-base of #1410 onto the current main branch. I did my best not to disrupt functionality implemented on main in the past 2 years. Any feedback is appreciated.

codingjourney avatar Oct 20 '24 12:10 codingjourney

Build size and comparison to main:

Section Size Difference
text 380724B 640B
data 944B 0B
bss 22608B 64B

Run in InfiniEmu

github-actions[bot] avatar Oct 20 '24 12:10 github-actions[bot]

@FintasticMan Can you trigger CI?

mark9064 avatar Oct 26 '24 20:10 mark9064

Added a fix for a minor issue: after exiting StopWatch in the Paused state and then reopening it, the displayed time would shift by 4, sometimes 5 hundredths of a second. I think this is the delta between the last rendering and the moment we switch state to Paused and set timeElapsedPreviously. (The delta is consistent with the ~24 Hz refresh frequency I've observed.) The fix simply renders time once more once we are Paused.

codingjourney avatar Oct 27 '24 08:10 codingjourney

By the way, I've noticed this PR breaks InfiniSim. Does that have to be adapted before things get merged in InfiniTime? I don't mind looking into it, it's just that the build setup seems a bit more involved (I went with the Docker method for InfinTime and that's super smooth).

codingjourney avatar Oct 30 '24 21:10 codingjourney

Yeah it's good practice to get an InfiniSim PR up and waiting if a PR here will break it (annoyingly the CI has given up again so I can't easily see). I haven't used the docker method so I can't comment on that but provided you're on Linux getting a build environment up and running shouldn't be too bad.

mark9064 avatar Oct 30 '24 21:10 mark9064

I've created PR #163 for InfiniSim. Necessary changes were trivial. Functionality in InfiniSim seems to work as intended.

codingjourney avatar Nov 02 '24 18:11 codingjourney

Great :)

mark9064 avatar Nov 02 '24 22:11 mark9064

Looking superb. Just needs a rebase for CI to run (and the last few bits of feedback) and then it's all good from me

mark9064 avatar Dec 12 '24 23:12 mark9064

I'm not sure how much I like the feel of the time being pushed right to the top? But that's probably just me being used to how it was before, so I'll see after living with it for a bit 👍

Regarding vertical positioning of the time label, my thinking goes like this:

  • the top margin is about half as wide as the side margins - not good
  • on PineTime, the margin blends with the watch bezel so it's OK - good
  • there's too much empty room above the buttons when no laps are listed - not good
  • there's enough room to list 3 laps - good

It would be nice if the time was vertically centered between the top and the buttons and then floated upwards as laps get added to the list, eventually ending up where it is now. I don't find the slight improvement worth the effort, though.

codingjourney avatar Dec 14 '24 08:12 codingjourney