Please read the posts in the Announcements section about the current status of Cumulus development now that I have retired

Please read this post before posting

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See this post for download

Trend arrow Javascript

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderators: daj, TNETWeather

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

Re: Trend arrow Javascript

Postby steve » Mon Nov 15, 2010 8:55 am


Yes, that too. My slightly autistic nature only lets me process one problem at a time :lol:
Steve
-----
Hosting available for Cumulus web sites. See http://sandaysoft.com/forum/viewtopic.php?f=2&t=11876

Please read the posts in the Announcements section about the current status of Cumulus development since I have retired from my day job

User avatar
mcrossley
Posts: 5192
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Trend arrow Javascript

Postby mcrossley » Mon Nov 15, 2010 9:01 am

Ditto - I hadn't spotted the decimal issue! :lol:

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

Re: Trend arrow Javascript

Postby steve » Mon Nov 15, 2010 9:02 am

steve wrote:You can use the web tags which replace the comma with a decimal point,

Actually, there doesn't seem to be one for temperature trend. The standard gauges page uses <#temptrendtext> and <#temptrendtextenglish>
Steve
-----
Hosting available for Cumulus web sites. See http://sandaysoft.com/forum/viewtopic.php?f=2&t=11876

Please read the posts in the Announcements section about the current status of Cumulus development since I have retired from my day job

User avatar
mcrossley
Posts: 5192
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Trend arrow Javascript

Postby mcrossley » Mon Nov 15, 2010 9:07 am

Which is why is it easier to reanme the images steady.png, rising.png, falling.png and then just use...

Code: Select all

<img src="xxxxx\<#temptrendtextenglish>.png" alt="<#temptrendextenglish>" />


(typing on a wobbly train - apologies for mistakes)

corsair
Posts: 5
Joined: Tue Nov 09, 2010 10:38 am
Weather Station: Davis Vantage Pro 2
Operating System: Win Seven

Re: Trend arrow Javascript

Postby corsair » Mon Nov 15, 2010 9:19 am

mcrossley wrote:Which is why is it easier to reanme the images steady.png, rising.png, falling.png and then just use...

Code: Select all

<img src="xxxxx\<#temptrendtextenglish>.png" alt="<#temptrendextenglish>" />


(typing on a wobbly train - apologies for mistakes)

Did the rename to www, no luck! Sorry but I don't understand this... How can I use it? Strange thing that I use same syntax from Station Sensor Led, few lines below, that works perfect...

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

Re: Trend arrow Javascript

Postby steve » Mon Nov 15, 2010 9:25 am

Because of this (my very first answer).

var temp = +1,5;
Steve
-----
Hosting available for Cumulus web sites. See http://sandaysoft.com/forum/viewtopic.php?f=2&t=11876

Please read the posts in the Announcements section about the current status of Cumulus development since I have retired from my day job

Synewave
Posts: 642
Joined: Mon Jan 25, 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Trend arrow Javascript

Postby Synewave » Mon Nov 15, 2010 10:07 am

Corsair,

As Mark and Steve have said, it is probably better to use the <#temptrendtext> as the comma as the decimal seperator will cause it to fail. You could write some Javascript to replace the , with a . but this way will be much easier:

Locate this line in your indexT.htm file:

Code: Select all

<td><#temp>&nbsp;<#tempunit></td>

and replace it with:

Code: Select all

<td><#temp>&nbsp;<#tempunit> <img src="images/<#temptrendtext>.png" alt="<#temptrendext>" /></td>


You will also need to rename your up and down arrow images as follows:

up.png becomes Rising.png
down.png becomes Falling.png

These images will need to be in your images folder on your website.

corsair
Posts: 5
Joined: Tue Nov 09, 2010 10:38 am
Weather Station: Davis Vantage Pro 2
Operating System: Win Seven

Re: Trend arrow Javascript

Postby corsair » Mon Nov 15, 2010 10:31 am

THANK YOU, all for your instructions... With Paul's step by step info, I manage it! Thank you Paul! BTW, excellent site! Great job for Great College!! :clap: :clap: If you don't mind, I will ask you for more info about History data in your page!

Synewave
Posts: 642
Joined: Mon Jan 25, 2010 1:55 pm
Weather Station: Watson W-8681
Operating System: Raspian
Location: Brighton, UK
Contact:

Re: Trend arrow Javascript

Postby Synewave » Mon Nov 15, 2010 10:41 am

Corsair,

Glad to see you've got it working. Just had a look at your images folder, although I didn't say so before, you will also need a Steady.png file in your images folder.

Thanks for the compliment about my website.

corsair
Posts: 5
Joined: Tue Nov 09, 2010 10:38 am
Weather Station: Davis Vantage Pro 2
Operating System: Win Seven

Re: Trend arrow Javascript

Postby corsair » Tue Nov 16, 2010 7:01 am

Thank you again Paul. Was there but with small "s"... :lol: Good morning from sunny :evil: Athens

mitmania
Posts: 33
Joined: Tue Feb 07, 2012 11:51 am
Weather Station: WS2350 & Davis VP2
Operating System: Win 7
Location: Italy
Contact:

Re: Trend arrow Javascript

Postby mitmania » Tue Jun 09, 2015 8:44 pm

Hi .... wonder where he constantly make mistakes ... I rewrote the same code 10 times but I do not see anything on Safari or Chrome .... thanks!

<!-- Temperatura_1_linea -->
<tr class="td_temperature_data">
<td><font size="2">Temperatura esterna</font></td>
<td><#temp>&nbsp;<#tempunit><script type="text/javascript">
var temp = <#temptrend>;
if (temp==0){var imagen = "steady.bmp";}
if (temp>0){var imagen = "up.bmp";}
if (temp<0){var imagen = "down.bmp";}
document.write('<img src="http://piavemeteo.altervista.org/images/'+imagen+'"/>');
</script></td>
<td><font size="2">Dew point</font></td>
<td><#dew>&nbsp;<#tempunit></td>
</tr>

User avatar
beteljuice
Posts: 2469
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Trend arrow Javascript

Postby beteljuice » Wed Jun 10, 2015 12:25 am

Because of all the comments above !!!!!

Currently your Cumulus processed script says:
var temp = -1,7;

COMMA decimal delimiter .....
So the maths comparrisons do not work correctly.

As above, use #temptrendenglish method instead.
Image
......................Imagine, what you will KNOW tomorrow !

mitmania
Posts: 33
Joined: Tue Feb 07, 2012 11:51 am
Weather Station: WS2350 & Davis VP2
Operating System: Win 7
Location: Italy
Contact:

Re: Trend arrow Javascript

Postby mitmania » Wed Jun 10, 2015 10:42 am

Ok !!!!!!!!

dazza1223
Posts: 371
Joined: Sun Jan 25, 2015 8:41 pm
Weather Station: Davis Vantage Vue
Operating System: raspberry pi 3
Location: worthing
Contact:

Re: Trend arrow Javascript

Postby dazza1223 » Sun Jan 28, 2018 1:17 am

Can i use them so it auto refresh the icon with out refresh the page to get the icon to up date


Return to “Web site - General”

Who is online

Users browsing this forum: No registered users and 5 guests