Author Topic: FIXED : Weird Steel Gauges problem (I'm stupid)  (Read 25717 times)

Tailspin45

  • Gentle Breeze
  • **
  • Posts: 45
    • EW0995
    • KCACARLS17
    • Carlsbad Science and Technology Observatory
  • Station Details: Davis 6250, 6520 USB logger, iMac, Evocam
FIXED : Weird Steel Gauges problem (I'm stupid)
« on: June 16, 2013, 04:37:43 PM »
Running latest Saratoga scripts and V2.4.2 of Steel Gauges at http://www.carlsbadwx.com/wxgauges.php. (Full credits on 'About' page.)

Integrated the html into a PHP page (attached) and it works fine except the Fahrenheit/Centigrate radio buttons seem to be ignored.

If I load the page and select F, temps are okay; but after first reload it goes to C. If I select C, temps go to negative C values, if I select F they go to F but revert to C on next reload.

realtimeguageWC.txt has units and temp in F

Code: [Select]
"date":"17/06/13",
"timeUTC":"2013,6,17,14,23,22",
"SensorContactLost":"0",
"forecast":"Current forecast is -- Increasing clouds with little temperature change. --",
"tempunit":"°F",
"windunit":"MPH",
"pressunit":"inHg",
"rainunit":"in",
"temp":"61.7",


Spent several hours trying to debug this using ?debug=y and ?show=settings without success.

So, hat in hand, I'm here hoping someone can spot my problem.
Tailspin Tommy
http://carlsbadwx.com


UncleBuck

  • Strong Breeze
  • ***
  • Posts: 114
    • IVICTORI276
    • Point Cook Weather
  • Station Details: Oregon WMR200, MAC OS X 10.10, WeatherCat V2
Re: Weird Steel Gauges glitch
« Reply #1 on: June 20, 2013, 01:21:30 AM »
Not sure if this is the problem BUT I don't believe your gauges.js file should look like this.
Notice the strange character in the data.tempunit = , this could be what is causing your script to behave a bit odd as mine just has ?C and ?F

Code: [Select]
        setTempUnits = function (celcius) {
            if (celcius) {
                data.tempunit = '°C';
                _temp.sections = createTempSections(true);
                _temp.minValue = gauge.tempScaleDefMinC;
                _temp.maxValue = gauge.tempScaleDefMaxC;
                _dew.sections = createTempSections(true);
                _dew.minValue = gauge.tempScaleDefMinC;
                _dew.maxValue = gauge.tempScaleDefMaxC;
            } else {
                data.tempunit = '°F';
                _temp.sections = createTempSections(false);
                _temp.minValue = gauge.tempScaleDefMinF;
                _temp.maxValue = gauge.tempScaleDefMaxF;
                _dew.sections = createTempSections(false);
                _dew.minValue = gauge.tempScaleDefMinF;
                _dew.maxValue = gauge.tempScaleDefMaxF;
            }
[\code]

Tailspin45

  • Gentle Breeze
  • **
  • Posts: 45
    • EW0995
    • KCACARLS17
    • Carlsbad Science and Technology Observatory
  • Station Details: Davis 6250, 6520 USB logger, iMac, Evocam
Re: Weird Steel Gauges glitch
« Reply #2 on: June 20, 2013, 01:46:37 AM »
Thanks for the quick response, Colonel.

I saw that weird character on my gauges and assumed it was because the HTML character set was specified incorrectly.

But now, looking at gauges.js on the site with BBEDit, it don't see the character either! It only seems to show online.

Code: [Select]
setTempUnits = function (celcius) {
            if (celcius) {
                data.tempunit = '?C';
                _temp.sections = createTempSections(true);
                _temp.minValue = gauge.tempScaleDefMinC;
                _temp.maxValue = gauge.tempScaleDefMaxC;
                _dew.sections = createTempSections(true);
                _dew.minValue = gauge.tempScaleDefMinC;
                _dew.maxValue = gauge.tempScaleDefMaxC;
            } else {
                data.tempunit = '?F';
                _temp.sections = createTempSections(false);
                _temp.minValue = gauge.tempScaleDefMinF;
                _temp.maxValue = gauge.tempScaleDefMaxF;
                _dew.sections = createTempSections(false);
                _dew.minValue = gauge.tempScaleDefMinF;
                _dew.maxValue = gauge.tempScaleDefMaxF;

I wonder if the way I've embedded the code in the Saratoga PHP template page has done it? I'll look at the top.php and header.php files and see if there's a hint there.
Tailspin Tommy
http://carlsbadwx.com


mcrossley

  • Gale
  • ****
  • Posts: 273
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: Davis VP2 + home brew
Re: Weird Steel Gauges glitch
« Reply #3 on: June 20, 2013, 12:17:59 PM »
Ken created an updated header PHP for the gauges that formats the page as HTML5 and UTF-8. I don't use his templates so I don't know the details, but you should investigate that.
Mark

Tailspin45

  • Gentle Breeze
  • **
  • Posts: 45
    • EW0995
    • KCACARLS17
    • Carlsbad Science and Technology Observatory
  • Station Details: Davis 6250, 6520 USB logger, iMac, Evocam
Re: Weird Steel Gauges glitch
« Reply #4 on: June 21, 2013, 10:16:56 PM »
Thanks Mark, I have installed all of Ken's new header files (and top.php, and common.php, etc).

I've gone back and made sure that all Ken's script are up to date, that I have latest version of the gauges, that WeatherCat is sending the right info (v1.2) and that everything is installed properly. But something is clearly out of whack.

The key symptom is that the UTF-8 functions are being ignored as evidenced by an ? (C3 85) before the temp gauge units. Everything else seems to work except the units radio-buttons selection are reset to Centigrade on each new data update. (Actually the buttons don't change, but the gauge display reverts to Centigrade).

I've tried to follow the process using Apple developer tools in Safari, but not being a developer I'm fascinated by, but ignorant of, what it's trying to tell me.

Oddly, the same problem occurs even with the included .htm file.
Tailspin Tommy
http://carlsbadwx.com


jf-i2r

  • Strong Breeze
  • ***
  • Posts: 150
  • Station Details: vantage pro2 wireless with solar sensor ; weatherlink-ip ;mac mini 1,6ghz 2go ram El Capitan
Re: Weird Steel Gauges glitch
« Reply #5 on: June 22, 2013, 08:06:51 AM »
very nice web site Tommy  [tup]

i use Saratoga template and gauges too

cheers
jean frederic

mcrossley

  • Gale
  • ****
  • Posts: 273
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: Davis VP2 + home brew
Re: Weird Steel Gauges glitch
« Reply #6 on: June 22, 2013, 07:00:10 PM »
Tommy, your gauges page is still in xhtml format...
Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

Other Saratoga ss-gauges pages I look at at in html 5 format...
Code: [Select]
<!DOCTYPE html>
<html lang="en">

I think this is what Kens updates addressed - with dynamic UTF-8 on-the-fly conversion for the other existing ISO-8859-n translation files (.txt, .js)
Mark

Tailspin45

  • Gentle Breeze
  • **
  • Posts: 45
    • EW0995
    • KCACARLS17
    • Carlsbad Science and Technology Observatory
  • Station Details: Davis 6250, 6520 USB logger, iMac, Evocam
Re: Weird Steel Gauges glitch
« Reply #7 on: June 22, 2013, 07:03:34 PM »
Exactly, Mark. But for the life of me I can't figure out why it isn't using UTF-8. I have all of Ken's updates, installed and re-installed, and tried his wxssgauges.php page but it shows the same thing.
Tailspin Tommy
http://carlsbadwx.com


Tailspin45

  • Gentle Breeze
  • **
  • Posts: 45
    • EW0995
    • KCACARLS17
    • Carlsbad Science and Technology Observatory
  • Station Details: Davis 6250, 6520 USB logger, iMac, Evocam
Re: Weird Steel Gauges glitch
« Reply #8 on: June 22, 2013, 07:19:39 PM »
FIXED!

I went back through everything and verified the files are where they should be, everything was properly customized. But everything looked right, and I didn't change a thing.

So I loaded up Ken's wxssgauges.php just make sure what I said in my previous message about his page not working was true -- BUT IT WORKED!

WTF, says I. Guess I better check my page against his. Identical.

So I looked at my page... AND IT WORKED!

I have no explanation. Super moon, karma, just holding my tongue right, perhaps?

Anyway I'm happy now, and I appreciate everyone's contribution.

You know the saying, "I'd rather be lucky than good?" Seems to apply here. I warned you this was weird.

And I'm gonna smack the next person that tells me computers and software are deterministic.
Tailspin Tommy
http://carlsbadwx.com


mcrossley

  • Gale
  • ****
  • Posts: 273
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: Davis VP2 + home brew
Re: FIXED (by magic): Weird Steel Gauges glitch
« Reply #9 on: June 22, 2013, 09:40:25 PM »
Hmm, your page still doesn't work for me :( ?
Mark

Tailspin45

  • Gentle Breeze
  • **
  • Posts: 45
    • EW0995
    • KCACARLS17
    • Carlsbad Science and Technology Observatory
  • Station Details: Davis 6250, 6520 USB logger, iMac, Evocam
Re: FIXED (by magic): Weird Steel Gauges glitch
« Reply #10 on: June 22, 2013, 09:43:45 PM »
Cached page? Still works fine here.
Tailspin Tommy
http://carlsbadwx.com


ELO

  • Gentle Breeze
  • **
  • Posts: 75
    • KCOBRECK14
    • Weather in the Highlands
  • Station Details: Old Davis WMII, Heated Rain Collector, Mac Mini
Re: FIXED (by magic): Weird Steel Gauges glitch
« Reply #11 on: June 23, 2013, 12:54:07 AM »
I hate to say it, but it's not fixed for me either... I've attached a screenshot of what I'm seeing as of 4:43pm. I hit my browser refresh several times to assure I wasn't using a cached page to no avail. Tried it in both Chrome & Safari.

Heck if I know what's going on for you. I don't use the Saratoga templates on my site, but the gauges themselves work just fine (wx.oshlo.net). Somewhere there is a mismatch between the ?F and ?C settings in addition to the "A" character on the two gauge faces themselves. Have you tried completely re-downloading a fresh set of Mark's Steel Gauges files, making the few needed Weathercat and file location changes and then uploading the full new set of scripts to your site? I'm just shooting in the dark here...

Rick

Tailspin45

  • Gentle Breeze
  • **
  • Posts: 45
    • EW0995
    • KCACARLS17
    • Carlsbad Science and Technology Observatory
  • Station Details: Davis 6250, 6520 USB logger, iMac, Evocam
Re: FIXED (by magic): Weird Steel Gauges glitch
« Reply #12 on: June 23, 2013, 02:41:10 AM »
...Have you tried completely re-downloading a fresh set of Mark's Steel Gauges files, making the few needed Weathercat and file location changes and then uploading the full new set of scripts to your site? I'm just shooting in the dark here...

Dang, another one! Yes, I've downloaded and installed the Steel Gauges and Ken's files several times.

What perplexes me now is that I see them working fine and you don't!

Gadzooks, there's spooks!
Tailspin Tommy
http://carlsbadwx.com


Tailspin45

  • Gentle Breeze
  • **
  • Posts: 45
    • EW0995
    • KCACARLS17
    • Carlsbad Science and Technology Observatory
  • Station Details: Davis 6250, 6520 USB logger, iMac, Evocam
Re: FIXED (by magic)...OR NOT: Weird Steel Gauges glitch
« Reply #13 on: June 23, 2013, 03:04:19 AM »
So I tried it in Crome and Firefox. Both broken. Trash cache, reload, quit and restart. Doesn't work.

Safari? Works great. Trash cache, reload, quit and restart...works great.


 [banghead]
Tailspin Tommy
http://carlsbadwx.com


Tailspin45

  • Gentle Breeze
  • **
  • Posts: 45
    • EW0995
    • KCACARLS17
    • Carlsbad Science and Technology Observatory
  • Station Details: Davis 6250, 6520 USB logger, iMac, Evocam
Re: (NOT) FIXED : Weird Steel Gauges glitch
« Reply #14 on: June 23, 2013, 01:50:55 PM »
Well, this morning mine doesn't work either.

Checked weather before I went to bed, gauges worked great.

 [bed]

Came in this morning and they behave as before, showing Centigrade when Fahrenheit is selected and showing the ? character.
Tailspin Tommy
http://carlsbadwx.com