Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 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

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

How to put beaufort text into banner.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
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

How to put beaufort text into banner.php?

Post by William Grimsley »

Hi Steve/others,

I've been trying to put beaufort text instead of beaufort number into the banner.php file.

Currently, I have the beaufort number showing.

In the cvalues area of the banner.php, I currently have this:

Code: Select all

// Current field names (matches tag fields) used
$SITE['cvalues'] = array(
    "date","time","temp","hum","dew","wspeed","wgust","avgbearing","rrate",
    "rfall","press","wdir","beaufort","windunit","tempunit","pressunit","rainunit",
    "windrun","presstrend","rmonth","ryear","rfallY","intemp","inhum","wchill",
    "temptrendval","tempTH","TtempTH","tempTL","TtempTL",
    "windTM","TwindTM","wgustTM","TwgustTM",
    "pressTH","TpressTH","pressTL","TpressTL",
    "cversion","cbuild");
I tried changing:

Code: Select all

"wdir","beaufort","windunit"
To (I had put the <#beaudesc> web tag in the realtime.txt file):

Code: Select all

"wdir","beaudesc","windunit"
But, that made all the other units except humidity display different units.

Please can someone help?

Thanks,

William
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: How to put beaufort text into banner.php?

Post by steve »

I suspect it's because the beaufort description can be more than one word, so can get parsed as separate items. Try putting quotes around the web tag in your custom realtime.txt file - "<#beaudesc>". I don't know whether that will work because I don't know enough about the PHP "explode" function (which splits the line up).

If it doesn't work, you could change the delimeter in your realtime.txt file to something like "|" instead of space, and then change the code in banner.php:

Change

// Read data into array
$DATA = get_raw($SITE['hloc'] . $SITE['datafile'],' ');

to

// Read data into array
$DATA = get_raw($SITE['hloc'] . $SITE['datafile'],'|');

Anything else which uses your custom realtime.txt file would have to cope with that change too, of course.
Steve
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: How to put beaufort text into banner.php?

Post by William Grimsley »

Hi Steve,

Ok, it looks like what you said about the banner.php file, works. But, now my realtime.txt file has stopped updating. :(

Thanks for your help,

William
User avatar
steve
Cumulus Author
Posts: 26672
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: How to put beaufort text into banner.php?

Post by steve »

A possibly better way occurs to me: go back to using the beaufort number, put an array of descriptions in the PHP, and use the number to index the array.
Steve
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: How to put beaufort text into banner.php?

Post by William Grimsley »

steve wrote:A possibly better way occurs to me: go back to using the beaufort number, put an array of descriptions in the PHP, and use the number to index the array.
:?:
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: How to put beaufort text into banner.php?

Post by William Grimsley »

Ok, this what I have changed back to, so far.

In the realtime.txt file:

Code: Select all

<#date format=dd/mm/yy> <#timehhmmss> <#temp> <#hum>% <#dew> <#wspeed> <#wlatest> <#bearing> <#rrate> <#rfall> <#press> <#currentwdir> <#beaufortnumber> <#windunit> <#tempunitnodeg> <#pressunit> <#rainunit> <#windrun> <#presstrendval> <#rmonth> <#ryear> <#rfallY> <#intemp> <#inhum> <#wchill> <#temptrend> <#tempTH> <#TtempTH> <#tempTL> <#TtempTL> <#windTM> <#TwindTM> <#wgustTM> <#TwgustTM> <#pressTH> <#TpressTH> <#pressTL> <#TpressTL> <#version> <#build> <#wgust> <#heatindex> <#humidex> <#UV> <#ET> <#SolarRad> <#avgbearing> <#rhour> <#forecastnumber> <#isdaylight> <#SensorContactLost> <#wdir> <#cloudbasevalue> <#cloudbaseunit> <#apptemp> <#SunshineHours> <#CurrentSolarMax> <#IsSunny> 
In the banner.php file:

Code: Select all

$DATA = get_raw($SITE['hloc'] . $SITE['datafile'],' ');
And:

Code: Select all

$SITE['cvalues'] = array(
    "date","time","temp","hum","dew","wspeed","wgust","avgbearing","rrate",
    "rfall","press","wdir","beaufort","windunit","tempunit","pressunit","rainunit",
    "windrun","presstrend","rmonth","ryear","rfallY","intemp","inhum","wchill",
    "temptrendval","tempTH","TtempTH","tempTL","TtempTL",
    "windTM","TwindTM","wgustTM","TwgustTM",
    "pressTH","TpressTH","pressTL","TpressTL",
    "cversion","cbuild");
And:

Code: Select all

$text = ret_value("beaufort");
Now, what do I do?
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: How to put beaufort text into banner.php?

Post by beteljuice »

You could try posting in the banner thread, or you could try doing what Steve said ....

Declare a descriptive array

Code: Select all

/* Beaufort 0 to 12 in array */
$langBeaufort = Array ( 
 "Calm", "Light Air", "Light Breeze", "Gentle Breeze", "Moderate Breeze", "Fresh Breeze",
 "Strong Breeze", "Near Gale", "Gale", "STRONG GALE", "STORM",
 "VIOLENT STORM", "HURRICANE"
);

// then your 'look-up'
$text = $langBeaufort[ret_value("beaufort")];
Image
......................Imagine, what you will KNOW tomorrow !
User avatar
William Grimsley
Posts: 833
Joined: Thu 22 Sep 2011 5:22 pm
Weather Station: Davis Vantage Vue
Operating System: Windows 7 Home Premium 64-bit
Location: Latitude: 50.70189285 Longitude: -3.30849957
Contact:

Re: How to put beaufort text into banner.php?

Post by William Grimsley »

beteljuice wrote:You could try posting in the banner thread, or you could try doing what Steve said ....

Declare a descriptive array

Code: Select all

$langBeaufort = Array ( 
"Calm", "Light Air", "Light Breeze", "Gentle Breeze", "Moderate Breeze", "Fresh Breeze",
 "Strong Breeze", "Near Gale", "Gale", "STRONG GALE", "STORM",
 "VIOLENT STORM", "HURRICANE"
);

// then your 'look-up'
$text = $langBeaufort[ret_value("beaufort")];
Hi beteljuice,

Thanks very much! Your fix worked! :D

All I've done is changed:

Code: Select all

$langBeaufort = Array ( 
"Calm", "Light Air", "Light Breeze", "Gentle Breeze", "Moderate Breeze", "Fresh Breeze",
 "Strong Breeze", "Near Gale", "Gale", "STRONG GALE", "STORM",
 "VIOLENT STORM", "HURRICANE"
);
To:

Code: Select all

/* Beaufort 0 to 12 in array */
$langBeaufort = Array ( 
"Calm", "Light air", "Light breeze", "Gentle breeze", "Moderate breeze", "Fresh breeze",
 "Strong breeze", "Near gale", "Gale", "Strong gale", "Storm",
 "Violent storm", "Hurricane"
);
So, that the beaufort scale texts match up with the Cumulus beaufort scale texts! :D

Thanks,

William
Last edited by William Grimsley on Tue 16 Apr 2013 6:53 am, edited 1 time in total.
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: How to put beaufort text into banner.php?

Post by beteljuice »

The capitalization of the last four descriptions was to reinforce their severity.
ie. Don't go out and batten down the hatches !
Image
......................Imagine, what you will KNOW tomorrow !
Post Reply