Trixology
WeatherCat => WeatherCat Web Templates => Topic started by: tigers on March 12, 2012, 12:51:29 AM
-
I've begun work on a new template that incorporates javascript to have certain data updated in real-time. I don't have much to show thus far, but you can see the basic framework for a real-time dashboard (updates at every 5 seconds) that includes temp, pressure, and rain here: http://wx.atkinsfamily.org/indexjq.php
This seems to work on Safari, Firefox, Chrome, and iOS.
Like I said above, this is just the very basics right now, but I'm hoping to evolve this into something pretty cool. Gauges are on the list, but to be honest I'm not really a "gauge" guy. Just give me the number and I'm all set. Now graphs, that's another matter altogether. I've found a couple cool looking possibilities for graphs but that's a bit further down the road..
-
Very cool, Todd! Thanks for taking on this project.
Steve
-
Nice work Todd!
Cheers,
Stu.
-
Howdy WeatherCat fans, .. . .
I've begun work on a new template that incorporates javascript to have certain data updated in real-time.
Hurrah!! [bounce] Thanks Tiger!! [cheer]
See what happens when you put a ;) tiger in your tank! [lol2]
Cheers, Edouard [cheers1]
-
Looks very professional, far better than he primitive live display I have on my website.
I'm hoping there is going to be a metric version ;)
Tony
-
Looks very professional, far better than he primitive live display I have on my website.
I'm hoping there is going to be a metric version ;)
Tony
Funny you should say that! I'm working on a way to set SI units now. I just gotta figure out if the cgi output from LWC is always in imperial units or not. It looks like this is the case but I just need to ask Stu to verify.
-
Very slick! I wish I knew more Javascript. Looking forward to the final result.
For SI units, I'm thinking you could get the php file to output two .txt docs, one for imperial, one for SI (just converting the variables).
-
Funny you should say that! I'm working on a way to set SI units now. I just gotta figure out if the cgi output from LWC is always in imperial units or not. It looks like this is the case but I just need to ask Stu to verify.
Always Imperial I'm afraid, hence the rather messy conversions on my site.
I'm looking forward to seeing it done properly [wink]
-
Very slick! I wish I knew more Javascript. Looking forward to the final result.
For SI units, I'm thinking you could get the php file to output two .txt docs, one for imperial, one for SI (just converting the variables).
I'm converting the units in js since I'd rather just output one file. I'm thinking this might be slightly easier on the server since the xml file is getting updated every 5 seconds. Besides, we all have multi-core computers now so I figure might as well use some of those cycles for client-side arithmetic!
-
True (also I meant to write xml, not txt). It's probably more user friendly to allow the user to select the units on their end (and have the conversion happen on their side).
-
Ok, I've got all the real-time variables available from WC (via the CGI panel) being read into a webpage via Ajax. I've also implemented a switch whereby one can switch between SI and Imperial units on the fly. The default is hardcoded into the page so if you use this template, you can just update that variable to either "c" or "f" depending on what you want the default to be.
http://wx.atkinsfamily.org/indexjq.php
-
Looks great, very professional.
-
Howdy Todd (aka Tigers), Tony, and WeatherCat fans,
Ok, I've got all the real-time variables available from WC (via the CGI panel) being read into a webpage via Ajax.
ditto on Tony's observation! [tup]
Certainly amazing how something as seemingly simple as this brings an immediacy to weather at a remote location!
Thanks again for taking this on Todd! [spin]
Cheers, Edouard [cheers1]
-
Coming along nicely [tup]
Is there a reason you have decided to go with metres a second instead of km/hr in the metric version?
Tony
-
Coming along nicely [tup]
Is there a reason you have decided to go with metres a second instead of km/hr in the metric version?
Tony
No reason in particular. I'll switch it over to kph tonight.
-
Page is finally getting somewhere. I've used the jquery and jquery ui scripts to help out with the AJAX and tab functions. One advanatage is that changing the theme is pretty simple and you can even roll your own by going to http://jqueryui.com/themeroller/
Also, the page is valid HTML5 and makes use of CSS3, so older browsers are out (IE mainly). Works just phone on iOS and Safari, FF, and Chrome.
I've still got to integrate the graphs and I have a couple more ideas I want to try and implement but I hope to have this ready to go in a week or so (or at least after the next release of WC which will provide a couple things that I and SaratogaWX need ;) ).
Anyway, check it out:
http://wx.atkinsfamily.org
-
Looking great [tup]
-
Looking great [tup]
Thanks! And I haven't forgotten about the metric units--I just removed the user selectable option since that was more of a test thing anyway. All one needs to do is change a variable in the template and it'll switch to metric or imperial depending how one wants it.
-
Very impressive. I'm liking your development page a lot. Thanks for putting the time into it.
-
Indeed, very nice [tup]
-
Looking great [tup]
Thanks! And I haven't forgotten about the metric units--I just removed the user selectable option since that was more of a test thing anyway. All one needs to do is change a variable in the template and it'll switch to metric or imperial depending how one wants it.
I was going to ask about it ;) but realised it was still in development.
Is there any chance of doing some Javanese on the wind direction to get it to display compass bearings rather than degrees? My pet hate.. but not enough to put me off [tup]
Tony
-
Here's a handy JavaScript code to convert degrees to cardinal directions:
function windDir ($winddir)
// Take wind direction value, return the
// text label based upon 16 point compass -- function by beeker425
// see http://www.weather-watch.com/smf/index.php/topic,20097.0.html
{
var $windlabel = new Array("N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW");
return $windlabel[Math.floor(((parseInt($winddir) + 11) / 22.5) % 16 )];
}
use it by var windDirection = windDir(windDegrees);
and the windDirection variable will contain the text of the cardinal wind direction based on the number in windDegrees.
Best regards,
Ken
-
Here's a handy JavaScript code to convert degrees to cardinal directions:
function windDir ($winddir)
// Take wind direction value, return the
// text label based upon 16 point compass -- function by beeker425
// see http://www.weather-watch.com/smf/index.php/topic,20097.0.html
{
var $windlabel = new Array("N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW");
return $windlabel[Math.floor(((parseInt($winddir) + 11) / 22.5) % 16 )];
}
use it by var windDirection = windDir(windDegrees);
and the windDirection variable will contain the text of the cardinal wind direction based on the number in windDegrees.
Best regards,
Ken
Thanks! That's much more compact than the code I came up with!
-
Looking great [tup]
Thanks! And I haven't forgotten about the metric units--I just removed the user selectable option since that was more of a test thing anyway. All one needs to do is change a variable in the template and it'll switch to metric or imperial depending how one wants it.
I was going to ask about it ;) but realised it was still in development.
Is there any chance of doing some Javanese on the wind direction to get it to display compass bearings rather than degrees? My pet hate.. but not enough to put me off [tup]
Tony
Cardinal directions have been added thanks to the efficient function provided by saratogaWX (which is many many lines shorter than the code I'd originally come up with!).
-
Looking good Todd [tup]
-
Hi Ken, Todd, Stu, and WeatherCat fans,
Here's a handy JavaScript code to convert degrees to cardinal directions:
Thanks! That's much more compact than the code I came up with!
Ditto!! Shucks I should have thought of that!! (http://www.canebas.org/Weather/LWC_forum/Custom_emoticons/D%27oh.gif)
Not certain AppleScript can do the math properly . . . *sigh* everything is weird in AppleScript :o, but that doesn't look like a real stretch. [tup]
The one good thing is I have that code in a separate library so I could swap it out and all my AppleScripts would be updated.
Thanks Ken for the elegant solution!! [bounce]
Cheers, Edouard [cheers1]
-
Looking good Todd [tup]
Thanks, Stu. Got the realtime min/max for today included now and no problems to report with the interim build. Thanks.
-
Just had a quick look Todd, looking good! (So glad you made the high/low text a little bit bigger - I had to get a twenty year old colleague to read it earlier in the week [biggrin])
Stu.
-
Thanks Stu, yeah I was playing around with Google fonts. I ended up making the widget boxes a little wider to there's more room to work.
Anyway, things are coming along nicely. I've got weather underground forecasts and alerts working now and the only thing left for an initial release is to bring in the graphs.
Not sure of a good solution for the STMONTHLY and STDAILY tags yet...the output from those is W I D E! :D
-
Looking good!
I like the forecast icons, give the page a bit of a lift
-
Lookin' great!
I'm assuming we'd have the flexibility to swap tags. When Stu gets tags for all the extra sensors, I'd like to present a few of those.
-
That's really nice looking, Todd! Thanks for working on this.
Steve
-
Lookin' great!
I'm assuming we'd have the flexibility to swap tags. When Stu gets tags for all the extra sensors, I'd like to present a few of those.
Hi Matt,
As of version 0.9.5, the current values of additional sensors are available (see http://www.trixology.com/live_weather/custom/ - scroll down to 'Additional Current Readings') - queries are planned for a later release.
Cheers,
Stu.
-
Not sure of a good solution for the STMONTHLY and STDAILY tags yet...the output from those is W I D E! :D
Sorry about that :)
I've been doing tentative work on a macro language for templates to do data tables and such like (it'll probably make an experimental appearance in early V2 releases if there's interest to take it forward). This will make it possible to come up with custom layouts and data in the future (simple conditionals, loops and variables which will allow one to loop a bunch of tags from some date to some other date - say the first day of the month to today). But for now we're stuck with the hard-wired, pre-formatted output for which I apologise - I'd love to sit here and develop all day, but the most important thing on my plate at the moment is to get V1 out.
Cheers,
Stu.