Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Default Gauge Scale

Share your Cumulus MX user interface here
Phil23
Posts: 111
Joined: Sat Jul 16, 2016 11:59 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Win7 Pro
Location: Australia

Default Gauge Scale

Postby Phil23 » Tue Jan 24, 2017 10:36 am

Hi all,

I've looked at the code a few times, but not sure where to start.

Would like my gauges to default to a range of 0-40°C instead of -10 as the starting point.

We do see -5 t0 -10 in Winter, so would need to auto rescale then, but can anyone give me a rough idea of which lines will let me set 0°C as the default gauge minimum.

Thanks

Phil.

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

Re: Default Gauge Scale

Postby mcrossley » Tue Jan 24, 2017 1:21 pm

Phil, is this on the MX interface, or the web page?

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

Re: Default Gauge Scale

Postby mcrossley » Tue Jan 24, 2017 1:23 pm

For MX, ..../CumlusMX/interface/lib/steelseries/scripts/gauges.js

Line 106+

Phil23
Posts: 111
Joined: Sat Jul 16, 2016 11:59 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Win7 Pro
Location: Australia

Re: Default Gauge Scale

Postby Phil23 » Tue Jan 24, 2017 8:55 pm

mcrossley wrote:Phil, is this on the MX interface, or the web page?


Thanks Mark,

Primarily the web page, and that's around where I looked.

Code: Select all

            // default gauge ranges - before auto-scaling/ranging
            tempScaleDefMinC       : -20,
            tempScaleDefMaxC       : 40,


Probably got confused a little by the fact that -20 was specified, yet my gauge showed -10.

Interesting though that both web & interface code contains -20 as default,
yet the web page gauge is starting at -10 & the interface at -20.
If I've explained it so it makes sense.

Or maybe I'm confused cause I may have previously edited the file.

Phil

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

Re: Default Gauge Scale

Postby mcrossley » Tue Jan 24, 2017 9:13 pm

I can't check as I'm not at home at the moment, but I suspect it may be a "niceScale" thing that is altering the scale to a range of 50. The gauges on my web page go from -20 to 40 though. :? :roll:

A link to your page?...

Phil23
Posts: 111
Joined: Sat Jul 16, 2016 11:59 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Win7 Pro
Location: Australia

Re: Default Gauge Scale

Postby Phil23 » Wed Jan 25, 2017 9:18 am

Thanks Mark,

I have managed to get it to scale from 0 to 40 by changing "tempScaleDefMaxC" on line 107 of gauges.js

Noticed later though that the gauge had rescaled it's self to 0-50.

Presume that was done by what's down around line 829.

Code: Select all

                    //auto scale the ranges
                    scaleStep = data.tempunit[1] === 'C' ? 5 : 20;
                    while (cache.lowScale < cache.minValue) {
                        cache.minValue -= scaleStep;
                        if (cache.highScale <= cache.maxValue - scaleStep) {
                            cache.maxValue -= scaleStep;
                        }
                    }
                    while (cache.highScale > cache.maxValue) {
                        cache.maxValue += scaleStep;
                        if (cache.minValue >= cache.minValue + scaleStep) {
                            cache.minValue += scaleStep;
                        }
                    }

                    if (cache.minValue !== ssGauge.getMinValue() || cache.maxValue !== ssGauge.getMaxValue()) {
                        ssGauge.setMinValue(cache.minValue);
                        ssGauge.setMaxValue(cache.maxValue);
                        ssGauge.setValue(cache.minValue);
                    }
                    if (cache.selected === 'out') {
                        cache.areas = [steelseries.Section(+cache.low, +cache.high, gaugeGlobals.minMaxArea)];
                    } else {
                        cache.areas = [];
                    }


Not at all a Java programmer, but am assuming that the rescaling is based on the maximum temp & it may have happened once we hit 30 today.
Presume also that it stays scaled that way for the rest of the day.

Changed the value here from 10 to 5, but think it's still observing todays maximum & rescaling the 40 up to 45.

Code: Select all

scaleStep = data.tempunit[1] === 'C' ? 5 : 20;


My site is in my signature.

Cheers

Phil.

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

Re: Default Gauge Scale

Postby mcrossley » Wed Jan 25, 2017 12:28 pm

It should only re-scale when the current value exceeds the current scale limits, so hitting 30 shouldn't have done that.

I'd need to examine what the code on your site is doing - maybe I'll have time this evening. Meantime - are you running the latest version of the gauges script?

Phil23
Posts: 111
Joined: Sat Jul 16, 2016 11:59 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Win7 Pro
Location: Australia

Re: Default Gauge Scale

Postby Phil23 » Thu Jan 26, 2017 1:03 am

Still on Cumulus 3041 & "Scripts by Mark Crossley - version 2.5.5"

Got a little lost on how exactly to upgrade the steel script stuff.

I did download it from Github a while back but was not sure how to proceed from there.

Phil.

Phil23
Posts: 111
Joined: Sat Jul 16, 2016 11:59 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Win7 Pro
Location: Australia

Re: Default Gauge Scale

Postby Phil23 » Thu Jan 26, 2017 3:42 am

mcrossley wrote:It should only re-scale when the current value exceeds the current scale limits, so hitting 30 shouldn't have done that.


Noticed the gauge returned to the 0-40 scale this morning, presuming at the 9:00am rollover.

Have since noticed it's rescaled to 0-45°C.
I did change the scaleStep to 5 yesterday.

Code: Select all

                    //auto scale the ranges
                    scaleStep = data.tempunit[1] === 'C' ? 5 : 20;


Phil.

Edit:-

Now it's scaled back to 0-40°C.
Bit lost on what's triggering it.

Phil23
Posts: 111
Joined: Sat Jul 16, 2016 11:59 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Win7 Pro
Location: Australia

Re: Default Gauge Scale

Postby Phil23 » Thu Jan 26, 2017 4:17 am

Also read this post,

http://sandaysoft.com/forum/viewtopic.php?t=14863

Don't think it's relevant. Not sure, as I'm seeing 0-45.

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

Re: Default Gauge Scale

Postby mcrossley » Fri Jan 27, 2017 11:57 am

OK, the scales of the "temperature" and "dew/apparent/.." gauges are linked, so they show the same range. If the Apparent temp goes over 40 then both gauges will rescale. During thr day your apparent temperature is quite a bit higher than your actual temperature I suspect?


Return to “Customisation”

Who is online

Users browsing this forum: No registered users and 1 guest