PDA

View Full Version : advice on adding activity transitions



kaeton
October 12th, 2007, 01:18 AM
I am using NR/NRD without Girder. I would like to add a "please wait" transition while my activity macros are processing. It seems from what I have read and tried that I cannot use a multiple jump technique (like with pronto). I guess that I could use some sort of an animation, but I am not sure how to do this.

Can you tell me what my best option is.

I was also wondering if I can make a volume slider with my global cache rs232 Sunfire receiver, and If so could I do that without Girder only using NR/NRD.


Thanks,

Kaeton

Rob H
October 12th, 2007, 06:02 AM
You could use a hidden frame that gets shown when you want the user to wait. I'd probably put it on the device template overlay so that it's available to all device pages and is guaranteed to appear on top.

You could add an animation to it of course.

In theory it may be possible to do what you want with the sunfire receiver, but it wouldn't be fun.

kaeton
October 12th, 2007, 03:00 PM
Rob,

Thanks for the reply. Any advice on how to set up the hidden frame. I have been all through the tutorials, instructions and even tried to break down some of the posted ccfs.

Could you give me a quick list of instructions or at least point me in the direction of instructions on how to do this somewhere.

Thanks,

Kaeton

tmorten
October 12th, 2007, 05:28 PM
I had exactly the same issue when I was migrating from Pronto to NetRemote. I currently have a frame for a loading bar, with four states controlled by a state variable. This frame is normally hidden, but I update the state from Girder as the macro is running, which causes the various stages of the loading bar to appear.

It should be possible to do the same thing from NetRemote alone using a LUA script, but the trick will be triggering the screen refresh -- you can't just change the state values within the button's action list, because I don't think that will trigger the repaint. Instead, I would experiement with changing the value of a variable, which is watched by your lua script. When your lua script detects that change in state, it could set timers to change the state of the variable that your hidden frame is dependent on. I *think* this will enable the repaint.

I agree with Rob about the volume... that one would be challenging without Girder... really, that's exactly the sort of application where Girder comes in handy, providing back-end processing.

Best,
Tim

Rob H
October 12th, 2007, 06:08 PM
You should just be able to set the relevant NetRemote variable (using NetRemote.SetVariable) and the screen should refresh.

Or you can use my FramePopups code if you want something a bit more flexible.

The basic idea is to give the frame two states one of which is invisible (the default state), and the other of which is dependent on a NetRemote variable having the value 1.

You can hide or show that frame by calling NetRemote.SetVariable('mystate', 1) or NetRemote.SetVariable('mystate', 0).

If you use FramePopups (see the help) then you can get the frame to disappear after a timeout.

kaeton
October 16th, 2007, 03:49 PM
Thanks for the help so far,

Rob, I am trying to use your FramePopups, as well as the PopupDemo config. Each time I try to follow the directions for FramePopup or just try to run PopupDemo with NR, I get this error

"1: attempt to index global 'FramePopup' (a nill value)"

Am I missing something.

Thanks,

Kaeton

Rob H
October 16th, 2007, 03:54 PM
You need to add the line


require "FramePopups"

To the start of your CCF's system lua file.

kaeton
October 16th, 2007, 05:58 PM
Thanks Rob,

That worked. But when I try to put the "execute lua code on release" (the same way that the popupdemo ccf uses it) on a button that has aliasis to other buttons and a jump to another page, It wont work.

If I have a button with just the "execute lua code on release" it works fine.

Any suggestions?

Kaeton

kaeton
October 16th, 2007, 07:13 PM
It is not the alias commands that are the problem. It is the jump command.

Ive tried delays which don't work, every combination of the order that everything is in, nothing works. The lua call seems to be ignored if there is a jump on the same button. I even tried putting the variable to 1 using a "set variable to value" command and making the visible state when it is equal to 1. That didn't work either.

Am I crazy or isn't what I am trying to do (Make a wait transition between activities using only NR) a very common thing. I would imagine that everyone using NR for a universal remote solution would do this.

I would imagine that I could write a lua function that would first call the framepopup and then jump to the desired page. And that I could do this for each activity. Sounds like more work than is needed, but if this is the only solution could someone tell me how to write a lua function for jumping pages.

Any help would be appreciated, this is the last thing I need to finish my NR design.

Thank You,

Kaeton

Rob H
October 17th, 2007, 03:01 AM
Do you want the jump to occur when the transition frame closes?

If so then you could do this in Lua using the OnHide handler for the frame popup with a NetRemote.GoDevice() call

kaeton
October 17th, 2007, 01:55 PM
Rob,

This is exactly what I want to do.

I'm not sure how to do this. Do I put this all in my lua script file, and still only call the popup from the button. If so, how do I write it so that it calls the GoDevice() at the right time.

Thanks for all your help,

Kaeton

Rob H
October 17th, 2007, 06:12 PM
You'd do something like


myPopup.OnHide = function(popup)
NetRemote.GoDevice('mygroup', 'mypage')
end



Obviously changing 'mygroup' and 'mypage' to appropriate values.

kaeton
October 18th, 2007, 12:28 PM
Thanks Rob,

This worked great. The only problem is that on the button that I call the lua function there is also aliases to buttons with Ir codes, and delays for timing of the activities. (I obviously come from a pronto background)

The problem is that the lua call seems to wait untill the delays and aliases have been called before it goes into effect.

A solution could be to call the delays and IR commands (or aliases) from inside the lua script file. I don't know if this is the best solution. If it is, is there a way to call delays and Ir commands (or aliases) from lua code.

Thanks,

Kaeton

Rob H
October 20th, 2007, 01:44 PM
For the delays you can use the SetTimer function, but I'm not sure about the IR - I think there's a function to do it but I'm not sure whether it's in the help. Hmm... it might only be available for the GlobalCaché - try searching here for SendIR

kaeton
October 30th, 2007, 05:34 PM
Rob,

Thanks for all of your help so far.

I have tried endlessly to use the SetTimer function. It seems to me that the SetTimer function sets delays to a lua function, which I think is my popup and then my godevice onhide of that popup. Which isn't what I need delayed. I need the actions on the NR button delayed

Right now I have a call to the popup function on a button inside of NR/NRD with an execute lua on release, followed by aliases to other buttons which have IR commands on them for turning on and setting inputs of my tvs etc. I don't need to have aliases I could obviously put in the ir commands directly, it is just eaiser with aliases. Onhide and Godevice functions are then called to perform the page jump at the end of the transition. these are called inside of my lua script by my popup function.

When I press the button, even though the popup function is at the top of the list, NR runs throught all of the aliases(ir commands), and then calls the popup function. Hence the need for the delay

This is what I need to happen in this order

1. you push button on NR
2. tv turns on (ir through global cache)
3. Transition page popsup for certian time (14 seconds)
4. Tv swiches inputs (ir through global cache)

what is happening is that I push the button, it runs through the ir commands, then does the transition popup.

I'm sure there is a million different ways to do this, but I can't figure it out.

Please help, I'm going crazy.

Thanks,

Kaeton

Rob H
October 30th, 2007, 05:52 PM
You need to add an OnHide function to the popup that does the SendIR to the globalcache. See the FramePopup help for this. And search here for the SendIR syntax.

vitello
October 30th, 2007, 09:35 PM
kaeton

When you get this working please post what you did. I am also interested in an activity delay. I have also had some concerns about whether NR button commands will always be activated in sequence. It seems that some commands get sent to threads. If that is so, then that would make things difficult for commands that must be in a certain sequence.

Good luck

Peter

kaeton
October 31st, 2007, 01:04 AM
I found this for the sendir function

irinstance:SendIR(irinstance.PRONTO_STRING,true,'0 000 0000 0000 0000'); --use string format, and use repeat (true or false)

I assume that the zeros are my ir code, I'm not sure what

irinstance.PRONTO_STRING represents.

Anyone know what I put here.

Thanks,

Kaeton

Rob H
October 31st, 2007, 04:00 AM
I'm not entirely sure either. However, I've just realised that there's another solution to this.

You can get NR to 'press' a button on the current page from Lua code. See the help for the NetRemote Lua library under ButtonDown() and ButtonUp(). That way you can put all the IR actions that you want to occur when the popup hides onto a hidden button and use ButtonDown() and ButtonUp() to press that button from OnHide().

kaeton
November 3rd, 2007, 07:36 PM
I have all of the transitions w/ delays during activities working great. Thanks for all of your help Rob.

Peter I will post what I have this week after further testing.

I was wondering if anybody knows if I can send a keystroke to the same machine running NR, using only NR and not girder.

Thanks again for all of the help, this forum is great.

Kaeton

sonata31
November 4th, 2007, 04:03 AM
I have all of the transitions w/ delays during activities working great. Thanks for all of your help Rob.

Peter I will post what I have this week after further testing.

I was wondering if anybody knows if I can send a keystroke to the same machine running NR, using only NR and not girder.

Thanks again for all of the help, this forum is great.

Kaeton

Can you post your code, I have the same problem ?

Thank You

kaeton
November 6th, 2007, 04:30 PM
Put this in your lua script file; (you will have to use this for every transition/delay that you need.) My own syntax is in green, what you need is in blue.

require "FramePopups"

watchtvwait = FramePopup:New('watchtvwait', 'master Template', 14)

watchtvwait.OnHide = function(popup)
gettvdigitalinput = NetRemote.GetElementByName("tvinputswitch")
tvdigitalinput = gettvdigitalinput:ButtonDown()
NetRemote.GoDevice('watch tv', 'WATCH TV')
end


I set up a frame popup just like in the “popupdemo” ccf on the downloads page of the promixis website.

Use execute lua code (on down) from the NRBasic plugin and call watchtvwait:Toggle() and whatever power on commands you need (aliases or direct IR commands) from your corresponding activity (in this case Watch TV.) I put my transition behind my background on the template page associated with the page where I call the watchtvwait:Toggle()

“tvinputswitch” is an invisible button on the transition frame with the commands/aliases on it that you want sent after the delay but before the transition jumps to its destination page in this case the (watch tv page under the WATCH TV page group), which is my watch tv activity control page.

If you have any questions, please don’t hesitate to ask.

Kaeton

sonata31
November 7th, 2007, 11:13 AM
Ok, Thank You