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 4019) - 03 April 2024

Legacy Cumulus 1 release 1.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

Pressure as displayed in wconsole.php

Discussion and questions about Cumulus weather station software version 1. This section is the main place to get help with Cumulus 1 software developed by Steve Loft that ceased development in November 2014.
Post Reply
tmabell
Posts: 25
Joined: Sat 07 Mar 2015 12:25 am
Weather Station: Vantage Pro II
Operating System: Windows 7
Location: Indiana

Pressure as displayed in wconsole.php

Post by tmabell »

Using wconsole.php with Cumulus 1.9.4 the pressure reading is displayed with three places after the decimal. For example... 30.215 in

Is there a way to eliminate the thousandths place to just display it this way? 30.21 in
Thank you
User avatar
steve
Cumulus Author
Posts: 26701
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Pressure as displayed in wconsole.php

Post by steve »

I don't think there's an option in Cumulus 1 to reduce the number of decimal places for Davis stations (I can't remember and can't easily look at the code at the moment). I don't know what wconsole.php is, but I think your only option would be to modify the code to do what you want. Someone who knows what wconsole.php is may be able to reply with something that's actually helpful to you.
Steve
tmabell
Posts: 25
Joined: Sat 07 Mar 2015 12:25 am
Weather Station: Vantage Pro II
Operating System: Windows 7
Location: Indiana

Re: Pressure as displayed in wconsole.php

Post by tmabell »

This is it: http://wiki.sandaysoft.com/a/WeatherConsole

It was a user contribution but I dn't know who the devolper is or how to reach him/her.
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: Pressure as displayed in wconsole.php

Post by sfws »

tmabell wrote:It was a user contribution but I dOn't know who the devEolper is or how to reach him/her.
That Wiki article has author as David Jamieson, who is still a contributor, but I believe his JavaScript will simply output the figure as it appears in your realtime.txt file.
As far as I am aware, the simplest way in Javascript to implement your requirement is to multiply by 100, round that number, and then divide by 100.
Using jQuery library software as David does in WeatherConsole/wconsole.js (in code below where it says

Code: Select all

// DO NOT change anything below here.
) find :

Code: Select all

$("#pressure").html(rawdata[10]+" "+rawdata[15]);
and change to

Code: Select all

$("#pressure").html( (Math.round(100 * rawdata[10]) /100) +" "+rawdata[15]);
tmabell
Posts: 25
Joined: Sat 07 Mar 2015 12:25 am
Weather Station: Vantage Pro II
Operating System: Windows 7
Location: Indiana

Re: Pressure as displayed in wconsole.php

Post by tmabell »

Thank you for the replies. Problem solved!
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Pressure as displayed in wconsole.php

Post by mcrossley »

sfws wrote: and change to

Code: Select all

$("#pressure").html( (Math.round(100 * rawdata[10]) /100) +" "+rawdata[15]);
Roughly, doesn't work for some edge cases. Try say 32.675 or 32.745. :?
tmabell
Posts: 25
Joined: Sat 07 Mar 2015 12:25 am
Weather Station: Vantage Pro II
Operating System: Windows 7
Location: Indiana

Re: Pressure as displayed in wconsole.php

Post by tmabell »

A friend found that this works well:

Add this:
var newpress = Number(rawdata[10]).toFixed(2);

Change this:
$("#pressure").html(rawdata[10]+" "+rawdata[15]);

to this:
$("#pressure").html(newpress+" "+rawdata[15]);
Post Reply