Hi Bobby
I have attached an example panel that takes a time of day (24-hour clock) in a text field and updates the stop value of the timer to that value. The tricks here are to:
- Use "Time of Day" timer type
- Use script to grab the timer's "formatter" and use it to convert your text into a value the timer can understand (that's in the "Update" method)
For some extra ease-of-use, I have also set the widget for the text field to our built-in time picker. If you keep this, you will want to make sure its w.format property uses the same time format as the timer.
<abs contexttype="opengear" id="_top" keepalive="false" style="">
<meta>
<api>function updateStopTimeFromText(timerID, text)
{
var timer = ogscript.getTimerManager().getTimer(timerID);
var parsedStartValue = timer.getFormat().parseObject(text);
timer.setStop(parsedStartValue);
timer.startTimer(false);
}
</api>
<params>
<param access="1" maxlength="0" name="cddisplay" oid="cddisplay" stateless="true" type="STRING" value="37:55" widget="label"/>
<param access="1" maxlength="0" name="cdstop" oid="cdstop" type="STRING" value="15:30:00" widget="time-picker"/>
</params>
<timer autostart="false" id="cdtimer" pattern="HH:mm:ss" rate="500" stop="15:00:00">
<timertask tasktype="ogparamset">params.setValue('cddisplay', 0, event.getDisplay());</timertask>
</timer>
<ogscript handles="onload">var stopValue = params.getValue('cdstop', 0);
updateStopTimeFromText('cdtimer', stopValue);
</ogscript>
</meta>
<param expand="true" height="56" left="24" oid="cddisplay" showlabel="false" style="style:timerLabel;" top="36" width="327"/>
<param expand="true" height="42" left="22" oid="cdstop" showlabel="false" top="103" width="236">
<config key="w.format">HH:mm:ss</config>
</param>
<button buttontype="push" height="44" left="262" name="Update" top="102" width="93">
<task tasktype="ogscript">var stopValue = params.getValue('cdstop', 0);
updateStopTimeFromText('cdtimer', stopValue);
</task>
</button>
</abs>

Cheers
James
------------------------------
James Peltzer
Ross Video
------------------------------
Original Message:
Sent: 10-15-2021 11:59
From: Bobby P
Subject: Timer countdown to specific time in Dashboard
Hi Ben,
I think I sort of got it but I am not sure how to edit the time I wish for it to count to. I changed the type of clock to "Count Time Until" but I'd like to create a field in DashBoard where I could enter the "Stop Time", this is where I am getting stuck as I don't know what variable to replace in the source. If it helps you, I replied to Malcolm in this thread what I am trying to do.
Thanks!
------------------------------
Bobby P
Supervisor
Original Message:
Sent: 10-13-2021 14:00
From: Ben Gatien
Subject: Timer countdown to specific time in Dashboard
This video might help you out:
Adding Clocks to your PanelRoss Video | remove preview |
| Adding Clocks to your Panel | Having a display of different times is handy to have in a panel. Timers can be used show you: the current time how much time has passed since the start of your production how much time remains until a specific event occurs other clocks This video shows you how to put a timer in your panel, and how to configure it. | View this on Ross Video > |
|
|
You essentially have to create a timer where the start time is the remaining time, and the stop time is 0:00:00.
There are methods you can use to set the start time as well. Most of it is explained in that video. Start there and if you still have questions, post them here.
Ben
------------------------------
Ben Gatien
Ross Video
Original Message:
Sent: 10-13-2021 11:23
From: Bobby P
Subject: Timer countdown to specific time in Dashboard
Hello,
I am trying to create a timer in DashBoard that counts down to a time. For example, our show ends at 17:58:30, is there a way I can create a field in DashBoard where I can type this time in (or any time, depending on the show's out time) & then press a "Start" button & have a countdown timer to the inputed time? Thanks so much!
#DashBoard
------------------------------
Bobby P
Supervisor
------------------------------