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:
Javascript debugging and a couple questions
This thread has 6 replies. Displaying all posts.
Post 1 made on Friday September 28, 2007 at 13:43
MVis
Long Time Member
Joined:
Posts:
July 2007
94
What's the best way to syntax check and possibly debug javascript other than downloading every time? I ask because I'm in learning mode and I'm spending a lot of time just physically downloading to the device to test code changes.

What's the minimum refresh time that matters for scheduleAfter(delay,function) ?

For example, if I'm animating, a delay of 1ms is equivalent to the delay of 16ms (60Hz) which implies that there are some bounds on how fast scheduleAfter can process. What is the refresh rate for the panel? Is scheduleAfter natively tied to the refresh rate or just when functions inside it call graphics updates ? If I chain updates for several widgets in a function, does the refresh occur for each widget which might imply updating multiple widgets would affect the minimum scheduleAfter delay time. Or is there another mechanism that refreshes asynchronously from the widget calls?

I know, it's a remote, but I'm exploring this aspect as I learn to use it. And I realize that animated doobahickeys are cute at first, but generally annoying after the initial novelty wears off.

Thanks,
Mark
Post 2 made on Friday September 28, 2007 at 13:59
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
In the slimserver activity the basic schedule loop is 100 miliseconds. We do some animation and it looks okay to my weak eyes and Lowpro (very fussy eyes) is comfortable with it. The eyes really require a slightly faster refresh rate for good motion continuity but it does not look bad.

As for Java editor, I have posted on this forum several times what I am using/doing and how I do it (I built a special program to make the edit/compile turnfast and it is on my web site). Search this forum for more info.

If I was nasty or younger I would yell at you for not searching this forum. It is small after all. I know I posted something re Java editing within the past two days.
OP | Post 3 made on Friday September 28, 2007 at 14:13
MVis
Long Time Member
Joined:
Posts:
July 2007
94
Barry,

I already use your prontoxml, but the syntax checker barfs on all the undefineds like CF and TCPsocket.

Are you writing wrappers so that the syntax will pass ? Or using CPoint JSeditor for the syntax check?

EDIT - I assumed double clicking in the ProntoXML was coming up with an error message ProntoXML was generating, but it was just running another application (whatever was mapped to .js).

I'll use JSEditor to syntax check and see how that goes. What would be really awesome is a TSU9600 emulator that supports javascript, but I guess that's a lot to ask for.

Mark

Last edited by MVis on September 28, 2007 14:31.
OP | Post 4 made on Friday September 28, 2007 at 17:04
MVis
Long Time Member
Joined:
Posts:
July 2007
94
Another question - The system page widgets are copied on all pages. If I have an image that scrolls up into the system page widget area, how do I keep it from going "in front of" the system page widgets ? An easy answer might be to just copy the system widgets to the desired page and use the front/back stuff...

I noticed the graphics for the firm buttons on the system page do not have a handle associated with them. Is that typical? I'm using the default .xcf file included with ProntoEdit.
Post 5 made on Friday September 28, 2007 at 17:56
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,006
Look in the Dev Guide Appendix B where you will find reserved names for various activities. You can access System Device, System Pages with key of "PS_SYSTEM" You can do the same for all Firm buttons using "PS_FIRM1" to "PS_FIRM5".

There's a specific reason why you cannot program ProntoScript on the System page. There is no global script active as the System Device is really just a placeholder for common widgets. You can still manipulate items such as changing images, etc... However, you cannot program script stuff into the system-level firm buttons.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 6 made on Friday September 28, 2007 at 18:07
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
I ran into that problem and did what you suggested. Did not like the result. There is still a scroll limit based upon the 480 pixels of the Pronto screen. I ended up doing the following:

Broke the text into lines. Did that based upon the average width of a character in the font (typed a label with all the normal characters at the font size I wanted and saw how much of an x dimension the widget needed to hold it and divided by the number of characters.)

I then split the the text on blanks and combined words into lines adding back the blanks until the computed line width (average char width * Number of chars)exceeded the width of the widget. Then removed the last word.

Each "Line" went into an element of an array. This array has no real boundry on the number of lines which is what I wanted.

It is now a simple and very fast process to ensure that the widget "Windows" just the right lines from the array. A for loop dumps the Current N lines into the widget label, adding a \n at the end of each line. This is triggered by whatever is the scroll button being used, (e.g. PageUp and Page down) and if done right allows the button to be held down to continuously scroll.

BUG WARNING. Placing the text into an array and then transfering the lines into the widget has an issue with unicode vs Latin. The Prontoteam has a test case from me and is looking at it. If the transfer was just from a text string it works with no issue. So if you get some funny characters ( my issue was with oxAE which is the registered symbol) and 0x92 (an apostrophe) which are beyond the standard 128 Latin codes, i.e. require a full 8 bits. I did a quick scan, eliminating characters over 127 and changing them to some thing below 127 (the apostrophe) if they had a Latin counterpart.

With regard to the system widgets, there is under the insert menu something relating to system items. When opened it is always grayed out. I once saw it not grayed out but do not remember how I did that. Getting old sucks, but the alternative is worse (currently).
Post 7 made on Friday September 28, 2007 at 23:29
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
13,006
You can only insert system items on the system page. If you find you need them on other pages, you can add a copy and then hack the config and move the item to a different page. This is done by editing ConfigEdit.xml inside the XCF zip archive.

If you are interested in doing something like this, you will find hints in the ProntoNG forum under +custom +battery +icon or by another keyword of +ConfigEdit.xml
Lyndel McGee
Philips Pronto Addict/Beta Tester


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