Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Default Gauge Scale

Share your Cumulus MX user interface here

Moderator: mcrossley

Post Reply
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Default Gauge Scale

Post by Phil23 »

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.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
User avatar
mcrossley
Posts: 12692
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Default Gauge Scale

Post by mcrossley »

Phil, is this on the MX interface, or the web page?
User avatar
mcrossley
Posts: 12692
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Default Gauge Scale

Post by mcrossley »

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

Line 106+
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Default Gauge Scale

Post by Phil23 »

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
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
User avatar
mcrossley
Posts: 12692
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Default Gauge Scale

Post by mcrossley »

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: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Default Gauge Scale

Post by Phil23 »

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.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
User avatar
mcrossley
Posts: 12692
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Default Gauge Scale

Post by mcrossley »

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: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Default Gauge Scale

Post by Phil23 »

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.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Default Gauge Scale

Post by Phil23 »

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.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
Phil23
Posts: 884
Joined: Sat 16 Jul 2016 11:59 pm
Weather Station: Davis VP2+ & GW1000 (Standalone)
Operating System: Win10 Pro / rPi Buster
Location: Australia

Re: Default Gauge Scale

Post by Phil23 »

Also read this post,

https://cumulus.hosiene.co.uk/viewtopic.php?t=14863

Don't think it's relevant. Not sure, as I'm seeing 0-45.
:Now: :Today/Yesterday:

Image

Main Station Davis VP2+ Running Via Win10 Pro.
Secondary Stations, Ecowitt HP2551/GW1000 Via rPi 3 & 4 Running Buster GUI.
:Local Inverell Ecowitt Station: :Remote Ashford Ecowitt Station:
User avatar
mcrossley
Posts: 12692
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Default Gauge Scale

Post by mcrossley »

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?
Post Reply