How do you pause an animated button?
Joe Hebert
Posts: 2,159
Is there anyway to pause and then restart a multi-state general button that has Auto-Repeat set to Yes and feedback always on. The ^ANI command works great and I?m assuming that?s the command I need to use but I can?t figure out the params to use to make it pause.
Since 0 for state means current state, I tried plugging in a 0 for both the start state and the end state but that doesn?t do anything except to stop the animation when it reaches the last state (which is not what I would have expected since Auto-Repeat is Yes and feedback channel is always on)
So then I tried a 1 for start state and a 0 for end state and as expected that makes the button flicker between the first state and the current state (an almost pause)
I also tried turning the feedback channel off but that didn?t do anything for me either.
Any ^ANI experts out there that can help me out?
TIA
Software History wrote:"'^ANI-<variable text address range>,<start state>,<end state>,<time>'"
Run a button animation. Time is in 1/10 seconds and is optional.
0 for state means current state.
Syntax:
SEND_COMMAND <DEV>,"'^ANI-<vt addr range>,<start state>,<end state>,<time>'"
Since 0 for state means current state, I tried plugging in a 0 for both the start state and the end state but that doesn?t do anything except to stop the animation when it reaches the last state (which is not what I would have expected since Auto-Repeat is Yes and feedback channel is always on)
So then I tried a 1 for start state and a 0 for end state and as expected that makes the button flicker between the first state and the current state (an almost pause)
I also tried turning the feedback channel off but that didn?t do anything for me either.
Any ^ANI experts out there that can help me out?
TIA
0
Comments
Joe,
I was banging my head against the wall with using multi-state buttons
for animations a while back. At that time, I was trying to find a way to
query the button for the current state. This is not possible, just for the
reasons you stated in your post.
I ended up emulating the "always-on" feedback through code. It seems
as the feedback type property falls into the group of properties that
override any code commands. Once it is set a specific way in TPD4,
it cannot be modified by external commands.
Now, if I need to have any control over the multi-state button, I just
send ON and OFF commands when applicable.
Are you saying you have been able to pause an animated button? If so, can you explain how? I?m getting nowhere fast.
Thanks.
You could use a multi state bargraph with some timeline code to achieve it though. Put your animation states into the multistate bargraph and give it a high range equal to your maximum number of states. Create a repeating timeline and in each timeline event send a level incremented by one to your bargraph, Loop it back to 0 when you reach your bargraph high range.Now on a button event on your bargraph pause your timeline with 'timeline_pause'. You can restart it with 'timeline_restart'. This will achieve what you're trying to do.
I should have clarified, I was NEVER able to get a multi-state button
to pause mid-stream during an animation.
The multi-state bargraphs are nice for level control, but apparently dont
have the ability to auto-repeat by themselves.
It sounds like a custom timeline would probably be the way to go.
I am hoping that in the near future, these touch panels will support more animation type effects natively, without writing special code for it.
I guess I?m going to have to abandon the idea of pausing. Feature request?
Thanks for the feedback guys.
Jeff
Has anyone made it work?
This is what I've used for stopping animations as well as changing speeds, etc. I guess what you want is to stop where ever you are in the animation vice at the end of the run which is what it appears to always do. I had to double check this one and it does indeed finish its run before stopping. I did have mine set to "Always On" and Repeat "yes".
The timeline idea peviously mentioned would probably be the only way to stop where it is but as you said that would always be running in the processor where I guess the animation runs on the TP independent of the processor once initiated.
Here's what I've used FYI:
{
push:
{
local_var integer nAniB
nAniB = button.input.channel
switch (nAniB)
{
case 1://high speed
{
// paddle fan animation
//"'^ANI-<vt addr range>,<start state>,<end state>,<time>'"
send_command dvAni_Array,"'^ANI-1,1,7,1'"
}
case 2://medium speed
{
send_command dvAni_Array,"'^ANI-1,1,7,2'"
}
case 3://low speed
{
send_command dvAni_Array,"'^ANI-1,1,7,6'"
}
case 4://stop
{
send_command dvAni_Array,"'^ANI-1,0,0,0'"
}
//walking man animation !!!!!!
//"'^ANI-<vt addr range>,<start state>,<end state>,<time>'"
send_command dvAni_Array,"'^ANI-2,1,20,10'"
}
case 5: //running man
{
send_command dvAni_Array,"'^ANI-2,1,20,23'"
}
case 6://walking man
{
send_command dvAni_Array,"'^ANI-2,1,20,50'"
}
}
}