I have 15 buttons selecting channels on a TV, each button looks like the channel icon. The commands they send are, for example:
0.0 Exit
0.5 Digit 1
1.0 Digit 0
1.5 Digit 1
I want a progress bar to run across the relevant channel icon as the command is executing. I have set up a Number, number_favourite1_progress, with custom actions to set the value of a various Flags, flag_favourite1_progress and then a percentage. This Flag determines whether & which progress icon is displayed over the channel icon button by virtue of the Reveal settings (but only for favourite1 at the moment).
So the new commands on the buttons are:
0.0 number_favourite1_progress=1 (Group flag_favourite1_progress=OFF, flag_favourite1_progress_0%=ON)
0.0 Exit
0.5 number_favourite1_progress=33 (Group flag_favourite1_progress=OFF, flag_favourite1_progress_33%=ON)
0.5 Digit 1
1.0 number_favourite1_progress=66 (Group flag_favourite1_progress=OFF, flag_favourite1_progress_66%=ON)
1.0 Digit 0
1.5 number_favourite1_progress=100 (Group flag_favourite1_progress=OFF, flag_favourite1_progress_100%=ON)
1.5 Digit 1
2.00.0 number_favourite1_progress=0 (Group flag_favourite1_progress=OFF)
Question1:
I initially set up the channel Button, then progress Images (that are the same size as the button, but mostly transparent) immediately on top of one another as it were, but the Images do not show on execution. Moving the Button from 'underneath' the Images, to a different part of the screen proves that the progress bar is progressing when the button is pushed.
Buttons always appear on top of Images?
Question2:
If I want to do this for all 15 channel favourite buttons I will need to create 15 Numbers (number_favourite1_progress, number_favourite2_progress...), one for each favourite, 15 Groups of Flags (flag_favourite1_progress, flag_favourite2_progress...), each with four Flags in, and then set up 4 custom feedback actions for each of the 15 Numbers...
Is there a way, using the [] identifier that the commands for pushing the favourite 6 button could be something like:
0.0 number_favourite_pushed=6
0.0 number_favourite[number_favourite_pushed]_progress=0
0.0 Exit
0.5 number_favourite[number_favourite_pushed]_progress=33
0.5 Digit 1
1.0 number_favourite[number_favourite_pushed]_progress=66
1.0 Digit 0
1.5 number_favourite[number_favourite_pushed]_progress=100
1.5 Digit 1
2.0 number_favourite[number_favourite_pushed]_progress=0
2.0 number_favourite_pushed=0
So I guess that question is can I use a Number to set a Number? Or perhaps I need to use a Number to set a Label. I am lost in logic!
Many thanks in advance.
Rex
Using Numbers & [] to update a progress bar
Re: Using Numbers & [] to update a progress bar
Question 1: Yes, buttons always appear on top of images
Question 2: If you want a progress bar next to each channel button, and you have 15 channel buttons, then I'd do this:
Create a number called 'progress'. Also create a number called 'MACROS'
Create 15 gauges on the GUI, all linked to the 'progress ' number in the gauge menu
Create 15 flags (in a group called 'progressflags' which will 'reveal' the correct gauge when set. Set the reveal option for each gauge to the correct flag, and choose 'appear' as the transition type.
In the custom actions for 'MACRO', define an action for when the number is between 1 and 1 (ie when it is set to 1). The actions should be:
set 'progress' to 0
delay 0.5 set 'progress' to 10
delay 1.0 set 'progress' to 20
etc
until you set 'progress' to 100
This is just a stored set of actions which we will repeat, to save having to put all those actions in on each button.
On each channel button, do the following:
Set the group of flags 'progressflags' to OFF. This hides all the gauges.
Set the appropriate channel flag to ON. This will show the appropriate gauge.
Set 'MACRO' to 1. This will fire off the set of actions which will change the progress number periodically, which changes the gauge. It actually changes all the gauges, but only 1 is visible at once.
Question 2: If you want a progress bar next to each channel button, and you have 15 channel buttons, then I'd do this:
Create a number called 'progress'. Also create a number called 'MACROS'
Create 15 gauges on the GUI, all linked to the 'progress ' number in the gauge menu
Create 15 flags (in a group called 'progressflags' which will 'reveal' the correct gauge when set. Set the reveal option for each gauge to the correct flag, and choose 'appear' as the transition type.
In the custom actions for 'MACRO', define an action for when the number is between 1 and 1 (ie when it is set to 1). The actions should be:
set 'progress' to 0
delay 0.5 set 'progress' to 10
delay 1.0 set 'progress' to 20
etc
until you set 'progress' to 100
This is just a stored set of actions which we will repeat, to save having to put all those actions in on each button.
On each channel button, do the following:
Set the group of flags 'progressflags' to OFF. This hides all the gauges.
Set the appropriate channel flag to ON. This will show the appropriate gauge.
Set 'MACRO' to 1. This will fire off the set of actions which will change the progress number periodically, which changes the gauge. It actually changes all the gauges, but only 1 is visible at once.
Re: Using Numbers & [] to update a progress bar
Thanks for the great support DemoPad. I posted that at 19:59 last night and you replied by 20:19!