CountUpDownTimer icon indicating copy to clipboard operation
CountUpDownTimer copied to clipboard

(T.TimeCheck() - not seting to true after reaching 0 remaining time.

Open WojciechowskiMarek opened this issue 5 years ago • 5 comments

My code https://github.com/WojciechowskiMarek/Timer-for-Ozone-generator/blob/main/main.cpp line 174, after counting down not setted T.TimeCheck().

Your sincerely Marek Wojciechowski

WojciechowskiMarek avatar Feb 12 '21 19:02 WojciechowskiMarek

Made a change to the library, please pull the library again.

AndrewMascolo avatar Feb 12 '21 19:02 AndrewMascolo

Andrew, all is working fine was problem local with my code. Your code works excelent. Why I'm choose Your library ? Because You have flag T.TimeChanged it was easy to use in my code. TAke a look at line 293 and 294. When timer is running and I want to stop it I'm using T.SetTimer(0,0,0,0); T.StopTimer();. Do You have in library some elegant function for this purpose ? Now I have to set up timer for 0 and then stop to get TimeCheck flag set to true ?

WojciechowskiMarek avatar Feb 13 '21 17:02 WojciechowskiMarek

Nothing elegant no, but if you want something added, let me know.

  • Andrew

Sent from my iPhone

  • Andrew

Sent from my iPhone

On Feb 13, 2021, at 12:01 PM, WojciechowskiMarek [email protected] wrote:  Andrew, all is working fine was problem local with my code. Your code works excelent. Why I'm choose Your library ? Because You have flag T.TimeChanged it was easy to use in my code. TAke a look at line 293 and 294. When timer is running and I want to stop it I'm using T.SetTimer(0,0,0,0); T.StopTimer();. Do You have in library some elegant function for this purpose ? Now I have to set up timer for 0 and then stop to get TimeCheck flag set to true ?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

AndrewMascolo avatar Feb 13 '21 21:02 AndrewMascolo

Hello.

Should be good to handle situation that is interrupted working of timer. For example in my case operator can exit from timer screen into main menu. Now I have to initialize timer with 0 time to get proper state flag T.TimeCheck. And stop timer with T.StopTimer ??? flag.

WojciechowskiMarek avatar Feb 15 '21 22:02 WojciechowskiMarek

boolean TimeCheck() { // output true if timer equals requested time or has passed it. if(_type) return remainingSeconds >= stopTimeTotalTime; // Counting UP else
return remainingSeconds <= stopTimeTotalTime; // Counting DOWN }

When Counting Down, TimeCheck only returns true when the remaining seconds is less than or equal to the set stop time. So in your case, yes you would need setTimer(0) and stopTimer() together.

AndrewMascolo avatar Feb 15 '21 22:02 AndrewMascolo