Page 1 of 1

Add Storm Rain to Rain Gauge Tooltip

Posted: Wed 05 Apr 2017 7:33 pm
by Herbaldew
In the last couple weeks I have managed to:

-Drop tenths from wind speed and temp gauge LCD's
-Darkened the green average wind "wedge" and the red wedges in all to match the daker red color of the hi/low pressure and theoretical solar max wedges.
-Changed layout of the gauges page
-Figured out how to make the "Other Temps" gauge load my choice by default
-Added Storm Rain to the web templates (easy) and to two of the interface pages (tougher as I had to create entries rather than just edit existing code)
-Purchased and setup a Raspberry Pi to include an Apache web server

That leaves my wish list with three items. I would prefer the amount of minor ticks in the wind scale to equal the amount of numbers between the major ticks. Has been discussed here already so I know that isn't happening.

Most of the gauges have an "Arrow Head" to show the high for the day or a shaded wedge to show the range for the day. Rainfall stays at it's amount until it resets at midnight. The exception is the UV Index - would like for the highest segment that illuminates during the day to stay there to indicate the high until it resets at midnight - I have know clue if or how this could be done so not obesessing on this one either.

The last item is to add "Storm Total" to the tool tip of the rain gauge. I *think* this would be relatively simple. I *think* this would require adding an entry to gaugefeed.js, language.min.js and gauges.js. The entry to the first two files seem straight forward and simple but I have experimented with trying to figure out what to add to gauges.js for several hours and am lost and defeated.

Can anyone offer any advice on how to accomplish this?


TIA - Herb

Re: Add Storm Rain to Rain Gauge Tooltip

Posted: Wed 05 Apr 2017 11:05 pm
by mcrossley
Herb,

You will have to switch the UV gauge to a regular pointer gauge to put a 'max' marker on, the LED gauges do not support that functionality.

Adding storm total, just add the required value to the JSON data file template realtimegaugesT.txt.
Then in rain gauge code that creates the "tip" string, refer to the value as "data.<what_ever_you_called_it_in_the_json_file>"
You can use hard coded strings for the surrounding text if you do not use multiple languages - if you do, then yes you will have to add new strings to language.js and re-minimise it.

Re: Add Storm Rain to Rain Gauge Tooltip

Posted: Fri 07 Apr 2017 1:47 pm
by Herbaldew
Thanks for the instructions. I have given up on adding the tooltip. Adding it to the JSON was no problem but I just can't get my head wrapped around the gauges.js entry.

UV Gauge: I couldn't find anything about switching to a pointer gauge. I experimented and found that changing:

Code: Select all

ssGauge = new steelseries.RadialBargraph('canvas_uv', params);

to:

Code: Select all

ssGauge = new steelseries.Radial('canvas_uv', params);
changed it to a pointer gauge. I also added:

Code: Select all

params.maxMeasuredValueVisible = true;
and that seems to have turned on the max arrow head. However I have two issues - first there is a red arrow head pointing out that I have no idea about. It is at the "5" in the screenie attached, but if I change the scale it moves to the halfway point. Second, the max arrow doesn't go to max but instead follows the pointer.

EDIT: I just noticed....the max pointer does stay at the high during constant operation - it just isn't going to the high during initialization.

I wanted to change the rain gauge to pointer as well but when I delete "Bargraph" as I did for the UV gauge, the gauge page loads and displays but will not receive data.

Any further advice?

Thanks again

Image

Re: Add Storm Rain to Rain Gauge Tooltip

Posted: Fri 07 Apr 2017 2:25 pm
by mcrossley
The Radial gauges take different (and more) parameters from the RadialBargraphs.

The pointer at the midpoint is the "threshold" indicator, you will want to disable that in the init params...
thresholdVisible: false,

To make the UV max indicator reflect today's high, you will need to add a call to .setMaxMeasuredValue() using today's high UV value.

Re: Add Storm Rain to Rain Gauge Tooltip

Posted: Fri 07 Apr 2017 5:15 pm
by Herbaldew
Image

:D :D :D :D :D Thanks!

I wanted to change the rain gauge to pointer as well but when I delete "Bargraph" as I did for the UV gauge, the gauge page loads and displays but will not receive data.
Any clues for this? I thought it would be simple beings there is no max arrow to deal with.

TIA

Re: Add Storm Rain to Rain Gauge Tooltip

Posted: Fri 07 Apr 2017 7:38 pm
by Herbaldew
Got it sorted ... found in another post that I had to remove:

Code: Select all

gaugeRain.gauge.setGradient(gaugeRain.data.grad);
Thanks again!

Image

Re: Add Storm Rain to Rain Gauge Tooltip

Posted: Sat 08 Apr 2017 5:59 pm
by mcrossley
Great, glad you got it all working. Maybe I'll add "all pointer gauges" as an option at some point as a few people like the consistent look...

Re: Add Storm Rain to Rain Gauge Tooltip

Posted: Mon 10 Apr 2017 1:15 pm
by Herbaldew
Herbaldew wrote:I have given up on adding the tooltip
And back to the subject of this post...I "un"gave up.

Image

Persistence has paid off 8-)

Re: Add Storm Rain to Rain Gauge Tooltip

Posted: Mon 10 Apr 2017 2:33 pm
by mcrossley
8-) - I'd forgotten about that one!