Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timer: let timer go overtime (with ringing) #557

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

hatmajster
Copy link
Contributor

@hatmajster hatmajster commented Aug 4, 2021

In short: Now timer can go overtime - after ringing counter will turn red and start counting up to show when exactly did the timer ring. This way if I didn't feel alarm,or just had other stuff to do, I can just look at the watch and see "oh, so the alarm rang 2 minutes ago, fine".

Description: When timer has ended and vibrated, the counter turns red and start counting up. It will turn off if user will press "stop" or close Timer application. It will not turn off if the screen will just go blank (but I've found during testing that notifications can turn red timer off - I don't know how to gracefully go around it, but it should be doable. For now left it as is). The timer will also turn off after 99:59 overtime, just to not mess with display.

This is actually most common behavior in modern timers I think. For example all smartphones have this I think.

This PR will conflict with #554 and #407 as clang-format reformatted all files, and also I did myself some minor cleanings.

PS1: I changed GetTimeRemaining to give seconds instead of milliseconds as that's what was used anyway, and changed the function name to GetSecondsRemaining. Hopefully with the name changed it won't break anyone's custom code.

PS2: currently counter in Timer shows floor(remainingSeconds), wouldn't it be better if it would show ceil(remainingSeconds)? I think that's what @Riksu9000 also did in #554

Movie of awesome quality, but You should see slight red in the overtime (and "see" ringing as Pinetime moves each ring):

timer-overtime_edit.mp4

@Riksu9000
Copy link
Contributor

PS2: currently counter in Timer shows floor(remainingSeconds), wouldn't it be better if it would show ceil(remainingSeconds)? I think that's what @Riksu9000 also did in #554

Correct.

Ringing will be added in #342/#544, which can be used here to make timer ending more obvious and less likely to get missed. Still I do think that showing overtime is a good idea.

@hatmajster
Copy link
Contributor Author

Rebased, fixed conflicts, tested - works as before. Nothing changed since the beginning, as I don't really want to make this change any bigger.

Copy link
Contributor

@Riksu9000 Riksu9000 left a comment

Choose a reason for hiding this comment

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

If only there was a bit more space to add a minus. Maybe instead it could read overtime below the time, and maybe blink slowly.

It should be very easy to add the ringing now with the overtime state and stop button, if you'd like to take a look at that.

Maybe even style the stop button like in the Alarm app, so it would be consistent.

src/displayapp/screens/Timer.cpp Outdated Show resolved Hide resolved
src/displayapp/screens/Timer.cpp Outdated Show resolved Hide resolved
@Riksu9000 Riksu9000 self-assigned this Oct 31, 2021
@hatmajster hatmajster changed the title Timer: let timer go overtime Timer: let timer go overtime (with ringing) Nov 4, 2021
@hatmajster
Copy link
Contributor Author

hatmajster commented Nov 4, 2021

@Riksu9000 I think I've done all You asked, but I am not sure about time blinking, so I left it for now. In summary:

  • implemented stop() function
  • added ringing
  • matched app layout to Alarm

EDIT: I can write the blinking too, I just thought that it was unnecessary complicating code. But if more folks want it, I can implement that too ofc.

@JF002 I think this is one of the simplest most thumbed up change;) Can You review/give Your opinion (or both);) I've even added kinda crappy movie now, so hopefully its visible what it does ^^

@Riksu9000
Copy link
Contributor

The layouts nice, but in the alarm app the stop button turns red when it's ringing. This is what I meant.

IMG_20211105_104210

This is what I had in mind about the overtime, and have just the text blink. But that's just an idea. I haven't tested it if it would be any good.

overtime

@Itai-Nelken
Copy link
Contributor

Itai-Nelken commented Dec 1, 2021

Works fine and is a great improvement.
It would be nice if ringing continued after closing the app like the alarm app does.

@Riksu9000
Copy link
Contributor

I think the ringing might actually make the overtime redundant. It's unlikely that the user would miss the timer ending now since the watch is worn on the wrist, compared to a timer on a phone which could get misplaced. So maybe we only need the ringing after all.

@M4xTheMan
Copy link

M4xTheMan commented Jan 1, 2022 via email

@trman
Copy link

trman commented Jan 1, 2022

I think the ringing might actually make the overtime redundant. It's unlikely that the user would miss the timer ending now since the watch is worn on the wrist, compared to a timer on a phone which could get misplaced. So maybe we only need the ringing after all.

i thinks the overtime is useful because it allow to see how much have overtime (if you cook something , overtime of 1 minute is not thze same than 15 or more)...
it even more true if it's something that need to know how much overtime have been done in order to adjust the rest of the steps

@Riksu9000
Copy link
Contributor

I'm thinking that because the timer ending is now very obvious, the user wouldn't miss it in the first place. Because of this, the timer won't be left going into overtime accidentally.

As for letting it go to overtime intentionally, I don't think people will want to keep the watch vibrating on their wrist for minutes just to keep track of overtime. Though if this is important, maybe there should be a timeout and/or a mute button, but let's leave that for another PR.

@Itai-Nelken
Copy link
Contributor

Maybe simply stop the vibrations after a certain amount of time, for example 10 seconds.

@hatmajster
Copy link
Contributor Author

hatmajster commented Jan 25, 2022

To me overtime is an important feature like trman said, during cooking, baking I take it into consideration constantly. Its maybe even more important than missing the timer as I usually just check it constantly. I added now the 10 seconds for stopping vibrations requested by Itai-Nelken, as indeed ringing all the time was a bit of annoyance.
I am still wondering if overtime timer should stop after closing application. It is sometimes happening and then the information lost... On the other hand I don't like clicking on watch that much, and everything currently is just so clean;)

EDIT: uh actually just noticed that 10 seconds limit doesn't work when the screen goes blank. Have to figure something different...

@Riksu9000
Copy link
Contributor

Okay, I'm willing to approve this PR with or without the 10 second timeout, as it's an improvement either way. I may make further improvents to this in the future.

If you want to fix the timeout, you'll need to disable sleeping while the timer is ringing. This is because the apps don't run while the screen is off, so Refresh() isn't called. Alternatively I think you can use FreeRTOS timers, which keep running while the screen is off. You can take a look at #945, where I made something similar for the Alarm app. Now I'm wondering which solution is better..

@hatmajster
Copy link
Contributor Author

To me it doesn't matter much if the screen should be on or off during vibration, I can have/do it either way. Right now in newest commit, I implemented vibration for 10 times in motorController. Seems to be working good, and I like this way. You, Riksu could reuse it in Alarm or any other app the same way.
However, it introduces a little rare race, so it maybe better to do it differently (like You already did), do outside of this PR for now or scrap completely. The problem is when the timer is in overtime and a call will happen, it will often stop ringing. This is because Timer app and Notifications app stops vibration on closing. If timer/notification don't sync we have stopped ringing and can miss a call:/
Now that I think of it I don't know if previous implementation was secured against this anyway... I think not.

@Riksu9000
Copy link
Contributor

Hmm, I think I would rather have the app control the ringing directly rather than leave it being controlled separately in MotorController without feedback.

There is already a bug where the ringing stops when receiving two call notifications for example, so I don't think it was caused by your changes.

@ghost
Copy link

ghost commented Jul 28, 2022

Note: This PR is open so long that in the meantime the alarm apps design got matched to the timer. @hatmajster do you plan to finish the work on this?
@Riksu9000 Are you happy with the current implementation?

@Riksu9000 Riksu9000 removed their assignment Jul 28, 2022
@Riksu9000
Copy link
Contributor

I would like to see some changes made, but there are also a lot of conflicts making it difficult to update and I'd have preferred the overtime feature to be separate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants