Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3044 7 December 2018. See the Wiki for download

changing tempScaleDefMaxC causes erratic behaviour

Discussion of Mark Crossley's HTML5/Javascript gauges

Moderator: mcrossley

Post Reply
UncleBuck
Posts: 36
Joined: Sat 29 Dec 2012 10:27 pm
Weather Station: Davis VP2+
Operating System: MAC Mini - OSX El Capitan
Location: Victoria, Australia

changing tempScaleDefMaxC causes erratic behaviour

Post by UncleBuck » Wed 27 Jan 2016 10:06 am

I switched from Weathercat to CumulusMX in the last few days (since I replaced the Oregon with a Davis) and was installing the SS gauges.
When I changed the tempScaleDefMaxC from its default to be 50 the temp gauges pointers starting jumping back to 0 and then climbing up to the current temps.
If I change the setting to 45 then it returns to its expected behaviour of not moving unless the temp changes.

I can put up with the setting being at 45 as we have only had about two days in the last 3 years where it has exceeded the 45 here.
Just thought you would like to know about the unexpected weirdness.

Col.

User avatar
mcrossley
Posts: 5234
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: changing tempScaleDefMaxC causes erratic behaviour

Post by mcrossley » Wed 27 Jan 2016 10:38 am

Hi, could you post a link to the page and leave it with the odd behaviour for a while so I can take a look?

The gauges will automatically rescale if a reading exceeds the defaults in a given day.

UncleBuck
Posts: 36
Joined: Sat 29 Dec 2012 10:27 pm
Weather Station: Davis VP2+
Operating System: MAC Mini - OSX El Capitan
Location: Victoria, Australia

Re: changing tempScaleDefMaxC causes erratic behaviour

Post by UncleBuck » Thu 28 Jan 2016 5:22 am

Hi Mark,
This is the page with the basic gauges on it.
http://www.pcweather.kcsolutions.com.au ... -basic.htm
The erratic behaviour only happens if viewing in Deg C, as I have not modified the defaults for Deg F.

Colin.

User avatar
mcrossley
Posts: 5234
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: changing tempScaleDefMaxC causes erratic behaviour

Post by mcrossley » Thu 28 Jan 2016 9:32 am

OK, I see what the problem is.

The gauges by default are configured to have a 'niceScale', that means it takes your min and max scale values and rounds them numbers that create a more pleasing set of scale numbers. You can see the difference when I disable the niceScale on your temp gauge compared with the dew gauge here...
Untitled-1.png
The temp gauge ends up with a tick mark every 0.5 degree and every 2.5 degrees there is a semi-major tick mark.

You have specified the max as 50 and the min as -5, as these are not both multiples of 10, the niceScale routine rounds your min to -10.

Now the code checks if the required min scale value matches the current gauge min scale value, if they don't match the gauge is redrawn. But due to niceScale, it redraws again with a rounded min value of -10 instead of the requested -5.

With me so far? :?

So two options to fix this...

1. Change your min scale values for the temp and dew gauges to -10
2. Add an additional parameter to the temp and dew gauges to disable 'niceScale' and keep your -5
- Add

Code: Select all

                    params.niceScale = false;
at lines 720 and 957
You do not have the required permissions to view the files attached to this post.

UncleBuck
Posts: 36
Joined: Sat 29 Dec 2012 10:27 pm
Weather Station: Davis VP2+
Operating System: MAC Mini - OSX El Capitan
Location: Victoria, Australia

Re: changing tempScaleDefMaxC causes erratic behaviour

Post by UncleBuck » Thu 28 Jan 2016 1:19 pm

Yep, got all that....
Have decided to go with option 1 even though I don't think we have ever gone below about -3 here.
It's just easier to change the DefMin as the gauges look better that way.

Now I just need to finish troubleshooting those damn popup graphs :groan:

Post Reply