I made some adjustments to your custom panel by converting your calculation scripts into two API functions: getTotalRuntime()
and getRemainingTime()
. These functions are now used in the respective timer tasks for timers t4
and t5
.
Original Message:
Sent: 12-04-2024 11:51
From: Theo Olivier
Subject: Adding timers values
My apologies, here is the zip file
------------------------------
Theo Olivier
Sonlife Broadcasting Network
Original Message:
Sent: 12-04-2024 11:11
From: Aury Rukazana
Subject: Adding timers values
Hi Theo,
I couldn't find the grid file you mentioned. You might need to zip it first, as files with a .grid
extension may not be accepted during upload.
As for automatically updating timers, you can set the timing in your TimerTask
, which runs each time the timer updates. Check out the example I shared earlier for the total runtime timer to see how I handled it.
<timer id="TotalRuntime" pattern="HH:mm:ss" rate="1000" start="23:59:59" stop="00:00:00"> <timertask tasktype="ogparamset">ogscript.getTimerManager().getTimer('TotalRuntime').setTime(getTotalRuntime()); params.setValue('totalRuntime', 0, event.getDisplay());</timertask> </timer>
------------------------------
Cheers,
Aury Rukazana
Senior Software Developer
Ross Video
Original Message:
Sent: 12-04-2024 10:49
From: Theo Olivier
Subject: Adding timers values
Thank you for this example. Before i got your response, i was trying a few more things and i came up with a timer panel that will work for us. However one thing i couldnt figure out is how to make it calculate continually. I added a button called "Calculate" on the bottom, but i have to press this every time i want the timers to update. Is there a way that it can automatically update it without the user having to press the "update" button?
What i did was i created 6 timers names (t1,t2,t3,t4,t5,t6)
The "t1" timer is segment 1
The "t12" timer is segment 2
The "t13" timer is segment 3
the "t4" timer is the "total runtime" timer
the "t5" is a timer i created with the start time of 53:00 minutes (this is the total show time) and this is the timer i used to calculate the remaining time "t6"
the "t6" timer is the "remaining time" timer
I have attached the Grid file if you want to take a look at what i did, and if you can guide me in the correct direction that would be great. Im sure there is a much better way to accomplish this.
thank you
------------------------------
Theo Olivier
Sonlife Broadcasting Network
Original Message:
Sent: 12-02-2024 17:18
From: Aury Rukazana
Subject: Adding timers values
Hi Theo,
You can use the method ogscript.getTimerManager().getTimer('CountUpTimer1').getCurrent();
to retrieve the current value in milliseconds for each timer. Once you have the values, you can sum them up and set the total runtime using ogscript.getTimerManager().getTimer('TotalRuntime').setTime(getTotalRuntime());
.
I have attached a zip file that contains a grid demonstrating this process. The grid includes three timers that count up, controlled by a reset button, as well as a timer that displays the total runtime. The reset button utilizes a reusable API function, reset_timer(timerID)
, which accepts the timer ID, resets the timer, and starts it counting again. Additionally, there is another API function, getTotalRuntime()
, which calculates the sum of the three timers and returns the value. This function is subsequently used to update the total runtime timer.
Let me know if you need further assistance!
------------------------------
Cheers,
Aury Rukazana
Senior Software Developer
Ross Video
Original Message:
Sent: 11-26-2024 17:43
From: Theo Olivier
Subject: Adding timers values
Hi,
Im very new to the custom panels, mostly watching the tutorial videos to get ideas and inspiration. I need some help with a custom panel that i built. This panel has 3 timers, each with a stop, start and reset button. We have a show that has 3 segments, each segment have a rough time it can go, but we need a specific total runtime for the show. I have 3 timers that i need to add the value of the 3 timers together to get the total show runtime. Is there a simple way to do this? it will be awesome if the "total runtime" can display the total combined time dynamically. I can add a screenshot of the panel if it helps.
thanks
------------------------------
Theo Olivier
Sonlife Broadcasting Network
------------------------------