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

Login:
Pass:
 
 

Original thread:
Post 12 made on Monday July 19, 2010 at 11:57
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,994
No idea if that is the case.

Several things that may help.

1. You cannot cancel a timer once started.
2. You can start subsequent timer.
3. You can use 'user data' such as sequence number to pass along with a timer. User data will be used as parameter to function when timer is called.
4. This user data can be a sequence number in stored in a variable for later reference.


// In activity script
var currSeqNum = 0;
function myTimerFunction(seqAtTimeOfTrigger)
{
if (currSeqNum === seqAtTimeOfTrigger)
{
// do something as user has not reset/restarted timer.
// jump back.
}
}

function setupOrRestartTimer()
{
currSeqNum = currSeqNum + 1;
CF.activity().scheduleAfter(10*1000, myTimerFunction, currSeqNum);
}


In each of your onscreen buttons that need to reset the timer, you will need to add prontoscript.


// Button Script
setupOrRestartTimer();
this.executeActions();


In the page script where you need to start the timer, you will need to add prontoscript.


// Page
setupOrRestartTimer();


Note that you can take this farther and use only a single active timer by keeping track of time remaining before JumpBack must occur. This is the more resource-friendly approach as there are only 64 allowed timers. That is, if you have a long timeout period and user presses 65 buttons, that 65th press will fail to start a timer and you will then lose JumpBack capability because timers 1 to 64 above will not act because sequence number does not match.

I leave this as an exercise for you to experiment with.

Philips did something like this in the RS232 scripts for Denon/Marantz receivers. Admittedly, their code is rather complicated and sometimes difficult to read but it does the job.
Lyndel McGee
Philips Pronto Addict/Beta Tester


Hosting Services by ipHouse