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:
prontoscript question
This thread has 7 replies. Displaying all posts.
Post 1 made on Wednesday January 22, 2020 at 14:45
Fischi
Long Time Member
Joined:
Posts:
January 2011
114
Hi, I want to set an image of a panel depending on the value of this panel
I've tried this
.........
case "F4":
lblid = "CURRENTICON";
if (value == 1) { value = "."; } else if (value == 0) { CF.widget("0","Widgetpage","TTV").setImage(); }
break; .........

My image "0" is stored under pageTag "Widgetpage" and activity tag "TTV".
This doesn't run

I have tried

.........
case "F4":
lblid = "CURRENTICON";
if (value == 1) { value = "."; } else if (value == 0) { CF.widget("0","Widgetpage","TTV").executeActions(); }
break; .........

to play e.g. a soundfile stored under the same activity/page tag
and this runs fine.

Why doesn't the setting of an image work ?
Where is my mistake?

Regards,
Fischi
Post 2 made on Friday January 24, 2020 at 00:14
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,994
It is not good practice to set an image in a widget using CF.widget. If the widget you are referencing is on a page which is not the current page, I don’t think this will work. It will not fail but as soon as you leave the current activity, if it actually did work, your changes are reverted. Instead, use GUI.widget() to retrieve the widget on the current page and set the image Note that GUI.widget also works from inside the Page script as well.
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 3 made on Friday January 24, 2020 at 00:26
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,994
Next, your setImage call has no arguments. You want to do something like this.

GUI.widget(‘TARGET’).setImage(CF.widget(‘SOURCE’,’MYPAGE’,’RESOURCES’).getImage(0),0);

Finally, buttons have 2 images with index 0 and 1. You see that I used index 0 above. I am a bit confused here because you mention setting images into a panel with CF.widget yet you then say that executeActions works on this same widget reference.

Please review my example above as well as searching the dev guide for setImage. If you could provide clarity regarding my confusion or email me a small config explains where to look for your code, that would help me tremendously.

Thanks in advance.
Lyndel
Lyndel McGee
Philips Pronto Addict/Beta Tester
Post 4 made on Monday January 27, 2020 at 19:42
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,994
Did you ever get this sorted?

TIA,
Lyndel
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 5 made on Tuesday January 28, 2020 at 10:03
Fischi
Long Time Member
Joined:
Posts:
January 2011
114
Hi Lyndel,
please excuse me for my late reply.

I've got it working as follows :

...............

case "F4":
lblid = "HS-2";
if (value == 0) { widget("CURRENTICON").setImage(CF.widget("Moon","RECOURCES").getImage(0),0);
return; } else
if (value == 100) { widget("CURRENTICON").setImage(CF.widget("Sun","RECOURCES").getImage(0),0);
return; };
break;
...................

It shows the icon "Moon" or "Sun" in a panel with the
tag "CURRENTICON) depending on the value.
The values are provided from a little server installed on my HomeSeer HA system and its possible to get other values to show different weather icons.

Regards,
Fischi
Post 6 made on Wednesday January 29, 2020 at 17:59
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,994
Great! Thanks for the update. I'm still working on openweather.org weather implementation. I got actual live date last night as have spent the last week or so gutting my original Yahoo Weather which is 13+ years old to move from wxdata to the new site.

The Weather 3.0 module will support lookup by id, zip, and lat/lon and will support all 3 units (Standard - Kelvin, Metric - Celcius, and Imperial - Fahrenheit). One thing I am going to question is the formatting of date display. Right now, I am doing MM-DD-YYYY. For other countries, users may want DD-MM-YYYY or maybe just standardize on YYYY-MM-DD.

Interested in your thoughts on this one.

I am using a the Philips HTTP module with some very minor modifications to support clients doing their own state management. Philips specifically did not make visible the READYSTATE object in their implementation. I have rectified that.

The Http module does not support via req.responseXML the removal of the XML Preprocessing instruction which to anyone wanting to use this library with openweathermap.org, they need to do custom text request handling and then convert to XML which is exactly what I did to overcome the issue below.

Note that if in the XML response string, the preprocessing instruction is present, you get an error that 'xml is a reserved word'. I have a temporary hack in place until I can get this last one sorted in an updated Philips Http Library ++.

Lyndel
Lyndel McGee
Philips Pronto Addict/Beta Tester
OP | Post 7 made on Thursday January 30, 2020 at 07:24
Fischi
Long Time Member
Joined:
Posts:
January 2011
114
On January 29, 2020 at 17:59, Lyndel McGee said...
I am doing MM-DD-YYYY. For other countries, users may want DD-MM-YYYY or maybe just standardize on YYYY-MM-DD.
Interested in your thoughts on this one.

I would be interested in DD-MM--YYYY

Lyndel I have parts of my project integrated in Scott's module (HTC like).
I've implemented temperature high, temperature low, outside temperature and icon until now.

Let's stay connected

Kind regards,
Fischi
Post 8 made on Thursday January 30, 2020 at 21:20
Lyndel McGee
RC Moderator
Joined:
Posts:
August 2001
12,994
Shoot me an email at the address on my RC Profile. ;-)
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