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

Login:
Pass:
 
 

Topic:
onRelease Event After an activity Jump
This thread has 8 replies. Displaying all posts.
Post 1 made on Monday April 6, 2009 at 19:31
mraneri
Long Time Member
Joined:
Posts:
February 2009
141
I'm trying to figure out a way to trigger a prontoscript routine on release of a system button. This would be no problem except that I would like to jump across activities during (or shortly after) the button press...

So, for instance.. Press the power button, and immediately jump to the page which dynamically shows which components are no longer required. This gives the user the option to shut off components individually. For convenience, I would like the user to be able to press and hold the power button, be taken to the power down page (immediate feedback), and if they release the button after holding it for more than 700ms, automatically turn off all the equipment, so they don't have to click anything on the screen.

The logic works fine if I don't switch the page.. As soon as I include the jump, the onRelease event doesn't trigger at all. I also tried setting the onRelease function on the new page as well as in the Prontoscript on the button itself. None of this works in the simulator.

Is this possible, or do I just have to delay the page jump until the user releases the button?

Thanks for any help you can provide.

- Mike
Post 2 made on Monday April 6, 2009 at 19:48
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,001
You should have a look at the Denon 232 script from Philips website (assuming you have certification) to see how they accomplished volume control from the home page.

Specifically, you will want to look @ page script that is active following a page jump that occurs from home when user presses Vol+/- hard button.

After the jump takes place, you can "hook" the onRelease using a page script to get a notification that button has been released.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 3 made on Monday April 6, 2009 at 20:09
mraneri
Long Time Member
Joined:
Posts:
February 2009
141
I'm certified. I will check the script. Thanks for the tip.
OP | Post 4 made on Monday April 6, 2009 at 20:29
mraneri
Long Time Member
Joined:
Posts:
February 2009
141
I got my CF's and GUI's mixed up...

This didn't work:
CF.widget("PS_POWER","PS_SYSTEM","PS_SYSTEM").onRelease = SYS_ReleasedPower;

This did work:
GUI.widget("PS_POWER").onRelease = SYS_ReleasedPower;

Thanks for the pointer.

- Mike
OP | Post 5 made on Wednesday April 8, 2009 at 09:36
mraneri
Long Time Member
Joined:
Posts:
February 2009
141
Incidentally, I hit an obscure bug related to this...
When you Press a button with a release activity defined, but due to some other logic execute a page jump BEFORE that button is released, something gets messed up...

If you subsequently Press a button with a hold function defined, the Hold function never executes. Press it a second time, and the hold function DOES execute. Press any other button first, and the hold functions work fine too...

It's just the first button press after a jump occurs WHILE a button (with a release function) is being held, which doesn't work properly...

Just spent an couple of hours trying to figure this one out, expecting there was something wrong with my prontoscript. Haven't yet figured out a workaround.
Post 6 made on Wednesday April 8, 2009 at 11:19
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,001
Do you have a small configuration that exhibits what you believe to be the problem? I don't think it is a bug but rather a use case Philips might not have expected.

Are you attempting multiple page jumps to pages in different activities? If so, I will go out on a limb and say this will not be supported. Why? Because ProntoScript context is reset/restarted with entry into an activity. I suspect the "onRelease" stuff only works when hopping from one activity to another.

Another note....

If you notice in the Philips Denon module, they actually use single page jump and repeating page script to send commands to ramp the volume. They don't rely on 2nd button press.
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 7 made on Wednesday April 8, 2009 at 15:06
mraneri
Long Time Member
Joined:
Posts:
February 2009
141
So, here's what I've been working on. I have a multi-zone configuration which all runs off a single home page. The Home page is (basically) dynamically created in prontoscript (hiding/ activities, moving buttons, etc..) based on which is the currently selected zone (stored in a global XML object so as to survive page/activity jumps.) When the user wants to switch to an activity without changing inputs on devices, they just tap the activity, and the jump occurs to the desired activity. If they want to turn on equipment and set inputs, instead of tapping the activity, the press and hold for 600ms. Then the equipment is turned on, and setup, and the activity jump happens.

The way I've decided to handle power is like this:
Click the power button, and the intent is the user is shutting down the zone, so I page jump to a Power Off page, which has buttons showing which equipment can be shut off depending on which zones are still on and using other equipment. There, they can click each piece of equipment and turn them off one at a time. For convenience, if they press and hold the power button for 600ms, this equipment will turn off automatically (i.e. they don't have to click each one). If they continue to hold for a total of 3 seconds, all equipment in all zones is shut down.

Now consider a user at the home page presses and holds the DVD activity to setup the equipment. Perhaps they realized this was not what they wanted. They should be able to press and hold the power button to turn the zone off automatically, However, since they pressed and held the Activity button from the home page (during the jump to the activity), the press and hold of the power button doesn't work. Another use case is my Wii activity, which really has nothing going on. My kids would press and hold the Wii activity to set everything up. Then when they were done, they would push and hold power, but the equipment wouldn't automatically shut down.

I took a look at the Denon script, and it seems it may not be related to the release, but somehow related to the jump itself. If you take the stock denon script and pick a button on the home page, and add a page jump to the Radio activity, the volume controls work fine. If you do a widget().executeActions(); call to a button which has the same page jump, the volume hold does not work the first time. If you click a different button first, while in the radio activity, the volume control works fine too.

Very interesting and frustrating at the same time.

Again, Lyndel, Thanks for your insight. If you have other thoughts, I'd be interested in hearing them.

- Mike
Post 8 made on Wednesday April 8, 2009 at 18:57
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,001
If the issue is that you need to calculate time after the jump, how about this. When you press the power button, set the time pressed (as an integer converted to string) into a system global, then in your onRelease() function, simply compare time delta as "now - then".

If, delta > 3000 then power off everything
else if delta > 600 then power off current zone

I'm struggling a bit with visualizing what you are stating in paragraph 3. Any way you could email me (I do not share private files that have been emailed to me) your config so I could get a better understanding of what you are attempting to do. It seems to me that once you jump to the activity, each page in the activity could install a handler into the Power Button but the Power button must be released and repressed if Power was in pressed state upon entry to the activity. This is by design. In order to fully understand and make a recommendation as to whether or not you can do what you like, I'd really need to see the code.

Lyndel
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 9 made on Wednesday April 8, 2009 at 19:34
mraneri
Long Time Member
Joined:
Posts:
February 2009
141
Thanks for your response. I will send you an e-mail.

- Mike


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