The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

Re: Re: Weather, and a new xAPplication coming on




>I could, if I had the slightest idea what you were on about :-)

lol, well it is the developer forum!


Basically it goes like this.

In the current weather display the time display is directly linked to
the UTC element of the xAP message. So what ever is  after UTC= gets
displayed.
The alternative is to separate the displaying of the data from the
actual data:
The %%UTC%% xAP variable holds whatever is the current UTC value
The label ( number 4 in this case) is blank not  @  %%utc%% as it
currently is.
Whenever the UTC changes a script is called
The script reads the value of %%UTC%% and adds a certain number of hours
The script now updates the label of the weather display with the new time.

The script is a .txt file that is stored in the same directory as the
rest of the weather files. It would contain:

sub main()

'Number of hours to adjust the UTC time by
NumberOfHoursToAdd=9

'Get the current UTC value
tmp=xap.GetxAPvar(DisplayName,"UTC")

'Add the required number of hours
NewTime=dateadd("h",NumberOfHoursToAdd,tmp)

'Update the label and then the display
a=xap.UpdateLabel(DisplayName,4,"   @" & NewTime)
a=xap.UpdateDisplay(DisplayName)

end sub

Once the file is saved you can use the display designer to set the
script to run when the utc variable changes.
If vbscript makes sense to you the hopefully the above also makes sense,
if not don't worry. The latest Desktop has web updateable displays so I
can upload updates to displays which can then be simply loaded on any
Desktop client. Once I get some free time!

James





xAP_Development Main Index | xAP_Development Thread Index | xAP_Development Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.