Purpose

The purpose of the Timer Unit Test is to allow users to learn and understand how to setup and use the Timer custom widget in their Tulip applications. Custom widgets are coded widgets that sit on top of the Tulip platform to give additional functionality that is not currently part of the main platform. The Timer Custom Widget is an enhancement to the existing timer, and the duration can be set to suit custom timer requirements.

Setup

Custom Widget Plugins interact with your application through the use of properties and events. Properties are the shared data that exists between your application and widget, while events are signals that your widget can send to your application. In your app editor you can build triggers based off these events. Events can be made to send data to your application as well.

The Timer Custom Widget makes use of five properties and three events. The first property being used is called 'Title' and is of type text and is read-only. This is the text that will display above the timer. The second property being used is called 'Duration' and is of type interval and is read-only. This is the countdown duration in seconds for the timer and the widget will count down from this time.. The next property is called 'Stop' and is of type Boolean and is read-only. This property is used to stop the timer. The next property is called 'Reset' and is of type Boolean and is read-only. This property is used to reset the timer. The last property is called 'Hidden' and is of type Boolean and is read-only. This allows you to choose whether or not to hide the timer in the background.

The first event being used in this custom widget is called 'Reset Event' and this event fires when the timer is reset. The second event being used in this custom widget is called 'Stopped' and this event fires when the timer is stopped. The third event being used in this custom widget is called 'Finished' and this fires when the timer counts down and reaches zero.

How it Works

The Timer Custom Widget can be used to create custom timers for steps/entire applications and fire events when the timer hits zero. An example of how the Timer custom widget works can be seen in the GIF below.

Did this answer your question?