475 views
in GUI Development by
Hi Team

How to implement CountDown Timer for the time that the user defines? What I want to Implement is, if user defines a time, when he click a button the countdown of time should start and display the remaining time in the display.

Regards

Rangsons

1 Answer

0 votes
by

Hi Rangsons,

you can use a timer object to trigger a slot method where you decrement a time variable and format the string to show the remaining time in a text view. The buttons OnPress property can be used to start/stop the timer. For example:

Here is the corresponding project.

I hope this helps.

Best regards,

Manfred.

by
Hi Manfred

I don't want the timer value to be default or constant, I want the timer value to be user defined. What i meant is every time the user starts the application, he is able to give the countdown timer.

Regards
Rangsons
by
Hi Rangsons,

you can adapt the slot method onRelaod according to your needs and assign a start value that was defined from the user.

Best regards,
Manfred.
by
Hi Manfred

I got that in the OnReload Method We can change but the user need to enter the timer value from LCD TouchDisplay of underlying controller. For that what i need to do.

Regards
Rangsons
by

Hi Rangsons,

it would be really helpful for all, if you could post your questions and comments more precise: What are you planning, how should the user enter something and what have you tried so far?

Btw: Have you seen our Quick Tour Tutorial? Let me recommend to work through the tutorial in order to get familiar with the basic concepts, this will be very helpful for making own implementations.

Regards,
Manfred.

by

Hi Manfred,

Sorry Manfred but I am finding difficulty to understand the Workflow, Framework and Architecture of the Embedded Wizard because I am new to EW and I am trying to learn it. But now I am doing one project, I need to submit it asap. Please assist me.

In this Dialog, i need to give time in Hours, Minutes and in Seconds. This data, i want it on the other screen 

 

This is my Second Dialog. Here in this screen, I want start the Timer for the value what i have given in the Dialog1

I have tried it by adding texteditor in Dialog1, I am giving a integer value(ex. 10000), I am transferring that data to Dialog2 and i am getting the value. And that value I am assigning it to the vaariable inside the onreload method,but it is taking in a millisecond but i want it in the precise way.

by
Hi Rangsons,

if you want to make your count down with longer time spans (not milli seconds) you can exchange the time in seconds between your dialogs. This means, the user enters e.g. Hours, Minutes and Seconds you convert that into seconds and provide it to Dialog2.

The Period of the Timer can be set to 1000 (means 1000ms = 1 sec) - so that the onCount() slot method is called every second. Within this slot method you decrement the number of seconds until 0.

I hope this helps.

Best regards,
Manfred.

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...