Premise How to display temperature along with the date and time.

Motorola Premise
So far, I'm not seeing the auto-refresh for anything other than the date/time/temp...th temp icon ONLY changes during a manual refresh or when loading the page. I've increased the date/time css to provide enough space for the .jpg, but so far, not so good. F5-ing it works okay for a laptop, but not what I need for a touchscreen. Ideas?

Wayne - thanks for the link. Looks like some good stuff, but it qon't quit work for my Ambient->Premise->Perplexed arrangement, as Ambient updates the icon files, then Premise grabs (or is supposed to) the icon file from the directory that Ambient loaded to.
 
It's doing what I had hoped it wouldn't do! I'm convinced the background image, in the DateTime section, is cached by IE. The DateTime section is periodically refreshed in order to update the clock-time; however, it appears it only updates the text and the background image remains unchanged. Only a complete page-refresh (F5) will force IE to reload DateTime's background image (and display the newest weather-image).

WayneDb's solution is promising because it uses text formatted with a weather-icon font ... the background image is not altered. However, I believe this is not a good fit with the way the Ambient software operates.

ADDENDUM

Did a quick test and here is the result. I modified DateTime's RenderPlugin function and slapped in a line that sets "weather.gif" as the background-image. The idea is to explicitly set the image each time the RenderPlugin runs (i.e. every minute).

Modules > AutomationBrowser > DateTime > Classes > DateTime > RenderPlugin
Code:
if CBool(this.multiLine) = true then
	' Added the next line
	tstr = "<SPAN style=""background-image:url(\images\weather.gif)"">"
	tStr = tStr & WeekDayName(Weekday(this.DateTime))
	...
	' Added the closing SPAN tag
	output = tStr & " </SPAN>"
else
	...

IE displays "weather.gif" in DateTime's background but does not update it when RenderPlugin runs. You have to refresh (F5) the page to force IE to update the background-image. Bummer!
 
hmmm...so should I be able to use somthing like 'DateLastModified' as part of my routine for displaying the 'latest' image? I'm thinking that it would check each time the Date/Time Timer advances, it would check the last modified date, and if it has been modified, then it would reload the image. Or would that not work?

Unfortunately, my VBScript skills are more from the torture perspective than expert, so I'm curious whether I'm even heading down the right path...(those who can, code; those who can't, manage) ;)
 
It might be fun to try!

;)

That's a line I'll never forget and it came from a very old edition of Mad magazine. It lampooned "Hi-Fi" magazines and included a bogus "Letters to the Editor" section. The best letter was from an enthusiast (whose family name was probably a Mad-like "Furd") who described, in excruciating detail, an exotic combination of turntable, tone-arm, cartridge, stylus, and pre-amp, and asked if they would work together. The editor's response to the earnest question was: "It might be fun to try!".
 
On the iPhone module, I have some of the weather graphics tied to Rob Brun's Weatherstation Module. Works well, very reliable (I still need to put it up in Downloads), however, the images would get loaded from cache, even if using the 'Refresh' button. So in the toolbar function I modified the Refresh button to reload the image without having to reload the page (F5). No problems with that.

Code:
	if curObj.path = "sys://Home" then
		Output = Output & "<a href= ""/sys/home?d??iPhoneRenderPage"" & ""java script:location.reload(true)"">" & g_iPhoneGetToolbarImage("Refresh.gif") & "</a>"
	else
			 Output = Output & "<a href=""" & CurObj.ObjectID & "?d??iPhoneRenderPage"">" & "<A href=""java script:location.reload(true)"">" & g_iPhoneGetToolbarImage("Refresh.gif") & "</a>"
		end if

So I thought I'd get a bit more clever and have it autorefresh, by adding this to the iPhone global, then calling it from either the header or footer. Nada.

Code:
function g_timedRefresh(timeoutPeriod) 
Output = Output & "<script type=""text/javascript"">"
Output = Output & "setTimeout(""location.reload(true);"",timeoutPeriod);" & "}"
Output = Output & "</script>"
g_TimedRefresh = "<body onload=""java script:timedRefresh(5000);""" 
g_TimedRefresh = Output
end function

Any ideas?
 
Chuck,

Try this. Put the META tags (shown in the image) after the HEAD tag. It instructs the web-browser to refresh the page every 15 seconds and to refrain from using any cached content.

In xBrowser, the g_xbRenderHeaderEx() function is responsible for creating the web-page's HEAD tag so that's where you'd put the META tags.
 

Attachments

  • tags.png
    tags.png
    2.2 KB · Views: 10
Drats! Thanks for the instructions. I had tried the content/refresh angle, but couldn't get it to work...I left it in, commented it out, went the javascript route. Saw your post, and went back to try it out and what did I see? I didn't have the META tag or cache on it!!! So thanks, (again & as usual) for sharing your wealth of knowledge...and it works like a champ!
 
Nice...tested on Firefox; Iphone; Smartphone-WM6; and some thing called Internet Explorer(?). Works across all platforms. Four at the same time; not apparent impact to speed even w/ four refreshing at the same time...not sure, but the iPhone may not refresh as well as the others...

123...you are king!!! or you Rock!!! or are awesome!!! (california lingo...)
 
Back
Top