Page 1 of 2

MX 3.5.0 windrose gauge

Posted: Mon 13 Apr 2020 2:56 am
by BCJKiwi
I notice that the Wind Rose gauge is now showing undefined, where the wind run units of measure used to be.

On checking the MX User interface I see there is nothing there where the distance units used to be.

Has this intentionally been removed (if so what to change in gauges.js ?) or, if not intentional, how do we fix it?
There does not appear to be any distance unit in /web/realtimegaugesT.txt and it seems there never was.

Have looked at gauges.js but don't see an answer there but maybe I'm not looking in the right place?

Re: MX 3.5.0 windrose gauge

Posted: Mon 13 Apr 2020 4:27 am
by Phil23
Both my interface & website seem to be showing the wind rose OK.

Both are currently displaying a wind run of 20.6 km.

Re: MX 3.5.0 windrose gauge

Posted: Mon 13 Apr 2020 6:05 am
by water01
Same here, all showing correctly.

Re: MX 3.5.0 windrose gauge

Posted: Mon 13 Apr 2020 6:38 am
by BCJKiwi
Thanks
@ Phil I see you are using the default website .htm pages
@water01 Can't tell what site you have.

While I am using basically the same files from the interface folder the actual page (.htm vs .php) is different.

What puzzles me is that it was all working well before the latest MX version updates but am unable to find any relevant differences in any of the files involved other than the actual gauges.php vs gauges.htm files which are a lot different.
However I don't see what has changed between the files I am using pre and post MX ver 3071.

It is not only my site but the others using the same template as well.

Re: MX 3.5.0 windrose gauge

Posted: Mon 13 Apr 2020 6:51 am
by water01
OK that made me fix my banner!! Mine is my own build, mostly in PHP. Could it have anything to do with the announcement about Highcharts. Not sure they are involved in the gauges, I didn't think so. I am on 3.5.1, but that was a minor add to 3.5.0.

Mark's announcement said the entire interface folder had to be changed?

Re: MX 3.5.0 windrose gauge

Posted: Mon 13 Apr 2020 8:14 am
by BCJKiwi
Well I've checked all the files and they have not changed over the time involved.
Already had the main highcharts updated. The only one there that changed was grid.js and have swapped that back and no difference.

My Saratoga site windrose gauge is fine and have compared the gauges.js files and while they do vary a bit (the Saratoga files are quite old) there is nothing relevant that I can see.

The thing is I'm sure that nothing was changed in these pages or support files between working before and not working now but there must be some change that I'm missing.

Just checked an old version of MX and the Ui does not have a wind run unit at all - same as 3071.

Re: MX 3.5.0 windrose gauge

Posted: Tue 14 Apr 2020 3:02 am
by BCJKiwi
Hmmm
Been back through earlier versions of the template and the ones I looked at all showed undefined.
Finally fond the bits of code that should do the job but don't so now have code that does not show the units.
BUT I know it should show the units (as you have it) but don't see how it does Grrr.

I can see that MX 3071 is delivering an older version of gauges.js but there is no obvious difference the the way it works.

I did tweak the code slightly but instead of the the expected (hoped for?) result, the result is no 'undefined' and no UOM - just blank as it is on the MX UI.

I suppose it is better in that it is not displaying an error. :lol: :lol:

Re: MX 3.5.0 windrose gauge

Posted: Tue 14 Apr 2020 3:16 am
by beteljuice
I suppose the obvious question is does MX have the wind speed units set ?
ie. not corrupted or invalid.

Re: MX 3.5.0 windrose gauge

Posted: Tue 14 Apr 2020 8:51 am
by water01
It does in the realtimegauges.txt file

Code: Select all

"tempunit":"C",
"windunit":"mph",
"pressunit":"mb",
"rainunit":"in",
and it does the set of the title here

Code: Select all

        getWindrunUnits = function (spdUnits) {
            var retVal;
            switch (spdUnits) {
            case 'mph':
                retVal = 'miles';
                break;
            case 'kts':
                retVal = 'n_miles';
                break;
            case 'km/h':
            // falls through
            case 'm/s':
            // falls through
            default:
                retVal = 'km';
                break;
            }
            return retVal;
        },
but what I cannot find is where is puts into the dial!!

Re: MX 3.5.0 windrose gauge

Posted: Tue 14 Apr 2020 9:30 am
by mcrossley
David, the odometer title is added by the drawOdoTitle() function, it uses the value in cache.gaugeOdoTitle (it defaults to "km"), which in turn is set by setWindUnits()

I see the odometer units on the Wind Rose on https://silveracorn.nz/weather/wxssgauges.php though?

Re: MX 3.5.0 windrose gauge

Posted: Tue 14 Apr 2020 9:37 am
by water01
Hmmmm but I am getting undefined http://www.dmjsystems.co.uk/weatherbos/gauges-ss.php as per the original post !! But the pop-up has the correct data i.e. miles, which is weird!!

Re: MX 3.5.0 windrose gauge

Posted: Tue 14 Apr 2020 11:23 am
by BCJKiwi
The gauges.js looks OK but there is nothing in realtimegaugesT.txt to set the units for the odo.
I'm running
scriptVer : '2.7.3',
This is the same script version that is running in the Saratoga site. The only difference in the scripts is that for Saratoga I have added an icon on the gauges, and have longpoll running, neither of these 'features' is running in the MX UI websites.

The realtimegauges.txt file is the same file it is just sent to the different sites via extra webfiles and I have verified that the files are identical.

If I rem out
// Add title to windrun odometer to the plot
// if (cache.showOdo) {
// drawOdoTitle(buffers.ctxPlot);
// }
then there is no undefined, if I leave it in then I get undefined.

Re: MX 3.5.0 windrose gauge

Posted: Tue 14 Apr 2020 11:27 am
by water01
there is nothing in realtimegaugesT.txt to set the units for the odo
Not quite true as I said here viewtopic.php?f=40&t=17967#p140452 it uses the realtimegauges.txt data for windunit in a case statement to determine if it should be miles, n. miles etc.

Re: MX 3.5.0 windrose gauge

Posted: Tue 14 Apr 2020 11:37 am
by BCJKiwi
Agreed,
But, there is no actual var being created in realtimegauges.txt specifically for the odo which is what i said.

Re: MX 3.5.0 windrose gauge

Posted: Tue 14 Apr 2020 11:53 am
by griffo42
BCJKiwi

I am running your scripts CumulusMX UI and the attachment shows a screenshot of the relevant gauge - shows undefined.

When I mouse over the gauge, it shows (at the top) Windrose (km/h) which is also incorrect. It should show km only (for Australian units of measurement).

Am running Win 10 on the latest version of Cumulus MX V3.5.1 (b3072).

Hope this helps in your getting to the bottom of it.

best wishes

Keith