Author Topic: $heatcolourword  (Read 3751 times)

0 Members and 1 Guest are viewing this topic.

Offline lddaly

  • Forecaster
  • *****
  • Posts: 490
$heatcolourword
« on: December 28, 2009, 09:31:19 AM »
When my page initially loads, it displays 28.8F Uncomfortably Cold, which is the current WD value (conditionscolour.jpg). But at the first AJAX update, the screen changes to Cold. Where is the new value coming from? I am using Webster Weather's dashboard alternative 4.20.

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: $heatcolourword
« Reply #1 on: December 28, 2009, 05:29:06 PM »
When you say "initially loads", are you referring to the initial values before all of the current ajax variables are updated after a second or two of loading? If so, I believe the initial values are just the recently cached values in your browser. The new updated values are pulled from clientraw.txt and testtags.php...


Here is some more info if you need it, you can adjust the conditionscolour.jpg temperatures here:

In Weather Display click the menu item "Control Panel" >> then click "Summary Image & Icons" >> click on the tab "Thresholds to Set Icon/Conditions Colour" >>Then on the bottom right of the "Thresholds to Set Icon/Conditions Colour" screen click the button that says "Set thresholds for the conditionscolour.jpg"

The actual value (Uncomfortably Cold or Cold etc.) resides in testtags.php in the variable named $heatcolourword ...
« Last Edit: December 28, 2009, 05:43:40 PM by eldoradowx »
-Danny
-root is everything

Offline lddaly

  • Forecaster
  • *****
  • Posts: 490
Re: $heatcolourword
« Reply #2 on: December 28, 2009, 08:09:30 PM »
The initial value displayed on the page match's the current testtags.php value. It looks like the value updated with ajaxWDwx.js in the "function to add colored heatColorWord" section is incorrect (off by one word).

My Conditioncolour.jpg threshold settings are default. Here are the sections from ajaxWDwx.js

Code: [Select]
var langHeatWords = new Array (
 'Unknown', 'Extreme Heat Danger', 'Heat Danger', 'Extreme Heat Caution', 'Extremely Hot', 'Uncomfortably Hot',
 'Hot', 'Warm', 'Comfortable', 'Chilly', 'Cool', 'Cold', 'Very Cold', 'Extremely Cold', 'Dangerously Cold' );

Code: [Select]
function heatColor(temp,WindChill,Humidex) {
  var hcWord = langHeatWords[0];
 if (temp > 32 && Humidex > 29) {
  if (Humidex > 54) { return ('<span style="border: solid 1px; color: white; background-color: #BA1928;">&nbsp;'+langHeatWords[1]+'&nbsp;</span>'); }
  if (Humidex > 45) { return ('<span style="border: solid 1px; color: white; background-color: #E02538;">&nbsp;'+langHeatWords[2]+'&nbsp;</span>'); }
  if (Humidex > 39) { return ('<span style="border: solid 1px; color: black; background-color: #E178A1;">&nbsp;'+langHeatWords[4]+'&nbsp;</span>'); }
  if (Humidex > 29) { return ('<span style="border: solid 1px; color: white; background-color: #CC6633;">&nbsp;'+langHeatWords[6]+'&nbsp;</span>'); }
 } else if (WindChill < 16 ) {
  if (WindChill < -18) { return ('<span style="border: solid 1px; color: black; background-color: #91ACFF;">&nbsp;'+langHeatWords[13]+'&nbsp;</span>'); }
  if (WindChill < -9)  { return ('<span style="border: solid 1px; color: white; background-color: #806AF9;">&nbsp;'+langHeatWords[12]+'&nbsp;</span>'); }
  if (WindChill < -1)  { return ('<span style="border: solid 1px; color: white; background-color: #3366FF;">&nbsp;'+langHeatWords[11]+'&nbsp;</span>'); }
  if (WindChill < 8)   { return ('<span style="border: solid 1px; color: white; background-color: #6699FF;">&nbsp;'+langHeatWords[10]+'&nbsp;</span>'); }
  if (WindChill < 16)  { return ('<span style="border: solid 1px; color: black; background-color: #89B2EA;">&nbsp;'+langHeatWords[9]+'&nbsp;</span>'); }
 }  else if (WindChill >= 16 && temp <= 32) {
  if (temp < 26) { return ('<span style="border: solid 1px; color: black; background-color: #C6EF8C;">&nbsp;'+langHeatWords[8]+'&nbsp;</span>'); }
  if (temp <= 32) { return ('<span style="border: solid 1px; color: black; background-color: #CC9933;">&nbsp;'+langHeatWords[7]+'&nbsp;</span>'); }
  }
  return hcWord;
}

Do the langHeatWords variables start numbering with 0 or 1?

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: $heatcolourword
« Reply #3 on: December 28, 2009, 09:34:06 PM »
I believe in the array world 0 is the first value. so in this array 'unknown' is value 0.

There are 13 real variables on WD.  There are 11 in Ken's array.

So I dont think its "off by one word"  I think Ken has made a judgement call, that -1 is not Uncomfortably cold, its just plain Cold.   cool has swapped too.  Loosk like he got rid of uncomfortably hot as well.

Andrew

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline lddaly

  • Forecaster
  • *****
  • Posts: 490
Re: $heatcolourword
« Reply #4 on: December 28, 2009, 10:41:33 PM »
Thanks Andrew. I made changes to better match what I have configured in WD. I started looking into this as a result of visitor feedback submitted through my site. They did not think mid 30's was "Cool", more like "Dang Cold". It is Texas after all :lol:.

blackjack52

  • Guest
Re: $heatcolourword
« Reply #5 on: December 28, 2009, 10:48:26 PM »
I recently changed my variables, to include swapping cool and cold. I also added descriptors.
Quote
  var hcWord = langHeatWords[0];
 if (temp > 30 && Humidex > 27) {
  if (Humidex > 43) { return ('<span style="border: solid 1px; color: white; background-color: #BA1928;">&nbsp;'+langHeatWords[1]+'&nbsp;</span>'); } //Extreme Heat Danger
  if (Humidex > 40) { return ('<span style="border: solid 1px; color: white; background-color: #E02538;">&nbsp;'+langHeatWords[2]+'&nbsp;</span>'); } //Heat Danger
  if (Humidex > 37) { return ('<span style="border: solid 1px; color: black; background-color: #E178A1;">&nbsp;'+langHeatWords[4]+'&nbsp;</span>'); } //Ext hot
  if (Humidex > 27) { return ('<span style="border: solid 1px; color: white; background-color: #CC6633;">&nbsp;'+langHeatWords[6]+'&nbsp;</span>'); } //hot
 } else if (WindChill < 16 ) {
  if (WindChill < -13) { return ('<span style="border: solid 1px; color: black; background-color: #91ACFF;">&nbsp;'+langHeatWords[13]+'&nbsp;</span>'); } //extremely cold
  if (WindChill < -5)  { return ('<span style="border: solid 1px; color: white; background-color: #806AF9;">&nbsp;'+langHeatWords[12]+'&nbsp;</span>'); }//v cold
  if (WindChill < 5)  { return ('<span style="border: solid 1px; color: white; background-color: #3366FF;">&nbsp;'+langHeatWords[11]+'&nbsp;</span>'); } //cold
  if (WindChill < 11)   { return ('<span style="border: solid 1px; color: white; background-color: #6699FF;">&nbsp;'+langHeatWords[10]+'&nbsp;</span>'); } //chilly
  if (WindChill < 16)  { return ('<span style="border: solid 1px; color: black; background-color: #89B2EA;">&nbsp;'+langHeatWords[9]+'&nbsp;</span>'); } //cool
 }  else if (WindChill >= 16 && temp <= 30) {
  if (temp < 23) { return ('<span style="border: solid 1px; color: black; background-color: #C6EF8C;">&nbsp;'+langHeatWords[8]+'&nbsp;</span>'); } //comfortable
  if (temp <= 30) { return ('<span style="border: solid 1px; color: black; background-color: #CC9933;">&nbsp;'+langHeatWords[7]+'&nbsp;</span>'); } //warm
  }
  return hcWord;

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: $heatcolourword
« Reply #6 on: December 28, 2009, 10:57:37 PM »
Its all relative.  It would be "cool" to add some seasonality to it.  Here.... 8 degrees (C) in July is Cold for a high, cool for a low, but 8 degrees in January is downright balmy, skiing in shorts etc.

I just found a new flag in WD that was not turned on... thanks to this post.  My page just showed - - - until the first ajax load.  So thanks for asking this question....

Andrew
« Last Edit: December 28, 2009, 10:59:17 PM by mackbig »

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: $heatcolourword
« Reply #7 on: December 29, 2009, 01:53:20 AM »
I just found a new flag in WD that was not turned on... thanks to this post.  My page just showed - - - until the first ajax load.  So thanks for asking this question....

Andrew

Where?

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

Offline mackbig

  • Forecaster
  • *****
  • Posts: 4128
    • Mackie's Main Street, Unionville, ON Canada Weather
Re: $heatcolourword
« Reply #8 on: December 29, 2009, 09:27:44 AM »
Pat,
control panel - internet file creation and upload - file #15.

Set file creation time (if using 3rd party ftp), ftp timer as well if using WD ftp...

Andrew


Where?

Andrew - Davis VP2+ 6163, serial weatherlink, wireless anemometer, running Weather Display.  Boltek PCI Stormtracker, Astrogenic Nexstorm, Strikestar - UNI, CWOP CW8618, GrLevel3, (Station 2 OS WMR968, VWS 13.01p09), Windows 7-64

Offline Cienega32

  • Forecaster
  • *****
  • Posts: 2635
    • East Mesa Weather
Re: $heatcolourword
« Reply #9 on: December 29, 2009, 04:02:26 PM »
Oh yeah... the one that's right in front of me (as long as I put on my reading glasses  ](*,) )

Thanks, Andrew!

Pat ~ Davis VP2 6153-Weatherlink-Weather Display-StartWatch-VirtualVP-Win7 Pro-64bit
www.LasCruces-Weather.com   www.EastMesaWeather.com

 

anything