Page 14 of 15

Re: Yet more gauges

Posted: Fri 08 Jul 2011 9:28 am
by mcrossley
gemini06720 wrote:
mcrossley wrote:The LCD displays are hard coded to be right justified at the moment.
Indeed, I looked through the code of the 'steelseries.js' and found the location of the 'hard coded' right justification of the text ... a request for less 'hard coding' and more flexibility would really really be appreciated ... and you have that direct communication/connection with the holy designer... :mrgreen:
Ray, the problem is he is migrating the Java gauges over to Javascript. This is a big job which he does in his spare time. He will not want to go adding functionality into the JS version without implementing it in the Java version first. As it stands the JS version will lag behind the Java version for some time.

Now, if I come up with a cool suggestion that grabs his attention, he does sometimes put it in straight away (see the scrolling LCD he has now implemented in the JS version). But for run of the mill stuff like justification, I cannot see being done in the near term. I imagine he wants the keep the two versions as similar as possible whilst he is in the long slog the porting process.

The JS code is evolving too, I've made some suggestions about updating style and syntax that I see he has implemented in the latest version too. The current code has a number of 'issues' that should be resolved before tweaking features.

Now I have quite a lot of changes already to Gerrit's code to implement the current gauges. It is painful to carry these changes forward into each of Gerrit's new releases, so I am reluctant to go adding more customisation at this stage too. I guess I'm saying we've got what we've got for now, unless we come up with killer suggestions - and I think what we've got is pretty cool already 8-)

Re: Yet more gauges

Posted: Fri 08 Jul 2011 9:44 am
by gemini06720
Mark, the flexibility in the positioning of the texts was just a suggestion... But with this...
mcrossley wrote:...see the scrolling LCD he has now implemented in the JS version...
...there is no need for text justification... :) Will it be possible for you to use that feature?

Another question. Someone suggested the addition of a cloud base gauge. Do you have access to these gauges and could one of them be used for that purpose?

Re: Yet more gauges

Posted: Fri 08 Jul 2011 10:02 am
by mcrossley
Hi Ray, once I get the code back from yourself I'll look at updating the Gerrit's latest code which will give us the scrolling.

The linear gauges have been available for a while - see my demo page. I could use one for the cloud base, it's not difficult just a matter of priorities and time.

Re: Yet more gauges

Posted: Fri 08 Jul 2011 10:10 am
by mcrossley
I'm cross posting this from another thread on the forum, just in case people missed it:
One of the more recent changes to the gauge code means they will only work with the latest beta version of Cumulus.
Sorry, I hadn't realised this and made it clear, this is because it includes the new <#timeUTC> tag.

If you feel like making the v0-9 gauges work with version 1.9.1 of Cumulus, then edit gauges.js, and change line 630 from

var then = eval("Date.UTC("+cumulus.timeUTC+")");
to
var then = now;

and you should be good.

Re: Yet more gauges

Posted: Fri 08 Jul 2011 11:14 am
by JimDantin
mcrossley wrote:beteljuice is correct, the error checking in the script is very 'light' at the moment. Just deleting elements from the HTML is not sufficient, at the moment you also need to remove/comment out the relevant sections of code that refer to them.

Once I have a solution that functions as expected across the various different unit and nationalisation combinations, I do plan on making it more robust. One obvious addition would be to check for the existence of containers in the DOM before trying to use them. That way people can remove elements easily without having to worry about the code.
That's appreciated -- I have no significant experience in web design beyond simple HTML and Javascript. In the past, I found code I liked, modified/deleted, tried it out and moved on -- this one was a bit of a surprise. The gauges are SO nice, I just HAVE to include them! The amount of effort you guys are putting into developing a page design for the rest of us is amazing. Thanks.

Re: Yet more gauges

Posted: Fri 08 Jul 2011 12:07 pm
by beteljuice
Tip:
I don't know if <span> or <div> are being used as containers, but a temporary solution for you would be to 'hide' the container - to keep any page formatting you would have to 'replace' it with one of a similar size with whatever content you wanted.

The following assumes a <span> container:

Code: Select all

<span id="this_gauge" class="...         style="display: none;">content hidden no space reserved</span>
By using the style display code after any class declaration the container will not be displayed,
further it takes up NO space ! - the Javascript can still 'see' it and will 'process' it.

If you want to leave a blank 'hole' the right size, use:

Code: Select all

<span id="this_gauge" class="...         style="visibility: hidden;">content hidden, RESERVED space</span>
These should work unless the javascript is refreshing those properties during the Ajax loop.

Re: Yet more gauges

Posted: Fri 08 Jul 2011 12:14 pm
by mcrossley
The gauges are <canvas> but they are wrapped in a <div> at the current version, but I was going to take the wrapper out for the next release as I don't actually use it :roll: but maybe I'll leave it in now :)
The next release of code will be smarter around the HTML content - you can delete whatever components you want and the rest will continue to function.

Re: Yet more gauges

Posted: Fri 08 Jul 2011 12:19 pm
by JimDantin
beteljuice, you rock! :clap:

The HTML code was not quite like you used in the example, but the idea worked fine. Just before the three canvas lines, I changed
<td colspan='3' style="text-align:'left'">
to
<td colspan='3' style="display: none;">
and got this:
http://personalpages.bellsouth.net/j/d/ ... auges1.htm
Simple, clean, and the 4x2 layout shows up on my phone quite nicely.

Re: Yet more gauges

Posted: Fri 08 Jul 2011 1:39 pm
by gwheelo
Has anyone translated SS "gauges.js" to language specific variables? Specifically I need French, Spanish, Catalan (hey - Meteotortosa), Dutch, and German.

George Wheelock

Re: Yet more gauges

Posted: Fri 08 Jul 2011 2:16 pm
by gemini06720
gwheelo wrote:Has anyone translated SS "gauges.js" to language specific variables? Specifically I need French, Spanish, Catalan (hey - Meteotortosa), Dutch, and German.
George, I have a partial translation to french ... a work in progress... ;)

For the time being, the 'gauges.js' script by itself has not (and will not) be translated into another language, but the texts (messages) appearing inside the gauges and with the graphic images have been moved into language variables - those variables have also been moved together near the top of the script. It will be up to the station operator to translate the language variables into his/her language.

Re: Yet more gauges

Posted: Fri 08 Jul 2011 2:17 pm
by beteljuice
beteljuice, you rock! :clap:
I sometimes sway a bit after visiting my local hostelry :D , but I'm not sure I am to be congratulated for showing you how to hide Marks (very) hard work :roll:

Re: Yet more gauges

Posted: Fri 08 Jul 2011 3:38 pm
by gwheelo
Ray-
George, I have a partial translation to french ... a work in progress..
When finished -I would appreciate a copy. It is indeed only those variables I need!

Anyone else working in other languages?

Again I am looking for Spanish,Catalan, French,German, and Dutch.

GW

Re: Yet more gauges

Posted: Fri 08 Jul 2011 3:46 pm
by mcrossley
George

I have put all the strings into a LANG 'object'. If you want multiple language support, then you will have to write a (external preferably) script, that just overwrites all those object properties and calls 'drawGauges()' which will then refresh all the gauges on the page.

Re: Yet more gauges

Posted: Fri 08 Jul 2011 8:23 pm
by JimDantin
I just went live with the revised gauges web page. I edited all of the navigation links to point to my new gauges1.htm web page instead of the standard gauges.htm. That required editing every one of my web pages and changing the href in two places in each file (my web pages have navigation bars on the top and bottom). But, I'm a bit lazy, so here's how I did it . . .

Get the free utility program Replace Text from http://ecobyte.com/replacetext/ (there are probably other similar utilities, but I know this one works!). This program will do a search and replace on a group of files that you specify. It's a life saver in situations like this.

Make a backup copy of your \cumulus\web folder. The utility will save a backup copy of each file it processes, but let's be REALLY careful, OK? The utility is really easy to use, but I'll give you a quick tutorial.

Open the program.
Add a Replace Group.
Add files to the group -- select the "Use folder" option, navigate to the Cumulus folder and enter "*.htm" in the "Include File Filter:" box. Exclude any that you do NOT want to modify.
Make additional entries as needed for specific files that you want to process.
In the bottom of the screen, enter href="gauges.htm" in the Original Text box, and the name of your new file in the Replacement Text box (for me it was href="gauges1.htm")
Click on the"Start Replacing" icon
You are done.

Do a manual Web Update in Cumulus and upload any files that Cumulus doesn't know about. That's it.

Jim

Re: Yet more gauges

Posted: Sat 09 Jul 2011 5:44 am
by meteotortosa
gwheelo, I'm going to translate to catalĂ  and spanish.