Author Topic: Question for mcrossley (Steel Gauges genius)  (Read 1906 times)

xairbusdriver

  • Storm
  • *****
  • Posts: 2392
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.14.4/WC 3.0.4
Question for mcrossley (Steel Gauges genius)
« on: April 17, 2015, 03:33:09 AM »
First, I must say I am amazed at your skills and talents! [tup] [cheer]

I spent a good deal of time today looking at various sites using your Steel Gauges. However, I found one minor problem in all of the ones I viewed:
  • nowaitweather.com/
  • oshlo.net/
  • timberlakesutah.com/
  • randysweatheronthehill.com/
  • weather.hoke.org/
  • avon-weather.com/
The ‘timer’ display 'canvas' is just a wee bit too narrow, maybe only ~10 pixels, at least for the chosen font (which also seems to be a default). The tens digit is being almost completely hidden. The only way I recognized that there was another digit in there was that things didn't change the first two time the timer hit "zero". It wasn't really at "zero", it was at "20" and then "10".  :P

I have never ever tried learning javascript; eventual failures, of various degrees,
with Microsoft Basic for the first Macs (that small screen was a real P-i-t-B!)/Pascal/C(
and C++ via Xcode)/PHP/ discouraged me from even looking at it. I must sayjs
has also had a somewhat checkered past, even though that may have been
caused by confusion with Java and it's favor with advertisers. I do have a fair
amount of experience with HTML5 and CSS3 and their predecessors.

My first idea to change the ‘timer’ display was to look for some CSS that could be used to set the width of this canvas item in EMs. Alas, W3C states that the attributes (width and height) are both required and must be set in non-negative integers (pixels). So much for editing the CSS. ::)

I am now jumping into the ‘fire’ by assuming the following:
“canvas” has been assigned an ‘ID’ to make it available to javascript. My solution seems to be to edit the “width” value when I eventually get around to creating my own weather page.

Is my assumption valid?
Or even close?

mcrossley

  • Strong Breeze
  • ***
  • Posts: 244
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: WH1090
Re: Question for mcrossley (Steel Gauges genius)
« Reply #1 on: April 17, 2015, 02:11:53 PM »
Hmm, I see both digits on those sites in both IE 11 and Chrome (42) on Windows 7. Do you have a 'large font' setting enabled somewhere on your system?

Answer to you other question, yes you can rescale using CSS, but not resize. You can resize using JS. but you would have to do it before the canvas is drawn. I don't think the graphics will rescale properly if the canvas is resized after the initial draw.

Simplest way is just to set the canvas width in your source HTML.
Mark

xairbusdriver

  • Storm
  • *****
  • Posts: 2392
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.14.4/WC 3.0.4
Re: Question for mcrossley (Steel Gauges genius)
« Reply #2 on: April 17, 2015, 03:42:53 PM »
Quote
Simplest way is just to set the canvas width in your source HTML.
That's what I meant as my "solution".

Quote
Hmm, I see both digits on those sites in both IE 11 and Chrome (42) on Windows 7.
Of course you do! That's why it doesn't bother you. :D And maybe no one else, for that matter! Testing in multiple browsers is a real pain.

I do have a minimum of 14 point text in Safari; aging eyes... but points, EMs, and pixels are different things. If the 'canvas' box is set it pixels (which is the only choice), the points/EMs/user choices and even the zooming functions of a browser are irrelevant. Too bad 'canvas' can't be more flexible. OTOH, it may make it easier to use when the most of a page is fluid.

No problem, you've confirmed my method of fixing my site on my browser.  [cheer] No other things matter to me! [blush] [lol]

BTW, thanks for such a quick response! A mark of a concerned developer!

mcrossley

  • Strong Breeze
  • ***
  • Posts: 244
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: WH1090
Re: Question for mcrossley (Steel Gauges genius)
« Reply #3 on: April 17, 2015, 03:56:16 PM »
Yep, Canvas is rooted in pixels, SVG would be more flexible, but I don't fancy the work in porting it!
Mark

xairbusdriver

  • Storm
  • *****
  • Posts: 2392
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.14.4/WC 3.0.4
Re: Question for mcrossley (Steel Gauges genius)
« Reply #4 on: April 21, 2015, 12:06:24 AM »
WeatherCat Steel Gauges users and/or Mark:

More stupid questions!

I've managed to get the basic Steel Gauges uploaded to a site I already had. However, I already have a directory called "images" which holds (wait for it!) all the images for that live site. Obviously, I don't want WeatherCat or your scripts to replace anything in that images folder. More importantly, I don't want the whole directory to be replaced; that would almost completely destroy my current 50+ page site!

As I examine the directory structure of your scripts, I think WC/Steel Gauges will create new images (based on the "realtimegaugesWC.txt" file?) in the "/web_server/images/" location. If so, I need not worry about my images in my root-level "images" directory.

Questions:
Am I correct in the safety of two different "images" directories, since they are in different paths?
What is the point in changing the './images/' to './' as described in the Trixology Steel Gauges Wiki.

I am not allowing WC to actually upload any new data (realtimegaugesWC.txt) to my site until I get an answers to these questions. 8)

Thanks!

mcrossley

  • Strong Breeze
  • ***
  • Posts: 244
  • Sorry, I'm not a WeatherCat user!
    • ICHESHIR25
    • Wilmslow Astro Weather
  • Station Details: WH1090
Re: Question for mcrossley (Steel Gauges genius)
« Reply #5 on: April 21, 2015, 09:11:51 AM »
The scripts don't create anything in the images folder, it is just picking up the images created by WC.
Mark

wurzelmac

  • Storm
  • *****
  • Posts: 1251
    • ITIROLPR2
    • Wetterstation Prägraten am Großvenediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini Mid 2011 2,7 GHz Intel Core i7 with 12 GB of RAM | 1x Canon EOS 1300D | macOS 10.14.6 Mojave
Re: Question for mcrossley (Steel Gauges genius)
« Reply #6 on: April 21, 2015, 10:07:39 AM »
Hello xairbusdriver,

have you ever thought about putting all your weather-related uploads into a separate folder "weather" or something similar onto your web server? You can point all WeatherCat uploads to this folder and nothing else in your web server structure will be touched or affected.

Cheers,
Reinhard
Reinhard


xairbusdriver

  • Storm
  • *****
  • Posts: 2392
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.14.4/WC 3.0.4
Re: Question for mcrossley (Steel Gauges genius)
« Reply #7 on: April 21, 2015, 04:52:34 PM »
Quote from: Mark
The scripts don't create anything in the images folder, it is just picking up the images created by WC
Thanks, for the info. I was not intending to imply that your scripts would do any harm to my currently live, non-weather site. I'll stop bugging you... for a while, anyway! :)

Quote from: Felix
have you ever thought about putting all your weather-related uploads into a separate folder "weather" or something similar onto your web server?
That's what I've done. The folder is named "steel", quite original, no? [rolleyes2] And the directory structure on the site is the same as on my drive.

Part of the problem is that I first tried to use a 'sub domain' on my web space. That appeared to be option 2 in the Wiki. That plan never seemed to work, even though my .htaccess file seemed to allow it; it probably didn't, but I wasn't sure how to change it, so I fell back to option 1.

At that point, I became concerned about the edits to the "imgPathURL". However, I have reviewed the path/relative path details and I think the edit is correct (it would certainly have been discussed by now, if not! [banghead] ).

The edit in gauges.js is simply setting a variable that is used by other scripts, to build the actual path to the images. The script with that 'call' for the image is not in gauges.js itself, or even the directory it resides in. I'm sure if I took the time to trace those 'calls', I would end up in the "steel" directory. Javascript is mostly Greek translated into Latin and converted by Babel.com!

My ignorance of what does what (WC and/or the Steel Gauges scripts) helps confuse me. I may need to change my 'location' to show that 'state', BTW. [blush]

wurzelmac

  • Storm
  • *****
  • Posts: 1251
    • ITIROLPR2
    • Wetterstation Prägraten am Großvenediger
  • Station Details: Davis Vantage PRO2 Plus (24h fan aspirated, wireless) with UV/Solar | Weather Envoy Data Logger | Mac mini Mid 2011 2,7 GHz Intel Core i7 with 12 GB of RAM | 1x Canon EOS 1300D | macOS 10.14.6 Mojave
Re: Question for mcrossley (Steel Gauges genius)
« Reply #8 on: April 21, 2015, 05:36:10 PM »
Part of the problem is that I first tried to use a 'sub domain' on my web space. That appeared to be option 2 in the Wiki. That plan never seemed to work, even though my .htaccess file seemed to allow it; it probably didn't, but I wasn't sure how to change it, so I fell back to option 1.

I think there is no need to use a sub-domain in option 2 in the Wiki (although I do have a subdomain that is pointing on the index.html file in my weather folder). If you have the same structure as I am using, you should do with "/" for the image path and "/realtimegaugesWC.txt" for the text-file (see attached). At least for me it is working.

Cheers,
Reinhard
(alias  :o Felix)
Reinhard


Blicj11

  • Storm
  • *****
  • Posts: 3292
    • EW3808
    • KUTHEBER6
    • Timber Lakes Utah
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP™ Data Logger | iMac (late 2013), 3.5 GHz Intel Core i7, 24 GB RAM, macOS Mojave | Sharx SCNC2900 Webcam | Supportive Wife
Re: Question for mcrossley (Steel Gauges genius)
« Reply #9 on: April 21, 2015, 06:34:11 PM »
Xair:

Back to your original question about the width of the countdown window. The countdown number is just two digits. It does not have a decimal point (tenths) element. I am curious as to what you are seeing there. Did you get it to display properly on your browser?
Blick


xairbusdriver

  • Storm
  • *****
  • Posts: 2392
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.14.4/WC 3.0.4
Re: Question for mcrossley (Steel Gauges genius)
« Reply #10 on: April 21, 2015, 08:31:20 PM »
Quote
It does not have a decimal point (tenths) element. I am curious as to what you are seeing there. Did you get it to display properly on your browser?
I meant to say the "tens" digit; 34, 20, 12, etc. The root problem was my prefs for Safari being a minimum font size of 14 points. Reducing that to 12 enabled all the digits to appear, but, of course, made many sites un-readable for my aging eyes.

There are several ways to correct this. I simply edited <canvas id="canvas_timer" width: ...> to 85 (which must be a positive integer pixel value). That allows the width to be wide enough to see the two numbers, even with my preferred font size. Anyone viewing my page will probably never notice the loss of 15 pixels of screen real estate. ;D

I also converted the "font-size" attributes to em values or percentages of the base em size in every place I could find in the CSS files. Unfortunately, the "canvas" html5 property is not capable of dynamic or even font measurements. A div would be nice, but the use of javascript may force the use of 'canvas'.

I've been extremely busy and very frustrated getting a version of Word on my wife's laptop. She occasionally needs to edit .doc files, sometimes even on her iPad. M$ now has a $7/mon "service" that allows Word (via DropBox) on the iPad, iPhone (who would possible want to create/edit something on that?!), and her MBP. I was finally able to find a real person to 'chat' with at MS and I then realized (without their help, of course) that what she needed was not called "Word" but "OneDrive for Mac". [banghead] I can only hope this is the last time I ever have to deal with MS... :-X

Blicj11

  • Storm
  • *****
  • Posts: 3292
    • EW3808
    • KUTHEBER6
    • Timber Lakes Utah
  • Station Details: Davis Vantage Pro2 Plus | WeatherLinkIP™ Data Logger | iMac (late 2013), 3.5 GHz Intel Core i7, 24 GB RAM, macOS Mojave | Sharx SCNC2900 Webcam | Supportive Wife
Re: Question for mcrossley (Steel Gauges genius)
« Reply #11 on: April 22, 2015, 05:26:10 AM »
Ha ha! We should all be grateful for Windoze. If it hadn't been so bad, there would never have been a need (or room) for Steve Jobs. And it's not like Apple never put out a clunker product. Look at how many iterations of iCloud we've gone through starting with MobileMe and its still not working all that great.
Blick


xairbusdriver

  • Storm
  • *****
  • Posts: 2392
    • EW7115 (E7115)
    • KTNGERMA20
    • Mid-South Weather
  • Station Details: Davis VP2 wireless + remote Anemometer/2014 Mac min - 10.14.4/WC 3.0.4
Re: Question for mcrossley (Steel Gauges genius)
« Reply #12 on: April 22, 2015, 05:06:06 PM »
Don't forget iTools back in 2000! And even eWorld before that!!

Technology is often hard for large corporations to understand. I was working for FedEx when they introduced "ZapMail". Principally supported by a fellow who went on to create Netscape, it was supposed to revolutionize communications. Most of my group recognized it as nothing more than a FAX machine. [naghead] Now the FAX function comes on even low priced printers; it's not usually the primary reason any printer is purchased. It's a technology that has come and is almost gone. OTOH, we still have a land line phone! [blush]