Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Previous section Next section Previous page Next page Up level
What's New
4/16/13 - "Harmony Ultimate" hybrid touchscreen and "Harmony Smart Control" models join the ranks.
4/15/13 - Convenient $150 hard buttoned remote for use with Apple iPhone or iPad-based control systems.
1/24/13 - Disappointing Q3 earnings due to flagging global PC market to blame.
12/31/12 - Our thanks to everyone who has helped make Remote Central a great community for the past year!
12/25/12 - Got a new remote? Want a new remote? Explore Remote Central's resources!

Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Page 2 of 2
Topic:
Actions and sleep
This thread has 24 replies. Displaying posts 16 through 25.
OP | Post 16 made on Tuesday June 26, 2012 at 15:33
urskog
Junior Member
Joined:
Posts:
June 2012
28
I seem to be getting the same problem anyway.

This is the beginning of my script when starting the activity for BluRay on TV:
--
// Check if activity is already running
if (System.getGlobal("currentActivity") != "BLURAY_TV")
{
System.print("Starting activity BluRay TV");

// Power On everything needed
if (System.getGlobal("powerStatus.PREPRO") != "ON")
{
System.print("Powering On PreProcessor");
System.setGlobal("powerStatus.PREPRO", "ON");
CF.widget("HIDDEN_POWER_ON", "DEVICE_PREPRO_HIDDEN", "DEVICE_PREPRO").executeActions();
System.print("After sleep");
}

// BluRay Player Power On
if (System.getGlobal("powerStatus.BLURAY") != "ON")
{
System.print("Powering On BluRay player");
System.setGlobal("powerStatus.BLURAY", "ON");
CF.widget("POWER_ON", "DEVICE_BLURAY_TRANSPORT", "DEVICE_BLURAY").scheduleActions();
}
--

And the actions (not scripted) on the button called with HIDDEN_POWER_ON is:
Function: Power On preprocessor..
Delay: 20.00 Sec (20sec for test)

However, when starting the activity in the simulator I get this error message in the console:
Starting activity BluRay TV
Powering On PreProcessor
ProntoScript error: Busy playing actions
Offending activity script: (untagged)
Offending line #24: " CF.widget("HIDDEN_POWER_ON", "DEVICE_PREPRO_HIDDEN", "DEVICE_PREPRO").executeActions();"

So it's still not possible for me to executeActions() here, and if I change to scheduleActions() it doesn't do the delay in the order specified, instead it powers on everything and then delays for 20 seconds :(

Did I misunderstand the above posts and did something wrong?
Post 17 made on Tuesday June 26, 2012 at 16:20
Lowpro
Select Member
Joined:
Posts:
March 2004
1,845
You are not following my suggestion at all per Post 11 of this thread. You are still using ProntoScript to construct your actionlist. What I suggest in Post 11 is that you "only" use ProntoScript to conditionally determine which actionlist you want to run using a simple if/else statement. That's where the ProntoScript ends. The if/else statement simply states, if these conditions are met execute the actionlist contained on Button A, else execute the actionlist contained on Button B. The appropriate actionlist is then run (a traditional actionlist, not ProntoScript) which contains all the needed actions from start to finish, including any delay actions.

Last edited by Lowpro on June 26, 2012 16:29.
LP Related Links:
View my profile to access various
links to key posts and downloads.
Post 18 made on Tuesday June 26, 2012 at 16:52
brasch
Regular Member
Joined:
Posts:
December 2008
87
another thought regarding the projector - I would suggest not having a simple please wait screen on for 90 seconds - that's a long delay, make it do something nice while waiting, like showing photos or something
Post 19 made on Tuesday June 26, 2012 at 18:37
alpha
Long Time Member
Joined:
Posts:
September 2003
208
I was thinking a Pop-Up Countdown Timer with a Cancel Button. Just in case it is executed by accident.
Project Boredom 2 is here. [Link: mediafire.com]
------------------------
Check Version 1 & 2 out in the files section.
Post 20 made on Tuesday June 26, 2012 at 22:58
Guy Palmer
Active Member
Joined:
Posts:
June 2008
639
On June 26, 2012 at 15:33, urskog said...
I seem to be getting the same problem anyway.

So it's still not possible for me to executeActions() here

It certainly is possible to use executeActions() where you are trying to use it.  I don't understand why you are getting the error that you are getting as HIDDEN_POWER_ON is your first actionlist.  My only thought is that you have another actionlist at the activity, rather than page, level (e.g. a jump to the page, which is something that PEP often adds automatically).  So, when it tries to run HIDDEN_POWER_ON it is still running this activity-level actionlist.  Check whether there are any actions in the activity properties and, if there are, just delete them.
Post 21 made on Wednesday June 27, 2012 at 00:03
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
11,543
That is the only reason you'd get such behavior. Clear out any actions in the Activity's ActionList.

Or, alternatively, try this but removing actions in the Activity's Actionlist is much easier.

var w= CF.widget("HIDDEN_POWER_ON", "DEVICE_PREPRO_HIDDEN", "DEVICE_PREPRO");
CF.activity().scheduleAfter(50,function(mywidget){mywidget.executeActions();},w);

What will happen here is that after 50 milliseconds of completing the actionlist (remote becomes idle), your function will be called and will pass the value of 'w' which is your widget. When function executes, it will then execute the actions of the widget passed in.

Note that this approach assumes you have all delays in a single actionlist. If not and your actions are spread across multiple widgets, simply do multiple scheduled calls against different widgets as in:

var w= CF.widget("HIDDEN_POWER_ON", "DEVICE_PREPRO_HIDDEN", "DEVICE_PREPRO");
var w2= CF.widget("HIDDEN_POWER_OFF", "DEVICE_PREPRO_HIDDEN", "DEVICE_PREPRO");

CF.activity().scheduleAfter(50,function(mywidget){mywidget.executeActions();},w);
CF.activity().scheduleAfter(100,function(mywidget){mywidget.executeActions();},w2);

And remember that if your widget contains a Jump, you will get an ActionList Error (do a search) that should be handled by using a Try/Catch. This whole try/catch logic necessity is what caused Widget.scheduleActions to be introduced.

Lyndel

Last edited by Lyndel McGee on June 27, 2012 00:12.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 22 made on Wednesday June 27, 2012 at 01:37
urskog
Junior Member
Joined:
Posts:
June 2012
28
Indeed my activities had jumps!
However, when I removed the page jump so the action list itself on the activity BLURAY_TV then not even the script part gets executed.

I tried putting a System.print("Start test"); at the top when nothing happened just to make sure that it at least tries but not even that line gets printed, strange!
However if I add the page jump back on the activity actions then the line gets printed as it should but of course the error also returns.

Is there something else needed to make it execute everything scripted under "Advanced" after removing the automatically placed page jump?
Post 23 made on Wednesday June 27, 2012 at 10:03
Guy Palmer
Active Member
Joined:
Posts:
June 2008
639
The activity-level script should run as soon as you enter the activity.  Similarly, page-level scripts should run as soon as you enter the page.

Maybe try this (which is good pactice anyway): wrap your activity-level script into a function then call this function from the page level.
Post 24 made on Wednesday June 27, 2012 at 19:48
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
11,543
If activity script is not running, then you may have a syntax error. If you remove the page jump, I find that weird. For starters, make sure the first page you want visible in the activity is not hidden. The first visible page will be the target.

Next...

Wrap the entire activity script in a try/catch block and print any error to the diag log.

try
{
// your current script stuff
}
catch(e)
{
System.print(e);
Diagnostics.log(e);
}

I suggest writing to both as if you have an extender on this project, you will not be able to simulate unless you are using the Jon Welfringer patch for the simulator. If no extender, then jump to your actiivity in debug with console logging turned on and hopefully you can isolate the issue.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 25 made on Thursday June 28, 2012 at 03:09
urskog
Junior Member
Joined:
Posts:
June 2012
28
I'm hopeful that this problem is resolved now!
I think I have the needed behavior in the simulator at least but I'll have to try it out on the real remote to see if it indeed works, and then I have to clean up the code a bit because it is littered with println debugging etc :)
After this, if it indeed worked, I'll post details on what exactly the solution was so others can benefit from it.

Thanks again to everyone involved!
Page 2 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