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 4017) - 17 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

Now available: AJAX/PHP multilingual website templates

Discussion of Ken True's web site templates

Moderator: saratogaWX

BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by BCJKiwi »

OK,
Getting real confused here.
Steve,
I have no idea of the steps involved in the process of getting a forecast form a Davis console into Cumulus. I gather your response means that the Davis documentation and sentences pulled from the .bin file in the console firmware are not what the console actually delivers when the sentences are combined into a forecast via the forecast number mechanism.
All the documentation I have seen relating to Davis forecast strings shows them in ALL CAPITALS without full stops.

Manuel and now Mark are showing lists in mixed case. Manuel's list has full stops at the end of every sentence, Marks has some sentences with full stops and some without. The Tags contain UCfirst sentences, some with full stops, some without but I don't see a list of these anywhere in the Wiki so am working blind.

Ken's function is designed around the existence of the full stops to avoid the need for all 160+ variations to be parsed by parsing the individual sentences on the full stops. Mark's list has 50 sentences and the one I posted previously has 42!

Mark,
Where does your list come from?
I note it has 8 more sentences than the info I was working from,
It is in normal case with UCfirst and some sentences have full stops and some don't.

Without a definitive list of each sentence, it is difficult to proceed. If some sentences have full stops and some not, then unless Ken (or someone else more knowledgeable in these matters than I), comes up with a different parsing technique that does not rely on the full stops, either
his approach will have to be abandoned in favour of listing all the variations,
or
all the combinations of sentences without stops will have to be combined with all the following sentences.

I really don't care what is coming from where or in what format - just want to be sure I'm working with the right data before I rehash it all again.

Thanks
User avatar
mcrossley
Posts: 12689
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by mcrossley »

BCJKiwi wrote:Mark,
Where does your list come from?
I note it has 8 more sentences than the info I was working from,
It is in normal case with UCfirst and some sentences have full stops and some don't.
I extracted the list directly from the vantagepro.dll file the Cumulus uses. I have not altered the case or added or removed any full stops. I suspect the strings without stops are designed to be concatenated with other strings - most of them had a space character at the end of the string.
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by steve »

The consoles only display the forecasts that you can extract from the firmware binary file. They do not make the text available for software to read. They make the 'rule number' available for software to read, and it's up to the software to turn that into text.

In the case of Cumulus, it uses the Vantagepro.dll, which Davis supply, to communicate with the console. The DLL does not make the 'rule number' available to software which uses it. The DLL makes a text forecast available to software which uses it. The strings it uses to create those forecasts are the ones Mark quoted; Mark extracted them from the DLL. I did the same myself earlier today, but Mark beat me to posting them. Cumulus doesn't get the 'fragments' of forecast, it gets the whole forecast after the DLL has combined one or more of those strings. I don't know what algorithm the DLL uses to combine the strings. I don't know whether the DLL uses the 'rule number' from the console, or whether it has its own forecast algorithm built in. There is no documentation from Davis about the forecast strings produced by the DLL. Cumulus just reads them and passes them on.

The forecast which the DLL produces appears to be the same as the forecast displayed on the console at any given time, with the exception of the case and (possibly) the punctuation, and (as I have pointed out a couple of times recently) apparently also sometimes the wind directions, which it seems to modify sometimes based on the console's location. I don't know whether the consoles do the same modification.
Steve
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by BCJKiwi »

Thanks, Steve,
That makes it much clearer and also explains why the variations exist.

I have just combined Marks list with the one I posted earlier and now have 55 sentences!

I have to go earn some money right now but will work up the complete list as best I can and submit it for review.

Hopefully Ken can advise If there is a way to handle the mix of sentences with and without full stops.
User avatar
mcrossley
Posts: 12689
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by mcrossley »

Well, the way I would do would be to do a regex match and replace on each of those 50 'fragments', leaving the wind directions untranslated (but possibly relocated). Then do a regex match and replace on the compass points to translated values.

Probably not the most efficient method, I'm sure Ken can adapt his routines to do something better.
User avatar
PaulMy
Posts: 3775
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by PaulMy »

saratogaWX wrote:The gauges-ss-basic-inc.php page is included with Mark's distribution starting at the 2.2.0 version. It is not included with the CU-plugin.zip (or the Base-*.zip) for the AJAX/PHP templates .. it is only in the Steel-Series Gauges distribution.
Hi Ken,
I downloaded Mark's latest v.2.2.3 and uploaded the gauges-ss-basic-inc.php into the root where all the wx-template files are.
The wxssgauges.php has the following
if(! file_exists($ssgDir."gauges-ss-basic-inc.php")) {
print "<!-- Steel Series Gauges template (gauges-ss-basic-inc.php) not found in $ssgDir. ".
"Using default HTML for gauges. -->\n";
gen_default_html($ssgDir);

} else {
include_once($ssgDir."gauges-ss-basic-inc.php");
}
The View Source from the running ss-gauges page has
<!-- Steel Series Gauges template (gauges-ss-basic-inc.php) not found in /. Using default HTML for gauges. -->
<!-- default HTML is being used -->
Could I /should I edit the wxssgauges.php so that the gauges-ss-basic-inc.php can be found and what would that be? I.e. with a leading . (dot)?

Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm

Image
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

Paul,

The wxssgauges.php page has one setting

Code: Select all

############################################################################
# Required setting:
#
$ssgDir = './ssg/'; // set to relative directory location of the SteelSeries gauge directory
#
Set the value of $ssgDir to be the relative directory location of where you put the SteelSeries distribution (and keep the trailing / ).

Best regards,
Ken
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by BCJKiwi »

@ Mark, Steve;

I've attached the revised list for insertion into language-xx.txt
Have removed the list from the post above (with note there to that effect).

It contains the sentences in your post Mark plus I added some for E to go with the W - no idea if they will get used. The 'extra' ones I seemed to have were duplicates/combined sentences.

Since there appears not to be a definitive list of all the combinations that the DLL can produce, unless someone can come up with an improved system (way beyond me I'm afraid), the sentences without '.' that are combined with ones that do have a '.' will need to be added to the list as they are identified (when they don't translate).

Have added the one I know about already ;)
You do not have the required permissions to view the files attached to this post.
User avatar
PaulMy
Posts: 3775
Joined: Sun 28 Sep 2008 11:54 pm
Weather Station: Davis VP2 Plus 24-Hour FARS
Operating System: Windows8 and Windows10
Location: Komoka, ON Canada
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by PaulMy »

Hi Ken and Mark,
I uploaded the gauges-ss-basic-inc.php after the suggested setting changes all is working well, actually very well!
http://www.komokaweather.ca [Almanac] (SS Live Gauges)

Thank you for all your help and guidance again,
Paul
Davis Vantage Pro2+
C1 www.komokaweather.com/komokaweather-ca
MX www.komokaweather.com/cumulusmx/index.htm /index.html /index.php
MX www.komokaweather.com/cumulusmxwll/index.htm /index.html /index.php
MX www. komokaweather.com/cumulusmx4/index.htm

Image
User avatar
actioman
Posts: 118
Joined: Sat 20 Mar 2010 1:01 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows XP SP3
Location: Elvas, Portugal
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by actioman »

BCJKiwi wrote:@ Mark, Steve;

I've attached the revised list for insertion into language-xx.txt
Have removed the list from the post above (with note there to that effect).

It contains the sentences in your post Mark plus I added some for E to go with the W - no idea if they will get used. The 'extra' ones I seemed to have were duplicates/combined sentences.

Since there appears not to be a definitive list of all the combinations that the DLL can produce, unless someone can come up with an improved system (way beyond me I'm afraid), the sentences without '.' that are combined with ones that do have a '.' will need to be added to the list as they are identified (when they don't translate).

Have added the one I know about already ;)
Thank you again for all the work done!

I added these strings, it seems to me missing:

Code: Select all

langlookup|Increasing winds|Increasing winds|
langlookup|Precipitation ending within 12 hours possible wind shift to the W, NW, or N|Precipitation ending within 12 hours possible wind shift to the W, NW, or N|
langlookup|Precipitation ending within 12 hours possible wind shift to the W, SW, or S|Precipitation ending within 12 hours possible wind shift to the W, SW, or S|
langlookup|Precipitation ending within 12 hours possible wind shift to the E, NE, or N|Precipitation ending within 12 hours possible wind shift to the E, NE, or N|
langlookup|Precipitation ending within 12 hours possible wind shift to the E, SE, or S|Precipitation ending within 12 hours possible wind shift to the E, SE, or S|
langlookup|Precipitation likely.|Precipitation likely.|
I noticed that appears "likely" and "likley", this last word must be an error of Davis, no?

I think today towards the end of the day I will have it all translated into Portuguese and then I'll test.
If everything is working, then I will do the translation into Spanish. If any Spanish colleague, want to take a look around and can fix, we appreciate! ;)

And Ken, what do you think of these improvements, do you agree?
Is there anything we're forgetting?

Thanks!
Kind Regards, Manuel.

Image
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

I think your approach is fine.

There do seem to be typos built-in to the phrases returned, and there may be differences between the VP1, VP2 and Vue phrases (capitalization, punctuation and some misspellings). I'm not sure we have a comprehensive list to cover all the Davis Vantage and Vue stations yet. I do have an (ancient) VP1, so I can test the VP1 output :)

Best regards,
Ken
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by BCJKiwi »

Ken,
It seems to me that we are on a hiding to nothing if we (you ;) ) can't work out a way to work on the basic sentences without relying on the '.'

I think your concept of using the base sentences is great but the reliance on the '.' when quite a few sentences do not have one means that we will need to keep adding more and more combined sentences.
e.g. the 'Precipitation ending ...' sentences added by actionman are combinations of two existing sentences.
If the actual strings are matched disregarding the '.' then the '.'s can be added in the substitute string wherever one wishes.

Also the breakdown could be extended as there are significant repetitions in the existing sentences. There is a limit of course as it wouldn't make sense to break the sentences into phrases that won't read properly in different languages when recombined.

Actionman, 'Increasing winds' and 'Precipitation likely' are both in the last list I published.
User avatar
mcrossley
Posts: 12689
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by mcrossley »

Am I missing something here?

But the forecast available to Cumulus only comes from the DLL, and the DLL only contains the text strings I posted above. So the forecasts can only be some combination of those strings. Yes?

What the forecast strings are on the consoles is irrelevant, that text is never sent to the monitoring programs, just a forecast number to DLL. So all those strings can be ignored.

However the DLL *may* switch the wind directions in some of the messages to create some other variants.
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by saratogaWX »

BCJKiwi wrote:Ken,
It seems to me that we are on a hiding to nothing if we (you ;) ) can't work out a way to work on the basic sentences without relying on the '.'

I think your concept of using the base sentences is great but the reliance on the '.' when quite a few sentences do not have one means that we will need to keep adding more and more combined sentences.
e.g. the 'Precipitation ending ...' sentences added by actionman are combinations of two existing sentences.
If the actual strings are matched disregarding the '.' then the '.'s can be added in the substitute string wherever one wishes.

Also the breakdown could be extended as there are significant repetitions in the existing sentences. There is a limit of course as it wouldn't make sense to break the sentences into phrases that won't read properly in different languages when recombined.

Actionman, 'Increasing winds' and 'Precipitation likely' are both in the last list I published.
You're correct that with the posted code, conditions without a ending period wouldn't be processed correctly.
Try changing:

Code: Select all

   if(strpos($Cond,'.') !==false) {  // split into sentences for processing
      $vals = explode(".",$Cond.'.');
   }
to just

Code: Select all

  // split into sentences for processing
    $vals = explode(".",$Cond.'.');
By appending a '.' to the string, there will always be a period (or two) and later processing will remove the null sentence (and extra period) if needed.
User avatar
actioman
Posts: 118
Joined: Sat 20 Mar 2010 1:01 am
Weather Station: Davis Vantage Pro2 Plus
Operating System: Windows XP SP3
Location: Elvas, Portugal
Contact:

Re: Now available: AJAX/PHP multilingual website templates

Post by actioman »

Ken I already tested and does not work. Some phrases are translated but most are not ...

http://www.meteoelvas.com/wxvpforecasttest.php

For example at the moment Davis has a simple forecast sentence "Mostly clear and warmer.", but it's not translated ...

BCJKiwi where do you get strings like this?
"Mostly cloudy, Rain and/or snow possible or continuing"
Kind Regards, Manuel.

Image
Post Reply