Page 7 of 15
Re: Yet more gauges
Posted: Wed 29 Jun 2011 10:51 am
by mcrossley
Hi Ray, can you update to the contents of the latest zip file please, the version you have was faulty.
Re: Yet more gauges
Posted: Wed 29 Jun 2011 11:00 am
by gemini06720
Mark, I 'hacked' for a few hours at the previous release (v0-1) ... unfortunately without success...
I have downloaded the latest release (v0-3) and will try it in a little while.
In order to be able to display unusual characters (such as the degree symbol) I had to change the charset to "ISO-8859-1" - I do not think "UTF-8" will be able to display accentuated characters (not tried yet).
May I suggest that the UoM (units of measure - ie: temperature, rain, pressure, wind speed) be read from the data ('realtimegauges.txt') file rather than being 'hard-coded' into the script...
Thank you for being so open to suggestions...

Re: Yet more gauges
Posted: Wed 29 Jun 2011 11:13 am
by mcrossley
Ray,
UTF8 should be fine for accented characters and definitely for the degree symbol.
Not sure what you mean by the UoM being hard coded? I do read them from the realtime file, but I have to compare them against hard coded values in order to make decisions about scales etc.
I am aware that the scale ranges will probably need a little tweaking/extending for some people.
Re: Yet more gauges
Posted: Wed 29 Jun 2011 11:14 am
by RayProudfoot
mcrossley wrote:Hi Ray, can you update to the contents of the latest zip file please, the version you have was faulty.
Now updated to 0.3 but sadly the same problems exist. I think we only differ in how we measure rainfall so this is perplexing. Hope you can sort it because these gauges are brilliant.
LATER: Tried it with IE8 but got a message that canvases aren't supported. For the record I'm running Firefox 5. But I can see your gauges fine Mark so it seems something is wrng with my config and/or paths.
Re: Yet more gauges
Posted: Wed 29 Jun 2011 11:45 am
by mcrossley
Ray
I think it is because you still have an old copy of the realtimegaugesT.txt that Cumulus is processing.
Re: Yet more gauges
Posted: Wed 29 Jun 2011 11:50 am
by gemini06720
OK, Mark, I have installed the latest release (v0-3).
Looking at the 'gauges.js' script I notice a little coding error.
I like that you have now created a variable 'imgPathURL' for the 'relative' path to the folder containing the graphics produced by Cumulus, but I do not think (my personal opinion) that including that path into the array 'g_tipImgs' is a good thing - I would suggest that the variable 'imgPathURL' be placed into the script wherever the array 'g_tipImgs' is used, such as (line 669):
Code: Select all
document.getElementById('imgtip0_img').src = imgPathURL + g_tipImgs[0][0] + g_cacheDefeat;
The 'ddimgtooltip.js' script also needs to be modified so that the variable 'imgPathURL' can be used for the hover tool tip images:
Code: Select all
tooltips[0]=[imgPathURL + "temp.png", " ", {background:"#FFFFFF", color:"black", border:"2px ridge darkblue"}];
Mark, with your scripts, indeed, using the charset to "UTF-8" does display the degree symbol.
I have also downloaded the demonstration page from Gerrit Grunwald website and installed it on my computer trying to understand why your scripts would not work. For that page, if I use the charset "UTF-8", the degree symbol does not display (or rather it is displayed as a question mark within a black diamond) - thus my need to use the charset "ISO-8859-1".
mcrossley wrote:Not sure what you mean by the UoM being hard coded? I do read them from the realtime file, but I have to compare them against hard coded values in order to make decisions about scales etc.
Somewhere down the code:
Code: Select all
//set some default units
cumulus.tempunit = "°C";
cumulus.rainunit = "mm";
cumulus.pressunit = "hPa";
cumulus.windunit = "mph";
On my system, the wind speed unit is in kilometer/hour - thus, if mph is used, the resulting display will be wrong...
Oh, from which file do you read the UoM, from the 'realtime.txt' file or from the 'realtimegauges.txt' file - on my system the two files are at different locations?
And, as indicated by the 'other' Ray

, the script will not 'initialize' - it just get 'stuck' as 'Downloading' (same problem with the previous release). I have tried different options, all unsuccessful...
The script must be reading some data from the 'realtimegauges.txt' file - clicking on the buttons get the gauges going, but no updating!
Script is [link removed] - on my home/office Apache server running under Windows 7 Pro.
Re: Yet more gauges
Posted: Wed 29 Jun 2011 11:57 am
by mcrossley
Right, firstly apologies again, the realtimegaugesT.txt in the zip is out of date. The correct one is attached. This is the cause of Ray and Ray's problems.
Ray (gemini) Ah I see your concern, those values are just placeholders to stop the initial drawing of the gauges failing whilst the data is fetched from the web site. Once the script has your realtimegauges.txt file, it will update the default values with your specific values.
Re: Yet more gauges
Posted: Wed 29 Jun 2011 12:07 pm
by RayProudfoot
Bingo!!!
It works. I decided to compare my realtimegauges.txt to yours Mark and noticed your first field was the time but mine was the temp. You probably spotted it at the same time.
My only suggestion is that the forecast window could do with being a bit wider so "Precipitation possible within 24 to 48 hours" is fully visible.
It looks accurate enough to throw open to the wide world. I'll modify my home page later today.
Well done that man!!

Re: Yet more gauges
Posted: Wed 29 Jun 2011 12:17 pm
by gemini06720
Mark, I have replaced the 'realtimegauges.txt' file...
And it is now a 'go'!
And as the 'other' Ray (the 'Proudfoot' one

) pointed out, the forecast window could be somewhat wider...

How difficult would it be to make the forecast window 'flexible', meaning that it automatically adjust its width according to the length of the forecast string...

Re: Yet more gauges
Posted: Wed 29 Jun 2011 12:19 pm
by mcrossley
Ray
Good job, you can try upping the size of the text display by altering line 407 of gauges.js, change:
width: 350,
to something like:
width: 400,
However, I would not say they were ready for the real world yet. They only work on the latest browsers, so we should really put a redirect in there for non-compatible browsers back to the original gauges page. The code isn't very robust and isn't very well proven. I'd hold off for a bit, but it's your call.
Re: Yet more gauges
Posted: Wed 29 Jun 2011 12:22 pm
by mcrossley
Ray (gemini), you seem to have a problem with the popup trend images, they are out of sync for some reason?
Re: Yet more gauges
Posted: Wed 29 Jun 2011 12:36 pm
by RayProudfoot
Hi Mark! (thank God there isn't two Marks or this would really be fun!),
It required a width of 900 before the whole message was visible. The other Ray's suggestion of a variable-sized box depending on message length sounds good but I don't have to program it!
Good point about it not working with all browsers. I'll hold off for now. Do you have a list of those it does work with?
Re: Yet more gauges
Posted: Wed 29 Jun 2011 12:46 pm
by steve
I've got them installed here -
http://sanday.org.uk/weather/gauges-ss/gauges-ss.htm
Excellent work!
What do the red sectors on the barometer represent?
Re: Yet more gauges
Posted: Wed 29 Jun 2011 12:50 pm
by mcrossley
I've talked to Gerrit about making text that is too large scroll, that should be fun! Any 'latest' browser should work, IE9, Chrome, FF4+ etc.
I'm at the barbers now, catch you later.
the red sectors are your all time low/high limits
Re: Yet more gauges
Posted: Wed 29 Jun 2011 1:40 pm
by mcrossley
steve wrote:What do the red sectors on the barometer represent?
I see a problem with the code and your values. Your all time high pressure is 1044.9, and the code sets the scale max to 1050,
but the clever gauge code decides that a 'nicer' value would be 1060. I then draw the upper red sector from 1044.9 to 1050, which now doesn't reach the end of the scale
The 'nice' values in the gauges can be switched off to force them to use your supplied values - I'll try that.