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 24 made on Monday November 15, 2010 at 02:15
buzz
Super Member
Joined:
Posts:
May 2003
4,385
deric.lts,

As a relatively quick and painless fix, look at onExitCallback().

Then change your typical IR command from
page("TEMP1").widget("tempUp16").executeActions();

to
airCondTemp = CF.widget( "tempUp16", "TEMP1". "DAIKIN" );

In the onExitCallback() function:
airCondTemp.executeActions();

will emit the appropriate temperature IR only once as the user moves to another page. Make sure that you do not emit a stray IR command if the user does not actually change any fan settings.

Strictly speaking you don't need to use the CF.widget(,, "DAIKIN") form, but it is a good habit to get into as your programs grow.

---

As a matter of programming style, note that you could establish three variables:

a = "TEMP1";
b = "tempUp";
c = "16";

then code your temperature adjustment line as:

airCondTemp = CF.widget( b + c, a, "DAIKIN" );

If you calculate the value of "a", "b", and "c" based on the current fan speed and temperature, you can eliminate the giant switch statements. The only real trick here is to make sure that "c" ends up as a proper character string after any calculations.

Use the style that works for you. A gawky looking program that actually works is much better than a very clever program that almost works.


Hosting Services by ipHouse