Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Previous page Next page Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Page 1 of 2
Topic:
Create a jump in prontoscript
This thread has 27 replies. Displaying posts 1 through 15.
Post 1 made on Sunday April 20, 2008 at 06:04
nico11
Lurking Member
Joined:
Posts:
April 2008
4
I am new in prontoscript.
I need to create in the code of a page a jump to a buttun in the page and execute the action list of the buttun.
What is the code that I need to make in the page code to create the Jump? What is the code that I need to do in the button to execute the action list?
Thanks
Post 2 made on Sunday April 20, 2008 at 06:29
dave964
Long Time Member
Joined:
Posts:
January 2008
172
You don't "jump" to a button.

From within prontoscript, to execute the actions of a button, you need to give the button a prontoscript name. If you are trying to execute it from a different page, you need to give the page it appears on a prontoscript name. And if you are trying to execute it from a different activity, you need to give the activity a prontoscript name.

Then, from your code :

CF.widget (button_name, page_name, activity_name).executeActions ();

If you are calling it from the same page, you don't need page name and activity name.

If you really meant that you want to jump to a different page from within prontoscript, you would need to create a button with an action list that performs the jump - and then reference it as above.
Dave
Post 3 made on Sunday April 20, 2008 at 09:44
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Also remember that if trying to do this from a page script, you will need to use scheduleAfter as referenced in FAQ-11 of the Philips ProntoScript Website. Note that you can use a delay of 5 milliseconds versus 100 and it should still work.

11. How to execute an Actionlist from within a page script?

The call to executeActions will not work from within a page script. This is due to the restriction that the control panel cannot play multiple action lists at the same time and a page script is always executed after a page jump action within an Actionlist
The way to do this is by scheduling the playing of the Actionlist as follows:
- in the page script -
...
scheduleAfter(100, function(){executeActions();});
...


Nico, On a personal note: What happened to Riccardo6886? (your other user id)
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 4 made on Sunday April 20, 2008 at 10:56
nico11
Lurking Member
Joined:
Posts:
April 2008
4
Lyndel,
I am in an other Pc, not at home
OP | Post 5 made on Sunday April 20, 2008 at 13:23
nico11
Lurking Member
Joined:
Posts:
April 2008
4
I try but it doesn't work, where I make the mistake?


var EXT_NR = "2";// Specify extender 0-9, A-F
var INPUT_PORT = 0;// Specify power sense port 0,1,2,3

var e = CF.extender[parseInt(EXT_NR, 16)]; // Set up the extender
if(e == null) // Verify extender
{
Diagnostics.log("Extender " + EXT_NR + " is not defined");
}
else // Set up power sense input
{
var i1 = e.input[INPUT_PORT];

if(i1.get())// If Input 1 Is On
{
// execute actions of this button
scheduleAfter(100, CF.widget("butOn").executeActions());
}
else // If Input 1 Is Off
{
// execute actions of this button
scheduleAfter(100, CF.widget("butOff").executeActions());
}
}
Post 6 made on Sunday April 20, 2008 at 13:33
dave964
Long Time Member
Joined:
Posts:
January 2008
172
scheduleAfter takes the name of the function as the second argument. What you have done will actually call the function, not schedule it.

It should be :

scheduleAfter (100, CF.widget("butOff").executeActions);
Dave
OP | Post 7 made on Sunday April 20, 2008 at 13:47
nico11
Lurking Member
Joined:
Posts:
April 2008
4
Dear Dave,
when I run the script, it show the page and then he goes to the home page without making the action list. The buttun need only the name of the tag any script to perform the action list?
Post 8 made on Sunday April 20, 2008 at 13:51
dave964
Long Time Member
Joined:
Posts:
January 2008
172
If the button is on the same page you are running the script from, you only need the PS name of the button.

But - you are using scheduleAfter, so you might need the page name, and the activity name. So :

scheduleAfter (100, CF.widget("butOff", "page name", "device name").executeActions);

Edit : Obviously you need to use the real prontoscript "page name" and "device name".
Dave
Post 9 made on Sunday April 20, 2008 at 14:47
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
A page jump should be the ONLY or LAST thing in an action list as once a page jump is executed to move to another Activity, ProntoScript shuts down the current Activity and the new Activity is started up.

Downloadable, from the Philips ProntoScript site (presuming you have level2 cerification) is an Animation XCF(this is an unapproved file/configuration) that does countdown through several page jumps (steps of an initialization macro) and utilizes, IIRC System.setGlobal() and Page Scripts to make this happen.

If you are trying to achieve a startup sequence such that you are doing the following in a single Actionlist, this will never work in ProntoScript. You must break things apart at the page jump boundaries.

1. execute some actions
2. do a page jump
3. execute some more actions
4. do another page jump
5. execute again
6. do jump to final device page

Have a look at the above referenced Animation script and to get some ideas as to how you can do what, I believe, you would like to do.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 10 made on Friday May 16, 2008 at 04:34
jacovn
Long Time Member
Joined:
Posts:
December 2007
33
- edited: found a explanation that what i want cannot be done..

Last edited by jacovn on May 16, 2008 04:46.
Post 11 made on Friday May 16, 2008 at 09:42
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Jacovn,

You sure about that? I've done many things, some require creative solutions, using ProntoScript.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 12 made on Friday May 16, 2008 at 12:08
jacovn
Long Time Member
Joined:
Posts:
December 2007
33
No i thought that i found the solution:
Button with a jump (named jump) to another page (Video 2), and activate that with:
page("page1").widget("jump").executeActions();

but this does not work.

Also a: CF.widget("jump","page1").executeActions();
does not work


To explain what i want:
I have one activity with multiple pages under it. In every page is a HT-device.
Some HT-devices need more than 1 page for all the buttons.

I can use the normal page up and down to go through the pages, but than i could also hop to a page not belonging to the ht-device.

So i hoped that with pronto script i could just assign page names and with a simple check see if a page up/down request comes in if it is allowed to jump to another page.

Last edited by jacovn on May 16, 2008 12:21.
Post 13 made on Saturday May 17, 2008 at 00:24
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
What you have to do is emulate/implement the Page Up/Down functionality yourself.

That is, you emulate Page Up/Down. For each page you want to jump to, you can do the following:

1. Create a button for each page in a hidden page in the activity. These buttons contain nothing but page jumps.

2. When the activity starts, retrieve these "jump" widgets and add them to an array.

3. Create an index variable (at activity level) that points to current page you are on. For example, assume your starting page is first in the array (that is, the jump button reference in array should be at index 0).

4. In the Activity Hard Button properties, your ProntoScript that you could for Page Up/Down should simply increase or decrease the index such that you treat your array as a circular buffer. After increasing/decreasing the index, you simply dereference (retrieve widget at) the current array element and then use scheduleAfter() to execute the action as mentioned above.


If all pages are in the current activity, then this will work as your activity script will not be interrupted.

However, if a page you want is outside the activity, then you could, in theory, use System.setGlobal()/getGlobal() to save/restore the current index once you have jumped 'Back' from the page outside the current activity. The only caveat to this approach is that any connection (TCP/IP, for example) that you have made will have to be restored upon reentry. Otherwise, if you just want to emulate the page up/down functionality, this should work just fine.

Early in ProntoScript Beta, Philips had a config file that did many things such as this. They have released bits and pieces of this config as other modules. However, as this configuration contained some functionality that proved unstable to Javascript, it was never released. The type of functionality I'm describing here is, for the most part like functionality of jumping between macro and device side of remote for classic prontos. Once implemented, you can "remember" the last page of the device that was currently viewed.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 14 made on Saturday May 17, 2008 at 04:31
jacovn
Long Time Member
Joined:
Posts:
December 2007
33
Lyndel,

Ok step 2 would look something like this ?

var jumppages = new array[];

Can you just put a widget in an array like this
jumppages[0] = CF.widget("Button", "HiddenPage", "Device");


And can i simply get that out and execute ?

jumppages[0].executeActions;
Post 15 made on Saturday May 17, 2008 at 08:07
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,999
Yes, it does and yes you can (squared).

Just heed the FAQ warning about doing this from a page/activity script and use CF.activity().scheduleAfter().


The only issue you will have is needing to restore your current state when jumping back into the activity.

Most of the script you write will be in the Activity Script. Rest is in PageUp/PageDown Hard Key button scripts.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Page 1 of 2


Jump to


Protected Feature Before you can reply to a message...
You must first register for a Remote Central user account - it's fast and free! Or, if you already have an account, please login now.

Please read the following: Unsolicited commercial advertisements are absolutely not permitted on this forum. Other private buy & sell messages should be posted to our Marketplace. For information on how to advertise your service or product click here. Remote Central reserves the right to remove or modify any post that is deemed inappropriate.

Hosting Services by ipHouse