cloudy

Author Topic: Cloud Height Graphic v2.1  (Read 80471 times)

0 Members and 2 Guests are viewing this topic.

Offline Meerkat

  • Rainer
  • Posts: 695
  • WD v10.37Q b31, Win 7, HP 2 Core 4GB, 72hr UPS
  • Pretoria, South Africa
    • Bashewa
Re: Cloud Height Graphic (released)
« Reply #15 on: May 02, 2009, 08:00:45 AM »
Hi, thanks for the script, sadly mines giving me an error with regards to the language
side of things and i dont use and other language, just English, any ideas please?

http://www.northantsweather.com/cloud-base.php?uom=M&html=1

Have you perhaps got a "common.php" file in your root?
It should have a langtransstr() function in it.
I can fix it by checking for it.

EDIT: FIXED
« Last Edit: May 02, 2009, 12:05:04 PM by Rainer »
Cheers,
Rainer

Meerkat's Script Collection
Script download links always available on the first page of my threads

Offline Meerkat

  • Rainer
  • Posts: 695
  • WD v10.37Q b31, Win 7, HP 2 Core 4GB, 72hr UPS
  • Pretoria, South Africa
    • Bashewa
Re: Cloud Height Graphic (released)
« Reply #16 on: May 02, 2009, 08:04:16 AM »
Hi Rainer

Very nice script indeed.

But I get an error message about a "cb.jpeg" image that I can not find.

See here >  http://www.goranpettersson.se/cloud-base.php?uom=M&html=1

Regards
Göran

For some or other reason the script is not able to output the image to your disk.
You should have write permission on your root.
This one works fine: http://www.goranpettersson.se/cloud-base.php?uom=M
Cheers,
Rainer

Meerkat's Script Collection
Script download links always available on the first page of my threads

Offline Meerkat

  • Rainer
  • Posts: 695
  • WD v10.37Q b31, Win 7, HP 2 Core 4GB, 72hr UPS
  • Pretoria, South Africa
    • Bashewa
Re: Cloud Height Graphic (released)
« Reply #17 on: May 02, 2009, 08:07:13 AM »
Dam well done it is a very smooth and easy to configure script.

I only have one problem with showing the wind deg above the windsock.
Fatal error: Call to undefined function langtransstr() in C:\wamp\www\tok\cloud\cloud-base.php on line 641

Any suggestions

Code: [Select]
// Add wind direction text
if ($showWindDir) {
   $txtD  = langtransstr(windDEGtoDIR($winddir));
   $sizD = strlen($txtD)*imagefontwidth(3);
   imagestring ( $slate, 3, 86-round($sizD/2), 174, $txtD, $white);

Ok I'll fix that one too.

EDIT: FIXED
« Last Edit: May 02, 2009, 12:05:52 PM by Rainer »
Cheers,
Rainer

Meerkat's Script Collection
Script download links always available on the first page of my threads

Offline Meerkat

  • Rainer
  • Posts: 695
  • WD v10.37Q b31, Win 7, HP 2 Core 4GB, 72hr UPS
  • Pretoria, South Africa
    • Bashewa
Re: Cloud Height Graphic (released)
« Reply #18 on: May 02, 2009, 08:17:20 AM »
The language translation problems have been fixed.
Grab the new cloud-base.php V1.1 below.
« Last Edit: May 02, 2009, 11:42:03 AM by Rainer »
Cheers,
Rainer

Meerkat's Script Collection
Script download links always available on the first page of my threads

Offline Jose1701

  • Posts: 463
  • Germany
    • Wetter in Mülheim
Re: Cloud Height Graphic (released)
« Reply #19 on: May 02, 2009, 08:17:27 AM »
Thanks a lot for the great script. Works pretty.

Only that there were clouds shown but there aren't any. How can I correct that?

I set Metar to false but nothing worked.

Regards

Jose
WX Station Type OS WMR200 + UV + modified Solarunit

http://www.wetternet.org


Offline arthurhh

  • Tokoroa Weather Live
  • Posts: 369
  • IT Fixer
  • Tokoroa South Waikato New Zealand
    • Tokoroa Weather Live
Re: Cloud Height Graphic (released)
« Reply #20 on: May 02, 2009, 08:19:15 AM »
Bashy change the lines at 640 to the code below and it will work so long as you do not need language translations

Code: [Select]
// Add wind direction text
if ($showWindDir) {
   $txtD  = (windDEGtoDIR($winddir));
  //   $txtD  = ($winddir);          //gives wid dir by angle
   $sizD = strlen($txtD)*imagefontwidth(3);
   imagestring ( $slate, 3, 86-round($sizD/2), 174, $txtD, $white);
}

Offline Meerkat

  • Rainer
  • Posts: 695
  • WD v10.37Q b31, Win 7, HP 2 Core 4GB, 72hr UPS
  • Pretoria, South Africa
    • Bashewa
Re: Cloud Height Graphic (released)
« Reply #21 on: May 02, 2009, 08:23:37 AM »
Thanks a lot for the great script. Works pretty.

Only that there were clouds shown but there aren't any. How can I correct that?

I set Metar to false but nothing worked.

Regards

Jose

You will have to translate the strings below if WD reports the conditions in any other language other than English.
Look at your WD Solar/UV setup description for the actual strings.
   $sunny           = 'clear,sunny';                   // for sunny
   $partlycloudy    = 'partly cloudy,mostly clear';    // for some clouds
   $scattered       = 'scattered';                     // for clouds
   $mostlycloudy    = 'mostly cloudy,stopped raining'; // for many clouds
   $overcast        = 'cloudy,overcast,recent rain';   // for overcast
   $thunderclouds   = 'cumulonimbus,cumulus';
   $drizzle         = 'drizzle,shower';
   $raining         = 'rain,thunderstorm';
   $snowing         = 'snow,flurries';
   $misty           = 'mist,fog';
   $rainstopped     = 'recent rain,stopped raining,recent showers';
Cheers,
Rainer

Meerkat's Script Collection
Script download links always available on the first page of my threads

Offline Jose1701

  • Posts: 463
  • Germany
    • Wetter in Mülheim
Re: Cloud Height Graphic (released)
« Reply #22 on: May 02, 2009, 08:25:53 AM »
Thanks. I will look at it.
WX Station Type OS WMR200 + UV + modified Solarunit

http://www.wetternet.org


Offline Meerkat

  • Rainer
  • Posts: 695
  • WD v10.37Q b31, Win 7, HP 2 Core 4GB, 72hr UPS
  • Pretoria, South Africa
    • Bashewa
Re: Cloud Height Graphic (released)
« Reply #23 on: May 02, 2009, 09:59:08 AM »
VERSION HISTORY:
  02 May 2009 V1.0 First release.
  02 May 2009 V1.1 Fixed translation issue for non-multilingual web sites.
  02 May 2009 V1.2 Added "dry" to the "clear,sunny" match string.
                   Added German match strings ... please un-comment to use.

Grab the latest release for cloud-base.php below.
« Last Edit: May 02, 2009, 11:41:09 AM by Rainer »
Cheers,
Rainer

Meerkat's Script Collection
Script download links always available on the first page of my threads

Offline Meerkat

  • Rainer
  • Posts: 695
  • WD v10.37Q b31, Win 7, HP 2 Core 4GB, 72hr UPS
  • Pretoria, South Africa
    • Bashewa
Re: Cloud Height Graphic (released)
« Reply #24 on: May 02, 2009, 11:51:26 AM »
TRANSLATIONS FOR THE CLOUD MATCH
I have translated the following cloud condition match strings into German.
The best way to see what WD reports is in your clientraw.txt file.
If anybody does another language translation could you please post it here.

GERMAN TRANSLATION for the cloud condition match:
   $sunny           = 'klar,sonnig,trocken';                                       // for sunny
   $partlycloudy    = 'teilweise bewölkt,größtenteils klar,leicht bewölkt';     // for some clouds
   $scattered       = 'teilweise bewölkt';                                        // for clouds
   $mostlycloudy    = 'stark bewölkt,nach niederschlag';                          // for many clouds
   $overcast        = 'geschlossene wolkendecke,bewölkt,vor kurzem niederschlag'; // for overcast
   $thunderclouds   = 'cumulonimbus,cumulus';
   $drizzle         = 'niesel';
   $raining         = 'regen,gewitterregen';
   $snowing         = 'es schneit,schnee';
   $misty           = 'nebel';
   $rainstopped     = 'vor kurtzem,nach niederschlag';
Cheers,
Rainer

Meerkat's Script Collection
Script download links always available on the first page of my threads

Offline jmoriartey

  • Posts: 30
  • Leduc Alberta Canada
    • Leduc Weather
Re: Cloud Height Graphic (released)
« Reply #25 on: May 02, 2009, 12:09:25 PM »
Hi Rainer

Very nice script indeed.

But I get an error message about a "cb.jpeg" image that I can not find.

See here >  http://www.goranpettersson.se/cloud-base.php?uom=M&html=1

Regards
Göran

Create a file gb.jpeg  in the same directory as your could-base.php   "touch gb.jpeg" 
You may also have to set the permissions for the file depending on your server "chmod 644 gb.jpeg" 
Also you may have to the file cb.jpeg to the name.group the httpd is running under.

Offline tstorm

  • Posts: 370
  • Harpers Ferry, WV
    • Meadowbrook Farm Weather
Re: Cloud Height Graphic (released)
« Reply #26 on: May 02, 2009, 12:12:52 PM »
Working fine here (http://www.harpersferry-weather.com/cloud-base.php?uoe=M&html=1).  Thanks for the script.  I would love to get this into the dashboard in the Snow section (http://www.harpersferry-weather.com/wxindex.php).  I've tried several different things but I'm not very savy with php.  Can anyone provide me with the code needed to add into this area and what I would need to remove?

Thanks,

John

Offline jmoriartey

  • Posts: 30
  • Leduc Alberta Canada
    • Leduc Weather
Re: Cloud Height Graphic (released)
« Reply #27 on: May 02, 2009, 12:36:44 PM »
Rainer 
 
 
Fantastic script  easy to setup, now I have find a place to put it :)
I went to your site and was amazed at the WMR200 console (http://www.bashewa.com/wxconsoleWMR200.php)
As WMR200 owner I love that script I think most WMR200 owners would love that script too
Great work Thanks

Offline Rabbit66ca

  • Posts: 29
  • Cedar Hills - Surrey, BC Canada
Re: Cloud Height Graphic (released)
« Reply #28 on: May 02, 2009, 01:20:50 PM »
Working fine here (http://www.harpersferry-weather.com/cloud-base.php?uoe=M&html=1).  Thanks for the script.  I would love to get this into the dashboard in the Snow section (http://www.harpersferry-weather.com/wxindex.php).  I've tried several different things but I'm not very savy with php.  Can anyone provide me with the code needed to add into this area and what I would need to remove?

Thanks,

John

John,

You need to put
Code: [Select]
<img src="cloud-base.php?uom=E" height="200" width="100" border="0" />where you want to have the image located on your page.

If you want to replace the "Snow" section of your dashboard,  find
Code: [Select]
  if ($useSNOW) {  //  Show Snow
?>
              <tr>
                <td class="data1">Today: </td>
                <td style="text-align: right;" class="data1">
                   <?php
                      
if ($useCM
                          echo 
$snowtodaycm " CM";
                      else    
                          echo 
$snowtodayin $uomRain;
                   
?>

</td>
              </tr>
              <tr>
                <td class="data1">Yesterday:</td>
                <td style="text-align: right;" class="data1">
                    <?php
                      
if ($useCM
                          echo 
$snowyesterday " CM";
                      else    
                          echo 
$snowyesterday $uomRain;
                   
?>

</td>
              </tr>
              <tr>
                <td class="data1"><?php  echo $monthname ":" ?> </td>
                <td style="text-align: right;" class="data1">
                   <?php
                      
if ($useCM
                          echo 
$snowmonthcm "CM";
                      else    
                          echo 
$snowmonthin $uomRain;
                   
?>

                </td>
              </tr>
              <tr>
                <td class="data1">Season Total:<sup>2</sup></td>
                <td style="text-align: right;" class="data1">
                   <?php
                      
if ($useCM
                          echo 
$snowseasoncm " CM";
                      else    
                          echo 
$snowseasonin $uomRain;
                   
?>

</td>
              </tr>
              <tr>
                <td class="data1">Snow Depth: </td>
                <td style="text-align: right;" class="data1">
                   <?php
                      
if ($useCM
                          echo 
$snownowcm " CM";
                      else    
                          echo 
$snownowin $uomRain;
                   
?>

</td>
              </tr>
              <tr>
                <td class="data1" colspan="2" style="text-align: center;">
  <?php echo "$snowdaysthismonth snow day";
   $t = ($snowdaysthismonth 1)? 's':'';
   print "$t in " $monthname;
   ?>

                </td>
              </tr>
              <tr>
                <td class="data1" colspan="2" style="text-align: center;">
  <?php echo "$snowdaysthisyear snow day";
   $t = ($snowdaysthisyear 1)? 's':'';
   print "$t in all " $date_year .".";
   ?>

                </td>
              </tr>
<?php // end $useSNOW  ---------------------------------------- ?>
and replace it with something like
Code: [Select]
  if ($useSNOW) {  //  Show Snow
?>
              <tr>
                   <td><img src="cloud-base.php?uom=E" height="200" width="100" border="0" />
                   </td>
              </tr>
<?php // end $useSNOW  ---------------------------------------- ?>

Bashy

  • Guest
Re: Cloud Height Graphic (released)
« Reply #29 on: May 02, 2009, 02:00:45 PM »
Thanks for the update, now working, although i aint overly keen on having to have my root
set to write so i will move it to another dir update the settings to suit,

I aint sure but the my current conditions are showing as overcast, yet the image is mostly
cloudy, METAR is turned off as well so i aint sure where its getting mostly cloudy from?
http://www.northantsweather.com/cloud-base.php?uom=M&html=1